0% found this document useful (0 votes)
43 views23 pages

DVR LR Nat

This document discusses routing protocols and how distance vector routing works. It explains that routers maintain routing tables to choose the optimal path for packet forwarding. Distance vector routing relies on routers periodically sharing their routing tables with neighboring routers via "hello messages" so that each router knows the distances and next hops to reach all destinations on the network. Routers initially populate their local routing tables based on directly connected neighbors and costs, then exchange this information through hello messages to collectively learn the full topology and optimal paths.

Uploaded by

Barjees Bhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views23 pages

DVR LR Nat

This document discusses routing protocols and how distance vector routing works. It explains that routers maintain routing tables to choose the optimal path for packet forwarding. Distance vector routing relies on routers periodically sharing their routing tables with neighboring routers via "hello messages" so that each router knows the distances and next hops to reach all destinations on the network. Routers initially populate their local routing tables based on directly connected neighbors and costs, then exchange this information through hello messages to collectively learn the full topology and optimal paths.

Uploaded by

Barjees Bhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Hello friends! Welcome to Gate Smashers.

In today's video we will


discuss about
routing protocols and
its categorization.
So what is routing protocol.
And what are its
different categories.
We are going to discuss about this.
But before that I want to tell you that what
is major functionality of
network layer.
Forwarding.
Forwarding the packet.
What is the meaning of forwarding the
To put the packet on
its right path is
forwarding.
Basically, who does the forwarding?
Let's say
There is a router
And router generally, in network, is
connected to multiple networks.
So let's say router is connected to
To N1.
To N2.
To N3.
To N4
It is connected to multiple networks.
Now any packet. Let's say, a packet arrives.
The packet is received by
router.
After receiving the packet.
It will open the
packet internally and
send it on the
right path.
And basically,
what is the right path?
It should be optimal path.
Optimal means
the shortest path
with lesser delay.
Cost should also be less.
Packet should reach quickly.
So what is the way to choose optimal path?
How should
router find out.
How router finds out
whether to send it to N1,to N2 or to N3 or
to N4.How does it find out?
By routing tables.
Here comes the concept of routing tables.
Basically what is routing table?
It is collection of entries.
That what is happening inside
my network
All the values in my network
are contained in
my routing table.
It is basically
a to and fro
communication.
Meaning what is happening
inside the complete network. Which connection is working.
Which connection is not working.
From which one network to which
other network it has to go.
From which node to other node it has to go.
What is my cost?
All these points are
under routing table.
And how is routing table
created? To properly create a
routing table either
we can make a
static routing table
or dynamic.
What is a static routing table?
Meaning manually.
One that is created manually. You have to
manually insert data in routing table.
And who has to do it? Network Administrator will do it
This is possible in a small network.
Enter the data manually.
What a person is connected with?
What is the underlying cost?
What is the delay?
But if we talk about internet.
Everything is possible
on internet.
Everything is possible means.
Rather than using static
we work
on dynamic.
Our routing table should
automatically send information to each other.
And they should be
automatically updated.
So how is a dynamic routing table created?
To make them we use
routing
protocols.
We use different type of routing protocols.
What are they? They are set of instructions, rules
which help
routers
to share data.
And after sharing
update
your routing table.
From time to time.
Because if any packet comes
That packet, on the basis of
routing table
could be checked
for the direction in which it should be sent.
So it reaches
its destination
on the network as soon as possible.
So the routing protocols that we have.
There are different type of routing protocols.
Intra domain and
inter domain.
So how does this intra domain and inter domain works.
As we all know. Internet is a very big term.
Meaning internet is a very big term.
What we call
this big area.
What do we call this complete network. Internet.
But internally we have divided
internet into
autonomous systems.
Autonomous systems means that the
particular network. Let's say
it is a collection of different networks.
Like there is one network N1,
N2,
N3,
N4.
There are different networks that are
connected to networks and each other.
And what is autonomous system
One autonomous system
is one that
is under one particular
network administrator.
Meaning, the network under
one particular network administrator
we call it
autonomous system
Let's say, if we talk about Delhi.
Under Delhi,
all the complete networks.
All the small small networks.
After connected them together.
Complete Delhi could be
called autonomous system.
Similarly if we talk,
let's say Bombay. Mumbai also has its
own autonomous system.
Under different autonomous systems
how does the communication occur.
That is known as inter domain. Meaning, this is one autonomous system.
This is another autonomous system. How would they communicate with each other.
How will
they share data.
How will they share routing information
That is the inter domain.
And Intra domain is
within one autonomous system.
Meaning inside one autonomous system.
one autonomous system.
Like, I gave the example of Delhi.
Let's say I want to send information
from Hauz Khas to green park.
We are talking about a simple example.
If we want to do routing within
an autonomous system.
Meaning
within the autonomous system,
we want to share data.
Different routers
want to share data.
That how much is the cost.
Which net is running.
Which link is basically not working.
All this
status,
how does that status
is shared,
with the help of
intra domain. That's why
it is intra. And inter means between the autonomous system.
Under intra domain
we have distance vector
and link state routing.
And how do we implement distance vector.
RIP.
RIP is a real life protocol.
That is a routing information protocol that we generally use
to share information in intra domain.
Similarly, there is OSPF,
that is open shortest
path first. And this basically works
on link state routing.
Similarly we have border gateway protocol.
It works on
path vector.
But if you are preparing for gate,
net or any other exam.
Even if you are preparing for college or university level exam.
Then remember distance vector
is the most important.
The very important algorithm.
That is a distance vector. After that we
sometimes talk about link state routing.
Here this is .
the major portion
And all the three algorithm's,
all the three protocols
works on
unicasting. The meaning of unicasting.
We generally use unicasting or multicasting.
Meaning if we want to do one to one
communication. One person want to send data to the other person.
Or multicasting, meaning
I want to send data to a full group.
Or multicasting, meaning
Then there are different protocols for multicasting.
These protocols are
under unicasting.
This is basically
basic information
of routing protocols.
Next we will discuss
one by one that what is a distance vector
and how does it work.
Thank you.

