CS422: Fall2005 Midterm
| Question |
Max. |
Current |
| Part I. True and False |
10 pts. |
|
| 1-5 |
15pts |
|
| 6-10 |
15pts |
|
| 11-15 |
15pts. |
|
| 16-19 |
15 pts. |
|
| 20. |
10 pts |
|
| 21. |
10 pts |
|
| 22. |
10 pts |
Part I. Answer True or False (T/F) (1 point each).
T__ RS232 uses +15 V to represent a 0.
F__ If A has a half duplex communication to B then A can
send data to B but B will not be able to send data back to A.
T___According to Shannon's theorem, if there is no noise in a
chanel then the throughput can be infinite.
F___Assuming odd parity, if a receiver receives a character 01110110 it will trigger an error.
F___Checksum is able to detect positional errorsT___The maximum throughput of a T1 line is 1.544Mbps
T___ The TTL field in an IP packet uses 8 bits
F___ The host hat originates an IP packet may fragment a
packet if it is larger than the MTU of the network.
F___ 802.11b is able to send up to 54Mbps
Part II. Answer the following questions:
1. (3 pts) Explain what is quantization noise.
Digital encoding has a finite number of levels. Quantization noise
is
caused by rounding errors.
2. (3 pts) Explain why data is modulated in a carrier wave.
3. (3 pts) Explain why "byte stuffing" is used in RS232.
4. (3 pts) Explain the sequence of events that could lead an
Ethernet packet to take a long time to be delivered.
- Successive collisions might cause an Ethernet packet to take a
long time to be delivered.
- This might be caused by a high usage of the network.
5. (3 pts) Explain why 802.11 uses CA (Collision Avoidance) instead
of Collision detection.
Because two machines sending at the same time might not be able to
detect collisions if both are out of range of each other.
6. (3 pts)Explain the characteristics of ATM that make it better than
Ethernet to send real time data like voice and video.
- ATM sets up a virual circuit in the switches in the path that
reserves bandwidth before the transmission.
8. (3 pts) What is the difference between a repeater and a bridge?
- repeater
+ analog
+ repeats noise and collisions
- bridge
+ digital
+ understands packets
+ only forwards packets if destination is in
the opposite segment.
10. (3 pts) Enumerate the 5 layers in the TCP/IP layering
11. (3 pts) What is it done in the Internet to ensure that real time
traffic like Voice over IP have acceptable delays?
- Increase network bandwidth so that the utilization is low and queueing delays are small as well.
- Make real time traffic have a higher priority.
- Route real time traffic through a different faster path.
12. (3 pts) Explain what the following line is used for in your HTTP
server
int optval = 1;
int err = setsockopt(masterSocket, SOL_SOCKET, SO_REUSEADDR, (char *)
&optval, sizeof( int ) );
13. (3 pts) Describe the Layering principle
- A module at layer i will receive messages that were originated
only from layer i.
- A module at layer i can only communicate with one layer above and
below.
15.(3 pts) Computer A will send an IP packet to B where B and A are
in the are in the same Ethernet network. Describe the packets that are
exchanged assuming that A does not know B's MAC address.
19. (6 pts)Write a diagram with the fields of an IP packet and the
lengths of the fields
(refer to books)
| 20. (10 pts) From lab3 write the procedure void dumpURL(const char *
url ) that will print in stdout the requested URL. void dumpURL(const char * url ) {
|
21. (10 pts.) From lab4, assuming you have a
procedure void dispatchHTTP( int slaveSocket) that processes
the request and closes slaveSocket, write the loop server code
for a) iterative server, b) concurrent server using fork, c) concurrent
server creating a thread
after each request, and d) pool of threads, in the
procedures indicated. Each procedure receives as argument the master
socket already initialized and ready tobe used inside accept. void iterativeServer( int masterSocket) {
<>void forkServer( int masterSocket) { } void poolOfThreads( int masterSocket) { } void createThreadForEachRequest( int masterSocket ) { } // Other procedures |
| 22. (10 pts) From lab4 write the function that
implements
cgi-bin that executes programs stored in the directory cgi-bin/. The
"document" variable contains the name of the program or script as well
as the variables in the form "prog?a=b&c=d..." // Global variables void dispatchCGIProgram( int slaveSocket, char * document ) } |