Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
261 views

Homework 2: Due Date: 2 Jan., 2019

The document provides instructions for homework 2 in networking which is due on January 2nd, 2019 and is worth 100 points total. It includes 6 questions related to network algorithms, IP fragmentation, network addressing, BGP routing, linear feedback shift registers, slotted ALOHA, and efficiency. The student is asked to show the steps and calculations for applying algorithms like Dijkstra's and provide numerical answers for questions about probabilities, addresses, routing paths, and register values.

Uploaded by

Tam Hoang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
261 views

Homework 2: Due Date: 2 Jan., 2019

The document provides instructions for homework 2 in networking which is due on January 2nd, 2019 and is worth 100 points total. It includes 6 questions related to network algorithms, IP fragmentation, network addressing, BGP routing, linear feedback shift registers, slotted ALOHA, and efficiency. The student is asked to show the steps and calculations for applying algorithms like Dijkstra's and provide numerical answers for questions about probabilities, addresses, routing paths, and register values.

Uploaded by

Tam Hoang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Homework 2

Due date: 2nd Jan., 2019


Total points: 100

1. (10 points) Consider the following network. With the indicated link costs, use Dijkstra’s least-
cost path algorithm to compute the least-cost path from x to all the network nodes. Show how
the algorithm works by computing the following table.

Step N’ D(t), p(t) D(u),p(u) D(v), p(v) D(w),p(w) D(y), p(y) D(z), p(z)
0
1
2
3
4
5
6

Ans
Step N’ D(t),p(t) D(u),p(u) D(v),p(v) D(w),p(w) D(y),p(y) D(z),p(z)

0 x ∞ ∞ 3,x 6,x 6,x 8,x


1 xv 7,v 6,v 3,x 6,x 6,x 8,x
2 xvu 7,v 6,v 3,x 6,x 6,x 8,x
3 xvuw 7,v 6,v 3,x 6,x 6,x 8,x
4 xvuwy 7,v 6,v 3,x 6,x 6,x 8,x
5 xvuwyt 7,v 6,v 3,x 6,x 6,x 8,x
6 xvuwytz 7,v 6,v 3,x 6,x 6,x 8,x

2. (10 points) Consider sending a 1600-byte datagram into a link that has an MTU of 500 bytes.
Suppose that the original datagram is stamped with the identification number 291.
1
(a) How many fragments are generated?
(b) What are the values in the various fields in IP datagrams generated related to fragmentation?

Ans
The maximum size of data field in each fragment =480 (because there are 20 bytes IP header). Thus
1600  20 
the number of required fragments   4
 480 
Each fragment will have Identification number 291. Each fragment except the last one will be of size
500 bytes (including IP header). The last datagram will be of size 160 bytes (including IP header).
The offsets of the 4 fragments will be 0, 60, 120, 180. Each of the first 3 fragments will have flag=1;
the last fragment will have flag=0.

3. (10 points) Consider the network setup in the following. Suppose that the ISP instead assigns
the router the address 24.34.112.235 and that the network address of the home network is 192.
168.1/24.

2
(a) Assign addresses to all interfaces in the home network.
(b) Suppose each host has two ongoing TCP connections, all to port 80 at host 128.119.40.86.
Provide the six corresponding entries in the NAT translation table.
Ans
a) Home addresses: 192.168.1.1, 192.168.1.2, 192.168.1.3 with the router interface being
192.168.1.4
b)
NAT Translation Table
WAN Side LAN Side
24.34.112.235, 5000 192.168.1.1, 3345
24.34.112.235, 5001 192.168.1.1, 3346
24.34.112.235, 5002 192.168.1.2, 3445
24.34.112.235, 5003 192.168.1.2, 3446
24.34.112.235, 5004 192.168.1.3, 3545
24.34.112.235, 5005 192.168.1.3, 3546

4. (30 points) In the following network,

(a) Consider the path information that reaches stub network W, X, and Y. Based on the
information available at W and X, what are their respective views of the network topology?
The topology view at Y is shown in the following.

3
(b) B would never forward traffic destined to Y via X based on BGP routing. But in BitTorrent,
data packets go to X first then flow to Y. Describe how data packets follow a path not given
by BGP algorithm.
(c) Suppose that there is another stub network V that is a customer of ISP A. Suppose that B
and C have a peering relationship, and A is a customer of both B and C. Suppose that A
would like to have the traffic destined to W to come from B only, and the traffic destined

4
to V from either B or C. How should A advertise its route to B and C? What AS route does
C receive?
Ans
(a)

B x B x
w A w A

C y C y

X’s view of the topology W’s view of the topology

In the above solution, X does not know about the AC link since X does not receive an advertised
route to w or to y that contain the AC link (i.e., X receives no advertisement containing both AS A
and AS C on the path to a destination.

(b)

BitTorrent file sharing and Skype P2P applications.


Consider a BitTorrent file sharing network in which peer 1, 2, and 3 are in stub networks W, X, and Y
respectively. Due the mechanism of BitTorrent’s file sharing, it is quire possible that peer 2 gets data chunks
from peer 1 and then forwards those data chunks to 3. This is equivalent to B forwarding data that is finally
destined to stub network Y.

(c)
A should advise to B two routes, AS-paths A-W and A-V.
A should advise to C only one route, A-V.
C receives AS paths: B-A-W, B-A-V, A-V.

5. (10 points) Consider the generator G=1001, and suppose that D has the value 11000111010.
What is the value of R?
Ans
R=110

5
6. (20 points) Suppose four active nodes, A, B, C, and D, are competing for access to a channel
using slotted ALOHA. Assume each node has an infinite number of packets to send. Each node
attempts to transmit in each slot with probability p. The first slot is numbered slot 1, the second
6
slot is numbered slot 2, and so on.
(a) What is the probability that node A succeeds for the first time in slot 5?
(b) What is the probability that some node (either A, B, C, or D) succeeds in slot 4?
(c) What is the probability that the first success occurs in slot 3?
(d) What is the efficiency of this four-node system?

ANS
a) (1 – p(A))4 p(A)
where, p(A) = probability that A succeeds in a slot
p(A) = p(A transmits and B does not and C does not and D does not)
= p(A transmits) p(B does not transmit) p(C does not transmit) p(D does
not transmit)
= p(1 – p) (1 – p)(1-p) = p(1 – p)3

Hence, p(A succeeds for first time in slot 5)


= (1 – p(A))4 p(A) = (1 – p(1 – p)3)4 p(1 – p)3

b) p(A succeeds in slot 4) = p(1-p)3


p(B succeeds in slot 4) = p(1-p)3
p(C succeeds in slot 4) = p(1-p)3
p(D succeeds in slot 4) = p(1-p)3

p(either A or B or C or D succeeds in slot 4) = 4 p(1-p)3


(because these events are mutually exclusive)

c) p(some node succeeds in a slot) = 4 p(1-p)3


p(no node succeeds in a slot) = 1 - 4 p(1-p)3

Hence, p(first success occurs in slot 3) = p(no node succeeds in first 2 slots) p(some node
succeeds in 3rd slot) = (1 - 4 p(1-p)3)2 4 p(1-p)3

d) efficiency = p(success in a slot) =4 p(1-p)3

You might also like