100% found this document useful (1 vote)
370 views7 pages

Routing Algorithms and Network Analysis

The document contains several numerical problems related to routing in computer networks. It provides solutions to routing problems involving concepts like flooding, distance vector routing, reverse path forwarding, subnet masks and IP addressing. It also includes questions on topics like traffic shaping, fragmentation, virtual circuits and IP address space utilization.

Uploaded by

devgarg792004
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
370 views7 pages

Routing Algorithms and Network Analysis

The document contains several numerical problems related to routing in computer networks. It provides solutions to routing problems involving concepts like flooding, distance vector routing, reverse path forwarding, subnet masks and IP addressing. It also includes questions on topics like traffic shaping, fragmentation, virtual circuits and IP address space utilization.

Uploaded by

devgarg792004
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Numericals on Routing

1. Consider the following network.

Suppose that it uses flooding as the routing algorithm. If a packet sent by A to D has a
maximum hop count of 3, list all the routes it will take. Also tell how many hops worth of
bandwidth it consumes.
Solution
It will follow all of the following routes:
ABCD, ABCF, ABEF, ABEG, AGHD, AGHF, and AGEB
The number of hops used is 24.

2. Consider the following network. Suppose that it uses flooding as the routing
algorithm. If a packet sent by A to G has a maximum hop count of 3, list all the routes
it will take. Also tell how many hops worth of bandwidth it consumes.

Solution
It will follow all of the following routes:
AEHK, AEHI, AFIH, AFIN, AFIJ, AFDC, AFDG
The number of hops used is 21

3. Consider a network (A, B, C, D, E, F) where distance vector routing is used. Router C has
received the following vectors from B(3, 0, 6, 8, 4, 2), D(12, 13, 5, 0, 8, 10) and F(8, 9, 7, 4, 4, 0).
Assume the delay links from C to B, D and F are 3, 2 and 1 respectively.
What will be C's routing table?

Solution

Router C has recived routing table from B, D and F.

Going via B gives (3 + 3, 0 + 3, 6 + 3, 8 + 3, 4 + 3, 2 + 3) = (6, 3, 9, 11, 7, 5)

Going via D gives ( 12 + 2, 13 + 2 + 2, 5 + 2, 0 + 2, 8 + 2, 10 + 2) = (14, 17, 7, 2, 10, 12)

Going via F gives (8 + 1, 9 + 1, 7 + 1, 4 + 1, 4 + 1, 0 + 1) = (9, 10, 8, 5, 5, 1)

Taking the minimum for each destination (A, B, C, D, E, F) except for C is (6, 3, 0, 2, 5, 1) via
(B, B, -, D, F, F).

3. Consider the following subnet. Apply Distance vector routing and find the distance
vector for each router

Step 1 : Create initial routing table for each router

For Router A For Router B

For Router C For Router D


Step2: Each router shares its routing table with its neighbours and
update its table using received tables and by finding minimum
distance using distance vector formula of bellman ford algorithm
e.g For router A
 Cost of reaching destination B from router A = min { 2+0 , 1+7 } = 2 via B.
 Cost of reaching destination C from router A = min { 2+3 , 1+11 } = 5 via B.
 Cost of reaching destination D from router A = min { 2+7 , 1+0 } = 1 via D.

Updated A table Similarly, updated B table

updated C table updated D table

So, distance vector of router A is (0,2,5,1)


distance vector of router B is (2,0,3,3)
distance vector of router C is (5,3,0,6)
distance vector of router D is (1,3,6,0)
If delays are recorded as 8-bit numbers in a 50-router network, and delay vectors are
exchanged twice a second, how much bandwidth per (full-duplex) line is chewed up by
the distributed routing algorithm? Assume that each router has three lines to other
routers.
ANS:
The routing table is 400 bits. Twice a second this table is written onto each line, so 800
bps are needed on each line in each direction.
(Chapter 5, Problem 14)

Looking at the following subnet, how many packets are generated by a broadcast from
B, using a) reverse path forwarding and b) the sink tree? Sketch diagrams.

ANS:
a) The reverse path forwarding algorithm takes five rounds to finish. The packet
recipients on these rounds are AC, DFIJ, DEGHHIIJKN, EFHLLMOO, GMLH,
respectively. A total of 28 packets are generated.
b) The sink tree needs four rounds and 14 packets.

(Chapter 5, Problem 38)

Convert the IP address whose hexadecimal representation is A44FF1BC to dotted


decimal notation.

ANS:
(A) 16=(1010)2
(4)16=(0100)2
(F)16=(1111)2
(1)16=(0001)2
(B) 16=(1011)2
(C) 16=(1100)2
(A44FF1BC)16=(10100100.01001111.11110001.10111100)2
(10100100)=27+25+22=128+32+4=(164)10
(01001111)=26+23+22+21+20=64+8+4+2+1=(79)10
(11110001)=27+26+25+24+20=128+64+32+16+1=(241)10
(10111100)= 27+25+24+23+22=128+32+16+8+4=(188)10
(A44FF1BC)16=[Link]

(Chapter 5, Problem 39-1)

A network on the Internet has a subnet mask of [Link]. What is the maximum
number of hosts it can handle?

ANS:
[Link] in binary is 11111111.11111111
The mask is 20 bits long, so the network part is 20 bits. The remaining 12 bits are for the
host, so 4096 host addresses exist.

(Chapter 5, Problem 39-2)


A network on the Internet has a subnet mask of [Link]. What is the maximum
number of hosts it can handle?
ANS:
The mask is 19 bits long, so the network part is 19 bits. The remaining 13 bits are for the
host, so 8192 host addresses exist.

(Chapter 5, Problem 40-1)

A large number of consecutive IP address are available starting at [Link]. Suppose


