Docsity

Geosynchronous - Computer Netrwork - Solved exam, Exams of Computer Networks

Toggle sidebar
bg1
Final Exam for Computer Networks Fall 2009
>>> SOLUTIONS <<<
Welcome to the Final Exam for Computer Networks. Read each problem carefully. There are ten required
problems (each problem is worth 10 points). There is also an additional extra credit question worth 10 points.
You may have with you a calculator, pencils and/or pens, erasers, blank paper, and one 8.5 x 11 inch “formula
sheet”. On this formula sheet you may have anything you want (definitions, formulas, homework answers, old
exam answers, etc.) as handwritten by you in pencil or ink on both sides of the sheet. Photocopies, scans, or
computer generated and/or printed text are not allowed on this sheet. Note to tablet PC users – you may not
print-out your handwritten text for the formula sheet. You have 120 minutes for the exam. Please use a
separate sheet of paper for the answer to each question. Good luck and be sure to show your work!
Problem #1
Answer the following questions on the basics of computer networks and the Internet.
a) Sketch the OSI model and briefly describe the function of each layer
0.5 each (4 pts total rounded up)
+------------------+
| Application | 7 – Provides access to applications
+------------------+
| Presentation | 6 – Provides data independence
+------------------+
| Session | 5 – Manages end-to-end connections
+------------------+
| Transport | 4 – Provides reliable end-to-end data transfer
+------------------+
| Network | 3 – Maintains point-to-point connections
+------------------+
| Data link | 2 – Provides reliable error-free point-to-point data transfer
+------------------+
| Physical | 1 – Transmission of bit stream (cabling, voltages, etc.)
+------------------+
b) Name the four factors of delay for a packet. Then, identify which factor will most likely predominate (i.e.,
be the largest factor) for 1000 Byte packets in a flow on a 1) 10 Mb/s LAN segment between two PCs in the
same building, 2) 1 Mb/s geosynchronous-orbit satellite link between the US and Nepal, 3) on the Internet
between the US and Nepal.
1 pt each identified largest factor (3 pts total)
The four factors of packet delay are processing, transmission, propagation, and queueing. For (1) the
predominant delay will be transmission in the 1 ms range (processing is microseconds, propagation is
nanoseconds, and queueing in non-existent), For (2) the propagation will be the largest delay (in the 100s of
milliseconds), and for (3) the largest delay will likely be queueing due to the many hops between the US and
Nepal.
c) This class has (correctly) been called a “jargon class”. Spell-out the following acronyms and identify which
layer(s) (in the 5-layer protocol model used in the book) they belong to – TCP, OSPF, IP, SNMP, MAC, and
SMTP.
0.5 pt each per acronym (3 pts total rounded-up) – no points off for missing OSPF
TCP = Transmission Control Protocol (layer 4), OSPF = Open Shortest Path First (layer 3), IP = Internet Protocol
(layer 3), SNMP = Simple Network Management Protocol (layer 5), MAC = Medium Access Control (layer 2), and
SMTP = Simple Mail Transfer Protocol (layer 5).
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Geosynchronous - Computer Netrwork - Solved exam and more Exams Computer Networks in PDF only on Docsity!

Final Exam for Computer Networks Fall 2009

>>> SOLUTIONS <<<

Welcome to the Final Exam for Computer Networks. Read each problem carefully. There are ten required

problems (each problem is worth 10 points). There is also an additional extra credit question worth 10 points.

You may have with you a calculator, pencils and/or pens, erasers, blank paper, and one 8.5 x 11 inch “formula

sheet”. On this formula sheet you may have anything you want (definitions, formulas, homework answers, old

exam answers, etc.) as handwritten by you in pencil or ink on both sides of the sheet. Photocopies, scans, or

computer generated and/or printed text are not allowed on this sheet. Note to tablet PC users – you may not

print-out your handwritten text for the formula sheet. You have 120 minutes for the exam. Please use a

separate sheet of paper for the answer to each question. Good luck and be sure to show your work!

Problem

Answer the following questions on the basics of computer networks and the Internet.

a) Sketch the OSI model and briefly describe the function of each layer

