Network_Answers
Network_Answers
Answer: The TCP segment is of size 1,020 bytes. Therefore, we will need 3 IP packets
of sizes 520, 520 and 40 bytes.
Answer: Forwarding is about moving a packet from a router’s input link to the
appropriate output link. Routing is about determining the end-to-routes between sources
and destinations.
3) Consider a VC network with a 2-bit filed for the VC number. Suppose that the
network wants to set up a virtual circuit over four links: link A, link B, lick C and link
D. Suppose that each of those links is currently carrying two other virtual circuits, and
the VC numbers of these other VCs are as follows:
Assume that each of the existing VCs may only traverse one of the four links.
a) If each VC is required to use the same VC number on all the four links along
its path, what VC number could be assigned to the new VC?
Answer: Notice that there is no one common VC number that is not being used
on all the four links. As a result, there is no VC number, which could be
assigned to the new VC. This example illustrates a problem associated with
having to pick a common VC number along the end-to-end of a virtual circuit.
4) Consider a datagram network using 8-bit host addresses. Suppose a router uses
longest-prefix matching and has the following forwarding table:
Computer Networks and Applications
For each of the four interfaces give the associated range of destination host addresses
and the number of addresses in the range.
Answer:
Destination Address Range Link Interface
00000000
through 0
00111111
01000000
through 1
01111111
10000000
through 2
10111111
11000000
through 3
11111111
5) The only entries in a certain route table are (128.59.28.0/22, port 0), (128.59.28.0/23,
port 1) and (128.59.28.0/24, port 2). These entries indicate CIDR network number, the
prefix indication and the corresponding port to which a packet should be forwarded. If a
packet arrives with a destination IP address equal to 128.59.29.18, which port will this
router will this router forward the packet to? (QUESTION FROM PREVIOUS EXAM)
Answer: The address of the IP packet matches 128.59.28.0 in the first 23 bits. The 24th
bit is different. Since we use the longest prefix match, the router will use the port
corresponding to 128.59.28.0/23 in its route table, and forward the packet to port 1.
6) Suppose datagrams are limited to 1,500 bytes (including header) between source
Host A and destination Host B. Assuming a 20-byte IP header and a 20-byte TCP
header, how many datagrams would be required to send an MP3 consisting of 4 million
bytes.
Answer: MP3 file size = 4 million bytes. Assume the data is carried in TCP segments,
with each TCP segment also having 20 bytes of header. Then each datagram can carry
1500-40=1460 bytes of the MP3 file.
Computer Networks and Applications
$ 4 % 10 6 "
Number of datagrams required = = # ! = 2740 . All but the last datagram will be
# 1460 !
1,500 bytes; the last datagram will be 1060+40 = 1100 bytes. Note that here there is not
fragmentation – the source host does not create datagrams larger than 1500 bytes, and
these datagrams are smaller than the MTUs of the links.
8) Suppose an ISP owns the block of addresses of the form 101.101.128/17. Suppose it
wants to create four subnets from this block, with each block having the same number
of IP addresses. What are the prefixes (of form a.b.c.d/x) for the four subnets?
9) Consider sending a 3,000 byte datagram into a link which has an MTU of 500 bytes.
Suppose the original datagram is stamped with the identification number 422. How
many fragments are generated? What are their characteristics?
Answer: The maximum size of data field in each fragment = 480 (20 bytes IP header).
$ 3000 % 20 "
Thus the number of required fragments = # =7
# 480 !!
Each fragment will have Identification number 422. Each fragment except the last one
will be of size 500 bytes (including IP header). The last datagram will be of size 120
bytes (including IP header). The offsets of the 7 fragments will be 0, 60, 120, 180, 240,
300, 360. Each of the first 6 fragments will have flag=1; the last fragment will have
flag=0.
B
1 4
3 10
A C E 1 F
3
1
4
4
D
Computer Networks and Applications
Answer:
The shortest path routes from F to all the destinations have been shown as thick lines in
the figure above.
Cost to
A C D E F
1 3 4 5 4
11) Suppose a peer with user name Arnold discovers through querying that a peer with
user name Bernard has a file it wants to download. Also suppose that Bernard is behind
a NAT whereas Arnold isn’t. Let 138.76.29.7 be the WAN-side address of the NAT and
let 10.0.0.1 be the internal IP address for Bernard. Assume that the NAT is not
specifically configured for the P2P application.
(a) Discuss why Arnold’s peer cannot initiate a TCP connection to Bernard’s
peer, even if Arnold knows the WAN-side address of the NAT, 138.76.29.7.
Answer: NAT will not have an entry for a connection initiated from the WAN
side, hence will drop incoming packets from Arnold.
(b) Now, suppose that Bernard has established an ongoing TCP connection to
another peer, Cindy who is not behind a NAT. Also suppose that Arnold
learned from Cindy that Bernard has the desired file and that Arnold can
establish (or already has established) a TCP connection with Cindy. Describe
how Arnold can use these two TCP connections (one from Bernard to Cindy
and the other from Arnold to Cindy) to instruct Bernard to initiate a direct
TCP connection (that is, not passing through Cindy) back to Arnold. This
technique is sometimes called connection reversal. Note that even though
Bernard is behind a NAT, Arnold can use this direct TCP connection to
request the file, and Bernard can use the connection to deliver the file.
Answer: Bernard can know the IP address of Arnold through Cindy. Then, the
p2p application can initiate a connection through NAT to Arnold and upload the
file.
Computer Networks and Applications
12) Consider the network shown below, and assume that each node initially knows the
costs to each of its neighbours, Consider the distance vector algorithm and show the
distance table entries at node z.
1
u v
5
2 15
z
10
2
y
x
1
Answer: The distance table in z is:
Cost to
u v x y z
From v 1 0 3 4 5
x 2 3 0 1 2
y 3 4 1 0 3
z 4 5 2 3 0
13) What is head of line blocking? Does it occur in input ports or output ports?
Answer: HOL blocking – a queued packet in an input queue must wait for transfer
through the fabric because it is blocked by another packet at the head of the line. It
occurs at the input port.
14) Suppose you purchase a wireless router/ADSL modem and connect it to your
telephone socket. Also suppose that your ISP dynamically assigns one IP address to
your connecting device (i.e. your router/modem). Also suppose that you have five PCs
at home that use 802.11 to wirelessly connect to your wireless router. How are IP
addresses assigned to five PCs? Does the wireless router use NAT? Why or why not?
Answer: Typically the wireless router includes a DHCP server. DHCP is used to assign
IP addresses to the 5 PCs and to the router interface. Yes, the wireless router also uses
NAT as it obtains only one IP address from the ISP.
15) Consider the following topology. Assign network addresses to each of these 6
subnets, with the following constraints:
• All addresses must be allocated from 214.97.254/23
• Subnet A should have enough addresses to support 250 interfaces
• Subnet B should have enough addresses to support 120 interfaces
• Subnet C should have enough addresses to support 120 interfaces
• Of course, subnets D, E and F should each be able to support 2 interfaces
For each subnet, the assignment should either take the form a.b.c.d/x or a.b.c.d/x –
e.f.g.h/y
Computer Networks and Applications
Now using the address assignments from above, provide the forwarding tables (using
longest prefix matching) for each of the three routers.
Subnet A
Subnet F
Subnet D
Subnet E
Subnet B
Subnet C
Answer:
To simplify the solution, assume that no datagrams have router interfaces as ultimate
destinations.
Router 1
Longest Prefix Match Outgoing Interface
11010110 01100001 11111111 Subnet A
11010110 01100001 11111110 0000000 Subnet D
11010110 01100001 11111110 000001 Subnet F
Computer Networks and Applications
Router 2
Longest Prefix Match Outgoing Interface
11010110 01100001 11111111 0000000 Subnet D
11010110 01100001 11111110 0 Subnet B
11010110 01100001 11111110 0000001 Subnet E
Router 3
Longest Prefix Match Outgoing Interface
11010110 01100001 11111111 000001 Subnet F
11010110 01100001 11111110 0000001 Subnet E
11010110 01100001 11111110 1 Subnet C