xAP Router
A xAP Router allows two disjoint xAP TCP/IP networks to be interconnected. Broadcast messages are confined to a single subnet under normal circumstances, limiting access to xAP traffic to hosts located only on that subnet. From time to time, however, it can be useful to be able access the xAP infrastructure remotely - perhaps to allow the use of xAP applications from a laptop when travelling. The xAP router provides this capability by establishing a point-to-point connection between two networks and passing xAP messages between them.
Instructions
If the router is required to co-exist with other xAP-enabled applications on the same host, then a xAP-Hub is required.
To interconnect two xAP networks, one network is designated a "master" and one network is designated a "slave". Irrespective of this designation, xAP traffic passes freely between the two.
On the master network, the xAP router should be started in server mode. The server listens for remote connections (on a specified port) initiated from the slave network.
Once the server is running, a connection may be initiated from the slave network by starting the xAP router in client mode and supplying the IP address of the corresponding server to connect to.
For example: It is required to connect a xAP network 192.168.0.x with a xAP network 10.10.10.x. The 192.168.0.x network is (arbitrarily) designated as master. The 10.10.10.x network is designated as slave. The server will run on a host on the master network (say 192.168.0.2), the client on a host on the slave network (say 10.10.10.5). We decide to use the xAP port 3639 to establish a connection.
- Start the server on 192.168.0.2 with the command line: xap-router server 192.168.1.2 3639
- Initiate a connection from the client on host 10.10.10.5 with the command line: xap-router client 192.168.1.2 3639
xAP traffic should now flow freely between the two networks.
Limitations
Routers must be deployed in pairs. It is not possible for a server to accept more than one concurrent connection at this time. If the connection is broken, the client does not attempt automatic reconnection. No authentication is performed between connecting routers, and xAP traffic is passed between the two routers in clear text.
Command Line Options
xap-router <mode> <p2p address> <p2p port> [network interface] [udp port] [debug level]
where:
mode (mandatory) specifies either client or server. A server accepts connections from a remote router; a client initiates connections to a remote router.
p2p address (mandatory). In client mode, this specifies the address of the server to connect to. In server mode, this specifies the address on which to listen for incoming connections.
p2p port (mandatory). In client mode, this specifies the server port on which to connect. In server mode, this specifies the port on which to listen for incoming connections.
network interface is the network interface used for sending and receiving xAP messages. On a Linux and Windows PC host these are named eth0, eth1. Under OSX they are named ne0 etc. By default, eth0 is used. On a Windows PC which has multiple adapters installed, even if they are not active, eth0 may not represent the active interface - some experimentation may be required!
udp port is the UDP port xAP broadcasts on. By default xAP uses its officially allocated port, 3639. Using an alternative port can be useful during isolated testing, however. Be aware that the use of ports below 1024 will fail unless the application is run by a user with administrative privileges. The use of ports below 1024 therefore has security implications and is not recommend.
debug level determines the verbosity of the output written to stdout. Verbose output can be useful for debugging unexpected behaviour. By default, the debug level is 0. Increasing levels of detail may be specified, up to a maximum of 4.
Download
xAP Router Project
Windows executable (requires cygwin dll) Windows/Linux source (requires xAP-lib)
|