Computer & Communication Networks, Homework Solutions …...Computer & Communication Networks,...

12
Computer & Communication Networks, Homework Solutions (Chs. 1-4) Chapter 1: 1.15 a) 2 x (385x10 6 )/(3x10 -10 ) = 2.57 sec b) delay×bandwidth = 2.57s x 100Mb/sec = 257 Mb = 32.124 MB c) Maximum number of bytes that can be transmitted before getting an acknowledgement d) Transfer Time = Round trip time + (Transfer size/ Bandwidth) 2.57 + (200Mb/100Mb) = 4.57s 4.57 s required until the transfer is finished 1.17 a) Delay. (The message sent to the server is short) b) Bandwidth (It depends on the size of the content. Larger contents are bandwidth sensitive c) Delay (It has modest size) d) Delay (Attributes are small in size) 1.23 To find the bandwidth at which compression option takes the same time RTT+(Transmission Size 0.5 MB /BW)+Compression time = RTT +(Transmission Size 0.4 MB /BW) Comment: RTT cancels on both side (0.5/BW) + 1 = (0.4/BW) + 2 BW = 0.1 MB/sec = 0.8 Mbps Latency doesn’t affect the answer because it would affect the compressed and uncompressed transmission equally. 1.28 (a) (640 × 480) × 3 bytes/pixel × 30 frames/sec = 27.6 MB/sec (b) (160 x 120) x 1 bytes/pixel × 5 frames/sec = 96 KB/sec (c) 650 MB /(75 x 60) sec = 0.144 MB/sec (d) 8 × 10 × 72 × 72 pixels = 414,720 bits = 51,840 bytes. At 14,400 bits/sec, this would take 28.8 seconds

Transcript of Computer & Communication Networks, Homework Solutions …...Computer & Communication Networks,...

Computer & Communication Networks, Homework Solutions (Chs. 1-4) Chapter 1:

1.15 a) 2 x (385x106)/(3x10-10) = 2.57 sec

b) delay×bandwidth = 2.57s x 100Mb/sec = 257 Mb = 32.124 MB

c) Maximum number of bytes that can be transmitted before getting an acknowledgement d) Transfer Time = Round trip time + (Transfer size/ Bandwidth) 2.57 + (200Mb/100Mb) = 4.57s 4.57 s required until the transfer is finished

1.17 a) Delay. (The message sent to the server is short)

b) Bandwidth (It depends on the size of the content. Larger contents are

bandwidth sensitive

c) Delay (It has modest size)

d) Delay (Attributes are small in size)

1.23 To find the bandwidth at which compression option takes the same

time RTT+(Transmission Size 0.5 MB /BW)+Compression time =

RTT +(Transmission Size 0.4 MB /BW) Comment: RTT cancels on both side (0.5/BW) + 1 = (0.4/BW) + 2 BW = 0.1 MB/sec = 0.8 Mbps Latency doesn’t affect the answer because it would affect the compressed and uncompressed transmission equally.

1.28 (a) (640 × 480) × 3 bytes/pixel × 30 frames/sec = 27.6 MB/sec (b) (160 x 120) x 1 bytes/pixel × 5 frames/sec = 96 KB/sec (c) 650 MB /(75 x 60) sec = 0.144 MB/sec (d) 8 × 10 × 72 × 72 pixels = 414,720 bits = 51,840 bytes.

At 14,400 bits/sec, this would take 28.8 seconds

Chapter 2:

2.6) Sequence of bits arriving over link: 1101011111010111110010111110110 Resulting frame after any stuffed bits are removed 1101011111 1011111 01011111 110 After any 5 consecutive ‘1s’ transmitted, the sender inserts ‘0’ before

transmitting next bit for bit stuffing No errors detected. Error is identified if there were 7 consecutive ‘1s’

in a row. 2.18) (a) C(x) = 1001 , message 11001001 begin by multiplying x3 since our divisor polynomial degree is 3: 11001001000

Generator: 1001 Message: 11001001000 Remainder: 011 Transmitted message: 11001001000 minus 011 = 011001000101 (exactly divisible by C(x))

(b) Inverting the first bit gives 0100 1001 011; dividing by 1001

(x3 + 1) gives a quotient of 0100 0001 and a remainder of 10.

Generator: 1001 Message: 01001001000 Remainder: 010

The receiver performs CRC which don’t should yield 0 which means message had been in error in one or more bits.

2.23 (a) Propagation delay = 20 × 103 m/(2 × 108 m/sec) = 100 μs.