DVR

That is dvr.
It is basically intra domain routing protocol.
And intra domain means.
All the routers inside the autonomous system.
How they will share the information
with the help of dvr that is distance vector routing.
The first question that comes is that what is available with us.
In this diagram, I have taken N1, N2, N3, N4, N5. What are they.
They are routers.
And we have connected these routers with links. These are basically links.
And our main purpose is.
That the routers will share information about the network.
They will share information
so that they remain updated about what is happening in their network.
And what this basically helps in. Forwarding the packet.
What has to be forwarded.
Means if I want to route a packet.
Then for routing, obviously I have to find out minimum distance.
Minimum distance or shortest distance has to be found.
Then how will we find out shortest distance.
If I don't have the information about the complete network.
Then how will I find whom to send next, after that next.
For this we use distance vector routing.
So the routers share information among themselves.
Here I have five routers.
And what do we have first.
Each router maintain its routing table.
The routing table in dvr has 3 data.
One is destination.
That which destination node is this.
I referring router as node, so I have taken N1 and N2 as node.
In the graph we have node and edges.
So I may use edge and node while talking.
Node basically is router.
And edge means link.
Next we have distance.
What is distance.
Here it is given.
One, three, four, two, six.
They basically are distance.
Means, if I have to go from N4 to N3.
My distance is two.
You can take it as distance.
It can also be considered as cost.
Considered as propagation delay.
Considered as number of hops.
Anything.
What is basically given to you.
If you want to go from N4 to N3.
If will have to pay a cost of 2.
Two will be the cost.
To go from N4 to N5.
Cost will be four.
And it will always be given in the question.
That how much is the cost.
Then the first thing to do is.
Our distance vector.
We have to fulfil our local routing table.
Local routing table means.
N4 has to see its routing.
N3 its own.
I have already drawn the routing tables to save time.
Each routing has table has three information.
Destination- where to go.
Distance- how much is the distance, how is the cost.
Next- next is next hop.
Meaning, through which it has to go.
What is next.
Next we have.
In distance vector routing.
The first point is, the first rule is.
That in all the routers in the network.
Every person should know that how many
routers are present in the total network.
Meaning, N4 must know that there are five routers in the total network.
Every one knows.
The second point is.
That we, use hello message here.
What happens with hello message is
that it will come to know its neighbour node.
N4 will know its neighbour.
N5 will know its neighbour.
It will become aware of its neighbours.
So, the first step is.
That first time the local routing table.
How will they fill the local routing table at their end.
How to fill.
Like, we have N1.
Let's start from N1.
This is N1's routing table.
From N1, if have to go to N1.
What is my destination. N1.
To go from N1 to N1.
Then obviously, the distance would be zero.
Because, obviously I don't have to travel anything.
I am standing at the same node.
Then what is next. Next basically is N1.
From N1 I have to go to N2.
This is the destination.
And where are you standing.
Standing on N1.
From N1, I have to go to N2. What is the cost.
Cost is one.
As soon as you apply one cost.
The next node you will reach is N2.
Simple.
You just have to fill one by one.
You have to go from N1 to N3.
Next is N3.
For going from N1 to N3 we don't have any direct route.
Because for the first time,
if one is making this routing table.
You don't know anything in the routing table.
You only know about your neighbour.
N1's neighbour is N2.
N3 is the neighbour of N2, not N1.
So N1 does not know anything about N3.
The cost from N1 to N3 is infinite.
Because it only knows about N2.
So we written the cost from N1 to N2 as 1.
But for now, it does not know the cost of N1 to N3.
So it is infinite.
So what is next.
Next means, I don't know where I have to go next.
So don't know next.
Next N1 to N4.
See N1 is directly connected to N4. It is not.
Then its value is also infinite.
Next is also infinite.
So this local routing table is formed.
You can say first.
As we began network.
The first routing table of N1 that is formed. It is that.
Parallely what is happening.
Parallely. Means we had only discussed about N1.
But parallely N2, N3, N4, and N5 also filled their routing table.
Now let's see. If we talk about N2.
We are standing at N2.
And the destination is N1.
So the distance from N1 to N2 is 1.
And the next node you will reach is N1.
The cost of going from N2 to N2 is zero.
So the next is nothing. You are at N2.
What is the cost of going from N2 to N3.
Cost is six.
Next is N3.
To go from N2 to N4.
See there is no direct path.
Means here it will be infinite.
And what is next. I don't know what next will be.
Then the cost of going from N2 to N5 is 3.
And where will I reach. I will reach N5.
This is the basic fundamental.
You have to fill this one by one.
Similarly if we talk about N3.
Going from N3 to N1. To go from N3 to N1, cost will be infinite.
We are standing at N3. To go to N1.
There is no direct link.
To go from N3 to N2.
The cost of going from N3 to N2 is six.
And where will I reach.
From N3, I will reach N2.
Then I have to go from N3 to N3.
The cost is zero.
And where am I.
At N3.
If I want to go from N3 to N4.
Cost is two.
And I will reach N4.
To go from N3 to N5.
There is no direct link.
To first value is infinite.
And next value is don't know.
Then we have N4's value.
To from N4 to N1.
So there is no direct link.
It will be infinite.
Next I don't know.
Next we have, to go from N4 to N2.
There is no direct link from N4 to N2.
It will become infinite.
Next we don't know.
To go from N4 to N3.
To go from N4 to N3, cost will be two.
Where will you reach. At N3.
To go from N4 to N4.
Zero.
On N4.
To go from N4 to N5.
Cost will be 4.
Where will you reach.
At N5.
And last we have N5.
You have to go from N5 to N1.
Then distance is obviously infinite.
There is no direct link.
From N5 you have to go to N2.
To go to N2, the cost is 3.
You will reach N2.
To go from N5 to N3.
There is no direct link.
Infinite.
To go from N5 to N4.
Cost is four.
You will reach N4.
From N5 to N5.
Cost is zero.
You are already standing at N5.
This is the basic fundamental.
That how it will form its local routing table for the first time.
What happens after that.
The first step that comes.
That the distance vector has to shared.
This is a very important point.
We will complete.
Generally, what students consider.
Sharing the complete routing table with each other. No.
The first most important point is,
only neighbours.
What and with whom we are sharing.
Sharing only and only with neighbours.
And second.
Are we sharing the complete routing table.
No.
Only distance vector.
Now what is the story behind distance vector.
And what is the meaning of neighbour.
If we talk about N1.
What will N1 send.
And to whom it will send.
It will only send to N2.
And what.
Its distance vector.
Its distance vector.
Distance vector means, this array.
In computer science, we are taking this as array of values.
And only and only, this set of values.
Only this column.
From here to here.
Only this column will be send.
Meaning. N1 is basically sending its distance vector to N2.
You have to consider it like this.
Similarly if we talk about N2.
To whom will N2 send.
To N5, to N3, and to N1.
Only to its neighbours.
If we talk about N4.
To N3, to N5.
Similarly if we talk about N3.
Only to N2, and to N4.
So remember these two points.
Only share to neighbours.
And second what to share.
Only distance vector.
Not the complete routing table.
Otherwise in your bandwidth.
You are sharing a lot of data.
So when this algorithm was made.
Around in 1980s.
It was very popular algorithm.
And at that time.
It only shared the distance vector.
So originally for gate exam, NET exam.
In any competitive exam, if it is asked.
So you have to remember.
That you only have to share the distance vector.
So basically if we talk about at N1.
Which distance vector will come in N1.
Only N2's will come.
If we talk about at N2.
Who all will send at N2.
N1 will send,N3 will also sen

