CSD008/COMP3616, Networks & Internet Systems: Problem Set 5 ----------------------------------------------------------- Solutions --------- ("Tanenbaum" refers to the 4th Edition) 1. (Tanenbaum, Ch. 5, problem 39) A network on the Internet has a subnet mask of 255.255.240.0. What is the maximum number of hosts it can handle? Solution: the given subnet mask's encoded IP address is 11111111111111111111000000000000 12 bits are available for the hostid ==> 2^12 possible hostids. However all-0's and all-1's are reserved, so the maximum number of hosts on this subnet is 2^12 - 2 = 4094 hosts. 2. (a) Suppose a host with IP address 128.96.34.15 has a subnet mask of 255.255.255.128. What is the subnet number of the subnet this host is attached to? Solution: the encoded IP addresses are 10000000011000000010001000001111 11111111111111111111111110000000 AND -------------------------------- 10000000011000000010001000000000 which (converting back into dotted-decimal notation) is a subnet number of 128.96.34.0. (b) The host in part (a) wants to send an IP datagram to a host with IP address 128.96.34.139. Is the destination on the same subnet as the sender or not? Solution: the bitwise AND of the destination address and the host's subnet mask yields 10000000011000000010001010001011 11111111111111111111111110000000 AND -------------------------------- 10000000011000000010001010000000 which in dotted-decimal form is 128.96.34.128. This does not match the sending host's subnet number, so the destination is not on its subnet and the datagram must be sent to a router. 3. (Tanenbaum, Ch. 6, problem 14) Why does UDP exist? Would it not have been enough to just let user processes send raw IP packets in order to communicate? Solution: No. IP datagrams use IP addresses (identifying host machines), so without any additional addressing information the destination network layer process responsible for delivering data to application layer processes would not know what to do with an arriving IP datagram. Process-to-process communications are based on the concept of ports. A port is a conduit into a computer through which data flows. We can have multiple processes on a single computer, each with their own port number. A process is uniquely addressed by a pair. Common applications are available at well-known (and reserved) ports on each host; user applications must choose from the set of non-reserved ports (generally, above 1023). A UDP segment contains a destination port number that identifies which application process is supposed to receive the data. In this way UDP converts IP's machine-to-machine delivery service into a process-to-process communication service. 4. (Tanenbaum, Ch. 6, problem 23) A process on host 1 has been assigned port p, and a process on host 2 has been assigned port q. Is it possible for there to be 2 or more TCP connections between these 2 ports at the same time? Solution: No. A TCP connection is uniquely identified by the socket identifiers at each end {sock_id_1, sock_id_2}, where sock_id_1 = IP_address_1, p sock_id_2 = IP_address_2, q Therefore, while multiple TCP connections may simultaneously exist at sock_id_1 (or sock_id_2), there can only be one TCP connection between sock_id_1 and sock_id_2 at any given time. 5. (Tanenbaum, Ch. 6, problem 20) Datagram fragmentation and reassembly are handled by IP and are invisible to TCP. Does this mean that TCP does not have to worry about data arriving in the wrong order? Solution: No. Although each IP datagram arrives intact, the datagrams themselves may be out-of-order, requiring TCP to reassemble the transmitted message. 6. (a) (Tanenbaum, Ch. 6, problem 28) Consider the effect of using slow-start on a line with 10 millisec round trip time and no congestion. The receiver's window is 24 kB and the Maximum Segment Size is 2 kB. How long does it take before the first full window can be sent? Solution: the first transmission is 2 kB, the second is 4 kB, the third is 8 kB, the fourth is 16 kB, and the fifth is 24 kB (which is the receiver's advertized window). Therefore it takes 4 transmissions, or 40 millisec, before the first full window is sent. (b) (Tanenbaum, Ch. 6, problem 29) Suppose that the TCP congestion window is 18 kB and then a timeout occurs. If the Maximum Segment Size is 1 kB, how big will the congestion window be after 4 successful transmission bursts? Solution: the first transmission after a timeout is 1 MSS, or 1 kB in this case. Assuming no further problems, the second transmission will be 2 kB, the third will be 4 kB, and the fourth will be 8 kB. However remember that the Threshold parameter will have been set to half of the previous congestion window, or 9 kB in this case. So after the 4th successful transmission, the congestion window is only allowed to increase from 8 to 9 kB. 7. (Tanenbaum, Ch. 6, problem 31) A TCP machine is sending full windows of 65,535 bytes over a 1 Gbps channel that has a 10 millisec one-way delay. What is the maximum achievable throughput? What is the line efficiency? Solution: one window's worth of data can be sent every 20 millisec. The achievable throughput is therefore (65,535)/(20x10^-3) = 3.28x10^6 bytes/second = 26.21x10^6 bits/second, or 26.21 Mbps Since the line rate is 10^9 bits/second, the efficiency is (26.21x10^6)/(10^9) = 0.02621, or approximately 2.6%. Note : this shows that on high-speed links, the current TCP window management scheme performs poorly. One option is to scale the window size to allow more data to be transmitted in one RTT (see p. 539). 8. Mention some of the challenges faced in delivering "continuous media" (e.g. video, voice) over a computer network. Of the two protocols TCP and UDP, which one is usually used to deliver continuous media in the Internet, and why? Solution: challenges include having to handle -- delay (has many components, e.g. packetisation, encoding, sender OS, transmission, propagation, network queueing, receiver OS, decoding, playout buffer, playout device...) -- jitter (in other words, delay variation) -- data loss -- bandwidth constraints -- need to synchronise across media (e.g. voice and video) UDP is usually preferred to TCP as the transport protocol for multimedia delivery over IP-based networks because of their characteristics: -- TCP: retransmissions can lead to high delay and delay jitter; doesn't support multicast; slow start congestion control mechanism not suitable for continuous media. -- UDP: no retransmissions; supports multicast; no congestion control (traditionally). 9. Briefly describe the steps carried out by a Web client retrieving a Web page, and by the Web server providing that Web page. Solution: see lecture notes on "The World Wide Web". 10. Briefly describe (with the aid of diagrams) the "hidden" and "exposed" station problems in IEEE 802.11 Wireless LANs. Solution: see lecture notes on "Mobile/Wireless Internet".