knowt logo

Routing

Routing fundamentals.

All right, we have covered a lot of information

up to this point in the course,

but we still haven't left our local area network yet.

Once we're ready to leave our network,

this is where routers are really going to start

coming into play.

When we start talking about connecting

to subnets within our network

or connecting our internal network and an external network,

we have to use a router.

So in this section of the course,

we're going to be talking all about routing fundamentals.

The first thing you must understand

is the function of a router, which is to route traffic.

Now, I know that sounds kind of silly,

but essentially that's what it's going to do.

It's going to forward the traffic in one direction or another

between different subnets or between an internal

and external network or between two different

external networks.

Each subnet or external network is going to be

its own broadcast domain because routers

are used to separate broadcast domains.

Unlike switches, which are layer two devices,

and therefore can only maintain one broadcast domain

for everything that's connected to the switch,

the routers are going to be layer three devices.

And they're used to separate and break apart

those broadcast domains into smaller portions to provide

additional efficiency and security to your networks.

Now, before we go too far in this lesson,

it's important to note that there's a difference

between the real world and the exam.

In the real world,

you may often find yourself using a layer three switch,

also known as a multi-layer switch.

When you do this, it can perform routing functions for you.

Many small office home office networks

or small and medium sized businesses

will often opt to use a layer three switch

because it can handle both functions.

It can handle layer two forwarding

when it's acting like a switch

and layer three routing when it acts as a router.

For the exam though, remember,

if you're using a multi-layer switch,

it is functioning as a router.

And so we're going to treat it as a router,

or a layer three device.

Now in this entire section,

we're going to be referring to these devices as a router,

even if I'm using a multi-layer switch in the real world.

Now for the exam, if they say switch,

they're talking about a standard layer two switch.

If they say multi-layer switch or router,

they're referring to layer three functionality of a device

that we call a router during this course and the exam.

So how does the basic router perform this work?

Well, let's consider this diagram here.

I have two networks, one on the left side

and one on the right side of the screen.

As you can see, PC one is connected to our left network,

and PC two is connected to our right network.

Now, to connect these two networks together,

we have two routers and a serial connection

or wide area network connection between them.

For now, we're not going to focus too much on that connection

because we're going to cover that

in a different section of the course

when we talk about all the different WAN technologies.

Right now just realize that there's connection between them,

and it's a long-distance one.

This could be a fiber connection, a serial connection,

a satellite connection, a VPN or any other kind of link.

It really doesn't matter right now.

As long as you understand that there is connectivity between

these two routers and they can communicate to each other

over that WAN connection, that's all we need to know.

Now if I'm sitting at PC one and

I want to send a message to PC two,

I can't just send it through ARP like I did with a switch.

If you remember back in switching,

we talked about how PC one would send an ARP packet

to the switch.

And if it didn't know where to deliver it,

it would send out every single switch port

based on that MAC address.

Well, PC one can and will still do that.

But what's going to happen here is that our ARP request is

going to go up to the switch and the switch is going to

realize that it doesn't know the MAC address associated with

that request.

So it's going to forward it out as default gateway.

The default gateway is the router.

Now that router is then going to respond to the ARP request

on behalf of the destination device.

At this point,

we're now going to have to leave MAC addresses behind

because MAC addresses only work internally in our network.

Once we get to the router,

we're going to switch to using IP addresses

or logical addressing at layer three.

This is where we begin to make our layer two

to layer three transitions.

At this point,

PC one has determined the MAC address

for where the router is

because it needs to send the packet to get out of this local

area network and leave to go find this device.

The left router in this case wants to send

the information to PC two,

because that's what PC one told it to do, to do that,

it's going to pass the information over to router two,

and then router one is going to get the data frame,

which is layer two from PC one.

The writer will repackage it up as a packet,

which is layer three, and then add an IP header to it.

This allows router one to then push the data over its

default connection as an IP packet.

And the data will then be sent across the serial connection

to get to router two.

All right,

once that packet gets to router two,

router two is going to

strip off the IP header and bring it back down to layer two

data frames by adding a MAC address for PC two.

This way it's going to correlate PC two's MAC address with the

destination IP of the packet,

because router two knows who PC two is, it's on its network.

Now, since router two knows the MAC address for PC two,

it can call to PC two directly over layer two

and send that data frame through the switch.

The switch is going to take that information and push it

from router two down to PC two

just as if the two of them were computers sitting on the

same switch, trying to communicate locally.

When PC two wants to send a response to PC one,

this process is going to be reversed.

And that way the communication can continue back and forth

between PC one, its switch, router one,

the WAN connection, router two, its switch, and PC two.

Alright, so a quick summary

of what we just saw in terms of data flow.

We started out with layer two pieces of information called a

data frame coming from PC one.

When it got to router one,

it got packaged up as a layer three packet

to cross the wide area network.

When it got to router two,

it stripped it back down to layer two,

to make it a data frame again,

using MAC addresses to deliver it to PC two

on its local network.

Essentially, this is how routing works.

Now at this point, it's pretty simple,

but it's going to get a lot more complicated as we start to

move packets across not just a direct way in link

like this one,

but over the world's largest wide area network,

the internet.

Now in this section of the course,

we're going to talk about all the different protocols

that are used in routing,

including static and dynamic routing

and address translation and multicast routing.

We're going to spend some time in three different domains in

this section of the course, including domain one,

networking fundamentals, domain two,

network implementations and domain five,

network troubleshooting.

Within these domains,

we're going to focus on objectives 1.4, 2.2 and 5.5.

Objective 1.4 states that given a scenario,

configure a subnet and use appropriate

IP addressing schemes,

objective 2.2 states that you must be able to compare and

contrast running technologies and bandwidth management

concepts, and objective 5.5 states that given a scenario,

you must troubleshoot general networking issues.

So let's get started talking all about routing our packets

in this section of the course.

So how does a router make its routing decisions?

Well, it uses a routing table.

Just like our switches used a MAC address table

or a CAM table we're going to use routing tables

to decide where our packets need to go inside

and outside of our networks.

Now, these routing decisions are going to contain

layer three information,

and they're going to do a layer three to layer two map.

The router is going to use an ARP cache to map an IP address

to a given MAC address.

And this way it knows inside it's local area network

which IPs are going to relate to which MAC addresses.

Now each packet forwarding decision is then going to be based

on it's internal routing table.

Those internal routing tables are really focused on the

logical address side of things or that IP address.

So let's dig a little bit deeper into these routing tables

to really see how they work.

These tables are kept by the router

and they help them determine which route

is best fit for them,

as they're trying to route the traffic

throughout the different networks.

Now a route entry has a prefix and the longer the prefix is

the more specific that network is.

So if we look here at this chart,

I have three different networks showing up.

There's 125.0.0.0.

I have 161.5.0.0.

And I have 134.7.0.0.

Now, which of these would have the longest prefix?

Well, it's the bottom two because they're the most specific.

These are the ones that are most specific

because they have the first two octets specified.

Whereas the first one with the 125.0.0.0

only has the first octet specified.

So it is the least specific.

So if I'm dealing with something like 10.1.1.0/24,

that is really really specific because I have

the first three octets specified, the 10.1.1.

That means I only have 256 possible IPs left

because of that .0 at the end.

Now, instead if I use something like 10.0.0.0/8

this means I only have one octet specified

and the other three are really wild cards.

So I can have up to 16 million IP addresses

because of those three sets of zeros.

So you can see here the longer the prefix we have

or the higher the CIDR notation,

the more specific that route becomes.

Now, when we look at these routing tables

and we look at all the routes in the table,

those routes are going to tell us

what the destination network is

and which router it should go to to get to that network.

It'll also tell us which port on the router is going to be used

to send traffic out and the cost of that route,

which is basically like switching,

where it's dependent upon numbers of different factors,

like the link speed and other factors like that.

Now we're going to talk specifically about those different

factors in another lecture

when we start diving into routing protocols.

But for now just realize that every link in a route

does have a cost associated with it.

So what are some of the sources of routing information

that we can have?

Well, there are really three different sources

that routers are going to use.

The first one is called a directly connected route.

Now a directly connected route is learned by

a physical connection between two routers.

So if you look on the screen here,

I have three different routers.

Router one, router two, and router three.

Now router two knows where router one is and router three

are because it has direct cabling between those

and this is shown by those zigzag lines

or that lightning bolt looking line

that's here on my diagram.

This denotes that it is a serial connection.

Next we have static routes and this is the second way

that routers know how things are connected to them.

Now a static route are routes that are configured

by an administrator manually.

So for example,

router one knows how to get to router two

because it's directly connected,

but it doesn't know how to get to router three yet.

So for me to tell it how to get through router three,

I can put a route into my routing table that says

every time you want to send something to router three,

just go ahead and send it through router two.

That would become a static route.

Now, there is always one default static route

in every router.

And it's a special one.

It's known as 0.0.0.0/0.

Basically it says to the router,

if you don't know where to go, just go here.

It's kind of like your default gateway.

And so for router one,

it might have a default route of 0.0.0.0/0.

That says go to router two anytime you don't know

how to get someplace.

And then it becomes router two's problem

to figure out what to do with that traffic.

Now the third way that routers can do this

is by using what's known as dynamic routing.

And this is done by using dynamic routing protocols.

These protocols are learned by exchanging information

between routers automatically based on the protocols.

Now, instead of me having to go into router one

and tell it how to get to router three,

instead I can just let router two do it.

Now, the idea here is that when router one

and router two become directly connected,

they start sharing their routing tables.

So router one is going to say, hey router two,

do you know how to talk to some people?

And router two will say,

oh yeah, I'm connected to router three.

So anytime you've got something for router three,

just send it to me and I'll pass it on for you.

And they do this all by themselves automatically

using these dynamic routing protocols.

This is really great especially in large networks

because we don't have to manually configure everything.

So for example,

think about if I took your router at home

and I had to put down every single route for you

to be able to find every website

you wanted to get to on the internet.

You would not be able to do it.

It is just too many things out there, right?

So instead we use dynamic routing to accomplish this.

When you connect to the internet,

you connect to your ISP and they know that they are

now your default route.

Anything you want to get to that's not inside your network

you send it to your ISP

and then your ISP will send it to the next router.

And it keeps going up that chain that way.

So that's a great overview of

the three different types of routes.

We have directly connected routes,

static routes, and dynamic routes.

So let's go ahead and dig a little bit deeper into each of

these three types so you can understand them

a little bit more.

First, let's take a look at a directly connected route.

When we look at a directly connected route,

it's going to look something like what you see here

on my screen.

Now as you can see router one and router two are directly

connected with that zigzag line.

That's that serial connection.

Now these routers both know how to get to the other switches

because they're directly connected to them, right?

So if I look at router one's table,

it says I'm connected to 10.0.1.0/24,

which is the network that it owns on switch one.

It's also connected to 192.1.1.0,

because this is the serial connection

between the two routers.

Now notice that router one does not know how to get to

the 10.0.2.0 network,

because this is on switch two

