Midterm Ic s16 Solution
Midterm Ic s16 Solution
Although connect() is typically associated with TCP sockets, explain the effect of using connect() on a
UDP socket?
It forces the server to receive data only from one client.
b.
In traditional client-server communication using TCP, a new socket is created. Explain why. How would it
hurt performance it only one socket is used?
The server would not be able to accept incoming connections from other clients.
A wireless Node A can successfully receive a message from another Node B, but not from Node C.
However, transmissions from both Nodes B and C interfere with transmissions from Node A. Explain the
property of wireless signals that causes this situation.
Node A and Node B are in transmission range and the signal can be decoded. Node A and Node C are in
carrier sensing/interference range and the signal is too weak to be decoded.
b.
c.
What properties of NRZI encoding make it a good choice for pairing with 4B/5B encoding?
Because NRZI guarantees no long sequences of 0s and NRZI guarantees no long sequences of 1s.
b.
Why is byte stuffing necessary with some sentinel-based framing schemes? Is a byte of all zeros a good
choice for a sentinel? Justify your answer.
The sentinel may occur in the data.
Zero is very common in data.
Would have to stuff a lot (excessive overhead).
b.
Explain what would happen if node in IEEE 802.11 did not suspend its collision counter when it detects
that the medium is busy.
All the nodes with expired timers will try to transmit as soon as the channel is IDLE, causing more
collisions
b.
c.
Ethernet frames must be at least 64-bytes long to ensure that the transmitter is still going in the event of a
collision at the far end of the cable. Fast Ethernet has the same 64-byte minimum frame size but can get
the bits out ten times faster. How is it possible to maintain the same frame size?
The maximum wire length in fast Ethernet is 1/10 as long as in Ethernet.
d.
Why is it ineffective to use and ACK for broadcast and multicast communication in wireless networks?
ACK implosion problem, too many ACKs for the same packet.
a.
In the Perlman distributed spanning tree algorithm, why does the root bridge periodically send messages
even after the tree is determined?
As a heartbeat to verify the tree and make sure none of the links or bridges on the tree have failed.
b.
Distance vector routing protocols can be enhanced to detect loops using techniques like split horizon and
poisoned reverse. Explain what types of loops are detected and what types are not.
Only loops of length two or less are detected. All others go undetected.
c.
Jupite
r
B
Mars
Ma
7
C
E
1
a)
Venus
(7 points) Fill in the tables below indicating the root port for each bridge (as a LAN) and the designated bridge
for each LAN.
Bridge
LAN
Designated Bridge
a)
b) (3 points) Suppose after the configuration is complete, host Mars attaches to LAN B, host Venus attaches
to LAN H and host Jupiter attaches to LAN F. Suppose Mars sends a message to Venus, then Jupiter sends
a message to Mars, then Venus sends a message to Jupiter.
i) (1 point) Mars sends a message to Venus
All
ii) (1 point) Jupiter sends a message to Mars
B, D, E, F
iii) (1 point) Venus sends a message to Jupiter
C, E, F, G, H
8. Forwarding Tables
Consider the network shown in the figure below. The links are labeled with relative costs. The three parts of this
problem deal with circuit-switched forwarding, datagram forwarding and source-routed forwarding, respectively
S2 2
1
0
S6 2
1
0
S1 2
S4 2
S5 2
3
S3 2
3
a) (3 points) Fill in the following table for the datagram routing table at switch S2, assuming least-cost paths are
used.
Switch 2:
Host
A
B
C
D
Output Port
3
1
3
3
Distance
2
0
2
1
3
3
E
F
4
3
b) Now assume the use of source routing for the network. For each of the following packets, indicate the sequence
of absolute port identifiers (from left to right) that must be included in the header to route the packet along the
least-cost path.
i)
(1 point) from B to E.
3,2,1,2,2
1
0
S2 2
F
4
1
0
S1 2
S6 2
S4 2
3
S5 2
3
S3 2
3
c) Suppose virtual circuit forwarding is used for the network shown above with the routing tables shown below.
When setting up a new virtual circuit on a given output port, a switch assigns the smallest unused virtual circuit
identifier for that port.
Indicate the changes to the routing tables after the following three (cumulative) events:
i) (2 points) Tear down the entire virtual circuit starting at switch 1 with incoming port 0 and incoming VCI 0.
Cross out all appropriate entries in all switches in the tables above.
ii) (3 points) Add a new circuit from host B to host F using a least cost path. Fill in the above tables with any new
entries (use row for Part ii where necessary).
iii) (3 points) Add a new circuit from host A to host E using a least cost path. Fill in the above tables with any new
entries (use row for Part iii where necessary).
BA
portin
0
3
Switch 1
VCIin
0
0
portout
3
0
VCIout
0
0
Part ii
Part iii
AF
Switch 2
DE
portin
1
Switch 4
VCIin
0
portout
2
VCIout
0
Part ii
Part iii
portin
Switch 5
VCIin
portout
VCIout
BA
Part ii
Part iii
AF
DE
Part ii
Part iii
portin
1
VCIin
0
portout
3
VCIout
0
AF
BA
DE
0
1
3
Part ii
Part iii
portin
0
0
Switch 3
VCIin
0
1
portout
1
1
VCIout
0
1
DE
Part ii
Part iii
AF
0
0
0
2
0
2
0
0
1
portin
3
3
Switch 6
VCIin
0
1
portout
1
2
VCIout
0
0
(a) (4 points) If a transmitter sends at 20 Mbps, how long must packets be to guarantee collision detection by the
transmitter?
Longest link = 4*15 = 60 km, so maximum one-way delay is:
(60x103m) / (3 x 108 m/s) = 20 x 10-5 sec
= 200 sec
Therefore, maximum RTT is 400 sec. So at a rate of 20 Mbps, we get:
(20x106 bps) * 400 sec = 8000 bits
= 1000 bytes
(b) Divide time into slots the length of the maximum round-trip propagation delay in the network. One packet may
be transmitted each time slot. Assume that each of the hosts attempts to transmit with probability p in each
time slot. What is the probability of a successful transmission in any given slot if
iv) (2 points) p = 1/2?
5 x (1/2) x (1 1/2)4= 5 / 32
v) (2 points) p = 2/3?
5 x (2/3) x (1 2/3)4 = 10 / 243
For the last part of the problem, assume that each packet requires 200 bytes of header/trailer and 1000 bytes of data.
Also assume the probability of successful transmission calculated for part (b)(i) (using p=1/2).
(c) (5 points) A packet transmission may require more than one slot to complete. Assume that other hosts sense
the continuation of the transmission (carrier sense) and simply discard any packets that arrive during those slots.
Calculate the average throughput for the network. (Hint: use cycle analysis)
1200 B / 1000 B = 2 slots to transmit
C: competition, F: finish transmit
Success = CF with no collisions
C->C
C->F
F->C
probability = 27/32
probability = 5/32
probability = 1
cycle
C
CF
explanation
failure
success
len
1
2
transmitted
0
1
prob.
27/32
5/32*1
Orbus
60,000 packets/second
4
600 Mbps
2.4 Gbps
$15,000
PDQ
90,000 packets/second
1
1.2 Gbps
1 Gbps
$4,000
Orbus
60,000 1500 8 = 720 Mbps
600 Mbps 2 / 2 = 600 Mbps
2.4 Gbps / 2 = 1.2 Gbps
PDQ
90,000 1500 8 = 1.08 Gbps
1.2 Gbps / 2 = 600 Mbps
1 Gbps / 2 = 500 Mbps
600 Mbps
500 Mbps
I pick PDQ. Although it has slightly lower capacity, it has a much better price per Mbps.
b) (3 points) Draw a block diagram of the workstation architecture that you have chosen in part (a), labeling all
components with appropriate names and data rates.
Processor
Memory
RingMaster
Network Adaptor
GigaNet
Network Adaptor
c) (5 points) At the maximum sustainable bandwidth (i.e., with no packets dropped), what is the transmission rate
- the total number of bits per second, including headers and trailers - sent over each network link (the
RingMaster and the GigaNet)?
RingMaster =
500 Mbps 1600/1500 = 533.33 Mbps
GigaNet = 500 Mbps 1650/1500 = 550 Mbps