



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A programming assignment for a university course on computer networks (cmsc 417) where students are required to write a simple name server and a resolver. The assignment involves implementing mechanisms for re-transmissions and checksum computation for udp packets. The server and clients communicate using udp and query a resident database for hostname to ip address mappings.
Typology: Assignments
1 / 6
This page cannot be seen from the preview
Don't miss anything!




CMSC 417 Computer Networks Spring 2009
Assigned: February 13 Due: February 23, 23:59:
In this project, you will write a simple name server and a resolver. The real domain name service in the Internet is used to resolve the mapping between a hostname and an IP address. As usual, the server will run on a machine at a well-known port number. The clients, called resolvers, will contact the server with queries about hostnames and IP addresses. The server has a resident database of hostname to IP address mappings. The database and routines to access it will be provided to you. On receiving a name service query, the server will lookup the query in the database and respond with an appropriate answer. The server and the client (resolver) will use UDP to communicate with each other. UDP is an unreliable protocol. Thus, for various reasons, UDP packets may be lost in the network. In this assignment, you will need to implement two new mechanisms:
The protocol works as shown in Figure 1. The client will construct queries of different types and send them to the server. The server will query its internal database for each client query and send back a response. The client is responsible for re-transmitting any query that gets lost or corrupted in the network. Details of the protocol follow.
Query Response
Database
Another query
Response
Retransmitted query
Packet loss
Set
Timeout
Timer
Figure 1: protocol outline
Both query and response packets have the same packet structure shown below. The maximum size of each packet is 256 bytes. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version|T|D|S|U| Length | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Query-ID | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | | Data | | .... | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Version (4 bits) The version field for the protocol should be set to 1111.
Packet-type (T) (1 bit) Set to 0 for query packet, and 1 for response packets
Data-type (D) (1 bit) The data bit is set to 0 if the data field is an IP address, and 1 if it is a hostname.
If the server does not reply within a pre-defined time period (i.e., the retransmission timer expires before receiving responses from the server), the client will re-try its query. The server is completely stateless, i.e., it does not remember which queries it has served, from whom, and when. If it receives the same query from the same resolver, the server will answer as appropriate. Note: Clients must be able to disambiguate stale responses from the server. Thus, if a client gets a response which does not match the latest Query-Id, it should ignore this response and not re-set the retransmission timer. The checksum is one’s complement of the one’s complement sum of all 16-bit words in the packet. Compute the checksum in the following manner:
You will have to write both the server and the client for this assignment. No TCP connections are allowed. We will have a server up and running for you to test and debug your client. The server we provide, however, will not drop, delay, or damage the packets it sends. You may modify your own server to simulate poor network conditions if you want to test your client more intensively, but the server you turn in should operate normally (i.e., no dropping, delaying, or damaging the packets). The name server and the client executables will accept the following command line arguments:
The server will query entries in the database using the following interface routines :