CS 640 Introduction
to Computer Networks
Programming
Assignment 1: Mock Name Server (MNS)
Please check
this page
for FAQs and frequent updates on
instructions.
Testing
your program:
Returns invalid responses? |
Server # |
Port # |
|
1 |
5200 |
* |
2 |
5201 |
|
3 |
5202 |
* |
4 |
5203 |
|
5 |
5204 |
* |
6 |
5205 |
Please
Note:
·
Note
that
servers 2, 4 and 6 (marked with an * ) return invalid response packets.
Use these servers to test the robustness of your
client program.
·
The
test
servers are designed to be running perennially and will not terminate
upon
received of a client request of type 6.
·
Please
ensure that your client program is complete and adheres to all project
specifications before sending test packets to the server.
·
For
testing
purposes, the database used by the servers to respond to client
requests
contains the following records:
Server 1:
Mapping File:
machine1.cs.wisc.edu 128.45.6.1
machine2.cs.wisc.edu 128.45.6.2
tom3.cs.wisc.edu
128.45.10.3
tomcat4.cs.wisc.edu 128.45.11.4
Redirect File:
tom4.cs.wisc.edu 128.105.165.16 5202
128.45.6.3 128.105.165.16 5202
Server 3:
Mapping File:
tom4.cs.wisc.edu
128.45.10.4
tomcat5.cs.wisc.edu
128.45.10.5
Redirect File:
machine1.cs.wisc.edu 128.105.165.16 5200
128.45.6.3 128.105.165.16 5204
machine5.cs.wisc.edu 128.105.165.16 5200
Server 5:
Mapping File:
machine3.cs.wisc.edu 128.45.6.3
tomcat6.cs.wisc.edu
128.45.10.6
Redirect File:
tomcat4.cs.wisc.edu 128.105.165.16 5200
machine1.cs.wisc.edu
128.105.165.16 5202
machine5.cs.wisc.edu
128.105.165.16 5202
Example Queries:
./client -s 128.105.165.16 -p 5200 -r 0 -d 128.45.6.3 -t 4 -n 4
machine3.cs.wisc.edu
./client -s 128.105.165.16 -p 5202 -r 1 -d tomcat5.cs.wisc.edu -t 4 -n 4
128.45.10.5
/client -s 128.105.165.16 -p 5202 -r 1 -d tomcat7.cs.wisc.edu -t 4 -n 4
unresolved
/client -s 128.105.165.16 -p 5206 -r 1 -d tomcat5.cs.wisc.edu -t 4 -n 4
timeout
If
you
encounter any problems while attempting to connect to a particular
server try
connecting again after a few minutes. If the problem persists, send
email to
the TA (shukla[AT]cs.wisc.edu)
·
What to submit:
You will need to submit the source
code along with the Makefiles in a
single tar.gz file (name it p1.tar.gz). The extracted directory p1 should in turn have two
sub-directories - client and server. The sub-directories should have
their respective codes and Makefiles. Do not submit object files, or
compiled executables. The Makefile should have two rules: clean and all.
clean will delete previous .o
files, executables, etc.
all should produce a single
executable called client/server.
The directory structure should look like this:
p1(dir)
|
---------------------------
| |
server(dir) client(dir)
|
|
|
|
server.c
Makefile client.c
Makefile
The TA will run the following sequence of operations to execute your
code:
tar xvfz p1.tar.gz
cd p1/
cd server/
make clean
make all
./server -p <port1> -f <mapping-file1> -r
<redirect-file1>
./server -p <port2>
-f <mapping-file2> -r <redirect-file2>
./server -p <port3>
-f <mapping-file3> -r <redirect-file3>
cd ../client
make clean
make all
./client -s
<server-name> -p <port> -r <req-type> -d <data>
-t
<timeout> -n <seq-no>
Please test to make
sure that these commands can execute in sequence without any
intervention.
·
How to submit:
First
add the following line to your .cshrc.local file (located in your home
directory):
set path =
($path /s/handin/bin)
Then
run the following command at the shell prompt:
source
~/.cshrc.local
Finally,
to handin your files, enter the following command:
handin -c
cs640-1 -a PA1 -d <directory>
where
<directory> is the path to the directory where p1.tar.gz is
located
Make sure both the group members submit the same code.