Checking connectivity between a z-Tree client and a z-Tree ServerIf you can't connect from your z-Tree client and your z-Tree Server (and if you think that you should be able to connect), please follow these steps:
- Determine the ip-Address of the server. It should be one of the (comma separated) addresses in
server.eecin the directory where you started the z-Tree server. The content of
server.eecmight, e.g., look like this:
192.168.2.3,10.4.5.6,127.7.8.9This means that
z-Treethinks the machine has three network interfaces:
192.168.2.3is an address in a local network.
10.4.5.6is another address in another local network.
127.7.8.9is the address the machine uses when it is talking to itself.
192.168.2.199, then both machines should be connected through the
192.168.2.*network. Use the
192.168.2.3address to connect to the server. If your client has, e.g., the address
10.4.8.9, then, hopefully, both machines are connected through the
10.4.*network, so use the
10.4.5.6address to connect to the server. Use
127.7.8.9only when the client is on the same machine as the server.
In the following, I assume that we are on an IPv4 network and that the server's address is x.x.x.x
- Of course, you did start
z-Leafon the client as
zLeaf.exe /server x.x.x.xdidn't you? If this fails (i.e.
z-Leaftells you something like “Failed to connect to z-Tree. Try again?”), let us check why the connect between
z-Treemight have failed:
ping: Open a terminal on the client and issue the command
ping x.x.x.xAs an answer, you should get something like
PING x.x.x.x: 56 data bytes 64 bytes from x.x.x.x: icmp_seq=0 ttl=64 time=0.036 ms ...If you only get the first line then, most likely, clients in your network are not allowed to talk to each other at all. Return to your terminal with
Control-Cand talk to your network administrator.
If you succeed with ping, then there is at least some connection from client to server.
nmap: Next try whether the connection allows communication on port 7000 (here I assume that
z-Treeis listening on port 7000 which is the default. If in doubt, use
netstat(see below) on the server to find out whether it is, really, port 7000). If
nmapis installed on your client you should probe whether port 7000 on x.x.x.x is listening. On the client issue the following:
nmap -p 7000 x.x.x.xYou should get something like:
PORT STATE SERVICE 7000/tcp open afs3-fileserverIf, instead, you get
Host seems down.or
7000/tcp closed, then somebody is blocking at least communication on port 7000 (or you made a mistake with your your ip-address, so check again whether x.x.x.x is really the correct address. If yes, then talk to your network administrator).
nmapis not installed and if you can't install it (you should, it is a useful tool to diagnose networks) then you can still use telnet:
telnet 10.x.x.x 7000You should get something like
Trying x.x.x.x... Connected to x.x.x.x Escape character is '^]'.The
Connected tomeans that, indeed, you are now connected to
z-Tree. In principle you could now pretend to be a zLeaf (don't, it would require a lot of typing, zLeaf is better at this...).
To return to your terminal enter telnet's command mode with a
Control-]and they say
QUIT. This brings you back to your terminal.
If, instead, you get
Trying x.x.x.x... telnet: connect to address x.x.x.x: Connection refused telnet: Unable to connect to remote hostthen somebody is blocking port 7000.
- There are more things which could fail. After all,
z-Treewants to talk back to its z-Leaves, hence the clients have to open a port, too.
To find out which ports are opened by
z-Leafcompare the output of
netstatbefore and after your have started
z-Leaf. On a terminal of your client, before starting
z-Leaf, say the following:
netstat -an4 | grep LISTENYou will get a list of open ports, similar to the following:
... tcp4 0 0 *.8000 *.* LISTEN ...Once
z-Leafhas started, it might say something like “Failed to connect to z-Tree. Try again?”. While you see this message, issue the same command again:
netstat -an4 | grep LISTENNow the output should have changed:
... tcp4 0 0 *.7999 *.* LISTEN tcp4 0 0 *.8000 *.* LISTEN ...A new open port, in this example 7999, has appeared. This should be the port which was opened by
z-Leafseems to try to get 7999 first, if this port is not free, it tries a smaller one, so 7998 next, then 7997, etc.). To test whether the server can talk back to the client, issue (on a terminal of the server):
nmap -p 7999 y.y.y.ywhere y.y.y.y is the address of your client.