Assignment #0 - Socket Programming and Network Measurements
Due on Thursday, September 10.
Please email your written report (in PDF or PostScript) to the
TA Amal Fahad (fahad@cs.rochester.edu)
by midnight September 10. 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/UDP sockets. You can write your program in
C/C++ or Java. However, I strongly encourage you write it in C/C++
since Java contains unnecessary fat that makes accurate measurement
sometimes difficult. In particular, you may not be able to use
my high resolution timer
if you program in 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:
- 1, (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.
- 2, (10 points) Repeat the transmission delay measurements for UDP
messages of different sizes. What is the biggest sized UDP message you
can send out successfully?
- 3, (10 points) Establish a TCP connection with an Internet service
site (e.g., a search engine or an e-commerce site) and measure the round-trip
transmission delay. 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 the experiment
several times and then take the average. Use
a high resolution timer
whenever necessary. The goal is to have STABLE
measurement results.
Turn-in:
You should turn in a written report for this assignment 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.