Guest User

Untitled

a guest
May 25th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.10 KB | None | 0 0
  1. Question 1 - High level TCP [4 marks]
  2. a) What is TCP? (2 marks)
  3. b) Name the four things that uniquely identify a TCP connection. (1 mark)
  4. c) Explain when you might choose not to use TCP. (1 mark)
  5.  
  6. Model answer:
  7. a) Transmission Control Protocol, a networking layer that allows hosts on a network to reliably transfer a stream of bytes in the correct order.
  8. b) Source address, source port, destination address, destination port.
  9. c) TCP may provide unnecessary overhead for simple one-shot protocols, or may affect realtime delivery by attempting to retransmit non-essential data.
  10.  
  11. Marks:
  12. a) 1 mark for expanding the acronym, and 1 mark for having any reasonable description of TCP (network layer over IP, reliable ordered stream of bytes).
  13. b) 1/2 mark for two, or a full mark for all four.
  14. c) 1/2 mark for only giving concrete examples, such as "DNS" or "video streaming", 1 mark for mentioning a scenario (e.g "connection setup would be too costly", "too much overhead for realtime delivery" or "retransmission of data would be useless after timeouts").
  15.  
  16. Rationale:
  17. I think it is important for students to have a clear definition for TCP, as well as the basics of a connection. A good understanding of a topic begins and ends with a clear and concise definition. I also think students should be aware of the cases where TCP is not a good option.
  18.  
  19.  
  20. Question 2 - TCP benefits [6 marks]
  21. TCP defines solutions for several potential networking issues. Three examples of this are packet loss, data corruption, and network congestion.
  22. a) For each of these three issues, how does TCP addresses these concerns? (3 marks)
  23. b) For each solution, point out a limitation of this approach. (3 marks)
  24.  
  25. Model answer:
  26. a)
  27. i) Packet loss is addressed by requiring receivers to acknowledge received data in a timely fashion, or the packet is assumed lost and retransmitted.
  28. ii) Data corruption is addressed by calculating and verifying a checksum on each packet.
  29. iii) Congestion is addressed by slow start and congestion avoidance algorithms.
  30. b)
  31. i) Packets might be assumed lost too early and retransmitted unnecessarily, wasting bandwidth.
  32. ii) Checksums are fallible by nature (pigeonhole principle), and can erroneously approve corrupted packets in some cases.
  33. iii) If the level of traffic on the network changes abruptly, communications may take some time to adjust, under-utilising the available bandwidth.
  34.  
  35. Rationale:
  36. Students should understand the obstacles TCP faces, and how it attempts to deal with them. Covering the drawbacks of an approach helps ensure that the methods are correctly understood.
  37.  
  38. Question 3 - TCP headers [6 marks]
  39.  
  40. Here is part of a TCP header. For this answer, you can igore all fields that are not labelled.
  41. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  42. | | |
  43. | Source Port | Destination Port |
  44. | | |
  45. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  46. | |
  47. | Sequence Number |
  48. | |
  49. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  50. | |
  51. | Acknowledgement Number |
  52. | |
  53. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  54. | | | | | |A| |R|S|F|
  55. | | | | | |C| |S|Y|I|
  56. | | | | | |K| |T|N|N|
  57. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  58.  
  59. A client (192.168.10.4) tries to open a connection to a standard HTTP server (210.55.48.213). Show the headers for the three packets that successfully create this connection. The client uses a starting sequence number of 00001000, and the server uses ABCD1000. You do not have to fill in the individual bits. (6 marks)
  60.  
  61. (Question sheet includes three duplicates of the above diagram, minus labels).
  62.  
  63. Model Answer:
  64.  
  65. (SYN)
  66. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  67. | pppp | 80 |
  68. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  69. | 00001000 |
  70. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  71. | xxxxxxxx |
  72. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  73. | | | | | |0| |0|1|0|
  74. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  75.  
  76. (SYN/ACK)
  77. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  78. | 80 | pppp |
  79. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  80. | ABCD1000 |
  81. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  82. | 00001001 |
  83. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  84. | | | | | |1| |0|1|0|
  85. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  86.  
  87. (ACK)
  88. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  89. | pppp | 80 |
  90. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  91. | 00001001 |
  92. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  93. | ABCD1001 |
  94. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  95. | | | | | |1| |0|0|0|
  96. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  97.  
  98. Marks:
  99. 1 mark for keeping the ports consistent across all three diagrams. Any source port is acceptable on the client side, but the server port should be 80 ("standard HTTP server").
  100. 1 mark for putting the correct starting sequence numbers, and 1 more for adding one in the second and third acknowledgement fields.
  101. 1 mark each for getting the flags right in each packet.
  102.  
  103. Rationale:
  104. The three part handshake is important to understand when troubleshooting a connection problem. The mark allocation puts the emphasis firmly on the flag fields, because I feel these are the most important aspect of a new connection. The ports are pretty straightforward, and I think the sequence numbers are generally more important throughout the actual communication than at connection time.
  105.  
  106.  
  107. Question 4 - Routing and Dijkstra's Algorithm [4 marks]
  108.  
  109. Dijkstra's Algorithm is commonly used by routers connected to a larger network.
  110.  
  111. a) Briefly describe what Dijkstra's Algorithm accomplishes. (3 marks)
  112. b) Explain how this is a useful algorithm for a router with multiple connections. (1 mark)
  113.  
  114. Model answer:
  115. a) Given a list of nodes, the connections between them, and some measurement of the cost of each connection, Dijkstra's Algorithm finds the cheapest (or shortest) path from a starting node to every reachable destination.
  116. b) This algorithm can be used by a router to build an optimal routing table for every destination without manual configuration.
  117.  
  118. Marks:
  119. a) 1 mark for mentioning each of these: finds the cheapest or shortest path, starting from a particular node, a cost for each edge.
  120. b) 1 mark for mentioning that the router can build its own routing table.
  121.  
  122. Rationale:
  123. Since Dijkstra's Algorithm is used in many (if not all) routers, it is important to understand what it does. Anyone expecting to configure a router within a larger network should be familiar with what it achieves and what information it works with, if not explicitly how. It is also a useful algorithm to be aware of in other situations.
  124.  
  125.  
  126. Question 5 - Asynchronous I/O [4 marks]
  127.  
  128. A particular server runs two processes for serving files. FileServ1 is written using event-based networking, and FileServ2 uses a new thread for each client connection.
  129.  
  130. a) Which of these designs allow for non-blocking I/O? (1 mark)
  131. b) Which of these designs is likely to handle the largest number of simultaneous connections, and why? (2 marks)
  132. c) What is one downside of writing a program in this style? (1 mark)
  133.  
  134. Model answer:
  135. a) They both do.
  136. b) FileServ1, because there is less overhead per connection than in a threaded model.
  137. c) The code becomes more complicated, as we essentially have one thread trying to keep track of multiple connections.
  138.  
  139. Marks:
  140. a) 1 mark only for mentioning both - no partial credit for choosing one or the other,
  141. b) 1 mark for choosing the event-based server, 1 mark for mentioning one of: speed, resources, or overhead per connection.
  142. c) 1 mark for mentioning one of: code complication or per-connection state tracking.
  143.  
  144. Rationale:
  145. Anyone writing scalable services (which is becoming more important) needs to be familiar with common techniques, and their tradeoffs. Threaded servers are common in example code because they are simpler, but for any server with a large number of users this approach becomes less attractive, and so I think an understanding of the event-based model is crucial to anyone writing modern services.
Add Comment
Please, Sign In to add comment