Download EE122 Midterm examination and more Lecture notes Data Communication Systems and Computer Networks in PDF only on Docsity!
University of California at Berkeley
College of Engineering
Department of Electrical Engineering and Computer Sciences
EE
MIDTERM EXAMINATION
Thursday, 11 October 2012 Scott Shenker
INSTRUCTIONS—READ THEM NOW! This examination is CLOSED BOOK/CLOSED NOTES. You will not require a calculator, iPhone®, laptop computer, or other calculation aid. Please put them away right now! You MAY use one 8.5”x11” double-sided crib sheet, packed with notes, formulas, and diagrams (but no smaller than 8pt font). All work should be done on the attached pages, and there are four blank pages at the end for you to use as scratch paper. Don’t be scared off by the number of questions; many of them are simple warm-up exercises, and you should have plenty of time to finish them all.
In general, if something is unclear, write down your assumptions as part of your answer. If your assumptions are reasonable, we will endeavor to grade the question based on them. If necessary, of course, you may raise your hand, and a TA or the instructor will come to you. Please try not to disturb the students taking the examination around you. Please write your SID on each page!
Name – Please Print! (Signature)
SID Discussion Section (Day/Time)
Question Possible Points Points Obtained 1 True or False 20 2 General Multiple-Choice 20 3 TCP Basics 10 4 Sequence of Messages 15 5 The Real World 6 6 Timer Values 8 7 Addressing 14 8 Learning Switch 12 9 DNS 4 10 Sliding Window 10 Bonus Questions 0. Total 119.
SID October 11, 2012
Fun Facts to Remember
The IP header, without options, is 20 bytes
The TCP header, without options, is 20 bytes
The UDP header is 8 bytes.
1 TB = 10
12
bytes; 1 GB is 10
9
bytes; 1 MB is 10
6
bytes
1Gbps is 10^9 bits/sec; 1Mbps is 10^6 bits/sec
1 msec is 10
seconds
SID October 11, 2012
2. General Multiple-Choice [20 points]
Pick one and only one answer for each question (indicate by circling)
- The appropriate layer for implementing reliable transfer is: a. The physical layer b. The data link layer c. The network layer d. The transport layer e. The application layer
- A router running distance-vector routing knows: a. Nothing b. The entire network’s topology c. The distance to destinations through its immediate neighbors
- A router running link-state routing knows: a. Nothing b. The entire network’s topology c. Only the distance to destinations through its immediate neighbors
- Which of these fields does an IP router need to modify before sending a packet to the next hop? a. Source Address b. Destination Address c. Protocol d. TTL e. None of the above
- Which of these fields in the IP header protect against corruption of the data payload? a. TTL b. Fragmentation flags c. Protocol d. Checksum e. None of the above
- Which of these fields does the UDP packet header have? a. Source address b. Destination address c. Checksum d. Protocol e. None of the above
SID October 11, 2012
- Which of these fields is present in IPv4, but not in IPv6? a. Source Address b. Destination Address c. Fragmentation flags d. Protocol/Next Header e. None of the above
- Which of these fields is present in IPv6, but not in IPv4? a. Flow Identifier b. Destination Address c. Destination port d. Protocol/Next Header e. Checksum
- Which one of the following apply to MAC addresses? a. May be assigned dynamically b. Used in the physical layer c. Used in the data link layer d. Used in the network layer e. Hierarchical
- Which one of the following apply to IP addresses? a. May be assigned dynamically b. Burned into the device c. Used in the physical layer d. Used in the data link layer e. Always globally unique
- Consider an IP packet (without options) with total length 1500 bytes. The packet is split into fragments by a network that can only handle IP packets of up to 500 bytes. Which set of IP packet lengths could describe the set of fragments? a. 500, 500, 500 b. 400, 400, 400, 300 c. 420, 420, 420, 300 d. 500, 500, 500, 80 e. None of the above
- Assuming circuit switching, if the network has allocated exactly enough bandwidth to handle the application’s peak bandwidth P, and the application has average bandwidth A, the level of utilization of that application’s circuit is given by (where / denotes division): a. A/P b. P/A c. (P - A)/A d. (P - A)/P
SID October 11, 2012
- Someone invents a new compression technique that reduces data to a quarter of its original size. As chief Internet architect, you suggest deploying this technology in all: a. End hosts b. Routers c. Switches d. NAT boxes
- If the round-trip time for packets going from Berkeley to MIT is roughly 100msec (i.e., 0.1sec), and the bandwidth available to a connection is roughly 1Mbps (remember this is 106 bits per second), then how large of a window (in bits) is necessary to “fill the pipe”? a. 100 bits (10^2 ) b. 1000 bits (10^3 ) c. 10000 bits (10^4 ) d. 100000 bits (10^5 ) e. 1000000 bits (10^6 )
- Using the same parameters as above, what is the end-to-end throughput that can be achieved if the source uses a window size that is double the size needed to fill the pipe? a. .1 Mbps b. .5 Mbps c. 1 Mbps d. 2 Mbps e. 10 Mbps
- Again using the parameters above, what is the end-to-end throughput that can be achieved if the source uses a window size that is half the size needed to fill the pipe? a. .1 Mbps b. .5 Mbps c. 1 Mbps d. 2 Mbps e. 10 Mbps
SID October 11, 2012
3. TCP Basics [10 points]
Pick one and only one answer (indicate by circling)
A TCP connection has been established between hosts A and B. A receives a packet from B that has a 52 byte TCP payload and the following field values shown below: Sequence: 1001 Acknowledgement: 5001 Window size: 4000 Assume that B has not sent any acknowledgments beyond 5001.
For each of the packets below, indicate whether they are possible valid responses from A:
Sequence: 5001 Acknowledgement: 1053 Valid Invalid Window size: 200 Payload: 2000
Sequence: 1053 Acknowledgement: 5001 Valid Invalid Window size: 3000 Payload: 2000
Sequence: 8001 Acknowledgement: 1053 Valid Invalid Window size: 200 Payload: 1000
Sequence: 6001 Acknowledgement: 1053 Valid Invalid Window size: 200 Payload: 4000
Sequence: 6231 Acknowledgement: 1053 Valid Invalid Window size: 2000 Payload: 1000
Validity test:
Sequenceresponse >= 5001 (Sequenceresponse + Payloadresponse) <= (Acknowledgementfirst + Window sizefirst) = (5001 +
- = 9001
SID October 11, 2012
5. The Real World (according to EE122) [6 points]
Pick one and only one answer for each question (indicate by circling)
- Your grandfather calls you because, in his words, “the Internet is broken.” You ask him for details, and he explains that he cannot access any web sites, including google.com and npr.org. Which of the following is most likely the cause of the problem? a. Your grandfather’s DHCP server is no longer working, so he hasn’t been assigned an IP address. b. Your grandfather’s DHCP server is no longer working, so he hasn’t been assigned an Ethernet address. c. Your grandfather is behind a NAT box, which means that he cannot access anything outside of his local network. d. The “com” top level domain server is down. e. Google is down.
- The next day your grandfather calls you back to thank you for fixing his computer, but he now says that he can reach all sites except your home page www.yourfavoritegrandchild.com. You know the site is up (because it is served off of your home PC, and you know your PC is connected to the Internet). Which of the following is the most likely cause of this new problem? a. Your grandfather’s DHCP server is no longer working, so he hasn’t been assigned an IP address. b. Your grandfather’s DHCP server is no longer working, so he hasn’t been assigned an Ethernet address. c. Your grandfather is behind a NAT box, which means that he cannot access anything outside of his local network. d. The “com” top level domain server is down. e. The authoritative DNS server for yourfavoritegrandchild.com is down.
- The following day your grandfather calls you back to thank you for fixing his computer again, but he now says that he can’t reach google.com or bing.com, but he can reach cs.berkeley.edu and npr.org. Which of the following is the most likely cause of this latest problem? a. Your grandfather’s DHCP server is no longer working, so he hasn’t been assigned an IP address. b. Your grandfather’s DHCP server is no longer working, so he hasn’t been assigned an Ethernet address. c. Your grandfather is behind a NAT box, which means that he cannot access anything outside of his local network. d. The “com” top level domain server is down. e. All authoritative DNS servers are down.
SID October 11, 2012
6. Timer Values [8 points]
Pick one and only one answer for each question (indicate by circling)
- An offer message from a DHCP server includes a lease time (along with other fields like an IP address, subnet mask, DNS server address, and so on). Why is a lease time necessary? a. The lease field is necessary for scalability: without a lease time, a DHCP server would store one entry for every host that ever used the network, and eventually this state would become infinite. b. The lease time helps network operators bill hosts correctly for the amount of time that they were using the network. c. The lease time allows the DHCP server to reclaim IP addresses, even if the client never explicitly releases the address (e.g., if the client crashes). d. The lease time ensures that addresses assigned to hosts remain private, and aren’t sent outside of the private network where they are being used.
- The IP packet header includes a time-to-live field that is decremented by each router along the path. Why is the time-to-live field necessary? a. The TTL field is decremented at each router along the path, and routers drop packets with a TTL of 0, so the TTL field prevents packets from looping indefinitely if they are stuck in a forwarding loop. b. The TTL field allows hosts to determine the appropriate window size. c. The TTL field is necessary for scalability. Routers store each packet for the amount of time given by the TTL field; without the TTL field, routers would need to store packets forever, which would consume infinite space. d. The TTL field is not necessary, which is why it was removed in IPv6.
- NAT has a timer associated with each map entry. Why is this necessary? a. The timer field is included in each packet and decremented at each router along the path. Routers drop packets with a timer value of 0, so the timer field prevents packets sent by the NAT box from looping indefinitely. b. NAT stands for network address timer; the timer is fundamental to a NAT’s functionality. c. Eventually, the NAT box needs to reclaim port numbers to use for new data transfers. Without a timer, the NAT box would eventually use up all ports and not be able to allow new connections. d. When a NAT box assigns an IP address to a client and the client never responds, the timer allows the NAT box to eventually reclaim the address.
SID October 11, 2012
7. Addressing [14 points]
Pick one and only one answer for each question (indicate by circling)
- What is the network portion of the address 4.5.6.7 with mask 255.192.0.0? a. 0000001100 b. 00000100000 c. 0000010011 d. 00010100101 e. 0000010000
Mask 11111111.11000000.00000000. Address 00000100.00unimportant bits omitted
- What is the host portion of the address 4.5.6.7 with mask 255.255.255.0? a. 1100110010 b. 00000111 c. 00001010 d. 111000000 e. 00001000
Mask 11111111.11111111.11111111. Address unimportant bits omitted 00000111
What is the address range covered by the prefix 128.8.16.0/20? a. 128.8.16.0 - 128.8.16. b. 128.8.16.0 - 128.8.20. c. 128.8.16.0 - 128.8.24. d. 128.8.16.0 - 128.8.31.
- 0 Address 10000000.00001000.00010000. Mask 11111111.11111111.11110000.
Conveniently, this means the highest possible address is Address’ 10000000.00001000.00011111. which is 128.8.31.255.
SID October 11, 2012
For the next four questions, consider the following routing table:
128.8.16.0/20 Port 1 10000000.00001000.00010000.00000000^ 128.8.16.0^ 128.8.31.
128.8.24.0/21 Port 2 10000000.00001000.00011000.00000000^ 128.8.24.0^ 128.8.31.
128.8.128.0/24 Port 3 10000000.00001000.10000000.00000000^ 128.8.128.0 128.8.128.
128.8.128.0/28 Port 4 10000000.00001000.10000000.0000^0000 128.8.128.0^ 128.8.128.
Default Port 5
For each of the following addresses, indicate which port the packet is sent out:
Port 1 Port 2 Port 3 Port 4 Port 5 This is within the range corresponding to Port 3, but none other.
Port 1 Port 2 Port 3 Port 4 Port 5 This is within the range of Ports 3 and 4, but the range corresponding to Port 4 is more specific (/28).
- 128.8.25.
Port 1 Port 2 Port 3 Port 4 Port 5 This is within the range corresponding to Port 2.
Port 1 Port 2 Port 3 Port 4 Port 5 Same as question 5.
SID October 11, 2012
After A sends a packet to F, the switches know the links for the following destinations^1 :
After E then sends a packet to A:
(^1) We cheat by listing the known hosts next to the switch, but not the specific link.
A
D
F
B
E
C
4
(^1 )
3
5
6
7
8
A
A A
A
A
A
A
A
A
D
F
B
E
C
4
(^1 )
3
5
6
7
8
A
A,E A
A,E
A
A
A,E
A,E
SID October 11, 2012
After C then sends a packet to E:
A
D
F
B
E
C
4
(^1 )
3
5
6
7
8
A
A,E A
A,E,C
A,C
A,C
A,E
A,E,C
SID October 11, 2012
10. Sliding Window [10 points]
Pick one and only one answer for each question (indicate by circling)
Consider a sender and receiver exchanging data using a sliding window flow control. We use the notation Di to refer to the i’th data packet, and Ai to refer to the ACK packet acknowledging receipt of all data packets up to and including packet (i-1). Assume that the transport protocol has a fixed window size of 5, and will time out packets after 1 second and retransmit them (no fast retransmits). Assume further that the packet transmission time and RTT time are much smaller than 1 second.
We will give you a series of ACK packets received by the sender, and you need to tell us which of the several scenarios could be responsible for this series of observed ACK packets.
Scenarios: a. D3 was dropped by the network b. The ACKs sent in response to packets D and D3 were dropped by the network c. A3 was duplicated by the network d. D3 was duplicated by the network e. D2 and the ACK sent in response to D4 was dropped by the network
Each of the following independent questions shows the first five ACKs received by the sender. For each one, pick which one of the scenarios was most likely to produce this result:
- A2 A3 A3 A4 A5 pick one of: a b c d e
- A2 A2 A2 A2 A7 pick one of: a b c d e
- A2 A3 A3 A3 A3 pick one of: a b c d e
- A2 A3 A4 A4 A5 pick one of: a b c d e
- A3 A5 A6 A7 A8 pick one of: a b c d e
SID
N.B. The following table shows the answers are sufficient. It does not prove they are the only possible correct cases. X0 = duplicated packet X0 = packet dropped Sender generates Receiver gets Receiver generates Sender gets D2 and the ACK sent in response to The ACKs sent in response to packets D1 and D3 were dropped by
- October 11,
- 1 D Scenario
- 2 D A3 was duplicated by the network
- 3 D D4 was dropped by the network
- 4 D D3 was dropped by the network
- 5 D D3 was duplicated by the network