You are on page 1of 14

CS471/EE471/CS573: Fall 2012-2013 Handout # 30

Zartash Uzmi

Final Examination 2012-2013 – Solutions


Closed Books and Notes, Two A-4 hand-written help sheets (both sides), Calculators allowed
Time Allowed: 2.5 hours (Monday, December 17, 2012 starting at 12:00 noon)

“I certify that I have neither received nor given unpermitted aid on this examination and
that I have reported all such incidents observed by me in which unpermitted aid is given.”

Signature

Name Student ID

IMPORTANT NOTE: In this course, and in this exam, 1 K means 1000 and not 1024. Similarly,
1 M means 106 . Capital ‘B’ is used for bytes, while small ‘b’ is used for bits. Therefore, 1 Kb/s is
1000 bits/sec, and 4 MB is 4×106 bytes. All addresses are IPv4 unless specified otherwise.
We will prefer brief and to the point answers!
For questions that require numerical answers, make sure to compute a final answer (calculators
are allowed!); significant grade may be lost if you fail to compute a final answer.

Problem 1 [14]

Problem 2 [10]

Problem 3 [16]

Problem 4 [20]

Problem 5 [30]

Problem 6 [15]

TOTAL [105]

1
2
Problem 1: TCP Interaction [14 points] Consider a TCP connection established between two
hosts A and B. At some point during the communication, host A has sent out 20 packets to host
B; assume these packets are numbered 1 to 20. Host A receives an ACK for packet number 10,
followed by triplicate ACKs for packet number 11. Each packet from A to B contained 1100 data
bytes and the first byte in packet number 1 is byte number 34567. Given this information:
(a) [2 points] Which of the 20 packets can host A assume are lost?
Solution: 12. Note that TCP does not ACK by segment (packet) numbers but by the number
of next expected byte. There is no packet numbering in TCP, so the packet numbers here are all
hypothetical. When we say that “ACK for packet number 10 is received”, it really means that
packet number 10 was received by the receiver and is being ACKed. In this ACK packet, the
ACK number field will contain the byte number of next expected byte (that would be the sequence
number of first byte in packet number 11). We will also accept 11 as a partially correct answer.
(b) [2 points] Which of the 20 packets can host A assume were definitely received?
Solution: 1 through 11 (partial credit: 1 through 10)
(c) [3 points] What is the value of ACK number field in each of the three triplicate ACK packets
that host A has received?
Solution: Same value in each packet. The value is 34567 + 11 × 1100 = 46667. Partial credit given
for 34567 + 10 × 1100 = 45567.

After receiving the triplicate ACKs, host A retransmits the next missing packet and receives an
ACK for packet number 16 in response. Each packet still contained 1100 bytes of data. Given this
information:
(d) [2 points] Which packets of the original 20 can host A assume are still lost, if any?
Solution: None.
(e) [2 points] Which of the original 20 packets can host A assume were definitely received?
Solution: 1 through 16 (partial credit: 1 through 15)
(f ) [3 points] What is the value of ACK number field in the ACK packet that host A has received?
Solution: 34567 + 16 × 1100 = 52167. Partial credit given for 34567 + 15 × 1100 = 51067.

3
Problem 2: Local and Wide area Forwarding [10 points] A network topology is shown in the
figure. X and Y (shown as circles) are end stations. All devices have one or more network interfaces
with corresponding IP and MAC addresses. The NAT IP6 is on the “inside” of an organizational
network while IP7 is a global IP address. B1 is a bridge while R1, R2 and R3 are routers. Assume
that all interfaces of routers are on different subnets (this is what usually happens in a router).

IP6 IP7 IP8 IP9


MAC6 MAC7 MAC8 MAC9
X NAT R2
IP1
MAC1 IP11
IP2 IP5 MAC11
MAC2 MAC5
R1 R3 Y
IP4 IP10 IP12
B1 MAC4 MAC10 MAC12
IP3
MAC3

Figure 1: Switched Ethernet LAN

