Suppose you have the following routing table in your router. We haven\'t studied
ID: 3599234 • Letter: S
Question
Suppose you have the following routing table in your router. We haven't studied Netmasks. Google them. The Netmask identifies the bits we care about in the destination IP address. The Destination column identifies the values for the bits not masked out. Destination,Netmask,NextHop,Interface 0.0.0.0, 0.0.0.0, 100.10.1.1, etho 128.148.0.0, 255.255.0.0, 128.148.0.1, eth1 128.148.32.0, 255.255.240.0, 128.148.32.1, eth2 128.148.34.128, 255.255.255.128, 128.148.34.129, eth3 What is the next hop for each of these addresses, given that you use longest-prefix matching? a) 128.148.34.192 b) 128.148.34.72 c) 128.148.1.1 d) 192.168.12.14 e) 128.148.38.15Explanation / Answer
Solution: 1) 0.0.0.0, 0.0.0.0, 0.0.0.0/0 -eth0
2) 128.148.0.0, 255.255.0.0, 128.148.0.0/16 -eth1
3) 128.148.32.0, 255.255.240.0, 128.148.32.0/20 -eth2
4) 128.148.34.128, 255.255.255.128, 128.148.34.0/25 -eth3
Ans: (a) 128.148.34.192
Taking the first 25 bits of 128.148.34.192 as network address, we have 128.148.34.128.
The bit pattern of 128.148.34.192 is 10000000.10010100.00100010.11000000
When we perform the bit and operation with 25 leading bit 1s and 7 bit 0s, it is equivalent of making the last 7 bit zero.
We get the following network address bit pattern: 10000000.10010100.00100010.10000000.
The first three bytes are not changed. The 4th type changes from 192 to 128 .
In the routing table The 4th row matches.
The next hop will be eth3.
Ans: (b) 128.148.34.72
Taking the first 25 bits of 128.148.34.72 as network address, we have 128.148.34.0.
The bit pattern of 128.148.34.72 is 10000000.10010100.00100010.01010010
When we perform the bit and operation with 25 leading bit 1s and 7 bit 0s, it is equivalent of making the last 7 bit zero.
We get the following network address bit pattern: 10000000.10010100.00100010.00000000.
The first three bytes are not changed. The 4th type changes from 72 to 0 .
In the routing table The 4th row matches.
The next hop will be eth3.
Ans: (c) 128.148.1.1
Taking the first 16 bits of 128.148.1.1 as network address, we have 128.148.0.0.
The bit pattern of 128.148.1.1 is 10000000.10010100.00000001.00000001
When we perform the bit and operation with 16 leading bit 1s and 16 bit 0s, it is equivalent of making the last 16 bit zero.
We get the following network address bit pattern: 10000000.10010100.00000000.00000000.
The first two bytes are not changed. The 3rd and 4th type changes to 0 .
In the routing table The 2nd row matches.
The next hop will be eth1.
Ans: (d) 192.168.12.14
Taking the longest 25 bits of 192.168.12.14 as network address, we have 192.168.12.0.
The bit pattern of 192.168.12.14 is 11000000.10001000.00001100.00001110
When we perform the bit and operation with 25 leading bit 1s and 7 bit 0s, it is equivalent of making the last 7 bit zero.
We get the following network address bit pattern: 11000000.10001000.00001100.00000000.
The first three bytes are not changed. The 4th type changes to 0 .
we have 192.168.12.0. None of the entry matches the routing table.
Now Taking the 20 bits of 192.168.12.14 as network address, we have 192.168.0.0.
The bit pattern of 192.168.12.14 is 11000000.10001000.00001100.00001110
When we perform the bit and operation with 20 leading bit 1s and 12 bit 0s, it is equivalent of making the last 12 bit zero.
We get the following network address bit pattern: 11000000.10001000.00000000.00000000.
The first two bytes are not changed. The 3rd and 4th type changes to 0 .
we have 192.168.0.0. None of the entry matches the routing table.
Now Taking the 16 bits of 192.168.12.14 as network address, we have 192.168.0.0.
The bit pattern of 192.168.12.14 is 11000000.10001000.00001100.00001110
When we perform the bit and operation with 20 leading bit 1s and 12 bit 0s, it is equivalent of making the last 12 bit zero.
We get the following network address bit pattern: 11000000.10001000.00000000.00000000.
The first two bytes are not changed. The 3rd and 4th type changes to 0 .
we have 192.168.0.0. None of the entry matches the routing table.
Now Taking the 0 bits of 192.168.12.14 as network address, we have 0.0.0.0.
The bit pattern of 192.168.12.14 is 11000000.10001000.00001100.00001110
When we perform the bit and operation with 0 leading bit 1s and 32 bit 0s, it is equivalent of making the last 32 bit zero.
We get the following network address bit pattern: 00000000.00000000.00000000.00000000.
All the bytes changes to 0 .
we have 0.0.0.0. The 1st row matches.
The next hop will be eth0.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.