CS 779/879 Design of Network Protocols Open Book & Notes

advertisement
CS 779/879
Design of Network Protocols
Spring 2007
Midterm Exam
Time 2 & 1/2 hours
Open Book & Notes
Name:
Login:
Each Question is 10 points.
1
1. How to find out the IPv4 and the IPv6 addresses of host “somethingextra”?
2. Many of the servers in our textbook examples uses port SERV_PORT.
a) How to find out if there is a current running process that uses this port?
b) How to find out the name of the user who is running this process?
c) Is it possible to find more than one running processes using this port? Explain?
2
3. Consider the following routing table of a give UNIX OS host:
Destination
Gateway
Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ --------128.82.4.0
128.82.4.209
U
1 2432 eri0
224.0.0.0
128.82.4.209
U
1
0
eri0
default
128.82.4.253
UG
1 265
127.0.0.1
127.0.0.1
UH
6 2056 lo0
Describe the meaning of the “default” row in this table?
4. Consider the following two programs:

Receiver <port>
<mcast_addr>
This program creates a udp socket, binds it <port> and INADDR_ANY, joins mcast address:
<mcast_addr> and then displays any message received.
The option SO_REUSEADDR is on for the udp socket.

Sender
<address> < port> <message>
The program sends <message> to ( <address> < port> )
3
Assume we have executed the Receiver on something (128.82.4.210) and the Sender on somethingelse
(128.82.4.120) as follows:
% Receiver 9877
> File1 &
% Receiver 7789
> File2 &
% Receiver 9877
224.2.2.2
> File3 &
% Receiver 9877
224.1.1.1
> File4 &
% Receiver 7789
224.1.1.1
> File5 &
% Sender 128.82.4.210
9877
“HI 1111”
% Sender 224.1.1.1
9877
“HI 2222”
% Sender 224.2.2.2
9877
“HI 3333”
% Sender 224.3.3.3
9877
“HI 4444”
% Sender 224.1.1.1
7789
“HI 5555”
% Sender 127.0.0.1
7789
“HI 6666”
% Sender 128.82.4.210
7789
“HI 7777”
What is the output of the following statements?
% cat File1
% cat File2
% cat File3
% cat File4
% cat File5
4
5. The above Receive program may receive multicast or unicast messages. Discuss if is it
possible for the program to tell if a received message was sent as multicast or unicast.
6. How to use Stevens’s sock program to implement the functionality of the following
statements:
% Receiver 9877 224.2.2.2 > File3
and
% Send 224.2.2.2
9877 “HI 3333”
5
7. How to use the tcpdump program to capture all the traffic (and no other traffic) generated by
these two commands in Question 6?
8. What is the difference between multicast address and multicast group?
If two persons randomly select two multicast groups g1 and g2, what is the probability that
g1 and g2 are the same?
6
9. Consider a lazy TCP daytime Server S that sleeps 75 seconds before serving a client. Assume
that S backlog value is 0 and it is running on Solaris 10 (thus its accept queue size value is 1).
If a client C generates one request every 5 seconds and it started at the same time as S and
there are no other clients will connect to S.
Which requests among the first ten requests generated by C will get the daytime from S?
10. To handle many concurrent clients, a server may use either select, fork or thread. If a server
decides to use select, what is the maximum possible number of simultaneous of clients it can
handle?
7
Download