Docsity

Fundamental Measures - Computer Netrwork - Solved exam, Exams of Computer Networks

Toggle sidebar
bg1
Mid-Term Exam for Computer Networks Fall 2008
>>> SOLUTIONS <<<
Welcome to the Mid-Term Exam for Computer Networks. Read each problem carefully. There are six required
problems (each worth 16 points – you get 4 points for following these instructions correctly). There is also an
additional extra credit question worth 10 points. You may have with you a calculator, pencils, 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 on both sides of the
sheet. Photocopies, scans, or computer generated/printed text are not allowed on this sheet. You have 75
minutes for the exam. Please use a separate sheet of paper for each question. Good luck and be sure to show
your work!
Problem #1 (10 minutes)
Answer the following questions regarding the basics of computer networks and the Internet.
a) What are the fundamental measures of a communications system?
0.5 each and round-up (3 pts total)
Throughput, delay, loss, cost, mobility, robustness, and secrecy
b) What are the basics tasks of a communications system?
0.5 each and round-up (4 pts total)
Message formatting, error detection and recovery, addressing, routing, flow control, system management,
security, and QoS
c) Precisely define protocol and interface
0.5 each and round-up (3 pts total)
A protocol is a complete set of rules regarding information exchange between same level layers between sites.
An interface is a complete set of rules regarding information exchange between adjacent layers in a single site.
d) Sketch the OSI model. Describe the purpose of each layer.
0.5 each and round-up (3 pts total)
+------------------+
| 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.)
+------------------+
e) Name at least three standards organizations (in the area of communications) and briefly describe what they
standardize and how they operate.
1 each (3 pts total)
IETF – Internet standards (called RFCs). Entirely open, anyone welcome to come and present, everything posted
on the web. Build it, standardize it. IEEE – Ethernet and WiFi standards. Mostly open, mostly anyone can present,
most stuff presented on the web. ITU – Telephony standards. Closed. Invited by special permission. Only final
standard is available (and at a non-trivial cost). Standardize it, build it. ISO and FCC are other possible answers.
pf3
pf4
pf5

Partial preview of the text

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

Mid-Term Exam for Computer Networks Fall 2008

>>> SOLUTIONS <<<

Welcome to the Mid-Term Exam for Computer Networks. Read each problem carefully. There are six required

problems (each worth 16 points – you get 4 points for following these instructions correctly). There is also an

additional extra credit question worth 10 points. You may have with you a calculator, pencils, 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 on both sides of the

sheet. Photocopies, scans, or computer generated/printed text are not allowed on this sheet. You have 75

minutes for the exam. Please use a separate sheet of paper for each question. Good luck and be sure to show

your work!

Problem #1 (10 minutes)

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

a) What are the fundamental measures of a communications system?

0.5 each and round-up (3 pts total) Throughput, delay, loss, cost, mobility, robustness, and secrecy

b) What are the basics tasks of a communications system?

0.5 each and round-up (4 pts total) Message formatting, error detection and recovery, addressing, routing, flow control, system management, security, and QoS

c) Precisely define protocol and interface

0.5 each and round-up (3 pts total) A protocol is a complete set of rules regarding information exchange between same level layers between sites. An interface is a complete set of rules regarding information exchange between adjacent layers in a single site.

d) Sketch the OSI model. Describe the purpose of each layer.

0.5 each and round-up (3 pts total) +------------------+ | 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.) +------------------+

e) Name at least three standards organizations (in the area of communications) and briefly describe what they

standardize and how they operate.

1 each (3 pts total) IETF – Internet standards (called RFCs). Entirely open, anyone welcome to come and present, everything posted on the web. Build it, standardize it. IEEE – Ethernet and WiFi standards. Mostly open, mostly anyone can present, most stuff presented on the web. ITU – Telephony standards. Closed. Invited by special permission. Only final standard is available (and at a non-trivial cost). Standardize it, build it. ISO and FCC are other possible answers.

Problem #2 (10 minutes)

Consider two hosts A and B connected by a single link of rate r bits/sec. The two hosts are separated by d

meters. Signal propagation is p meters per second. Host A is sending to host B a packet of size S bits.

a) What is the propagation delay, tpr?

t (^) pr = d / p 2 pt

b) What is the transmission delay, t tr , of the packet?

t (^) fr = S / r 2 pt

c) Ignoring any possible processing and queueing delays, what is the end-to-end delay?

( d p ) + ( S r ) 3 pts

d) If Host A starts to transmit the packet at time t = 0, where is the packet at time t = t tr?

The last bit is just leaving Host A. 3 pts

e) Suppose that t pr > t fr. At time t = t fr where is the first bit of the packet?

The first bit is on the link and has not reached Host B. 3 pts

f) Suppose that t pr < t tr. At time t = t fr where is the first bit of the packet?

The first bit has reached (and likely received by) Host B. 3 pts

Problem #3 (15 minutes)

Answer the following questions regarding the Application Layer.

a) What is HTTP?

0.5 each and round-up (4 pts total) The HyperText Transfer Protocol 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 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, language, and so on. The response includes a response header with a response code (code 200 is OK and 404 is page not found). Other commands include POST and HEAD.

b) HTTP supports both non-persistent and persistent connections. Describe each type of connection and state

which HTTP protocol version supports each type. How is the type of connection specified in the HTTP

protocol?