and that's hanging off of router two.

It has no information on this because it only knows things

that are directly cabled to it.

Now, if we go further into static routing,

I can actually write that down as part of my default route

or 0.0.0.0 for router one.

Now this tells me that anytime I don't know an IP address,

I'm simply going to send it out port serial 1/1,

which is going to push it over to router two.

And so in this case, if PC one tries to get to PC two,

it would get as far as router one

and then router one's going to say ugh,

I don't know how to get to 10.0.2.2,

but maybe router two does.

And it's going to push that over to them

over that wide area network connection,

that serial connection that's directly connected.

That's how this manual configuration works

with a static route.

Alright, so I think you understand how

direct connections work and how static routing works.

Let's take a look at the dynamic routing protocols instead.

Now dynamic routing protocols can have more than one route

for an existing network.

If I have a more complex network diagram,

like these five routers that you see here,

and I wanted to get from one to five,

I can go a couple of different ways.

I can go one, two, three, four, five.

And I really just start zigzagging all over the network.

Or I might go one, two, four, five.

Or I might go one, three, four, five.

There's lots of different ways for me to go

because all the different connections that are there.

So how does my router know which one is best?

Well, the dynamic routing is going to get negotiated for us

based on the number of hops that are there,

which is the number of times I have to

go through a different router,

the number of link bandwidth that's available.

So how fast it is.

I might go through the ones that are faster or slower

and other criteria that are out there.

All of these dynamic routing protocols can be able to be

supported depending on what routers you're using

and different criteria of how you want to set them up,

depending on how we configure them.

Now we're going to spend an entire lesson

on the different types of dynamic routing protocols.

So we can really dig into each of them.

And you can really understand because you're going to get

test questions on them come test day.

Now, the last thing I want to talk about in this lesson

is preventing routing loops.

Just like we had an issue with switches

where you can get loops and broadcast storms,

you can get issues with routing

if things start going into a circular manner.

Things will just end up getting lost in cyberspace, right?

So, to prevent that we have two different techniques

we can use.

These are known as the split horizon and the poison reverse.

Now with the split horizon,

this is going to prevent a route that's learned

on one interface from being advertised back out

that same interface.

So in this example,

you see router one knows how to get to router two

because of that direct connection between those two routers.

Now it's not going to go and tell router two

how to get to router two based on that same connection,

because guess what, it came in that connection.

So it can't go out the same connection.

This is essentially what our spanning tree protocol

did for us in our switching networks.

But now we can do this inside of routing.

Now, the second way we do this is what's known as

a poison reverse and a poison reverse is going to cause a route

that's received on one interface to be advertised back out

that same interface, but with a really really high cost

so that nobody would ever want to use it.

Now, these are just two different techniques

for you to stop writing loops.

You could use one or the other.

It really doesn't make a difference.

As long as you're using one,

it's going to prevent that running loop for you.

The first one is I'm just not going to repeat anything.

The second one is, I'm going to repeat it,

but I'm going to tell you it's so expensive

that you'll never ever want to use it.

So let's go ahead and take a look at an example

of these routing loops

and how we can make sure we prevent them.

So here's a network with no issues at all.

I have three routers here.

I have router one, router two, and router three.

You can see the different networks based on the IPs

and their routing tables are shown here on the screen.

Now we're going to look specifically at the routing tables

for router two and router three in this example.

Now, if I start having an issue, like for instance,

the network connection from router three,

for the 10.1.4.0 network went down

because ethernet 0/1 went down,

what do you thinks going to happen?

Well, router two still thinks it can get to that network

because it says, hey,

I can get there through my serial port of 0/1,

because I have a connection to router three.

Now if router three went down, it's going to say,

I don't know how to get there anymore.

And so it's going to ask its friends

using the dynamic router protocols.

And so at this point it's going to say hey router two,

do you know how to get to that network?

And what happens is router two would say oh yeah,

I know how to get to that network.

I can do it in just one hop.

So go ahead and send it to me.

And then router three says, oh great.

That means I know how to get there too,

because I'm connected to you router two,

and you know how to do it.

So that one hop for you becomes two hops for me

and it keeps going back and forth.

And then router two goes, oh, I know how to get there.

Router three knows how to get there.

And he says, he can do it in two hops,

so I can do it in three hops.

And it keeps going back and forth until both of those

get to be such a high number that neither of those routers

can actually ever get to that route anymore.

Now, this is the idea of what a poisoned reverse would do.

But when you use a poison reverse

instead of making it go one at a time

and keep iterating up, it would immediately just say hey,

I know how to get there and it will take me a thousand hops.

And so it's got such a huge cost

you won't want to send it to me.

That's the way that router three can say,

I don't have this route anymore.

Now if you don't use poisoned reverse

and you don't use split horizon,

what ends up happening is you have this loop that happens.

And two says I can do it in one,

three says I can do it in two.

Two says I can do it in three and they keep counting up.

And that eats up a lot of your resources in your network

by causing this loop

and those two sending packets back and forth to each other

continually increasing that cost until it gets so high

that they stop sending traffic.

Now if there's no other way to get to that network,

it's just going to keep going in this infinite loop

and that's going to cause a real problem for you.

This is why it's really important to make sure you're

setting up your poison reverse or your split horizons.

In the last lesson, I talked about the fact

that we can use dynamic routing protocols

so routers can tell each other the routes they know.

But I said we would talk more

about those specific writing protocols later on.

Well, in this lesson, we're going to cover

each and every one of those

that you're going to need to know for the Network+ exam.

Now there are two different types

of dynamic routing protocols.

There are internal ones and external ones

and these are the basic categories.

Now, interior ones are things like

interior gateway protocols that operate

within a network or within an autonomous system.

External gateway protocols will operate

between autonomous systems on those exterior networks.

So for example, the internet

is a really large exterior system

so it's going to be using exterior gateway protocols.

Your networks inside your intranet,

even if you have multiple routers and switches there,

are going to operate using interior gateway protocols.

And we're going to go through some examples

of both of these types of protocols in this lesson.

Now first, let's talk about the router advertisement method.

This is a characteristic of every routing protocol.

Every dynamic routing protocol is going to look at routing

just a little bit differently, though.

Some of them are going to use things

known as distance vectors and others

are going to use things known as link states.

Now some of them don't fit neatly

into either of these two categories

and they become a hybrid of both of them.

Now, what this means is that there's some method

for the route to be received, advertised,

and provided to somebody else.

And you have to figure out how you're going to do that.

There's different ways of doing it.

It can be based on the measurement of cost.

That would be something like a distance vector.

If could be based on how many routers

you have to go through,

it might be something based on the link state of it.

All of those are valid ways,

depending on the protocol you're using.

And this is where you become much more concerned

with the different ways of doing things.

For instance, if you're going to be using a link state vector,

this is where you're going to be concerned more with link speed

and what is the quickest method of getting there?

If you have to go through four routers,

but it's quicker than going through just one.

That's okay if we're dealing with link state,

but if we're dealing with distance, that would be backwards.

We only want to go through one router, even if it's slower.

This is the way we have to look at these different things

and figure out what's going to be best for us.

Now, we're going to talk about all of these

as we go through this video

and hopefully it'll make a little bit more sense to you.

First, let's talk about distance vectors.

Now, when you're dealing with a distance vector,

this is about the number of routers

you're going to be connecting through

for a particular route.

And so if you're dealing with a distance vector,

it's going to send a full copy of its routing table

to everybody else who's directly connected to it

at regular intervals.

Now, the bad thing about this is it has

what's known as a slow convergence time.

Now, what is convergence?

Well, convergence is the time it takes

for all of the routers to update their routing tables

in response to a topology change.

So if I add a router or I take one away,

how long is it going to take for everyone on the network

to know that happened?

So in this example, you'll see I have three routers.

I have routers one, two, and three.

And if I added a fourth router in,

it's going to take some amount of time for router four

to tell the other three routers that it's there

and how it's connected.

That's the idea of convergence time.

Now, once everybody knows all the same information

across all four routers

then you have what's known as a converged network.

Now, one of the ways that we can speed up

our convergence time is to actually use a hold-down timer.

So instead of updating our routing tables every 30 seconds,

we might update it every three minutes.

Now, by doing that, it's going to allow us

to converge faster

because there's less changes across the network.

Now, if there's more changes,

it's going to take us more time to converge.

So if we do less changes and we spread that out

from 30 seconds to three minutes, maybe to six minutes,

that's going to be better for us

in terms of convergence time.

Now, when we deal with a distance vector,

it's really also concerned about a thing known as hop count.

And this is how many times

I have to go through another router to get somewhere.

So in this example, what's the quickest way

to get from router three to router two?

Well, if you're only concerned with hops

or the number of routers you have to go through,

you're going to go directly from three over to two

over that slow, one-megabit-per-second connection.

Now, if you're concerned with link state on the other hand,

you're going to be concerned with the fastest way

to get there by going where the most bandwidth is available.

And that would actually be going

across the 100-megabit-per-second connections.

So I go from router three to router one to router two,

and that will be much faster than going directly

to router two from router three.

Now that's again not going to account for the fact

that if we're doing a distance or link state vector.

If we're using a distance vector, we don't consider speed.

We just count the hops.

So we're going to go direct from two to three,

but if we're dealing with a link state vector,

we're going to go based on speed.

And that's the big difference here.

So you have to think about that as you're figuring out

which protocol you're going to use

and which is going to be the best way

for you to have information flow in your network.

Now, when we deal with link state, we start worrying

about the cost and the speed of all these connections.

This is going to require all of our routers

to know about all the paths of all the other routers as well

so it can figure out what the best path is

to send the information around.

Now, this information is flooded out

through the link state domain when you're using OSPF,

which is one of our routing protocols.

Another one we can use is IS-IS

and this again is a link state protocol

to ensure the routers have a synchronized information

inside their routing tables.

Now, with that synchronized information,

they can then make the best routing decisions.

Now, we're going to talk specifically

about these two protocols in just a little bit here

so hang in with me.

Now, the link state does have a faster convergence time

than distance vectors and it does use that cost

and other factors as metrics

when it figures out what the best way of routing traffic is.

Now, this also includes things like your link speed,

because the link speed is really important

of how much bandwidth you have to send the data across.

Each router is going to construct

its own relative shortest path based

on where it sees itself in the logical diagram

and then it calculates the distance

of how it's going to get to the other places.

So let's take an example of you sitting in Florida,

and I'm sitting here in Washington, DC,

and we both want to get to California.

Now we can have different methods to get there based

on where we sit in the typology of the United States, right?

If we're both going to get in our car and drive there,

we have to figure out based on the highway speeds

and the slowness of those speeds

and which traffic there is

and how many states we have to go through

and which highways we're going to go to get over there.

So let's say we had to go 3,000 miles

to get to California from Washington or from Florida.

Well, if I can go 60 miles an hour the whole time,

but you can only go 30 miles an hour,

well, I'm going to get there a lot faster, right?

Because I can go two miles for every one that you go.

Now that's the idea.

