Exercises TCP/IP Networking Solution. With Solutions Jean-Yves Le Boudec Fall 2010 Exercises marked with a were given at exams in the past. 1 Module 1: TCP/IP Architecture Exercise 1.1 Elaine is setting in front of lrcpc3 and connects to machine ezinfo.ethz.ch by Telnet. A clairvoyant angel has read all the frames passing on the network. Here is the first packet resulting from this activity: ETHER: ----- Ether Header ----- ETHER: ETHER: Packet 1 arrived at 19:03:32.39 ETHER: Packet size = 60 bytes ETHER: Destination = ff:ff:ff:ff:ff:ff ETHER: Source = 0:0:c0:b8:c2:8d ETHER: Ethertype = 0806 ETHER: ARP: ----- ARP/RARP Frame ----- ARP: ARP: Hardware type = 1 ARP: Protocol type = 0800 (IP) ARP: Length of hardware address = 6 bytes ARP: Length of protocol address = 4 bytes ARP: Opcode 1 (ARP Request) ARP: Sender s hardware address = 0:0:c0:b8:c2:8d ARP: Sender s protocol address = 128.178.156.7, lrcpc3.epfl.ch ARP: Target hardware address =? ARP: Target protocol address = 128.178.156.1, in-inr-e4.epfl.ch 1. What is this frame used for in this exchange? Solution. The frame used is an ARP request. 1
2. What stations receive this frame? What stations reply to it? Solution. All the stations of this subnetwork will receive this frame. Only the router in-inr-e4.epfl.ch will answer with the MAC address that was requested with the ARP request. 3. How can we determine if a frame is an ARP frame? Solution. With the Ethernet type = 0806. Exercise 1.2 Among the packets observed, shortly afterwards, we find the following two: ETHER: ----- Ether Header ----- ETHER: ETHER: Packet 2 arrived at 19:03:32.39 ETHER: Packet size = 74 bytes ETHER: Destination = 0:0:c:2:78:36 ETHER: Source = 0:0:c0:b8:c2:8d ETHER: Ethertype = 0800 ETHER: IP: ----- IP Header ----- IP: IP: Version = 4 IP: Header length = 20 bytes IP: Type of service = 0x00 IP: xxx.... = 0 (precedence) IP:...0... = normal delay IP:... 0... = normal throughput IP:....0.. = normal reliability IP: Total length = 60 bytes IP: Identification = 2947 IP: Flags = 0x0 IP:.0..... = may fragment IP:..0.... = last fragment IP: Fragment offset = 0 bytes IP: Time to live = 64 seconds/hops IP: Protocol = 17 IP: Header checksum = c2ba IP: Source address = 128.178.156.7 IP: Destination address = 128.178.15.8, IP: No options IP: UDP: ----- UDP Header ----- UDP: UDP: Source port = 1267 UDP: Destination port = 53 (DNS) UDP: Length = 40 UDP: Checksum = B672 UDP: 2
DNS: ----- DNS: ----- DNS: DNS: "" DNS: ETHER: ----- Ether Header ----- ETHER: ETHER: Packet 3 arrived at 19:03:32.40 ETHER: Packet size = 202 bytes ETHER: Destination = 0:0:c0:b8:c2:8d, Western Digital ETHER: Source = 0:0:c:2:78:36, Cisco ETHER: Ethertype = 0800 ETHER: IP: ----- IP Header ----- IP: IP: Version = 4 IP: Header length = 20 bytes IP: Type of service = 0x00 IP: xxx.... = 0 (precedence) IP:...0... = normal delay IP:... 0... = normal throughput IP:....0.. = normal reliability IP: Total length = 188 bytes IP: Identification = 38579 IP: Flags = 0x0 IP:.0..... = may fragment IP:..0.... = last fragment IP: Fragment offset = 0 bytes IP: Time to live = 58 seconds/hops IP: Protocol = 17 IP: Header checksum = 3d0a IP: Source address = 128.178.15.8, IP: Destination address = 128.178.156.7, IP: No options IP: UDP: ----- UDP Header ----- UDP: UDP: Source port = 53 UDP: Destination port = 1267 UDP: Length = 168 UDP: Checksum = 0000 UDP: DNS: ----- DNS: ----- DNS: DNS: "" DNS: 3
1. What has happened? Solution. Packet 2: lrcpc3 issues an UDP packet searching for the IP address of ezinfo.ethz.ch. This packet is sent to the DNS server. Packet 3: DNS server answers with the requested IP address. 2. What is lrcpc3 s IP address? and ezinfo.ethz.ch s? What is the source IP address of packet 3. Which is the source MAC? Solution. lrcpc3: 128.178.156.7 ezinfo.ethz.ch is contained in the DNS part of packet 3 (not presented). It will be available in packet 4. source IP of packet 3: 128.178.15.8 Source MAC address of packet 3: 0:0:c:2:78:36 3. What is UDP port 53 reserved for? 1267? How can a UDP packet be recognised? Solution. UDP port 53 is reserved for Name Server in DNS. UDP port 1267 is not reserved. A UDP packet can be recognized by the protocol field in the IP header (= 17) 4. Comment on the value of the TTL fields. Solution. Packet 2 has TTL=64 and packet 3 has TTL=58. Assuming that DNS server issues the packet with the same TTL as lrcpc3 (that is 64), we can conclude that the routers between the DNS and lrcpc3 have reduced the TTL by 6. 5. Comment on the UDP checksum. Solution. Checksum computation is not mandatory with UDP over IPv4; if no checksum is computed, the value 0 is written in the checksum field. This value cannot be obtained if a valid checksum is computed. We see that there was no checksum computed in Packet 3. Exercise 1.3 The following packets are then observed. 1. What has happened? Solution. There has been established a TCP connection between lrcpc3 and eznfo.ethz.ch. Packets 4,5 and 6 form 3-way handshake procedure. 2. What is the length of the TCP payload contained in packets 5 to 9? Solution. In packet 7. packetnumber payload 5 0 6 0 7 24 8 0 9 30 4
3. What will the value of the sequence and acknowledgement fields be in the next packet sent by lrcpc3? Solution. acknowledge field = 2068544031 sequence number = 2591304298 Exercise 1.4 1. Let us consider an IP packet transmitted on an Ethernet. Is it possible that the destination MAC address in the packet is different from the MAC address of the destination? Solution. Yes, always except in the last hop. 2. A router receives an IP packet on one of its Ethernet interfaces. How can it determine the Ethernet connected system that just sent the packet? Solution. By the MAC address of the IP packet s source. 3. How many IP addresses does an IP router have? Solution. 2 or more (at least one per physical interface). 4. Does a bridge need an IP address? Solution. No. But one could be used for management. Exercise 1.5 At ETHZ the IP addresses are of the form 129.132.x.x and use 6 bits for the host part. Thus the prefix length is 26 bits. 1. The prefixes of the Globi and Fritz subnets are respectively 129.132.43.128/26 and 129.132.43.192/26. For each of the following addresses, say whether they belong to the Globi subnet, to the Fritz subnet, or none. (a) 129.132.43.213 (b) 129.132.43.25 (c) 129.132.43.150 Solution. The answer is: (a) 129.132.43.213 Fritz subnet (b) 129.132.43.25 none (c) 129.132.43.150 Globi subnet 2. What should normally be the subnet mask at every ETHZ host? Solution. The subnet mask at every ETHZ host should be FF.FF.FF.C0 (in decimal: 255.255.255.192). 3. Assume that an IP host A on the Globi subnet is not well configured and has a subnet mask equal to 255.255.0.0. Explain what happens when such a host wants to send an IP packet to a destination host B (consider both cases where B is on the Globi subnet or not). Solution. A thinks that B is on the same subnet as his own subnet. Therefore, two cases are possible: 5
batz.sovkom.ch pc33.sovkom.ch 192.168.38.253 00:01:01:00:FF:33 192.168.38.1 00:AE:01:00:00:29 192.168.38.84 00:01:01:00:00:33 192.168.38.252 00:01:01:00:FF:45 NB Observation Point 192.168.38.254 00:01:01:00:FF:52 192.168.38.2 00:AE:01:00:00:97 anv.sovkom.ch (DNS server) Figure 1: The network of Problem 1, with NB configure as bridge if B is actually on the Globi subnet, then, there won t be any problem. A will send an ARP request to find B s MAC address, B will receive the ARP request and answer with an ARP reply. if B is not on the Globi subnet (but B is at ETHZ), there will be a problem. Indeed, A will broadcast an ARP request with target B on the Globi subnet and A will not get any answer because B will not receive this request (remember that the ARP request are not forwarded by routers). Therefore, A will never be able to send an IP packet to B. 4. We assume that we cannot change the configuration of host A. Propose a solution to the problem. Solution. We should implement PROXY ARP in the router on the Globi subnet. So, the router could answer on behalf of B to the ARP requests. Exercise 1.6 1. Consider the network in Figure 1. Only the systems shown on the figure exist in the network. The box in the middle, labeled NB is a multi-function network box, which can be configured either as a router or a bridge. It also runs a web server. In this question, we assume that NB is configured to work as a bridge. Figure 1 shows the IP addresses and MAC addresses of all interfaces. The network mask on all machines is 255.255.255.0. (a) Are the IP addresses plausible, or would you change anything? (justify your answer) (b) Does NB need IP addresses, or could we remove them? (justify your answer) (c) We assume that the ARP cache at machine pc33.sovkom.ch is empty. We start a TCPDump somewhere on the LAN between pc33.sovkom.ch and NB (at the place called Observation Point ). 6
Then a user at pc33.sovkom.ch executes a command, as shown below: pc33# telnet batz.sovkom.ch daytime Trying 192.168.38.1... Connected to batz.sovkom.ch. Escape character is ˆ]. Tue Nov 29 14:21:34 2005 Connection closed by foreign host. pc33# (The user sends one request to the server batz.sovkom.ch using telnet, i.e. using TCP, to destination port 13 the port number reserved for the daytime service, obtains one answer from the server, and the TCP connection is closed. ) For each of the packets that can be observed, give the values of the following fields: MAC source address MAC destination address IP source address IP destination address protocol type if applicable, TCP or UDP source and destination ports If some of the values cannot be determined exactly, explain what possible values would be. If two different packets give the same set of values, give it only once. Solution. (a) All the systems in the network belong to the same ethernet network: as all the IP addresses in the network are correct and as they belong to the same subnet, they all are correct. (b) Nb needs at least one IP address, as it runs a web server. (c) Let s use the following labels: Device Address Symbol PC33 (IP) a1 PC33 (MAC) a2 DNS server (IP) b1 DNS server (MAC) b2 Batz (IP) c1 Batz (MAC) c2 NB (IP) n1 NB (MAC) n2 For NB we consider only the network interface on the same ethernet segment as pc33. 7
batz.sovkom.ch pc33.sovkom.ch 192.168.37.253 00:01:01:00:FF:33 192.168.37.1 00:AE:01:00:00:29 192.168.38.84 00:01:01:00:00:33 192.168.38.252 00:01:01:00:FF:45 NB Observation Point 192.168.39.254 00:01:01:00:FF:52 192.168.39.2 00:AE:01:00:00:97 anv.sovkom.ch (DNS server) Figure 2: The network of Problem 1, with NB configure as router Packet IP src IP dest MAC src MAC dst protocol type-dest port pc33 all (a1) (b1) a2 (broadcast) ARP DNS pc33 (b1) (a1) b2 a2 ARP pc33 DNS a1 b1 a2 b2 UDP (port 53)-dns query DNS pc33 b1 a1 b2 a2 UDP (local port)-dns answer pc33 all (a1) (c1) a2 (broadcast) ARP batz pc33 (c1) (a1) c2 a2 ARP pc33 batz a1 c1 a2 c2 TCP (port 13)- syn batz pc33 c1 a1 c2 a2 TCP (local port)- syn ack pc33 batz a1 c1 a2 c2 TCP (port 13)- ack batz pc33 c1 a1 c2 a2 TCP (local port)- (data, fin) pc33 batz a1 c1 a2 c2 TCP (port 13)- ack pc33 batz a1 c1 a2 c2 TCP (port 13)- fin batz pc33 c1 a1 c2 a2 TCP (local port)- ack 2. Now we assume that NB is configured as a router. The addresses are now as shown in Figure 2 Answer the same three questions (a) to (c) as in the previous case. Solution. 1. From the picture, the two servers and the PC33 each belong to a different ethernet network, connected each to a separate network interface of the router. Then each IP address in each ethernet network belong to the same subnet, and all are correct: then all the IP address assigned in the picture are acceptable. 2. In order to route packets, NB needs IP addresses for all of its three network interfaces. 8
3. We use the same labels as before: Packet IP src IP dest MAC src MAC dst protocol type-dest port pc33 all (a1) (n1) a2 (broadcast) ARP NB pc33 (n1) (a1) n2 a2 ARP pc33 DNS a1 b1 a2 n2 UDP (port 53)-dns query DNS pc33 b1 a1 n2 a2 UDP (local port)-dns answer pc33 batz a1 c1 a2 n2 TCP (port 13)- syn batz pc33 c1 a1 n2 a2 TCP (local port)- syn ack pc33 batz a1 c1 a2 n2 TCP (port 13)- ack batz pc33 c1 a1 n2 a2 TCP (local port)- (data, fin) pc33 batz a1 c1 a2 n2 TCP (port 13)- ack pc33 batz a1 c1 a2 n2 TCP (port 13)- fin batz pc33 c1 a1 n2 a2 TCP (local port)- ack Exercise 1.7 Consider the configuration in Figure 3. www.sovkom.an PCA ROUT1 BRI WP ROUT2 WSS A R 1 R 1 B B H H R 2 R 2 S IP addresses a r 1 r 1 b b h h r 2 r 2 s 11 2 3 4 5 MAC addresses Figure 3: The configuration with web browser on PCA, web proxy WP and web server on WSS. MAC addresses are called a, r 1,... IP addresses are called A, R 1,... PCA is a host running a web browser. WSS is a web server, responding to URL=www.sovkom.an, and with IP address S. WP is a firewall acting as web proxy (application level gateway). PCA is configured to use WP by default. ROUT1 and ROUT2 are routers, BRI is a bridge. All links are Ethernet. All links between those systems are shown on the figure. MAC and IP addresses are shown on the figure. We assume that PCA already knows the IP addresses of WP and WSS. Thus, there will be no call to DNS. We also assume that ARP tables are already populated with the correct values, so there will be no ARP messages. 9
Assume that PCAsends an HTTP request with target URL = www.sovkom.an in order to transfer one single file. Assume that we do a TCPDump at points 1 to 5, and we capture a copy of all packets that correspond to the transfer of the file and that travel in the direction from PCA to WSS. Give the IP and MAC source and destination addresses that can be read in the packets. Give the solution in the table below. at 1 at 2 at 3 at 4 at 5 MAC source MAC destination IP source IP destination Solution: MAC source MAC destination IP source IP destination at 1 a r 1 A H at 2 r 1 h A H at 3 r 1 h A H at 4 h r 2 H S at 5 r 2 s H S Exercise 1.8 The following trace was captured with TCPDump. It was generated by a Web session. The S, P, and F letters indicate the corresponding TCP flags. Starting with the second packets in each direction, Sequence and Acknowldegement numbers are given by their offset from the values in the first packets. The notation 1:449(448) means that the packet sequence number is 1, it carries 448 bytes of data, and the last byte has sequence number 449-1. 1. Explain the use of the flags. Solution. S is the SYN flag, indicating establishment of a new connection F is the FIN flag, indicating closing of a connection P is the PSH flag, requesting immediate data delivery (to the application) at the receiver 2. Some packets have been mis-ordered. At which lines is that visible? Solution. Note that by monitoring traffic by a third party, a retransmission and mis-ordering usually can t be distinguished with certainty. The answers given here therefore only indicate what is very likely to have happened. Segment 10486:10934 would have been expected at or near line 81 but is received at line 94. Note that this could also be due to a retransmission after a timeout. Expected at line 84, segment 11382:11830 is received at line 87, i.e. 11382:11830 and 11830:12278 appear to be swapped. 3. Which lines are retransmissions? Solution. Segment 8246:8694 (expected at or near line 69) appears to be retransmitted at line 90. Expected at line 176, segment 23926:24374 is apparently retransmitted at line 185. 10
4. Show the states (from the slide TCP Finite State Machine ) for each of the two ends of the connection, for the first and last 10 lines of the trace, after the packet has been received. Solution. Line lrcpc8 ezinfo 1 SYN SENT SYN RCVD 3 ESTABLISHED SYN RCVD 5 ESTABLISHED ESTABLISHED 6 ESTABLISHED ESTABLISHED 8 ESTABLISHED ESTABLISHED 9 ESTABLISHED ESTABLISHED... 181 ESTABLISHED ESTABLISHED 182 CLOSE WAIT FIN WAIT 1 184 CLOSE WAIT FIN WAIT 1 185 CLOSE WAIT FIN WAIT 1 187 CLOSE WAIT FIN WAIT 2 188 CLOSE WAIT FIN WAIT 2 189 LAST ACK TIME WAIT 191 CLOSED TIME WAIT Exercise 1.9 1. Consider the transparency Nagle s Algorithm: Example. Assume that the packet at line 4 is lost in the network. Give a possible continuation of the message chart. Solution. In the hypothesis that the override timer is bigger than the retransmission timer, we have repacketization: at the retransmission timeout the lost bits are retransmitted, together with the bits arrived in the meantime. In this case Nagle s algorithm does not came into play. We can well realize how it is not possible to have the override timer smaller than the retransmission timer, as we would have transmission of duplicate of the same bits even in the absence of losses. 2. Assume Nagle s algorithm is disabled for a given connection. Is it possible that some data written by the application is still delayed? Prove your answer. 11
Solution. Due to the sliding window mechanism, whenever the available window does not allow the application to send all the data that it produces, all the remaining data is buffered and therefore delayed. Exercise 1.10 Quiz 1. true false When a multiport repeater has some bits to send on a half-duplex Ethernet interface, it should first wait until the channel is idle. Solution. False. The repeater simply repeats bits, even if this causes a collision. 2. true false When a bridge sends a packet towards the final destination over a full duplex Ethernet interface, it should put as destination MAC address the MAC address of the next hop. Solution. False; the bridge does not modify MAC addresses. 3. true false When a bridge has a packet ready to send on a full-duplex Ethernet port, it listens to the medium and waits until the medium is idle. Solution. False, there is no CSMA/CD over full duplex Ethernet. 4. true false Bridges are said to be multiprotocol because a bridged network works independently of network layer protocols such as IPv4 or IPv6. Solution. True. 5. true false A bridge is an intermediate system for layer 2. Solution. True. 6. true false Assume host A sends an IP packet to host B via bridge X, and assume all three systems are on the same bridged network. Then the destination MAC address in the packet sent by A is the MAC address of X. Solution. False. Bridges on Ethernet are transparent. 7. true false On a full duplex Ethernet link, there is no CSMA/CD protocol. Solution. True. A full duplex Ethernet link uses Ethernet physical layer but is not a shared medium link. 8. true false With an Ethernet switch, there is one collision domain per port. Solution. True. 9. true false A multiport repeater separates collision domains. Solution. False. 10. true false When a bridge has a packet ready to send on a half-duplex Ethernet port, it listens to the medium and waits until the medium is idle. Solution. True, the bridge executes CSMA/CD on all half-duplex ports. 11. true false In a bridged LAN with more than one bridge and with redundant paths, packet sequence is not guaranteed. 12
Solution. False. Packet sequence is guaranteed by the spanning tree algorithm, which reduces the active topology to a tree. 12. true false Assume hosts A and B are on the same bridged LAN, with one bridge X. When host A sends a packet to host B, the source MAC address is that of A, and the destination MAC address is that of the bridge Solution. False; Bridges are transparent. The destination address is normally that of B; it may also be the broadcast address, or a multicast address. 13. true false A router is an intermediate system for layer 3. Solution. True. 14. true false Ethernet bridges do not use IP addresses when deciding where to send a packet. Solution. True. Bridges do not look at layer 3 information and are therefore said to be multiprotocol 15. true false If an IP host A receives an IP packet with TTL=255, then A can conclude that the source of the packet is on-link. Solution. True. 16. true false If host A at EPFL wants to send an IP packet to host B at ETHZ, and if A s ARP cache is empty, then A sends an ARP request in order to determine the IP address of the next hop router. Solution. False. The ARP request is to find the MAC address of the next hop router. 17. true false Assume A and B are two IPv4 hosts, and that the hosts are on Ethernet. If A and B have the same network mask and the same network prefix, then when A sends a packet to B, the packet still contains an IP destination address, equal to the IP address of B. Solution. True. 18. true false When an IP router between two Ethernet segments forwards an IP packet, it does not modify the destination IP address. Solution. true. 19. true false Assume that host A has an IP packet to send to host B, and that the two hosts are on two Ethernet segments separated by a bridge BR. Assume the ARP table at A is empty. Host A will send an ARP packet in order to find the MAC address of the bridge BR. Solution. False. The bridge is not visible to A. The ARP is to find the MAC address of B. 20. true false Assume A and B are two IPv4 hosts, and that the hosts are on Ethernet. If A and B have the same network mask and the same network prefix; if A has no entry in its ARP, then before sending a packet to B, A sends an ARP request with target IP address = IP address of B. Solution. True. Comment: if proxy ARP is used, a proxy ARP server may respond with another MAC address than that of B 21. true false The route indicated by traceroute may not be the real one because parallel paths may exist in the Internet. Solution. True. 13
22. true false In an intranet with more than one router, packet sequence is guaranteed by means of the TTL field. Solution. False. Packet sequence is not guaranteed with IP. 23. true false When an IP router between two Ethernet segments forwards an IP packet, it does not modify the destination MAC address. Solution. false. 24. true false Assume A and B are two IPv4 hosts on the EPFL network. Assume that host A is configured by error with a network mask equal to 255.255.0.0. When A sends a packet to another EPFL host B, if the ARP cache at A is empty, then A will send an ARP packet in order to find the MAC address of B. Solution. True. This is not the normal configuration, but it will works because in such cases the default router for A will use proxy ARP and respond with its own MAC address 25. true false If there are some errors in the routing tables at some routers, then, with IPv4, it is possible that a packet loops for ever. Solution. False. The packet is discarded when the TTL fields becomes 1. 26. true false When a router sends a packet towards the final destination over a full duplex Ethernet interface, it should put as destination MAC address the MAC address of the next hop. Solution. True. 27. true false The subnet mask is used by a host or a router in order to know whether it belongs to the same subnet as a machine identified by some IP address. Solution. True. 28. true false When an application receives a block of data from TCP, the application knows that the data was sent as one message by the source. Solution. False. 29. true false Assume host A sends data to host B using TCP. In some cases, it may happen that two blocks of data generated by the application at A are grouped by TCP into one single IP datagram. Solution. True. TCP does its own packetization. 30. true false Assume host A sends data to host B using a TCP socket. If A writes three blocks of data into the TCP socket, then there will be three packets sent to B. Solution. False. TCP does its own packetization. There may be any number of packets, depending on how much data is written by B. 31. true false It is possible for a UDP source A to send data to a destination process P 1 on host B 1, using source port a and destination port b, and at the same time send (different) data to another destination process P 2 on a different host B 2, still using the same source port a and destination port b. Solution. True. 32. true false With TCP, the goal of silly window syndrome avoidance is to avoid that out of 14
sequence data is delivered to the application. Solution. False. 33. true false When an application receives data from UDP, the application knows that the data was sent as one message by the source. Solution. True. 34. true false Assume host A sends data to host B using UDP. In some cases, it may happen that two blocks of data generated by the application at A are grouped by UDP into one single IP datagram. Solution. False. 35. true false With a sliding window protocol and for a constant round trip time, increasing the window size increases the throughput if there is no loss, up to a certain limit. Solution. True. 36. true false With a sliding window protocol, the window size is the maximum amount of unacknowledged data that can be sent by the source. Solution. True. 37. true false Assume host A sends one block of data to host B using UDP. In some cases, it may happen that the blocks of data generated by the application at A is fragmented by the IP layer at A into several IP packets. Solution. True. 2 Module 2: Dynamic Routing Exercise 2.1 1. Why do bridges have to build a spanning tree whereas routers do not? Solution. Bridges have to build a spanning tree because they forward packets according to MAC addresses which are not structured and they do not detect frames that loop. Routers do not have to build a spanning tree since they forward packets according to IP addresses which are structured and eventually discard packets that loop. 2. What happens to packets if there is a routing loop with bridges? with routers? Solution. Packets loop indefinitely if there is a routing loop with bridges. Packets will eventually be discarded if there is a routing loop with routers because of the TTL field. 3. Is it possible for a link-state algorithm to use the Bellman-Ford algorithm? Why or why not? Solution. The link-state algorithm can use the Bellman-Ford algorithm (static version) for computing the shortest path to all other nodes since the Bellman-Ford algorithm requires only a partial view of the network and the link-state algorithm provides a complete topology view of the network. 15
10.1.1 / 24 10.0.0.80 / 28 R1 10.0.0.0 / 28 10.1.6 / 24 R6 10.1.2 / 24 R2 10.0.0.64 / 28 10.0.0.16 / 28 10.1.5 / 24 R5 R3 10.0.0.48 / 28 R4 10.0.0.32 / 28 10.1.3 / 24 10.1.4 / 24 Figure 4: The network in Exercise 2.2. Exercise 2.2 Consider the network in Figure 4. R1 to R6 are routers. Each of these routers has 3 (external) IP interfaces: two interfaces, called backbone interfaces, connect the router to neighbouring routers; the prefix length for these interfaces is 28 bits. one of them, called edge interface, is an interface to a set of hosts; the prefix length for this interface is 24 bits. All routers run a distance vector routing protocol such as RIP. The costs of a link between two adjacent routers is equal to 1. The cost from a router to a directly connected network is also equal to 1. 1. What is the subnet mask at each of the router interfaces shown on the picture? (give the answer in dotted decimal notation) Solution. Backbone: 255.255.255.240. Edge: 255.255.255.0. 2. Give the routing table at R1, assuming the routing protocol has converged. Also assume that there is no other network connected to these routers than shown on the picture. Solution. Let s assume that the last two bits of the clock-wise side backbone interfaces are equal to 01 and the other side backbone interfaces have the last two bits equal to 10. Lets also assume that the edge interfaces are called eth0, clock-wise side backbone interfaces are called eth1 and the other side backbone interfaces are called eth2. Then the routing table is: 16
Destination Network Next Hop Interface Distance 10.1.1.0/24 on-link eth0 1 10.0.0.0/28 on-link eth1 1 10.1.2.0/24 10.0.0.2 eth1 2 10.0.0.16/28 2 10.1.3.0/24 3 10.0.0.32/28 3 10.1.4.0/24 4 10.0.0.48/28 10.0.0.81 eth2 3 10.1.5.0/24 3 10.0.0.64/28 2 10.1.6.0/24 2 10.0.0.80/28 on-link 1 3. Assume there exists a host M with IP address 10.0.0.24 and a host A with IP address 10.1.1.23. What are the possible default routers for M and A? For each combination of cases, what is the path (=sequence of routers) followed by a packet from M to A? Solution. The possible default routers for M: R2 and R3. ForA: R1. Case (R2,R1): the path is M R2 R1 A. Case (R3,R1): for the first packet the path is M R3 R2 R1 A. Then, the redirection will happen and the path M R2 R1 A will be used for the subsequent packets. 4. Assume now that, on router R2, the edge interface with network prefix 10.1.2/24 is brought down and replaced by a new edge interface, which has now prefix 10.1.7/24. Explain by which mechanisms the other routers will become aware of the change. Solution. In the next RIP update message (sent every 30s) R2 will announce toward its neighbors the network 10.1.7 with metric 1 and will not announce the network 10.1.2 (which is equivalent to the metric ). Bellman-Ford algorithm will cause the updates of routing tables or R1 and R3. R1 and R3 will propagate changes of their routing tables in their next update messages sent towards their neighbors. The change propagates further in the same way. 5. Assume just after this change of configuration, router R2 receives a distance vector from R1, which is based on the values before the change. Explain what will happen, assuming the routing protocol does not implement split horizon. What would happen if the routing protocol would implement split horizon? Solution. If split horizon is not used there will be count to infinity scenario: R2 will increment it s metric toward 10.1.2/24 to 3 and tell this route to R1 and R3. R1 will increment its metric to 4 and tell to R2 and R6, and so on. In this way there is count to infinity between R1 and R2. If split horizon is used, R2 will immediately set its metric toward 10.1.2/24 to infinity (16 in real implementation), as it sees that the route announced by R1 goes over itself (R2). then it will propagate this change toward R1, R1 will propagate it further, and so on. Similar will happen with R3 as with R2. The change propagates immediately in the case with split horizon. 6. Assume the network has converged after the changes in the previous questions. Assume we do the same manipulation on router R5, with the same new prefix (i.e. the edge interface with network prefix 10.1.5/24 is brought down and replaced by a new edge interface, which has now prefix 10.1.7/24, the same prefix as on router R2). Normally, this should not be done, since in principle different LANs should have different prefixes. 17
However, this was done by the network managers, maybe by mistake. Explain the actions that the routing protocol will take, and give the routing table entries at all routers that, after convergence, have changed. Solution. The actions: RIP update messages exchange and routing table updates according to Bellman-Ford algorithm. Only the entries toward 10.1.7/24 will change at some of the routers: Router Destination Network Next Hop Distance changed? R1 10.1.7.0/24 R2 2 no R2 10.1.7.0/24 on-link 1 no R3 10.1.7.0/24 R2 2 no R4 10.1.7.0/24 R5 2 yes R5 10.1.7.0/24 on-link 1 yes R6 10.1.7.0/24 R5 2 yes 7. Assume there is a host B2 connected to router R2 s edge interface, with IP address 10.1.7.2 and a host B5 connected to router R5 s edge interface, with IP address 10.1.7.5. Assume host A has a packet to send to B2 and a packet to send to B5. What is the path followed by each of these packets? What happens at the last router on the path, in both cases? Solution. A B2: A R1 R2 B2, success. A B5: A R1 R2, then ARP will fail, and the ICMP destination host unreachable message will be sent by R2 to A, and the packet will be dropped by R2. Exercise 2.3 Consider the network in Figure 5. It represents a small corporate network. The IP addresses are shown explicitly; M1 to M15 mean MAC addresses. B1, B2 and B3 are bridges; R1, R2 and R3 are routers. D3 is the DNS server for this network. The machines C1, D1, C2, D2, and C3 are configured with DNS server address = 192.168.1.52. The network is connected to the Internet only by means of a web proxy (the machine H is an application layer gateway). All interfaces that have IP addresses of the form 192.168.x.y are configured with netmask = 255.255.255.240. The default gateway are configured as follows at C1 and D1: 192.168.1.17 at C2 and D2: 192.168.1.33 at C3 and D3: 192.168.1.49 1. Give a possible value for the X in the IP address of the interface M4 of router R1 (i.e. give a possible value for the address marked 192.168.1.X on the figure). Justify your answer. Same question for the Y in the IP address of the interface M8 of router R2. Solution. The M4 interface must belong to the same subnet as C2 and D2. Since the mask is over 28 bits, X must lie in the interval [33, 46] (the host parts b0000 [X =32] and b1111 [X =47] are not possible). The value must also not be already allocated. A possible value is 34. Similarly, Y must lie in the interval [49, 62]; a possible value is 50. 18
192.168.1.X 192.168.1.Y 9.23.31.2 M4 M8 M12 9.23.31.1 R1 192.168.1.17 M3 R2 192.168.1.33 M7 R3 192.168.1.49 M11 M13 www.plinn.ws S H B1 B2 B3 M14 9.1.2.2 M15 145.238.10.78 M1 M2 1 M5 M6 M9 M10 Internet C1 D1 C2 D2 C3 D3 (DNS) 192.168.1.19 192.168.1.18 192.168.1.35 192.168.1.36 192.168.1.51 192.168.1.52 Figure 5: A small corporate network (exercise 2). 2. We assume that R1, R2 and R3 are manually configured, i.e. they do not run any routing protocol. Put in the table below the routing table entries that need to be written in these three routers. Give only the entries for destination prefixes that are not on-link with this router. Solution. tbd. R1 needs only default entry to 192.168.1.33 3. The user at host C1 uses a web browser to connect to the server www.plinn.ws, which is on the machine marked S on the figure. As a result, the web browser at C1 sends a DNS query to determine the IP address that corresponds to the DNS name www.plinn.ws. A packet sniffer placed at the location labelled 1 on the figure reads the DNS query and its answer. In the table below, mark the values of the fields that are read in these two packets. 19
4. The web browser at C1 has now received the response from the DNS server and sends an HTTP query. Same question as before for the packets that contain the HTTP query sent by C1 and for the resulting response. 5. Assume that we change (by mistake) the netmask for the interface M1 of host C1. The new mask value is 255.255.255.0. Will C1 continue to work normally? Justify your answer. 20
6. Instead of manual configuration as in question 2, routers R1 R2 and R3 use now RIP. After RIP has converged, what are the routing tables at each router? Give only the entries for destination prefixes that are not on-link with this router. Solution. tbd 21
192.168.1.X 192.168.1.Y?.?.?.? M4 M8 M12 R1 R2 R3 192.168.1.17 M3 192.168.1.33 M7 192.168.1.49 M11 B1 B2 B3 M10 M1 M2 M5 M6 M9 C1 D1 C2 D2 C3 D3 (DNS) 192.168.1.19 192.168.1.18 192.168.1.35 192.168.1.36 192.168.1.51 192.168.1.52 Figure 6: The second network (exercise 2). 7. We now pull the wire between M12 and M13; then we change the IP address of the interface at M12 and connect M12 to bridge B1; the resulting new configuration is in Figure 6. What IP address and netmask should we give to M12? Solution. An address in subnet 192.168.1.16/28, for example 192.168.1.20. The netmask should be 255.255.255.240 (i.e. the prefix is 28 bits) Explain what RIP does immediately after the re-connection? In the following table, write the routing tables after RIP has stabilized. (As before, give only the entries for destination prefixes that are not on-link with this router.) 22
2 M4 M8 M12 R1 R2 R3 192.168.1.17 M3 192.168.1.33 M7 M11 192.168.1.49 B1 B2 B3 3 1 M1 M2 M5 M6 M9 M10 C1 D1 C2 D2 C3 D3 (DNS) 192.168.1.19 192.168.1.18 192.168.1.35 192.168.1.36 192.168.1.51 192.168.1.52 Figure 7: The third network (exercise 2). 8. We reconfigure the network as shown in Figure 7. The interfaces at M4, M8 and M12 are not used. We change the network mask to 255.255.255.0 on all systems, the IP addresses remain the same. We do a ping from C1 to C2, C2 to C3 and C3 to C1. Packet sniffers are placed at locations labeled 1, 2 and 3 on the figure. In the table below, mark the values of the fields that are read in the ping packets corresponding to each of the ping exchanges if the packet is visible at this location. Consider only the ping packets themselves, not the replies. Solution. One of the links must be disabled by the spanning tree, so at one of the observation points we should see nothing. Exercise 2.4 Consider the network in Figure 8. Domain A [resp. B] is a service provider to domains Z and T [resp. X and Y]. A and B peer over the link shown in the figure. A1, A2, A3 and A4 run BGP and OSPF. B1, B2, B3 and B4 run BGP and RIP. Some of the routers (like A3 and B3) run BGP but do not have external BGP connections. Both domains A and B never redistribute BGP into their IGP. The link costs for OSPF or RIP are all equal to 1. The decision process inside all BGP routers in domain A is such that the route selected is, by order of decreasing priority (1) the route that has the smallest MED (2) the route that has the shortest IGP distance from this node to the NEXT-HOP of the route The decision process inside all BGP routers in domain B uses the reverse order, i.e., it is such that the route selected is, by order of decreasing priority (1) the route that has the shortest IGP distance from this node to the NEXT-HOP of the route (2) the route that has the smallest MED 1. Here is the list of all BGP announcements that are made over E-BGP: 23
Domain T Domain A Domain B Domain X 133.29/16 Domain Z A1 133.1.28.1 133.1.28.2 A2 133.1.28.82 133.1.28.83 A3 145.1.23.1 145.1.23.2 B1 B2 B3 201.1.7.1 201.1.7.2 201.1.110.2 201.1.110.1 201.89/16 Domain Y 133.30/16 133.1.32.82 133.1.32.83 A4 201.1.213.2 201.1.213.1 B4 201.90/16 Figure 8: Network for exercise 2.4, step 1. A1 to B1 133.29/16 AS-PATH = B MED = 10 133.30/16 AS-PATH = B MED = 40 B1 to A1 201.89/16 AS-PATH = B MED = 10 201.90/16 AS-PATH = B MED = 40 24
All BGP routers that receive announcements made over E-BGP accept them, and store them in their RIB-in with the corresponding NEXT-HOP attribute. For example, the RIB-in at A1 for the link to B1 is RIB-in at A1 from B1 201.89/16 AS-PATH = B MED = 10 NEXT-HOP = 145.1.23.2 201.90/16 AS-PATH = B MED = 40 NEXT-HOP = 145.1.23.2 Since A1 receives only one route to 201.89/16 [resp. 201.90/16] we assume that its decision process accepts this route. We assume a similar behavior at B1. (a) Will A4 also learn the route 201.89/16 AS-PATH = B MED = 10? If so, by which protocol? Solution. By I-BGP, over a TCP connection from A1. (b) What is the routing table entry (in the forwarding table) at router A3 for destination prefix 201.89/16? at B3 for destination prefix 133.29/16? Solution. A3: destination prefix next-hop interface 201.89/16 145.1.23.2 N/A B3: destination prefix next-hop interface 133.29/16 145.1.23.1 N/A 25
2. Assume now that an external link is opened between A4 and B4, as shown on Figure 9. The BGP Domain T Domain A Domain B Domain X 133.29/16 Domain Z 133.30/16 A1 133.1.28.1 133.1.28.2 A2 133.1.28.82 133.1.28.83 A3 133.1.32.82 133.1.32.83 A4 145.1.23.1 145.1.23.2 197.122.223.2 197.122.223.1 B1 B2 B3 201.1.213.2 201.1.213.1 B4 201.1.7.1 201.1.7.2 201.1.110.2 201.1.110.1 201.89/16 Domain Y 201.90/16 Figure 9: Network for exercise 2.4, step 2. announcements that are made over E-BGP are the same as previously plus the following ones: A4 to B4 133.29/16 AS-PATH = B MED = 50 133.30/16 AS-PATH = B MED = 10 B4 to A4 201.89/16 AS-PATH = B MED = 50 201.90/16 AS-PATH = B MED = 10 (a) Which route does the decision process at A4 now select toward the networks 201.89/16 and 201.90/16? at B4 toward 133.29/16 and 133.30/16? Give the answers in the form destination prefix / AS-path / next-hop Solution. destination prefix AS-path next-hop A4: 201.89/16 B 145.1.23.2 201.90/16 B 197.122.223.1 destination prefix AS-path next-hop B4: 133.29/16 B 197.122.223.2 133.30/16 B 197.122.223.2 (b) Does this change the outcome of the decision process at A1? at B1? (justify your answer) Solution. A1: the route toward 201.89/16 does not change, as the new advertisement has bigger MED value. A1: the route toward 201.90/16 changes, as the new advertisement has smaller MED value and will be prefered. 26
B1: the routes will not change as the shortest IGP route toward next hop has the highest priority and will always lead over A1. (c) After BGP converges, assume router A3 has a packet with destination address 201.89.1.1. To which directly connected neighbor does A3 send the packet? By which mechanisms did A3 learn where to send this packet? Same questions for B3 with a packet to send to 133.29.1.1. Solution. A3 forwards the packet to 133.1.28.82, determined by recursive table lookup over the next two forwarding table entries: destination prefix next-hop interface learned by 201.89/16 145.1.23.2 N/A I-BGP from A1 145.1.23.2 133.1.28.82 eth... IGP in domain A B3 forwards the packet to 201.1.213.1, determined by recursive table lookup over the next two forwarding table entries: destination prefix next-hop interface learned by 133.29/16 197.122.223.2 N/A I-BGP from B4 197.122.223.2 201.1.213.1 eth... IGP in domain B 3. Assume now that the link between A1 and B1 fails. Will connectivity between domains T and X be affected and how? Will the BGP routers be able to find new routes from T to X? Explain what will happen, i.e. what will trigger the events, which messages (information) will be exchanged and between which routers and by which protocol, which entries will change and in which tables and at which routers? Solution. The connectivity will temporarily be affected and the routes going over the broken link will experience the losses, until BGP detects and fixes the problem. BGP routers will be able to restore the connectivity by selecting alternate routes. A1 and B1 will detect the problem by observing periodic updates over the broken link are missing, or by detecting that the link is broken by some another means. Then, A1 and B1 will delete the entries learned over this link from their RIB-in tables, and update related entries in their forwarding tables. They will also advertise the changes (I-BGP) to other BGP routers within their domains, and similar delete in RIB-in and update in forwarding tables will take place (there will be only one BGP entry available per considered destination network, and it will be selected). 3 Module 3: Congestion Control Exercise 3.1 Consider the network illustrated on Figure 10. Source 1 uses links 1 and 2; source 2 uses links 2 and 3: source 3 uses link 3. Each of the links has the same capacity c. 1. Assume that the rates x 1, x 2 and x 3 of the three sources are distributed according to max-min fairness. Compute their values. Solution. x i = c 2 by the water filling algorithm. 2. Same question assuming that the rates are distributed according to proportional fairness. 27
source 2 link 1 link 2 link 3 source 1 source 3 Figure 10: A network with 3 sources. Solution. The proportionally fair allocation is obtained by maximizing the function defined for x i > 0 by J =lnx 1 +lnx 2 +lnx 3 subject to the constraints x 1 c (1) x 1 + x 2 c (2) x 2 + x 3 c (3) (4) The constraint (1) is redundant with the constraint (5) and can be deleted. At the optimum, the constraint (5) has to be satisfied, since, if it is not, we can always increase x 1 (which is not subject to other constraints). The same holds for (3). Thus we have to maximize a function of x 2 only, equal to ln(c x 2 )+ln(x 2 )+ln(c x 2 ) Elementary calculus gives the maximum for x 2 = c 3. The proportionally fair allocation is thus x 1 = 2c 3, x 2 = c 3 and x 3 = 2c 3. Exercise 3.2 1. Assume that a TCP sender, called S, does not implement fast retransmit, but does implement slow start and congestion avoidance. Assume that segments n, n +1,n+2,...,n+10are transmitted at times 0, 1, 2,...,10 deciseconds (ds) transmission time per segment is 1 ds round trip time (2-way propagation plus packet transmission, ack processing and transmission) is fixed and equal to 10 ds segment n is lost no other segment or ack is lost there is no misordering of segments or acks by the network the retransmission timer for segment n is set to 60 ds, starting at the end of the transmission cwnd = twnd = 64 segments at time 0 offeredwindow = 70 segments all along the exercise 28
By which means and at what time will the loss of segment n be detected? Solution: Loss of segment n is detected by a retransmission timer timeout, at 61 ds. 2. Immediately after re-transmitting segment n (due to a timeout), S has 3 more segments ready to send (we call them segments n+11 to n+13). At what time is the ack for segment n+3 received (assuming again that there are no losses other than that of segment n)? For segment n +13? Solution: n +3 is ACK ed at 71 ds, n +13is ACK ed at 91 ds. Segment n +3is sent at 3 ds and received at 4 ds. At 61 ds, the loss of segment n is detected and a retransmission occurs. Since the RTT is equal to 10 ds, the segment n is ACK ed at 71 ds along with segments n +1to n +10. Since a loss was detected, cwnd is set to 1 and twnd is divided by 2. When the ACK for n is received, cwnd is set to 2. Hence, segment n +11is sent at 71 ds and segment n +12is sent at 72 ds. n +11is ACK ed at 81 ds. At this point, cwnd is incremented and segments n +13is sent. It is ACK ed at 91 ds. 3. Same question as before assuming now that fast retransmit and fast recovery are implemented and segments n +11to n +13are available for transmission at time 60. Solution: n +3is ACK ed at 23 ds. n + k +3is ACK ed at 72 ds. Segment n +1is sent at 1 ds, ACK ed at 11. Segment n +2is sent at 2 ds, ACK ed at 12. Segment n +3is sent at 1 ds, ACK ed at 13. Since segment n was lost, the three ACKs received are identical. Hence, segment n is retransmitted at 13 ds and ACK ed at 23 ds along with segments n +1to n +10. Note that with fast recovery, cwnd is only halved. Hence, when segments n +11to n +13are ready to be sent at 60 ds, they can be sent in a row at 60 ds, 61 ds and 62 ds. ACK for segment n +13is received at 72 ds. Exercise 3.3 Consider the network illustrated in Figure 11. There are three links and six flows. The flows that use one link are called short, the other flows are called long. The short flow number 1 [resp. 2,3] uses link 1, and its rate is called x 1 [resp. x 2,x 3 ]. The long flow number 1 [resp. 2,3] uses links 1 and 2 [resp. 2 and 3, 3 and 1]. All links have the same capacity c. Case 1 Assume that the rates of the six flows are distributed according to max-min fairness. Compute their values. Solution. x i = y i = c 3 by the water filling algorithm. Case 2 Same question assuming that the rates are distributed according to proportional fairness. Solution. The proportionally fair allocation exists and is unique. Since the problem is symmetric (all links play the same role) the proportionally fair allocation must have x 1 = x 2 = x 3 and y 1 = y 2 = y 3. (Proof of this statement: by contradiction. Assume this would not be true, say for example that we would have x 1 <x 2. By symmetry, the new allocation obtained by exchanging the roles of 1 and 2, thus x 1 = x 2,x 2 = x 1, would also be proportionally fair. This would contradict the uniqueness of the the proportionally fair allocation.) Thus we are looking for x and y that maximize J(x, y) =3lnx +3lny 29
y 3 x 3 link 2 link 3 x 2 y 2 link 1 x 1 y 1 Figure 11: A network with 6 flows. The short flow 1 and the long flow 1 are shown with thick lines. subject to the constraint x +2y c (5) At the optimum, the constraint (5) has to be satisfied with equality, since, if it is not, we can always increase x (which is not subject to other constraints). Thus we have to maximize the function of y only, equal to 3ln(c 2y)+3ln(y) Elementary calculus gives the maximum for y = c 4. The proportionally fair allocation is thus x i = c 2 and y i = c 4. Case 3 We assume now that each flow is a TCP connection. Assume that the round trip times of each short flow is equal to the same number T, while the round trip time of each long flow is exactly 2T (i.e. most of the round trip time is spent queuing and processing at the link buffers; time spent at destinations is negligible). Assume that: The loss ratio at the entrance to link i is q, the same for all links, and the same for all flows that use a link. Thus the loss ratio for a flow that uses one link is q Loss rates are small, so that the loss ratio for a flow that uses two links is considered to be equal to 2q All flows have the same TCP segment size Flows are limited only by the link capacities and overhead is negligible, so we assume that the sum of the rates of flows is equal to link capacity. For example: TCP acknowledgements are never lost. x 1 + y 1 + y 3 = c (6) 30
Compute the rates achieved by all flows under these assumptions. Solution. Apply the loss throughput formula: Thus x i =2 2y i. By Eq.(6), we obtain x i = y i = K T q K 2T 2q y i = c 2 0.207c 2+2 x i =2 2y i 0.586c Case 4 Same question assuming that the round trip times of all six flows are approximately the same (i.e. most of the round trip time is due to processing at the servers, instead of queuing and processing at the link buffers). Compare to the rates found in cases 1 and 2 and explain what you find. Also compare to the rates found in case 3 and explain what you find. Solution. Now we find Thus x i = 2y i. By Eq.(6), we obtain x i = y i = K T q K T 2q y i = c 2+2 0.293c x i = 2y i 0.414c Comparing to cases 1 and 2, we see that this allocation is in between (the ratios x i /y i are 1, 2 and 1.4). This is compatible with the fact that TCP tends to distribute rates according to a utility fairness, intermediate between proportional fairness and max-min fairness, when all RTTs are identical. Comparing to case 3, we see that TCP has a bias against long round trip times. Exercise 3.4 Consider the scenario in Figure 12. A and B each transfer a very large file over a TCP connection with server S. The link rates are: between A and R1: 54 Mb/s in each direction between B and R1: 100 Mb/s in each direction between R1 and R2: 6 Mb/s in each direction between R2 and S: 1000 Mb/s in each direction Assume there is no other traffic than these two TCP connections. The RTT for A is 1000 ms, for B it is 200 ms. 1. What would be the throughputs of A and B if they were max-min fair? if they were proportionally fair? Solution. In both cases, by computing throughputs we have that each source gets 3 Mb/s. 31
S A R1 R2 B Figure 12: Network for exercise 3.4, step 1. 2. Assume we can neglect all losses except on the link R1-R2. Also assume that the two TCP connections can, together, fully utilize the link R1-R2 (i.e. the sum of their throughputs is 6 Mb/s). What are the throughputs achieved by A and B? Solution. By the loss-throughput formula, the throughputs are proportional to the round trip times, and their sum is 6Mb/s, thus they are: for A: 1 Mb/s; for B: 5 Mb/s 3. Assume now that the satellite link has a high loss ratio, due to transmission errors (FEC is disabled). The loss rate for the connection from A is now assumed to be fixed and equal to 0.01. We assume the RTTs stay the same, and, as before, that the two TCP connections can, together, fully utilize the link R1-R2 (i.e. the sum of their throughputs is 6 Mb/s). What are now the throughputs achieved by A and B? L C Solution. Take L = 1500 bytes and C =1.22. For A: Ta sqrt(0.01) = 146 kbit/s; For B: 6Mbit/s 146 kbit/s= 5854 kbit/s. 4. Assume we change the configuration and introduce a transport layer gateway H, as shown on Figure 13. There is now one TCP connection from A to H, a second one from H to S (and one from B to S as before). The RTT between H and S is 200 ms, between A and H is 800 ms and between B and S 200 ms as before. We assume FEC is enabled so that there is no loss between A and H. What is the end to end throughput of A and B? Same question if FEC is disabled, so that the loss rate between A and H is again 0.01. Is it useful to use a transport layer gateway in this scenario? Solution. FEC enabled: then the maximum throughput for the source at A will be the same as for 32
H S A R1 R2 B Figure 13: Network for exercise 3.4, step 2. source B. Indeed, on link A-H there is only one TCP connection, that can exploit the whole bandwidth. Also the connection H-S is identical to B-S, so that they will get the same bandwidth share, 3Mbit/s. FEC disabled: for A: kbit/s. L C 0.8 sqrt(0.01) Ra =(L/800)(C/sqrt(0.01)) = 183 kbit/s; for B: 6Mbit/s 183 kbit/s= 5817 It is not very useful, as it guarantees a share of the bandwidth to the link with larger round trip delay which is only slightly higher. Exercise 3.5 Assume that we change the code of TCP by modifiying the congestion avoidance phase as follows. For every acknowledgement received, we increase the window size as in slow start. Give the pros and cons of this modification. Solution. This is roughly equivalent to performing multiplicative increase by a factor of 2, instead of additive increase. But we know that this is bad because it will not provide fairness. Pros: if I am the only one doing this, I am more aggressive and will gain higher throughput, at the expense of others. Cons: if everyone does this, the network will not distribute rates according to any form of fairness. Connections that have a high share (because the network was lightly loaded when they started) will continue to have a higher share than others during periods of congestion. 33
Exercise 3.6 Assume two hosts have a very large file to transfer, and decide to open n parallel TCP connections for the transfer. 1. Find one advantage and one drawback, for the user of the two hosts, of having n>1. Justify your answer. Solution. Advantage: We know that TCP approximatively shares the network in order to maximize a utility function close to proportional fairness. By using n TCP connections, the user gets n shares instead of 1. Now the result depends on where the bottleneck is, and with whom it is shared. We can distinguish two extreme cases. On one hand, if the bottleneck is a link of large capacity, where the user uses a small fraction of the link. by increasing the number of connections from 1 to n, we have a negligible impact on this link. The fair share for every user remains the same, thus in this case we obtain approximately n times more throughput than before. On the other hand, if the bottleneck is not shared, for example it is a modem line used only by this user. Every fair share will be 1 n of the capacity, so there is no benefit. As we discuss later, we in fact even obtain less in this case because we have more overhead. In summary, one advantage to the user is to obtain more of the network in the case where the limiting resource is shared with others. Drawback: the overhead of managing the n connections (CPU, memory) can become quickly expensive with a growing n. 2. Find one advantage or one drawback, for the rest of the network, of having n>1. Justify your answer. Solution. Advantage: there is no clear advantage for the network. Drawback: the user behaves unfairly and steals network resources. 4 Module 4 Exercise 4.1 Host redirect 1. Supposing that if a host receives (due to an error) a packet destined for an IP address that is not that of the host, that it will retransmit this packet towards the destination ( good citizen rule ). Now suppose that a computer with IP address a, following a hardware error, thinks that its Ethernet address is A= xff:ff:ff:ff:ff:ff. What happens when computers with IP addresses b,c,...(and corresponding MAC addresses B,C,...) try to send IP datagrams to address a? We assume that all the computers are on the same LAN. Solution. Station b sends an ARP request with the IP address of station a and a responds with the MAC broadcast address. Station b sends a packet to station a, which is received by all other stations. All the stations but a send this packet back to the station a (good citizen rule). Thus, the first packet 34
causes n 1 packets and after j turns it causes in total (n 1) j packets. This is an example of the broadcast storm. 2. Among the following rules, which ones seem to you to remove this problem: ICMP messages are never sent as a response to datagrams received on a link layer broadcast address; IP datagrams received on a layer 2 broadcast address are never forwarded; ARP table entries should never map to the link layer broadcast for non-multicast and non broadcast addresses. Solution. Either the second or the third condition can remove this problem. Exercise 4.2 1. The Total Length field in the IP header is the length of the IP datagram (true/false) Solution. false because of fragmentation 2. Replay the IP Fragmentation (2) transparency, assuming that the MTU of the network on the right is 250 (instead of 1500). In that case router R2 will fragment datagrams larger than 250. Packet 2a and 2b are fragmented into 3 packets. For the packet 2c fragmentation is not needed. 2a.1 2a.2 2a.3 2b.1 2b.2 2b.3 2c Length 244 244 172 244 244 172 220 Identificatio 567 567 567 567 567 567 567 More Fragment Flag 1 1 1 1 1 1 0 Offset 0 28 56 75 103 131 150 8*Offset 0 224 448 600 824 1048 1200 3. Supposing that the lifetime of a packet in transit is TTL seconds at the most and that the reassembly timer is at 120 seconds at the most. What is the maximum number of IP packets per second that a system can send so as to avoid two different packets having the same Identification field, for TTL = 60 and TTL = 255? The maximum packet rate ρ has to be large enough so that packets with the same number cannot exist at the same time, which gives: MLT ρ<2 16 where MLT is the packet maximum lifetime (including time in reassembly). The upper bound for ρ is thus: for TTL= 60, ρ< 65536 60+120 = 364 packets/second for TTL= 255, ρ< 65536 255+120 = 174 packets/second If all packets are large Ethernet frames (IP packet size =1500 bytes), then, in the second case, the maximum rate for the source is 174 1500 =2Mb/s. (Note that in reality, the TTL fiel does not limit the lifetime, but the number of hops. The maximum lifetime of a fragment is usually bounded by 2 mn). 4. In the fragmentation algorithm, what happens if new(fragmentlist, P0.(identification, source address), fl)) returns false? How can the performance be improved, avoiding creating a list if a fragment has already been refused because it was not possible to create the list at that moment. 35
Solution. the reassembly timer expires and the reassembly list is discarded. An ICMP error is sent to the source. In order to avoid creating new re-assembly lists if another segement arrives, the reassembly list is put on the blacklist for a duration equal to the maximum fragment lifetime. Arriving fragments of that datagram will be discarded. 5. What is the maximum amount of free memory that it is necessary to allocate at the creation of a fragment list? Solution. equal to the maximum size of the IP datagram (2 16 bytes). 6. Show that the reassembly method shown in the course transparency can lead to a deadlock. How can this be avoided? Solution. A deadlock can occur for example if 6 fragment lists of 5 packets each are interleaved, and there is buffer space for only 25 fragments. The problem will not be solved by timeout. A solution is to allocate to every fragment list (when new(fragmentlist,...) is called) the maximum IP datagram size that is expected (1500 bytes in many cases). 7. Can the following functions be performed (yes or no): Router Host Segmentation -------- ------ Reassembly -------- ------ Routeur Host Segmentation yes yes Rassemblage no yes Exercise 4.3 1. The first byte of an option of an IP header contains Option Code ; if it is 1, the options field must be copied into each of the fragments at fragmentation. Modify the algorithm in the Fragmentation Algorithm transparency to take this field into account. procedure sendipp(p0): if P0.totalLength > MTU then data1length = (MTU-P0.HLEN rounded to multiple of 8) data1=first data1length bytes of P0 data part data2=remainder of P0 data part header1 =P0.header with More bit set totallength =P0.HLEN + data1length P1=new (IPPacket; header1; data1) send P1 on data link layer header2 =P0.header with 36
totallength=p0.totallength-data1length fragmentoffset += data1length/8 for all options do if copy bit =1 then keep option P2= new(ippacket; header2; data2) sendipp(p2) else send P0 on data link layer 2. In the modified algorithm, is there a case where the occurrence of copy bit=1inanoption should be considered as an error? If the original packet P0 is a fragment other than the firs one, then the copy bit in the option must be set to 1. if P0.totalLength > MTU then data1length =(MTU-P0.HLEN rounded to multiple of 8) data1=first data1length bytes of P0 data part data2=remainder of P0 data part header1 = P0.header with More bit set totallength = P0.HLEN + data1length P1= new (IPPacket; header1; data1) send P1 on data link layer header2 =P0.header with totallength=p0.totallength-data1length fragmentoffset +=data1length/8 for all options do if copy bit =1 then keep option P2=new(IPPacket; header2; data2) 37
sendipp(p2) else send P0 on data link layer Exercise 4.4 1. A low quality modem link has a bit error rate of 0.0001. We suppose the errors to be independent and equally distributed. What is the probability that a packet of length L is received correctly? Assume acks are never lost. The probability that the packet is received correctly is equal to p =(1 q) l, where q is bit error rate, and l is size of packets in bits. 2. The modem uses SRP error recovery. We assume a very large window, so that the source always has something to send. We also assume that we have data units of long length to send, segmented into IP packets of size L + K, where K is the overhead. What is the line utilisation for: K =48octets (as for TCP over IP over PPP without compression) L = 296 octets, L = 1500 octets. Call N1 the number of fresh packets over a long time interval and N2 the number of retransmissions. Call r the proportion of packets which is lost. In our case r =1 p. We have the following relation: N2 =(N1+N2) r (7) The utilization u is given by: N1 L u = (8) (N1+N2) (L + K) So the utilization u is: u = L L + K p (9) Relation (9) gives that utilization for L = 296 and K = 48is equal to 0.6534. Utilization for L = 1500 and K =48is equal to 0.2808. Exercise 4.5 A set of n web servers is connected to a single router. The n web servers are all replications of the same site. We want to give only one IP address, shared by the set of n web servers, so that remote web clients have to know only one address. Find two different solutions for this problem. Describe each of your two solutions in 5 to 25 lines. Discuss the advantages and drawbacks of each of your solutions in 5 to 25 lines. Solution. A first idea could be to use a NAT. We can imagine all web servers in the same intranet, with a set of private web addresses, which the NAT translates into the same Internet IP address. This translation function could be done in a load sharing way, choosing each server in turn. Also, to preserve the coupling client-server, the association could be done taking into account the IP address of the source. pros: it does not require any particular configuration setting in the web servers. 38
cons: it is a solution with a single point of failure. Second idea: use of an application layer proxy: a server with IP address equal to the one used by remote web clients. On one side, it terminates the connections with the web clients, up to the application level; on the other side, it establishes connections to each of the n servers in turn, working in load sharing. pros: same as the previous one. cons: It implies more processing than the NAT solution, and it is an application layer-dependent solution. It is also solution with a single point of failure. Some of the (many) other solutions could be: the use of a server which does HTTP redirect; A mechanism similar to NAT but at the MAC layer: every time that an IP packet arrives at the router, it does an ARP on the LAN on which the n web servers are, and, among those that answer, the server chooses one in a round robin fashion; If the n web servers were spread all over the internet, we could simply assign the same IP address to each of them: then routing selects which web server will serve a given client, by routing each request to the server which is closer. Exercise 4.6 Explain in 1 to 5 lines each of the concepts below. 1. Automatic Tunnel Automatic tunnel is a tunnel to a dual stack host. It is used when the destination address of a datagram is IPv4 compatible IPv6 (typically to reach isolated hosts) 2. Sollicited Node Multicast Address 3. DHCP DHCP stands for Dynamic Host Configuratio Protocols. It is a client-server protocol that enables a host to be allocated an IP address. A DHCP server can also provides configuratio parameters required by the host to access the network. For instance, the IP address of the DNS server and the IP address of the gateway. 4. Flow Label The fl w label is one of the fiel of the header of an IPv6 packet. It is 20 bits long and. It is used for QoS management. 5. Transition from IPv4 to IPv6 Until IPv6 native connectivity becomes widely available and supported by the routing infrastructure, it will be necessary to use transition mechanisms to integrate IPv6 and IPv4 nodes smoothly and seamlessly. 6. IPv4 compatible IPv6 address IPv4-compatible IPv6 addresses constitute a special class of IPv6 addresses. Such an IPv6 address has its firs 96 bits set to zero, while its last 32 bits represents an IPv4 address. They are used with Automatic tunneling. It used to represent an IPv4 address in a table with fi ed size members that must also be able to store an IPv6 address. 7. IPv4 mapped IPv6 address IPv4 mapped IPv6 addresses constitute a special class of IPv6 addresses. Such an IPv6 address has its firs 80 bits set to zero, the next 16 set to one, while its last 32 bits represents an IPv4 address 39
An IPv4-mapped IPv6 address enables an IPv6 application on an IPv4/IPv6 host to communicate with an IPv4-only node. IPv4 mapped addresses are normally used by the IP stack to represent IPv4 addresses to IPv6 applications. It allows the transparent use of transport layer protocols (TCP or UDP) over IPv4 through the IPv6 networking API. It is therefore considered as an IPv6 transition mechanism for dual-stack hosts. The big advantage of this mechanism is in allowing a server application to only use a single listening socket to handle connections from client via both IPv6 and IPv4 protocols. In that case, IPv6 clients will be handled as regularly, and IPv4 clients appear as IPv6 clients with an adequate mapped IPv6 address. While the actual packets on the network will be IPv4, the logical connection will be presented as an IPv6 one to the application. Exercise 4.7 1. Explain why some of the logical interfaces on a dual stack host attached to Ethernet have an MTU of 1480 instead of 1500 2. How does a dual stack host know wether it should talk IPv4 or IPv6 with a distant host? Dual stack hosts uses DNS to know whether to use IPv4 or IPv6 send packets. 3. How does a dual stack host know to which router and over which mecanism it should send an IP packet? Exercise 4.8 1. Explain in at most 15 lines the principles, benefits and limitations of an IPv4-IPv6 interworking unit operating at the network layer. 2. Explain in at most 15 lines the principles of an IPv4-IPv6 interworking unit operating at a layer other than the network layer. Exercise 4.9 1. On slide B: Some Examples: Email, explain which function is in a router and which one is in a host. Solution. Both the UA (user agent) and the MTA (mail transfer agent) are part of the application layer, and as such are on hosts. 2. What is a mail exchanger? Is it a router? Solution. A Mail Exchanger delivers SMTP messages from source to destination MTAs. It is not a router. SMTP is an application layer protocol. It may be considered to be a mail router. 3. Do mail exploders use multicast IP addresses? Solution. No. SMTP is on top of TCP which doesn t use multicast addresses. Exercise 4.10 1. Consider the intranet illustrated on Figure 14. There are three Ethernet segments at 10 Mb/s, each corresponding to a net:subnet prefix noted n 1, n 2 and n 3. Every Ethernet segment is connected to two routers as indicated on the figure. There is no external connection to this intranet. Each Ethernet segment has a number of hosts directly attached to it. The Ethernet segments are shared media, there is no Ethernet switching equipment. 40
x1 R1 x2 n1 n2 R2 n3 R3 x3 Figure 14: The firs network for Problem 4.10 (a) We assume that the IP routing tables in R1, R2 and R3 are setup in such a way that traffic from subnet n i to a subnet n j, with i j goes through exactly one router. How can the hosts and routers be configured to achieve this? Show all the relevant routing tables. If necessary, introduce additional notation (for addresses and interfaces). Solution. There is more than one solution to this problem. Let s assume that eth0 or the router Ri (i =1, 2, 3) is connected to the network with a smaller subnet prefix (every router is connected to two networks). Let hostx be the host part of host X IP address, and let Ri be the host part of the router Ri(i =1, 2, 3). In all the cases, the content of routing tables on the routers (obtained by RIP or OSPF) could be: R1: Destination Network Next Hop Interface n1 on-link eth0 n2 on-link eth1 n3 n1.r2 eth0 R2: Destination Network Next Hop Interface n1 on-link eth0 n2 n3.r3 eth1 n3 on-link eth1 R3: Destination Network Next Hop Interface n1 n2.r1 eth0 n2 on-link eth0 n3 on-link eth1 Then, there are 3 ways to configure hosts: 1) Manually defined routes toward all the destination networks: 41
hosts on network 1: Destination Network Next Hop Interface n1 on-link eth0 n2 n1.r1 eth0 n3 n1.r2 eth0 hosts on network 2: Destination Network Next Hop Interface n1 n2.r1 eth0 n2 on-link eth0 n3 n2.r3 eth0 hosts on network 3: Destination Network Next Hop Interface n1 n3.r2 eth0 n2 n3.r3 eth0 n3 on-link eth0 Remark: This manual and case-specific solution is inconvenient and error-prone, and it is not used in practice. 2) Using default gateways: hosts on network 1: Destination Network Next Hop Interface n1 on-link eth0 Default gateway n1.r1 eth0 hosts on network 2: Destination Network Next Hop Interface n2 on-link eth0 Default gateway n2.r3 eth0 hosts on network 3: Destination Network Next Hop Interface n3 on-line eth0 Default gateway n3.r2 eth0 Note that, if using this solution, in some cases a so-called redirection will happen. For example, if a host on n1 sends a packet to the host on n3, the packet will first go to the default router R1. R1 will note that next hop for this packet is a router on the same subnet (R2), and it will inform the host to send subsequent packets destined for n3 directly to the router R2. Note also that, for the given configuration and requirements, this solution works only if the default gateways are carefully chosen according the entries of the routing tables at the routers. For example, if a host directly connected to the subnet n1 sets R2 as the default router, and sends a packet to a host on n3, R2 will forward the packet to R3, and the packet will cross two routers, which is against the posed requirements. This makes the solution not only inconvenient and error-prone but also unreliable, as the routing table entries could change, for example, after rebooting one router (R1 can reach n3 over R2 or R3 in the same number of hops, the first offer that comes will be used). So, though use of a default gateway is convenient and the only good solution in many practical cases, in the concrete case it is not appropriate for achieving the specified requirements (if 42
some traffic passes two routers, the maximum throughput is smaller). 3) Using dynamic routing (RIP for example) on hosts, but in a promiscuous mode. Promiscuous mode means that the routing process does not advertise itself, but only overhears the routing messages exchanged between routers R1, R2 and R3, and it uses this data to compute it s own routing tables. The resulting routing tables could be as in the first case with statically defined routes. In the concrete case, this would be the easiest and the best solution. (b) We call x i the total traffic generated by all hosts directly attached to segment i. We neglect the effect of collisions on one Ethernet and thus assume that the maximum amount of traffic possible on every Ethernet segment is 10 Mb/s. We further assume that the destination of traffic originating from subnet i is uniformly distributed among the three subnets. Thus, for example, the amount of traffic originating from subnet 1 which has a destination in subnet 2 is x 1 3. What is the maximum value of the total traffic x 1 + x 2 + x 3 which is possible with these assumptions? Solution. This is an inequality-constrained optimization problem with concave objective function and convex constraints: The function to optimize (objective function) is: The constraints are: f(x 1,x 2,x 3 )=x 1 + x 2 + x 3 (10) g 1 (x 1,x 2,x 3 )=x 1 + x 2 3 + x 3 10 0 3 (11) g 2 (x 1,x 2,x 3 )= x 1 3 + x 2 + x 3 10 0 3 (12) g 3 (x 1,x 2,x 3 )= x 1 3 + x 2 3 + x 3 10 0 (13) g 4 (x 1,x 2,x 3 )= x 1 0 (14) g 5 (x 1,x 2,x 3 )= x 2 0 (15) g 6 (x 1,x 2,x 3 )= x 3 0 (16) To find the solution, we can apply the Lagrangian approach and the Kuhn-Tucker sufficiency theorem. The theorem (as stated in http://www.economics.soton.ac.uk/staff/aldrich/maths4.pdf ) is: Theorem 16.1 (Kuhn-Tucker sufficiency) Consider the inequality constrained optimization problem with concave objective and convex constraints: i.e. to maximize f(x) (where f : R n R) subject to the constraints g j (x) 0 where g j : R n R and j = 1,..., m. Define L = f(x) m j=1 λ jg j (x) and let x be a feasible point. Suppose we can find numbers λ j such that L(x )=0, λ j 0 for all j, and λ j =0whenever g j (x ) < 0. Then x solves the maximization problem. In our case x =(x 1,x 2,x 3 ) and L(x) =f(x) 6 j=1 λ jg j (x), and we should find x and λ j that satisfy the next conditions: L(x) x 1 =0, L(x) x 2 =0, L(x) x 3 =0 (*) 43
and λ j 0, but if g j (x) < 0 (the constraint is not binding) then λ j =0 (**) (*) and (**) together are nonlinear conditions with respect to λ j, j = 1,..., 6, so we have to assume which λ j s are positive. If λ j is positive, the corresponding constraint is binding, i.e. g j =0, which gives us equations for finding a set of feasible x that corresponds to our assumptions on λ j s. Then we can compute positive λ j s using equations (*) and binding constraints. If computed λ j s and x satisfy conditions (*) and (**), then x is the solution. Otherwise we should assume differently which λ j s are positive, and repeat the procedure until success (there is a theorem that says if the objective function is concave and if each constraint is linear, the conditions from the previous theorem are both sufficient and necessary, which applies in our case). In the concrete case, the symmetry of both the objective function and the constraints allows us to guess easily which constrains are binding (i.e. which λ j s are not necessarily equal to 0). The symmetry and increasing linear dependance of the objective function on x 1, x 2 and x 3 imply x 1 = x 2 = x 3 > 0 (g 4, g 5 and g 6 ) are not binding, i.e. λ 4 = λ 5 = λ 6 =0) and g 4, g 5 and g 6 are all binding. The binding equations give x 1 = x 2 = x 3 = 18 3, and (**) gives λ 1 = λ 2 = λ 3 = 3 5. Assumed and computed λ js and computed x satisfy (*) and (**), so the computed x is the solution of the maximization problem and maximum possible throughput is (x 1 + x 2 + x 3 ) max =18Mb/s. 2. We consider the intranet illustrated on Figure 15. There are three Ethernet segments at 10 Mb/s, interconnected by means of three bridges B1, B2 and B3. There is no router and no external connection in this intranet. Each Ethernet segment has a number of hosts directly attached to it. The Ethernet segments are shared media, there is no Ethernet switching equipment apart from the three bridges B1, B2 and B3. x1 B2 B1 segment 1 segment 2 segment 3 x2 B3 x3 Figure 15: The second network for Problem 4.10 (a) How many subnets are there in principle in this intranet? Solution. There is only one subnet. (b) We call x i the total traffic generated by all hosts directly attached to segment i. We neglect the effect of collisions on one Ethernet and thus assume that the maximum amount of traffic possible on every Ethernet segment is 10 Mb/s. We further assume that the destination of traffic originating from subnet i is uniformly distributed 44
among the three subnets. Thus, for example, the amount of traffic originating from subnet 1 which has a fina destination in subnet 2 is x 1 3. We further assume that the bridges have had enough time to learn and build their forwarding tables. What is the maximum value of the total traffic x 1 + x 2 + x 3 which is possible with these assumptions? Solution. In this case, one of the bridges will block one of its ports in order to prevent forming the loop. We do not lose in the generality of the solution, assuming it is one of the ports of the bridge one. Now the traffic from n1 to n2 and vise versa will go over the network n3. As in the previous case (the case with routers) have an inequality-constrained optimization problem with concave objective function and convex constraints, but now it is not symmetric: The objective function is the same as in the previous case: But the constraints are different from the previous case: f(x 1,x 2,x 3 )=x 1 + x 2 + x 3 (17) g 1 (x 1,x 2,x 3 )=x 1 + x 2 3 + x 3 10 0 3 (18) g 2 (x 1,x 2,x 3 )= x 1 3 + x 2 + x 3 10 0 3 (19) g 3 (x 1,x 2,x 3 )= 2x 1 3 + 2x 2 3 + x 3 10 0 (20) g 4 (x 1,x 2,x 3 )= x 1 0 (21) g 5 (x 1,x 2,x 3 )= x 2 0 (22) g 6 (x 1,x 2,x 3 )= x 3 0 (23) We can use the same auxiliary function L(x), and the same conditions (*) and (**) as in the previous case (the case with routers instead of bridges). Again, we have to assume (guess) binding constraints. Note that the bottleneck here is n 3. Note also that for a feasible allocation with all the x 1,x 2 andx 3, if we decrease x 3 by a small value Δ, we can increase x 1 + x 2 by 1.5Δ. So, if we want to maximize the objective function, we will tend to decrease x 3 to zero, if it allows for the increase of x 1 and x 2. So, we assume that g 6 and g 3 are binding. As the problem is symmetric with respect to x 1 and x 2, and for x 1 = x 2 the constraints g 1 and g 2 become equal to the constraint g 3 (for assumed x 3 =0), g 1 and g 2 are binding as well. From the binding equations we obtain x 1 = x 2 = 15 2. The conditions (*) give λ 6 = λ 3 3 and λ 1,2 = 3 4 λ 3. If we choose λ 3 =1, we obtain λ 1,2 = 1 4 and λ 6 = 1 3 which are all positive, and the condition (**) is satisfied. So, (x 1 = x 2 = 15 2, x 3 =0) is the solution of the optimization problem. The maximum possible throughput in this case is (x 1 + x 2 + x 3 ) max =15Mb/s, which is less than in the case with the routers instead of the bridges (and it is achieved only if the hosts directly connected to n3 do not generate outgoing traffic). 45
Exercise 4.11 1. Based on what addresses (MAC addresses, IP addresses, UDP/TCP port numbers) do bridges forward packets? 2. For the rest of this problem, we define a new bridging method (called structured bridging ). Unlike the bridging method we have seen in the lecture, this method is not transparent. It uses a supplementary field in the Ethernet packet, called Routing Information field. The Routing Information field already exists in some versions of Ethernet; it is used by source routing bridges (which we did not see in the lecture). We redefine it here for the purpose of supporting structured bridging. Therefore, structured bridging is incompatible with source routing and with transparent bridging. Consider a collection of Ethernet segments, interconnected at layer 2 by bridges (one Ethernet segment is one collision domain). We assume that the bridges implement structured bridging, defined as follows. every LAN segment is allocated a 16 bit number, called the LAN Segment Identifier (LSI) consider a station A, connected to a LAN segment with LSI equal to L1, and a station B connected to a LAN segment with LSI equal to L2. When A sends a MAC frame to B, it puts in the MAC frame: source address = A, destination address = B, Routing Information : (destination LSI=L2, source LSI=L1). bridges have forwarding tables based on LSIs. Namely, for every destination LSI, a bridge knows on which port it has to send the MAC frame. Unless specified otherwise, we assume that the forwarding tables are written manually. Assume station A knows the IP address of station B, but not its own LSI nor B s LSI, nor B s MAC address. Assume also that a host knows its own MAC address but does not know its LSI at initialization. Explain (in at most 15 lines) how station A can communicate with station B over the bridged network using structured bridging (without using any routers). 3. Propose the principles of a method for the bridges to build the LSI forwarding tables automatically (at most 15 lines) Exercise 4.12 Quiz 1. true false When an IPv4 system A sends an ICMP packet to the IPv4 system B, it sends it as a UDP packet with destination port number = 1 (the port reserved for ICMP). Solution. false. ICMP is an IP protocol, it does not use UDP 2. true false A filtering router may be configured to discard all IP packets that have protocol type = UDP and source port number = 234. Solution. true. 46