1 each (4 pts total) In a non-persistent connection each HTTP request/response pair has its own TCP connection. A persistent connection supports multiple request/response pairs over a single TCP connection. HTTP 1.0 supports only non- persistent connection, HTTP 1.1 supports both types. The HTTP GET header specifies the type of connection to be used.

c) How does TCP determine the time-out (RTO we have called it) for implicit detection of packet loss? Be

brief.

1 each (4 pts total) An optimum RTO value should be just slightly longer than the pending RTT. TCP samples RTT values (i.e., measures them) and then uses exponential smoothing to get a “smoothed” SRTT value. The SRTT value is then multiplied by a constant to get RTO. Sampling of RTT values only occurs on non-retry transmissions. On retry transmissions, RTO is backed-off (doubled) with each successive time-out until a successful transmission occurs (i.e., an ACK is received). Exponential smoothing is implemented as SRTT ( k + 1 ) =α ⋅ SRTT ( ) k +( 1 −α) ⋅ RTT _ sample ( ) k. And then, RTO^ (^ k + 1 ) = β ⋅ SRTT (^ k + 1 ).

d) Assume that you have 10 Mb/s of bandwidth to allocate using proactive flow control. Assume you have five

nodes labeled A, B, C, D, and E that request the following amounts of bandwidth, A requests 5 Mb/s, B

requests 10 Mb/s, C requests 2 Mb/s, D requests 1 Mb/s, and E requests 50 Mb/s. Using a max-main fair

allocation, what amount of bandwidth should be allocated to each node?

2 each round (4 pts total) First round gives everyone 10 / 2 = 2, so 1, 2, 2, 2, 2 (for D, C, A, B, and E, respectively). This leaves 1 Mb/s leftover to distribute to A, B and E. The final distribution is then 1, 2, 2.33, 2.33, 2.33 for D, C, A, B, and E.

Problem #6 (10 minutes)

Answer the following questions about the network layer.

a) What is the fundamental purpose or service of this layer?

2 each (4 pts total) To deliver packets end to end.

b) The purpose of a routing algorithm is to find the least cost path from source to destination. What are some of

the possible cost metrics? Which metrics could cause stability problems (i.e., oscillation or route flapping)?

Why?

2 each (6 pts total) Cost metrics include hops, link capacity, throughput, congestion, and delay. Any metric that is a measurement of a realtime function of traffic is prone to causing stability problems. This is because the routing algorithm directly affects these measures.

c) For the six node network topology given below with link costs as shown, find the shortest path from node A

to node F using Dijkstra’s algorithm. Clearly describe the order of links as they are added one-by-one by the

algorithm and give the path cost from node A to the added node.

A

B D

C E

F

1

2

5

3

2 3 1

5

2

1

1 each step (6 pts total) One possible solution is:

  • AC (added cost = 1, path cost from A to C = 1)
  • CE (added cost = 1, path cost from A to E = 2)
  • AB (added cost = 2, path cost from A to B = 2)
  • ED (added cost = 1, path cost from A to D = 3)
  • EF (added cost = 2, path cost from A to E = 4)

Another possible solution is:

  • AC (added cost = 1, path cost from A to C = 1)
  • AB (added cost = 2, path cost from A to B = 2)
  • CE (added cost = 1, path cost from A to E = 2)
  • ED (added cost = 1, path cost from A to D = 3)
  • EF (added cost = 2, path cost from A to E = 4)

Extra Credit (10 minutes)

Sketch the FSM for the following connection establishment protocol between a sender and a receiver.

When the receiver receives a CONNECT packet from the sender it replies to the sender with an ACK. The

receiver than waits for an ACK packet from the sender. If an ACK is not received within 10 seconds, the

receiver sends an RST and waits for another SYN packet, otherwise it enters a connected state

1 for each state, 1 for timer, and 2 for each transition (10 pts total)

Wait_1 Wait_


| Receive a CONNECT | Connected |-------------------------------------------->| -------- | Send an ACK, reset and start timer | Receive an ACK | | |--------------------->| | timer expires | | |<--------------------------------------------| | Send a RST | | |

Note: The timer is set to 10 seconds on reset

  1. if (connect_s < 0)
  2. {
  3. printf("*** ERROR - accept() failed \n");
  4. exit(-1);
  5. }
  6. // Copy the four-byte client IP address into an IP address structure
  7. memcpy(&client_ip_addr, &client_addr.sin_addr.s_addr, 2);
  8. // Print an informational message that accept completed
  9. printf("Accept completed (IP address of client = %s port = %d) \n",
  10. inet_ntoa(client_ip_addr), client_addr.sin_port);
  11. // Send to the client using the connect socket
  12. strcpy(out_buf, "This is a message from SERVER to CLIENT");
  13. retcode = send(connect_s, out_buf, strlen(out_buf), 0);
  14. if (retcode < 0)
  15. {
  16. printf("*** ERROR - send() failed \n");
  17. exit(-1);
  18. }
  19. // Receive from the client using the connect socket
  20. retcode = recv(connect_s, in_buf, (sizeof(in_buf) + 1), 0);
  21. if (retcode < 0)
  22. {
  23. printf("*** ERROR - recv() failed \n");
  24. exit(-1);
  25. }
  26. printf("Received from client: %s \n", in_buf);
  27. // Close the welcome and connect sockets
  28. retcode = closesocket(welcome_s);
  29. if (retcode < 0)
  30. {
  31. printf("*** ERROR - closesocket() failed \n");
  32. exit(-1);
  33. }
  34. // Clean-up winsock
  35. WSACleanup();
  36. }