So as we start figuring out

how we're going to go through this using link state,

we can start taking speeds into account and figuring out,

hey, maybe I'm going to take this highway

versus that back road.

Or, there's a lot of traffic on that highway

so I'm going to take the back roads instead.

Well, our routers do the same exact thing

using those links state protocols.

Now let's talk about the first routing protocol here.

This one is known as RIP, R-I-P,

and it's one of the oldest routing protocols out there.

It stands for the Routing Information Protocol

and it is an interior gateway protocol

that is used internal to your networks.

This is a distance vector protocol

and so it's going to rely on hop count

to figure out the fastest path.

Now it's all about how many routers

we're going to have to go through

and the maximum number of hops you can hit is 15 with RIP.

Now, if you hit 16 or more routers,

the connection is going to be considered dead

and it's just going to drop the packet

and wait for you to retransmit it.

Now, again, this is the oldest dynamic routing protocol

out there and it does provide updates every 30 seconds

and so it becomes really hard to maintain convergence

when you're dealing with a RIP network.

Now, RIP is really easy to configure

and it sends out its information using UDP as its protocol

and so it does have that fire and forget method.

The next routing protocol we have is known as OSPF

which is really popular.

This is known as Open Shortest Path First.

OSPF is another interior gateway protocol,

but unlike RIP it doesn't use distance vector.

It uses link state.

So it is concerned with costs and this way

it's going to be a lot more efficient.

Now, going back to our example of having the three routers,

router one, router two, and router three,

what is the shortest path for us to go

from router three to router two?

Well, it's actually going through router one

because the speed there is going

across a 100-megabit-per-second link

instead of going over a 10-megabit-per-second link.

Cost here is based on link speed not on hop count.

And so OSPF will help you get there fastest

using that link state variable.

Next, we have

the Intermediate System to Intermediate System

known as IS-IS.

This is another interior gateway protocol

and it functions a lot like OSPF.

It again is going to use cost as its link state measurement.

And this cost is based on link speed between two routers.

It functions a lot like OSPF,

but OSPF is still dominant in the marketplace

and used very widely where IS-IS

didn't really see widespread adoption.

The next routing protocol we have to discuss is EIGRP

or the Enhanced Interior Gateway Routing Protocol,

which you can probably guess

is the interior gateway protocol based on its name.

Now this is an advanced distance vector protocol

that uses both bandwidth and delay to make it a hybrid

of the distance and link state protocols.

It does count the delay that exists,

which is how many hops there are,

as well as the cost that's available

with each of those links to figure out their speed,

making it that nice hybrid.

Now, this hybrid protocol was developed by Cisco

as an upgrade to OSPF and it is very popular

if you're using a Cisco-only network.

Because it's proprietary,

meaning you can only use it with all Cisco products,

you're not going to see it a lot if you're using Juniper

or Brocade or other routers in your network.

Again, it hasn't gotten the widespread acceptance

that OSPF has because OSPF can be used on any device

in any networks, not just Cisco.

The last protocol we're going to talk about is BGP

or the Border Gateway Protocol.

This is an external gateway protocol and on the exam,

if you're asked which of these

is an exterior gateway protocol,

the only answer you should be looking for is BGP

because all the other protocols we talked about

are interior protocols.

Now this gateway protocol is going to use a path vector

to use a number of the autonomous system hops

that it needs to use instead of router hops.

Now, I'm not concerned with how many routers

I have to go through necessarily,

but I'm more concerned with how many systems

I have to go through.

Again, this makes sense when you start thinking

about the fact that BGP is used

as the backbone of the internet.

It's made up of lots of different autonomous systems

as we move from one ISP to another

and so this is what we want to think about

when we talk about autonomous systems.

Now this has gained widespread utilization

and is used all across the internet.

BGP makes the internet run.

The big problem with it is that

it doesn't converge very quickly

because of the large scale of all of these networks.

So if you add a new router or a new system to the internet,

it can take an hour or two

before it starts getting populated

and even more as it goes across the entire internet

to let them know that it now exists.

When we talk about these routers,

we have all of these different routes

and we have to think about the believability of a route.

Now, what exactly does that mean

when we talk about believability of a route?

Well, let's say I have a network that's using

more than one routing protocol

because my routers can support multiple protocols.

I might be running RIP, and I might have OSPF.

Both of them being used on the same router

in the same network.

Now, how do I know which one

I'm going to go with when I'm a packet

and the router needs to move me around the network?

Well, these routing protocols

are going to be considered more or less believable

based on some different factors that we have.

For example, RIP is considered less believable than OSPF.

Now, why is that?

Well, this is because routers use an index of believability,

which we're going to call AD

or the administrative distance.

Now, if a route has a lower administrative distance,

it's going to be considered more believable,

and it's going to be better to have a lower number.

So I like to think about this like golf rules,

the lower the number, the better it is

in terms of believability.

Now here's a chart for you with the administrative distances

of the different protocols we talked about.

If you're dealing with a directly connected route,

this is going to be the most believable.

Why?

Because the router is directly connected

to another router so it knows itself

and it trusts its own opinion that it's connected.

Now, this makes a lot of sense, right?

So if I know you personally, we're holding hands,

we're both connected and therefore the trust would be zero.

That's the idea here with the directly connected route.

It is fully trusted.

Now a statically configured network

is going to have an AD of one.

That's the next most believable

because routers do what they're told.

And if you, as a network administrator

went in and configured a static route, you told that router,

I want you to believe this above everything else,

unless you're directly connected to somebody else.

Beyond that, you're always going to believe me.

After our directly connected routes and our static routes,

we're then going to trust EIGRP next.

After that we believe, OSPF and then RIP,

and then external EIGRP.

And then as we go all the way to the bottom of our chart,

we see the worst believability, the unknown or unbelievable,

which means that it's going to have a rate of 255

for its administrative distance.

The reason why we set it at 255 is basically we say,

I can't find this network anymore.

It is totally unbelievable

and so I don't want to run traffic that way.

Now for the exam, do you have to memorize all these numbers?

No, but you should have an idea that directly connected

is the most believable, then static,

then followed by things like EIGRP, OSPF and RIP.

If you think about the fact that RIP

was one of our earliest protocols,

it would be one of our least believable.

OSPF was an improvement to RIP

so it's a little bit more believable.

And then we had EIGRP, which was an improvement to OSPF.

So again, it's more believable.

This is kind of a memory game that I use

to try to remember which ones are most believable

and which ones are least believable.

Lastly, we have metrics associated with all of these routes.

And when we look at these metrics

and we look at these routes,

there's going to be a routing protocol

that's able to choose which path it's going to go on.

And we do this based on metrics.

These are things like hop count, believability,

reliability, bandwidth, delay, costs, or other metrics.

Each protocol uses a different metric

to determine which route it should use

and which one is it going to be considered faster or slower.

Depending on which route it is,

it's going to determine which metric you're going to use.

And so when we're dealing with metrics,

it's always going to be thinking about the fact

that lower numbers are better, higher numbers are worse,

when we deal with routing.

Anytime we talk about hop count,

we want the least number of routes.

If we start talking about bandwidth,

we want the lowest cost of bandwidth.

And that gives us the highest amount of bandwidth.

And so lower costs becomes better.

If we're dealing with delay,

we want the least amount of delay.

Believability, we want the lowest number.

We want a zero for directly connected, right?

Or one for static route or one of those lower numbers

for the administrative distance.

That's the idea here.

Lower numbers are always going to be better.

You see this trend in routing

where the metrics lower is always better.

And so remember that for the exam.

Lastly, I wanted to give you this summary slide

here on the screen.

This is one of those things I'd like you to write down

in your notes so you can remember

all about the routing protocols.

This summarizes everything nicely.

From RIP, OSPF, EIGRP.

IS-IS, and BGP.

It shows you which ones are interior,

which ones are exterior, which ones are distanced vectors,

which ones are link states.

And hopefully this will help you

as you study your different routing protocols

and remember the key facts and figures

for them before the exam.

If you think back to our lesson on IP addressing,

specifically with version four,

we talked about the fact, that IPv4

was running out of IP addresses,

and this was becoming a huge problem.

Now, IPV six, honestly, wasn't ready yet to be developed.

And they were still in the process of it.

And so, something else had to come up,

to help us with this problem.

And that is what address translation did.

It was there, to help solve this problem for us.

And there was two versions of this,

Network Address Translation and Port Address Translation.

Now, Network Address Translation is a way for us,

to conserve those limited number of IPv4 addresses.

For example, if I go to your house right now,

how many devices do you have on your network?

You might have five or ten or fifteen.

In my house, we each have a smartphone, a tablet,

a laptop, a desktop, some video game machines,

and there's four of us.

So right there, we've got twelve, fifteen,

twenty devices, right?

Now, if you start adding things up,

like, smart thermostats, and file servers and desktops,

we quickly get to twenty or thirty or forty devices

in any single house.

But, in each house, we only have one public IP addresses.

So, how do all these devices get onto the internet?

Well, that is where NAT and PAT come into play.

Now, NAT or Network Address Translation is going

to allow you to translate your private IP address

into a public IP address,

for routing over the public networks, like the internet.

Now, there's another variation out there known as PAT,

which is Port Address Translation.

And we're going to talk about that

at the end of this video too.

Now, when we talk about different types

of address translation, there are three main ones out there.

There is DNAT, SNAT and PAT.

let's take each one, one at a time.

Let's start out with DNAT,

or Dynamic Network Address Translation.

Now, Dynamic NAT (DNAT) is going to take an IP address,

and automatically assign it from a pool of IP addresses,

and give us a one-to-one translation.

Now, why would we want to use Dynamic NAT (DNAT)?

Well, if you remember, I talked about the fact,

that public IP addresses cost money.

Maybe, you only wanted to pay

for five addresses in your business,

but you have thirty workstations there.

Well, in the old days, only 20% of your people

were going online at any time,

and so, Dynamic NAT (DNAT) worked out really well for that.

The way dynamic NAT would work,

is when you want to get online,

your computer, would go to the router,

it would borrow one of these five IP addresses,

it would do a translation from your private IP

to your public IP and that way you'd be able to use it.

Go online, make the request and then when you're done,

your computer turned that public IP,

back into the router, back to the shared pool.

This way you can maximize your public IP space

for the most amount of internal clients.

And it did all of this dynamically and you didn't have to

worry about it.

Just like it does with DHCP, to give you internal addresses,

this was all done, from a matching of an internal scope

to an external scope.

And so, in just a quick microsecond,

you could then take this address, make the request,

and then give it back.

Now, if you want to think about this, like a family,

let's say you have a mom and a dad,

and two teenagers living in the house,

but you only have two cars.

Well, if somebody wants to go the mall,

they would grab the car keys, get in the car, drive out,

and then when they're done, they'd bring the car back

and put the keys back up,

and then somebody else can grab the keys

and take out the car.

That's the way Dynamic NAT (DNAT) worked.

Now, when we're dealing with Static NAT or (SNAT),

this was a static assignment,

