| 1 |
|
| 2 |
<HTML> |
| 3 |
<HEAD> |
| 4 |
<TITLE>XPA Communication Between Hosts</TITLE> |
| 5 |
</HEAD> |
| 6 |
<BODY> |
| 7 |
|
| 8 |
|
| 9 |
<H2><A NAME="xpainet">XPAInet: XPA Communication Between Hosts</A></H2> |
| 10 |
|
| 11 |
|
| 12 |
<H2>Summary</H2> |
| 13 |
XPA uses standard inet sockets to support communication between two or |
| 14 |
more host computers. |
| 15 |
|
| 16 |
|
| 17 |
<H2>Description</H2> |
| 18 |
<P> |
| 19 |
When the <A HREF="./method.html">Communication Method</A> is set to |
| 20 |
<B>inet</B> (as it is by default), XPA can be used to communicate |
| 21 |
between different computers on the Internet. INET sockets utilize the |
| 22 |
IP address of the given machine and a (usually random) port number to |
| 23 |
communicate between processes on the same machine or between different |
| 24 |
machines on the Internet. These standard Internet sockets are also |
| 25 |
used by programs such as Netscape, ftp. etc. |
| 26 |
|
| 27 |
<P> |
| 28 |
XPA supports a host-based <A HREF="./acl.html">Access Control</A> mechanism |
| 29 |
to prevent unauthorized access of XPA access points by other computers |
| 30 |
on the Net. By default, only the machine on which the XPA server is |
| 31 |
running can access XPA services. Therefore, setting up communication |
| 32 |
between a local XPA server machine and a remote client machine |
| 33 |
requires a two-part registration process: |
| 34 |
|
| 35 |
<UL> |
| 36 |
<LI> the XPA service on the local machine must be made known to the |
| 37 |
remote machine |
| 38 |
<LI> the remote machine must be given permission to access the local |
| 39 |
XPA service |
| 40 |
</UL> |
| 41 |
|
| 42 |
Three methods by which this remote registration can be accomplished |
| 43 |
are described below. |
| 44 |
|
| 45 |
<H2>Manual Registration</H2> |
| 46 |
|
| 47 |
The first method is the most basic and does not require the remote |
| 48 |
client to have xpans running. To use it, the local server simply |
| 49 |
gives a remote client machine access to one or more XPA access points |
| 50 |
using xpaset and the <B>-acl</B> sub-command. For example, |
| 51 |
consider the XPA test program "stest" running on a local machine. By |
| 52 |
default the access control for the access point named "xpa" is |
| 53 |
restricted to that machine: |
| 54 |
<PRE> |
| 55 |
[sh]$ xpaget xpa -acl |
| 56 |
*:* 123.456.78.910 gisa |
| 57 |
*:* localhost gisa |
| 58 |
</PRE> |
| 59 |
Using xpaset and the <B>-acl</B> sub-command, a remote client |
| 60 |
machine can be given permission to perform xpaget, xpaset, xpaaccess, |
| 61 |
or xpainfo operations. For example, to allow the xpaget operation, the |
| 62 |
following command can be issued on the local machine: |
| 63 |
<PRE> |
| 64 |
[sh]$ xpaset -p xpa -acl "remote_machine g" |
| 65 |
</PRE> |
| 66 |
This results in the following access permissions on the local machine: |
| 67 |
<PRE> |
| 68 |
[sh]$ xpaget xpa -acl |
| 69 |
XPA:xpa 234.567.89.012 g |
| 70 |
*:* 123.456.78.910 gisa |
| 71 |
*:* localhost gisa |
| 72 |
</PRE> |
| 73 |
|
| 74 |
The remote client can now use the local server's xpans name server to |
| 75 |
establish communication with the local XPA service. This can be done |
| 76 |
on a call-by-call basis using the <B>-i</B> switch on xpaset, xpaget, etc: |
| 77 |
<PRE> |
| 78 |
[sh]$ xpaget -i "local_machine:12345" xpa |
| 79 |
class: XPA |
| 80 |
name: xpa |
| 81 |
method: 88877766:2778 |
| 82 |
sendian: little |
| 83 |
cendian: big |
| 84 |
</PRE> |
| 85 |
Alternatively, the XPA_NSINET variable on the remote machine can be |
| 86 |
set to point directly to xpans on the local machine, removing |
| 87 |
the need to override this value each time an XPA program is run: |
| 88 |
<PRE> |
| 89 |
[csh]$ setenv XPA_NSINET 'karapet:$port' |
| 90 |
[csh]$ xpaget xpa |
| 91 |
class: XPA |
| 92 |
name: xpa |
| 93 |
method: 88877766:2778 |
| 94 |
sendian: little |
| 95 |
cendian: big |
| 96 |
</PRE> |
| 97 |
Here, '$port' means to use the default XPA name service port (14285). |
| 98 |
not a port environment variable. |
| 99 |
|
| 100 |
<p> |
| 101 |
Access permission for remote client machines can be stored in a file |
| 102 |
on the local machine pointed to by the <B>XPA_ACLFILE</B> environment |
| 103 |
variable or using the <B>XPA_DEFACL</B> environment variable. See <A |
| 104 |
HREF="./acl.html">XPA Access Control</A> for more information. |
| 105 |
|
| 106 |
<H2>Remote Registration</H2> |
| 107 |
|
| 108 |
If xpans is running on the remote client machine, then a local xpaset |
| 109 |
command can be used with the <B>-remote</B> sub-command to |
| 110 |
register the local XPA service in the remote name service, while at |
| 111 |
the same time giving the remote machine permission to access the local |
| 112 |
service. For example, assume again that "stest" is running on the |
| 113 |
local machine and that xpans is also running on the remote machine. |
| 114 |
To register access of this local xpa on the remote machine, use |
| 115 |
the xpaset and the <B>-remote</B> sub-command: |
| 116 |
<PRE> |
| 117 |
[sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' + |
| 118 |
</PRE> |
| 119 |
To register the local xpa access point on the remote machine with xpaget |
| 120 |
access only, execute: |
| 121 |
<PRE> |
| 122 |
[sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' g |
| 123 |
</PRE> |
| 124 |
Once the remote registration command is executed, the remote client |
| 125 |
machine will have an entry such as the following in its own xpans name |
| 126 |
service: |
| 127 |
<PRE> |
| 128 |
[csh]$ xpaget xpans |
| 129 |
XPA xpa gs 88877766:2839 eric |
| 130 |
</PRE> |
| 131 |
The xpa access point can now be utilized on the remote machine without |
| 132 |
further setup: |
| 133 |
<PRE> |
| 134 |
[csh]$ xpaget xpa |
| 135 |
class: XPA |
| 136 |
name: xpa |
| 137 |
method: 838e2f68:2839 |
| 138 |
sendian: little |
| 139 |
cendian: big |
| 140 |
</PRE> |
| 141 |
To unregister remote access from the local machine, use the same |
| 142 |
command but with a '-' argument: |
| 143 |
<PRE> |
| 144 |
[sh]$ xpaset -p xpa -remote 'remote_machine:$port' - |
| 145 |
</PRE> |
| 146 |
The benefit of using remote registration is that communication with |
| 147 |
remote access points can be mixed with that of other access points |
| 148 |
on the remote machine. Using <A HREF="./template.html">Access Point |
| 149 |
Names and Templates</A>, one XPA command can be used to send or |
| 150 |
receive messages to the remote and local services. |
| 151 |
|
| 152 |
<H2>XPANS Proxy Registration</H2> |
| 153 |
|
| 154 |
The two methods described above are useful when the local and remote |
| 155 |
machines are able to communicate freely to one another. This would be |
| 156 |
the case on most Local Area Networks (LANs) where all machines are |
| 157 |
behind the same firewall and there is no port blocking between |
| 158 |
machines on the same LAN. The situation is more complicated when the |
| 159 |
XPA server is behind a firewall, where outgoing connections are |
| 160 |
allowed, but incoming port blocking is implemented to prevent machines |
| 161 |
outside the firewall from connecting to machines inside the |
| 162 |
firewall. Such incoming port blocking will prevent xpaset and xpaget |
| 163 |
from connecting to an XPA server inside a firewall. |
| 164 |
|
| 165 |
<P> |
| 166 |
To allow locally fire-walled XPA services to register with remote |
| 167 |
machines, we have implemented a proxy service within the xpans name |
| 168 |
server. To register remote proxy service, xpaset and the |
| 169 |
<B>-remote</B> sub-command is again used, but with an additional |
| 170 |
<B>-proxy</B> argument added to the end of the command: |
| 171 |
<PRE> |
| 172 |
[sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' g -proxy |
| 173 |
</PRE> |
| 174 |
Once a remote proxy registration command is executed, the remote |
| 175 |
machine will have an entry such as the following in its own xpans name |
| 176 |
service: |
| 177 |
<PRE> |
| 178 |
[csh]$ xpaget xpans |
| 179 |
XPA xpa gs @88877766:2839 eric |
| 180 |
</PRE> |
| 181 |
The '@' sign in the name service entry indicates that xpans proxy |
| 182 |
processing is being used for this access point. Other than that, from |
| 183 |
the user's point of view, there is no difference in how this XPA |
| 184 |
access point is contacted using XPA programs (xpaset, xpaget, etc.) or |
| 185 |
libraries: |
| 186 |
<PRE> |
| 187 |
[csh]$ xpaget xpa |
| 188 |
class: XPA |
| 189 |
name: xpa |
| 190 |
method: 88877766:3053 |
| 191 |
sendian: little |
| 192 |
cendian: big |
| 193 |
</PRE> |
| 194 |
<P> |
| 195 |
Of course, the underlying processing of the XPA requests is very much |
| 196 |
different when xpans proxy is involved. Instead of an XPA program such |
| 197 |
contacting the XPA service directly, it contacts the local xpans. |
| 198 |
Acting as a proxy server, xpans communicates with the XPA service |
| 199 |
using the command channel established at registration time. Commands |
| 200 |
(including establishing a new data channel) are sent between xpans and |
| 201 |
the XPA service to set up a new message transfer, and then data is fed |
| 202 |
to/from the xpa request, through xpans, from/to the XPA service. In |
| 203 |
this way, it can be arranged so that connections between the |
| 204 |
fire-walled XPA service and the remote client are always initiated by |
| 205 |
the XPA service itself. Thus, incoming connections that would be |
| 206 |
blocked by the firewall are avoided. Note that there is a performance |
| 207 |
penalty for using the xpans/proxy service. Aside from extra overhead |
| 208 |
to set up proxy communication, all data must be sent through the |
| 209 |
intermediate proxy process. |
| 210 |
|
| 211 |
<P> |
| 212 |
The xpans proxy scheme requires that the remote client allow the local |
| 213 |
XPA server machine to connect to the remote xpans/proxy server. If the |
| 214 |
remote client machine also is behind a port-blocking firewall, such |
| 215 |
connections will be disallowed. In this case, the only solution is to |
| 216 |
open up some ports on the remote client machine to allow incoming |
| 217 |
connections to xpans/proxy. Two ports must be opened (for command and |
| 218 |
data channel connections). By default, these two ports are 14285 and |
| 219 |
14287. The port numbers can be changed using the <B>XPA_NSINET</B> |
| 220 |
environment variable. This variable takes the form: |
| 221 |
<PRE> |
| 222 |
setenv XPA_NSINET machine:port1[,port2[,port3]] |
| 223 |
</PRE> |
| 224 |
where port1 is the main connecting port, port2 is the XPA access port, |
| 225 |
and port3 is the secondary data connecting port. The second and third |
| 226 |
ports are optional and default to port1+1 and port1+2, respectively. |
| 227 |
It is port1 and port3 that must be left open for incoming connections. |
| 228 |
|
| 229 |
<P> |
| 230 |
For example, to change the port assignments so that xpans listens |
| 231 |
for registration commands on port 12345 and data commands on port 28573: |
| 232 |
<PRE> |
| 233 |
setenv XPA_NSINET myhost:12345 |
| 234 |
</PRE> |
| 235 |
Alternatively, all three ports can be assigned explicitly: |
| 236 |
<PRE> |
| 237 |
setenv XPA_NSINET remote:12345,3000,12346 |
| 238 |
</PRE> |
| 239 |
In this case 12345 and 12346 should be open for incoming connections. |
| 240 |
The XPA access port (which need not be open to the outside |
| 241 |
world) is set to 3000. |
| 242 |
|
| 243 |
<P> |
| 244 |
Finally, note that we currently have no mechanism to cope with |
| 245 |
Internet proxy servers (such as SOCKS servers). If an XPA service is |
| 246 |
running on a machine that cannot connect directly to outside machines, |
| 247 |
but goes through a proxy server instead, there currently is no way to |
| 248 |
register that XPA service with a remote machine. We hope to implement |
| 249 |
support for SOCKS proxy in a future release. |
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
<P> |
| 256 |
<A HREF="./help.html">Go to XPA Help Index</A> |
| 257 |
|
| 258 |
<H5>Last updated: September 10, 2003</H5> |
| 259 |
</BODY> |
| 260 |
</HTML> |