| 1 |
|
| 2 |
<HTML> |
| 3 |
<HEAD> |
| 4 |
<TITLE>The XPA Name Server (xpans)</TITLE> |
| 5 |
</HEAD> |
| 6 |
<BODY> |
| 7 |
|
| 8 |
|
| 9 |
<H2><A NAME="xpans">xpans: the XPA Name Server</A></H2> |
| 10 |
|
| 11 |
|
| 12 |
<H2>Summary</H2> |
| 13 |
<PRE> |
| 14 |
xpans [-h] [-e] [-k sec] [-p port] [-l log] [-s security log] [-P n] |
| 15 |
</PRE> |
| 16 |
|
| 17 |
|
| 18 |
<P> |
| 19 |
<PRE> |
| 20 |
-h print help message |
| 21 |
-e exit when there are no more XPA connections |
| 22 |
-k send keepalive messages every n sec |
| 23 |
-l log data base entries to specified file |
| 24 |
-p listen for connections on specified port |
| 25 |
-s log security info for each connection to specified file |
| 26 |
-P accept proxy requests (P=1) using separate thread (P=2) |
| 27 |
--version display version and exit |
| 28 |
</PRE> |
| 29 |
|
| 30 |
|
| 31 |
<P> |
| 32 |
The xpans name server is an XPA-enabled program that is used to |
| 33 |
manage the names and ports of XPA access points. It is started |
| 34 |
automatically when an XPA access point is registered. You can access |
| 35 |
the name server using xpaget to get a list of registered access points. |
| 36 |
<P> |
| 37 |
The <EM>xpans</EM> name server provides a crucial link between XPA |
| 38 |
clients and servers. When an XPA server defines an access point using |
| 39 |
XPANew(), XPACmdNew(), or XPAInfoNew(), the name of the access point |
| 40 |
is registered in the name service, along with connection information. |
| 41 |
The name server then matches class:name templates passed to it by XPA |
| 42 |
clients with these registered entries, so that the clients can |
| 43 |
communicate with the appropriate servers. |
| 44 |
|
| 45 |
<P> |
| 46 |
The socket connection between an XPA-enabled program and |
| 47 |
<EM>xpans</EM> is kept open until the former exits (or explicitly |
| 48 |
closes the connection). Apparently, some Internet equipment (e.g. DSL |
| 49 |
modems) can cause such a connection to time-out after a period of |
| 50 |
inactivity. To prevent this from happening, you can use the <EM>-k |
| 51 |
[sec]</EM> switch to send a short keep-alive message to each open |
| 52 |
connection after the specified time delay. (Note that this |
| 53 |
application level use of keep-alive is necessary only if you are |
| 54 |
serving XPA-enabled clients over the Internet and have to deal with |
| 55 |
long-term connections involving DSL or similar equipment. XPA uses |
| 56 |
the ordinary socket-level keep-alive, which works for all other cases.) |
| 57 |
<B>NB (12/2/2009): Out-of-band (URG) TCP data, used by xpans |
| 58 |
keep-alive, is changed by some Cisco routers into in-band data. |
| 59 |
Encountering such a router will break the keep-alive function and may |
| 60 |
break your XPA server as well. Proceed with caution!</B> |
| 61 |
|
| 62 |
<P> |
| 63 |
The <EM>xpans</EM> program will be started automatically (assuming it |
| 64 |
can be found in the user's path) when the first XPA access point is |
| 65 |
registered. It therefore need not be started explicitly. However, |
| 66 |
when started automatically, the <EM>-e</EM> switch is used, so that |
| 67 |
the name server will exit when there are no more XPA access points |
| 68 |
registered. If you wish to keep the name server running continually, |
| 69 |
simply start it manually without the <EM>-e</EM> switch. |
| 70 |
|
| 71 |
<P> |
| 72 |
The name server will keep a log of registered access points if the |
| 73 |
<EM>-l [log]</EM> switch is used on the command line (this is the |
| 74 |
case for automatic start-up). The log contains enough name and connection |
| 75 |
information to allow you to re-register all XPA access points in case |
| 76 |
the name server process is terminated prematurely. For example, after |
| 77 |
the ds9 access point is registered,the log will contain the entry: |
| 78 |
<PRE> |
| 79 |
add 838e2f67:1863 ds9 ds9 gs eric |
| 80 |
</PRE> |
| 81 |
If <EM>xpans</EM> is terminated but ds9 still is running, you |
| 82 |
can re-register both access points for the ds9 process by running: |
| 83 |
<PRE> |
| 84 |
xpaset -p 838e2f67:1863 -nsconnect |
| 85 |
</PRE> |
| 86 |
Notice that the ip:port specifier is used with <EM>xpaset</EM> to bypass |
| 87 |
the need for contacting the name server (which does not have the name |
| 88 |
registered yet!) |
| 89 |
|
| 90 |
<P> |
| 91 |
The name server will keep a log of security information if the <EM>-s |
| 92 |
[security log]</EM> switch is used on the command line. For each |
| 93 |
accepted connection, (including connections via the <EM>xpaget</EM> |
| 94 |
command), information will be logged about the host issuing the |
| 95 |
command and the parameters passed into the program. This is most |
| 96 |
useful when <EM>xpans</EM> is accepting connections from untrusted |
| 97 |
machines. |
| 98 |
|
| 99 |
<P> |
| 100 |
When an XPA access point is removed by a server using <EM>XPAFree()</EM>, |
| 101 |
the access information is removed from the name server. If an |
| 102 |
XPA-enabled process is terminated, all names registered by that process |
| 103 |
will be removed automatically. The log file is always updated to |
| 104 |
reflect the currently registered access points. |
| 105 |
|
| 106 |
<P> |
| 107 |
The name server itself has an XPA access point names <EM>xpans</EM> |
| 108 |
registered through which you can find out information about currently |
| 109 |
registered access points (assuming you have access to the name server; |
| 110 |
see <A HREF="./acl.html">XPA Access Control</A> for more information). |
| 111 |
For each registered access point, the following information is returned: |
| 112 |
<PRE> |
| 113 |
class # class of the access point |
| 114 |
name # name of the access point |
| 115 |
access # allowed access (g=xpaget,s=xpaset,i=xpainfo) |
| 116 |
id # socket access method (host:port for inet, file for local/unix) |
| 117 |
user # user name of access point owner |
| 118 |
</PRE> |
| 119 |
|
| 120 |
<P> |
| 121 |
For example, to display all currently registered access points, simply execute: |
| 122 |
<PRE> |
| 123 |
xpaget xpans |
| 124 |
</PRE> |
| 125 |
Continuing the example of ds9 above, this will return: |
| 126 |
<PRE> |
| 127 |
DS9 ds9 gs 838e2f67:1863 eric |
| 128 |
</PRE> |
| 129 |
If the same program has been started with different XPA access names, |
| 130 |
you can look up only names matching a specified template. For example, |
| 131 |
assume that ds9 has been started up using: |
| 132 |
<PRE> |
| 133 |
ds9 & |
| 134 |
ds9 -title ds9-1-eric & |
| 135 |
ds9 -title ds9-2-eric & |
| 136 |
</PRE> |
| 137 |
To lookup all ds9 access points which end in ".eric" and which can |
| 138 |
be accessed using <EM>xpaset</EM>, use: |
| 139 |
<PRE> |
| 140 |
xpaget xpans "DS9:*.eric" "s" "*" |
| 141 |
</PRE> |
| 142 |
This will return: |
| 143 |
<PRE> |
| 144 |
DS9 ds9-2-eric gs 838e29d3:42102 eric |
| 145 |
DS9 ds9-1-eric gs 838e29d3:42105 eric |
| 146 |
</PRE> |
| 147 |
The third argument "*" requests all access points from all users. |
| 148 |
You also can specify a specific user name and only access points |
| 149 |
registered by that user will be returned. |
| 150 |
|
| 151 |
<P> |
| 152 |
The name server uses the <EM>XPA_METHOD</EM> environment variable |
| 153 |
to determine whether it should listen for requests on INET or LOCAL |
| 154 |
sockets. Since XPA access points also use this environment variable, |
| 155 |
the choice of socket method will be consistent. Note that, when INET |
| 156 |
sockets are used, a local server can be accessed from remote machines |
| 157 |
if the <EM>XPA_NSINET</EM> environment variable is set to point to |
| 158 |
the local machine. See |
| 159 |
<A HREF="./env.html">XPA Environment Variables</A> |
| 160 |
for more information. |
| 161 |
|
| 162 |
<P> |
| 163 |
An experimental feature of xpans is its ability to act as a proxy to |
| 164 |
XPA servers behind firewalls that want to communicate with external |
| 165 |
processes. The basic idea is the following: an XPA server (call it |
| 166 |
"foo") on host1, possibly behind a firewall, makes a remote connection |
| 167 |
to a proxy-enabled xpans program on host2 (specifying host2's XPA method). |
| 168 |
For example: |
| 169 |
<PRE> |
| 170 |
xpaset -p foo -remote 'host2:28571' + -proxy # on host1 |
| 171 |
</PRE> |
| 172 |
When this is done, host2 can use xpaset, xpaget, and xpainfo calls to |
| 173 |
communicate with the XPA server foo. All command communication is |
| 174 |
performed via the xpans socket connection between foo on host1 and |
| 175 |
xpans on host2 (which was initiated by foo from inside the firewall). |
| 176 |
Data communication is similarly performed using a socket connection |
| 177 |
initiated on host1 (usually with a port value two greater than the |
| 178 |
port value of the main xpans socket connection). An xpaset or xpaget |
| 179 |
call on host2 contacts xpans, which performs an XPASet() or XPAGet() |
| 180 |
call to foo, passing commands and data back and forth between the two |
| 181 |
programs. |
| 182 |
|
| 183 |
<P> |
| 184 |
By default, proxy connections are not allowed by xpans. If the -P switch is |
| 185 |
specified with a value of 1, proxy connection are allowed, but all proxy |
| 186 |
communication is performed in the same thread as xpans processing. If |
| 187 |
a value of 2 is specified, the proxy processing is performed in a |
| 188 |
separate thread (assuming pthreads are supported on your system). |
| 189 |
Because xpa callback processing of any type can take a long time and |
| 190 |
therefore can interfere with normal xpans processing, threaded proxy |
| 191 |
connections (-P 2) are recommended. When using proxy connections, it |
| 192 |
might also be useful to set the XPA_IOCALLSXPA environment variable, so |
| 193 |
that multiple proxy requests can be handled at the same time, instead of |
| 194 |
serially. |
| 195 |
|
| 196 |
<P> |
| 197 |
Note that this proxy interface to xpans is experimental. It is used |
| 198 |
to provide remote data analysis capabilities on the Chandra-Ed system |
| 199 |
using ds9. (See http://chandra-ed.cfa.harvard.edu and |
| 200 |
http://hea-www.harvard.edu/saord/ds9 for more details). As always, please |
| 201 |
contact us if you have problems or questions. |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
<P> |
| 208 |
<A HREF="./help.html">Go to XPA Help Index</A> |
| 209 |
|
| 210 |
<H5>Last updated: January 24, 2005</H5> |
| 211 |
</BODY> |
| 212 |
</HTML> |