0.5 each (4 pts total rounded up) +------------------+ | Application | 7 – Provides access to applications +------------------+ | Presentation | 6 – Provides data independence +------------------+ | Session | 5 – Manages end-to-end connections +------------------+ | Transport | 4 – Provides reliable end-to-end data transfer +------------------+ | Network | 3 – Maintains point-to-point connections +------------------+ | Data link | 2 – Provides reliable error-free point-to-point data transfer +------------------+ | Physical | 1 – Transmission of bit stream (cabling, voltages, etc.) +------------------+

b) Name the four factors of delay for a packet. Then, identify which factor will most likely predominate (i.e.,

be the largest factor) for 1000 Byte packets in a flow on a 1) 10 Mb/s LAN segment between two PCs in the

same building, 2) 1 Mb/s geosynchronous-orbit satellite link between the US and Nepal, 3) on the Internet

between the US and Nepal.

1 pt each identified largest factor (3 pts total) The four factors of packet delay are processing, transmission, propagation, and queueing. For (1) the predominant delay will be transmission in the 1 ms range (processing is microseconds, propagation is nanoseconds, and queueing in non-existent), For (2) the propagation will be the largest delay (in the 100s of milliseconds), and for (3) the largest delay will likely be queueing due to the many hops between the US and Nepal.

c) This class has (correctly) been called a “jargon class”. Spell-out the following acronyms and identify which

layer(s) (in the 5-layer protocol model used in the book) they belong to – TCP, OSPF, IP, SNMP, MAC, and

SMTP.

0.5 pt each per acronym (3 pts total rounded-up) – no points off for missing OSPF TCP = Transmission Control Protocol (layer 4), OSPF = Open Shortest Path First (layer 3), IP = Internet Protocol (layer 3), SNMP = Simple Network Management Protocol (layer 5), MAC = Medium Access Control (layer 2), and SMTP = Simple Mail Transfer Protocol (layer 5).

Problem

Answer the following questions regarding the application layer.

a) In general, an application layer protocol defines four things. What are these four things?

1 pt each thing (4 pts total) An application layer protocol defines 1) types of messages, 2) syntax of messages, 3) semantics of messages, and 4) timing (when and how)

b) Describe HTTP in about 100 words.You will be graded on the completeness of your description given the

constraint of about 100 words.

Roughly 0.5 pt each underlined item (6 pts total rounded up) The HyperText Transfer Protocol (HTTP) is a stateless application layer protocol. HTTP is used to transfer web content between a browser application (client) and an HTTP server. All web content is identified by a URL. HTTP is a request-response protocol that typically uses TCP for assured delivery. HTTP uses ASCII encoded headers. The HTTP GET command retrieves HTML files and other objects. The GET header includes the URL of the object and other optional fields such as capability, languages, and so on. The response includes a response header with a code (e.g., code 200 is OK and 404 is page not found). Other commands include POST and HEAD.

Problem

Appendix A of this exam contains tcpClient.c with some “bugs”. Identify the bugs and briefly explain

how to fix them. Note that the program compiles and links successfully. The bugs are all quite major in scope.

You may write your answer directly on the appendix sheets.

1 pt each (10 pts total) The following are the bugs:

  • IP_ADDR is clearly wrong (333!)
  • Initialize Winsock stuff before step #1 is clearly wrong (closesocket()!?)
  • client_s not assigned in step #
  • server_addr.sin_family not assigned in step #
  • server_addr.sin_addr.s_addr = inet_addr(PORT_NUM) should be for IP_ADDR
  • sizeof(char) should be sizeof(in_buf) in the recv() in step #
  • The printf() after step #3 should have in_buf, not out_buf, as its argument
  • Missing “+ 1” for eol character in the send() in step #
  • The send() in step #4 is using in_buf and not out_buf as it should
  • The retcode error check should be “<” and not “==” in step #

Problem

Consider a data transfer protocol where data packets contain sequence numbers. A sender increments the

sequence number for each data packet sent. Design a receiver protocol that will send an ACK for each correctly

received packet (i.e., for a received packet with a sequence number one greater than that of the previously

received data packet) and a NACK for each out-of-sequence packet. The receiver begins operation when a reset

is initiated. The first received frame after a reset does not necessarily have “0” as its sequence number and can