Assume that X and Y are exchanging application layer traffic that uses TCP underneath. We
are interested in source and destination IP and MAC on various packets in the network for this
traffic. For packets on each of the following directional links, indicate all the four fields:
(a) [2 points] Packet on link from B1 to R1.
Src IP: IP1 Src MAC: MAC1
Dst IP: IP12 Dst MAC: MAC4
(b) [2 points] Packet on link from NAT to R1.
Src IP: IP12 Src MAC: MAC6
Dst IP: IP1 Dst MAC: MAC5
(c) [2 points] Packet on link from R2 to R3.
Src IP: IP7 Src MAC: MAC9
Dst IP: IP12 Dst MAC: MAC10
(d) [2 points] Packet on link from X to B1.
Src IP: IP1 Src MAC: MAC1
Dst IP: IP12 Dst MAC: MAC4
(e) [2 points] Packet on link from R1 to B1.
Src IP: IP12 Src MAC: MAC4
Dst IP: IP1 Dst MAC: MAC1

4
Problem 3: Campus Size [16 points] We define campus size as the maximum length of a piece
of wire (passing through ducts and pipes or hubs but not through Ethernet switches or bridges) on
campus network between any two network cards. Note that the length is measured between two
network cards: this could either be between two hosts, between two bridge interfaces, between a
host and a router interface, etc. For this problem assume a signal propagation speed of 3 × 108 m/s.
(a) [4 points] Assume that Ethernet packets are standardized to have a minimum length of 72 bytes
(which includes 26 bytes of header and preamble). Find campus size for a 100 Mb/s Ethernet LAN.
Solution: Transmission time must be at least as large as twice the worst-case propagation time
l
 72×8
for collision detection to work. Thus the campus size l is found using 2 3×108 = 100×106 , which

yields l = 864 meters.


(b) [2 points] Consider a campus network whose size does not exceed what you found in part (a),
is it okay to add a bridge (ethernet switch) to this network? Say YES or NO. If YES, why? If NO,
why not? In no more than one sentence. Longer and irrelevant explanations (even if they contain
the correct answer) will receive no credit.
Solution: YES. Adding a bridge introduces multiple collision domains; this can only help by
decreasing the worst-case distance (i.e., the maximum distance between any two machines) within
a single collision domain.
(c) [2 points] Consider a campus with size you found in part (a), is it okay to add a hub (or repeater)
to this network? Say YES or NO. If YES, why? If NO, why not? In no more than one sentence.
Longer and irrelevant explanations (even if they contain the correct answer) will receive no credit.
The definition of hub/repeater is the one we used in class, i.e. a device all of whose ports are in the
same collision domain.
Solution: YES. Adding a hub does not change the worst-case distance (i.e., the maximum distance
between any two machines).

5
(d) [3 points] How would your answer to part (a) change if a 1 Gb/s LAN is used.
Solution: l = 86.4 meters
(e) [2 points] The IT folks want to deploy network over a large campus whose geographical extent
exceeds the campus size you found in part (d). What problem may occur if they just deploy the
network over this large campus neglecting the campus size of part (d)? A short phrase is sufficient.
Solution: Collisions may go undetected.
(f ) [3 points] To address the problem in part (e), the IT folks would like to deploy some networking
device? Can they use a hub? a bridge? a router? Answer which of these three devices they can use
and which they can’t. State the reason in each case.
Solution: Hub can’t be used since the entire network will be in the same collision domain, with
no change the in worst-case distance. In contrast, Bridge or router both create multiple collision
domains (one through each interface) and both will work as long as the worst-case distance on each
collision domain does not exceed the answer in part (d).

6
Problem 4: TCP Congestion Control [20 points] The figure shows the congestion control
window of a TCP sender. Assume that the connection has been pre-established and the sender
starts at a window size of 1MSS. After one RTT is passed, the window size increases to 2MSS and
so on. Some portion of the graph has been left out, complete it on the graph as needed.

32
30
28
26
Congestion Window (in MSS)

