CIS 410/510 Introduction to Networks
Winter 1998

Program #2: Multicast Address Lookup and File Transfer

Handed Out: 18 February 1998
Due: 11 March 1998 by 5pm

Description

  1. Multicast Address Lookup

    Modify your UDP client and server to perform multicast address lookup. The client sends a name lookup query as in the previous program, but instead of unicasting it to a server it multicasts it to a well-known group. The UDP servers all join this multicast group and hear all queries sent to the group. The server that has the requested name and address in its host table responds to the query by multicasting a response back to the same group. The client listens to this same group to hear the reply.

    The queries and replies for this program have the same format as with the previous program. However, a server will never send a redirect, unknown, or error.

    The server and client should otherwise run the same as in the previous program. The client should still be able to do download queries after it uses multicast to lookup the appropriate address.

    The UDP server should be run with arguments listing the port it will listen on, the multicast group it will listen on (given as an IP address), and the name of its host table file:

    udpserver [port] [group] [table]
    The client should run with arguments listing the port the servers are on, the multicast group it will query, the name of its host table file, a file containing a list of queries, and the TCP port:
    client [server] [port] [group] [host] [queries] [TCPport]
    Note that the client won't actually use the server name or host table for this assignment, but theoretically a client could do both unicast and multicast queries. The server should run indefinitely, handling all queries. The client should exit gracefully after completing all queries.

  2. Client Timeout
    (undergrads:optional, grads:required)

    Because the servers will not respond for error or unknown queries, the client needs a mechanism for it to timeout when it does not receive a response. Modify the client to use the select system call, with an appropriate timeout value, so that the client gracefully halts its query when none of the servers have the name in their host tables.

Output

Your program should produce the following output for each of the parts:
  1. Multicast Address Lookup
    Querying UDP servers in [group] for host [name] ...
    Resolved to address [address]
    You should also be able to handle file transfer with multicast lookup:
    Querying UDP servers in [group] for host [name] ...
    Resolved to address [address]
    Querying TCP server [name]/[address]/[port] for file [name] ...
    Received file:
  2. Client Timeout
    Querying UDP servers in [group] for host [name] ...
    No response after X seconds

You should handle errors in the same way as for program 1, with the exception of not receiving error messages from servers.

Deliverables

Things you should turn in on paper:

You should turn in a printout of all your source code and your Makefile. All code should be well documented so that I can understand what you have written. Use your judgement on the amount of documentation you think is needed to fulfill this purpose. You should also turn in a printout of sample output using a battery of tests that you have designed to test all cases given above. Organize the printouts so that I understand what each piece of paper is demonstrating. You should turn in all the info for the client and both the UDP and TCP servers.

Things you should turn in online:

Submit your source code, object code, documentation and your Makefile (or a batch file that compiles everything if you don't know how to do Makefiles). This includes code for the client and both the UDP and TCP servers so I can do all the tests mentioned above. Use the submit program documented in the Assignments section of the class web page.

Grading

Grading will be based on a battery of tests based on the scenarios outlined above and judged on the output your program produces. Borderline grades can be pushed up or down a level by the quality of the documentation.

Note: If you did not get a chance to finish everything the first time around, you should fix things this time around to get everything working. Your grade will reflect how much of a completely-functional system you have, based on the specifications of this handout, including the TCP server.