Homework Assignment 2 Questions - Computer and Network Security | CS 472, Assignments of Computer Systems Networking and Telecommunications

Material Type: Assignment; Professor: Kain; Class: Computer Networks: Theory, Applications and Programming; Subject: Computer Science; University: Drexel University; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-23f
koofers-user-23f 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS472 Computer Networks
Fall 2008
Homework Assignment # 2b
Due Date: Monday, October 20th, 2008 at 5:59pm
NOTE: Assignments must be submitted in electronic format to [email protected].
All the work must be original, no team work. Late assignments will not be accepted. Please
submit your assignment as your firstname and lastname as a zip file (e.g. mine would be
mkain_hw2b.zip)
Objective
This assignment asks you to implement a popular network protocol by interpreting and
implementing the specifications of an RFC. You will be writing a DNS server which is to
interact with the client you have already written. There are also questions about the security of
the protocol to be turned in with the client submission.
Problem
In Part B of the assignment, you are to implement a DNS cache server. You are to implement a
TCP CONCURRENT server (any of the three models discussed in class are acceptable) and an
UDP server.
You are to write the client code in C, C++, or Java ONLY. Libraries such as the libnsl, libresolv,
and libsocket with C/C++ and the package java.net are the ONLY permissible libraries that you
can use for socket programming. In case you do need to use some other library, please confirm
with the Professor and the TA first.
It is your responsibility to ensure that the code runs on tux.cs.drexel.edu or is entirely portable to
be run by the TA anywhere. Code that doesn’t meet either of these two requirements will be
graded as a zero. ALL source code must be available to the TA for inspection.
Input / Command Line
The server program should accept the following command line arguments:
The first argument is required and is the filename that logs all the messages received by and
generated by the server. Each message is to be logged in a single line. The message should
include some timestamp, client identification (IP address and port number) and the data sent.
The last argument is required and denotes the port number for the server to run on (since there
already is an DNS server running on port 53, you will have to specify a different number).
A sample command line would be:
dnsserver serverlog 5353
pf3

Partial preview of the text

Download Homework Assignment 2 Questions - Computer and Network Security | CS 472 and more Assignments Computer Systems Networking and Telecommunications in PDF only on Docsity!

CS472 Computer Networks

Fall 2008

Homework Assignment # 2b

Due Date: Monday, October 20 th, 2008 at 5:59pm

NOTE: Assignments must be submitted in electronic format to [email protected]. All the work must be original, no team work. Late assignments will not be accepted. Please submit your assignment as your firstname and lastname as a zip file (e.g. mine would be mkain_hw2b.zip)

Objective

This assignment asks you to implement a popular network protocol by interpreting and implementing the specifications of an RFC. You will be writing a DNS server which is to interact with the client you have already written. There are also questions about the security of the protocol to be turned in with the client submission.

Problem

In Part B of the assignment, you are to implement a DNS cache server. You are to implement a TCP CONCURRENT server (any of the three models discussed in class are acceptable) and an UDP server.

You are to write the client code in C, C++, or Java ONLY. Libraries such as the libnsl, libresolv, and libsocket with C/C++ and the package java.net are the ONLY permissible libraries that you can use for socket programming. In case you do need to use some other library, please confirm with the Professor and the TA first.

It is your responsibility to ensure that the code runs on tux.cs.drexel.edu or is entirely portable to be run by the TA anywhere. Code that doesn’t meet either of these two requirements will be graded as a zero. ALL source code must be available to the TA for inspection.

Input / Command Line

The server program should accept the following command line arguments:

The first argument is required and is the filename that logs all the messages received by and generated by the server. Each message is to be logged in a single line. The message should include some timestamp, client identification (IP address and port number) and the data sent.

The last argument is required and denotes the port number for the server to run on (since there already is an DNS server running on port 53, you will have to specify a different number).

A sample command line would be: dnsserver serverlog 5353

This would run the dnsserver offering its service at port 5353.

NOTE: You can implement these services through one program (which offers both TCP and UDP services) or two programs (TCP in one program and UDP in another).

Protocol details

Refer to the same RFC references as the first part of the assignment for protocol messages and semantics.

Your server should be able to respond to your client program by implementing the following features:

  • It must set up a listening socket to accept connections for the TCP server.
  • Upon startup, your servers should read /etc/resolv.conf and find the first name server specified there. It should use the IP address specified for all traffic (to port 53).
  • Adequately handle error conditions, non-supported commands and generate a message to the server log as well as send the appropriate message back to the client.
  • Implement a local cache of successful requests, so it does not have to requery the DNS nameserver for all known requests.
  • The DNS cache should implement some type of aging strategy for cache entries, so that the memory will not grow forever.
  • The general flow would be when a DNS request comes in from a client, that the cache is first checked, and if it can be satisfied from the cache, then the answer is returned to the client. Otherwise, a query is sent to the nameserver. The response from the nameserver is cached by the server and the response is returned to the client. This should be easily seen from looking at the server log.
  • A daemon implementation (where the servers are not connected to the terminal and will still exist after the login shell exits) is not required (but a nice touch), and will be worth 5 extra points.
  • The TCP and UDP servers do not have to share the same cache, but it is desirable.

Testing / Debugging

You should test your server with your client (from part A) to make sure that it works. Wireshark will also be very helpful in debugging your servers.

Additional Questions (to be submitted)

  1. Can the server detect attacks from clients for records?
  2. Since the server is caching the data for multiple clients, should it be more security-conscious about adding something to the cache from other servers? Suggest some ways that it can do this?