Computer Networks - Midterm October 30, 2015 Duration: 2h15m This is a closed-book exam Please write your answers on these sheets in a readable way, in English or in French You can use extra sheets if necessary (don t forget to put your name on them) The total number of points is 100 This document contains 17 pages Good luck! Full Name (Nom et Prénom): SCIPE No: Division: Communication Systems Other (mention it): Computer Science Year: Bachelor Year 2 Bachelor Year 3 Other (mention it):
1 Short questions (10 points) For each question, please circle a single best answer 1 In HTTP persistent connections: (a) multiple HTTP requests are sent using a single TCP connection (b) multiple HTTP requests are sent on multiple parallel TCP connections (c) each HTTP request is sent over a separate TCP connection (d) none of the above 2 A web cookie is a small piece of data used to (a) store state on the web browser (b) store state on the web server (c) store state on the web proxy (d) all of the above 3 In Digital Subscriber Line (DSL): (a) there are only two communication channels: the downstream and the upstream (b) the capacity of the downstream channel is smaller than that of the upstream channel (c) the capacity of the downstream channel is greater than or equal to that of the upstream channel (d) both downstream and upstream channels have the smallest capacity of all DSL channels 4 A switch uses packet switching to forward data from connections i = 1,, 10, each with an average rate i = 100Mbps, to an outgoing link of 1Gbps What is the average size of the outgoing-link queue? (a) Always 0 bits (b) Greater than or equal to 0 bits (c) Always 1 Mbit (d) Always 10 Mbits 5 In a P2P file-sharing system, a peer may obtain the IP addresses of the peers that have a certain content: (a) From a server (tracker) (b) From the peers, with the help of a Distributed Hash Table (DHT) (c) Both of the above (d) None of the above 2
6 The transport layer (a) moves datagrams between routers (b) moves frames across a link (c) moves data across a physical medium (d) moves segments between end-hosts 7 You have compromised 1,000,000 computers and you command them to send a lot of traffic to wwwsearchch, and as a result legitimate users cannot connect to this website What kind of attack is this? (a) Denial of Service (b) Eavesdropping (c) Impersonation (d) None of the above 8 A transmission delay is the time that: (a) is spent to move one bit across a link (b) a switch needs to push all bits into a link (c) a packet spends waiting in a buffer to be sent (d) the sender needs to establish the connection before transmitting the data 9 Suppose that there are A hosts with different IP addresses and each one has P available port numbers An application on a server is listening for TCP connections on port 80 What is the maximum number of simultaneous connections to the server application? (a) A (b) A P (c) A P 2 (d) A 2 P 2 10 How can one attack DNS? (a) Impersonate the local DNS server (b) Use a Denial-of-service against the root or TLD servers (c) Poison the cache of a DNS server (d) All of the above 3
2 Network Delays (30 points) Suppose the following: End-nodes A, B, C, D, E are part of a network shown in Figure 1 They are connected via a sequence of N switches S 1, S 2,, S N, which are able to perform at the same time: packet switching using store-and-forward; and connection switching, where each bit is processed as soon as it is received Once a connection is established using connection switching, the switches reserve a fraction of the transmission rate of the links that are used by the connection Packet switching may use only the remaining transmission rate of each link There are two permanently active connections for which the switches perform connection switching: B C and D E The connections operate at their maximum throughput The transmission rates of all links are shown in Figure 1 Each of the physical links has length l meters and propagation speed c The size of the packet buffer at every switch is infinite and processing delays can be ignored A 2 C B S1 S2 SN 2 4 D E Figure 1: The setup for the exercise on network delays Question 1 (5 points): How long does it take for a file of F bits to travel from B to C over path B S 1 S N C? 4
Question 2 (10 points): While connections B C and D E are active, node A wants to send a file to node E using packet switching It therefore splits the file into P packets of the same length L and then starts sending them over path A S 1 S N E a How long will it take for the first packet to be delivered to node E? b How long will it take for the whole file (P packets) to be delivered to node E? 5
Question 3 (10 points): Consider again the scenario described in Question 2 Assume that switch S 1 use separate queues for connection-switched traffic and packet-switched traffic a What is the packet arrival rate α (in packets/sec) at which packets going from A to E arrive at the packet-switched queue? Plot α as a function of time t (in secs) and indicate the intersection points with the x axis and y axis b What is the number of packets inside that queue when the last packet going from A to E arrives? (Hint: first compute the queue size for some specific P ) 6
Question 4 (5 points): Consider again the scenario described in Question 2 In order to avoid queuing in S 1, the network administrator doubles the rate of all links between the switches Ie the rate of each link S i S i+1, for i = 1,, (N 1) becomes now 2 a Will the average throughput experienced by receiver node E be the same, greater or less? Briefly explain why b Will the total transfer time of the file sent from A to E be the same, greater or less? Briefly explain why 7
3 Application layer (30 points) Question 1 (10 points): An EPFL user opens the web browser to access a webpage located on the domain wwwroutebricksorg Describe all the DNS messages that are exchanged in the entire network in order to resolve the IP address of the domain Make the following assumptions: The user s computer does not perform any DNS caching The user s computer uses nsepflch as local DNS server The DNS server nsepflch resolves DNS queries iteratively The DNS server nsepflch has the IP address of the org TLD server cached; no other IP addresses are in its cache The DNS server responsible for the domain routebricksorg is nsroutebricksorg For simplicity, assume nobody else is generating traffic on the Internet The workstations and servers have the following IP addresses: Name of server IP address oot DNS server 1111 ch TLD DNS server 2222 org TLD DNS server 3333 nsepflch 4444 nsroutebricksorg 5555 user workstation 6666 wwwroutebricksorg 7777 Table 1: IP addresses of web and DNS servers Fill in the answer in Table 2 Show the source and destination IP address of each message and the contents of the message 8
Message Source Destination Message content 1 6666 4444 What is the IP address of wwwroutebricksorg? 2 3 4 5 6 7 8 9 10 Table 2: The messages that are transmitted in question 1 9
Question 2 (10 points): After the web browser resolves the IP address of wwwroutebricksorg, it accesses the webpage with UL http://wwwroutebricksorg/indexhtml The webpage includes two images, located at http://wwwroutebricksorg/diagrampng and http://wwwroutebricksorg/logopng Make the following assumptions: The web browser cache is enabled but is initially empty The web browser and the server use persistent HTTP connections with pipelining Each HTTP message is transmitted in a separate packet Each HTTP message fits in one packet The image diagrampng is requested before logopng The transmission delay for any packet is much smaller than the round-trip time a) Specify the HTTP messages which are performed from the initial connection to the final disconnection, including the sender of the message (client or server), the purpose of the message and any content that is relevant Include also the handshake for each connection setup Message Sender Type of message Content 1 Client TCP handshake - 2 Server TCP handshake reply - 3 4 5 6 7 8 9 10 Table 3: The messages that are transmitted in question 2a 10
b) A few moments later, after the previous connection has been closed, the user refreshes the web page Specify the HTTP messages which are performed from the start of the new connection to the final disconnection, including the sender of the message (client or server), the purpose of the message and any content that is relevant Assume that the files stored on the server never change Message Sender Type of message Content 1 Client TCP handshake - 2 Server TCP handshake reply - 3 4 5 6 7 8 9 10 Table 4: The messages that are transmitted in question 2b 11
Question 3 (10 points): You have to design a system that distributes a set of static files (they never change) to various users You can choose between a client-server architecture (for example, store the files on a Web server) or a peer-to-peer architecture (for example, use BitTorrent to distribute the files) Explain in 2-3 sentences which one is better from each of the following points of view (separately): a) Scalability b) Predictable performance 12
4 Transport layer (30 points) Question 1 (8 points): End-host A communicates with end-host B using a Go-Back-N protocol with sender window size N = 2 A and B communicate over a channel that cannot reorder or corrupt packets The channel may drop ACK packets (from B to A), but it cannot drop data packets (from A to B) A is trying to send a file to B It does so by splitting the file in 3 packets with sequence numbers from 0 to 2 At some point, A experiences a timeout event for packet 1 (there are no other timeout events) Show which packets and ACKs have been transmitted by A and B, including the ones which have been dropped Answer this question by completing the sequence diagram in Figure 2 Your answer should include the following: All packet transmissions, including ACKs Lost ACKs The timeout event Changes to the sender and receiver window, when packets (including ACKs) are received by either end-host We have already completed some of the information to help you get started End-host A has sent data packets 0 and 1, which have reached end-host B 13
A B pkt 0 0 1 2 3 4 0 1 2 3 4 pkt 1 0 1 2 3 4 0 1 2 3 4 Figure 2: Sequence diagram to be completed for Question 1 14
Question 2 (4 points): For the scenario described in Question 1, what is the minimum number of ACKs that the sender needs to receive so that the file transfer completes (the sender stops transmitting packets)? Justify your answer Question 3 (9 points): Sender A and receiver B communicate using a modified version of Selective epeat, where the receiver window of B is smaller than the sender window of A a If the channel can drop packets or ACKs, would the modified protocol work correctly? Justify your answer b Describe any advantages or disadvantages of this modification 15
Question 4 (9 points): Due to a configuration error, a Go-Back-N sender A connects to a Selective epeat receiver B, and starts sending a large file The window size of both end-hosts is equal to 2 For each of the following channels, explain if the file transfer would complete successfully or not If the transfer can fail, provide an example sequence diagram that shows the problem a A channel that may only drop data packets from A to B b A channel that may only drop ACKs from B to A The channels do not corrupt and do not reorder packets (or ACKs) 16
Figure about Network delays A 2 C B S1 S2 SN 2 4 D E Figure 3: * The setup for the exercise on network delays 17