So guys, now let us discuss our final algorithm that is drought lookup.
So you can see on the screen this is a name tried in a structure which is essentially a routing table.
And at this point of time, the following six roles has been inserted in this routing table.
All right.
So in case all throughout lookup for a given IP address, we must give or we must find the road from
this and try it in a structure with the longest prefix match possible.
All right.
In drought lookup algorithm, the bits zero and one matches with the don't care.
For example, if you have a binary string 1010 or binary string 1011.
Then we say that these two binary string matches with the string 101 don't care.
And following are the examples of the expected result offer outlook up the longest prefix match that
is LPA for a given IP address.
120 8.2.3.4 must give the row.
220 8.2.3.4 slash 32.
So this is the load in this I'm tried in a structure which matches best with the given IP address.
All right.
These IP address will be addressed from the IP header of the packet and the router.
After fetching the IP address from the IP hundred on the packet, look up into the routing table to
find the best route that matches that IP address.
And once the router finds the best route, then using the next hope information of that drought, the
router then eventually forwards the packet to the next node in the network.
So this is how routing table is used by layer three forwarding device for forwarding the traffic.
Similarly, second example is that that for a given IP address 120 2.2.3.5.
The best route or the longest prefix mat's route is 120 8.2.00.
Slide 16 Note that in your trying it out structure, if you have a default routing style, then any
unknown IP address would always match with this default route as per the longest prefix match principle.
All right, you just take any arbitrary IP address, let's say ten .1.1.1.
This route will not match.
And the other route and this I'm trying to add a structure, but it will always match with the default
proud, which is essentially zero by zero route.
But what is the algorithm which will make sure that for a given IP address, when you look up in this
routing table, the lookup algorithm will always give you the route with the best match or the road
with the longest prefix match.
So this is what we were going to discuss now, the route lookup algorithm.