finalece361-2013-solutionsexams.skule.ca/exams/ece361h1_20131... · 2018. 2. 3. · title:...

15
University of Toronto Department of Electrical and Computer Engineering ECE361- Computer Networks Final Exam April 29, 2013 Instructor: Professor Valaee Last Name: ____________________SOLUTION____________________________ First Name: __________________________________________________________ Student Number: _______________________________________________________ Signature: ___________________________________________________________ Instructions This is a Type A examination. You are not allowed to use aid-sheets, textbook or any other material. You may use only a non-programmable calculator. Clearly identify your final answer to each question (if there is more than one part that can be considered as your final answer, you will get no mark) Duration: 2.5 hours Answer ALL questions on this test paper. There is an extra page at the end if you need it. That page should also be handed in with the exam paper. Please enter the first letter of your last name here: Good luck EXAMINER's REPORT 1 /20 2 /20 3 /20 4 /20 5 /20 TOTAL ________ /100

Upload: others

Post on 04-Feb-2021

3 views

Category:

Documents


1 download

TRANSCRIPT

  • University of Toronto

    Department of Electrical and Computer Engineering

    ECE361- Computer Networks

    Final Exam

    April 29, 2013

    Instructor: Professor Valaee

    Last Name: ____________________SOLUTION____________________________

    First Name: __________________________________________________________

    Student Number: _______________________________________________________

    Signature: ___________________________________________________________

    Instructions • This is a Type A examination. • You are not allowed to use aid-sheets, textbook or any other material. • You may use only a non-programmable calculator. • Clearly identify your final answer to each question (if there is more than one part that can

    be considered as your final answer, you will get no mark)

    Duration: 2.5 hours Answer ALL questions on this test paper. There is an extra page at the end if you need it. That page should also be handed in with the exam paper. Please enter the first letter of your last name here:

    Good luck

    EXAMINER's REPORT 1 /20

    2 /20

    3 /20

    4 /20

    5 /20

    TOTAL ________ /100

  • Final Exam – ECE361S – 2013 Page 2 of 15

    You can use the following formulas if you need them. Probability Distribution Functions:

    :Poisson !,2,1,0 ,

    !)( === − kek

    kXPk

    λλ λ=E(X) var λ=(X)

    Geometric : ,2,1 ,)1()( 1 !=−== − kppkXP k 1)(p

    XE = 21 varpp(X) −=

    Exponential: ,0 ,0 ,)( >≥= − λλ λ xexf xX 1λ

    =E(X) 1var 2λ(X)=

    EstimatedRTT (new) = 0.875 * EstimatedRTT (old) + 0.125 * SampleRTT DevRTT (new) = 0.75 * DevRTT (old) + 0.25 * |SampleRTT - EstimatedRTT (old)| TimeoutInterval = EstimatedRTT (new) + 4 * DevRTT (new) CSMA-CD:

    Efficiency = 1

    1+ 5tpropttrans

  • Final Exam – ECE361S – 2013 Page 3 of 15

    Question 1 – (4+4+4+4+4=30 marks) (a) Under what conditions does it make sense to use RTS/CTS in CSMA/CA?

    The size of the data packet should be much larger than the RTS/CTS packets. Indeed we should have RTS+CTS+2SIFS

  • Final Exam – ECE361S – 2013 Page 4 of 15

    (d) Consider the following circular DHT network. Transmission over each link takes 1 msec. The links are directional as noted in the figure. When a key is found, the key holder creates a direct connection to the query-originating node and transmits the key. The delay on that link is also 1msec. What is the average time to search for a key in the above network if the keys are distributed uniformly among the nodes?

    A: (2+3+4+4+5)/6=18/6 B: (2+3+3+4+4)/6=16/6 C: (2+2+3+3+4)/6=14/6 D: (2+3+2+3+4)/6=14/6 E: (2+3+4+5+6)/6=20/6 F: (2+3+4+5+5)/6=19/6 DELAY=(18+16+14+14+20+19)/(6*6)=

    (e) Let g(x) = x3 +1 be the generating polynomial for a CRC code. We would like to transmit the following bits 100110. What is the transmitted data including the CRC bits? Give an example to show that this CRC may not be able to detect an error pattern with two bits in error. Show that the error cannot be detected.

    x3 +1 x8 + x5 + x4

    x8 + x5

    x4

    x4 + x

    x

    x5 + x Transmitted bits = 100110010

    Example for an undetected error = 000010010 x3 +1 x4 + xx4 + x0

    x

    A

    B

    C

    D

    E

    F

  • Final Exam – ECE361S – 2013 Page 5 of 15

    Question 2 - (3+3+3+3+3=15 marks) - Distance Vector Routing (a) In the graph below, use the Distance Vector routing (without split horizon or reverse poisoning) to find the minimum distance from each node to node G. Assume that exchanges of routing information and routing table updates are synchronous (i.e., they happen at the same time at all nodes). Fill out the table below to find the shortest distance from each node to node G.

    ! !

    ! !! !

    ! !

    ! !

    ! !! !

    G

    A

    B

    C

    D

    E

    F

    3

    1

    1

    4

    3

    3 4

    2

    4

    1

    1

    Iteration A B C D E F Initial -1,∞ -1,∞ -1,∞ -1,∞ -1,∞ -1,∞

    1 -1,∞ G,3 -1,∞ -1,∞ G,1 G,1 2 B,5 G,3 B,4 F,2 G,1 G,1 3 D,4 G,3 D,3 F,2 G,1 G,1 4 D,4 G,3 D,3 F,2 G,1 G,1 5 6 7

    (b) Assume that G sends a broadcast packet to all nodes. Assume that Reverse Path Forwarding is used. How many copies of the packet are transmitted in the network? Include the original packet in your calculations. G: 3 B: 4 E: 2 F: 2 D: 3 C: 1 A: 1 Total = 16

  • Final Exam – ECE361S – 2013 Page 6 of 15

    (c) Assume that the link between nodes F and G is disconnected. Do NOT use split horizon or reverse poisoning. Fill out the table below to find the shortest distance from each node to node A.

    ! !

    ! !! !

    ! !

    ! !

    ! !! !

    G

    A

    B

    C

    D

    E

    F

    3

    1

    1

    4

    3

    3 4

    2

    4

    1

    1

    (d) Assume that each iteration in part (c) is done in 10 seconds. Find the total time during which packets destined to G go around a loop somewhere in the network. (e) Assuming that the link between nodes F and G is broken, use split horizon with reverse

    poisoning to find the shortest distance from all nodes to G. How many loop can you find?

    Iteration A B C D E F Initial D,4 G,3 D,3 F,2 G,1 G,1

    1 D,4 G,3 D,3 F,2 G,1 E,4 2 D,4 G,3 D,3 F,5 G,1 E,4 3 B,6 G,3 D,6 F,5 G,1 E,4 4 5

    Iteration A B C D E F Initial D,4 G,3 D,3 F,2 G,1 G,1

    1 D,4 G,3 D,3 F,2 G,1 D,3 2 D,4 G,3 D,4 F,4 G,1 D,3 3 D,6 G,3 D,5 F,4 G,1 E,4 4 D,6 G,3 D,5 F,5 G,1 E,4 5 B,6 G,3 D,6 F,5 G,1 E,4 6 7 8

  • Final Exam – ECE361S – 2013 Page 7 of 15

    Question 3 – (6+6+6+2=20 marks) A company has been granted a block of IP addresses starting with 128.100.10.0/24. The company wants to assign IP addresses to three groups of its departments as follows:

    (a) The first group has 6 networks, where each network needs 10 addresses. (b) The second group has 5 small networks, where each network needs 6 addresses. (c) The third group has 3 larger networks, where each network needs 28 addresses.

    Design the subblocks and write down the minimum IP address, the maximum IP address, and the slash notation for each network in the tables below. Each department has a distinct router that advertises all the IP addresses in its corresponding network. The addresses should be allocated in the order given above (group (a) is allocated first, followed by group (b), followed by group (c)). You should not leave any unnecessary space between the addresses allocated to the groups. Group (a) Network IP address range Network slash notation

    1 Min IP: 128.100.10.0 128.100.10.0/28

    Max IP: 128.100.10.15

    … … …

    6 Min IP: 128.100.10.80 128.100.10.80/28

    Max IP: 128.100.10.95

    Group (b) Network IP address range Network slash notation

    1 Min IP: 128.100.10.96 128.100.10.96/29

    Max IP: 128.100.10.103

    … … …

    5 Min IP: 128.100.10.128 128.100.10.128/29

    Max IP: 128.100.10.135

  • Final Exam – ECE361S – 2013 Page 8 of 15

    Group (c) Network IP address range Network slash notation

    1 Min IP: 128.100.10.160 128.100.10.160/27

    Max IP: 128.100.10.191

    … … …

    3 Min IP: 128.100.10.224 128.100.10.224/27

    Max IP: 128.100.10.255

    (d) Find out how many addresses are still available after these allocations. Used =16*6+8*5+32*3=232 Remaining = 256-232= 24

    16

    16

    16

    16

    16

    16

    8 8 8 8 8

    32

    32

    32

    Not assigned

    0000XXXX

    0001XXXX

    0010XXXX

    0011XXXX

    0100XXXX

    0101XXXX 01100XXX 01101XXX 01110XXX 01111XXX 10000XXX

    101XXXXX

    110XXXXX

    111XXXXX

  • Final Exam – ECE361S – 2013 Page 9 of 15

    Question 4 - (6+7+7=20 marks) Host A wants to fetch a webpage from the web server B. The hardware address of the router R, which is also the local DNS server for host A is not known. The router R does not know the IP address of the web server B, however it only knows the IP of the TLD server for the domain that contains B. Assume that a one way transmission of any packet on the local network takes 5msec and the one way transmission in the internet takes 50msec. The main page of the webpage has 500 bytes, which also has a link to an image with 8000 bytes. Ignore the processing delay and the header size, and assume that the size of the ACK packet is negligible. Assume that the maximum segment size in the network is 500 Bytes and let the link bitrate to be very high. In the calculations below always include the connection teardown delay if needed.

    ! !

    !

    Internet

    B

    TLDroot

    AS

    Web Server

    R

    A

    (a) How long does it take from the time the user clicks on the link until the IP address of B is resolved?

    Solution: first we should resolve the HW address of R using ARP. This takes 4 packet exchanges between Host A and Router R. Next we should find the IP of B. Since the TLD is cached, there is no need to contact root. ARP: 4*5=20 msec DNS: 5+2*50+2*50+5=210 msec Total delay = 230 msec

  • Final Exam – ECE361S – 2013 Page 10 of 15

    (b) If there is no error or packet loss in the network, and if non-persistent HTTP is used, how long does it take to download the whole page? Ignore the IP address resolution time of server B. The image has 8000/500=16 segments First we should create a TCP connection to get the main page. TCP connection establishment is a three-way handshake protocol, however the third packet can bring the HTTP GET command. Delay to get the main page = 55+55+55+55+55 = 55*5= 275 msec The first two transactions are for the TCP establishment. The next two transactions are for HTTP GET and reply, and the last one is for TCP teardown. The 16 segments can be transmitted in the batches of 1+2+4+8+1, which takes 5 RTT time. Total delay for object transmission is = 55+55+55+5*110+55=220+550=770 msec Total delay = 275 + 770 = 1045 msec

  • Final Exam – ECE361S – 2013 Page 11 of 15

    (c) If there is no error or packet loss in the network, and if persistent HTTP is used, how long does it take to download the whole page? Ignore the IP address resolution time of server B.

    In this case the TCP connection is not released after fetching the main web page. There are a total of 17 segments to be fetched from server B (including the main webpage). The 17 segments will be fetched in the batches of 1+2+4+8+2=17 (total of 5 RTT) Total delay = 110 (TCP establishment) + 110 (main webpage) + 4*110 (image) + 55 (connection teardown) = 660+55= 715 msec.

  • Final Exam – ECE361S – 2013 Page 12 of 15

    Question 5 – (4+4+4+4+4=20 marks) 2N computers have been connected in a network as illustrated. The length of each link is written in meters. Each computer generates 1000 packets per second with each packet being 500 bytes. The maximum rate of all links is 1 Gbps. The propagation speed in the medium is 2.0×108 meters/second.

    !

    !

    !!

    !

    !

    hub 2 hub 3

    hub 1

    1

    2

    N

    N+1

    N+2

    2N

    100

    100

    100

    100

    100

    100

    50 50

    a) Assume that the network uses Slotted Aloha, where the length of each timeslot is equal to the transmission time of a single packet. Find the packet generation rate of each node in a timeslot. The length of each timeslot: 500*8109

    =4000109

    = 0.0004 = 4µ sec

    Total number of timeslots per second = 1/0.0004=250000 Packet generation rate of each source per timeslot = 1000/250000 = 0.004

  • Final Exam – ECE361S – 2013 Page 13 of 15

    b) In the Slotted Aloha network find the number of nodes in the system if about 30% of the timeslots is idle.

    There is an error which has to be corrected

    1− p( )2N = 0.3 where p=0.4 from part (a) Therefore 2N log 0.96 = log 0.3 or N = log0.3 / (2 log 0.96) = 15

    c) In part (b), what is the expected delay for the successful transmission of each packet?

    Transmission of a packet is successful with probability: Ps = p(1− p)

    2N−1 = 0.04×0.9629 ≅ 0.01 The number of timeslots before a success is 100 The expected delay = 100 * 40µsec=4 msec

  • Final Exam – ECE361S – 2013 Page 14 of 15

    d) What is the maximum number of nodes supported in the network if CSMA-CD is used on the shared medium?

    CSMA-CD:

    Efficiency = 1

    1+ 5tpropttrans

    tprop =3002×108

    = 0.0015msec =1.5µ sec

    ttrans = 40µ sec

    efficiency = 1

    1+ 5tpropttrans

    =1

    1+ 5×1.540

    = 0.84

    The total capacity is 0.84*1Gbps=840Mbps. Hence

    2N =840×106

    1000×500×8= 210

    N =105

    e) Assume that hub1 is replaced with a switch. Find the maximum number of nodes

    supported in the network if CSMA-CD is used on the shared medium

    tprop =2002×108

    =1µ sec

    ttrans = 40µ sec

    efficiency = 1

    1+ 5tpropttrans

    =1

    1+ 5×140

    = 0.89

    The total capacity is 0.91*10Mbps=9.1Mbps. Hence

    N = 890×106

    1000×500×8= 222

    222−1= 2212N = 442

    to account for the transmission by the switch

  • Final Exam – ECE361S – 2013 Page 15 of 15