Download Book answers

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Book answers:
http://www.sr2jr.com/textbook-solutions/computer-science/10402001/computer-networking-a-topdown-approach-the-network-layer
Chapter 4 Homework Solutions
Problem 1 (10 pts)
What is the difference between routing and forwarding?

Answer : The key differences between routing and forwarding is that forwarding is a router’s local
action of transferring packets from its input interfaces to its output interfaces and forwarding takes
place at very short timescales (typically a few nanoseconds), and thus is typically implemented in
hardware. Routing refers to the network-wide process that determines the end-to-end paths that
packets take from sources to destinations. Routing takes place on much longer timescales
(typically seconds) and is often implemented in software.
Problem 2 (10 pts)
What is the role of the forwarding table within a router?

Answer : To hold entries to determine the outgoing link interface to which an arriving packet will
be forwarded via switching fabric.
Problem 3 (10 pts)
Describe why each input port in a high-speed router stores a shadow copy of the forwarding table.

Answer : With the shadow copy, the forwarding lookup is made locally, at each input port,
without invoking the centralized routing processor. Such a decentralized approach avoids
creating a lookup processing bottleneck at a single point within the router.
Problem 4 (10 pts)
What is HOL blocking? Does it occur in input ports or output ports?

Answer : Sometimes a packet that is first in line at an input port queue must wait because there
is no available buffer space at the output port to which it wants to be forwarded. When this
occurs, all the packets behind the first packet are blocked, even if their output queues have room
to accommodate them. HOL blocking occurs at the input port.
Problem 5 (10 pts)
Visit a host that uses DHCP to obtain its IP address, network mask, default router, and IP address of its
local DNS server. List these values.

Answer will vary :
o IPv4 Address: 192.168.1.69
o Subnet Mask: 255.255.255.0
o Default Gateway: 192.168.1.1
o DHCP Server: 192.168.1.1
o DNS Servers: 192.168.1.1
Problem 6 (10 pts)
Suppose Host A sends Host B a TCP segment encapsulated in an IP datagram. When Host B receives
the datagram, how does the network layer in Host B know it should pass the segment (that is, the payload
of the datagram) to TCP rather than to UDP or to something else?

Answer : The 8-bit protocol field in the IP datagram contains information about which transport
layer protocol the destination host should pass the segment to.
Problem 7 (10 pts)
Compare and contrast the IPv4 and the IPv6 header fields. Do they have any fields in common?

Answer : IPv6 has a fixed length header, which does not include most of the options an IPv4
header can include. Even though the IPv6 header contains two 128-bit addresses (source and
destination IP address) the whole header has a fixed length of 40 bytes only. Several of the fields
are similar in spirit. Traffic class, payload length, next header and hop limit in IPv6 are
respectively like type of service, datagram length, upper-layer protocol and time to live in IPv4.
Problem 8 (10 pts)
Consider sending a 2400-byte datagram into a link that has an MTU of 700 bytes. Suppose the original
datagram is stamped with the identification number 422. How many fragments are generated? What are
the values in the various fields in the IP datagram(s) generated related to fragmentation?

Answer : 4 required fragments, since 2400 - 20 bytes for IP header => (2400-20)/680 = 4. The
max size of data field in each fragment will be 680 bytes, since the IP header is 20 bytes. Each
fragment, except the last one will be 700 bytes. Last fragment will be 360 bytes (including the 20
bytes IP header). The 4 offsets are 0, 85, 170, 255. First 3 flags are 1, last one is 0.
Problem 9 (20 pts)
Consider a router that interconnects three subnets: Subnet 1, Subnet 2, and Subnet 3. Suppose all of the
interfaces in each of these three subnets are required to have the prefix 223.1.17/24. Also suppose that
Subnet 1 is required to support at least 60 interfaces, Subnet 2 is to support at least 90 interfaces, and
Subnet 3 is to support at least 12 interfaces. Provide three network addresses (of the form a.b.c.d/x) that
satisfy these constraints.