that four organizations, A, B, C, and D, request 4000, 2000, 4000, and 8000 addresses,
respectively, and in that order. For each of these, give the first IP address assigned, the
last IP address assigned, and the mask in the w.x.y.z/s notation.

ANS:
To start with, all the requests are rounded up to a power of two. The starting address,
ending address, and mask are as follows:
A: [Link] – [Link] written as [Link]/20
B: A: [Link] – [Link] written as [Link]/21
C: A: [Link] – [Link] written as [Link]/20
D: A: [Link] – [Link] written as [Link]/19

(Chapter 5, Problem 40-2)

A large number of consecutive IP address are available starting at [Link]. Suppose


that four organizations, A, B, C, and D, request 2000, 4000, 6000, and 8000 addresses,
respectively, and in that order. For each of these, give the first IP address assigned, the
last IP address assigned, and the mask in the w.x.y.z/s notation.

ANS:
Starting address Ending address Mask
A: [Link] [Link] [Link]/21
B: [Link] [Link] [Link]/20
C: [Link] [Link] [Link]/19
D: [Link] [Link] [Link]/19

(Chapter 5)

An ATM network uses a token bucket scheme for traffic shaping. Anew token is put into
the bucket every 5 msec. Each token is good for one cell which contains 48 bytes of data.
What is the maximum sustainable data rate?

ANS:
With a token every 5 msec, 200,000 cells/sec can be sent. Each cell holds 48 data bytes or
384 bits. The net data rate is then 76.8 Mbps.

(Chapter 5)
Is fragmentation needed in concatenated virtual-circuit internets or only in datagram
systems?
ANS:
Fragmentation is needed in both. Even in a concatenated virtual-circuit network,
some networks along the path might accept 1024 – byte packets, and others might
only accept 48-byte packets. Fragmentation is still needed.

(Chapter 5)

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?

ANS:
With a 2 – bit prefix, there would have been 18 bits left over to indicate the network.
Consequently, the number of networks would have been 2 power of 18 or 262,144.
However, all 0s and all 1s are special, so only 262,142 are available.

Common questions

Powered by AI

The sink tree algorithm allows more efficient broadcast by minimizing the number of duplicate packets, creating a tree that converges on a sink node while ensuring all nodes receive the packet with fewer repetitions. For instance, a broadcast from B using a sink tree generates only 14 packets, fewer than the 28 packets created by reverse path forwarding, which includes multiple paths converging independently without coordination, thus increasing redundancy and traffic load .

The subnet mask, 255.255.240.0, has a network part of 20 bits, leaving 12 bits for host addresses, allowing for 4096 host addresses . In contrast, the mask 255.255.224.0 has a 19-bit network part and 13 bits for host addresses, resulting in 8192 host addresses . The choice of subnet mask directly influences the number of bits available for host addresses, with more bits allowing for a greater number of hosts within a subnet.

Router C calculates potential routes to each destination using vectors received from its neighbors B, D, and F, adjusting for link delays: Routing via B gives (6, 3, 9, 11, 7, 5), via D gives (14, 17, 7, 2, 10, 12), and via F gives (9, 10, 8, 5, 5, 1). By selecting the minimum value for each destination, C's routing table becomes (6, 3, 0, 2, 5, 1), with routes chosen based on the shortest calculated delay through its neighbors .

Converting the hexadecimal IP address A44FF1BC to dotted-decimal notation involves translating each hex segment into decimal: (A4)16 = 164, (4F)16 = 79, (F1)16 = 241, and (BC)16 = 188 . Thus, A44FF1BC in dotted-decimal format becomes 164.79.241.188, breaking down binary groupings of eight bits per octet and summing their decimal values .

Fragmentation is vital in both virtual-circuit and datagram network systems as different segments may handle varying maximum transmission unit (MTU) sizes. For example, within a virtual-circuit network, some paths might handle 1024-byte packets while others manage only 48-byte packets. Hence, fragmentation is necessary to adapt larger packets to smaller allowable sizes based on the MTU constraints of intermittent network segments, ensuring data is not discarded and can traverse differing network infrastructures .

If flooding is employed with a maximum hop count of 3 for a packet from A to D, the packet will follow the routes ABCD, ABCF, ABEF, ABEG, AGHD, AGHF, and AGEB . The total bandwidth consumed by these hops is equivalent to 24 hops . Flooding results in the packet taking all possible routes within the hop count limit, leading to significant bandwidth use.

A subnet mask of 255.255.240.0 has a network component of 20 bits, leaving 12 bits for host allocation . The formula for calculating the number of host addresses is 2^n - 2, where n is the number of host bits, accounting for the reserved network and broadcast addresses. Therefore, 2^12 - 2 equals 4096 host addresses, allowing for this many unique hosts within the subnet .

In an ATM network using a token bucket, a token inserted every 5 msec allows a maximum of 200,000 cells per second, each with 48 bytes of data. This results in a data rate of 76.8 Mbps . This shaping mechanism allows control over data rate, preventing burst traffic and smoothing data transmission, which helps in maintaining consistent network performance and avoiding congestion.

If 20 bits had been used for the network portion of a class B address, 18 bits would remain for networks, providing 262,144 possible networks. However, both the all-0s and all-1s cases are reserved for special purposes, reducing the available networks to 262,142 . The all-0s is typically used for specifying the default route, and all-1s often signifies a broadcast address, thus excluding them from general allocation.

Using reverse path forwarding for a broadcast from node B takes five rounds and generates a total of 28 packets . On the other hand, utilizing a sink tree approach reduces this to four rounds, generating only 14 packets . The choice of routing algorithm significantly impacts the efficiency and volume of network traffic during a broadcast, with sink tree approaches generally resulting in fewer packets and thus less congestion across the network.

You might also like