(b) The time out value should at least be 200 μs (round trip time)

(c) The timeout value do not include remote node’s processing delay. 2.33 1. The sender sends D[0], D[1], D[2]. Receiver receives it.

2. The receiver sends ACK[3], but sender does not receive it. The receiver is now expecting D[3] to D[5] 3. The sender times out and resends D[0], D[1], D[2]. Considering, D[1] and D[2] are lost. The receiver accepts D[0] as D[5], because they have the same transmitted sequence number. 4. The sender finally receives ACK[3], and now sends D[3]-D[5]. The receiver, however, believes D[5] has already been received, when D[0]

arrived, above, and drops D[5] as redundant.

2.42 A station must not only detect a remote signal, but for collision

detection it must detect a remote signal while it is transmitting. Hence, it is required that the repeaters enables increasing the intensity of remote-signal.

Chapter 3: 3.13 B1 is selected as the root bridge (least ID)

LAN A: B2 and B7 connected to LAN A. B7 is selected since it is closest to root bridge B1 LAN B: B2 and B5 are connected and both bridges are equally close, but B2 selecetd because of low ID number. LAN C: Directly connected to B1. LAN D: B2 and B3 are connected. But B3 is selected since it directly connecetd to root bridge LAN E: Directly connected to B1 LAN F: B3 and B5 connected. But B3 is selected since it is closer to B1 LAN G: B3 is selected LAN H: B3 and B6 connected. B3 selected LAN I: B4 and B6 connected. B4 selected.

3.15

When the bridge first boots, the forwarding table is empty. When the bridge receives a frame that is addressed to a host not currently in the table, it forwards the frame out on all the port In the above scenario when A sends to C, B1 donot have C in the forwarding table. Thus it forwards the frame out on port 1. B2 also forwards the frame out on port 1, 2 and 3 and so does B3 and B4. The forwarding table build at each bridge are

B1 B2 B3

Host Port A 1 C 2 D 1

B4

Host Port D 2 A 1

When C sends to A, the packet is directly sent to A and B4 doesnot learn about C When D send to C the packet is routed by B4 towards B2. 3.16 B1 B2

B3

Host Port A 1 Host Port A 1 C 3 D 1

Host Port D 2 A 1

Host Port D 1 C 2 A 1

Host Port

D 2

C 3

A 1

B4 Host Port D 2 C 1

When C sends to D it is send via B3-B2-B4 When A sends to C it routes through B1, B2 and B3 Chapter 4: 4.14(a) According to this algorithm if multiple packets arrive destined for D

before the first arp returns. Then we end up sending burst of arp request . This consumes bandwidth and since these arp packets are broadcasted they interrupt host and propapagte across bridges

(b) If (Ethernet address for D is in ARP cache) send P else { If (ARP queries are queued) {wait until the ARP response come back} else {send out an ARP query for D after timeout} } (c) There would be excessive packet loss when devices will be bootstrapped. 4.16

A B C D E F A 0 2 Inf 5 Inf Inf B 2 0 2 Inf 1 inf C Inf 2 0 2 Inf 3 D 5 Inf 2 0 Inf Inf E Inf 1 Inf Inf 0 3 F Inf Inf 3 Inf 3 0

A B C D E F A 0 2 4 5 3 Inf B 2 0 2 4 1 4 C 4 2 0 2 3 3 D 5 4 2 0 Inf 5 E 3 1 3 Inf 0 3 F Inf 4 3 5 3 0

A B C D E F A 0 2 4 5 3 6 B 2 0 2 4 1 4 C 4 2 0 2 3 3 D 5 4 2 0 5 5 E 3 1 3 5 0 3 F 6 4 3 5 3 0

4.17

STEP 1 (D,0,-) 2 (D,0,-) (E,2,E)

(A,8,A) 3 (D,0,-)

(E,2,E) (A,8,A)

4 (D,0,-) (E,2,E)

(A,8,A) (B,4,E) (C,3,E)

5 (D,0,-) (E,2,E) (C,3,E)

(A,6,E) (B,4,E) (F,9,E)

6 (D,0,-) (A,6,E)

(E,2,E) (C,3,E) (B,4,E)

(F,9,E)

7 (D,0,-) (E,2,E) (C,3,E) (B,4,E) (A,6,E)

(F,9,E)

8 (D,0,-) (E,2,E) (C,3,E) (B,4,E) (A,6,E) (F,9,E)