24
22
20
18
16
14
12
10
8
6
4
2
0
0 2 4 6 8 10 12 14 16 18 20
Time (in RTTs)

Figure 2: Switched Ethernet LAN

An event causes a decrease in window size during the sixth transmission round (note: first
transmission round is between 0 and 1 along the horizontal axis). A triplicate ACK event occurs in
the fifteenth transmission round. No other event occurred between sixth and fifteenth transmission
rounds (except for ACKs being received normally), or after the fifteenth transmission round.
(a) [2 points] Just by looking at the figure, can we say if TCP (old) Tahoe or TCP (new) Reno is
being used? If yes, which one?
Solution: NO. More information about the event in sixth transmission round is needed to answer
this.
(b) [2 points] What can we say about the variable ssthresh during the first transmission round?
[Hint: we are not looking for a specific value; just some limit, perhaps!]
Solution: ssthresh ≥ 32 MSS, since we are still doing slow-start at a congestion window size of
32 MSS.

7
(c) [2 points] If it is known that the sender is using TCP (new) Reno, what event occurred during
the sixth transmission round? Just the name of the event is sufficient. For the rest of the parts
assume that TCP (new) Reno is being used.
Solution: Retransmission Timeout (or simply Timeout).
(d) [2 points] Given that no timeout or triplicate ACK occurs between the sixth and fifteenth
transmission rounds, what is the congestion window size at the end of ninth transmission round
(label 9 along horizontal axis)?
Solution: 8MSS (was given in the original figure)
(e) [3 points] What is the value of ssthresh during the ninth transmission round?
Solution: 16MSS
(f ) [2 points] What is the value of congestion window at the end of thirteenth transmission round.
Feel free to use the empty portion of the plot but do not use it for rough work.
Solution: 19MSS (see completed plot)
(g) [2 points] It is already given that a triplicate ACK event occurs in the fifteenth transmission
round. Assume that it takes the entire round to adjust the congestion window (this is similar to
what is shown in sixth transmission round). What is the value of congestion window at the end of
seventeenth transmission round?
Solution: 12MSS
(h) [3 points] At the end of twentieth transmission round (last one shown on the graph), what is
the value of the variable ssthresh and of congestion window?
Solution: ssthresh is 10MSS and congestion window is 15MSS
(i) [2 points] If someone tells you that TCP (old) Tahoe was being used, can you say what event
occurred in the sixth transmission round? Just name the event.
Solution: Retransmission Timeout (or simply Timeout).

8
Problem 5: Bridge Forwarding Tables [30 points] Consider a switched Ethernet LAN topol-
ogy consisting of 6 learning bridges B1 through B6, as shown. Each bridge has four ports (i.e.,
physical interfaces, which should not be confused with Transport layer ports) which are used to
connect the bridges with each other and to end hosts indicated as circles, labeled A through N.

B N

4 4
A 3 B1 1 3 B6 1 L
2 2

C 4 4 M
3 B3 1 J 3 B5 1 K
2 2

4 G 4
D 3 B2 1 F 3 B4 1 I
2 2

E H

Figure 3: Switched Ethernet LAN

End hosts communicate with each other using Ethernet packets (also called frames). We are
interested in finding out how the bridge forwarding tables develop and on what ports an ethernet
packet is replicated. Important note: A bridge never replicates a packet on a port from which
that packet is received.
Initially, all forwarding tables of all the bridges are empty. In each of the following parts, packet
transmissions are progressive from previous parts (i.e., transmission(s) in part (b) happen AFTER
the transmissions in part (a), etc.).
(a) [4 points] Host A sends a packet to Host K. Fill out forwarding tables for each bridge also
indicating ports on which the packet is replicated by bridge. Partial answer provided :).

Bridge B1 Bridge B2
Port List of stations Replicated? Port List of stations Replicated?
1 – Y 1 – Y
2 – Y 2 – Y
3 A N 3 – Y
4 – Y 4 A N

