Solutions
Solutions
3. Forwarding is about moving a packet from a router’s input port to the appropriate
output port. Routing is about determining the end-to-routes between sources and
destinations.
4. Yes, both use forwarding tables. For descriptions of the tables, see Section 4.2.
7. 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.
9. If the rate at which packets arrive to the fabric exceeds switching fabric rate, then
packets will need to queue at the input ports. If this rate mismatch persists, the queues
will get larger and larger and eventually overflow the input port buffers, causing
packet loss. Packet loss can be eliminated if the switching fabric speed is at least n
times as fast as the input line speed, where n is the number of input ports.
10. Assuming input and output line speeds are the same, packet loss can still occur if the
rate at which packets arrive to a single output port exceeds the line speed. If this rate
mismatch persists, the queues will get larger and larger and eventually overflow the
output port buffers, causing packet loss. Note that increasing switch fabric speed
cannot prevent this problem from occurring.
11. HOL blocking: Sometimes the 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.
14. Students will get different correct answers for this question.
17. The 8-bit protocol field in the IP datagram contains information about which transport
layer protocol the destination host should pass the segment to.
18. 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.
19. 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 similar to type of service, datagram
length, upper-layer protocol and time to live in IPv4.
20. Yes, because the entire IPv6 datagram (including header fields) is encapsulated in an
IPv4 datagram.
21. Link state algorithms: Computes the least-cost path between source and destination
using complete, global knowledge about the network. Distance-vector routing: The
calculation of the least-cost path is carried out in an iterative, distributed manner. A
node only knows the neighbor to which it should forward a packet in order to reach
given destination along the least-cost path, and the cost of that path from itself to the
destination.
22. Routers are organized into autonomous systems (ASs). Within an AS, all routers run
the same intra-AS routing protocol. The problem of scale is solved since an router in
an AS need only know about routers within its AS and the subnets that attach to the
AS. To route across ASes, the inter-AS protocol is based on the AS graph and does
not take individual routers into account.
23. No. Each AS has administrative autonomy for routing within an AS.
24. No. The advertisement tells D that it can get to z in 11 hops by way of A. However, D
can already get to z by way of B in 7 hops. Therefore, there is no need to modify the
entry for z in the table. If, on the other hand, the advertisement said that A were only
4 hops away from z by way of C, then D would indeed modify its forwarding table.
25. With OSPF, a router periodically broadcasts routing information to all other routers in
the AS, not just to its neighboring routers. This routing information sent by a router
has one entry for each of the router’s neighbors; the entry gives the distance from the
router to the neighbor. A RIP advertisement sent by a router contains information
about all the networks in the AS, although this information is only sent to its
neighboring routers.
27. Policy: Among ASs, policy issues dominate. It may well be important that traffic
originating in a given AS not be able to pass through another specific AS. Similarly, a
given AS may want to control what transit traffic it carries between other ASs. Within
an AS, everything is nominally under the same administrative control and thus policy
issues a much less important role in choosing routes with in AS.
Scale: The ability of a routing algorithm and its data structures to scale to handle
routing to/among large numbers of networks is a critical issue in inter-AS routing.
Within an AS, scalability is less of a concern. For one thing, if a single administrative
domain becomes too large, it is always possible to divide it into two ASs and perform
inter-AS routing between the two new ASs.
28. ISP C can use the BGP Multi-Exit Descriptor to suggest to ISP B that the preferred
route to ISP D is through the east coast peering point. For example, the east coast
BGP router in ISP C can advertise a route to D with an MED value of 5. The west
coast router in ISP C can advertise a route to D with an MED value of 10. Since a
lower value is preferred, ISP B knows that ISP C wants to receive traffic on the east
coast. In practice, a router can ignore the MED value, and so ISP B can still use hot
potato routing to pass traffic to ISP C destined to ISP D via the west coast peering
point.
29. A subnet is a portion of a larger network; a subnet does not contain a router; its
boundaries are defined by the router and host interfaces. A prefix is the network
portion of a CDIRized address; it is written in the form a.b.c.d/x ; A prefix covers one
or more subnets. When a router advertises a prefix across a BGP session, it includes
with the prefix a number of BGP attributes. In BGP jargon, a prefix along with its
attributes is a BGP route (or simply a route).
30. Routers use the AS-PATH attribute to detect and prevent looping advertisements;
they also use it in choosing among multiple paths to the same prefix. The NEXT-
HOP attribute indicates the IP address of the first router along an advertised path
(outside of the AS receiving the advertisement) to a given prefix. When configuring
its forwarding table, a router uses the NEXT-HOP attribute.
31. A tier-1 ISP B may not to carry transit traffic between two other tier-1 ISPs, say A
and C, with which B has peering agreements. To implement this policy, ISP B would
not advertise to A routes that pass through C; and would not advertise to C routes that
pass through A.
Efficiency: multiple copies of the same packet are sent over the same link for
potentially many links; source must generate multiple copies of same packet
Addressing: the source must discover the address of all the recipients
34. False
35. IGMP is a protocol run only between the host and its first-hop multicast router.
IGMP allows a host to specify (to the first-hop multicast router) the multicast group it
wants to join. It is then up to the multicast router to work with other multicast routers
(i.e., run a multicast routing protocol) to ensure that the data for the host-joined
multicast group is routed to the appropriate last-hop router and from there to the host.
36. In a group-shared tree, all senders send their multicast traffic using the same routing
tree. With source-based tree, the multicast datagrams from a given source are routed
over s specific routing tree constructed for that source; thus each source may have a
different source-based tree and a router may have to keep track of several source-
based trees for a given multicast group.
Chapter 4 Problems
Problem 1
a) With a connection-oriented network, every router failure will involve the routing of
that connection. At a minimum, this will require the router that is “upstream” from
the failed router to establish a new downstream part of the path to the destination
node, with all of the requisite signaling involved in setting up a path. Moreover, all
of the routers on the initial path that are downstream from the failed node must take
down the failed connection, with all of the requisite signaling involved to do this.
b) In order for a router to maintain an available fixed amount of capacity on the path
between the source and destination node for that source-destination pair, it would
need to know the characteristics of the traffic from all sessions passing through that
link. That is, the router must have per-session state in the router. This is possible in a
connection-oriented network, but not with a connectionless network. Thus, a
connection-oriented VC network would be preferable.
c) In this scenario, datagram architecture has more control traffic overhead. This is due
to the various packet headers needed to route the datagrams through the network. But
in VC architecture, once all circuits are set up, they will never change. Thus, the
signaling overhead is negligible over the long run.
Problem 2
a) Maximum number of VCs over a link = 28 = 256.
b) The centralized node could pick any VC number which is free from the set
{0,1,…,28-1}. In this manner, it is not possible that there are fewer VCs in progress
than 256 without there being any common free VC number.
c) Each of the links can independently allocate VC numbers from the set {0,1,…,28-1}.
Thus, a VC will likely have a different VC number for each link along its path. Each
router in the VC’s path must replace the VC number of each arriving packet with the
VC number associated with the outbound link.
Problem 3
For a VC forwarding table, the columns are : Incoming Interface, Incoming VC Number,
Outgoing Interface, Outgoing VC Number. For a datagram forwarding table, the columns
are: Destination Address, Outgoing Interface.
Problem 4
Note, that the two flows could actually have the same VC numbers.
Router B.
Incoming interface Incoming VC# Outgoing Interface Outgoing VC#
1 22 2 24
Router C.
Incoming interface Incoming VC# Outgoing Interface Outgoing VC#
1 18 2 50
Router D.
Incoming interface Incoming VC# Outgoing Interface Outgoing VC#
1 24 3 70
2 50 3 76
Problem 5
a) No VC number can be assigned to the new VC; thus the new VC cannot be
established in the network.
b) Each link has two available VC numbers. There are four links. So the number of
combinations is 24 = 16. One example combination is (10,00,00,10).
Problem 6
In a virtual circuit network, there is an end-to-end connection in the sense that each router
along the path must maintain state for the connection; hence the terminology connection
service. In a connection-oriented transport service over a connectionless network layer,
such as TCP over IP, the end systems maintain connection state; however the routers
have no notion of any connections; hence the terminology connection-oriented service.
Problem 7
a) No, you can only transmit one packet at a time over a shared bus.
b) Yes, as discussed in the text, as long as the two packets use different input busses
and different output busses, they can be forwarded in parallel.
c) No, in this case the two packets would have to be sent over the same output bus at the
same time, which is not possible.
Problem 8
a) (n-1)D
b) (n-1)D
c) 0
Problem 9
Largest number of slots is still 3. Actually, based on the assumption that a non-empty
input queue is never idle, we see that the first time slot always consists of sending X in
the top input queue and Y in either middle or bottom input queue, and in the second time
slot, we can always send two more datagram, and the last datagram can be sent in third
time slot.
NOTE: Actually, if the first datagram in the bottom input queue is X, then the worst case
would require 4 time slots.
Problem 10
a)
Prefix Match Link Interface
11100000 00 0
11100000 01000000 1
1110000 2
11100001 1 3
otherwise 3
Problem 11
01000000
through 1
01011111
01100000
through 2
01111111
10000000
through 2
10111111
11000000
through 3
11111111
26 64
32
number of addresses for interface 0 =
25
25 64 32 96
number of addresses for interface 1 =
26
64
number of addresses for interface 2 =
number of addresses for interface 3 = 26
Problem 12
11000000
through (32 addresses) 0
11011111
10000000
through(64 addresses) 1
10111111
11100000
through (32 addresses) 2
11111111
00000000
through (128 addresses) 3
01111111
Problem 13
223.1.17.0/26
223.1.17.128/25
223.1.17.192/28
Problem 14
200.23.16/21 0
200.23.24/24 1
200.23.24/21 2
otherwise 3
Problem 15
Problem 17
Router 1
Router 2
Router 3
Problem 18
The IP address blocks of Polytechnic Institute of New York University are:
No, the whois services cannot be used to determine with certainty the geographical
location of a specific IP address.
2400 20
The maximum size of data field in each fragment = 680 (because there are 20 bytes IP
header). Thus the number of required fragments 4
680
Each fragment will have Identification number 422. Each fragment except the last one
will be of size 700 bytes (including IP header). The last datagram will be of size 360
bytes (including IP header). The offsets of the 4 fragments will be 0, 85, 170, 255. Each
of the first 3 fragments will have flag=1; the last fragment will have flag=0.
Problem 20
MP3 file size = 5 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
5 10 6
Number of datagrams required 3425 . All but the last datagram will be 1,500
1460
bytes; the last datagram will be 960+40 = 1000 bytes. Note that here there is no
fragmentation – the source host does not create datagrams larger than 1500 bytes, and
these datagrams are smaller than the MTUs of the links.
Problem 21
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, 4000 192.168.1.1, 3345
24.34.112.235, 4001 192.168.1.1, 3346
24.34.112.235, 4002 192.168.1.2, 3445
24.34.112.235, 4003 192.168.1.2, 3446
24.34.112.235, 4004 192.168.1.3, 3545
24.34.112.235, 4005 192.168.1.3, 3546
Problem 22
a) Since all IP packets are sent outside, so we can use a packet sniffer to record all IP
packets generated by the hosts behind a NAT. As each host generates a sequence of
IP packets with sequential numbers and a distinct (very likely, as they are randomly
chosen from a large space) initial identification number (ID), we can group IP packets
with consecutive IDs into a cluster. The number of clusters is the number of hosts
behind the NAT.
For more practical algorithms, see the following papers.
b) However, if those identification numbers are not sequentially assigned but randomly
assigned, the technique suggested in part (a) won’t work, as there won’t be clusters in
sniffed data.
Problem 23
It is not possible to devise such a technique. In order to establish a direct TCP connection
between Arnold and Bernard, either Arnold or Bob must initiate a connection to the
other. But the NATs covering Arnold and Bob drop SYN packets arriving from the WAN
side. Thus neither Arnold nor Bob can initiate a TCP connection to the other if they are
both behind NATs.
Problem 24
y-x-u, y-x-v-u, y-x-w-u, y-x-w-v-u,
y-w-u, y-w-v-u, y-w-x-u, y-w-x-v-u, y-w-v-x-u,
y-z-w-u, y-z-w-v-u, y-z-w-x-u, y-z-w-x-v-u, y-z-w-v-x-u,
Problem 25
x to z:
x-y-z, x-y-w-z,
x-w-z, x-w-y-z,
x-v-w-z, x-v-w-y-z,
x-u-w-z, x-u-w-y-z,
x-u-v-w-z, x-u-v-w-y-z
z to u:
z-w-u,
z-w-v-u, z-w-x-u, z-w-v-x-u, z-w-x-v-u, z-w-y-x-u, z-w-y-x-v-u,
z-y-x-u, z-y-x-v-u, z-y-x-w-u, z-y-x-w-y-u, z-y-x-v-w-u,
z-y-w-v-u, z-y-w-x-u, z-y-w-v-x-u, z-y-w-x-v-u, z-y-w-y-x-u, z-y-w-y-x-v-u
z to w:
z-w, z-y-w, z-y-x-w, z-y-x-v-w, z-y-x-u-w, z-y-x-u-v-w, z-y-x-v-u-w
Problem 26
Problem 27
a)
Step N’ D(x), p(x) D(u),p(u) D(v),p(v) D(w),p(w) D(y),p(y) D(z),p(z)
b)
Step N’ D(x), p(x) D(t),p(t) D(v),p(v) D(w),p(w) D(y),p(y) D(z),p(z)
d)
Step N’ D(x), p(x) D(u),p(u) D(v),p(v) D(t),p(t) D(y),p(y) D(z),p(z)
e)
Step N’ D(x), p(x) D(u),p(u) D(v),p(v) D(w),p(w) D(t),p(t) D(z),p(z)
f)
Step N’ D(x), p(x) D(u),p(u) D(v),p(v) D(w),p(w) D(y),p(y) D(t),p(t)
z 8,z ∞ ∞ ∞ 12,z ∞
zx 8,z ∞ 11,x 14,x 12,z ∞
zxv 8,z 14,v 11,x 14,x 12,z 15,v
zxvy 8,z 14,v 11,x 14,x 12,z 15,v
zxvyu 8,z 14,v 11,x 14,x 12,z 15,v
zxvyuw 8,z 14,v 11,x 14,x 12,z 15,v
zxvyuwt 8,z 14,v 11,x 14,x 12,z 15,v
Problem 28
Cost to
u v x y z
v ∞ ∞ ∞ ∞ ∞
From x ∞ ∞ ∞ ∞ ∞
z ∞ 6 2 ∞ 0
Cost to
u v x y z
v 1 0 3 ∞ 6
From x ∞ 3 0 3 2
z 7 5 2 5 0
Cost to
u v x y z
v 1 0 3 3 5
From x 4 3 0 3 2
z 6 5 2 5 0
Cost to
u v x y z
v 1 0 3 3 5
From x 4 3 0 3 2
z 6 5 2 5 0
Problem 29
The wording of this question was a bit ambiguous. We meant this to mean, “the number
of iterations from when the algorithm is run for the first time” (that is, assuming the only
information the nodes initially have is the cost to their nearest neighbors). We assume
that the algorithm runs synchronously (that is, in one step, all nodes compute their
distance tables at the same time and then exchange tables).
At each iteration, a node exchanges distance tables with its neighbors. Thus, if you are
node A, and your neighbor is B, all of B's neighbors (which will all be one or two hops
from you) will know the shortest cost path of one or two hops to you after one iteration
(i.e., after B tells them its cost to you).
Let d be the “diameter” of the network - the length of the longest path without loops
between any two nodes in the network. Using the reasoning above, after d 1 iterations,
all nodes will know the shortest path cost of d or fewer hops to all other nodes. Since
path with the loops removed), the algorithm will converge in at most d 1 iterations.
any path with greater than d hops will have loops (and thus have a greater cost than that
ASIDE: if the DV algorithm is run as a result of a change in link costs, there is no a priori
bound on the number of iterations required until convergence unless one also specifies a
bound on link costs.
Problem 30
a) Dx(w) = 2, Dx(y) = 4, Dx(u) = 7
b) First consider what happens if c(x,y) changes. If c(x,y) becomes larger or smaller (as
long as c(x,y) >=1) , the least cost path from x to u will still have cost at least 7. Thus
a change in c(x,y) (if c(x,y)>=1) will not cause x to inform its neighbors of any
If c(x,y)= <1, then the least cost path now passes through y and has cost +6.
changes.
c) Any change in link cost c(x,y) (and as long as c(x,y) >=1) will not cause x to inform
its neighbors of a new minimum-cost path to u .
Problem 31
Node x table
Cost to
x y z
x 0 3 4
From y ∞ ∞ ∞
z ∞ ∞ ∞
Cost to
x y z
x 0 3 4
From y 3 0 6
z 4 6 0
Node y table
Cost to
x y z
x ∞ ∞ ∞
From y 3 0 6
z ∞ ∞ ∞
Cost to
x y z
x 0 3 4
From y 3 0 6
z 4 6 0
Node z table
Cost to
x y z
x ∞ ∞ ∞
From y ∞ ∞ ∞
z 4 6 0
Cost to
x y z
x 0 3 4
From y 3 0 6
z 4 6 0
Problem 32
NO, this is because that decreasing link cost won’t cause a loop (caused by the next-hop
relation of between two nodes of that link). Connecting two nodes with a link is
equivalent to decreasing the link weight from infinite to the finite weight.
Problem 33
At each step, each updating of a node’s distance vectors is based on the Bellman-Ford
equation, i.e., only decreasing those values in its distance vector. There is no increasing
in values. If no updating, then no message will be sent out. Thus, D(x) is non-increasing.
Since those costs are finite, then eventually distance vectors will be stabilized in finite
steps.
Problem 34
a)
b) Yes, there will be a count-to-infinity problem. The following table shows the routing
converging process. Assume that at time t0, link cost change happens. At time t1, y
updates its distance vector and informs neighbors w and z. In the following table,
“” stands for “informs”.
time t0 t1 t2 t3 t4
Z w, Dz(x)= No change w, Dz(x)=
y, Dz(x)=6 y, Dz(x)=11
W y, Dw(x)= y, Dw(x)= No change
z, Dw(x)=5 z, Dw(x)=10
w, Dy(x)=4 w, Dy(x)=9 w, Dy(x)=14
z, Dy(x)=4 z, Dy(x)= z, Dy(x)=
Y No change
via w,
time t27 t28 t29 t30 t31
Z w, Dz(x)=50
y, Dz(x)=50 via y, 55
via w,
via z, 50
y, Dw(x)= y, Dw(x)=51
z, Dw(x)= via y,
W
z, Dw(x)=50
w, Dy(x)=
via z, 51
w, Dy(x)=53
z, Dy(x)=
Y via w, 52
z, Dy(x)= 52 via y, 60
via z, 53
c) cut the link between y and z.
Problem 35
Since full AS path information is available from an AS to a destination in BGP, loop
detection is simple – if a BGP peer receives a route that contains its own AS number in
the AS path, then using that route would result in a loop.
Problem 36
The chosen path is not necessarily the shortest AS-path. Recall that there are many issues
to be considered in the route selection process. It is very likely that a longer loop-free
path is preferred over a shorter loop-free path due to economic reason. For example, an
AS might prefer to send traffic to one neighbor instead of another neighbor with shorter
AS distance.
Problem 37
a) eBGP
b) iBGP
c) eBGP
d) iBGP
Problem 38
a) I1 because this interface begins the least cost path from 1d towards the gateway router
1c.
b) I2. Both routes have equal AS-PATH length but I2 begins the path that has the closest
NEXT-HOP router.
Problem 39
One way for C to force B to hand over all of B’s traffic to D on the east coast is for C to
only advertise its route to D via its east coast peering point with C.
Problem 40
B x B x
w A w A
C y C y
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.
Problem 41
Problem 42
Problem 43
Since Z wants to transit Y's traffic, Z will send route advertisements to Y. In this manner,
when Y has a datagram that is destined to an IP that can be reached through Z, Y will
have the option of sending the datagram through Z. However, if Z advertizes routes to Y,
Y can re-advertize those routes to X. Therefore, in this case, there is nothing Z can do
from preventing traffic from X to transit through Z.
Problem 44
Problem 45
The 32 receives are shown connected to the sender in the binary tree configuration shown
above. With network-layer broadcast, a copy of the message is forwarded over each link
exactly once. There are thus 62 link crossings (2+4+8+16+32). With unicast emulation,
the sender unicasts a copy to each receiver over a path with5 hops. There are thus 160
link crossings (5*32).
A topology in which all receivers are in a line, with the sender at one end of the line, will
have the largest disparity between the cost of network-layer broadcast and unicast
emulation.
Problem 46
A
B
c
D
F E
G
The thicker shaded lines represent
The shortest path tree from A to all
destination. Other solutions are
possible, but in these solutions, B
can not route to either C or D from A.
Problem 47
A
B
c
D
F E
Problem 48
y t
v
x
u
w
Problem 49
The center-based tree for the topology shown in the original figure connects A to C; B to
C; E to C; and F to C (all directly). D connects to C via E, and G connects to C via D, E.
This center-based tree is different from the minimal spanning tree shown in the figure.
Problem 50
The center-based tree for the topology shown in the original figure connects t to v; u to v;
w to v; x to v; and y to v (all directly). And z connected to v via x. This center-based tree
is different from the minimal spanning tree.
Problem 51
Dijkstra’s algorithm for the network below, with node A as the source, results in a least-
unicast-cost path tree of links AC, AB, and BD, with an overall free cost of 20. The
minimum spanning tree contains links AB, BD, and DC, at a cost of 11.
10 c 1
A D
9 1
B
Problem 52
After 1 step 3 copies are transmitted, after 2 steps 6 copies are transmitted. After 3 steps,
12 copies are transmitted, and so on. After k steps, 3*2k-1 copies will be transmitted in
that step.
3
6
12
24
48
…
Problem 53
The protocol must be built at the application layer. For example, an application may
periodically multicast its identity to all other group members in an application-layer
message.
Problem 54
A simple application-layer protocol that will allow all members to know the identity of
all other members in the group is for each instance of the application to send a multicast
message containing its identity to all other members. This protocol sends message in-
band, since the multicast channel is used to distribute the identification messages as well
as multicast data from the application itself. The use of the in-band signaling makes use
of the existing multicast distribution mechanism, leading to a very simple design.
Problem 55
32 4 28 bits are available for multicast addresses. Thus, the size of the multicast
address space is N 2 28 .
N ( N 1) ( N 2) ( N 999) 1 2 999
The probability that 1000 groups all have different addresses is
1 1 1
N N N
1000
N
2. Although each link guarantees that an IP datagram sent over the link will be received
at the other end of the link without errors, it is not guaranteed that IP datagrams will
arrive at the ultimate destination in the proper order. With IP, datagrams in the same
TCP connection can take different routes in the network, and therefore arrive out of
order. TCP is still needed to provide the receiving end of the application the byte
stream in the correct order. Also, IP can lose packets due to routing loops or
equipment failures.
3. Framing: there is also framing in IP and TCP; link access; reliable delivery: there is
also reliable delivery in TCP; flow control: there is also flow control in TCP; error
detection: there is also error detection in IP and TCP; error correction; full duplex:
TCP is also full duplex.
4. There will be a collision in the sense that while a node is transmitting it will start to
receive a packet from the other node.
6. After the 5th collision, the adapter chooses from {0, 1, 2,…, 31}. The probability that
it chooses 4 is 1/32. It waits 204.8 microseconds.
7. In polling, a discussion leader allows only one participant to talk at a time, with each
participant getting a chance to talk in a round-robin fashion. For token ring, there isn’t
a discussion leader, but there is wine glass that the participants take turns holding. A
participant is only allowed to talk if the participant is holding the wine glass.
8. When a node transmits a frame, the node has to wait for the frame to propagate
around the entire ring before the node can release the token. Thus, if L/R is small as
compared to tprop, then the protocol will be inefficient.
10. C’s adapter will process the frames, but the adapter will not pass the datagrams up the
protocol stack. If the LAN broadcast address is used, then C’s adapter will both
process the frames and pass the datagrams up the protocol stack.
11. An ARP query is sent in a broadcast frame because the querying host does not which
adapter address corresponds to the IP address in question. For the response, the
sending node knows the adapter address to which the response should be sent, so
there is no need to send a broadcast frame (which would have to be processed by all
the other nodes on the LAN).
12. No it is not possible. Each LAN has its own distinct set of adapters attached to it, with
each adapter having a unique LAN address.
15. In 802.1Q there is a 12- bit VLAN identifier. Thus 212 = 4,096 VLANs can be
supported.
16. We can string the N switches together. The first and last switch would use one port
for trunking; the middle N-2 switches would use two ports. So the total number of
ports is 2+ 2(N-2) = 2N-2 ports.
Chapter 5 Problems
Problem 1
11101
01100
10010
11011
11000
Problem 2
Suppose we begin with the initial two-dimensional parity matrix:
0000
1111
0101
1010
With a bit error in row 2, column 3, the parity of row 2 and column 3 is now wrong in the
matrix below:
0000
1101
0101
1010
Now suppose there is a bit error in row 2, column 2 and column 3. The parity of row 2 is
now correct! The parity of columns 2 and 3 is wrong, but we can't detect in which rows
the error occurred!
0000
1001
0101
1010
The above example shows that a double bit error can be detected (if not corrected).
Problem 3
01001100 01101001
+ 01101110 01101011
------------------------------
10111010 11010100
+ 00100000 01001100
------------------------------
11011011 00100000
+ 01100001 01111001
-----------------------------
00111100 10011010 (overflow, then wrap around)
+ 01100101 01110010
------------------------------
10100010 00001100
The one's complement of the sum is 01011101 11110011
Problem 4
a) To compute the Internet checksum, we add up the values at 16-bit quantities:
00000001 00000010
00000011 00000100
00000101 00000110
00000111 00001000
00001001 00001010
-------------------------
00011001 00011110
01100010 01100011
01100100 01100101
01100110 01100111
01101000 01101001
01101010 01101011
-------------------------
00000000 00000101
The one's complement of the sum is 11111111 11111010.
Problem 5
Problem 6
Problem 7
a) Without loss of generality, suppose ith bit is flipped, where 0<= i <= d+r-1 and
assume that the least significant bit is 0th bit.
A single bit error means that the received data is K=D*2r XOR R + 2i. It is clear that
if we divide K by G, then the reminder is not zero. In general, if G contains at least
two 1’s, then a single bit error can always be detected.
b) The key insight here is that G can be divided by 11 (binary number), but any number
of odd-number of 1’s cannot be divided by 11. Thus, a sequence (not necessarily
contiguous) of odd-number bit errors cannot be divided by 11, thus it cannot be
divided by G.
Problem 8
E ( p) Np(1 p) N 1
a)
E ' ( p ) 0 p*
1
N
b)
(1
1 N
E ( p*) N (1 ) N 1 (1 ) N 1
)
1 1 1 N
1
N N N 1
N
lim (1 ) 1 lim (1 )
1 1 N 1
N N N N e
Thus
lim E ( p*)
1
N e
Problem 9
E ( p) Np(1 p) 2( N 1)
E ' ( p) N (1 p) 2( N 2) Np2( N 1)(1 p) 2( N 3)
N (1 p) 2( N 3) ((1 p) p2( N 1))
E ' ( p) 0 p*
1
2N 1
E ( p*) (1 ) 2( N 1)
N 1
2N 1 2N 1
lim E ( p*)
1 1 1
N 2 e 2e
Problem 10
c) A’s throughput is 2p(1-p)N-1, and any other node has throughput p(1-p)N-2(1-2p).
Problem 11
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(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
N (Q / R d poll ) .
The length of a polling round is
Problem 14
C E
A 192.168.1.001
00-00-00-00-00-00 192.168.2.001 192.168.3.001
44-44-44-44-44-44 77-77-77-77-77-77
c)
1. Forwarding table in E determines that the datagram should be routed to interface
192.168.3.002.
2. The adapter in E creates and Ethernet packet with Ethernet destination address 88-
88-88-88-88-88.
3. Router 2 receives the packet and extracts the datagram. The forwarding table in
this router indicates that the datagram is to be routed to 198.162.2.002.
4. Router 2 then sends the Ethernet packet with the destination address of 33-33-33-
33-33-33 and source address of 55-55-55-55-55-55 via its interface with IP
address of 198.162.2.003.
5. The process continues until the packet has reached Host B.
d) ARP in E must now determine the MAC address of 198.162.3.002. Host E sends out
an ARP query packet within a broadcast Ethernet frame. Router 2 receives the query
packet and sends to Host E an ARP response packet. This ARP response packet is
carried by an Ethernet frame with Ethernet destination address 77-77-77-77-77-77.
Problem 15
a) No. E can check the subnet prefix of Host F’s IP address, and then learn that F is on
the same LAN. Thus, E will not send the packet to the default router R1.
Ethernet frame from E to F:
Source IP = E’s IP address
Destination IP = F’s IP address
Source MAC = E’s MAC address
Destination MAC = F’s MAC address
b) No, because they are not on the same LAN. E can find this out by checking B’s IP
address.
Ethernet frame from E to R1:
Source IP = E’s IP address
Destination IP = B’s IP address
Source MAC = E’s MAC address
Destination MAC = The MAC address of R1’s interface connecting to Subnet 3.
c) Switch S1 will broadcast the Ethernet frame via both its interfaces as the received
ARP frame’s destination address is a broadcast address. And it learns that A resides
on Subnet 1 which is connected to S1 at the interface connecting to Subnet 1. And, S1
will update its forwarding table to include an entry for Host A.
Yes, router R1 also receives this ARP request message, but R1 won’t forward the
message to Subnet 3.
B won’t send ARP query message asking for A’s MAC address, as this address can
be obtained from A’s query message.
Once switch S1 receives B’s response message, it will add an entry for host B in its
forwarding table, and then drop the received frame as destination host A is on the
same interface as host B (i.e., A and B are on the same LAN segment).
Problem 16
Lets call the switch between subnets 2 and 3 S2. That is, router R1 between subnets 2 and
3 is now replaced with switch S2.
a) No. E can check the subnet prefix of Host F’s IP address, and then learn that F is on
the same LAN segment. Thus, E will not send the packet to S2.
Ethernet frame from E to F:
Source IP = E’s IP address
Destination IP = F’s IP address
Source MAC = E’s MAC address
Destination MAC = F’s MAC address
b) Yes, because E would like to find B’s MAC address. In this case, E will send an ARP
query packet with destination MAC address being the broadcast address.
This query packet will be re-broadcast by switch 1, and eventually received by Host
B.
Ethernet frame from E to S2:
Source IP = E’s IP address
Destination IP = B’s IP address
Source MAC = E’s MAC address
Destination MAC = broadcast MAC address: FF-FF-FF-FF-FF-FF.
c) Switch S1 will broadcast the Ethernet frame via both its interfaces as the received
ARP frame’s destination address is a broadcast address. And it learns that A resides
on Subnet 1 which is connected to S1 at the interface connecting to Subnet 1. And, S1
will update its forwarding table to include an entry for Host A.
Yes, router S2 also receives this ARP request message, and S2 will broadcast this
query packet to all its interfaces.
B won’t send ARP query message asking for A’s MAC address, as this address can
be obtained from A’s query message.
Once switch S1 receives B’s response message, it will add an entry for host B in its
forwarding table, and then drop the received frame as destination host A is on the
same interface as host B (i.e., A and B are on the same LAN segment).
Problem 17
Wait for 51,200 bit times. For 10 Mbps, this wait is
Problem 19
Time, t Event
0 A and B begin transmission
245 A and B detect collision
293 A and B finish transmitting jam signal
293+245 = 538 B 's last bit arrives at A ; A detects an idle channel
538+96=634 A starts transmitting
Problem 20
P(Y m) (1 ) m1 ,
a) Let Y be a random variable denoting the number of slots until a success:
1
x E[ X ] E[Y ] 1
Np(1 p) N 1
1 Np(1 p ) N 1
x
Np(1 p ) N 1
k k
kx 1 Np(1 p ) N 1
k
efficiency Np(1 p ) N 1
b)
c)
efficiency
k
1 (1
1 N 1
k
)
N
(1
1 N 1
)
N
lim efficiency
1 1/ e k e 1
k k
k
N
1/ e
approaches 1 as k .
k
k e 1
d) Clearly,
Problem 21
C E
A 111.111.111.001
00-00-00-00-00-00 122.222.222.001 133.333.333.001
44-44-44-44-44-44 77-77-77-77-77-77
ii) from the left router to the right router: Source MAC address: 33-33-33-33-33-33
Destination MAC address: 55-55-55-55-55-55
Source IP: 111.111.111.001
Destination IP: 133.333.333.003
Problem 22
Problem 23
If all the 11=9+2 nodes send out data at the maximum possible rate of 100 Mbps, a total
aggregate throughput of 11*100 = 1100 Mbps is possible.
Problem 24
Each departmental hub is a single collision domain that can have a maximum throughput
of 100 Mbps. The links connecting the web server and the mail server has a maximum
throughput of 100 Mbps. Hence, if the three collision domains and the web server and
mail server send out data at their maximum possible rates of 100 Mbps each, a maximum
total aggregate throughput of 500 Mbps can be achieved among the 11 end systems.
Problem 25
All of the 11 end systems will lie in the same collision domain. In this case, the
maximum total aggregate throughput of 100 Mbps is possible among the 11 end sytems.
Problem 26
Problem 27
a) The time required to fill L 8 bits is
L 8
sec m sec .
L
128 10 3
16
L 8 40
c) Store-and-forward delay
R
1500 8 40
sec 19.4 sec
622 106
packetization delay for L 1500 is too large for real-time voice applications.
d) Store-and-forward delay is small for both cases for typical link speeds. However,
Problem 28
The IP addresses for those three computers (from left to right) in EE department are:
111.111.1.1, 111.111.1.2, 111.111.1.3. The subnet mask is 111.111.1/24.
The IP addresses for those three computers (from left to right) in CS department are:
111.111.2.1, 111.111.2.2, 111.111.2.3. The subnet mask is 111.111.2/24.
The router’s interface card that connects to port 1 can be configured to contain two sub-
interface IP addresses: 111.111.1.0 and 111.111.2.0. The first one is for the subnet of EE
department, and the second one is for the subnet of CS department. Each IP address is
associated with a VLAN ID. Suppose 111.111.1.0 is associated with VLAN 11, and
111.111.2.0 is associated with VLAN 12. This means that each frame that comes from
subnet 111.111.1/24 will be added an 802.1q tag with VLAN ID 11, and each frame that
comes from 111.111.2/24 will be added an 802.1q tag with VLAN ID 12.
Suppose that host A in EE department with IP address 111.111.1.1 would like to send an
IP datagram to host B (111.111.2.1) in CS department. Host A first encapsulates the IP
datagram (destined to 111.111.2.1) into a frame with a destination MAC address equal to
the MAC address of the router’s interface card that connects to port 1 of the switch. Once
the router receives the frame, then it passes it up to IP layer, which decides that the IP
datagram should be forwarded to subnet 111.111.2/24 via sub-interface 111.111.2.0.
Then the router encapsulates the IP datagram into a frame and sends it to port 1. Note that
this frame has an 802.1q tag VLAN ID 12. Once the switch receives the frame port 1, it
knows that this frame is destined to VLAN with ID 12, so the switch will send the frame
to Host B which is in CS department. Once Host B receives this frame, it will remove the
802.1q tag.
Problem 29
in out out
label label dest interf.
in out out
label label dest interf. 7 10 A 0 in out out
label label dest interf.
7 A 0 12 D 0
5 8 A 1 10 6 A 1
12 9 D 0
0
R6
0 0
D
1 1
0 R4 R3
R5
in out out 0 0
A
label label dest interf.
5 A 0 R2 R1
in out out
label label dest interf. in out out
label label dest inter.
8 6 A 0
6 - A 0
Problem 30
in out out
label label dest interf.
in out out
label label dest interf. 3 12 D 0 in out out
label label dest interf.
3 D 0 2 4 D 1
12 - D 0
0
R6
0 0
D
1 1
0 R4 R3
R5 1
in out out 0
label label dest interf.
A
2 D 0 R2 R1
in out out
label label dest interf. in out out
label label dest inter.
4 1 D 0
1 12 D 1
Problem 31
(The following description is short, but contains all major key steps and key protocols
involved.)
Your computer first uses DHCP to obtain an IP address. You computer first creates a
special IP datagram destined to 255.255.255.255 in the DHCP server discovery step, and
puts it in a Ethernet frame and broadcast it in the Ethernet. Then following the steps in
the DHCP protocol, you computer is able to get an IP address with a given lease time.
A DHCP server on the Ethernet also gives your computer a list of IP addresses of first-
hop routers, the subnet mask of the subnet where your computer resides, and the
addresses of local DNS servers (if they exist).
Since your computer’s ARP cache is initially empty, your computer will use ARP
protocol to get the MAC addresses of the first-hop router and the local DNS server.
Your computer first will get the IP address of the Web page you would like to download.
If the local DNS server does not have the IP address, then your computer will use DNS
protocol to find the IP address of the Web page.
Once your computer has the IP address of the Web page, then it will send out the HTTP
request via the first-hop router if the Web page does not reside in a local Web server. The
HTTP request message will be segmented and encapsulated into TCP packets, and then
further encapsulated into IP packets, and finally encapsulated into Ethernet frames. Your
computer sends the Ethernet frames destined to the first-hop router. Once the router
receives the frames, it passes them up into IP layer, checks its routing table, and then
sends the packets to the right interface out of all of its interfaces.
Then your IP packets will be routed through the Internet until they reach the Web server.
The server hosting the Web page will send back the Web page to your computer via
HTTP response messages. Those messages will be encapsulated into TCP packets and
then further into IP packets. Those IP packets follow IP routes and finally reach your
first-hop router, and then the router will forward those IP packets to your computer by
encapsulating them into Ethernet frames.
Problem 32
a) Each flow evenly shares a link’s capacity with other flows traversing that link, then the
80 flows crossing the B to access-router 10 Gbps links (as well as the access router to
border router links) will each only receive 10 Gbps / 80 = 125 Mbps
b) In Topology of Figure 5.31, there are four distinct paths between the first and third
tier-2 switches, together providing 40 Gbps for the traffic from racks 1-4 to racks 9-12.
Similarly, there are four links between second and fourth tier-2 switches, together
providing 40 Gbps for the traffic from racks 5-8 to 13-16. Thus the total aggregate
bandwidth is 80 Gbps, and the value per flow rate is 1 Gbps.
c) Now 20 flows will need to share each 1 Gbps bandwidth between pairs of TOR
switches. So the host-to-host bit rate will be 0.5 Gbps.
Problem 33
a) Both email and video application uses the fourth rack for 0.1 percent of the time.
c) Suppose the first three racks are for video, the next rack is a shared rack for both
video and email, and the next three racks are for email. Let's assume that the fourth
rack has all the data and software needed for both the email and video applications.
With the topology of Figure 5.31, both applications will have enough intra-bandwidth
as long as both are not simultaneously using the fourth rack. From part b, both are
using the fourth rack for no more than .00001 % of time, which is within the .0001%
requirement.
Chapter 6 Review Questions
1. In infrastructure mode of operation, each wireless host is connected to the larger
network via a base station (access point). If not operating in infrastructure mode, a
network operates in ad-hoc mode. In ad-hoc mode, wireless hosts have no
infrastructure with which to connect. In the absence of such infrastructure, the hosts
themselves must provide for services such as routing, address assignment, DNS-like
name translation, and more.
3. Path loss is due to the attenuation of the electromagnetic signal when it travels
through matter. Multipath propagation results in blurring of the received signal at the
receiver and occurs when portions of the electromagnetic wave reflect off objects and
ground, taking paths of different lengths between a sender and receiver. Interference
from other sources occurs when the other source is also transmitting in the same
frequency range as the wireless network.
5. APs transmit beacon frames. An AP’s beacon frames will be transmitted over one of
the 11 channels. The beacon frames permit nearby wireless stations to discover and
identify the AP.
6. False
7. APs transmit beacon frames. An AP’s beacon frames will be transmitted over one of
the 11 channels. The beacon frames permit nearby wireless stations to discover and
identify the AP.
8. False
9. Each wireless station can set an RTS threshold such that the RTS/CTS sequence is
used only when the data frame to be transmitted is longer than the threshold. This
ensures that RTS/CTS mechanism is used only for large frames.
10. No, there wouldn’t be any advantage. Suppose there are two stations that want to
transmit at the same time, and they both use RTS/CTS. If the RTS frame is as long as
a DATA frames, the channel would be wasted for as long as it would have been
wasted for two colliding DATA frames. Thus, the RTS/CTS exchange is only useful
when the RTS/CTS frames are significantly smaller than the DATA frames.
11. Initially the switch has an entry in its forwarding table which associates the wireless
station with the earlier AP. When the wireless station associates with the new AP, the
new AP creates a frame with the wireless station’s MAC address and broadcasts the
frame. The frame is received by the switch. This forces the switch to update its
forwarding table, so that frames destined to the wireless station are sent via the new
AP.
12. Any ordinary Bluetooth node can be a master node whereas access points in 802.11
networks are special devices (normal wireless devices like laptops cannot be used as
access points).
13. False
14. “Opportunistic Scheduling” refers to matching the physical layer protocol to channel
conditions between the sender and the receiver, and choosing the receivers to which
packets will be sent based on channel condition. This allows the base station to make
best use of the wireless medium.
16. No. A node can remain connected to the same access point throughout its connection
to the Internet (hence, not be mobile). A mobile node is the one that changes its point
of attachment into the network over time. Since the user is always accessing the
Internet through the same access point, she is not mobile.
17. A permanent address for a mobile node is its IP address when it is at its home
network. A care-of-address is the one its gets when it is visiting a foreign network.
The COA is assigned by the foreign agent (which can be the edge router in the
foreign network or the mobile node itself).
18. False
19. The home network in GSM maintains a database called the home location register
(HLR), which contains the permanent cell phone number and subscriber profile
information about each of its subscribers. The HLR also contains information about
the current locations of these subscribers. The visited network maintains a database
known as the visitor location register (VLR) that contains an entry for each mobile
user that is currently in the portion of the network served by the VLR. VLR entries
thus come and go as mobile users enter and leave the network.
The edge router in home network in mobile IP is similar to the HLR in GSM and the
edge router in foreign network is similar to the VLR in GSM.
20. Anchor MSC is the MSC visited by the mobile when a call first begins; anchor MSC
thus remains unchanged during the call. Throughout the call’s duration and regardless
of the number of inter-MSC transfers performed by the mobile, the call is routed from
the home MSC to the anchor MSC, and then from the anchor MSC to the visited
MSC where the mobile is currently located.
Chapter 6 Problems
Problem 1
Problem 2
Problem 3
Problem 4
Problem 5
a) The two APs will typically have different SSIDs and MAC addresses. A wireless
station arriving to the café will associate with one of the SSIDs (that is, one of the
APs). After association, there is a virtual link between the new station and the AP.
Label the APs AP1 and AP2. Suppose the new station associates with AP1. When the
new station sends a frame, it will be addressed to AP1. Although AP2 will also
receive the frame, it will not process the frame because the frame is not addressed to
it. Thus, the two ISPs can work in parallel over the same channel. However, the two
ISPs will be sharing the same wireless bandwidth. If wireless stations in different
ISPs transmit at the same time, there will be a collision. For 802.11b, the maximum
aggregate transmission rate for the two ISPs is 11 Mbps.
b) Now if two wireless stations in different ISPs (and hence different channels) transmit
at the same time, there will not be a collision. Thus, the maximum aggregate
transmission rate for the two ISPs is 22 Mbps for 802.11b.
Problem 6
Suppose that wireless station H1 has 1000 long frames to transmit. (H1 may be an AP
that is forwarding an MP3 to some other wireless station.) Suppose initially H1 is the
only station that wants to transmit, but that while half-way through transmitting its first
frame, H2 wants to transmit a frame. For simplicity, also suppose every station can hear
every other station’s signal (that is, no hidden terminals). Before transmitting, H2 will
sense that the channel is busy, and therefore choose a random backoff value.
Now suppose that after sending its first frame, H1 returns to step 1; that is, it waits a short
period of times (DIFS) and then starts to transmit the second frame. H1’s second frame
will then be transmitted while H2 is stuck in backoff, waiting for an idle channel. Thus,
H1 should get to transmit all of its 1000 frames before H2 has a chance to access the
channel. On the other hand, if H1 goes to step 2 after transmitting a frame, then it too
chooses a random backoff value, thereby giving a fair chance to H2. Thus, fairness was
the rationale behind this design choice.
Problem 7
A frame without data is 32 bytes long. Assuming a transmission rate of 11 Mbps, the time
to transmit a control frame (such as an RTS frame, a CTS frame, or an ACK frame) is
(256 bits)/(11 Mbps) = 23 usec. The time required to transmit the data frame is (8256
bits)/(11 Mbps) = 751
Problem 8
a) 1 message/ 2 slots
b) 2 messages/slot
c) 1 message/slot
d) i) 1 message/slot
ii) 2 messages/slot
iii) 2 messages/slot
e) i) 1 message/4 slots
ii) slot 1: Message A B, message D C
slot 2: Ack B A
slot 3: Ack C D
= 2 messages/ 3 slots
iii)
slot 1: Message C D
slot 2: Ack DC, message A B Repeat
slot 3: Ack B A
= 2 messages/3 slots
Problem 10
a) 10 Mbps if it only transmits to node A. This solution is not fair since only A is getting
served. By “fair” it means that each of the four nodes should be allotted equal number
of slots.
b) For the fairness requirement such that each node receives an equal amount of data
during each downstream sub-frame, let n1, n2, n3, and n4 respectively represent the
number of slots that A, B, C and D get.
Now,
data transmitted to A in 1 slot = 10t Mbits
(assuming the duration of each slot to be t)
Hence,
Total amount of data transmitted to A (in n1 slots) = 10t n1
Similarly total amounts of data transmitted to B, C, and D equal to 5t n2, 2.5t n3, and
t n4 respectively.
Now, to fulfill the given fairness requirement, we have the following condition:
10t n1 = 5t n2 = 2.5t n3 = t n4
Hence,
n2 = 2 n1
n3 = 4 n1
n4 = 10 n1
Now, the total number of slots is N. Hence,
n1+ n2+ n3+ n4 = N
i.e. n1+ 2 n1 + 4 n1 + 10 n1 = N
i.e. n1 = N/17
Hence,
n2 = 2N/17
n3 = 4N/17
n4 = 10N/17
The average transmission rate is given by:
c) Let node A receives twice as much data as nodes B, C, and D during the sub-frame.
Hence,
10tn1 = 2 * 5tn2 = 2 * 2.5tn3 = 2 * tn4
i.e. n2 = n1
n3 = 2n1
n4 = 5n1
Again,
n1 + n2 + n3 + n4 = N
i.e. n 1+ n1 + 2n1 + 5n1 = N
i.e. n1 = N/9
Problem 11
a) No. All the routers might not be able to route the datagram immediately. This is
because the Distance Vector algorithm (as well as the inter-AS routing protocols like
BGP) is decentralized and takes some time to terminate. So, during the time when the
algorithm is still running as a result of advertisements from the new foreign network,
some of the routers may not be able to route datagrams destined to the mobile node.
b) Yes. This might happen when one of the nodes has just left a foreign network and
joined a new foreign network. In this situation, the routing entries from the old
foreign network might not have been completely withdrawn when the entries from the
new network are being propagated.
c) The time it takes for a router to learn a path to the mobile node depends on the
number of hops between the router and the edge router of the foreign network for the
node.
Problem 12
If the correspondent is mobile, then any datagrams destined to the correspondent would
have to pass through the correspondent’s home agent. The foreign agent in the
network being visited would also need to be involved, since it is this foreign agent that
notifies the correspondent’s home agent of the location of the correspondent. Datagrams
received by the correspondent’s home agent would need to be encapsulated/tunneled
between the correspondent’s home agent and foreign agent, (as in the case of the
encapsulated diagram at the top of Figure 6.23.
Problem 13
Because datagrams must be first forward to the home agent, and from there to the mobile,
the delays will generally be longer than via direct routing. Note that it is possible,
however, that the direct delay from the correspondent to the mobile (i.e., if the datagram
is not routed through the home agent) could actually be smaller than the sum of the delay
from the correspondent to the home agent and from there to the mobile. It would depend
on the delays on these various path segments. Note that indirect routing also adds a home
agent processing (e.g., encapsulation) delay.
Problem 14
First, we note that chaining was discussed at the end of section 6.5. In the case of
chaining using indirect routing through a home agent, the following events would
The mobile node arrives at A, A notifies the home agent that the mobile is now
happen:
visiting A and that datagrams to the mobile should now be forwarded to the
The mobile node moves to B. The foreign agent at B must notify the foreign
specified care-of-address (COA) in A.
The mobile node arrives at A, A notifies the home agent that the mobile is now
In the case that chaining is not used, the following events would happen:
visiting A and that datagrams to the mobile should now be forwarded to the
The mobile node moves to B. The foreign agent at B must notify the foreign
specified care-of-address (COA) in A.
agent at A and the home agent that the mobile is no longer resident in A but in
fact is resident in B and has the specified COA in B. The foreign agent in A can
remove its state about the mobile, since it is no longer in A. From then on, the
home agent will forward datagrams it receives that are addressed to the mobile’s
The mobile node moves to C. The foreign agent at C must notify the foreign
COA in B.
agent at B and the home agent that the mobile is no longer resident in B but in fact
is resident in C and has the specified COA in C. The foreign agent in B can
remove its state about the mobile, since it is no longer in B. From then on, the
home agent will forward datagrams it receives that are addressed to the mobile’s
COA in C.
When the mobile goes offline or returns to its home network, the datagram-forwarding
state maintained by the foreign agent in C must be removed. This teardown must also be
done through signaling messages. Note that the home agent is always aware of the
mobile’s current foreign network. However, the correspondent is still blissfully unaware
of the mobile’s mobility.
Problem 15
Two mobiles could certainly have the same care-of-address in the same visited network.
Indeed, if the care-of-address is the address of the foreign agent, then this address would
be the same. Once the foreign agent decapsulates the tunneled datagram and determines
the address of the mobile, then separate addresses would need to be used to send the
datagrams separately to their different destinations (mobiles) within the visited network.
Problem 16
If the MSRN is provided to the HLR, then the value of the MSRN must be updated in the
HLR whenever the MSRN changes (e.g., when there is a handoff that requires the MSRN
to change). The advantage of having the MSRN in the HLR is that the value can be
provided quickly, without querying the VLR. By providing the address of the VLR
Rather than the MSRN), there is no need to be refreshing the MSRN in the HLR.
Chapter 7 Review Questions
1.
Bit rate Bytes transferred in 67
mins
Facebook Frank 40 kbps 20 Mbytes
Martha Music 200 kbps 100 Mbytes
Victor Video 4 Mbps 2 Gbytes
3. Quantizing a sample into 1024 levels means 10 bits per sample. The resulting rate of
the PCM digital audio signal is 160 Kbps.
Streaming Live Audio and Video: These applications allow users to receive a live
radio or television transmission over the Internet. Today, thousands of radio and
television stations around the world are broadcasting content over the internet.
5. UDP Streaming: With UDP streaming, the server transmits video at a rate that
matches the client’s video consumption rate by clocking out the video chunks over
UDP at a steady rate.
HTTP Streaming: In HTTP streaming, the video simply stored in an HTTP server as
ordinary file with a specific URL. When a user wants to see the video, the client
establishes a TCP connection with the server and issues an HTTP GET request for
that URL. The server then sends the video file, within an HTTP response message, as
quickly as possible, that is, as quickly as TCP congestion control and flow control
will allow.
Adaptive HTTP Streaming (DASH): In Dynamic Adaptive Streaming over HTTP, the
video is encoded several different versions, with each version having a different bit
rate and, correspondingly, a different quality level. The client dynamically requests
the chunks of video segments of a few seconds in length from the different versions.
When the amount of available bandwidth is high, the client naturally selects chunks
from a high-rate version; and when the available bandwidth is low, it naturally selects
from a low-rate version.
7. No. On the client side, the client application reads bytes from the TCP receive buffer
and places the bytes in the client application buffer.
9. Enter Deep: This philosophy is to enter deep into the access networks of Internet
Service Providers, by deploying server clusters in access ISPs all over the world.
Bring Home: A second design philosophy is to bring the ISP’s home by building
large clusters at a smaller number of key locations and connecting these clusters using
a private high-speed network.
10. Geographically closest cluster selection and real time measurements selection can
find a good cluster with respect to LDNS. IP anycast chooses good cluster with
respect to client itself.
11. Load on the cluster – clients should not be directed to overload clusters.
ISP delivery cost – the clusters may be chosen so that specific ISPs are used to carry
CDN-to-client traffic, taking into account the different cost structures in the
contractual relationships between ISPs and cluster operators.
12. End-to-end delay is the time it takes a packet to travel across the network from source
to destination. Delay jitter is the fluctuation of end-to-end delay from packet to the
next packet.
13. A packet that arrives after its scheduled play out time cannot be played out.
Therefore, from the perspective of the application, the packet has been lost.
14. First scheme: send a redundant encoded chunk after every n chunks; the redundant
chunk is obtained by exclusive OR-ing the n original chunks. Second scheme: send a
lower-resolution low-bit rate scheme along with the original stream. Interleaving does
not increase the bandwidth requirements of a stream.
15. RTP streams in different sessions: different multicast addresses; RTP streams in the
same session: SSRC field; RTP packets are distinguished from RTCP packets by
using distinct port numbers.
16. The role of a SIP registrar is to keep track of the users and their corresponding IP
addresses which they are currently using. Each SIP registrar keeps track of the users
that belong to its domain. It also forwards INVITE messages (for users in its domain)
to the IP address which the user is currently using. In this regard, its role is similar to
that of an authoritative name server in DNS.
18. A scheduling discipline that is not work conserving is time division multiplexing,
whereby a rotating frame is partitioned into slots, with each slot exclusively available
to a particular class.
19. FIFO: line at Starbucks. RR: merging traffic (taking 1 vehicle from first lane then 1
from the second, then 1 from the first, and so on). WFQ: ticket counter at airport
providing service to 2 people from first class and 1 from economy, and again 2 from
first class, and so on.
Chapter 8 Review Questions
1. Confidentiality is the property that the original plaintext message can not be
determined by an attacker who intercepts the ciphertext-encryption of the original
plaintext message. Message integrity is the property that the receiver can detect
whether the message sent (whether encrypted or not) was altered in transit. The two
are thus different concepts, and one can have one without the other. An encrypted
message that is altered in transmit may still be confidential (the attacker can not
determine the original plaintext) but will not have message integrity if the error is
undetected. Similarly, a message that is altered in transit (and detected) could have
been sent in plaintext and thus would not be confidential.
2. User’s laptop and a web server; (ii) two routers; (iii) two DNS name servers.
3. One important difference between symmetric and public key systems is that in
symmetric key systems both the sender and receiver must know the same (secret) key.
In public key systems, the encryption and decryption keys are distinct. The
encryption key is known by the entire world (including the sender), but the decryption
key is known only by the receiver.
4. In this case, a known plaintext attack is performed. If, somehow, the message
encrypted by the sender was chosen by the attacker, then this would be a chosen-
plaintext attack.
5. An 8-block cipher has 28 possible input blocks. Each mapping is a permutation of the
28 input blocks; so there are 28! possible mappings; so there are 28! possible keys.
6. If each user wants to communicate with N other users, then each pair of users must
have a shared symmetric key. There are N*(N-1)/2 such pairs and thus there are
N*(N-1)/2 keys. With a public key system, each user has a public key which is
known to all, and a private key (which is secret and only known by the user). There
are thus 2N keys in the public key system.
8. 175
10. No. This is because a hash function is a one-way function. That is, given any hash
value, the original message cannot be recovered (given h such that h=H(m), one
cannot recover m from h).
11. This is scheme is clearly flawed. Trudy, an attacker, can first sniff the communication
and obtain the shared secret s by extracting the last portion of digits from H(m)+s.
Trudy can then masquerade as the sender by creating her own message t and send (t,
H(t)+s).
12. Suppose Bob sends an encrypted document to Alice. To be verifiable, Alice must be
able to convince herself that Bob sent the encrypted document. To be non-forgeable,
Alice must be able to convince herself that only Bob could have sent the encrypted
document (e.g.,, no one else could have guessed a key and encrypted/sent the
document) To be non-reputable, Alice must be able to convince someone else that
only Bob could have sent the document. To illustrate the latter distinction, suppose
Bob and Alice share a secret key, and they are the only ones in the world who know
the key. If Alice receives a document that was encrypted with the key, and knows
that she did not encrypt the document herself, then the document is known to be
verifiable and non-forgeable (assuming a suitably strong encryption system was
used). However, Alice cannot convince someone else that Bob must have sent the
document, since in fact Alice knew the key herself and could have encrypted/sent the
document.
13. A public-key signed message digest is “better” in that one need only encrypt (using
the private key) a short message digest, rather than the entire message. Since public
key encryption with a technique like RSA is expensive, it’s desirable to have to sign
(encrypt) a smaller amount of data than a larger amount of data.
14. This is false. To create the certificate, certifier.com would include a digital signature,
which is a hash of foo.com’s information (including its public key), and signed with
certifier.com’s private key.
15. For a MAC-based scheme, Alice would have to establish a shared key with each
potential recipient. With digital signatures, she uses the same digital signature for
each recipient; the digital signature is created by signing the hash of the message with
her private key. Digital signatures are clearly a better choice here.
16. The purpose of the nonce is to defend against the replay attack.
17. Once in a lifetimes means that the entity sending the nonce will never again use that
value to check whether another entity is “live”.
18. In a man-in-the-middle attack, the attacker puts himself between Alice and Bob,
altering the data sent between them. If Bob and Alice share a secret authentication
key, then any alterations will be detected.
19. Alice provides a digital signature, from which Bob can verify that message came
from Alice. PGP uses digital signatures, not MACs, for message integrity.
21. The purpose of the random nonces in the handshake is to defend against the
connection replay attack.
22. True. The IV is always sent in the clear. In SSL, it is sent during the SSL handshake.
23. After the client will generate a pre-master secret (PMS), it will encrypt it with Alice’s
public key, and then send the encrypted PMS to Trudy. Trudy will not be able to
decrypt the PMS, since she does not have Alice’s private key. Thus Trudy will not be
able to determine the shared authentication key. She may instead guess one by
choosing a random key. During the last step of the handshake, she sends to Bob a
MAC of all the handshake messages, using the guessed authentication key. When
Bob receives the MAC, the MAC test will fail, and Bob will end the TCP connection.
24. False. Typically an IPsec SA is first established between Host A and Host B. Then all
packets in the stream use the SA.
25. False. IPsec will increment the sequence number for every packet it sends.
27. 01011100
28. True
29. Filter table and connection table. The connection table keeps track of connections,
allowing for a finer degree of packet filtering.
30. True
31. True
32. If there isn’t a packet filter, than users inside the institution’s network will still be
able to make direct connections to hosts outside the institution’s network. The filter
forces the users to first connect to the application gateway.
33. True
Chapter 8 Problems
Problem 1
The encoding of “This is an easy problem” is “uasi si my cmiw lokngch”.
The decoding of “rmij'u uamu xyj” is “wasn't that fun”.
Problem 2
If Trudy knew that the words “bob” and “alice” appeared in the text, then she would
know the ciphertext for b,o,a,l,i,c,e (since “bob” is the only palindrome in the message,
and “alice” is the only 5-letter word. If Trudy knows the ciphertext for 7 of the letters,
then she only needs to try 19!, rather than 26!, plaintext-ciphertext pairs. The difference
between 19! and 26! is 26*25*24...*20, which is 3315312000, or approximately 109.
Problem 3
Every letter in the alphabet appears in the phrase “The quick fox jumps over the lazy
brown dog.” Given this phrase in a chosen plaintext attack (where the attacker has both
the plain text, and the ciphertext), the Caesar cipher would be broken - the intruder would
know the ciphertext character for every plaintext character. However, the Vigenere
cipher does not alway translate a given plaintext character to the same ciphertext
character each time, and hence a Vigenere cipher would not be immediately broken by
this chosen plaintext attack.
Problem 4
a) The output is equal to 00000101 repeated eight times.
b) The output is equal to 00000101 repeated seven times + 10000101.
c) We have (ARBRCR)R = CBA, where A, B, C are strings, and R means inverse
operation. Thus:
1. For (a), the output is 10100000 repeated eight times;
2. For (b), the output is 10100001 + 10100000 repeated seven times.
Problem 5
a) There are 8 tables. Each table has 28 entries. Each entry has 8 bits.
number of tables * size of each table * size of each entry = 8*28* 8= 214 bits
b) There are 264 entries. Each entry has 64 bits. 271 bits
Problem 6
a) 100100100 ==> 011011011
b) Trudy will know the three block plaintexts are the same.
c) c(i) = KS(m(i) XOR c(i-1))
c(1) = KS(100 XOR 111) = KS (011) = 100
c(2) = KS(100 XOR 100) = KS (000) = 110
c(1) = KS(100 XOR 110) = KS (010) = 101
Problem 7
a) We are given p 3 and q 11. We thus have n 33 and q 11. Choose e 9 (it
might be a good idea to give students a hint that 9 is a good value to choose, since the
We first consider each letter as a 5-bit number: 00100, 01111, 00111. Now we
concatenate each letter to get 001000111100111 and encrypt the resulting decimal
number m=4583. The concatenated decimal number m (= 4583) is larger than current
n (= 33). We need m < n. So we use p = 43, q = 107, n = p*q = 4601, z = (p-1)(q-1)
= 4452. e = 61, d = 73
m**e= 21386577601828057804089602156530567188611499869029788733808438
804302864595620613956725840720949764845640956118784875246785033236197
777129730258961756918400292048632806197527785447791567255101894492820
972508185769802881718983
c**d
= 1283813313619771634195712132539793287643533147482536209328405262793
027158861012392053287249633570967493122280221453815012934241370540204
5814598714979387232141014703227794586499817945633390592
p = 5, q = 11
a) n = p*q = 55, z = (p-1)(q-1) = 40
b) e = 3 is less than n and has no common factors with z.
c) d = 27
d) m = 8, me = 512, Ciphertext c= me mod n = 17
Problem 9
Alice Bob
secrect key: SA SB
public key: TA = (g^SA) mod p TB = (g^SB) mod p
shared key: S = (TB^SA) mod p S' = (TA^SB ) mod p
(b and c) p = 11, g = 2
Alice Bob
secrect key: SA= 5 SB = 12
public key: TA = (g^SA) mod p = 10 TB = (g^SB) mod p = 4
shared key: S = (TB^SA) mod p = 1 S' = (TA^SB ) mod p = 1
d)
TT TB
Problem 10
KDC Bob
Alice
KA-KDC{A,B}
KB-KDC(A, K)
Problem 11
The message
I O U 1
9 0 . 9
0 B O B
Problem 12
S2
S1
H(.)
KS2 (m,h) KS2 (m,h) m
(m,h) encription Internet Decription (m,h) Compare
m +
algorithm algorithm
H(.) S2
S1
Problem 13
The file is broken into blocks of equal size. For each block, calculate the hash (for
example with MD5 or SHA-1). The hashes for all of the blocks are saved in the .torrent
file. Whenever a peer downloads a block, it calculates the hash of this block and
compares it to the hash in the .torrent file. If the two hashes are equal, the block is valid.
Otherwise, the block is bogus, and should be discarded.
Problem 14
Digital signatures require an underlying Public Key Infrastructure (PKI) with certification
authorities. For OSPF, all routers are in a same domain, so the administrator can easily
deploy the symmetric key on each router, without the need of a PKI.
Problem 15
Bob does not know if he is talking to Trudy or Alice initially. Bob and Alice share a
secret key KA-B that is unknown to Trudy. Trudy wants Bob to authenticate her (Trudy)
as Alice. Trudy is going to have Bob authenticate himself, and waits for Bob to start:
1. Bob-to-Trudy: “I am Bob” Commentary: Bob starts to authenticate himself. Bob’s
authentication of himself to the other side then stops for a few steps.
2. Trudy-to-Bob: “I am Alice” Commentary: Trudy starts to authenticate herself as
Alice
3. Bob-to-Trudy: “R” Commentary: Bob responds to step 2 by sending a nonce in
reply. Trudy does not yet know KA-B(R) so she can not yet reply.
4. Trudy-to-Bob: “R” Commentary: Trudy responds to step 1 now continuing Bob’s
authentication, picking as the nonce for Bob to encrypt, the exact same value that
Bob sent her to encrypt in Step 3.
5. Bob-to-Trudy: “KA-B(R)” Bob completes his own authentication of himself to the
other side by encrypting the nonce he was sent in step 4. Trudy now has KA-B(R).
(Note: she does not have, nor need, KA-B
6. Trudy-to-Bob: “KA-B(R)” Trudy completes her authentication, responding to the R
that Bob sent in step 3 above with KA-B(R). Since Trudy has returned the properly
encrypted nonce that Bob send in step 3, Bob thinks Trudy is Alice!
Problem 16
This wouldn't really solve the problem. Just as Bob thinks (incorrectly) that he is
authenticating Alice in the first half of Figure 7.14, so too can Trudy fool Alice into
thinking (incorrectly) that she is authenticating Bob. The root of the problem that neither
Bob nor Alice can tell is the public key they are getting is indeed the public key of Alice
of Bob.
Problem 17
KS(m,KA-(H(m)) KA+( )
KS( ) -
KB+( KS), KS(m,KA-(H(m)))
Internet - KS m
KB-( )
H( )
KB+( KS)
compare
Figure: Operations performed by Bob for confidentiality, integrity, and
authentication
Problem 18
a) No, without a public-private key pair or a pre-shared secret, Bob cannot verify that
Alice created the message.
b) Yes, Alice simply encrypts the message with Bob’s public key and sends the
encrypted message to Bob.
Problem 19
a) Client
b) IP: 216.75.194.220, port: 443
c) 283
d) 3 SSL records
e) Yes, it contains an encrypted master secret
f) First byte: bc; Last byte: 29
g) 6
Problem 20
Again we suppose that SSL does not provide sequence numbers. Suppose that Trudy, a
woman-in-the-middle, deletes a TCP segment. So that Bob doesn’t anything, Trudy needs
to also adjust the sequence numbers in the subsequent packets sent from Alice to Bob,
and the acknowledgment numbers sent from Bob to Alice. The result will be that Bob
will, unknowingly, be missing a packet’s worth of bytes in the byte stream.
Problem 21
No, the bogus packet will fail the integrity check (which uses a shared MAC key).
Problem 22
a) F
b) T
c) T
d) F
Problem 23
If Trudy does not bother to change the sequence number, R2 will detect the duplicate
when checking the sequence number in the ESP header. If Trudy increments the sequence
number, the packet will fail the integrity check at R2.
Problem 24
Given, m = 10100000
Hence, ICV = 1010 XOR 0000 = 1010
The three fields will be:
IV: 11
Encrypted message: 10100000 XOR 11111010 = 01011010
Encrypted ICV: 1010 XOR 0000 = 1010
b) The receiver extracts the IV (11) and generates the key stream 111110100000
……….
XORs the encrypted message with the key stream to recover the original message:
01011010 XOR 11111010 = 10100000
XORs the encrypted ICV with the keystream to recover the original ICV:
The receiver then XORs the first 4 bits of recovered message with its last 4 bits:
1010 XOR 0000 = 1010 (which equals the recovered ICV)
c) Since the ICV is calculated as the XOR of first 4 bits of message with last 4 bits of
message, either the 1st bit or the 5th bit of the message has to be flipped for the
received packet to pass the ICV check.
Problem 25
Filter Table:
Connection Table:
199.1.205.23 37654 23
222.22.93.2
a)
Alice Proxy1
+
K1 (S1)
b)
Alice Proxy1 Proxy2
S1( K2+(S2))
K2+(S2)
c)
Alice Proxy1 Proxy2 Activist.com
S1(S2(req))
S2(req)
req
page
S1(S2(page)) S2(page)