in Computer Networks edited by
1,768 views
2 votes
2 votes

Consider the entries shown below in the forwarding table of an $\text{IP}$ router. Each entry consists of an $\text{IP}$ prefix and the corresponding next hop router for packets whose destination $\text{IP}$ address matches the prefix. The notation " /$\mathrm{N}$ " in a prefix indicates a subnet mask with the most significant $\mathrm{N}$ bits set to $1$.

PrefixNext hop router
$10.1 .1 .0 / 24$$\mathrm{R} 1$
$10.1 .1 .128 / 25$$\mathrm{R} 2$
$10.1 .1 .64 / 26$$\mathrm{R} 3$
$10.1 .1 .192 / 26$$\mathrm{R} 4$ 

This router forwards $20$ packets each to $5$ hosts. The $\text{IP}$ addresses of the hosts are $10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191,$ and $10.1.1.205$. The number of packets forwarded via the next hop router $\mathrm{R} 2$ is __________.

in Computer Networks edited by
by
1.8k views

4 Comments

reshown by
Ans should be 60.
0
0
Presence of mind is the most important part of the exam and I found it now while reading the question again it is asking the number of packets while solving I got 2 hosts as correct so the number of packets will be 40. but I typed 2.
2
2
Oh right ..silly me. Forgot the rule of longest 1's.

10.1.1.132 and 10.1.1.191 will get packets through R2. Therefore ans is 40 .. right?
1
1

same here bro,did not multiply with 20 and typed 2 as answersad

0
0

2 Answers

3 votes
3 votes

In order to find how many packets are forwarded via the next hop router $R2$, first we need to check that how many hosts are passing through the subnet $10.1.1.128/25$.

In order to do that we need to do following steps:

  1. Find out the total range of all networks.
  2. Check in which range does the given host lie.
  3. If more than one networks are matching then select the network with longest prefix length i.e value of $/N$.
Range of all subnets in forwarding table is:
 
Sr. No.SubnetRangeNext Hop router
$1$$10.1.1.0/24$$10.1.1.0 \:-\: 10.1.1.255$$R1$
$2$$10.1.1.128/25$$10.1.1.128\: - \: 10.1.1.255$$R2$
$3$$10.1.1.64/26$$10.1.1.64\: - \: 10.1.1.127$$R3$
$4$$10.1.1.192/26$$10.1.1.192\: - \: 10.1.1.255$$R4$
 

For host $10.1.1.16$, it lies in the range of subnet numbered $1$. So it will pass through router $R1$. 

For host $10.1.1.72$, it lies in the range of subnets numbered $1,3$. But since prefix length of subnet $3(26)$ is greater than subnet $1(24)$, the host ip address will pass through router $R3$.

For host $10.1.1.132$, it lies in the range of subnets numbered $1,2$. But since prefix length of subnet $2(25)$ is greater than subnet $1(24)$, the host ip address will pass through router $R2$.

Similarly for host $10.1.1.191$, it will pass through router $R2$ and for host $10.1.1.205$, it will pass through router $R4$.

In total $2$ hosts have their next hop router as $R2$. So total number of packets transmitted through $R2$ will be $40$.

 
1 vote
1 vote

Forwarding Table

PREFIXNext HopFor understanding IPs(BOLD FIXED FOR NET ID)
10.1.1.0/24R110.1.1.0000 0000
10.1.1.128/25R210.1.1.1000 0000
10.1.1.64/26R310.1.1.0100 0000
10.1.1.192/26R410.1.1.1100 0000

Given 5 IPs represented in the table below

IPsFor Understanding
10.1.1.1610.1.1.0001 0000 ( maximum matches with R1)
10.1.1.7210.1.1.0100 1000 (maximum matches with R3)
10.1.1.13210.1.1.1000 0100 (maximum matches with R2)
10.1.1.19110.1.1.1011 1111 (maximum matches with R2)
10.1.1.20510.1.1.1100 1101 (maximum matches with R4)


From the Longest Prefix matching, we can get 10.1.1.132 and 10.1.1.191 are the IPs visiting Router R2.

10.1.1.16 - Router R1
10.1.1.72 - Router R3
10.1.1.205 - Router R4
Router forwarded packets to each host is 20 so 20 * 2 = 40 
40 is the answer.

Answer:

Related questions