CS 779/879
Design of Network Protocols
Spring 2005
Final Exam
Time 2 & 1/2 hours
Open Book & Notes

 

 

Name:                              
Login:

 


 

Q1: [15 points]

In achieving Server concurrency, we may use one of the following three techniques:

1.     Fork a process for each client

2.     Create a Thread for each client

3.     Use Select/Poll to monitor all clients

Describe the proms and cons of each technique.


 

Q2: [35 points]

Write a tcp-based program C that allows two persons A and B to chat with each other.  The syntax of using C is:

% C    <host>

Where <host> is an IP address of the other person.

 

For example, person A types:

% C    <ip-address-of-host B>

 

While person B types:

% C   <ip-address-of-host A>

C creates a tcp socket t, connects it to <host> at port 4444. If the connection is not established within 4 seconds, it waits for a connection from <host> and port 4444 for at most 40 seconds.

Any connection that comes from a different host or a different port should be rejected.

When the connection is established, C displays the message:

“Please type any thing followed by return. To exit type ctrl-D”

The program then concurrently (using any of the techniques mentioned in Question 1):

1.     Reads any message from the keyboard and the sends it to t

2.     Receives any message from t and displays it to the TTY.



Q3: [30 points]

In the following we would like to develop a udp  tunnel to allow two different groups (e.g., one at ODU the other at UNC) to chat using multicast as shown below:

 

 

 

 

 

 

 

 


Write the code for T. The syntax of using T is:

% T    <host>

Where <host> is  the IP address of the other end of the tunnel.

T creates two sockets:

1.     A udp socket u connected to <host> and port 2222.

2.     A multicast socket m that joins the multicast group “::ffff:224.1.1.1/4444”.

T then concurrently:

1.     sends any message received from u  to m.

2.     sends any message received from m  to u.

Make sure to set theloopback” of m appropriately.


 


Q4: [20 points]

 

 

A.  Consider a TCP-based server. How the server may shut down a connection that stays idle for more than 10 minutes.

 

B.  Consider a SCTP-based server (STREAM or SEQPACKET). How the server may shut down an association that stays idle for more than 10 minutes.

 

C. How a TCP client can send an RST segment to the Server?

 

D. Explain how the IPv6 managed to quadruple the IP address size while only doubling the size of the IP header.