where I would manually assign a private IP to a public IP

and each time it was a one-to-one translation.

So, in this case, if I had five public IP addresses,

I would also have five private ones,

and I couldn't multi share them

the way I could with Dynamic NAT (DNAT).

So, in this case, I have to have one car

for every person, right?

Somebody has to physically do all that assignment as well,

because it's done statically.

Now, why would somebody want to use Static NAT (SNAT)?

You may be wondering,

cause it seems kind of like a silly way to do it,

when Dynamic NAT (DNAT) was available.

Well, Static NAT (SNAT) was really used

just as a security feature.

It was a way to have all those public IP's,

not shown, exactly which client was attached

to each one, to the outside world.

And so, it added a little bit of a smoke screen,

if you will, that kind of hid those devices

behind the router.

Now, the third way, and the most common one

that we use today is what's known as

PAT or Port Address Translation.

In fact, as you're watching this video,

you're probably using PAT on your home network right now,

without even knowing it.

Now, this is what happens when you have multiple private

IP addresses, sharing only one public address.

Now, again, my house, we have fifteen

or twenty different network devices,

but, we only have one public IP.

Now, the problem is all of us want

to get online at the same time, right?

We don't want to have to share that one IP.

Well, by using PAT, we can do that,

because it allows a many-to-one translation,

instead of the one-to-one, the Dynamic NAT (DNAT)

and Static NAT (SNAT) required.

Now, this is a great thing,

because it allows me to take these small networks,

like small offices, and home offices and small businesses,

and be able to connect them through one IP,

out to the internet.

Now, I'm going to show you how this works

by using a diagram, in just a second, so bear with me.

Now, before we do that though,

I want to talk about the different names

of the NAT IP addresses.

They have specific names that you have to memorize

for the exam.

There's the Inside local, Inside global,

Outside local and Outside global.

For your inside local, this is your private IP address

that references an inside device.

For your inside global, this is your public IP address

or your global one that's being referenced

for an inside device.

For your outside local, this is your private IP address,

that's being referenced from the outside

and you have your global device

or your outside global is coming to be a public IP address,

referencing that outside device.

Now again, anytime you see the word global,

I want you to think about public.

Anytime you see the word local,

I want you to think about private,

and then you'll be able to answer these types of questions.

Now, let me show you what all this looks like on a diagram.

Here, I have NAT. Now, where are each of these things?

If I'm dealing with my inside local,

that is my private IP address referencing an inside device,

which is one of the private IP addresses,

referencing an inside device in this diagram.

Well, there might be something like 10.0.1.101.

Which would be PC1, that is my inside local address.

Then, I have to reference an inside global address,

which is a router.

And for our case, that would be 78.1.45.1

It's inside, because it's my network,

and it's global because it's public.

As far as the outside local, that's our private IP address

that references an outside device.

For us, that would be the inside of this router,

or, 10.0.1.1 because that is our outside device,

it's our boundary device, that router.

And then, if I wanted to talk about my outside global,

that's my public IP address, referencing an outside device.

That would be the server, 66.75.58.124

All four of these, have to work together,

for us to be able to get the information

from RPC, 10.0.1.101,

from that local private IP address,

out to the server, that I want to make the connection to.

Now, how does NAT work?

Well, let's take a look at this diagram,

where I have PC1 and PC2,

who want to make a request of a single server.

Now PC1 and PC2, both have private IP addresses,

which are not routable outside my network.

Once, I get to the router, they're going to be dropped, right?

So, when they send a request, from their source IP,

that's their private IP.

That would be the 10.0.1.101

or

10.0.1.102

Now, as part of that request,

they're going to put the destination of the server

that they want to get to.

And so, they're going to send that request

with their default gateway, over to the router.

And this is where the NAT happens,

because it's a NAT enabled router.

When the router gets that request,

it's going to keep track of the fact that 10.0.1.101

was for PC1

and the.102 was for PC2.

And it's going to assign each of them,

an inside global address from its pool

of public IP addresses.

In this case, that 78.1.45.101

and 78.1.45.102

Now, it's going to strip off the source,

that was those private IP addresses

and put on these inside global addresses,

which is publicly routable.

And then, they're going to send the packet off to the server.

When the request comes back to the router,

it's going to strip off those inside global addresses,

put back on the inside local addresses

and send it back to PC1 and PC2, respectively.

That's essentially how NAT works

and this can be either done statically or dynamically

based on those IP addresses and the pool that's

being there, in reserve, at that NAT enabled router.

Now, when we deal with your network at home though,

we're using PAT,

Like I said before. This is port address translation.

The reason for this is it only requires

one IP address on your router.

Now, you can't just take one and give it directly

to PC1 or PC2 though,

because, then, only one of them can get online at a time.

So instead, We're going to use ports,

to keep track of the different segments that we're doing.

So, when PC1 and PC2, make a request to the router,

the router is going to send off a request

from its source address.

and it's going to specify a port number,

to keep track of those requests.

When the request comes back from the server

on that specific port,

it then knows, I need to take that traffic

and forward it to either PC1 or PC2, respectively,

depending on which port number it was.

And that's why PAT is so popular today,

because we only have to have one public IP,

and we can have twenty, fifty, a hundred devices,

all sitting behind that router,

and being kept track of based on those ports.

The last topic we need to talk about

in this routing section is how multicast routing works.

Now, multicast routing is when you send traffic

to a class D IP address, known as the multicast group.

Now, our goal here is for us only to send traffic out once

and then have all of the devices

who want to get that information,

and anybody who doesn't want to get it, doesn't get it.

Now, there are two primary ways of doing this.

The first is known as IGMP,

or the Internet Group Management Protocol.

The second is PIM, or Protocol Independent Multicast.

We'll cover both of those in detail in this lesson.

Now, IGMP, or the Internet Group Management Protocol,

is used by clients and routers

so that the routers know which interfaces

have multicast receivers on them.

This allows a client to join a multicast group

and then be able to receive messages that they wanted to get

through this multicast group.

Now, there are three variants of IGMP.

The first one was IGMPv1.

And then it was improved to version two and version three.

Now in version one,

clients could request joining the group

and every 60 seconds, their router would go back and say,

do you still want to be here? Do you still want to be here?

Do you still want to be here?

And you could see how that causes

a lot of unnecessary traffic.

In version two, clients had the ability

to send leave messages to exit the group when they wanted.

Essentially now, the router's just going to assume

you want to be there until you told it

that you didn't want to be there.

Finally, in version three,

the client could request a multicast

from only a specific server and then choose,

did I want to get my messages from one server

and not from server two?

That was allowed.

It would also allow for source specific multicast,

which is what this server request was called.

Now, this allowed us to have multiple video streams

to a single multicast stream.

Now, almost like you'd have with cable TV,

where you could dial into the channel you wanted,

that's kind of what we were doing here digitally,

using the IGMP protocol.

So how did IGMP work?

Well, let's look at this diagram.

If I have a server that wants to send out traffic,

it's going to send it to the router

and the IP address of the multicast group.

In this case, 239.2.1.3.

Right now, the router is not sending it anywhere,

'cause nobody's requested that information.

But if PC2 sends a request message to router one,

now router one is going to remember that PC2

wants to be a part of this multicast group,

and anything it gets as part of this multicast group

will now be sent over to PC2 as well.

And only going to go to PC2,

because remember, PC1 and PC3

didn't ask to be a part of this group.

So hopefully you can see the benefits of this now.

In this example here,

we have PC1 and PC3 that wanted to be in there

and they could join the group as well.

And then the server can send it out to all three people

with only one copy of the message being sent in.

That's the benefit of this.

The second thing we want to look at is PIM,

or the Protocol Independent Multicast.

PIM is going to allow multicast traffic to be routed

between multicast enabled routers.

Multicast routing forms this multicast distribution tree,

and it really works between all these different routers

together because IGMP

was more about clients and servers together,

where PIM is much more focused on the routing part of this.

Now, there are two different modes in PIM.

There's a PIM-DM, which is the Dense Mode,

or PIM-SM or Sparse Mode.

In Dense Mode, we're going to use a periodic flood and prune

behavior to form an optimal distribution tree

across these routers.

And this can actually cause a negative performance impact

on your network, and because of this, in modern networks,

we really don't use it.

Instead, we tend to use Sparse Mode.

With PIM-SM, or Sparse Mode,

this is going to use a shared distribution tree initially,

and then it's going to, over time, find the best tree.

Now, when we start out,

that shared distribution tree is not optimal, but over time,

we're going to learn where the best tree is,

and then start switching over to the Shortest Path Tree,

or SPT, once it determines what that actually is.

Now, I know that's a lot of words.

So let's take a look at some pictures

to hopefully understand how this works a little better.

Here you can see PIM-DM or Dense Mode.

Now, what happens in Dense Mode is,

to begin with, it has this flooding procedure

where all of the routers,

every router in this entire network,

is getting all of the information.

Now, as you can see, that's a lot of traffic,

but we do already have the optimal way of getting there

from that multicast source to the multicast destination,

because it comes all at once with that big flood.

So in this case, it would be going down the left side

of that pyramid.

Now, as we go through,

it's going to then prune off all the non-optimal routes,

which in this case is all the routers off to the right.

It sends out this prune message saying,

hey, I don't need this traffic.

I'm not part of the optical route. Get me out of here.

And that way,

they can go ahead and drop those from the route.

Now, after sending all these pruning messages,

we now have the optimal path

between the source router and the last hop router,

giving us the quickest and easiest path.

Now, this is the idea of flood and prune.

And this happens every three minutes,

trying to find a more optimal route,

which again, can cause a really big performance hit

to your network, because we're flooding it

every three minutes.

And this is why we don't really use it much anymore.

Instead we use Sparse Mode.

Now Sparse Mode, or PIM-SM,

is going to use a shared distribution tree.

Essentially, when the server sends out the first message,

the router's going to send it over any way it can

to get it from the first router down to the last hop.

In this case, it's going to be sending it

to this rendezvous point first,

and then down to last router hop.

Now, this isn't the optimal path,

but it is a path and that's okay and it works.

And so this information is going to start to flow.

As you can see,

there are four of the six routers that got the information.

Two of them weren't even bothered to get the information,

and so they saved all that resources,

because they weren't being flooded.

Now, over time, we figured out this was a sub optimal path,

and instead, it would be a lot quicker

to go down the left-hand side of the diagram.

So, we're going to start switching over to that,

getting rid of all these unused branches

and then going to the Shortest Path Tree, the SPT,

and that now gives us the optimal tree

in this shared distribution tree,

just like we had before in Dense Mode.

Now you can see how this uses a lot less resources

than Dense Mode did,

but it did take us a little bit more time

to find that optimal way.

That's the trade off here.

Do you want to get optimal right from the start,

but flood your network?

Or can you wait for optimal

and use a lot less resources?

In most modern networks,

we choose PIM-SM, or Sparse Mode,

because it works better on our networks

and uses less resources upfront,

and eventually gets that optimal distribution

that we're looking for.