4.31

(a) 3 routes to P along links 1, 2, 3 (b) A to B through link 1 B to A through link 2 (c) Set policy to prefer link 1 (d) Set policy to prefer AS R or set rule that B cannot send on links 1 4.45 Soln: Do AND operation on network address and netmask

C4.5E.13.87 B C4.5E.13.87 AND FF.FF.F0.0 is C4.5E.10.00 C4.5E.22.09 A C4.5E.22.09 AND FF.F0.0.0 is C4.50.0.0

C3.41.80.02 E C3.41.80.02 AND 80.0.0.0 is 80.0.0.0 5E.43.91.12 F 5E.43.91.12 AND C0.0.0.0 is C0.0.0.0 C4.6D.31.2E C C4.6D.31.2E AND FF.F0.0.0 is C4.60.0.0 C4.6B.31.2E D C4.6B.31.2E AND FF.FC.0.0 is C4.68.0.0 4.46 C4.4B.31.2E F C4.4B.31.2E AND C0.0.0.0 is C0.0.0.0

C4.5E.05.09 B C4.5E.05.09 AND FF.FF.FC.0 is C4.5E.4.0 C4.4D.31.2E E C4.4D.31.2E AND FF.FC.0.0 is C4.4C.0.0 C4.5E.03.87 A C4.5E.03.87 AND FF.FF.FE.0 is C4.5E.2.0 C4.5E.7F.12 D C4.5E.7F.12 AND FF.FF.C0.0 is C4.5E.40.0 C4.5E.D1.02 C C4.5E.D1.02 AND FF.FF.E0.0 is C4.5E.C0.0

4.60 Depth = N Non leaf node = k children Recipient = kN

(a) One multicast transmission involves : k + k2 + k3 + …. + kN = k(kN - 1)/(k - 1) = (kN+1 - k)/(k - 1) k = depth 1, k2 = depth 2, …….., kN = depth N

(b) One unicast retransmission involves N links (depth N); sending to everyone (kN) would require N x kN links

(c) Unicast transmission to x fraction of the recipients :

x × N × kN links. Equating

this to the answer in (a), we get x = (kN − k)/((k − 1) × N × kN ) ≈ 1/(k − 1) × N 4.63 (a) ::0F53:6382:AB00:67DB:BB27:7332 Correct (:: = 0:0:0:0:0:0:0:0, 8 groups in total) (b) 7803:42F2:::88EC:D4BA:B75D:11CD

Incorrect (::: cannot be used) (c) ::4BA8:95CC::DB97:4EAB

Incorrect (The double colon may only be used once in an address, as multiple use

would render the address indeterminate)

(d) 74DC::02BA Correct (Consecutive sections of zeros are replaced with a double colon (::))

(e) ::00FF:128.112.92.116

Correct (This is shorthand for IPv4 address) Ethernet timeline diagram

Time slot U1 U2 U3 U4 Comment 1 CS/pkt

Arrives Idle CS/pkt

Arrives Idle U1,U3 ready to

send P1 and P3 2 P1,P3 Idle P1,P3 Idle Collision of P1,P3 3 Wait T Idle Wait T Idle T wait time 4 P1 CS/pkt

Arrives Back off CS/pkt

Arrives U1 wins, U3 back Off for time T

5 P1 Idle Idle Idle U1 sending While U2-U4 cannot

6 P1 Idle Idle Idle 7 P1 Idle Idle Idle U1 finishes

Sending P1 8 Idle P2,P3,P4 P2,P3,P4 P2,P3,P4 P2-4 collide 9 Idle Wait T Wait T Wait T U4 wins backoff with random no 1

U3 random backoff 3 U2 random backoff 2

10 Idle Wait 2T Wait 3T P4 11 Idle Wait 2T Wait 3T P4 12 Idle Idle Wait 3T P4 13 Idle Idle Idle P4 14 Idle P2,P3 P2,P3 Idle P2,P3 collides 15 Idle Wait T Wait T Idle U2 wins backoff with random no 0

U3 backoff with random no 4 16 Idle P2 Wait T Idle U2 start sending P2 17 Idle P2 Wait T Idle U3 waiting 18 Idle P2 Wait T Idle 19 Idle P2 Wait T Idle 20 Idle P2 Idle Idle U2 finished sending 21 Idle Idle P3 Idle U3 sending 22 Idle Idle P3 Idle All stations finished sending

See separate ppt slides for mcast problems and WLAN timeline