Assignment #0 - Socket Programming and Network Measurements
Due on Tuesday, September 9.
Please email your written report (in PDF format) to the TA
by midnight September 9.
Late turn-ins will NOT be accepted.
The purpose of this assignment is to give you experience on
socket-based network programming and basic techniques of network
measurements. Sockets are the key interface between applications
and networking systems. In this assignment you are asked to write
simple programs with TCP sockets. You can write your program in
C/C++ or Java.
Warmup on socket programming:
This part is a warmup on socket programming and it will
NOT be graded. You can skip it
if you are already fairly familiar with socket programming.
For this part, you will implement a client and a server that communicate
to each other over the network. The server basically echoes back the
client input message with some slight change. Specifically, for an input
string from the client, the server returns one with all upper case letters
replaced by lower case letters and every space changed to a '.'. Below
are some additional operational details about the client and server:
-
As the command line arguments, the client should accept as input
either a host name or an IP address with a port number. Using this
information, it should create a TCP connection with the server,
which should be already running at this time. Then it
accepts an input string from the terminal (ending with an enter),
truncates it if it exceeds 80 characters, and sends the string
to the server through the TCP connection. When it receives a
response, it prints the response and exits.
-
As the command line arguments, the server should accept a port
number that it will run at. After being started, the server should
repeatedly accept an input string from any TCP client and send back
the modified text string. The server can assume that it will not
receive a text string of over 80 characters in length.
Here is an example how your server should work.
Assume that you start a server on machine foo.cs.rochester.edu
(this machine doesn't really exist, find one yourself) listening to
port number 32000. The syntax should look like the following:
[yourself@foo] server 32000 <enter>
Then you run a client on machine foobar.cs.rochester.edu
using the following arguments:
[yourself@foobar] client foo.cs.rochester.edu 32000 <enter>
<enter text:>This is my text to be changed by the SERVER.<enter>
this.is.my.text.to.be.changed.by.the.server.
[yourself@foobar]
The real assignment:
- (10 points) Measure the round-trip transmission delay of a TCP
message between two machines. Provide measurement results for the
following TCP message sizes: 1-byte, 10-byte, 100-byte, 1,000-byte, 10,000-byte.
You should include the connection setup time in measured delays.
For comparison purposes, all measurements should be done on Linux machines
of the undergraduate lab or the graduate software lab.
- (10 points) Establish TCP connections with Internet service sites
(e.g., a search engine or an e-commerce site) and measure the round-trip
transmission delays. Please report the results for a site in the United
States and a foreign site. For the foreign site, you are encouraged to
find one with longest delay possible. There is no need to use messages of
different sizes (you cannot control the return message size anyway).
To ease your task, it may not be necessary to establish a valid message
exchange (i.e., a return error message is sufficient for measuring the
round-trip delay).
For the measurements, you may need to repeat each experiment several times and
then take the average.
Your goal is to produce accurate, stable measurement results.
Turn-in:
You should email a written report for this assignment to the TA and indicate
the location of your source code for solving each question.
- Written report: In the written report, please indicate the measurement
results, your measurement methodology (including how many times the experiments are
repeated before the average is taken etc.) and the names of the machines where your
measurements were conducted. Do not include any source code in the report.
- Source code: In the written report, you should indicate the location of
your source code for solving each question (e.g.,
/u/kshen/...
). Your
files must be in the department undergraduate or graduate network file system and
make sure your files are readable by others.