9
Bridge B3 Bridge B4
Port List of stations Replicated? Port List of stations Replicated?
1 – Y 1 – Y
2 – Y 2 – Y
3 – Y 3 A N
4 A N 4 – Y
Bridge B5 Bridge B6
Port List of stations Replicated? Port List of stations Replicated?
1 – Y 1 – Y
2 A N 2 – Y
3 – Y 3 A N
4 – Y 4 – Y

(b) [6 points] Host K replies back to host A. Fill in the tables.

Bridge B1 Bridge B2
Port List of stations Replicated? Port List of stations Replicated?
1 K N 1 – –
2 – N 2 – –
3 A Y 3 – –
4 – N 4 A –
Bridge B3 Bridge B4
Port List of stations Replicated? Port List of stations Replicated?
1 K N 1 – N
2 – N 2 – N
3 – N 3 A Y
4 A Y 4 K N
Bridge B5 Bridge B6
Port List of stations Replicated? Port List of stations Replicated?
1 K N 1 – N
2 A Y 2 – N
3 – N 3 A N
4 – N 4 – N

10
(c) [6 points] Starting from the state in part (b), host D sends a packet to host K. Fill in the tables.

Bridge B1 Bridge B2
Port List of stations Replicated? Port List of stations Replicated?
1 K – 1 – Y
2 – – 2 – Y
3 A – 3 D N
4 – – 4 A Y
Bridge B3 Bridge B4
Port List of stations Replicated? Port List of stations Replicated?
1 K Y 1 – N
2 – N 2 – N
3 D N 3 AD N
4 A N 4 K Y
Bridge B5 Bridge B6
Port List of stations Replicated? Port List of stations Replicated?
1 K Y 1 – –
2 AD N 2 – –
3 – N 3 A –
4 – N 4 – –

(d) [3 points] If now host K replies back to host D, what will be the total number of Ethernet
packets (including the original transmitted by host K and the ones replicated by various bridges on
various ports) one would observe on this switched Ethernet LAN?
Solution: 5
(e) [3 points] Suppose now, everyone has transmitted at least one packet destined to everyone else.
The bridges would have learned everything they could on this network. Their forwarding tables are
said to have reached a steady state (i.e., no more learning is possible, unless the network changes).
After this steady state is reached, host A sends a packet to host H. What would be the total number
of Ethernet packets one would observe as a result of this transmission?
Solution: 4

11
(f ) [2 points] After steady state, host D sends a packet to host M. What would be the total number
of Ethernet packets one would observe as a result of this transmission?
Solution: 6
(g) [6 points] After steady state is reached, fill in the forwarding tables for all bridges.

Bridge B1 Bridge B2
Port List of stations Port List of stations
1 DEFGHIJKLMN 1 F
2 C 2 E
3 A 3 D
4 B 4 ABC GHIJKLMN

Bridge B3 Bridge B4
Port List of stations Port List of stations
1 HIJKLMN 1 I
2 G 2 H
3 DEF 3 ABCDEFG
4 ABC 4 JKLMN

Bridge B5 Bridge B6
Port List of stations Port List of stations
1 K 1 L
2 ABCDEFGHI 2 M
3 J 3 ABCDEFGHIJK
4 LMN 4 N

