- [Instructor] This diagram depicts how a PC
would typically reach a server over a routed network.
This could be simply inside my local network
or on another continent.
Host A will start by consulting its local routing table.
If the destination IP address of the server
is in the same subnet as the PC
then it will try and forward it directly to the server
on the local LAN.
Since the destination isn't available locally,
then the PC will look up where to send it to
in its local routing table.
While PCs can have multiple routes,
they generally contain routes for the subnets
of IP addresses configured on them,
as well as a default gateway.
A default gateway is also known as a default route
or a gateway of last resort.
In essence it's a route that says,
if I don't know a better path to take,
then just take this one.
Routes and routing tables be it on hosts or routers
have a destination subnet along with a gateway.
The gateway will be another router on the same LAN.
In this case, the default gateway's next hop IP address
is the IP address of Gi0/1 of Router 1.
So Host A has determined that it wants to pass a packet
to Router 1's address that is on the same LAN.
So it will ARP for Gi0/1's address.
Once Router 1 responds with the MAC address of its Gi0/1 IP,
then Host A will forward the packet
inside of a layer two frame
over to Router 1 for further forwarding.
At no point in this process has
the layer three destination address in the packet changed.
The forwarding on a host device is a bit simpler
than what is required on a router.
It's more or less a five step process.
Start by examining frames that enter an interface.
Again, frames are the layer two encapsulation
protocol data unit, or PDU.
At this point the router determines
if further processing is required.
If the frame has no errors,
determined by the frame frame check sequence,
and the destination MAC address in the frame
is that of the router's interface
or if it's destined for a multicast or broadcast address
then proceed with processing.
Since step one was successful,
the the frame will be decapsulated from the frame
so the router can now examine the layer three packet.
Next, the router will take a look
at the packet's destination IP address.
Using this address, it will examine the routing table
to find the route that best matches.
If no route can be found, the packet will be dropped.
And an unreachable ICMP will be sent back
to the original sender.
If a satisfactory route is found,
then the router will make note of the next hop interface
and next hop router it should be sent to.
The packet will then be encapsulated into a layer two frame.
Just like the host before, ARP is used
to identify the MAC address of the next hop router.
The frame is then transmitted to the next hop router
via the interface noted in step three.
Encapsulation and decapsulation can be confusing
to keep track of.
I think of then as Russian nesting dolls.
As information moves down toward layer one
it goes inside another doll.
And as it moves up each layer it pops out of a doll.
This basic process is repeated on every device
with a networking stack.
So be sure you fully understand this concept.