W

Routing

Routing fundamentals.

All right, we have covered a lot of information

up to this point in the course,

but we still haven't left our local area network yet.

Once we're ready to leave our network,

this is where routers are really going to start

coming into play.

When we start talking about connecting

to subnets within our network

or connecting our internal network and an external network,

we have to use a router.

So in this section of the course,

we're going to be talking all about routing fundamentals.

The first thing you must understand

is the function of a router, which is to route traffic.

Now, I know that sounds kind of silly,

but essentially that's what it's going to do.

It's going to forward the traffic in one direction or another

between different subnets or between an internal

and external network or between two different

external networks.

Each subnet or external network is going to be

its own broadcast domain because routers

are used to separate broadcast domains.

Unlike switches, which are layer two devices,

and therefore can only maintain one broadcast domain

for everything that's connected to the switch,

the routers are going to be layer three devices.

And they're used to separate and break apart

those broadcast domains into smaller portions to provide

additional efficiency and security to your networks.

Now, before we go too far in this lesson,

it's important to note that there's a difference

between the real world and the exam.

In the real world,

you may often find yourself using a layer three switch,

also known as a multi-layer switch.

When you do this, it can perform routing functions for you.

Many small office home office networks

or small and medium sized businesses

will often opt to use a layer three switch

because it can handle both functions.

It can handle layer two forwarding

when it's acting like a switch

and layer three routing when it acts as a router.

For the exam though, remember,

if you're using a multi-layer switch,

it is functioning as a router.

And so we're going to treat it as a router,

or a layer three device.

Now in this entire section,

we're going to be referring to these devices as a router,

even if I'm using a multi-layer switch in the real world.

Now for the exam, if they say switch,

they're talking about a standard layer two switch.

If they say multi-layer switch or router,

they're referring to layer three functionality of a device

that we call a router during this course and the exam.

So how does the basic router perform this work?

Well, let's consider this diagram here.

I have two networks, one on the left side

and one on the right side of the screen.

As you can see, PC one is connected to our left network,

and PC two is connected to our right network.

Now, to connect these two networks together,

we have two routers and a serial connection

or wide area network connection between them.

For now, we're not going to focus too much on that connection

because we're going to cover that

in a different section of the course

when we talk about all the different WAN technologies.

Right now just realize that there's connection between them,

and it's a long-distance one.

This could be a fiber connection, a serial connection,

a satellite connection, a VPN or any other kind of link.

It really doesn't matter right now.

As long as you understand that there is connectivity between

these two routers and they can communicate to each other

over that WAN connection, that's all we need to know.

Now if I'm sitting at PC one and

I want to send a message to PC two,

I can't just send it through ARP like I did with a switch.

If you remember back in switching,

we talked about how PC one would send an ARP packet

to the switch.

And if it didn't know where to deliver it,

it would send out every single switch port

based on that MAC address.

Well, PC one can and will still do that.

But what's going to happen here is that our ARP request is

going to go up to the switch and the switch is going to

realize that it doesn't know the MAC address associated with

that request.

So it's going to forward it out as default gateway.

The default gateway is the router.

Now that router is then going to respond to the ARP request

on behalf of the destination device.

At this point,

we're now going to have to leave MAC addresses behind

because MAC addresses only work internally in our network.

Once we get to the router,

we're going to switch to using IP addresses

or logical addressing at layer three.

This is where we begin to make our layer two

to layer three transitions.

At this point,

PC one has determined the MAC address

for where the router is

because it needs to send the packet to get out of this local

area network and leave to go find this device.

The left router in this case wants to send

the information to PC two,

because that's what PC one told it to do, to do that,

it's going to pass the information over to router two,

and then router one is going to get the data frame,

which is layer two from PC one.

The writer will repackage it up as a packet,

which is layer three, and then add an IP header to it.

This allows router one to then push the data over its

default connection as an IP packet.

And the data will then be sent across the serial connection

to get to router two.

All right,

once that packet gets to router two,

router two is going to

strip off the IP header and bring it back down to layer two

data frames by adding a MAC address for PC two.

This way it's going to correlate PC two's MAC address with the

destination IP of the packet,

because router two knows who PC two is, it's on its network.

Now, since router two knows the MAC address for PC two,

it can call to PC two directly over layer two

and send that data frame through the switch.

The switch is going to take that information and push it

from router two down to PC two

just as if the two of them were computers sitting on the

same switch, trying to communicate locally.

When PC two wants to send a response to PC one,

this process is going to be reversed.

And that way the communication can continue back and forth

between PC one, its switch, router one,

the WAN connection, router two, its switch, and PC two.

Alright, so a quick summary

of what we just saw in terms of data flow.

We started out with layer two pieces of information called a

data frame coming from PC one.

When it got to router one,

it got packaged up as a layer three packet

to cross the wide area network.

When it got to router two,

it stripped it back down to layer two,

to make it a data frame again,

using MAC addresses to deliver it to PC two

on its local network.

Essentially, this is how routing works.

Now at this point, it's pretty simple,

but it's going to get a lot more complicated as we start to

move packets across not just a direct way in link

like this one,

but over the world's largest wide area network,

the internet.

Now in this section of the course,

we're going to talk about all the different protocols

that are used in routing,

including static and dynamic routing

and address translation and multicast routing.

We're going to spend some time in three different domains in

this section of the course, including domain one,

networking fundamentals, domain two,

network implementations and domain five,

network troubleshooting.

Within these domains,

we're going to focus on objectives 1.4, 2.2 and 5.5.

Objective 1.4 states that given a scenario,

configure a subnet and use appropriate

IP addressing schemes,

objective 2.2 states that you must be able to compare and

contrast running technologies and bandwidth management

concepts, and objective 5.5 states that given a scenario,

you must troubleshoot general networking issues.

So let's get started talking all about routing our packets

in this section of the course.

So how does a router make its routing decisions?

Well, it uses a routing table.

Just like our switches used a MAC address table

or a CAM table we're going to use routing tables

to decide where our packets need to go inside

and outside of our networks.

Now, these routing decisions are going to contain

layer three information,

and they're going to do a layer three to layer two map.

The router is going to use an ARP cache to map an IP address

to a given MAC address.

And this way it knows inside it's local area network

which IPs are going to relate to which MAC addresses.

Now each packet forwarding decision is then going to be based

on it's internal routing table.

Those internal routing tables are really focused on the

logical address side of things or that IP address.

So let's dig a little bit deeper into these routing tables

to really see how they work.

These tables are kept by the router

and they help them determine which route

is best fit for them,

as they're trying to route the traffic

throughout the different networks.

Now a route entry has a prefix and the longer the prefix is

the more specific that network is.

So if we look here at this chart,

I have three different networks showing up.

There's 125.0.0.0.

I have 161.5.0.0.

And I have 134.7.0.0.

Now, which of these would have the longest prefix?

Well, it's the bottom two because they're the most specific.

These are the ones that are most specific

because they have the first two octets specified.

Whereas the first one with the 125.0.0.0

only has the first octet specified.

So it is the least specific.

So if I'm dealing with something like 10.1.1.0/24,

that is really really specific because I have

the first three octets specified, the 10.1.1.

That means I only have 256 possible IPs left

because of that .0 at the end.

Now, instead if I use something like 10.0.0.0/8

this means I only have one octet specified

and the other three are really wild cards.

So I can have up to 16 million IP addresses

because of those three sets of zeros.

So you can see here the longer the prefix we have

or the higher the CIDR notation,

the more specific that route becomes.

Now, when we look at these routing tables

and we look at all the routes in the table,

those routes are going to tell us

what the destination network is

and which router it should go to to get to that network.

It'll also tell us which port on the router is going to be used

to send traffic out and the cost of that route,

which is basically like switching,

where it's dependent upon numbers of different factors,

like the link speed and other factors like that.

Now we're going to talk specifically about those different

factors in another lecture

when we start diving into routing protocols.

But for now just realize that every link in a route

does have a cost associated with it.

So what are some of the sources of routing information

that we can have?

Well, there are really three different sources

that routers are going to use.

The first one is called a directly connected route.

Now a directly connected route is learned by

a physical connection between two routers.

So if you look on the screen here,

I have three different routers.

Router one, router two, and router three.

Now router two knows where router one is and router three

are because it has direct cabling between those

and this is shown by those zigzag lines

or that lightning bolt looking line

that's here on my diagram.

This denotes that it is a serial connection.

Next we have static routes and this is the second way

that routers know how things are connected to them.

Now a static route are routes that are configured

by an administrator manually.

So for example,

router one knows how to get to router two

because it's directly connected,

but it doesn't know how to get to router three yet.

So for me to tell it how to get through router three,

I can put a route into my routing table that says

every time you want to send something to router three,

just go ahead and send it through router two.

That would become a static route.

Now, there is always one default static route

in every router.

And it's a special one.

It's known as 0.0.0.0/0.

Basically it says to the router,

if you don't know where to go, just go here.

It's kind of like your default gateway.

And so for router one,

it might have a default route of 0.0.0.0/0.

That says go to router two anytime you don't know

how to get someplace.

And then it becomes router two's problem

to figure out what to do with that traffic.

Now the third way that routers can do this

is by using what's known as dynamic routing.

And this is done by using dynamic routing protocols.

These protocols are learned by exchanging information

between routers automatically based on the protocols.

Now, instead of me having to go into router one

and tell it how to get to router three,

instead I can just let router two do it.

Now, the idea here is that when router one

and router two become directly connected,

they start sharing their routing tables.

So router one is going to say, hey router two,

do you know how to talk to some people?

And router two will say,

oh yeah, I'm connected to router three.

So anytime you've got something for router three,

just send it to me and I'll pass it on for you.

And they do this all by themselves automatically

using these dynamic routing protocols.

This is really great especially in large networks

because we don't have to manually configure everything.

So for example,

think about if I took your router at home

and I had to put down every single route for you

to be able to find every website

you wanted to get to on the internet.

You would not be able to do it.

It is just too many things out there, right?

So instead we use dynamic routing to accomplish this.

When you connect to the internet,

you connect to your ISP and they know that they are

now your default route.

Anything you want to get to that's not inside your network

you send it to your ISP

and then your ISP will send it to the next router.

And it keeps going up that chain that way.

So that's a great overview of

the three different types of routes.

We have directly connected routes,

static routes, and dynamic routes.

So let's go ahead and dig a little bit deeper into each of

these three types so you can understand them

a little bit more.

First, let's take a look at a directly connected route.

When we look at a directly connected route,

it's going to look something like what you see here

on my screen.

Now as you can see router one and router two are directly

connected with that zigzag line.

That's that serial connection.

Now these routers both know how to get to the other switches

because they're directly connected to them, right?

So if I look at router one's table,

it says I'm connected to 10.0.1.0/24,

which is the network that it owns on switch one.

It's also connected to 192.1.1.0,

because this is the serial connection

between the two routers.

Now notice that router one does not know how to get to

the 10.0.2.0 network,

because this is on switch two

and that's hanging off of router two.

