Netrek Metaserver Overhaul

Traffic Analysis

This is an analysis of the network traffic involving a Netrek Metaserver, using the current version of the software. This analysis was done using tcpdump, with one Digital UNIX machine as the server, and another as the metaserver. Both machines were on the same ethernet.

Metaserver Poll of Empty Server

This is the packet trace for a single poll from metaserver to server when the server has no players. It constitutes a TCP connection from the metaserver to the server players port, 2591, which produces the server output "No one playing.".

15:36:28.747436 metaserver.1454 > server.players: S 1152384000:1152384000(0) win 32768 
15:36:28.747436 server.players > metaserver.1454: S 1212480000:1212480000(0) ack 1152384001 win 33580 
15:36:28.753292 metaserver.1454 > server.players: . ack 1 win 33580
15:36:28.770860 server.players > metaserver.1454: P 1:18(17) ack 1 win 33580
15:36:28.770860 server.players > metaserver.1454: F 18:18(0) ack 1 win 33580
15:36:28.779644 metaserver.1454 > server.players: . ack 19 win 33563
15:36:28.780620 metaserver.1454 > server.players: F 1:1(0) ack 19 win 33580
15:36:28.780620 server.players > metaserver.1454: . ack 2 win 33580
Notes

  1. the poll required eight IP datagrams,

  2. the poll required four IP datagrams from each direction,

  3. only one IP datagram contained the essential datum (15:36:28.770860),

  4. the essential datum was encoded as eighteen bytes in length,

  5. at the current polling interval of 15 minutes, with about 12 servers listed as empty, the total cost is 24*60/15*8*12 = 9216 packets per day, which is (8*40+18)*9216 = 3,115,008 bytes per day, or 36 bytes per second (TCP header is 20 bytes, IP header is 20 bytes),

Metaserver Poll of Active Server

This is the packet trace for a single poll from metaserver to server when the server daemon is running. It constitutes a TCP connection from the metaserver to the server players port, 2591, which produces the server output containing the list of players, followed by a TCP connection from the metaserver to the server main port, 2592, which produces the more detailed player data packets in Netrek protocol format.

15:41:48.207404 metaserver.1472 > server.players: S 1194688000:1194688000(0) win 32768 
15:41:48.208380 server.players > metaserver.1472: S 1253568000:1253568000(0) ack 1194688001 win 33580 
15:41:48.209356 metaserver.1472 > server.players: . ack 1 win 33580
15:41:48.226924 server.players > metaserver.1472: P 1:77(76) ack 1 win 33580
15:41:48.226924 server.players > metaserver.1472: FP 77:509(432) ack 1 win 33580
15:41:48.229852 metaserver.1472 > server.players: . ack 510 win 33148
15:41:48.231804 metaserver.1472 > server.players: F 1:1(0) ack 510 win 33580
15:41:48.231804 server.players > metaserver.1472: . ack 2 win 33580

15:41:48.231804 metaserver.1473 > server.netrek: S 1194752000:1194752000(0) win 32768 
15:41:48.232780 server.netrek > metaserver.1473: S 1253632000:1253632000(0) ack 1194752001 win 33580 
15:41:48.234732 metaserver.1473 > server.netrek: . ack 1 win 33580
15:41:48.234732 metaserver.1473 > server.netrek: P 1:9(8) ack 1 win 33580
15:41:48.256204 server.netrek > metaserver.1473: . 1:1461(1460) ack 9 win 33580
15:41:48.256204 server.netrek > metaserver.1473: . 1461:2921(1460) ack 9 win 33580
15:41:48.262060 metaserver.1473 > server.netrek: . ack 2921 win 33580
15:41:48.262060 server.netrek > metaserver.1473: P 2921:3993(1072) ack 9 win 33580
15:41:48.263036 metaserver.1473 > server.netrek: F 9:9(0) ack 2921 win 33580
15:41:48.263036 server.netrek > metaserver.1473: . ack 10 win 33580
15:41:48.264012 server.netrek > metaserver.1473: F 3993:3993(0) ack 10 win 33580
15:41:48.265964 metaserver.1473 > server.netrek: R 1194752009:1194752009(0) win 0
15:41:48.265964 metaserver.1473 > server.netrek: R 1194752010:1194752010(0) win 0
Notes

  1. the poll required 21 (8+13) IP datagrams,

  2. the IP datagrams were again fairly well balanced according to originating host,

  3. the first half of the poll required eight IP datagrams as before, even though the data transfer was 509 bytes rather than 18, because the last packet included the FIN,

  4. the total transfer was 4501 bytes, and included superfluous data such as the MOTD from the server, which varies in size,

  5. two RST packets were delivered by the metaserver presumably to fully reset the connection that was closed at the metaserver end,

  6. at the current polling interval of 5 minutes, with about 5 servers listed as active, the total cost is 24*60/5*21*5=30240 packets per day, which is (21*40+4501)*30240 = 161,511,840 bytes per day or 1869 bytes per second (TCP header is 20 bytes, IP header is 20 bytes),

Client Poll of Metaserver

This is the packet trace for a single poll by a Netrek client to a metaserver. (This particular trace was generated by a telnet session, but the effect will be identical). It constitutes a TCP connection to the metaserver port 3521, resulting in a text dump from the metaserver, then the connection is closed.

15:45:07.995507 client.1250 > metaserver.3521: S 1279808000:1279808000(0) win 32768 
15:45:07.997459 metaserver.3521 > client.1250: S 1221184000:1221184000(0) ack 1279808001 win 33580 
15:45:07.997459 client.1250 > metaserver.3521: . ack 1 win 33580 
15:45:08.236579 metaserver.3521 > client.1250: F 1085:1085(0) ack 1 win 33580
15:45:08.236579 client.1250 > metaserver.3521: . ack 1 win 33580 
15:45:08.237555 metaserver.3521 > client.1250: P 1:1085(1084) ack 1 win 33580
15:45:08.238531 client.1250 > metaserver.3521: . ack 1086 win 32496 
15:45:08.239507 client.1250 > metaserver.3521: F 1:1(0) ack 1086 win 33580 
15:45:08.240483 metaserver.3521 > client.1250: . ack 2 win 33580
Notes

  1. the overhaul project is not changing this transaction,

  2. often seen curiousity here is that the FIN packet arrives before the data packet that should have preceeded it, resulting in an additional ACK packet back to the metaserver,

New Protocol

The new protocol will involve a UDP packet from the server to the metaserver. The typical size of an update packet will be around 60 bytes if the server is empty and around 880 bytes if it has 16 players.

For an average of 12 empty servers, polled at 15 minute intervals, the total packet count will be 24*60/15*12=1152 packets per day, which is (1*40+60)*1152=115,200 bytes per day, or 1.33 bytes per second.

For an average of 5 full servers, polled at 5 minute intervals, the total packet count will be 24*60/5*5=1440 packets per day, which is (1*40+880)*1440=1,324,800 bytes per day, or 15.33 bytes per second.

Conclusions

The bandwidth change will be from 1905 to 17 bytes per second. About one hundred-fold decrease. If we increase the polling rates by a factor of ten we will still have a saving of a factor of ten. Higher update rates can be a selling point to the server and client users.

Add to this the design change that will do away with polling by the metaserver, so that servers will send updates only if they are required, and the traffic is reduced further.

--
James Cameron
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800
(cameron@stl.dec.com)