HW2 Solution



Comments



Description

CIS 527 – COMPUTER NETWORKS 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 NRZ 0 - Low ; 1 - High Clock Manchester 0 - Low to High; 1 - High to Low NRZI Make a transition from the current signal to encode a 1 and stay at the current signal to encode a 0 2. A bit string, 0111101111101111110, needs to be transmitted at the data link layer. What is the string actually transmitted after bit stuffing? Solution: 01111011111 0 (data) (Inserted 0) 011111 (data) 0 (Inserted 0) 10 (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: Message M (x) = 10011101 = x7+x4+ x3+ x2+ 1 CRC Polynomial C (x) = x3+ 1 = 1001 Multiply the message with x3 since the divisor polynomial is of degree 3. . Dividing this by 1001 we get: 10101 --------------------------------------------1001 | 10111101100  Message | 1001 ----------------1011 1001 --------1001 1001 -----------0100  Remainder -----------Since the remainder is 100. If the third bit form the left is inverted during transmission. T (x): 10011101000 Remainder: 100 ------------------10011101100  This turns out to be the original message with ------------------the remainder appended to it. which is different form 0. we subtract the remainder from T (x) as shown below: Note: The minus operation in polynomial arithmetic is the logical XOR operation. divide T (x) by C (x) 1000110 --------------------------------------------| 10011101000  Message | 1001 ----------------1101 1001 --------1000 1001 ----------100  Remainder ----------- 1001 Since T (x) minus the remainder would be exactly divisible by C (x). the bit stream would be: 10111101100.e. T (x) = x3 (x7+x4+ x3+ x2+ 1) = x10+x7+ x6+ x5+x3  10011101000 Divide 10011101000 by 1001 i. the receiver detects the error and can ask for retransmission. . 25RTT Frame 0 Frame 1 Frame 2 1 RTT pp Frame 3 Processed ACK 0 Processed X Frame 4 ACK 1 Buffered Frame 5 Buffered Discarded Timeout for Frame 2 Frame 2 ACK 4 Frame 5 ACK 5 .25 RTT and the frames can be processed instantaneously if they arrive in order. The receiver use cumulative ACKs. Transmit Time = . buffered. when the third frame (frame 2) is lost. Use a timeout interval of about 2 x RTT. Assuming that the transmit time (insertion delay) of a frame is equal to 0. and discarded. Solution: SWS = 4. RWS = 3. processed. Draw a timeline diagram (up to frame 7) that for the sliding window algorithm with SWS=4 frames and RWS=3 frames. On each data frame and ACK frame. Timeout Interval = 2 × RTT. for example.4. you need to indicate what action is taken by the receiver when it is received. you need to indicate the sequence number (start from 0). In addition. From the above discussion we can derive that. Because 7 and 0 are indistinguishable mod MaxSeqNum. Solution: a) Find the smallest value for MaxSeqNum.DATA[4].. Receiver sends ACK[4] in response.. b) Give an example showing that MaxSeqNum – 1 is not sufficient We show that if MaxSeqNum=7. DATA[0] can no longer arrive.. the receiver cannot tell which actually arrived. 3. Sender times out and retransmits DATA[0]. We have that DATA[8] in receive window the earliest possible receive window is DATA[6]. and no out-of-order arrivals. then DATA[0] can no longer arrive at the receiver.5. The receiver accepts it as DATA[7]. The receive window is now DATA[5]. All arrive.DATA[7]. but it is slow. Suppose that we run the sliding window algorithm with SWS = 5 and RWS = 3.. MaxSeqNum can be greater than or equal to the sum of SWS and RWS and cannot be less than the sum. MaxSeqNum >= SWS + RWS . No explanation The smallest working value for MaxSeqNum is 8 It suffices to show that if DATA[8] is in the receive window. c) State a general rule for the minimum MaxSeqNum in terms of SWS and RWS. Sender sends DATA[0]. then the receiver can be expecting DATA[7] and an old DATA[0] can still arrive. all DATA[0]’s sent were sent before DATA[5]  by the no-out-of-order arrival hypothesis. 1.DATA[8] ACK[6] has been received DATA[5] was delivered. 2. But because SWS=5. 512 bits ≤ Size 7. or TRT.5microseconds or about 50 bits at 100Mbps). or THT)..2 microseconds) is based on twice the end-to-end propagation time (about 5 microseconds per km) plus time to propagate through repeaters. for the network TRT ≤ N × THT + RingLatency . given an upper bound on the token rotation time. Fast Ethernet has the same 64 byte minimum frame size but can get bits out 10 times faster. Fast Ethernet has shorter cable runs (100m of cable implies about 0.6.12μsec ≤ Size / 100 Mbps i. Ethernet frames must be at least 64 bytes long to ensure the transmitter is still going in the event of a collision at the far end of the cable.e. Solution: a) In terms of THT and RingLatency. express the efficiency of this network when only a single station is active. For Regular Ethernet: RTT ≤ Size / BW 51. 512 bits ≤ Size For Faster Ethernet: RTT ≤ Size / BW 5. How is it possible to maintain the same minimum frame size? Solution: The 64 byte (512 bit) limit is based on a 2..5km long 10base5 cable. we let the station transmit as long as it likes. c) In the case where N stations are active. 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. 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. The 512 bits (equals 51.e.2μsec ≤ Size / 10 Mbps i. THT / (THT + RingLatency) b) What setting of THT would be optimal for a network that had only one station active (with data to send) at a time? Infinity.
Copyright © 2024 DOKUMEN.SITE Inc.