CS422: Fall2006 Midterm


Name:___________________________________________

 

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).

___ The application that promoted the start of the Internet was remote computer access.

___  Quantization noise is possible in analog encoding.

____In RS232 the start bit is 1

____AM is more succeptible to noise than FM.

____SOH is encoded as ESC Y in byte stuffing

____The formal name of the Ethernet twisted pair is 10Base-T

____ Entries in a routing table are ordered from the most general first to the most specific.

____ The maximum throughput for 802.11g is 54Mbps

____ WEP stands for Wired Equivalent Policy

____ CSU/DSU stands for Central Service Unit/Data Service Unit


Part II. Answer the following questions:

1. (3 pts) Define a) Bandwidth, b) Throughput, and c) Delay




2. (3 pts) Write down Shanon's theorem and describe each of its parameters.






3. (3 pts) Explain  how "Packet Switching" ensures fairness.







4. (3 pts) Explain how using "Checksum" for error detection could  have some undetected errors.






5. (3 pts) Explain how network applications that do not follow the locality principle can be modified to follow the locality principle.






6. (3 pts) Explain how the Ethernet Exponential Back Off mechanism works.







7. (3 pts) Explain the main disadvantage of using network broadcast too often.






8. (3 pts) Explain why wireless networks use Collision Avoidance instead of Collision Detection like the Ethernet do.


9. (3 pts) Write the equation for queuing delay. What does this equation mean for applications that use real-time Internet traffic like Voice Over IP (VoIP)?




10. (3 pts)  Enumerate the layers of the ISO-7 Layer Reference Model








11. (3 pts) Explain the differences between a switch and a hub.







12. (3 pts) Explain why routers and hosts should know the subnet mask of the networks they are connected to.






13. (3 pts) Explain the Layering Principle






14. (3 pts)  When a router forwards a packet to a different network, what fields in the IP packet are modified? (Assume there are no IP options and no fragmentation is done).





15. (3pts) Explain how is the TTL field updated in an IP packet.






16. (3 pts)  Computer A will send an IP packet to computer B in a 802.11b network. Enumerate the packets needed in this exchange. Assume that A already knows the hardware address of B.








17. (3pts) Draw a diagram of an Ethernet packet showing all the fields of the Ethernet packet as well as the length in bits of each field.







18. (6 pts) Draw a diagram of an IP packet showing all the fields and the length in bits of each field.




19. Assume the following part of the Internet. There are 6 errors in the routing table and address assignment. Mark the errors and explain why.

Routing Problem




Part III. Programming questions

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 )
{































}