h02 answer cn

6
Dept. of Electronics and Information Eng., Huazhong University of Science and Technology 1 / 6 Computer Network (2012 Spring) Homework Answer Chapter2 Question 6 Suppose the following sequence of bits arrives over a link: 1101011111010111110010111110110 Show the resulting frame after any stuffed bits have been removed. Indicate any errors that might have been introduced into the frame. The frame Flag of HDLC or PPP protocol is 01111110. Bit stuffing is used to identify the start or the end of a frame by inserting additional 0. If there are five consecutive 1, the sender will insert one 0 as stuffed bit. If the receiver gets seven consecutive 1, there must be an error of the end of frame (EOF). We indicate the 0 after five 1s with red color. Received sequence: 11010111110 10111110 010111110 110 Removing stuffed 0: 1101011111^1011111^01011111^110 There is no seven consecutive 1 not interrupted by stuffed 0, so the receiver does not detect any error. Question 18 Suppose we want to transmit the message 11001001 and protect it from errors using the CRC polynomial x 3 + 1. (a) Use polynomial long division to determine the message that should be transmitted. (b) Suppose the leftmost bit of the message is inverted due to noise on the transmission link. What is the result of the receiver’s CRC calculation? How does the receiver know that an error has occurred? (a) The original message is M=11001001 The CRC polynomial is C(x)=x 3 +1, which is in order of 3, C=1001 Then we append 000 to M, and get T=11001001000, Divide T by C, …

Upload: ajay-malik

Post on 07-Feb-2016

229 views

Category:

Documents


2 download

DESCRIPTION

br

TRANSCRIPT

Page 1: H02 Answer Cn

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

1 / 6

Computer Network (2012 Spring) Homework Answer

Chapter2

Question 6 Suppose the following sequence of bits arrives over a link: 1101011111010111110010111110110 Show the resulting frame after any stuffed bits have been removed. Indicate any errors that

might have been introduced into the frame.

The frame Flag of HDLC or PPP protocol is 01111110. Bit stuffing is used to identify the start or

the end of a frame by inserting additional 0. If there are five consecutive 1, the sender will insert one 0 as stuffed bit. If the receiver gets seven consecutive 1, there must be an error of the end of frame (EOF).

We indicate the 0 after five 1s with red color. Received sequence: 1101011111010111110010111110110 Removing stuffed 0: 1101011111^1011111^01011111^110 There is no seven consecutive 1 not interrupted by stuffed 0, so the receiver does not detect

any error.

Question 18 Suppose we want to transmit the message 11001001 and protect it from errors using the CRC

polynomial x3 + 1. (a) Use polynomial long division to determine the message that should be transmitted. (b) Suppose the leftmost bit of the message is inverted due to noise on the transmission link.

What is the result of the receiver’s CRC calculation? How does the receiver know that an error has occurred?

(a)

The original message is M=11001001 The CRC polynomial is C(x)=x3+1, which is in order of 3, C=1001 Then we append 000 to M, and get T=11001001000, Divide T by C, …

Page 2: H02 Answer Cn

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

The quotient is 11010011, the remainder is What we transmit is the M with R appended, i.e., 11001001011

(b)

The received message is T’=01001001011The CRC polynomial C=1001 Then we divide T’ by C, …

The quotient is 01000001, the remainder is 010Since the T’ is not exactly divisible by C, i.e, the remainder is not zero, from this CRC calculation result, the receiver can know there must be some error in the received message.

Question 24 Suppose you are designing a sliding window protocol for a moon, which has a one-way latency of 1.25 seconds. Assuming thatdata, what is the minimum number of bits you need

The bandwidth x delay product is 1Mbps * This equals to 312500B / 1024 (B/pkt) The sliding window should be larger than 305 packets, and the resulting sequence number

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

remainder is R=011

hat we transmit is the M with R appended, i.e., 11001001011

=01001001011

is 01000001, the remainder is 010. is not exactly divisible by C, i.e, the remainder is not zero, from this CRC

can know there must be some error in the received message.

Suppose you are designing a sliding window protocol for a 1-Mbps point-to-point link to the way latency of 1.25 seconds. Assuming that each frame carries 1 KB of

data, what is the minimum number of bits you need for the sequence number?

he bandwidth x delay product is 1Mbps * ( 2 * 1.25 sec) = 2.5Mb = 312500 Byte (B/pkt) = 305.2 pkt

he sliding window should be larger than 305 packets, and the resulting sequence number

2 / 6

is not exactly divisible by C, i.e, the remainder is not zero, from this CRC can know there must be some error in the received message.

link to the each frame carries 1 KB of

he sliding window should be larger than 305 packets, and the resulting sequence number

Page 3: H02 Answer Cn

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

range should be twice, i.e., 610 packets. indicate the sequence number.

