Professional Documents
Culture Documents
CIS 527 - Computer Networks Solution - Homework #2: 0 - Low 1 - High
CIS 527 - Computer Networks Solution - Homework #2: 0 - Low 1 - High
SOLUTION – HOMEWORK #2
1. Sketch the NRZ, Manchester, and NRZI encoding for the bit stream 0001110101.
Assume that the NRZI signal starts out low.
Solution:
0 0 0 1 1 1 0 1 0 1
Clock
Solution:
01111011111 0 011111 0 10
(data) (Inserted 0) (data) (Inserted 0) (data)
When five consecutive 1s have been transmitted from the body of the message,
the sender inserts a 0 (as shown above) before transmitting the next bit.
3. A bit stream 10011101 is transmitted using the standard CRC method. The
generator polynomial is x3+1. Show the actual bit string transmitted. Suppose the
third bit from the left is inverted during transmission. Show that this error is
detected at the receiver’s end.
Solution:
1000110
---------------------------------------------
1001 | 10011101000 Message
| 1001
-----------------
1101
1001
---------
1000
1001
-----------
100 Remainder
-----------
Since T (x) minus the remainder would be exactly divisible by C (x), we subtract
the remainder from T (x) as shown below:
Note: The minus operation in polynomial arithmetic is the logical XOR operation.
T (x): 10011101000
Remainder: 100
-------------------
10011101100 This turns out to be the original message with
------------------- the remainder appended to it.
If the third bit form the left is inverted during transmission, the bit stream would
be: 10111101100. Dividing this by 1001 we get:
10101
---------------------------------------------
1001 | 10111101100 Message
| 1001
-----------------
1011
1001
---------
1001
1001
------------
0100 Remainder
------------
Since the remainder is 100, which is different form 0, the receiver detects the
error and can ask for retransmission.
4. Draw a timeline diagram (up to frame 7) that for the sliding window algorithm with
SWS=4 frames and RWS=3 frames, when the third frame (frame 2) is lost. The
receiver use cumulative ACKs. Use a timeout interval of about 2 x RTT. Assuming
that the transmit time (insertion delay) of a frame is equal to 0.25 RTT and the
frames can be processed instantaneously if they arrive in order.
On each data frame and ACK frame, you need to indicate the sequence number
(start from 0). In addition, you need to indicate what action is taken by the receiver
when it is received, for example, processed, buffered, and discarded.
Solution:
SWS = 4; RWS = 3; Timeout Interval = 2 RTT; Transmit Time = .25RTT
Frame 0
Frame 1
Frame 2
Processed
pp
1 RTT ACK 0
Frame 3 Processed
X ACK 1
Frame 4
Buffered
Frame 5
Buffered
Discarded
Timeout for
Frame 2
Frame 2
ACK 4
Frame 5
ACK 5
5. Suppose that we run the sliding window algorithm with SWS = 5 and RWS = 3, and
no out-of-order arrivals.
Solution:
But because SWS=5, all DATA[0]’s sent were sent before DATA[5]
by the no-out-of-order arrival hypothesis, DATA[0] can no longer arrive.
c) State a general rule for the minimum MaxSeqNum in terms of SWS and
RWS.
From the above discussion we can derive that, MaxSeqNum can be greater
than or equal to the sum of SWS and RWS and cannot be less than the
sum.
Solution:
The 64 byte (512 bit) limit is based on a 2.5km long 10base5 cable. The 512 bits
(equals 51.2 microseconds) is based on twice the end-to-end propagation time
(about 5 microseconds per km) plus time to propagate through repeaters. Fast
Ethernet has shorter cable runs (100m of cable implies about 0.5microseconds or
about 50 bits at 100Mbps).
RTT ≤ Size / BW
51.2μsec ≤ Size / 10 Mbps
i.e., 512 bits ≤ Size
RTT ≤ Size / BW
5.12μsec ≤ Size / 100 Mbps
i.e., 512 bits ≤ Size
7. Consider a token ring network like FDDI in which a station is allowed to hold the
token for some period of time (the token holding time, or THT). Let RingLatency
denote the time it takes the token to make one complete rotation around the
network when none of the stations have any data to send.
Solution:
a) In terms of THT and RingLatency, express the efficiency of this network when
only a single station is active.
b) What setting of THT would be optimal for a network that had only one station
active (with data to send) at a time?
c) In the case where N stations are active, given an upper bound on the token
rotation time, or TRT, for the network