otherwise be assumed to be in-sequence. It is acceptable if after a reset the receiver cannot detect lost frames

until after the first frame is received. Note that nothing is defined for how a sender may retransmit NACKed

packets or how the receiver should handle such retransmitted packets.

Problem

Answer the following questions on congestion control and fairness.

a) What is the fundamental trade-off in congestion control?

1 pt Throughput versus fairness

b) Sketch offered load versus carried load (goodput, if you will) for a packet switched network with no

congestion control, with ideal congestion control, and realistic congestion control.

1 pt each trace and showing of channel or link capacity (3 pts total) Carried load

Offered load

No congestion control

Ideal congestion control

Realistic congestion control

Channel capacity

c) TCP uses implicit congestion control. What is the “signal” implying the presence of congestion? What does

TCP do when it detects congestion? What problems may this cause in wireless networks?

1 pt each (3 pts total) TCP uses the time-out waiting for an ACK (from receiver to sender) as an implicit signal of congestion. TCP “guesses” that the ACK is due to a packet lost by overflow from a router buffer (and such overflow conditions are caused by congestion). TCP reduces its transmit rate (by shrinking its send window size) on detection of congestion. In wired networks most lost packets are due to congestion overflow. However, in wireless networks with high bit error rates many packets can be lost due to corruption and thus TCP will drop it send rate unnecessarily in such cases resulting in very low connection throughput.

d) Consider three senders, A, B, and C, that request 20, 8, and 30 Mb/s, respectively, on a 30 Mb/s channel.

Give a max-min fair allocation of the 30 Mb/s available bandwidth to the senders A, B, and C.

1 pt each (3 pts total) All nodes get 10 Mb/s in the first round. Only B is “happy” and returns 2 Mb/s. The remaining 2 Mb/s is allocated evenly to nodes A and C. Thus, the final allocation is A gets 11 Mb/s, B gets 8 Mb/s, and C gets 11 Mb/s.

Problem

Answer the following as it relates to the link layer and a telephony application. Suppose that a packet consists of

P bytes of data and 18 bytes of header. Consider sending a digitally encoded voice stream encoded at 128 kb/s.

Assume that a packet payload is completely filled (at a rate of 128 kb/s) before the packet is sent. The time to

fill the packet payload is called the packetization delay.

a) What is the packetization delay for packets with P = 46 bytes and P = 1500 bytes?

1.5 pts for each calculation (3 pts total and round-up) Packetization delay for P = 46 bytes = (46 * 8) / 128,000 = 2.875 milliseconds Packetization delay for P = 1500 bytes = (1500 * 8) / 128,000 = 93.75 milliseconds

b) What is the store-and-forward delay (transmission delay) for packets with P = 56 bytes and P = 1500 bytes

if the link rate is 10 Mb/s.

1.5 pts for each calculation (3 pts total and round-up) Store-and-forward delay is the same as transmission delay. So, Store-and-forward delay for P = 46 bytes = ((46 + 18) * 8) / 10,000,000 = 0.0512 milliseconds Store-and-forward delay for P = 1500 bytes = ((1500 + 18) * 8) / 10,000,000 = 9.715 milliseconds

c) Comment (and conclude) on the significance of the delays found in (a) and (b) above.

1 pt per item (4 pts total) The human threshold for delay is about 100 milliseconds (delays above this are noted as “annoying”). The packetization delay for the short packet is well below this threshold, but the packetization delay for the long packet is very close to the threshold. When the packetization delay plus store-and-forward delay is combined for a large packet, the delay exceeds the 100 millisecond threshold. This suggests that using small packets is essential for sending packetized voice such that excessive (and noticeable) delays do not occur.

Problem

Answer the following questions on wireless networks.

a) What is a “hidden terminal” and what challenges does it introduce.

1 pt for description and 1 pt for challenge (2 pts total) Assume that terminals A, B, and C are in a line. If A and C are too far apart to hear each other and B is in the middle and can hear A and C. Then A is a hidden terminal to C and visa versa. This can creates interference (and thus likely a corrupted packet) when, A (or C) is sending to B and then C (or A) also starts to send because it sees an idle medium. Note that an obstacle could also cause a hidden terminal situation.

