CS438 Midterm Sol
CS438 Midterm Sol
CS438 Midterm Sol
25 − 2 = 30
(g) (6 points) List one advantage each for: Link State Routing, Distance Vector Routing.
Link state routing: Global view of the network allows for more optimizations, multiple
path selection.
More robust to errors.
No count-to-infinity problem.
Distance-vector routing: Potentially smaller message traffic.
Less state maintained at nodes.
An updated link cost does not need to be broadcast to the entire network.
(h) (4 points) List two reasons for using a different routing schemes within an AS (intra-AS)
and between AS’es (inter-AS).
Policy: different goals addressed by routing within the AS (e.g. performance) and between
AS’s (e.g. revenue maximization).
Performance: Can optimize traffic within the AS better because of more limited view and
single administrative domains.
Scale: AS abstraction reduces table size and update traffic, as routing changes within an
AS need not be propagated to other AS’s.
Compatibility / innovation: Intra-AS schemes give AS’s flexibility to choose different
designs and experiment with new ones, whereas inter-AS scheme must be the same for
all routers in the world.
2. (6 points) The USB protocol uses a CRC with the polynomial x5 + x2 + 1. Calculate the
CRC of the bit string 1100011110110001
The polynomial x5 + x2 + 1 is equivalent to the bit string 100101.
100101 | 110001111011000100000
100101
------
101001
100101
------
110011
100101
------
101100
100101
------
100111
100101
------
100001
100101
------
100000
100101
------
10100
NETID: CS/ECE 438 Midterm 3
3. (6 points) Consider 4 hosts on a single LAN with the following ARP tables:
The third column, T , represents the number of minutes since the ARP cache entry has
been updated. Suppose 10.0.0.1 performs an ARP request for 10.0.0.4. After the request is
complete, its table is:
10.0.0.1
MAC: 0:0:1
IP MAC T
10.0.0.3 0:0:3 6
10.0.0.4 0:0:4 0
Write the contents of the ARP tables for the other three hosts.
Host 10.0.0.4 will add an entry for 10.0.0.1 to its ARP cache, since it will likely need to
communicate with 10.0.0.1.
Host 10.0.0.3 will snoop on the ARP request and update the T field for its entry for 10.0.0.1
to 0.
Host 10.0.0.2 will also hear the ARP request, but because it has no entry for 10.0.0.1, it
will ignore the request. 10.0.0.2 will not hear the ARP response, because ARP responses are
unicast. So the tables will be:
10.0.0.4
10.0.0.2 10.0.0.3
MAC: 0:0:4
MAC: 0:0:2 MAC: 0:0:3
IP MAC T
IP MAC T IP MAC T
10.0.0.2 0:0:2 8
10.0.0.4 0:0:4 8 10.0.0.1 0:0:1 0
10.0.0.1 0:0:1 0
101
110
(a) Draw the path taken by the packet 101 (shown) towards the output port
(b) Show (on the diagram) how another packet on another input, destined for a different
output port, can collide with 101 inside the Banyan network
(c) What condition would prevent such a collision?
For (b), note that for a collision, it is necessary that the two packets occupy the same wire,
rather than simply arrive at the same 2x2 switch. So if the packet 110 was instead 010, no
collision would have happened.
For (c), sorting the input packets in ascending order can be shown to prevent collisions. A
Batcher network can perform the sorting.
5. (10 points) Consider a client connecting to a server, sending a request, and then reading
back a response. Show the sequence of networking system calls that must occur on the client
and the server for this to work, in the order that they must be executed. The calls you should
use are: accept, bind, close, connect, listen, read, socket, write. You do not need to
list the arguments to the calls.
Client Server
socket socket
bind
listen
connect accept
write read
read write
close close
Note: We didn’t grade the ordering of calls between the client and the server because it is ill-
defined. For example, accept may be called either before or after the connect call; whichever
NETID: CS/ECE 438 Midterm 5
is called first will simply block until the other one is called. (But if you call connect before
listen is called, you will get a “connection refused” error.)
6. (12 points) Consider hosts A and C connected by two Ethernet segments, with a bridge B in
the middle. The segments are 10 Mbps and introduce a latency of 3 µs and 7 µs respectively.
Bridge
A B C
7 μs 3 μs
(a) Recalling that an Ethernet frame includes an 8-byte preamble and a 14-byte header,
calculate the effective bandwidth of the data transfer.
Recall that a bridge is a pass-through device that introduces almost no processing delay.
So in this case, when A sends a bit, it arrives at C 10µs later. The time to send a whole
packet is then:
(1500 + 14 + 8)bytes
+ 10µs = 1227.6µs
10M bps
(10 + 14 + 8)bytes
+ 10µs = 35.6µs
10M bps
1500bytes
≈ 9.5M bps
1227.6 + 35.6µs
(1500 + 14 + 8)bytes
2 + 10µs = 2445.2µs
10M bps
NETID: CS/ECE 438 Midterm 6
(10 + 14 + 8)bytes
2 + 10µs = 61.2µs
10M bps
1500bytes
≈ 4.8M bps
2445.2 + 61.2µs