So guys, now let us start with the discussion of data, structure and algorithm required to design
and implement routing table.
So before going forward, let us make ourselves familiar with some keywords.
The key words are prefix, mosque and wildcard.
So let us get also familiar with the definitions of these keywords.
So let's say you have an IP four out as an example, which is 1.2.3.4 slash 24.
So with this example, the prefix is nothing but the actual IP address itself.
So here the prefix is 1.2.3.4.
And when this prefix is represented in the binary form, you will got 32 bits.
This is the first octet.
This is the second octet.
This is the third octet.
And this is the full Dr. here.
Optic means a byte.
All right.
So prefix is nothing but the actual IP address part of a out as is the prefix.
The mask is the 24 in aid, not B, not seed or DRC IDR notation.
We express the mask as 255.22 5.2250.
This 24 actually means that the first 24 bits and the binary representation of the mask is one, whereas
the last ID words were going to be zero.
All right, so when we say it's less 24, it means that the first 24 bits of the mask are all ones.
And of course, the mosque land is always targeted to birds, and the perfect land is always harder
to base.
This land is fixed and constant for IPv4 addresses.
Then comes the wild card, which is exactly opposite of mosque.
If you flip the bits of the mosque, then you get the wild card, as simple as that.
So in Syria on rotation, the wild card is expressed exactly opposite to that of the mosque.
That is, you replace 255 and zero and you replace zero with 255 and so on.
And the binary notation, all the ones will be converted to zero and all the zeros will be converted
to once.
So this is what wild card is.
All right.
Then comes the effective prefix.
In fact, the prefix is nothing, but you are trying to view the prefix and the wildcard.
As one single logical thing.
So effective prefix, you take the bits from the prefix and you take as many bits from the prefix as
equal to this most number, which is straightforward.
So you have taken 24 bits from the prefix and the remaining bits will come from the wildcard.
So in the wildcard, in whatever positions you have one, just replace those one and we present those
one by x.
So here X represents don't care.
All right.
So in the wildcard, add those positions where you have one, those positions are don't care.
And in the mosque, those positions where you have zero, those positions are don't care.
So you have don't care what in mosque as well as wildcard.
The only difference is that that in the mosque don't get is represented by procedural whereas in wildcard
it's the one which represent don't care and effective prefix the don't care is represented by a symbol
x.
So note that effective prefix is used to view the prefix and wildcard together for easier human understanding
purpose only to store the effective prefix in computer memory.
You still need a prefix and wildcard together saved in separate variables.
All right, so in a separate variable, you store the perfect spot, and in separate variable, you
store the wildcard part.
And combining these tools, you will get that effective prefix.
All right.
So in the remaining part of this course, we will going to keep on saying the word prefix, the wildcard,
the effective prefix, or it is important that you get familiar with the vocabulary that we will going
to use in this course.
And you can see here is some of you are all which is nothing, but it is a nice IP calculator present
online.
You can always use this calculator in order to convert the IP out into its binary form and vice versa.
So this calculator will help you a lot and you can bookmark this calculator in your browser.