Quiz 2 Solutions 1. Consider an ATM wide area network, such as might be available from a national service provider, and a local area network, such as an Ethernet. (a) (10 points) Why does the wide area network prefer small packet lengths while the local area network usually prefers long packets? Small packets reduce the time to forward packets in a store and forward system. This is especially important in systems such as ATM that can carry real time data. Long packets, as in an Ethernet, reduce the fraction of overhead due to contention, headers and trailers. In addition, small packets in a WAN make for simpler switches with smaller buffers. (b) (10 points) How do the routing problems differ in the two networks? There is no routing in an Ethernet or a ring. Each stations sees every packet in a LAN. In ATM, you have to worry about setting up the virtual circuit which involves reserving resources, finding the best path, and dealing with quality of service issues. 2. If we look at the link level and the transport level, it appears that many of the services are duplicated. (a) (10 points) Why is error checking done at both levels? Is there any difference between the error checking methods at the two levels? There may be different techniques but each is usually some form of error detection so is part of an acknowledgement/retransmission scheme. Note that TCP does a checkon the whole packet, not just the header. It's IP that only does a header check. The reason for both is that a link level check does not account for things such as lost packets. (b) (10 points) Why is flow or congestion control done at both levels? What is the difference between flow control and congestion control? The link level only worries about point to point traffic (flow control) while the transport level, being an end-to-end layer has to worry about congestion in the network. Generally, flow control is easier as a node can either just discard packets or sent a choke packet. Congestion control requires the sender to slow down (which would not be the case if the receiver were to simply discard packets). 3. Consider the following situations in a network using TCP/IP. In each case, explain how the network recovers from the error. In each case identify what layers take care of the problem and how they do so. If you believe that the system cannot recover from the error, justify your conclusions. (a) (7 points) As a packet goes from a computer A to computer B, it passes through a link between switches C and D. On this link, an error in one bit of the address in the IP packet occurs. This should be handled at the link layer! The IP packet is encapsulated in a link layer packet so it doesn't matter which bit is in error. D will discard the packet, C will time out and resend it. (b) (7 points) As a packet goes from a computer A to computer B, it passes through a link between switches C and D. On this link, an error in one bit of the address in the link packet occurs. Same as (a): the link layer. (c) (6 points) The packet arrives at C but C crashes before it can send the packet on to D. Unless C recovers immediately, the packet is lost and TCP on A will have to resend it after a timeout when A fails to get an ack. 4. When a user enters data on a remote computer through a network (such as with telnet), there can be a huge amount of wasted overhead as each character can generate a separate TCP segment. One way to avoid this problem is to send out the first character in its own packet and then have the computer buffer succeeding characters until the acknowledgment from the first packet arrives. At this point all the characters in the buffer are sent in a new TCP segment. (a) (13 points) Suppose that you can type at an average rate of 500 characters per minute and that there is a round trip delay of 20ms in the network, how big is the data part of the segment? The scheme sounds good but won't work. Even at the high typing rate of 500 chars/sec, thats less than 1 char in 20ms. So most of the time, the buffer will be empty when the ack comes in. Note that you have to send a whole character and it makes no sense to send a TCP packet with nothing in it. So whenever a char comes in, it is sent in a TCP packet with only one byte of data. (b) (7 points) What happens if the network has a round trip delay of 100ms? Still too short a delay for the scheme to work. Same answer as (a). 5. Suppose that a router receives an IP packet containing 600 bytes of data and has to forward it to a network whose maximum packet size is 200 bytes. Assume that an IP header is 20 bytes. (a) (6 points) How many fragments does the rounter have to create for each packet? We need four fragments. (b) (7 points) What is the total length of each packet sent to the next network? You all missed that IP sends fragments in an integer number of 8 byte chunks. Since 180 bytes (200 - 20 for the header) is not a multiple of 8, we send 176 data bytes in each of the first three packets and the remaining 72 in the last for packet sizes of 196, 196, 196, and 92 bytes. (c) (7 points) What is the fragment offset in each of the packets sent out? The fragment offset is counted in units of 8 byte chunks, not bytes (bytes are counted in TCP). So the offsets are 0, 22, 44, 66.