12
Problem 6: Peer-to-Peer and Bittorrent [15 points] Consider a network with negligible
propagation delays and infinite bandwidth in the core which is never congested. The access network
to which end hosts are connected has finite bandwidth. This is very similar to the network we
discussed in class for comparing file delivery times in client-server and P2P architectures.
A server on this network has a 100 KB (kilobytes) file that it wants to distribute to a group of
31 receivers. All hosts have bidirectional 40 Kbps (Kilo bits per second) links to the Internet. That
is, they can upload and download at a maximum rate of 40 Kbps simultaneously.
(a) [3 points] What is the minimum time for the server to transmit the data to all of the receivers
in a client-server configuration (i.e., where the receivers do not upload any data)?
Solution: The server must transmit the 100 Kbyte (800 Kbit) file to 31 receivers at a rate of
40 Kbits/sec. The total time is (31*100*8)/40, or a total of 620 seconds.
(b) [4 points] Now, suppose that the receivers can upload data, too, but only after receiving an
entire copy of the 100 KB file. What is the minimum time for the server and the cooperating peers
to transmit the data to all receivers in this configuration?
Solution: First note that no receiver can upload data until it has received the entire file. The first
step must be for the server to upload file to one receiver. Thus, after (100 × 8)/40 = 20 seconds,
one receiver has a complete copy of the file. The receiver and the server can now upload to two
more receivers in another 20 seconds, and so on.
The number of hosts with a copy of the file doubles after each full 100 KB transmission (which
takes 20 seconds). The number of these 20-second rounds is log2 32 = 5. (That is, 1 receiver
completes in the first round, 2 in the second, 4 in the third, 8 in the fourth, and 16 in the fifth, for
a total of 31 receivers.) Hence, the total time is 20 × 5 = 100 seconds.
(c) [2 points] From network efficiency standpoint (time to distribute the file), is the configuration
in part (b) roughly similar to the one used in bittorrent? YES or NO? If YES, how? If NO, why
not? Very very briefly.
Solution: NO. In bittorrent, receivers can start uploading as soon as they receive the first chunk.
The scheme in part (b) allows uploading only after the complete file is received and is expected to
be inefficient compared to bittorrent.

13
(d) [4 points] Now, suppose that a receiver can start uploading data to others after receiving the
first 20 KB chunk of data. How long does it take to deliver the data to all receivers?
Solution: There are multiple schemes to consider (all accepted as possible answer):
20×8
Scheme-1 (Analytical): 3100KB of data needs uploading. In the first 40
= 4 seconds, only
server can upload 20KB to one of the receivers. In the next 4 seconds, 40KB can be uploaded (by
the server and the first receiver) to another two receivers. Thus, in the next 4 seconds, 80KB can
be uploaded, and so on. Note that total upload/download rate may not exceed 640KB in a given
4 second interval. A total of 36 seconds will be needed to deliver 3100KB of data. Also note that
this does not violate the condition given in the problem.
Scheme-2: Similar to part (b), the first 20 KB require five rounds to complete, where each round
20×8
requires 40
= 4 seconds to complete. So, by the end of five rounds, 20 seconds have elapsed, and
every peer has the first 20 KB of data. To distribute the rest of 80KB to receivers:
Scheme-2a: The remainder of the 80KB data transfer is pipelined (i.e., infinitesimally small
chunks). The last peers will download the remaining 80 KB as quickly as they can. They need a
80×8
time of 40
= 16 seconds to download the rest, for a total of 20 + 16 = 36 seconds. Alternately, the
server will need 16 seconds to upload the remaining 80KB into the network, where the distribution
will be continuous. Thus, a total of 36 seconds is needed.
Scheme-2b: Only 20KB chunks are allowed. Just like the first 20KB took 20 seconds to complete,
the next 20KB chunk will take another 20 seconds, and so on. The total time would be 100 seconds.
(e) [2 points] From network efficiency standpoint (time to distribute the file), is the configuration
in part (d) roughly similar to the one used in bittorrent? YES or NO? If YES, how? If NO, why
not? Very very briefly.
Solution: Scheme-1 is similar to bittorrent, though it is likely to perform better since optimal
distribution time will require some optimal chunk sequencing (which is not provided in bittorrent).
Scheme-2a of part (d) is also likely to perform better than bittorrent, due to infinitesimally small
chunks (bittorrent uses finite chunk sizes). Except for the first 20 KB distribution, this scheme is
similar to bittorrent with infinitesimal chunks (from a network efficiency standpoint, but not in the
operation).
Though Scheme-2b of part (d) has the same distribution time as for the scheme in part (b) which
was different from bittorrent, still Scheme-2b is similar to bittorrent except for the operational
efficiency. With more distribution servers, and by using bittorrent policies (rarest first, optimistic
unchoke, etc.), Scheme-2b is expected to yield a network efficiency (distribution time) similar to
that of bittorrent.

14

You might also like