Checking connectivity between a z-Tree client and a z-Tree Server
If 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 ofserver.eecmight, e.g., look like this:192.168.2.3,10.4.5.6,127.7.8.9
This means thatz-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 the192.168.2.*network. Use the192.168.2.3address to connect to the server. If your client has, e.g., the address10.4.8.9, then, hopefully, both machines are connected through the10.4.*network, so use the10.4.5.6address to connect to the server. Use127.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 aszLeaf.exe /server x.x.x.x
didn'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 betweenz-Leafandz-Treemight have failed: ping: Open a terminal on the client and issue the commandping x.x.x.x
As an answer, you should get something likePING 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 withControl-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 thatz-Treeis listening on port 7000 which is the default. If in doubt, usenetstat(see below) on the server to find out whether it is, really, port 7000). Ifnmapis 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.x
You should get something like:PORT STATE SERVICE 7000/tcp open afs3-fileserverIf, instead, you getHost seems down.or7000/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).telnet: Ifnmapis 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 7000
You should get something likeTrying x.x.x.x... Connected to x.x.x.x Escape character is '^]'.
TheConnected tomeans that, indeed, you are now connected toz-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 sayQUIT. 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 host
then 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 ofnetstatbefore and after your have startedz-Leaf. On a terminal of your client, before startingz-Leaf, say the following:netstat -an4 | grep LISTEN
You will get a list of open ports, similar to the following:... tcp4 0 0 *.8000 *.* LISTEN ...
Oncez-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 LISTEN
Now 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 byz-Leaf. (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.y
where y.y.y.y is the address of your client.