Network I/O

To measure the speed of data transfer through tcp/ip sockets between machines, say a Linux system acting as the receiver and a Windows system as a sender:

  1. Open port 6001 (or pick another one) on the Linux machine you will use to run the receiver code.
  2. Compile dimc_recv.c (with gcc).
  3. Execute ./dimc_recv -- It will wait for a connection to be made from the other machine.
  4. On a Windows machine, edit dimc_send.c and fill in the port number (6001) and the IP number of the Linux machine running the receiver code. Compile dimc_send.c with Windows Visual Studio (or modify the code to make it compile with gcc instead).
  5. Run ./dimc_send, and see how long it takes (the time is printed at the end), or measure separately with the time command.
  6. Calculate based on the link speed (e.g., 10 Mbps -- which is ten million bits, not bytes, per second) what the minimum transfer time is. If all is well, the test should come pretty close to this number.



Measure the relative time for copying data to disk and copying data in memory with dimc_disk.c -- just compile and run. Adjust the filename you want to use for the test before compiling.