count to infinity

Hello students. Welcome to Gate Smashers.


In today's class I will explain
count to
infinity problems
in distance vector routing.
Count to infinity problem occurs in
distance vector routing.
Why does it happen.
We will discuss all the points one by one.
But I will tell you in advance.
You should know
about distance vector routing.
How does it work.
What it is? And I have explained it with example.
And
video to that
is in the description box.
Please check that video.
If you already know about that. Then you will easily understand this.
Why? Because count to infinity problem occurs in
distance vector
due to some reason.
If you don't know about distance vector.
You will not be able to understand this.
First learn that.
Then come to count to infinity problem.
I will tell with an example.
Here we have
node A, node B.
And they are connected to internet.
I will create one more node.
So that I can give you more clarity.
Let's say we made another node here.
C.
See like this.
Now see what we have to do here.
What is the
cost from internet to B.
Cost of each link
here is one.
Meaning cost
from A to C
is one.
Cost of A to B is one
Cost from B to
internet is one. We are already given this point.
See here. First we have to
make that if B has to reach internet.
then obviously It knows the initials.
It will send hello message.
So it will come to know its cost.
How will B reach internet.
With the cost of one.
Why? Because there is one link. And cost of one link is one.
Now how is A connected to B.
With the link of one.
But can A reach internet right now.
No.
Initially A does not know anything.
That how it will reach internet.
Why. Because A's neighbours are B and C.
So it is not
directly connected to internet right now.
So its cost for it is infinite.
Similarly C will keep the
cost of internet as infinity.
I will not make
complete distance vector.
I am just telling the cost of each node.
According to internet.
To reach internet.
Cost of B is one.
Initially A's cost is infinite.
C's cost initially is infinite.
Because they don't know anything now.
They just know about their neighbours.
What will happen now.
When first pass will occur.
What neighbours do.
Neighbours send
their distance vector to each other.
So the first point here.
What will neighbours send.
Neighbours will send
only vector. Meaning what will they send.
Only and only the matrix.
In which
they have written what
is the cost. Meaning
what will B
send to A.B will send to A that
I will take you to internet
with cost of one. A knows that how can it reach B.
With the cost of one.
So one plus one.
Total cost is two.
The total cost of reaching
internet is two. internet is two.
Because B told A that I will take you to internet at cost of one.
A knows that the cost of A to B is
one
So one plus one is two.
Now what will happen
Here, obviously
what will happen in next pass.
In next pass. B told A that I will take you
with the cost of one.
So A changed its
vector from one to two.
Now C does not anything about this.
When A will send to C. It will send infinite.
So in first round, nothing will be known.
In first round. The cost from C to A is infinite.
What
changed is that the cost from A to internet
is two. And the cost from B to internet is already one.
Now when next round will happen.
In next round,
obviously neighbours will send.
So when neighbours will send.
See the main point.
When A will
send to C the
vector two.
Meaning A will tell to C that
I will take you to
internet with the
cost of two. Now C knows that how it will reach A.
With the cost of one.
three .A told that I will take you to internet
at two cost.
And the cost from C to A is one.
So two plus one is
three And my this cost
two is as it is.
And my this cost, one
is as it is.
Even if they pass the distance vector
in the next round.
Even then the cost
will not change. Like, C
tells A
that I will take you in 3 cost.
And A tells C
that I will take you in 2 cost. What will the
distance vector of C.
For internet it will be three.
And how much will be A's vector.
What reached A.
C's message reached.
That I will take you in 3 cost.
And from here B is taking
it in one cost.
Meaning my minimum cost is two.
And minimum cost is one. There is no change.
This is what we call that a normal operation is performing.
Now we will talk about.
The special case in this.
Special case means.
How the count to infinity problem occurs.
Let's say this link from B to internet is broken.
Meaning for some reason
the link from B to
internet is broken.
Now B is aware of this.
Why? Because the hello message will not get sent.
Then what B will instantly do is.
I will show by changing the color.
B will set its
cost for
internet as
infinite.
Why. Because B knows that I am not connected to internet.
So it changed its cost to infinite.
Now A does not know anything
about this.
C does not know anything about this.
So there will be no changes in this.
Now see. The next point is very interesting.
See what will happen now.
When neighbours will send to each other.
Then see.
B send to A
as infinite. That
I cannot take you to internet.
My cost is infinite.
Remember
they just send matrix
They only send cost.
They send that
via whom are they taking.
No. They only send the value Infinite.
So A came to know
that the cost is infinite.
It will
not respond now.
It is not like that it will instantly declare it as infinite.
It will not make infinite.
Why not? Because
C will also send message to A.
C will also send message to A.
So what C sent to A.
Cost three.
Meaning C is telling A that
I will take you
to internet
in three cost. It is not saying that I am going through you only.
You must be wondering that sir how it happened.
C is going through A.
But here
in distance vector.
Due to bandwidth utilization. We send only and only
the matrix.
We only send the value of cost.
We don't send that
through whom are we taking. That link we resolved
in straight.
We also resolved in split horizon. But for now the thing is.
C will tell A.
That I will take you to internet in three cost.
Then A will think.
B is not being able to take me.
Because its cost is infinite now
And C can take me.
And what is the cost of C
One. So what cost is updated.
Four. Here is where the problem happened.
If C would have told that I am going through you.
This would not have happened. But this is not the thing. It got resolved later on.
But initially this was
the count to infinity problem.
So C told A that
I will take you in three cost.
Three plus one. Because A to C cost
is one.
So the total cost came to be four.
Now at this time.
A must also had
sent a message. When A would have sent
a message. Then its cost is
three And this cost.
Now see,what must have happened here.
A must have sent to B. When
B sent to A,
infinite. Then A must have also sent to B.
What A sent to B.
Two cost.
Meaning this is happening at one point.
These all are sending parallely.
Why? Because A is sending to B. B is sending to A.
C is sending to A.
A is sending to C. Everyone is sending to their neighbours.
This is one pass.
I am explaining one turn.
But I cannot tell all in one go.
So I am explaining
one by one.
Now see.
When A told B that
I will take you in 2 cost.
It didn't say that I am going through you only.
It is saying that I will take you in two cost.
And what is the cost of B to A. One.
What it will do.
It will update three. Here stupidity happened.
It didn't say that I am going through you.
And this was the problem earlier. Resolved later. But this thing was initially the
problem.
Now see. The next round after this
is even more
interesting. What happened in the next round after this.
This was one round completed.
You can say
one sharing was completed.
See what happened in next sharing.
In next round, the stupider thing they did.
Now.
What B said
to A.
That I will take you in
three cost.
Where. I will take you to internet in three cost.
Similarly C will also say that
I will take you internet in
three cost.
Now what will happen. Obviously what it will do
B said that I will take you in three cost.
And A to B cost is one.
Then three plus one is four.
It will keep four as four
as it is.
Now it kept four
as four as it is.
Now at the same time.
A must also sent a message to B.
A must have also sent a message to C.
Now see.
What A is telling C
A is telling C that
I will take you in four cost
If I will take you in four cost.
Then four plus one.
What is the cost from C to A.
Then four plus one is five.
Now what it will do.
It will update.
We update in distance vector each time.
Why? Because it may happen that the
value of distance
keep fluctuating.
Not like that you have to keep it fixed.
A told C that I will
take you in four cost.
And C to A cost is one.
So four plus one is five.
So it updated five.
Similarly A told B.
That I will take you with the
cost of four. Now.
Four plus one is five.
It also
updated.
Similarly what will happen in next round.
It will send it five cost.
It will become six.
And they will remain
five and five.
Then what will happen in next cost.
It will send six.
So six plus one is seven.
And it will also be seven.
What I mean to say.
They will keep increasing
their cost like this.
And this cost
will keep increasing like this.
And it can
reach infinity.
That's why it is
called count to infinity
problem.
So I am telling you after summarizing
that they only and only
send the matrix.
Send only and only the cost.
If they send that
I will take it through you.
Or through someone else. Then obviously no problem will occur.
It will get resolved later on.
But if it asked in exam. That what is the count to infinity.
This is actually the
count to infinity
problem. Getting the point.
So you have to remember all these points.
Although in next video. I will show you
by solving a gate question.
That how count
to infinity problem creates problem.
Thank you.
link state routing

