CS 5565 Sample Final Exam Spring 2005

CS 5565
Sample Final Exam (Spring 2005)
CS 5565 Sample Final Exam Spring 2005
1 Delay and Bandwidth (12 pts)
a) Types of Delay (4pts)
Recall the different types of delays that can occur in a network. Give an example
of each of the following scenarios. A brief sentence suffices.
i.
Propagation delay is the dominating delay
Propagation delay can dominate for fast, but geographically distant links, such as
high-speed satellite links.
i.
Transmission delay is the dominating delay
Transmission delay can dominate for slow links, such as serial lines over short
distances.
ii.
Processing delay is the dominating delay
Processing delay can dominate if the forwarding machine has a slow CPU or bus
or is operating under load.
iii.
Queuing delay is the dominating delay
Queuing delay dominates if there is congestion.
b) Circuit vs Packet Switched Networks (8pts)
Compare the delay, from first bit transmitted to last bit received, in sending an xbit message over a k-hop path in a circuit-switched network and in a (lightly
loaded) packet-switched network. The call setup time is s sec, the propagation
delay is d sec per hop, the packet size is p bits, and the transmission rate of all
links is b bps. For the packet-switched network, assume that the processing and
queuing delays at each hop are zero and ignore any packet header overhead.
i.
(5 pts) Under what conditions does the circuit-switched network have a
lower delay?
The delay of the circuit-switched network is s + k*d + x/b. The delay of the
packet-switched network is propagation delay + transmission delay for entire
message + delay incurred in retransmitting the last bit (k-1) times: k*d + x/b + (k1)*p/b where we assume as in homework 1 for simplicity that x is divisible by p.
Therefore, the circuit-switched network has a lower delay if s < (k-1)*p/b.
Informally, the call setup delay must be less than the transmission delays
stemming from repeated forwarding in the store-and-forward operations. Notice
1/12
CS 5565
Sample Final Exam (Spring 2005)
that it does not depend on x, since all intermediate routers can forward packets in
parallel.
ii.
(3 pts) Consider what the circuit-switched network must do during call
setup: a call setup message must be sent along the k-hop path so that the
nodes along the path can allocate resources for the circuit. In addition, a
call connected message must be returned so that the sender knows that
the circuit has been established. Considering this requirement, how can a
circuit-switched network satisfy the conditions derived in i)?
If you assume that the call setup packet has length p’ and is sent over the same
links, then you would have s = 2*(k*d + p’/b). Therefore, we must have p’ << p.
Another alternative is to use a separate, faster signaling network with a larger
bandwidth b’.
2 Congestion Control & Fairness (12 pts)
a) AIAD (3 pts)
In their landmark 1989 paper, Chiu and Jain proved that additive increase,
multiplicative decrease (AIMD) is the only congestion control mechanism that
leads to fair allocation if two transport layer connections share a single bottleneck
link of capacity R. For their argument, they used the phase plot we discussed in
lecture:
Connection 2 throughput
R
Full bandwidth utilization
line
Equal bandwidth share
Connection 1 throughput
R
Use the same argument to show that an AIAD (additive increase, additive
decrease) scheme does not converge to a fair division of bandwidth.
AIAD (additive increase, additive decrease) scheme does not converge to a fair
division of bandwidth, because the point (x1, x2) that describes the relative
throughput of connections 1 and 2 will oscillate along a line that is parallel to the
equal bandwidth line, as shown below:
2/12
CS 5565
Sample Final Exam (Spring 2005)
Connection 2 throughput
R
Oscillates along
this line
(amplitude
depends on
INC/DEC
amounts)
starting
point
Connection 1 throughput
R
b) Network-assisted congestion control (9 pts)
Now assume that the two sources will not have to rely on packet losses as
congestion signals, but that the router with the shared bottleneck link monitors
traffic and helps the sources manage congestion. It does so by sending
commands to tell those sources whether to inject more or less data into the
network. In the absence of commands from the router, it is assumed that sources
keep sending at their current rate. Each source starts sending data at arbitrary
rate. The router uses the following algorithm:
• If the link is not fully utilized (quadrants 3, 4 below) an INCREASE
command is sent to both sources.
• Otherwise, a DECREASE command is sent to the source (or sources) with
the highest throughput.
Both INCREASE and DECREASE commands result in additive increases or
decreases.
i.
Given
(6 pts) Add arrows in the diagram below to show how the relative
throughput of connection 1 and 2 moves as a result of the congestion
control commands sent by the router in each of the four quadrants. As an
example, I filled in the arrow for quadrant 4.
Solution
3/12
CS 5565
Sample Final Exam (Spring 2005)
R
Connection 2 throughput
Connection 2 throughput
R
1
4
2
3
Connection 1 throughput
ii.
R
1
4
2
3
Connection 1 throughput
R
(3 pts) Does this network-assisted algorithm converge towards a fair
allocation of bandwidth? Explain why it does or does not.
It does converge since the changes in each quadrant will lead towards the equal
bandwidth/full utilization crossing point.
3 IP Addressing & Ethernet (14 pts)
a) IP Addressing (10pts)
You just got hired as a network engineer in your department. You are in charge
of providing Internet connectivity to two labs (each with one LAN) connected by
three routers, as shown below.
Internet
R1
Ethernet
LAN 1
60 Machines
__________
PPP Link 2
Subnet address:
______________
Default gateway:
______________
R2
__________
__________
PPP Link 1
__________
__________
__________
R3
Ethernet
LAN 2
120 Machines
Subnet address:
______________
Default gateway:
______________
4/12
CS 5565
Sample Final Exam (Spring 2005)
Lab 1 has 60 machines, lab 2 has 120 machines. Each lab has a router, which is
connected via a PPP connection to router R1. R1 provides connectivity to the
Internet through the campus ISP. The campus network administrator assigned
the following subnet to you: 191.23.25/24.
i. Assign IP addresses to your network. Assign IP addresses to each of the
six interfaces of R1, R2, and R3 (fill in the callouts above!) You do not
need to assign an address to the outgoing interface connecting you to the
ISP.
ii. In addition, you are responsible for configuring the hosts connected to
both LANs. Assume you are using DHCP for this purpose. In the boxes
above, fill in the subnet address and the default gateway that a DHCP
server would have to communicate to machines on either LAN. Use the
x.x.x.x/l form for the subnet address. In summary, you must assign 8 IP
addresses (x.x.x.x) and two subnet addresses (x.x.x.x/l).
A possible assignment is shown below:
Internet
R1
Ethernet
LAN 1
60 Machines
191.23.25.193
PPP Link 2
191.23.25.192/30
191.23.25.197
Subnet address:
191.23.25.128/26
Default gateway:
191.23.25.129
R2
191.23.25.194
PPP Link 1
191.23.25.129
191.23.25.196/30
191.23.25.198
191.23.25.1
R3
Ethernet
LAN 2
120 Machines
Subnet address:
191.23.25.0/25
Default gateway:
191.23.25.1
You have to subdivide the 256 addresses into 4 subnets that can accommodate
120, 60, 2, and 2 interfaces. The PPP Links need their own subnets. The LAN1
subnet must be 191.23.25.0/25 or 191.23.25.128/25, each choice leaves two
choices for the LAN2 subnet. After assigning LAN1 and LAN2, you have 64
addresses left, you need two ranges of at least size 4 for each link. (Recall that
the pair of interfaces at each end of a link is a subnet as well, see lecture slide.)
As discussed in lecture, the addresses with a host part of all zero bits (“this host”)
5/12
CS 5565
Sample Final Exam (Spring 2005)
or all ones (subnet broadcast) are reserved and cannot be used for interfaces.
The default gateway in either LAN must be the address of the router interface
facing the LAN.
b) Ethernet (4 pts)
After your success as a departmental network engineer, you were hired as chief
network engineer for the entire state, which runs a network with thousands of
hosts and dozens of sites. You recall the minor brain twisting it took in part a) to
split your IP address space to assign IP and subnetwork addresses to each
interface and LAN. A state contractor suggests to do away with IP routing
altogether and to use self-learning Ethernet switches instead, which cost only a
fraction of fully-fledged IP routers. Ethernet runs over fiber for long-haul
connections, so length restrictions are not an issue. In addition, they suggest the
use of switched Ethernet throughout to avoid any problems with collisions and
back-off related idle time stemming from Ethernet’s CSMA/CD algorithm.
Give two important reasons for why you decide against their proposal.
Acceptable reasons are:
•
•
•
ARP requests would be broadcast to all hosts in the entire state.
Switches, because of their limited switching table size, could not learn the
ports associated with all hosts, leading to frequent switching table misses
and hence broadcasts.
Switches only form a spanning tree, which does not allow for optimal
routing or distribution of load over multiple links.
CSMA/CD and length restrictions are non-reasons, as pointed out in the narrative
of the problem.
4 Error Correction and Detection (12 pts)
a) CRC (6 pts)
Suppose you receive the following message of 8 bits, which include a 3-bit CRC
checksum: 10101111. The CRC generator polynomial used for this message is
x3+1 (which has a bit pattern of 1001.) Was this message correctly received (as
far as you can tell from the CRC)? Show your work for full credit.
The CRC checksum is correct, as shown below:
1001
10111
|10101111
1001
1111
1001
1101
1001
1001
6/12
CS 5565
Sample Final Exam (Spring 2005)
1001
000
b) Forward Error Correction (6 pts)
Consider the following code used to transmit bits over a rather noisy channel.
The message is split into a sequence of pairs of bits. For each pair of bits, a
codeword of five bits is sent according to the following table:
i.
If bits in question are
Then send these five bits
00
00000
01
00111
10
11001
11
11110
(4 pts) How many bit errors can this code correct per codeword? Say why.
This code can correct up to one bit error, because the minimum Hamming
distance between each pair of codewords is 3: three bits must be flipped to
distort one codeword into another. If only one bit is flipped, it is still possible to
identify the original codeword and correct the bit. For instance, if 00000 is sent
and either 10000, 01000, 00100, 00010, or 00001 is received, the original
codeword (00000) can still be correctly identified. If two bits are flipped, this code
would be closer to a different codeword, hence it cannot correct two bit errors.
For instance, if 00000 is sent, but 00011 is received, the result is closer to 00111
than 00000 and the sent 00 would be mistaken for 01. Alternatively, the code
could be used to detect, but not correct, 2-bit errors – of course, you can only use
the code for one or the other.
ii.
(2 pts) Can this code detect 3-bit errors? Say why.
This code cannot detect 3-bit errors because, for instance, if 00 is sent as 00000,
but the last three bits are flipped, the arriving bit pattern 00111 would be
mistaken as an error-free transmission of 01.
5 Routing Algorithms (32 pts)
a) Distance Vector Convergence (8pts)
Suppose a static network in which all links have cost 1. Suppose that (unlike in
project 2B!) each node initially knows its directly connected neighbors. Suppose
routing advertisements are exchanged in globally synchronized iterations. In
each iteration:
• all nodes send their entire current distance vector estimate to each of their
connected neighbors and
7/12
CS 5565
Sample Final Exam (Spring 2005)
•
apply the Bellman-Ford equation to compute their new distance vector
estimates from the advertisements received. If the estimate has changed,
a node sends out a new estimate to each of its neighbors in the next
iteration.
A node is said to have converged after k iterations if it sent its distance vector
and performed Bellman-Ford k times and afterwards its estimate matches the
true minimum cost to all destinations. A network is said to have converged if all
its nodes have converged.
i.
(2 pts) What is the best-case topology, in terms of number of iterations, for
a network of k nodes? How many iterations does it take until the algorithm
converges for that topology?
The best case would be any graph with a diameter of 1, such as a fullyconnected graph in which there is direct link between each pair of nodes. In that
case, the topology would have converged after 0 iterations (if you count iterations
as described in the problem!) Since the problem didn’t assume a connected
graph (it should have) an empty graph is an acceptable answer as well.
ii.
(6 pts) What is the worst-case topology, in terms of numbers of iterations,
for a network of k nodes? How many iterations does it take until the
algorithm converges for that topology? Show the distance vector table of
the node or nodes that converged last.
The worst case is a string of k nodes, in which case it would take k-2 iterations to
converge (4 pts). The last nodes to converge would be the ones at the end of the
string (1 pts). Their final distance vector tables are (0, 1, 2, 3, k-1) and (k-1, k-2,
… 2, 1, 0) respectively (1 pts).
b) Load Balancing (4 pts)
It is often desirable to utilize multiple paths to a destination by distributing traffic
equally along paths with identical costs. Suppose such load balancing had been
a requirement for one of the parts in project 2B. Which of the two algorithms you
implemented would you have adapted, and why?
A link-state algorithm typically lends itself better to equal-cost multipath routing,
because each node has complete information about the entire topology of the
network and can therefore compute multiple routes with the same cost. This is
done by extending Dijkstra’s algorithm to keep track of multiple equal-cost paths.
A distance vector algorithm, on the other hand, hides the number of equal-cost
routes through a given neighbor.
c) Path Vector Routing in BGP (4 pts)
We talked in lecture about how knowledge of the path to a particular destination
helps BGP avoid routing loops. Considering the purposes for which BGP is used,
give another significant reason for why BGP uses a path vector approach.
8/12
CS 5565
Sample Final Exam (Spring 2005)
Aside from loop freeness, the knowledge of AS-PATH vectors is necessary to
implement such policies as: don’t send packets through a particular AS, for
instance in order to ensure that packets you sent do not pass through some other
company’s network, or policies such as send packets along the shortest path.
d) Link State Routing (16 pts)
Consider the static topology below.
5
u
v
1
4
1
1
y
3
1
w
i.
x
(3 pts) Assume that sequence-number controlled flooding is used to
distribute link state advertisements. Assume that (unlike in project 2B) a
node initially knows it neighbors and that each individual link state
advertisement (LSA) contains the entire adjacency list for that node. The
topology is static, so each node broadcasts its LSA only once. How many
LSA messages are sent during the broadcasts until all nodes have learned
the topology?
The originator sends its LSA message to all neighbors. All other nodes forward
each LSA once (the first time it arrives) along all outgoing links, except the link it
came in on. The number of messages exchanged is
|N| * (1 + Sumover all nodes(Degree(Ni) – 1))
5 * (1 + (3-1) + (2-1) + (3-1) + (4-1) + (2-1)) = 5 * (1+2+1+2+3+1) = 50.
ii.
(3 pts) Consider node u. Show the adjacency matrix u has learned after
every node’s LSA has been broadcast.
u
v
w
x
y
u
v
w
x
9/12
CS 5565
Sample Final Exam (Spring 2005)
y
The adjacency matrix u has learned is simply the adjacency matrix of the graph:
iii.
u
0
5
1
4
v
5
0
w
1
x
y
u
4
v
1
1
w
0
1
x
1
1
0
3
y
1
3
0
(6 pts) Show how Dijkstra’s algorithm computes u’s least cost routes by
filling in the table below.
N’
D(v), p(v)
D(w), p(w)
Step
D(x), p(x)
D(y), p(y)
Note: the table may have more rows than there are steps.
Step
0
1
2
3
4
iv.
N’
u
uw
uwx
uwxv
uwxvy
Final
D(v), p(v)
5, u
5, u
3, x
D(w), p(w) D(x), p(x)
1, u
4, u
2, w
3, x
1, u
D(y), p(y)
∞
∞
5, x
4, v
2, w
4, v
(4 pts) Now assume the topology from part iii is used for broadcasting
based on reverse path forwarding. Suppose that u wants to broadcast a
message. If one hop time is the time it takes for a message to travel one
link, regardless of cost, how many hop times will it take for u’s message to
reach nodes v, w, x, and y?
# of hop times from
u to
v
w
x
y
10/12
CS 5565
Sample Final Exam (Spring 2005)
In broadcasting based on reverse path forwarding, a node forwards a received
broadcast packet if and only if it comes in on the link that is on the shortest path
from that node to the source of the packet. Initially, u sends the message to v, w,
and x, so it will take 1 hop time for the broadcast message to arrive at these
nodes. Only w will forward the message, however, because as far as v and x are
concerned the message did not arrive on the link that marks their shortest path to
u. In the next step, w is going to forward the message to x. Now x will forward the
message to u, v, and y, so it arrives at y after 3 hop times.
# of hop times from
u to
v
1
w
1
x
1
y
3
6 Short Questions (18 pts)
a) Short Writes (4 pts)
In project 2A, you needed to worry about short reads when using a TCP
connection. Can there be short writes also? If yes, how could they occur? If not,
what must be done to avoid them?
Both yes and no are possible answers, but both require explanation.
•
Yes, short writes can occur because the current amount of space left in
the TCP send buffer might be too small to accommodate the entire
request.
•
No, short writes do not occur because the OS blocks the caller until space
becomes available, then resumes it and repeats this process until the
entire request is stored in the buffer.
In practice, the first behavior is provided to sockets in nonblocking mode,
whereas the second behavior is provided to sockets in blocking mode, which
fortunately is the default.
b) Media Access Protocols (4 pts)
In what kind of a scenario might you deploy a random access protocol in
connection with a channel partitioning protocol to mediate access to a shared
link?
A channel partitioning protocol splits the link between multiple sources, but it is
often not known what sources want to share the link at a given point in time. In
such situations, sources can use a random access protocol for a small, shared
portion of the partitioned channel to issue requests for a partition of the rest of
the channel. An example of this technique are requests for minislots via slotted
ALOHA in hybrid cable-fiber (HFC) networks.
11/12
CS 5565
Sample Final Exam (Spring 2005)
c) HTTP Cookies (4 pts)
Google recently introduced the beta version of their web accelerator, which is a
set of servers that prefetches pages a user is likely to look at in the near future.
The servers can be reached with lower latency than the server hosting the file,
saving the user time. Privacy advocates immediately complained that Google’s
servers store a user’s cookies in the process of prefetching pages. Explain why
Google’s servers must store a user’s cookies for this type of prefetching to work!
HTTP cookies are sent as part of a HTTP request message and cause the server
to customize the content they return based on the cookies presented. Without
storing them, the google web accelerator couldn’t send HTTP requests on behalf
of the user using the web accelerator and therefore could not prefetch any pages
for that user. A common mistake was to assume that the web accelerator would
somehow use or look at the cookies to determine a user’s preferences.
d) Paper: Toward A Wafer-Thin Control Plane (6 pts)
This question refers to:
J. Rexford, A. Greenberg, G. Hjalmtysson, D. Maltz, A. Myers, G. Xie, J. Zhan, H.
Zhang. Network-Wide Decision Making: Toward A Wafer-Thin Control Plane,
HotNets-III, 2004.
Could the approach to a thin control plane that is advocated in this paper be used
as a next-generation inter-AS routing protocol? Say why or why not.
The approach advocated by Rexford et al relies on central decision making,
something that is fundamentally incompatible with policy-dominated inter-AS
routing policies that must preserve the boundaries between different
administrative domains. It also would not scale to the entire Internet, which would
be required for it to be used as an inter-AS protocol. Their approach is intended
to provide the next-generation intra-AS routing protocol, or more precisely, to
eliminate routing intra-AS protocols as we know them.
12/12