It has no information on this because it only knows things

that are directly cabled to it.

Now, if we go further into static routing,

I can actually write that down as part of my default route

or 0.0.0.0 for router one.

Now this tells me that anytime I don't know an IP address,

I'm simply going to send it out port serial 1/1,

which is going to push it over to router two.

And so in this case, if PC one tries to get to PC two,

it would get as far as router one

and then router one's going to say ugh,

I don't know how to get to 10.0.2.2,

but maybe router two does.

And it's going to push that over to them

over that wide area network connection,

that serial connection that's directly connected.

That's how this manual configuration works

with a static route.

Alright, so I think you understand how

direct connections work and how static routing works.

Let's take a look at the dynamic routing protocols instead.

Now dynamic routing protocols can have more than one route

for an existing network.

If I have a more complex network diagram,

like these five routers that you see here,

and I wanted to get from one to five,

I can go a couple of different ways.

I can go one, two, three, four, five.

And I really just start zigzagging all over the network.

Or I might go one, two, four, five.

Or I might go one, three, four, five.

There's lots of different ways for me to go

because all the different connections that are there.

So how does my router know which one is best?

Well, the dynamic routing is going to get negotiated for us

based on the number of hops that are there,

which is the number of times I have to

go through a different router,

the number of link bandwidth that's available.

So how fast it is.

I might go through the ones that are faster or slower

and other criteria that are out there.

All of these dynamic routing protocols can be able to be

supported depending on what routers you're using

and different criteria of how you want to set them up,

depending on how we configure them.

Now we're going to spend an entire lesson

on the different types of dynamic routing protocols.

So we can really dig into each of them.

And you can really understand because you're going to get

test questions on them come test day.

Now, the last thing I want to talk about in this lesson

is preventing routing loops.

Just like we had an issue with switches

where you can get loops and broadcast storms,

you can get issues with routing

if things start going into a circular manner.

Things will just end up getting lost in cyberspace, right?

So, to prevent that we have two different techniques

we can use.

These are known as the split horizon and the poison reverse.

Now with the split horizon,

this is going to prevent a route that's learned

on one interface from being advertised back out

that same interface.

So in this example,

you see router one knows how to get to router two

because of that direct connection between those two routers.

Now it's not going to go and tell router two

how to get to router two based on that same connection,

because guess what, it came in that connection.

So it can't go out the same connection.

This is essentially what our spanning tree protocol

did for us in our switching networks.

But now we can do this inside of routing.

Now, the second way we do this is what's known as

a poison reverse and a poison reverse is going to cause a route

that's received on one interface to be advertised back out

that same interface, but with a really really high cost

so that nobody would ever want to use it.

Now, these are just two different techniques

for you to stop writing loops.

You could use one or the other.

It really doesn't make a difference.

As long as you're using one,

it's going to prevent that running loop for you.

The first one is I'm just not going to repeat anything.

The second one is, I'm going to repeat it,

but I'm going to tell you it's so expensive

that you'll never ever want to use it.

So let's go ahead and take a look at an example

of these routing loops

and how we can make sure we prevent them.

So here's a network with no issues at all.

I have three routers here.

I have router one, router two, and router three.

You can see the different networks based on the IPs

and their routing tables are shown here on the screen.

Now we're going to look specifically at the routing tables

for router two and router three in this example.

Now, if I start having an issue, like for instance,

the network connection from router three,

for the 10.1.4.0 network went down

because ethernet 0/1 went down,

what do you thinks going to happen?

Well, router two still thinks it can get to that network

because it says, hey,

I can get there through my serial port of 0/1,

because I have a connection to router three.

Now if router three went down, it's going to say,

I don't know how to get there anymore.

And so it's going to ask its friends

using the dynamic router protocols.

And so at this point it's going to say hey router two,

do you know how to get to that network?

And what happens is router two would say oh yeah,

I know how to get to that network.

I can do it in just one hop.

So go ahead and send it to me.

And then router three says, oh great.

That means I know how to get there too,

because I'm connected to you router two,

and you know how to do it.

So that one hop for you becomes two hops for me

and it keeps going back and forth.

And then router two goes, oh, I know how to get there.

Router three knows how to get there.

And he says, he can do it in two hops,

so I can do it in three hops.

And it keeps going back and forth until both of those

get to be such a high number that neither of those routers

can actually ever get to that route anymore.

Now, this is the idea of what a poisoned reverse would do.

But when you use a poison reverse

instead of making it go one at a time

and keep iterating up, it would immediately just say hey,

I know how to get there and it will take me a thousand hops.

And so it's got such a huge cost

you won't want to send it to me.

That's the way that router three can say,

I don't have this route anymore.

Now if you don't use poisoned reverse

and you don't use split horizon,

what ends up happening is you have this loop that happens.

And two says I can do it in one,

three says I can do it in two.

Two says I can do it in three and they keep counting up.

And that eats up a lot of your resources in your network

by causing this loop

and those two sending packets back and forth to each other

continually increasing that cost until it gets so high

that they stop sending traffic.

Now if there's no other way to get to that network,

it's just going to keep going in this infinite loop

and that's going to cause a real problem for you.

This is why it's really important to make sure you're

setting up your poison reverse or your split horizons.

In the last lesson, I talked about the fact

that we can use dynamic routing protocols

so routers can tell each other the routes they know.

But I said we would talk more

about those specific writing protocols later on.

Well, in this lesson, we're going to cover

each and every one of those

that you're going to need to know for the Network+ exam.

Now there are two different types

of dynamic routing protocols.

There are internal ones and external ones

and these are the basic categories.

Now, interior ones are things like

interior gateway protocols that operate

within a network or within an autonomous system.

External gateway protocols will operate

between autonomous systems on those exterior networks.

So for example, the internet

is a really large exterior system

so it's going to be using exterior gateway protocols.

Your networks inside your intranet,

even if you have multiple routers and switches there,

are going to operate using interior gateway protocols.

And we're going to go through some examples

of both of these types of protocols in this lesson.

Now first, let's talk about the router advertisement method.

This is a characteristic of every routing protocol.

Every dynamic routing protocol is going to look at routing

just a little bit differently, though.

Some of them are going to use things

known as distance vectors and others

are going to use things known as link states.

Now some of them don't fit neatly

into either of these two categories

and they become a hybrid of both of them.

Now, what this means is that there's some method

for the route to be received, advertised,

and provided to somebody else.

And you have to figure out how you're going to do that.

There's different ways of doing it.

It can be based on the measurement of cost.

That would be something like a distance vector.

If could be based on how many routers

you have to go through,

it might be something based on the link state of it.

All of those are valid ways,

depending on the protocol you're using.

And this is where you become much more concerned

with the different ways of doing things.

For instance, if you're going to be using a link state vector,

this is where you're going to be concerned more with link speed

and what is the quickest method of getting there?

If you have to go through four routers,

but it's quicker than going through just one.

That's okay if we're dealing with link state,

but if we're dealing with distance, that would be backwards.

We only want to go through one router, even if it's slower.

This is the way we have to look at these different things

and figure out what's going to be best for us.

Now, we're going to talk about all of these

as we go through this video

and hopefully it'll make a little bit more sense to you.

First, let's talk about distance vectors.

Now, when you're dealing with a distance vector,

this is about the number of routers

you're going to be connecting through

for a particular route.

And so if you're dealing with a distance vector,

it's going to send a full copy of its routing table

to everybody else who's directly connected to it

at regular intervals.

Now, the bad thing about this is it has

what's known as a slow convergence time.

Now, what is convergence?

Well, convergence is the time it takes

for all of the routers to update their routing tables

in response to a topology change.

So if I add a router or I take one away,

how long is it going to take for everyone on the network

to know that happened?

So in this example, you'll see I have three routers.

I have routers one, two, and three.

And if I added a fourth router in,

it's going to take some amount of time for router four

to tell the other three routers that it's there

and how it's connected.

That's the idea of convergence time.

Now, once everybody knows all the same information

across all four routers

then you have what's known as a converged network.

Now, one of the ways that we can speed up

our convergence time is to actually use a hold-down timer.

So instead of updating our routing tables every 30 seconds,

we might update it every three minutes.

Now, by doing that, it's going to allow us

to converge faster

because there's less changes across the network.

Now, if there's more changes,

it's going to take us more time to converge.

So if we do less changes and we spread that out

from 30 seconds to three minutes, maybe to six minutes,

that's going to be better for us

in terms of convergence time.

Now, when we deal with a distance vector,

it's really also concerned about a thing known as hop count.

And this is how many times

I have to go through another router to get somewhere.

So in this example, what's the quickest way

to get from router three to router two?

Well, if you're only concerned with hops

or the number of routers you have to go through,

you're going to go directly from three over to two

over that slow, one-megabit-per-second connection.

Now, if you're concerned with link state on the other hand,

you're going to be concerned with the fastest way

to get there by going where the most bandwidth is available.

And that would actually be going

across the 100-megabit-per-second connections.

So I go from router three to router one to router two,

and that will be much faster than going directly

to router two from router three.

Now that's again not going to account for the fact

that if we're doing a distance or link state vector.

If we're using a distance vector, we don't consider speed.

We just count the hops.

So we're going to go direct from two to three,

but if we're dealing with a link state vector,

we're going to go based on speed.

And that's the big difference here.

So you have to think about that as you're figuring out

which protocol you're going to use

and which is going to be the best way

for you to have information flow in your network.

Now, when we deal with link state, we start worrying

about the cost and the speed of all these connections.

This is going to require all of our routers

to know about all the paths of all the other routers as well

so it can figure out what the best path is

to send the information around.

Now, this information is flooded out

through the link state domain when you're using OSPF,

which is one of our routing protocols.

Another one we can use is IS-IS

and this again is a link state protocol

to ensure the routers have a synchronized information

inside their routing tables.

Now, with that synchronized information,

they can then make the best routing decisions.

Now, we're going to talk specifically

about these two protocols in just a little bit here

so hang in with me.

Now, the link state does have a faster convergence time

than distance vectors and it does use that cost

and other factors as metrics

when it figures out what the best way of routing traffic is.

Now, this also includes things like your link speed,

because the link speed is really important

of how much bandwidth you have to send the data across.

Each router is going to construct

its own relative shortest path based

on where it sees itself in the logical diagram

and then it calculates the distance

of how it's going to get to the other places.

So let's take an example of you sitting in Florida,

and I'm sitting here in Washington, DC,

and we both want to get to California.

Now we can have different methods to get there based

on where we sit in the typology of the United States, right?

If we're both going to get in our car and drive there,

we have to figure out based on the highway speeds

and the slowness of those speeds

and which traffic there is

and how many states we have to go through

and which highways we're going to go to get over there.

So let's say we had to go 3,000 miles

to get to California from Washington or from Florida.

Well, if I can go 60 miles an hour the whole time,

but you can only go 30 miles an hour,

well, I'm going to get there a lot faster, right?

Because I can go two miles for every one that you go.

Now that's the idea.

So as we start figuring out

