Assessed Coursework -- Networking (G6016)


Please answer all questions. The coursework is worth 50% of the overall mark. Remember, this is an assessed piece of work. Please do not collude or plagiarise other people's work as the standard university penalties for doing so will be applied.


Part 1 (30%):

  • List the five layers of the Internet and briefly describe their functions.
  • Discuss the concepts of ports and sockets as used in networking. Focus on functions, similarities and differences.
  • Successful network protocols evolve over time to adapt to new requirements. If you were asked to design a network protocol, what would you do to make protocol evolution easier? Think in particular about the packet format.
  • TCP has flow control and congestion control. Explain what both are used for and how they are different. What parts of the TCP header are used for flow-control, and what parts are used for congestion control?
  • Recall that in each TCP segment, the receiver specifies in the Receive Window header field the amount of additional received data (in bytes) that it is willing to buffer for the connection. What happens when the receiver sets the Receive Window to 0? How can a Receive Window that has been set to zero be later set to values > 0?

Part 2 (70%): The following are intentionally vague descriptions. Please state additional assumptions you make (for example with brief comments in your code). To ensure I can test your software, your submitted source code for each program should include a brief and understandable description of how to use it. If I am unable to compile your code, or unable to use it because it lacks appropriate documentation, you will get 0 points for this part of the coursework.

Design a tiny file-server protocol that allows you to do the following things:

  • Connect to a remote machine, with or without exchanging a password (as chosen by the server).
  • Change directories on the local and the remote machine.
  • List the content of the current directory on the local and on the remote machine.
  • Get a file from the current directory of the remote machine and store it in the current directory of the local machine.
  • Put a file from the current directory of the local machine and store it in the current directory of the remote machine.

Describe the layout of the packet data in your protocol, and what it means. Describe what underlying transport protocol you use and why.

Implement a server fss and a client fsc for your protocol. Both must run on the UNIX command line as follows. Running

   
  fss 2845

starts the server on port 2845. If the server cannot be started (for example because port 2845 is already being used), then the server should print out a message to this effect and terminate. Likewise, running

   
  fsc potato.some-domain.sg 48324

starts the client which will connect to the remote machine (here potato.some-domain.sg) at port 48324. If the client cannot connect, it should print a message to this effect and terminate. Naturally, client and server should be runnable at arbitrary ports.

The client and server should support the following commands:

  • passwd: sent by the server requests a password from the client upon login.
  • passwd pw: sent by the client supplies the password pw to the server.
  • rcd name: changes the remote current directory to name
  • lcd name: changes the local current directory to name
  • lls: list local directory
  • rls: list remote directory
  • put name: takes the local file name and saves it in the remote server's current directory
  • get name: gets the remote file name and saves it in the local server's current directory
  • exit closes the client (but not the server)

Both client and server should implement a logging mechanism as follows. The client logs all significant events into a file fsc.log. Significant events include starting up, terminating, connecting to a server, failing to connect to a server, getting a file, putting a file, changing the local directory, changing the remote directory, listing the remote directory and listing the local directory. Here is an example entry of fsc.log.

   
   12:13:03 connecting to load.toad.net port 8434
   12:13:04 connected with local port 4112 to load.toad.net port 8434
   12:13:04 changing local directory to pictures
   12:13:07 listing remote directory
   12:13:07 changing remote directory to Pics
   12:15:33 putting grape.jpg
   13:02:57 Exiting

The server similarly logs all its significant events, but to the file fss.log. The server must log additional events like clients connecting and disconnecting. When logging a client action, the server must log the clients IP address/FQDN and port number. When the server or client is started and the relevant log file does not exist, it is created. If the log file already exist, new events must be appended at the end. Don't forget to close the file if your program terminates.

The server fss should support an access control facility as follows. Upon start-up, fss reads a file forbidden.txt (in the local directory) containing zero or more IP addresses and FQDNs each in a separate line of forbidden clients. Here is an example:

   
   www.flying-saucers.com
   228.45.177.9
   news.bbc.co.uk
   chfc2-brig19-0-0-cust1.brig.cable.ntl.com

If a client tries to connect to the server from an IP address that is listed in forbidden.txt, or if there is a FQDN in forbidden.txt that resolves to that IP address, then the server sends a message to the client "Connection refused." and closes the connection. If forbidden.txt contains an entry that is neither an IP address nor a valid FQDN, then the server should log this problem and terminate.

The password mechanism should work as follows. When the server fss is started, and a file passed.txt exists in the local current directory containing a password, then the server will query every connecting client for a password, and refuse connection (as above) if the client supplied password is wrong. If the client-supplied password is correct, the connection is admitted and proceeds as before. Make sure your logging mechanism is appropriately modified to cater for the password mechanism.

I will test your applications on the Unix teaching server, so testing it on that machine before submission might be a good idea.

Breakdown of grades. If you complete only part of the coursework, here is a guide to how much some parts are worth. Percentages refer not to the overall grade for the coursework, but only Part 2 of the coursework.

  • Protocol design and description of packet data: 15%
  • Loggin mechanism: 10%
  • Access control: 15%.
  • Working implementation of the core protocol (without logging and access control list): 60%

What and How to Submit: To assure anonymity, please submit via the course's Study Direct page, where I have set up a link for that purpose (Week 8). Submission format:

  • Please do not put your names on your submissions, but do put your candidate numbers on all files you submit.
  • Your answers to part 1 must be a PDF file or written in plain ASCII text, the answers to the second question should be a PDF file called protocol.pdf or a plain ASCII file protocol.txt describing your code and two Java files called fss.java and fsc.java containing your code.
  • Please zip-archive of or submissions, containing everything you want to submit. Submit only that archive as one file.

When to Submit: The deadline for submission is Thursday, Week 8 (26th of November), 16:00.