In: Computer Science
Consider the following IPv4 forwarding table, using CIDR. As in exercise 1, IP address bytes are in hexadecimal, and “:” is used as the separator as a reminder.
destination | next_hop |
---|---|
00:0:0:0/2 | A |
40:0:0:0/2 | B |
80:0:0:0/2 | C |
c0:0:0:0/2 | D |
(a). To what next_hop would each of the following be routed? 63:b1:82:15, 9e:00:15:01, de:ad:be:ef
(b). Explain why every IP address is routed somewhere, even though there is no default entry. Hint: convert the first bytes to binary
Answer : Given data
* Let us convert the hexadecimal IP's into binary first, it will make our work easier to decide which destination will be taken by which IP.
63:b1:82:15 ---> 01100011 : 10110001 : 10000010 : 00010101
9e:00:15:01 ---> 10011110 : 00000000 : 00010101 : 00000001
de:ad:be:ef ---> 11011110 : 10101101 : 10111110 : 11101111
* Now let us understand the representation 40:0:0:0/2 , this means that out of 32bit only first 2 bits are used to decide Network ID.
* So only bold 2 bit in the above conversion will be used to see next hop. We will match the 2bit Network ID will all possible hops (A, B, C, D) Network ID.
* Whichever match will be found, the packet will be forwarded to that route.
Network ID (first 2 bits)
00:0:0:0/2 | A | 00000000 : |
40:0:0:0/2 | B | 01000000 : |
80:0:0:0/2 | C | 10000000 : |
c0:0:0:0/2 | D | 11000000 : |
From the above discussion, it is very clear that,
63:b1:82:15 -----> B
9e:00:15:01 ------> C
de:ad:be:ef -------> D
* Every IP address is routed to some destination, the reason being the exact match of their Network ID provided in the router table.
__________THE END____________