how we're going to go through this using link state,

we can start taking speeds into account and figuring out,

hey, maybe I'm going to take this highway

versus that back road.

Or, there's a lot of traffic on that highway

so I'm going to take the back roads instead.

Well, our routers do the same exact thing

using those links state protocols.

Now let's talk about the first routing protocol here.

This one is known as RIP, R-I-P,

and it's one of the oldest routing protocols out there.

It stands for the Routing Information Protocol

and it is an interior gateway protocol

that is used internal to your networks.

This is a distance vector protocol

and so it's going to rely on hop count

to figure out the fastest path.

Now it's all about how many routers

we're going to have to go through

and the maximum number of hops you can hit is 15 with RIP.

Now, if you hit 16 or more routers,

the connection is going to be considered dead

and it's just going to drop the packet

and wait for you to retransmit it.

Now, again, this is the oldest dynamic routing protocol

out there and it does provide updates every 30 seconds

and so it becomes really hard to maintain convergence

when you're dealing with a RIP network.

Now, RIP is really easy to configure

and it sends out its information using UDP as its protocol

and so it does have that fire and forget method.

The next routing protocol we have is known as OSPF

which is really popular.

This is known as Open Shortest Path First.

OSPF is another interior gateway protocol,

but unlike RIP it doesn't use distance vector.

It uses link state.

So it is concerned with costs and this way

it's going to be a lot more efficient.

Now, going back to our example of having the three routers,

router one, router two, and router three,

what is the shortest path for us to go

from router three to router two?

Well, it's actually going through router one

because the speed there is going

across a 100-megabit-per-second link

instead of going over a 10-megabit-per-second link.

Cost here is based on link speed not on hop count.

And so OSPF will help you get there fastest

using that link state variable.

Next, we have

the Intermediate System to Intermediate System

known as IS-IS.

This is another interior gateway protocol

and it functions a lot like OSPF.

It again is going to use cost as its link state measurement.

And this cost is based on link speed between two routers.

It functions a lot like OSPF,

but OSPF is still dominant in the marketplace

and used very widely where IS-IS

didn't really see widespread adoption.

The next routing protocol we have to discuss is EIGRP

or the Enhanced Interior Gateway Routing Protocol,

which you can probably guess

is the interior gateway protocol based on its name.

Now this is an advanced distance vector protocol

that uses both bandwidth and delay to make it a hybrid

of the distance and link state protocols.

It does count the delay that exists,

which is how many hops there are,

as well as the cost that's available

with each of those links to figure out their speed,

making it that nice hybrid.

Now, this hybrid protocol was developed by Cisco

as an upgrade to OSPF and it is very popular

if you're using a Cisco-only network.

Because it's proprietary,

meaning you can only use it with all Cisco products,

you're not going to see it a lot if you're using Juniper

or Brocade or other routers in your network.

Again, it hasn't gotten the widespread acceptance

that OSPF has because OSPF can be used on any device

in any networks, not just Cisco.

The last protocol we're going to talk about is BGP

or the Border Gateway Protocol.

This is an external gateway protocol and on the exam,

if you're asked which of these

is an exterior gateway protocol,

the only answer you should be looking for is BGP

because all the other protocols we talked about

are interior protocols.

Now this gateway protocol is going to use a path vector

to use a number of the autonomous system hops

that it needs to use instead of router hops.

Now, I'm not concerned with how many routers

I have to go through necessarily,

but I'm more concerned with how many systems

I have to go through.

Again, this makes sense when you start thinking

about the fact that BGP is used

as the backbone of the internet.

It's made up of lots of different autonomous systems

as we move from one ISP to another

and so this is what we want to think about

when we talk about autonomous systems.

Now this has gained widespread utilization

and is used all across the internet.

BGP makes the internet run.

The big problem with it is that

it doesn't converge very quickly

because of the large scale of all of these networks.

So if you add a new router or a new system to the internet,

it can take an hour or two

before it starts getting populated

and even more as it goes across the entire internet

to let them know that it now exists.

When we talk about these routers,

we have all of these different routes

and we have to think about the believability of a route.

Now, what exactly does that mean

when we talk about believability of a route?

Well, let's say I have a network that's using

more than one routing protocol

because my routers can support multiple protocols.

I might be running RIP, and I might have OSPF.

Both of them being used on the same router

in the same network.

Now, how do I know which one

I'm going to go with when I'm a packet

and the router needs to move me around the network?

Well, these routing protocols

are going to be considered more or less believable

based on some different factors that we have.

For example, RIP is considered less believable than OSPF.

Now, why is that?

Well, this is because routers use an index of believability,

which we're going to call AD

or the administrative distance.

Now, if a route has a lower administrative distance,

it's going to be considered more believable,

and it's going to be better to have a lower number.

So I like to think about this like golf rules,

the lower the number, the better it is

in terms of believability.

Now here's a chart for you with the administrative distances

of the different protocols we talked about.

If you're dealing with a directly connected route,

this is going to be the most believable.

Why?

Because the router is directly connected

to another router so it knows itself

and it trusts its own opinion that it's connected.

Now, this makes a lot of sense, right?

So if I know you personally, we're holding hands,

we're both connected and therefore the trust would be zero.

That's the idea here with the directly connected route.

It is fully trusted.

Now a statically configured network

is going to have an AD of one.

That's the next most believable

because routers do what they're told.

And if you, as a network administrator

went in and configured a static route, you told that router,

I want you to believe this above everything else,

unless you're directly connected to somebody else.

Beyond that, you're always going to believe me.

After our directly connected routes and our static routes,

we're then going to trust EIGRP next.

After that we believe, OSPF and then RIP,

and then external EIGRP.

And then as we go all the way to the bottom of our chart,

we see the worst believability, the unknown or unbelievable,

which means that it's going to have a rate of 255

for its administrative distance.

The reason why we set it at 255 is basically we say,

I can't find this network anymore.

It is totally unbelievable

and so I don't want to run traffic that way.

Now for the exam, do you have to memorize all these numbers?

No, but you should have an idea that directly connected

is the most believable, then static,

then followed by things like EIGRP, OSPF and RIP.

If you think about the fact that RIP

was one of our earliest protocols,

it would be one of our least believable.

OSPF was an improvement to RIP

so it's a little bit more believable.

And then we had EIGRP, which was an improvement to OSPF.

So again, it's more believable.

This is kind of a memory game that I use

to try to remember which ones are most believable

and which ones are least believable.

Lastly, we have metrics associated with all of these routes.

And when we look at these metrics

and we look at these routes,

there's going to be a routing protocol

that's able to choose which path it's going to go on.

And we do this based on metrics.

These are things like hop count, believability,

reliability, bandwidth, delay, costs, or other metrics.

Each protocol uses a different metric

to determine which route it should use

and which one is it going to be considered faster or slower.

Depending on which route it is,

it's going to determine which metric you're going to use.

And so when we're dealing with metrics,

it's always going to be thinking about the fact

that lower numbers are better, higher numbers are worse,

when we deal with routing.

Anytime we talk about hop count,

we want the least number of routes.

If we start talking about bandwidth,

we want the lowest cost of bandwidth.

And that gives us the highest amount of bandwidth.

And so lower costs becomes better.

If we're dealing with delay,

we want the least amount of delay.

Believability, we want the lowest number.

We want a zero for directly connected, right?

Or one for static route or one of those lower numbers

for the administrative distance.

That's the idea here.

Lower numbers are always going to be better.

You see this trend in routing

where the metrics lower is always better.

And so remember that for the exam.

Lastly, I wanted to give you this summary slide

here on the screen.

This is one of those things I'd like you to write down

in your notes so you can remember

all about the routing protocols.

This summarizes everything nicely.

From RIP, OSPF, EIGRP.

IS-IS, and BGP.

It shows you which ones are interior,

which ones are exterior, which ones are distanced vectors,

which ones are link states.

And hopefully this will help you

as you study your different routing protocols

and remember the key facts and figures

for them before the exam.

If you think back to our lesson on IP addressing,

specifically with version four,

we talked about the fact, that IPv4

was running out of IP addresses,

and this was becoming a huge problem.

Now, IPV six, honestly, wasn't ready yet to be developed.

And they were still in the process of it.

And so, something else had to come up,

to help us with this problem.

And that is what address translation did.

It was there, to help solve this problem for us.

And there was two versions of this,

Network Address Translation and Port Address Translation.

Now, Network Address Translation is a way for us,

to conserve those limited number of IPv4 addresses.

For example, if I go to your house right now,

how many devices do you have on your network?

You might have five or ten or fifteen.

In my house, we each have a smartphone, a tablet,

a laptop, a desktop, some video game machines,

and there's four of us.

So right there, we've got twelve, fifteen,

twenty devices, right?

Now, if you start adding things up,

like, smart thermostats, and file servers and desktops,

we quickly get to twenty or thirty or forty devices

in any single house.

But, in each house, we only have one public IP addresses.

So, how do all these devices get onto the internet?

Well, that is where NAT and PAT come into play.

Now, NAT or Network Address Translation is going

to allow you to translate your private IP address

into a public IP address,

for routing over the public networks, like the internet.

Now, there's another variation out there known as PAT,

which is Port Address Translation.

And we're going to talk about that

at the end of this video too.

Now, when we talk about different types

of address translation, there are three main ones out there.

There is DNAT, SNAT and PAT.

let's take each one, one at a time.

Let's start out with DNAT,

or Dynamic Network Address Translation.

Now, Dynamic NAT (DNAT) is going to take an IP address,

and automatically assign it from a pool of IP addresses,

and give us a one-to-one translation.

Now, why would we want to use Dynamic NAT (DNAT)?

Well, if you remember, I talked about the fact,

that public IP addresses cost money.

Maybe, you only wanted to pay

for five addresses in your business,

but you have thirty workstations there.

Well, in the old days, only 20% of your people

were going online at any time,

and so, Dynamic NAT (DNAT) worked out really well for that.

The way dynamic NAT would work,

is when you want to get online,

your computer, would go to the router,

it would borrow one of these five IP addresses,

it would do a translation from your private IP

to your public IP and that way you'd be able to use it.

Go online, make the request and then when you're done,

your computer turned that public IP,

back into the router, back to the shared pool.

This way you can maximize your public IP space

for the most amount of internal clients.

And it did all of this dynamically and you didn't have to

worry about it.

Just like it does with DHCP, to give you internal addresses,

this was all done, from a matching of an internal scope

to an external scope.

And so, in just a quick microsecond,

you could then take this address, make the request,

and then give it back.

Now, if you want to think about this, like a family,

let's say you have a mom and a dad,

and two teenagers living in the house,

but you only have two cars.

Well, if somebody wants to go the mall,

they would grab the car keys, get in the car, drive out,

and then when they're done, they'd bring the car back

and put the keys back up,

and then somebody else can grab the keys

and take out the car.

That's the way Dynamic NAT (DNAT) worked.

Now, when we're dealing with Static NAT or (SNAT),

this was a static assignment,