Answer :
o 223.1.17.0/26
o 223.1.17.128/25
o 223.1.17.192/28
1. Consider sending a 3000 byte datagram into a link that has an MTU of 500 bytes. How many
fragments are generated? What are their characteristics (i.e. what are the flags and offset values
for each
Assume that the DF flag was not set : )
Assume that no optional fields of the IP header are in use (i.e. IP header is 20
bytes)
The original datagram was 3000 bytes, subtracting 20 bytes for header, that
leaves 2980 bytes of data.
Assume the ID of the original packet is 'x'
With an MTU of 500 bytes, 500 - 20 = 480 bytes of data may be transmitted in
each packet
Therefore, ceiling(2980 / 480) = 7 packets are needed to carry the data.
The packets will have the following characteristics (NOTE: offset is measured
in 8 byte blocks, you don't need to specify Total_len)
Packet 1: ID=x, Total_len=500, MF=1, Frag_offset=0
Packet 2: ID=x, Total_len=500, MF=1, Frag_offset=60
Packet 3: ID=x, Total_len=500, MF=1, Frag_offset=120
Packet 4: ID=x, Total_len=500, MF=1, Frag_offset=180
Packet 5: ID=x, Total_len=500, MF=1, Frag_offset=240
Packet 6: ID=x, Total_len=500, MF=1, Frag_offset=300
Packet 7: ID=x, Total_len=120, MF=0, Frag_offset=360
2. A router is blasting out IP packets whose total length (data plus header) is 1024 bytes. Assuming
that packets live for 10 seconds, what is the maximum line speed the router can operate at
without danger of cycling through the IP datagram ID number space? Now assume that packets
are 40 bytes long (e.g. IP and TCP but with no data), what is the new maximum line speed?
The IP datagram ID number space is 216 = 65535
Packet lifetime = 10 seconds
Therefore, a maximum of 65535 packets may be sent in 10 seconds. If any
more packets were to be sent within the 10 seconds, there would be multiple
live packets with the same ID.
floor(65535/10) = 6553 packets/sec
The maximum line speed @ 1024 bytes/packet is:
1024 bytes/packet * 6553 packets/sec * 8 bits/byte = 53,682,176 bps (~ 53.7
Mbps)
The maximum line speed @ 40 bytes/packet is:
40 bytes/packet * 6553 packets/sec * 8 bits/byte = 2,096,960 bps (~2.1 Mbps)
3. Suppose that instead of using 16 bits for the network part of a class B address originally, 20 bits
had been used. How many class B networks would there have been?
Class B networks range from 128-191 (or 64 possible values) over their first 8
bits. Therefore, the number of networks had class B used 20 bits to represent
the network part of the address would have been 64 * 212 = 262,144
Another way to think of this is that there are 2 [number of network bits - 2] addresses.
We subtract 2 because Class B address must start with 10 (in binary). Thus
there are 218 = 262,144 networks.
4. Can the following IP addresses be aggregated: 57.6.96.0/21, 57.6.104.0/21, 57.6.112.0/21,
57.6.120.0/21? If so, to what? If not, why not?
57.6.96.0
57.6.104.0
57.6.112.0
57.6.120.0
=
=
=
=
00111000
00111000
00111000
00111000
00000110
00000110
00000110
00000110
01100000
01101000
01110000
01111000
00000000
00000000
00000000
00000000
Note that these 4 IP addresses are adjecent in binary. Because of this, they can
be aggregated to:
57.6.96.0/19 = 00111000 00000110 01100000 00000000
5. If UCSB is allocated the range of addresses 128.111/16 and they want to divide it into 8 equal
groups of addresses, what exactly would the new ranges of addresses be?
128.111/16 = 10000000 01101111
To split an address range into 8 groups we need to use log2 8 = 3 bits, resulting
in:
128.111.0/19
128.111.32/19
128.111.64/19
128.111.96/19
128.111.128/19
128.111.160/19
128.111.192/19
128.111.224/19
=
=
=
=
=
=
=
=
10000000
10000000
10000000
10000000
10000000
10000000
10000000
10000000
01101111
01101111
01101111
01101111
01101111
01101111
01101111
01101111
00000000
00100000
01000000
01100000
10000000
10100000
11000000
11100000
6. Explain how traceroute works. Include a traceroute to a host at least 20 hops away.
Traceroute transmits packets with small TTL values. Recall that the TTL (Time
To Live) is an IP header field that is designed to prevent packets from running
in loops. Every router that handles a packet subtracts one from the packet's
TTL. If the TTL reaches zero, the packet has expired and is discarded.
Traceroute depends on the common router practice of sending an ICMP Time
Exceeded message, documented in RFC 792, back to the sender when this
occurs. By using small TTL values which quickly expire, traceroute causes
routers along a packet's normal delivery path to generate these ICMP
messages which identify the router. A TTL value of one should produce a
message from the first router; a TTL value of two generates a message from
the second; etc. Here is a traceroute to a host at least 20 hops away:
$ traceroute iitkgp.ernet.in
traceroute: Warning: iitkgp.ernet.in has multiple addresses; using
202.141.127.2traceroute to iitkgp.ernet.in (202.141.127.2), 30 hops
max, 38 byte packets
1 csworld43 (128.111.43.1) 14.072 ms 1.448 ms 1.302 ms
2 128.111.235.1 (128.111.235.1) 2.156 ms 4.469 ms 1.912 ms
3 556-NOC-556-c.noc.ucsb.edu (128.111.4.65) 1.479 ms 3.376
ms 0.913 ms
4 574-c.noc.ucsb.edu (128.111.2.19) 3.636 ms 4.275 ms 1.545 ms
5 gsr-ngb.commserv.ucsb.edu (128.111.252.153) 1.345 ms 4.358
ms 1.879 ms
6 border1-g-1-0-0.commserv.ucsb.edu (128.111.252.149) 1.770
ms 4.407 ms 2.158 ms
7 teanet-qanh-far.commserv.ucsb.edu (128.111.252.10) 13.318
ms 4.928 ms 5.578 ms
8 bur-edge-01.inet.qwest.net (65.119.29.93) 8.644 ms 6.570
ms 6.764 ms
9 bur-core-01.inet.qwest.net (205.171.13.13) 8.925 ms 7.008
ms 7.161 ms
10 lax-core-01.inet.qwest.net (205.171.8.41) 8.218 ms 9.144
ms 6.761 ms
11 lax-brdr-01.inet.qwest.net (205.171.19.38) 13.481 ms 7.421
ms 7.254 ms
12 so3-1-0-622M.br1.LAX1.gblx.net (208.50.13.9) 15.233 ms 7.610
ms 7.220 ms
13 pos2-1-155M.cr2.LAX1.gblx.net (206.132.112.121) 13.052 ms 7.868
ms 8.239 ms
14 pos1-0-622M.cr2.NYC2.gblx.net (206.132.249.170) 76.944 ms 76.532
ms 76.565 ms
15 so7-0-0-2488M.ar2.NYC2.gblx.net (64.215.195.170) 76.859 ms 77.772
ms 77.042 ms
16 TelecomItaliaMumbiNYC4.so-2-3-3.ar2.NYC2.gblx.net
(64.211.60.250) 275.347 ms 275.070 ms 274.573 ms
17 202.54.2.189 (202.54.2.189) 280.670 ms 282.561 ms 281.847 ms
18 202.54.2.174 (202.54.2.174) 301.437 ms 301.736 ms 302.358 ms
19 203.197.119.1 (203.197.119.1) 302.292 ms 301.906 ms 301.967 ms
20 202.54.55.165 (202.54.55.165) 484.014 ms 361.006 ms 336.702 ms
21 iitkgp.iitkgp.ernet.in (203.197.98.10) 342.921 ms 334.959 ms *
7. Use the shortest path simulation applet from the web
page:http://www.cs.uwa.edu.au/undergraduate/courses/230.300/readings/graphapplet/dijkstra.
html
o Can you design a network with unreachable nodes? Why or why not?
Yes, if a node has no incoming links and it is not the source, it will not
be reachable by any other node.
8.
o
Design a network in which the shortest path found from node a to node b is six hops while
the minimal hop path is only three hops. Print your network and turn it in with your
assignment.