Question 29 Give some details of how you might augment the sliding window protocol withhaving ACKs carry additional information that reduces the SWSspace. Illustrate your protocol with a timelineare 4, the link speed is instantaneous, and the receiver can free buffers at the rate of one per second (i.e., the receiver is the bottleneck). Show what happens at T = 0, T = 1, ... , T = 4 sec

We assume ACKs carry an additional

the receiver. After receiving k, the window size). If k = 0, the sender will stop. controlled by the available buffer size in the receiver side,

T=0, Sender sends Frame1-Frame4. In short order, ACK1..

2, 1, and 0 respectively. T=1, Receiver frees first buffer; sends ACK4/

Receiver sends ACK5/k=0. T=2, Receiver frees second buffer; sends ACK5/

ACK6/k=0.

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

range should be twice, i.e., 610 packets. Since 29 < 610 < 210, then at least 10 bits are required to

Give some details of how you might augment the sliding window protocol with flow control by having ACKs carry additional information that reduces the SWS as the receiver runs out of buffer

Illustrate your protocol with a timeline for a transmission; assume the initial SWS and RWS taneous, and the receiver can free buffers at the rate of one per

receiver is the bottleneck). t T = 0, T = 1, ... , T = 4 seconds.

We assume ACKs carry an additional variable k, which indicate the available buffer space of the sender can use it as the maximum sending SWS (sliding

will stop. In this case, the sending rate in the sender side is controlled by the available buffer size in the receiver side, realizing the function of flow control.

Frame4. In short order, ACK1...ACK4 are received. Sender set

rst buffer; sends ACK4/k=1. Sender slides window forward and sends Frame5.

Receiver frees second buffer; sends ACK5/k=1. Sender sends Frame6; receiver sends

3 / 6

quired to

ow control by as the receiver runs out of buffer

for a transmission; assume the initial SWS and RWS taneous, and the receiver can free buffers at the rate of one per

buffer space of SWS (sliding

In this case, the sending rate in the sender side is the function of flow control.

SWS to 3,

Sender slides window forward and sends Frame5.

Sender sends Frame6; receiver sends

Page 4: H02 Answer Cn

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

4 / 6

T=3, Receiver frees third buffer; sends ACK6/k=1. Sender sends Frame7; receiver sends ACK7/k=0.

T=4, Receiver frees fouth buffer; sends ACK7/k=1. Sender sends Frame8; receiver sends ACK8/k=0.

Question 35 Suppose that we run the sliding window algorithm with SWS = 5 and RWS = 3, and no out-of-order arrivals. (a) Find the smallest value for MaxSeqNum. You may assume that it suffices to find the smallest MaxSeqNum such that if DATA[MaxSeqNum] is in the receive window, then DATA[0] can no longer arrive. (b) Give an example showing that MaxSeqNum − 1 is not sufficient. (c) State a general rule for the minimum MaxSeqNum in terms of SWS and RWS.

(a) The smallest value for MaxSeqNum is 8. Proof:

We assume DATA[8] is in the receive window, since RWS = 3, then the earliest possible receive window is { DATA[6], DATA[7], DATA[8] }. 旐 Then ACK[6] has been sent by the receiver. 旐 Then ACK[6] has been received by the sender . 旐 Then DATA[5] has been sent by the receiver. 旐 Since SWS = 5, then the earliest possible send window is {DATA[1],DATA[2],…,DATA[5]} 旐 Since no-out-of-order arrival, DATA[0] can no longer arrive.

(b) MaxSeqNum – 1 = 7 is not sufficient Proof:

1. We assume the sender sends { DATA[0] , DATA[1], …, DATA[4] }. All arrive. 2. The receiver sends ACK[5] in response, and the receive window moves on to { DATA[5], …, DATA[7]}. 3. We assume the ACK[5] is lost, then sender times out and re-transmits DATA[0]. While the receiver is expecting DATA[7]. 7 and 0 are in-distinguishable in mod MaxSeqNum calculation. So the receiver will accept DATA[0] as DATA[7], which is error.

(c) MaxSeqNum 驶 SWS + RWS

Question 41 The 1982 Ethernet specification allowed between any two stations up to 1500 m of coaxial cable,

Page 5: H02 Answer Cn

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

1000 m of other point-to-point link cable, and two repeaters.to the coaxial cable via up to 50 m of “dropgiven in Table 2.7 (where c = speed of light in a vacuum = 3×10round-trip propagation delay, measured in bits, due to the sources listed? (This list is notcomplete; other sources of delay include sense time and signal rise time.)

The one way delays include: 1) propagation delay in coax cable, 1500 / (0.77*3*102) propagation delay in point-to-point link, 1000 / (0.65*3*103) propagation delay in drop cables, 6 * 50 / (0.65*3*104) process delay in transceivers, 6 * 0.2 = 1.2 5) process delay in repeaters, 2 * 0.6 = 1.2 So, the one-way delay is 6.49+5.13+1.54+1.2+1.2 = 15.56For 10Mbps Ethernet, one bit time is 0.1311 bits.

Question 43 Suppose the round-trip propagation delay for Ethernet is 46.4 µs. This yields a minimum packet size of 512 bits (464 bits corresponding to propagation delay + 48 bits of jam signal).(a) What happens to the minimum packet size if the delay timesignalling rate rises to 100 Mbps? (b) What are the drawbacks to so large a minimum packet size?(c) If compatibility were not an issue, how might the specifications be written so as to permit a smaller minimum packet size?

(a) When rate rises to 100Mbps, one bit time is 0.01will be 4640 bits time. Then the minimum packet size is 4640 + 48 = 4688 bits = 586 Bytes

(b) This packet size is considerably larger than many higherconsiderable wasted bandwidth

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

point link cable, and two repeaters. Each station or repeater connects to the coaxial cable via up to 50 m of “drop cable.” Typical delays associated with each device are

c = speed of light in a vacuum = 3×108 m/s). What is the worstpropagation delay, measured in bits, due to the sources listed? (This list is not

complete; other sources of delay include sense time and signal rise time.)