b) As a mobile node gets farther and farther away from a base station, what are the two actions that a base

station could take to ensure than the loss probability of a transmitted frame does not increase?

1 pt for each way (2 pts total) The two possible ways are, 1) increasing the transmission power, and 2) reducing the transmission rate.

c) Can collision detection be feasibly implemented for a wireless channel? Why or why not?

0.5 pt for each (1 pt total) Collision detection is not feasibly possible in a wireless channel. Two fundamental reasons are: 1) the hidden terminal problem makes its impossible for all communicating stations to “hear” a transmission, and 2) when a wireless node is transmitting it cannot also receive (or “hear”) at the same time due to the generally very low signal level of a receive signal.

d) Give the CSMA/CA algorithm for both sender and receiver for 802.11 (WiFi)

4 pts for sender and 1 pt for receiver (5 pts total) For sender: (1) If sense channel idle for DIFS then Transmit entire frame (2) If sense channel busy then Start random backoff time Timer counts down while channel idle Transmit when timer expires If no ACK, increase random back-off interval, repeat (2)

c) What problem does a PKC solve?

2 pts A PKC solves the problem of having to distribute a secret key via a secure channel before communicating. This is especially difficult when two entities want to communicate for the first time.

d) Describe SNMP in about one or two sentences. Also, give an example of a management variable?

1 pt each (4 pts total) Simple Network Management Protocol is a request-response protocol where a manager station can GET or SET management variables from/to a database in managed devices. Managed devices contain an agent and a Management Information Base (MIB). The number of octets out from a given port is an example of a management variable.

Extra Credit

Answer the following questions regarding the textbook.

a) List the chapters by subject (or title) in the order that they appeared.

0.5 pts each (4 pts total rounded-up) Computer Networks and the Internet, Application Layer, Transport Layer, Network Layer, Link Layer and LANs, Wires and Mobile Networks, Multimedia Networking, Security in Computer Networks, and Network Management.

b) What did you like about the textbook?

3 pts Any insightful answer is acceptable.

c) What did you not like about the textbook? How could your “not like” issue be fixed?

3 pts Any insightful answer is acceptable.

Appendix A – Program tcpClient.c with some bugs

<< SNIP SNIP – header removed >> #define WIN // WIN for Winsock and BSD for BSD sockets

//----- Include files --------------------------------------------------------- #include <stdio.h> // Needed for printf() #include <string.h> // Needed for memcpy() and strcpy() #ifdef WIN #include <windows.h> // Needed for all Winsock stuff #endif #ifdef BSD #include <sys/types.h> // Needed for sockets stuff #include <netinet/in.h> // Needed for sockets stuff #include <sys/socket.h> // Needed for sockets stuff #include <arpa/inet.h> // Needed for sockets stuff #include <fcntl.h> // Needed for sockets stuff #include <netdb.h> // Needed for sockets stuff #endif

//----- Defines --------------------------------------------------------------- #define PORT_NUM 1050 // Port number used at the server #define IP_ADDR "222.222.222.333" // IP address of server

//===== Main program ========================================================== void main(void) { #ifdef WIN WORD wVersionRequested = MAKEWORD(1,1); // Stuff for WSA functions WSADATA wsaData; // Stuff for WSA functions #endif int client_s; // Client socket descriptor struct sockaddr_in server_addr; // Server Internet address char out_buf[4096]; // Output buffer for data char in_buf[4096]; // Input buffer for data int retcode; // Return code

#ifdef WIN // This stuff initializes winsock closesocket(wVersionRequested); #endif

// >>> Step #1 <<< // Create a client socket socket(AF_INET, SOCK_STREAM, 0); if (client_s < 0) { printf("*** ERROR - socket() failed \n"); exit(-1); }

// >>> Step #2 <<< // Fill-in the server's address information and do a connect with the // listening server using the client socket - the connect() will block. server_addr.sin_port = htons(PORT_NUM); server_addr.sin_addr.s_addr = inet_addr((char ) PORT_NUM); retcode = connect(client_s, (struct sockaddr )&server_addr, sizeof(server_addr)); if (retcode < 0) { printf("* ERROR - connect() failed \n"); exit(-1); }

Appendix B – FSMs for textbook RDT protocol