in link State routing, let me tell you first that I've explained distance vector
routing before this
distance vector routing, and next is link state
in link state routing first we have been given 6 routers
which are connected to each other like this. First of all, we use link state
routing
or distance vector, so that the routers
can make their routing tables and update them regularly
for making routing tables one of the method used is link-state
remember that the routers we have in link state
initially they will make their link-state table. Means, initially they'll
like R1, R2 and R3 are it's neighbours
it will send them hello message. After sending the hello message
R1 will get to know who is it connected with and what is it's distance
let say, first of all R1 will make it's link state table
link state means, link means this edge
how are the connected to each other that means link
and state means whether the link is up or down. Means, if the link is running
or not. So that is the actual meaning of a link state
so see, here I am making link state table of R1. We are not making routing table,
it's initial
at step 1, R1 knows that here
I am connected with R2 and R3
distance from R1 to R2 is 6 and distance from R1 to R3 is 3
means R1 knows this only. In mid, actually this is, that the distance vector
in the distance vector, the distance metric
we share that only with each other. Means what we share with neighbours is
only distance vector. Means what is the distance between each other that only
if you haven't checked that video, do check because the distance vector is one of
the most important routing algorithm
so that you get to know what are routing algorithms and what are their basics
because
link state is made to remove the problems of distance vector
so see, in link state we have the distance, that what are the distance between each
other than that there is also extra information
extra information related to the sequence number and
Time to live, i.e.TTL field. Means it is not just giving a simple information that
with whom I'm connected and what is the distance
along with that there are more information. Means, this whole packet
has many information in it. So obviously if there's more information then the band
width will be utilised more
obviously band width will be utilised more because bandwidth is directly
proportional to the
message size. So obviously if my message size bigger
then band width will be utilised more. This is the simple concept
now see, if I make this for R3. Then initially R3 doesn't know
with whom it is connected
R3 is connected with R1, R2, R5
it's distance with R1 is 3, distance with R2 is 2, distance with R5 is
9. So initially all of them sent hello message to each other
and made their link state table before routing table
now in link state table of R5, it knows it ks connected with R3
R4, R6. So, distance with R3 is 9
distance with R6 is 4 and distance with R4 is 1
everyone will make their own routing table like this. Like this, let say, if we
talk about R6
so the link state table that R6 will make before making the routing table in that
it will tell
that I'm connected with R5 and R4
distance with R4 is 8 and distance with R5 is 4
similarly, let say, R2 will also make it. R2 will say that I am connected with
I am connected with R1, R3 and R4. And the distance initially is 6
after that the distance is 2 and distance with R4 is 7. Similarly you've to make
for R4
Means, initially everyone will make their own link state table. And in making that
hello message helps. When you will send the neighbours hello message
then you will get to know the distance, you will get to know the link, that the
link is running or not
now the story starts. Now what is the next step? When we all have made our link
state tables
now the second is that we have to share it with each other
now at the time of sharing remember that, in distance vector we only shared with
the neighbour
Means R1 will share with R2 and R3, not with anyone else
similarly if we talk about R2, it will share with R4, R1 and R3. Neighbour means
which are directly connected with them
that you can know by the graph but in link state routing we use flooding
there are many questions, it is not necessary that you will always get numerical,
you can get many theoretical questions related to this
so the first step, we made our link state table, all nodes made their own
in which the sequence number, that what number should be given to every packet. We
generally use 32 bit sequence number
we generally used that because we flood the packets. You'll find out later
TTL field, if a packet is stucked in loop, to save that, we made TTL field and the
connections
and what are the distances. Second step is flooding
now we have to do flooding. Flooding means
R1 will send to everyone. Means it will flood in the whole network. R5, R6, R4 will
send to everyone
so meaning of flood is that we want reliability here
reliability means that if R1 flooded, packets will go from here also and there also
from both sides. Similarly from here also means you will get packets in whole
network
so if a packet is lost also then there is no problem, it will reach by any other
path. So we'll flood here
if you are in flooding, will the bandwidth be more utilised
will the condition be more? Obviously, bandwidth utilised more, congestion will be
more because we're sending packets from different routes by flooding
we'll send it not only to the neighbours but everyone. So the second step is flood
now after flooding, let say, at R1, means what will happen at R1
we can examine this by making it at any node. Let suppose what happens at R1. When
we flooded, when everyone flooded their link state table
now R1 will receive link state table of R2 R3 R4 R5 R6, everyone
from that R1 will make its database
database means, R1 gets to know who is it connected with
I'm connected with R2 and my distance with R2 is 6
similarly I am connected with R3 and my distance with R3 is 3
similarly when the packet of R3 will reach here, R3 will tell that your connected
with R5
you are connected to R5 through me and the distance is 9. Means R3 to R5 distance
is 9
similarly when R5 table will reach at R1. Then R5 will tell it that yes I am
connected to R4 with 1 and to R6 with 4. Means R
I'm connected to R4 with distance 1. And I'm connected to R6 with
distance 4. Means like this everyone is sharing their informations
then R1 will get all the information and this is called as global knowledge
what we call it? Global knowledge
that wasn't in distance vector. So here two points are clear, the difference
between distance vector and link state routing
and how does link State routing work. So see, like this R1 will get to know
everything
that with whom it is connected and what is the distance between them
everyone will tell this. so in this way,R1 get to know full diagram that this is
the scenario
now the next step is single source shortest path
i.e.Dijkstra's algorithms. Now here it will use Dijkstra's algorithm that is single
source shortest path
the help of that R1 will find the shortest distance to reach R2 R3 R4 R5 R6 from R1
so see, if you know Dijkstra's algorithm, then obviously you can do it easily
if you don't know let me tell you by a simple point that how does it work
one side is our source R1, and the others are our destination R3 R4 R5 R6
initially I know R1 to R2 is 6. R1 to R3 initially I know is 3
but initially the others are infinite. Means I don't know anything in starting, I
am telling you Dijkstra's algorithm
obviously you should know how does the Dijkstra's algorithm works
so the minimum distance is of R3
so now R1 and R3 have became source
next we'll know the distance of others by R1 and R3
so see, if I go to R2 through R1 and R3, then my distance is reduced from 6 to 5.
How?
first, it was 6 directly. Now if I go through R3, then the distance becomes 5
Similarly, let R3 be fixed, because we've already selected that
now we've to go to R4, now see, we can't go to R4 now, because I can't go to R4
through R3 or that
R5, we can go to R5 through R3, then the distance is 12
similarly, if we want to go to R6, we can't go there also. Now our R1 R3 and R2 are
at one side because they min. in them
now see, these 3 came, now we'll try to go to R4. Now if I go to R4 through R2,
distance is 13
if I gob through this then 9+3, 12. So obviously, I'll go for the lesser one so my
distance is 12
if I want to go to R5, I can go through R2 also, means like this
or I can go directly through R3, so 12, so obviously this 12 will be my minimum
similarly if we've to go to R6, you can't go there now also because neither R2
takes you there nor R3
so let suppose I took R4 next, so R1
R3, R2 and R4 became my final
now see if you go to R5 through R4. So your distance will be obviously become 14,
will become more. It will become more through this also
so obviously your min. distance will remain 12 that is through R3
if you want to go to R6, so you can go through this, so the distance here is 8
so now also your distance will come more because through R4 your distance is 13
and 21, this is much more distance. So now I will take R5
so R1 R3 R2 R4 and then R5
like this we'll go finally to R6. So from here 9+3, 12
12+4, 16. Means I'll reach by 16 distance. Means
by using Dijkstra's algorithm here single source shortest path finally, R1 will
make routing table. So see, R1 R2 R3 R4 R5 R6
and I've the distance here, so the distance from R1 to R1 is obviously 0 we've
found out the distance between R1 and R2 that is 5
we've found out the distance between R1 and R3 that is 3
we've found out the distance between R1 and R4 that is 12
we've found out the distance between R1 and R5 that is 12
we've found out the distance between R1 and R6 that is 12+4, 16
so actually this routing table is made via
via means through where we're going. So see, R1 to R1 we're going through R1
obviously
R2, obviously we're going directly. We're also going to R3 directly
to go to R4, here I'm taking help of R3
and then R2. I'm going from this path. Similarly, if we talk about going to R5, I'm
taking help of R3
and to go to R6 I'm going via R3 and R5
so actually your whole routing table will be made like this
we've made it of only R1. Similarly you can make R2 R3 or any
so the main point is flooding will be used here so that we can send link state
packet to each other
after that we'll use Dijkstra's algorithm so that everyone can make their routing
table
so in this way routing table will be made
in the next part we'll discuss what are the problems in this
or what are the advantages? Or why we use sequence number or TTL?
Thank you