where I would manually assign a private IP to a public IP

and each time it was a one-to-one translation.

So, in this case, if I had five public IP addresses,

I would also have five private ones,

and I couldn't multi share them

the way I could with Dynamic NAT (DNAT).

So, in this case, I have to have one car

for every person, right?

Somebody has to physically do all that assignment as well,

because it's done statically.

Now, why would somebody want to use Static NAT (SNAT)?

You may be wondering,

cause it seems kind of like a silly way to do it,

when Dynamic NAT (DNAT) was available.

Well, Static NAT (SNAT) was really used

just as a security feature.

It was a way to have all those public IP's,

not shown, exactly which client was attached

to each one, to the outside world.

And so, it added a little bit of a smoke screen,

if you will, that kind of hid those devices

behind the router.

Now, the third way, and the most common one

that we use today is what's known as

PAT or Port Address Translation.

In fact, as you're watching this video,

you're probably using PAT on your home network right now,

without even knowing it.

Now, this is what happens when you have multiple private

IP addresses, sharing only one public address.

Now, again, my house, we have fifteen

or twenty different network devices,

but, we only have one public IP.

Now, the problem is all of us want

to get online at the same time, right?

We don't want to have to share that one IP.

Well, by using PAT, we can do that,

because it allows a many-to-one translation,

instead of the one-to-one, the Dynamic NAT (DNAT)

and Static NAT (SNAT) required.

Now, this is a great thing,

because it allows me to take these small networks,

like small offices, and home offices and small businesses,

and be able to connect them through one IP,

out to the internet.

Now, I'm going to show you how this works

by using a diagram, in just a second, so bear with me.

Now, before we do that though,

I want to talk about the different names

of the NAT IP addresses.

They have specific names that you have to memorize

for the exam.

There's the Inside local, Inside global,

Outside local and Outside global.

For your inside local, this is your private IP address

that references an inside device.

For your inside global, this is your public IP address

or your global one that's being referenced

for an inside device.

For your outside local, this is your private IP address,

that's being referenced from the outside

and you have your global device

or your outside global is coming to be a public IP address,

referencing that outside device.

Now again, anytime you see the word global,

I want you to think about public.

Anytime you see the word local,

I want you to think about private,

and then you'll be able to answer these types of questions.

Now, let me show you what all this looks like on a diagram.

Here, I have NAT. Now, where are each of these things?

If I'm dealing with my inside local,

that is my private IP address referencing an inside device,

which is one of the private IP addresses,

referencing an inside device in this diagram.

Well, there might be something like 10.0.1.101.

Which would be PC1, that is my inside local address.

Then, I have to reference an inside global address,

which is a router.

And for our case, that would be 78.1.45.1

It's inside, because it's my network,

and it's global because it's public.

As far as the outside local, that's our private IP address

that references an outside device.

For us, that would be the inside of this router,

or, 10.0.1.1 because that is our outside device,

it's our boundary device, that router.

And then, if I wanted to talk about my outside global,

that's my public IP address, referencing an outside device.

That would be the server, 66.75.58.124

All four of these, have to work together,

for us to be able to get the information

from RPC, 10.0.1.101,

from that local private IP address,

out to the server, that I want to make the connection to.

Now, how does NAT work?

Well, let's take a look at this diagram,

where I have PC1 and PC2,

who want to make a request of a single server.

Now PC1 and PC2, both have private IP addresses,

which are not routable outside my network.

Once, I get to the router, they're going to be dropped, right?

So, when they send a request, from their source IP,

that's their private IP.

That would be the 10.0.1.101

or

10.0.1.102

Now, as part of that request,

they're going to put the destination of the server

that they want to get to.

And so, they're going to send that request

with their default gateway, over to the router.

And this is where the NAT happens,

because it's a NAT enabled router.

When the router gets that request,

it's going to keep track of the fact that 10.0.1.101

was for PC1

and the.102 was for PC2.

And it's going to assign each of them,

an inside global address from its pool

of public IP addresses.

In this case, that 78.1.45.101

and 78.1.45.102

Now, it's going to strip off the source,

that was those private IP addresses

and put on these inside global addresses,

which is publicly routable.

And then, they're going to send the packet off to the server.

When the request comes back to the router,

it's going to strip off those inside global addresses,

put back on the inside local addresses

and send it back to PC1 and PC2, respectively.

That's essentially how NAT works

and this can be either done statically or dynamically

based on those IP addresses and the pool that's

being there, in reserve, at that NAT enabled router.

Now, when we deal with your network at home though,

we're using PAT,

Like I said before. This is port address translation.

The reason for this is it only requires

one IP address on your router.

Now, you can't just take one and give it directly

to PC1 or PC2 though,

because, then, only one of them can get online at a time.

So instead, We're going to use ports,

to keep track of the different segments that we're doing.

So, when PC1 and PC2, make a request to the router,

the router is going to send off a request

from its source address.

and it's going to specify a port number,

to keep track of those requests.

When the request comes back from the server

on that specific port,

it then knows, I need to take that traffic

and forward it to either PC1 or PC2, respectively,

depending on which port number it was.

And that's why PAT is so popular today,

because we only have to have one public IP,

and we can have twenty, fifty, a hundred devices,

all sitting behind that router,

and being kept track of based on those ports.

The last topic we need to talk about

in this routing section is how multicast routing works.

Now, multicast routing is when you send traffic

to a class D IP address, known as the multicast group.

Now, our goal here is for us only to send traffic out once

and then have all of the devices

who want to get that information,

and anybody who doesn't want to get it, doesn't get it.

Now, there are two primary ways of doing this.

The first is known as IGMP,

or the Internet Group Management Protocol.

The second is PIM, or Protocol Independent Multicast.

We'll cover both of those in detail in this lesson.

Now, IGMP, or the Internet Group Management Protocol,

is used by clients and routers

so that the routers know which interfaces

have multicast receivers on them.

This allows a client to join a multicast group

and then be able to receive messages that they wanted to get

through this multicast group.

Now, there are three variants of IGMP.

The first one was IGMPv1.

And then it was improved to version two and version three.

Now in version one,

clients could request joining the group

and every 60 seconds, their router would go back and say,

do you still want to be here? Do you still want to be here?

Do you still want to be here?

And you could see how that causes

a lot of unnecessary traffic.

In version two, clients had the ability

to send leave messages to exit the group when they wanted.

Essentially now, the router's just going to assume

you want to be there until you told it

that you didn't want to be there.

Finally, in version three,

the client could request a multicast

from only a specific server and then choose,

did I want to get my messages from one server

and not from server two?

That was allowed.

It would also allow for source specific multicast,

which is what this server request was called.

Now, this allowed us to have multiple video streams

to a single multicast stream.

Now, almost like you'd have with cable TV,

where you could dial into the channel you wanted,

that's kind of what we were doing here digitally,

using the IGMP protocol.

So how did IGMP work?

Well, let's look at this diagram.

If I have a server that wants to send out traffic,

it's going to send it to the router

and the IP address of the multicast group.

In this case, 239.2.1.3.

Right now, the router is not sending it anywhere,

'cause nobody's requested that information.

But if PC2 sends a request message to router one,

now router one is going to remember that PC2

wants to be a part of this multicast group,

and anything it gets as part of this multicast group

will now be sent over to PC2 as well.

And only going to go to PC2,

because remember, PC1 and PC3

didn't ask to be a part of this group.

So hopefully you can see the benefits of this now.

In this example here,

we have PC1 and PC3 that wanted to be in there

and they could join the group as well.

And then the server can send it out to all three people

with only one copy of the message being sent in.

That's the benefit of this.

The second thing we want to look at is PIM,

or the Protocol Independent Multicast.

PIM is going to allow multicast traffic to be routed

between multicast enabled routers.

Multicast routing forms this multicast distribution tree,

and it really works between all these different routers

together because IGMP

was more about clients and servers together,

where PIM is much more focused on the routing part of this.

Now, there are two different modes in PIM.

There's a PIM-DM, which is the Dense Mode,

or PIM-SM or Sparse Mode.

In Dense Mode, we're going to use a periodic flood and prune

behavior to form an optimal distribution tree

across these routers.

And this can actually cause a negative performance impact

on your network, and because of this, in modern networks,

we really don't use it.

Instead, we tend to use Sparse Mode.

With PIM-SM, or Sparse Mode,

this is going to use a shared distribution tree initially,

and then it's going to, over time, find the best tree.

Now, when we start out,

that shared distribution tree is not optimal, but over time,

we're going to learn where the best tree is,

and then start switching over to the Shortest Path Tree,

or SPT, once it determines what that actually is.

Now, I know that's a lot of words.

So let's take a look at some pictures

to hopefully understand how this works a little better.

Here you can see PIM-DM or Dense Mode.

Now, what happens in Dense Mode is,

to begin with, it has this flooding procedure

where all of the routers,

every router in this entire network,

is getting all of the information.

Now, as you can see, that's a lot of traffic,

but we do already have the optimal way of getting there

from that multicast source to the multicast destination,

because it comes all at once with that big flood.

So in this case, it would be going down the left side

of that pyramid.

Now, as we go through,

it's going to then prune off all the non-optimal routes,

which in this case is all the routers off to the right.

It sends out this prune message saying,

hey, I don't need this traffic.

I'm not part of the optical route. Get me out of here.

And that way,

they can go ahead and drop those from the route.

Now, after sending all these pruning messages,

we now have the optimal path

between the source router and the last hop router,

giving us the quickest and easiest path.

Now, this is the idea of flood and prune.

And this happens every three minutes,

trying to find a more optimal route,

which again, can cause a really big performance hit

to your network, because we're flooding it

every three minutes.

And this is why we don't really use it much anymore.

Instead we use Sparse Mode.

Now Sparse Mode, or PIM-SM,

is going to use a shared distribution tree.

Essentially, when the server sends out the first message,

the router's going to send it over any way it can

to get it from the first router down to the last hop.

In this case, it's going to be sending it

to this rendezvous point first,

and then down to last router hop.

Now, this isn't the optimal path,

but it is a path and that's okay and it works.

And so this information is going to start to flow.

As you can see,

there are four of the six routers that got the information.

Two of them weren't even bothered to get the information,

and so they saved all that resources,

because they weren't being flooded.

Now, over time, we figured out this was a sub optimal path,

and instead, it would be a lot quicker

to go down the left-hand side of the diagram.

So, we're going to start switching over to that,

getting rid of all these unused branches

and then going to the Shortest Path Tree, the SPT,

and that now gives us the optimal tree

in this shared distribution tree,

just like we had before in Dense Mode.

Now you can see how this uses a lot less resources

than Dense Mode did,

but it did take us a little bit more time

to find that optimal way.

That's the trade off here.

Do you want to get optimal right from the start,

but flood your network?

Or can you wait for optimal

and use a lot less resources?

In most modern networks,

we choose PIM-SM, or Sparse Mode,

because it works better on our networks

and uses less resources upfront,

and eventually gets that optimal distribution

that we're looking for.

robot