1500 / (0.77*3*108) = 6.49 µs point link, 1000 / (0.65*3*108) = 5.13 µs

delay in drop cables, 6 * 50 / (0.65*3*108) = 1.54 µs 4) process delay in transceivers, 6 * 0.2 = 1.2 µs 5) process delay in repeaters, 2 * 0.6 = 1.2 µs

way delay is 6.49+5.13+1.54+1.2+1.2 = 15.56µs, the round-trip-time is 31.12µ, one bit time is 0.1µs, then the worst-case round-trip propagation delay

trip propagation delay for Ethernet is 46.4 µs. This yields a minimum packet size of 512 bits (464 bits corresponding to propagation delay + 48 bits of jam signal). (a) What happens to the minimum packet size if the delay time is held constant,

(b) What are the drawbacks to so large a minimum packet size? (c) If compatibility were not an issue, how might the specifications be written so as to permit a

hen rate rises to 100Mbps, one bit time is 0.01µs. If the delay time is held constant, then it hen the minimum packet size is 4640 + 48 = 4688 bits = 586 Bytes

This packet size is considerably larger than many higher-level packet sizes, resulting in

5 / 6

Each station or repeater connects cable.” Typical delays associated with each device are

is the worst-case propagation delay, measured in bits, due to the sources listed? (This list is not

µs. propagation delay is

trip propagation delay for Ethernet is 46.4 µs. This yields a minimum packet

and the

(c) If compatibility were not an issue, how might the specifications be written so as to permit a

s. If the delay time is held constant, then it hen the minimum packet size is 4640 + 48 = 4688 bits = 586 Bytes

resulting in

Page 6: H02 Answer Cn

Dept. of Electronics and Information Eng., Huazhong University of Science and Technology

6 / 6

(c) The minimum packet size could be smaller if maximum collision domain diameter were reduced, and if sundry other tolerances were tightened up

Question44 Let A and B be two stations attempting to transmit on an Ethernet. Each has a steady queue of frames ready to send; A’s frames will be numbered A1, A2, and so on, and B’s similarly. Let T = 51.2 µs be the exponential backoff base unit. Suppose A and B simultaneously attempt to send frame 1, collide, and happen to choose backoff times of 0 × T and 1 × T, respectively, meaning A wins the race and transmits A1 while B waits. At the end of this transmission, B will attempt to retransmit B1 while A will attempt to transmit A2. These first attempts will collide, but now A backs off for either 0 × T or 1 × T, while B backs off for time equal to one of 0 × T, . . . , 3 × T. (a) Give the probability that A wins this second backoff race immediately after this first collision; that is, A’s first choice of backoff time k× 51.2 is less than B’s. (b) Suppose A wins this second backoff race. A transmits A3, and when it is finished, A and B collide again as A tries to transmit A4 and B tries once more to transmit B1. Give the probability that A wins this third backoff race immediately after the first collision. (c) Give a reasonable lower bound for the probability that A wins all the remaining backoff races. (d) What then happens to the frame B1? This scenario is known as the Ethernet capture effect.

We note the backoff time for A and B are k_A and k_B respectively. (a) After the first collision, k_A can be 0 or 1, k_B can be 0,1,2,3. If A choose a smaller k_A than k_B, then it will win the second backoff race. There will be totally 2*4 cases, and 5 cases satisfying k_A < k_B. As the result, the probability for A wins the second race is 5/8 (b) k_A can be any one in {0,1}, k_B can be {0,1,2,…,7}. There will be totally 2*8 cases, and 13

cases satisfying k_A < k_B. As the result, the probability for A wins the second race is 13/16 (c) P(winning race 1) = 5/8 > 1/2 P(winning race 2) = 13/16 > 3/4 …… P(winning race i) > 1 – 1/2i-1

then, P(A wins every time after 3 times) = (1-1/8)*(1-1/16)*(1-1/32)* ……3/4 (d) B gives up on B1, and starts over with B2.