NAT

so let's start network address translation, the actual use of NAT is


- to this network, see here, network address translation
- means the address, the IP address, it translates that
- now which IP address is translated into which one, remember this simple point
- it translates private IP to public IP and public IP into private IP
- now comes that why it is need to be done, what is the reason behind it, so first
I'm explaining this to you with example
- so see, you can imagine of simple scenario, let say, there is a University and
there are 10 hostels in that University
- 10 hostels are there, now if you see in every hostel, if I give every room
different room numbers
- means if I give room number 101 in one hostel, give first room the number 101
- can't I give 101 number in the other hostel?
- obviously I can. Can I give 201 in other hostel? I can. Can I give 201 in third?
Yes
- what is meant by this is that if we talk about room numbers within the hostel
- that should be different but if we talk about two or four hostels in that room
numbers can be same
- means if 101 is in hostet no.1 then it can also be in hostel no.2. Even if we
talk about hotels
- there are thousands and lakhs of hotels in the world. In every hotel there will
be room no. 101, 201
- so what we're doing actually is, in starting we had
- when the story of internet started, in starting we used dial up connection, like
if we talk about 2000s, 1990s
- we provided IP address to every one
- when it stopped using that IP address, then the same IP address was assigned to
someone else dynamically. But in today's world
- we need a dedicated IP address means we aren't working on one machine, we're
working on 3-4 machines
- I need different IP address on every machine. If I want to use this much IP
address
- there are so many private network, each wants a dedicated IP address
- so how will I provide this much IP addresses because in IPV4 we use IP address of
32 bit
- so total 2³² IP addresses are possible. So actually NAT made this scenario easy
- reason for that is, it says you to make a private network inside your
university/organisation
- what? Inside your organisation either university/college/house/small office/big
office
- make a private network inside that. Now what is done actually to make that
private network
- we made the range here. That actually, if we talk about IPV4
- I'm not talking about IPV6 here. And in classful addressing, we made 3 ranges,
one of 10. this
- a 172 in class V and this one in class C. So here I've 2²⁴ addresses
- 2²⁰ addresses in this one and in this 2¹⁶ addresses. So what will happen now
- if an organisation says I need this much IP addresses, then I'll not give them
all the public IP address
- if I'll give all the public IP addresses then my total no. of IP addresses will
get restricted
- so what we'll do is we'll assign private IP addresses. Like if I take example of
this college/university
- so we have them a 10.10 IP address from the first range
- so it internally made a host, 2 3 4, it made these multiple hosts
- it made it's private network, this private network, means if we talk about
10.10.0.1
- so this same can be in some other university/college
- there's no problem in that. Why? Because we are using this privately within the
organisation
- so you can use the same address in different universities/colleges/organisation
- becausen it became a private network. Now what will happen
- outer world, the internet, the internet doesn't know what is this
- internet has nothing to do with this. Internet will get to know my organisation
by and public IP
- so let's say this is the public IP of my organisation 125.12.31.7 and let say
corresponding to that I have also taken a domain name
- gate smashers. What will happen, the whole world knows me by this IP address or
by this domain name
- I've made a private network to internally within me. See how the connection will
be made from here
- how there will be transfer how there will be communication? Let say here is my
host 10.10.0.2
- it says that I want to use Facebook or Gmail or any other web page from the outer
world
- so the packet that it will generate will have its own source address
- because it is generated by itself. What will be the destination? Let say, it
wants to access some website. Let take the address of it as
- 25.25.25.10 take anything. Let's say, it wants to get there and access this
particular host
- now what will happen, this is the source address and this is the destination
address
- so when this packet will reach at NAT, NAT will, outer wall doesn't know this
10.10 because this is private
- so what it will do, it will cut this source address, means, the packet it will
receive
- in that packet it will cut this source address and will paste this source
address. Means
- the public one, because the outer world knows it by this. So it will make it the
source address
- destination is already told by it that I want to access this
- so this packet will go out, in this www. It go to that particular host, and then
whatever the webpage or whatever it wants to access
- when reply will be received after accessing, in that case, when reply will come
- to this host, the server in the outer world will
- the source address, the own address, this address will become source address and
destination will be this one
- this one will be the destination. So when the packet will reach here, I have to
take the packet to the end also, to this place
- so till this place NAT will again do the translation. Means it translated private
IP to public IP in now it will again translate public IP to private IP
- so for that it is using a translation table so that it can Store
- because when the packet will return where it has to be sent, that is also
necessary to remember
- when the packet is returning first it is saving, means when the packet went out
- so it made an entry, 10.10.0.2 has to access 25
- the outer IP address 25.25.25.10. It has to access that, so the packet went out.
Now then the packet will return
- when the packet will return, this one will be in written in the source. So when
it saw this is in source
- so that means it was sent by this one. So it will make the destination this one
and will route the packet to that
- so in this way communication will go on. Let's say, in your hostel there are 101
102 103 many room numbers like this
- send is main to set outside there, that when a letter comes, it will tell by just
looking at it, that send this to this particular room number
- send this to this room number. Actually this is the work that is done by NAT
- it maybe possible you'll think that in a host multiple applications are using
same IP address
- so there can be multiple addresses corresponding to A
- so to resolve that later on, along with private IP, port number
- they stored IP address + port number. In this host which port number, let say,
there's a private port
- anyone you can take. We stored private port that it will get in the web browser
- we stored that private port also. And public port, like you can make 4 entries
like this
- private IP private port public IP public port. Entries can be made like this
- main story of NAT is, it works like this, public IP to private IP and private IP,
so that
- we can use your IP addresses properly
- but later on now, NAT is also not needed because IPv6 is used
- in IPv6 2 raise to power, in IPv6 there are a lot of IP addresses being used
- 2¹²⁸ IP addresses are being used which is a very huge number
- so in that if we don't use this then also it can work
- because there are so many IP addresses that won't end soon. Maybe later on there
will be problem in that
- but for now that is sufficient. Thank you

You might also like