P. 1
Sol 2

# Sol 2

|Views: 14|Likes:

See more
See less

12/05/2011

pdf

text

original

# COMP 5621 - Computer Networks I, Fall 2011 Course URL: http://course.cse.ust.hk/comp5621/.

Instructor: Prof. Brahim Bensaou, CSE, HKUST. Homework 2 - Solution Prepared by Jason Min WANG

Due: Dec. 4, 2011

1

Q1: IP

(a) Yes. A datagram 1,500 bytes arrives to Router 1, and this datagram should be forwarded to a link with a MTU of 512 bytes. This implies that 1,480 data bytes in the original datagram shall be allocated to 4 separate fragments (1480/488 ≈ 4). Notice that the original datagram is stamped with the identiﬁcation number of 12342. 1st fragment 488 bytes in the data ﬁeld of the IP datagram identiﬁcation = 12342 oﬀset = 0 ﬂag = 1 488 bytes in the data ﬁeld of the IP datagram identiﬁcation = 12342 oﬀset = 61 ﬂag = 1 488 bytes in the data ﬁeld of the IP datagram identiﬁcation = 12342 oﬀset = 122 ﬂag = 1 16 bytes in the data ﬁeld of the IP datagram identiﬁcation = 12342 oﬀset = 183 ﬂag = 0

2nd fragment

3rd fragment

4th fragment

(b) No. When Router 1 receives this datagram, the value of TTL ﬁeld will be decremented by 1 and since the TTL ﬁeld then reaches 0, this datagram shall be dropped directly by Router 1. No segmentation is needed.

2

Q2: Virtual Circuit Networks

(a) Solution: It is impossible to assign a ﬁxed VC number across the four links, because all 2-bit numbers are already used. (b) Solution: Since there are two VC numbers that are left for use in each link, the number of diﬀerent combination is equal to 24 = 16. 1

D 3. C 5. E 3. B 7. B The resulting shortest path tree is shown in Figure (1). B 6. C 6. 1. D 5. D 3. 4 Q4: Packet Forwarding Preﬁx Matching 11100000 / 8 1110000100000000 / 16 11100001 / 8 otherwise Link Interface 0 1 2 3 (a) Solution: (b) Solution: 2 . 3. C 5. G G D D D D D D H ∞ ∞ ∞ ∞ 17. C 5. F F F F F F F F G 6. 1. C 5. G 7. D 3. 1. C ∞ 4. 3. 2. B 6. 2. D 3. C 7. B ∞ ∞ 11. B 7.H G B F D A E C Figure 1: Shortest path tree from F 3 Q3: Link State Routing Solution: The steps of running Dijsktra algorithm are as follows: Step N A B C D E 0 1 2 3 4 5 6 7 F FE FED FEDC FEDCG FEDCGB FEDCGBA FEDCGBAH ∞ ∞ ∞ 7. F E E E E E E E 1. 2. 1. 2. 2. D 3. 2. 3. 1. 3. 2. 6. 1. 3. 3. 1. D 3.

3 . Hence it will be forwarded through interface 2. Hence it will be forwarded through interface 1. – 11100001 10000000 00010001 01110111 This address matches the preﬁx for interface 2. – 11100001 00000000 11000011 00111100 This address matches preﬁxes for interface 1 and 2. but the longest match occures with interface 1.– 11001000 10010001 01010001 01010101 This address matches only the rule for interface 3 and hence it will be forwarded through interface 3.

scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->