Everything Routers do - Part 2 - How Routers forward Packets - Networking Fundamentals - Lesson 5
Summary
TLDRThis video lesson delves into the workings of routers, explaining how they use IP and MAC addresses, routing tables, and ARP tables to direct data across networks. It illustrates packet forwarding through routers using routing tables and ARP for MAC address resolution. The tutorial covers how hosts communicate with routers and other hosts, detailing the process from initial ARP requests to final data delivery, emphasizing the foundational concepts of networking.
Takeaways
- 🌐 **Routers and IP/MAC Addresses**: Routers have IP and MAC addresses in each network they are connected to.
- 📖 **Routing Tables**: Routers maintain routing tables, which are maps of networks they know about, and can be populated in three ways.
- 🔍 **ARP Tables**: ARP tables map IP addresses to MAC addresses, starting empty and populating dynamically as needed.
- 💡 **ARP Process**: If a router doesn't have an ARP entry, it uses the Address Resolution Protocol to find the necessary MAC address.
- 🔄 **Packet Forwarding**: Routers use routing tables to determine where to send packets and ARP tables to find MAC addresses for direct network nodes.
- 🔧 **Layer 2 Headers**: Routers construct Layer 2 headers to move packets from one MAC address to another within a network.
- 🔄 **Layer 3 Headers**: Hosts create Layer 3 headers with source and destination IP addresses to send data to foreign networks.
- 🔍 **ARP Requests**: Hosts send ARP requests to find the MAC address of their default gateway or next hop router.
- 📚 **Learning Process**: Routers learn ARP mappings from incoming ARP requests, which they can then use for future packet forwarding.
- 🔁 **Return Traffic**: The process of sending packets back to the original host is faster as ARP entries have already been populated.
- 🌟 **Internet as a Network of Routers**: The internet functions as a series of routers passing packets between each other using routing and ARP tables.
Q & A
What is the main focus of this lesson on routers?
-The lesson focuses on explaining how routers use their routing tables and ARP tables to forward packets across networks, including detailed steps on how packets travel between devices.
What was covered in part one of this lesson that this video builds upon?
-Part one discussed how routers maintain routing tables, which are populated using three methods, and how routers use these tables to route traffic between networks.
What is the purpose of an ARP table in a router?
-An ARP table maps IP addresses (Layer 3 addresses) to MAC addresses (Layer 2 addresses). It helps routers deliver packets to the correct network nodes by resolving their MAC addresses.
How are ARP tables populated compared to routing tables?
-Unlike routing tables, which are populated ahead of time, ARP tables start empty and are dynamically populated as traffic flows through the network using the address resolution process.
What does Host A need to send a packet to Host C, and what happens if it doesn't know the router’s MAC address?
-Host A needs to construct a Layer 2 header with the router’s MAC address. If it doesn't know the MAC address, it sends an ARP request to resolve the router's MAC address.
What happens when a router receives a packet with a Layer 2 header?
-The router discards the Layer 2 header (since it only helped deliver the packet to that router) and looks at the Layer 3 header to determine where to forward the packet next, based on its routing table.
What occurs if a router doesn’t have an ARP entry for the next hop?
-If a router doesn’t have the MAC address for the next hop, it sends an ARP request to resolve the Layer 2 address, allowing it to construct the necessary Layer 2 header for the next transmission.
How does the return traffic from Host C to Host A differ from the original transmission?
-The return traffic from Host C to Host A is faster because the necessary ARP entries have already been populated, allowing routers to forward the packet without additional ARP requests.
What would happen if there were more routers between Host A and Host C?
-If more routers were involved, each router would follow the same process of checking its routing table for the next hop and using ARP to resolve the MAC address, if necessary.
What is the key takeaway from this lesson on how routers function?
-The key takeaway is understanding the systematic process routers use—leveraging routing and ARP tables to forward packets across networks and how they dynamically handle ARP requests when necessary.
Outlines
🌐 Understanding Routers and ARP Tables
This paragraph introduces part two of lesson five, focusing on the role of routers in networking. It builds upon the previous lesson, explaining that routers have both IP and MAC addresses and maintain routing tables. The lesson also introduces ARP tables, which map IP addresses to MAC addresses for nodes in directly connected networks. The dynamic nature of ARP tables is highlighted, contrasting with the pre-populated routing tables. An example using Router 1 and Router 2 illustrates how these tables are used to route packets from Host A to Host C. The process involves Host A sending an ARP request to find Router 1's MAC address, allowing it to construct a Layer 2 header. The importance of ARP in facilitating communication between devices on different networks is emphasized.
🔄 Routers' Role in Packet Forwarding
The second paragraph delves into the mechanics of how routers use Layer 2 and Layer 3 headers to forward packets. It describes the process of Router 1 receiving a packet from Host A and using its routing table to determine the next hop, which is Router 2. The necessity for Router 1 to perform an ARP request to learn Router 2's MAC address is explained. Once the MAC address is known, Router 1 can construct a Layer 2 header to forward the packet. The process is repeated at Router 2, which also needs to perform an ARP request to learn Host C's MAC address before forwarding the packet. The summary underscores the importance of ARP in enabling routers to forward packets to their correct destinations.
🔙 Efficient Packet Routing in Networks
The final paragraph discusses the return path for packets from Host C to Host A, highlighting how the process is expedited once ARP entries are populated. It explains that Host C, knowing the MAC address of Router 2 from previous ARP exchanges, can construct a Layer 2 header to send packets back. The paragraph reiterates the process of routers using routing tables and ARP tables to determine next hops and construct necessary headers for packet forwarding. It concludes by emphasizing that these principles apply regardless of the number of routers in the path, illustrating the fundamental nature of packet routing across complex networks like the internet. The paragraph ends with a call to action for viewers to support the creation of a full networking course by sharing the content and engaging with the community.
Mindmap
Keywords
💡Routers
💡IP Address
💡MAC Address
💡Routing Tables
💡ARP Tables
💡Address Resolution Protocol (ARP)
💡Layer 2 Header
💡Layer 3 Header
💡Default Gateway
💡Next Hop
💡Packet Forwarding
Highlights
Introduction to part two of lesson five on routers and networking fundamentals.
Continuation from part one, focusing on routers' IP and MAC addresses in each network.
Explanation of routing tables as a map of networks known to each router.
Three methods for populating routes in a routing table.
Demonstration of Router 1 and Router 2's routing tables.
Introduction to ARP tables and their function in mapping IP to MAC addresses.
ARP tables start empty and populate dynamically as traffic flows through the network.
Process of how a packet is sent from Host A to Router 1 using ARP.
Router 1's use of its routing table to determine the next hop for a packet.
Router 1's need to perform ARP to find the MAC address of Router 2.
Router 2's process for receiving a packet and looking up the destination IP address in its routing table.
Router 2's need to perform ARP to find the MAC address of Host C.
Detailed step-by-step of data transfer from Host A to Host C.
Explanation of how response data travels back from Host C to Host A.
Highlight of how ARP entries are already populated for quicker return of data.
Final thoughts on the process every router follows using routing and ARP tables.
Invitation to join the community on Discord for further learning.
Call to action for viewers to support the creation of a full networking fundamentals course.
Transcripts
hello welcome to part two of lesson five
where we will continue our discussion of
routers this is another lesson from my
new course on networking fundamentals
which will teach you everything you need
to understand how data flows through the
internet
in this lesson we'll continue right
where we left off from the last video
in part one of this lesson we used this
topology to illustrate that routers
have an ip address and a mac address in
each network that they are connected to
we also learned that routers maintain
routing tables which is a map of every
network that each router knows about
and that routes in that routing table
can be populated in one of these three
ways
we showed you all this by showing you
router 1 and router 2's routing tables
and showed you how each router populates
its routing table using one of these
three methods
now all this was covered in great detail
in part one of this video
if you haven't seen that video yet go
ahead and pause this video and watch
that one first
as this video is simply going to build
upon these concepts
now something we didn't mention in part
one of this video
is that not only do routers have routing
tables
but routers also have arp tables arp if
you recall is a mapping of a layer 3
address like an ip address to a layer 2
address like a mac address
now we discussed arp in lesson 3 of this
series in that lesson i told you that
everything with an ip address has an arp
table
well just like we just mentioned routers
also have ip
addresses therefore they also have arp
tables
in each case the router's arp tables are
going to maintain a mapping of ip
addresses to mac addresses
of all the nodes in directly connected
networks
take a look at r1's arp table right here
notice
in the 1044 network there is only one
other node other than the router
and router 1 is going to have an arp
entry correlating to the ip address and
mac of host
a for this network there are two
other nodes in that network other than
router 1 and router 1 is going to have
an arp entry for each of them
this one belonging to host b and this
one belonging to
router 2. and router 2 is the same way
there's only one other node in this
network that's host c
and there's the arp mapping for host c
and then in this network over here there
are two
other nodes other than r2 and you have a
mapping for each of them
in router 2's arp table now the thing
about arp tables
is that unlike routing tables arp tables
actually start out empty
they will get populated dynamically as
needed as traffic is flowing through
this network
that's different from the routing table
the routing table has to be populated
ahead of time
recall that if a router receives a
packet that it doesn't know how to
deliver
the router is just going to drop that
packet but with arp
if the router doesn't have an arp entry
it needs it can simply do
the address resolution process to figure
out what it needs
we're going to show you how router 1 and
router 2 use their routing tables and
r tables in order to get a packet all
the way from host a through both of
these routers to host c
it's going to start with host a having
some data it needs to send to host c
host a knows the ip address it's trying
to speak to so it's able to construct a
layer 3 header that's going to include a
source ip address of host a
and a destination ip address of host c
now we discussed some reasons of why
host a might already know the ip address
is trying to speak to
we reviewed that back in lesson three
feel free to check that out if you want
a refresher
either way host a can look at the
destination ip address and compare that
to its own ip address
to determine that what it's trying to
speak to is on a foreign network
which means this packet must be sent to
host a's default gateway
which in this case is r1 the issue
is if this is the first packet that host
a has sent host a
doesn't know router 1's mac address and
therefore
cannot construct the necessary layer 2
header which would take this packet
from host a's nick to router 1 snake
so before host a can send the packet
host a is going to have to perform arp
so host a is going to send an arp
request for the ip address of r1
100 44.1 that arp request is going to
ask for the mac address
for whoever owns the ip1044.1
notice in the arp request host a is
going to include its
own ip to mac address mapping this arp
request will be sent across the wire
where it'll be received by router 1 and
when router 1 receives the arp request
router 1 will be able to learn the arp
mapping of the sender of the arp request
recall that the sender included the arc
mapping of host a
and there's nothing preventing router 1
from simply adding
that arp entry to its arc table upon
receiving the arp request
narrator 1 needs to generate a response
that response will include the arp
mapping that host a was trying to
resolve
when that arp response gets back to host
a host a will populate its arp entry
with the mac address of its default
gateway and now
host a has everything it needs to
properly construct the layer 2 header
which will get this packet from host a
to the router
host a can now send all of this to the
router
when the router receives this packet the
first thing the router is going to do
is discard the layer 2 header remember
that header only existed to take that
packet from this mac address to this mac
address
it did so successfully so we can discard
that layer 2 header
now router 1 will look at the
destination ip address in its routing
table it's going to try and find a match
to determine where to send this packet
next
it'll see that there's a match right
here which will tell router 1 that the
next hop for this particular packet
is the ip address 5 100552
which is router 2's ip address
now router 1 needs to construct a layer
2 header
which will take this packet from this
mac address to this mac address
the problem is at this point router 1
does not have an
arp entry for the ip address 10055.2
therefore router 1 cannot construct the
layer 2 header as necessary
which means router 1 is going to have to
perform the address resolution
protocol router 1 will send an arp
request
for the ip address 10.0.55.2
just like before the arp request
includes the senders
arp mapping this is going to allow r2
to learn the art mapping of the sender
of that arp request
upon receiving the arp request r2 will
learn that something with the ip address
1055.1
has the mac address ee3 now
r2 will generate an arp response this
arp response
is the arp mapping that router 1 was
trying to discover
when router 1 receives this arp response
router 1 will be able to complete its
arp
entry and therefore able to create a
layer 2 header
which will get the packet through to the
next hop
now this packet can be sent from this
nick
to this neck once it gets there
router 2 is going to receive the packet
and discard the layer 2 header
again that header only existed to go
from here to here
then router 2 will look at the
destination ip address in the routing
table to try and determine what to do
with that packet next
it'll find a match right here indicating
that this packet needs to be delivered
out the left interface since router 2
is now delivering this packet through a
directly connected route
it knows that this is actually the final
hop for this particular packet
because the destination exists in a
directly connected network
so router 2 will need to construct a
layer 2 header which will take
this packet from router 2's nick to host
seesnake
but just like before router 2 currently
does not know
host c's mac address and therefore
cannot create the layer 2 header
router 2 is going to have to send an arp
request to resolve the layer 2 address
for host c
this will follow the same process we've
already outlined
host c will learn the mac address
mapping for router 2
by receiving the arp request from router
2.
this will be useful for the return
traffic back to host a
then host c will generate an arp
response this arp response is going to
include
the arp mapping that router 2 was trying
to resolve
once router 2 receives the arp response
it'll populate its arp
table with the appropriate mac address
and then he can finally create the
appropriate layer 2 header
to get the packet to host c
when host c receives this packet it's
going to discard the layer 2 header
again this header's purpose was simply
to take the packet from this nick to
that nick
then ho c is going to discard the layer
3 header the purpose of that header was
simply to take
the data from this ip address to this ip
address
and finally host c will process the data
and that is every single step that needs
to happen
in order to get data from post a to host
c
next i'm going to show you what needs to
happen in order to get a response from
host c
back to host a but you'll notice the way
back will go much quicker
because all of the necessary arp entries
have already been populated
just like before it's going to start
with host c having some data to go to
host a
now these routers aren't going to know
that this is actually response data
from the perspective of these routers
this is just a bunch of ones and zeros
host c knows this data needs to get to
host a so it'll create
a layer 3 header with a source ip
address of host csip
address and a destination appears a host
a's ip address
and since host c knows that the
destination ip address is on a foreign
network
host c knows that this packet needs to
go to its default gateway
which in this case is router 2. and
since host c
already has the art mapping for router 2
it can create
the layer 2 header necessary to get this
packet
from this nic to this nic remember
that host c learned the mac address of
router 2 when router 2
asks for host c's arp entry either way
that's what's going to occur to get this
packet sent to r2
once r2 receives the packet it'll
discard the layer 2 header
then look up the destination ip address
in its routing table to determine what
to do with this packet next
it'll find a match for this ip address
with this route right here
which is going to tell router 2 that the
next hop of this particular packet is
the ip address
10055.1 which is rather once i p address
and since router 2 already has an arp
mapping for
router 1 router 2 can instantly create
the necessary layer 2 header
to get the packet across this hop so
with that layer 2 header created
router 2 can now send the packet to
router 1.
once it arrives to router 1 again router
1 will discard the layer 2 header
and then look up the destination ip
address in its routing table
it'll find a match for this route right
here which tells router 1 that this
particular packet needs to be delivered
out the right interface to its final hop
and since router 1 has the arp mapping
for the ip address 1044.9
router 1 is able to construct a layer 2
header
which will get the packet across to its
final hop
this will then allow router 1 to send
this packet to host
a once host a receives the packet host a
will discard the layer 2 header
then host a will discard the layer 3
header and finally host a will process
the response data
and that is everything that occurs to
get the response data
from host c all the way back to host a
and that wraps up the major ideas i
wanted to communicate to you
in this lesson the main takeaways are
understanding how
the routers are going to use their
routing tables and their arp tables in
order to forward packets across a
network
but before i let you go there's still
one last thought i want to leave you
with
everything we did between router 2 and
router 1 in order to
move data from host c to host a would
repeat for any amount of routers in the
path
in each case every router in the path
would look up the destination ip address
in
their routing table to determine the
next hop ip address
and then construct a layer 2 header with
the appropriate mac addresses
to get the packet across to the next hop
if for whatever reason
a router doesn't know the destination
mac address that router will perform arp
as necessary these steps are the same
steps we just illustrated to get a
packet from router 2 to router 1.
but those same steps would also occur if
there were many
other routers in the path between router
2 and router 1.
what we just illustrated essentially
showed you how a packet gets from host c
all the way through to host a whether
host a
is on the other side of two routers or
five routers
or the other side of the internet in
fact
the internet is really nothing more than
just a series of routers that are
handing packets off between
other routers and with that
we finally wrap up our discussion on
routers
the main takeaway is understanding the
process that every router will follow
and how the routers will use their
routing table and their arp tables to
move packets along
i hope you enjoyed this video i want to
thank you for watching
and we'll see you in the next one hey
youtube
i hope you enjoyed that free lesson i'm
releasing this content for free to see
how much interest there would be
in a full networking fundamentals course
taught in the same
practical networking style if you want
the full course to be created you have
to help me out by spreading the word
about this free module
if this content gets enough attention i
will definitely create the full course
based upon your suggestions for what you
want in a networking fundamentals course
besides i'm sure you know someone that
would also benefit from learning how
data flows through the internet
so you'd be helping them by sharing
these videos you could also
further help me out with a youtube
algorithm by liking subscribing and
leaving a comment below
i would appreciate it greatly and i read
and respond to every comment
otherwise feel free to join fellow
learners and fans of practical
networking on discord
the invite is available at pragnet.net
discord thank you for watching and we'll
see you in the next video
Voir Plus de Vidéos Connexes
OSI Model: A Practical Perspective - Networking Fundamentals - Lesson 2a
Everything Hosts do to speak on the Internet - Part 2 - Networking Fundamentals - Lesson 3
Packet switching | Packet switched network | Switching technology | TechTerms
IP Routing
Network Protocols Explained: Networking Basics
What is a ROUTER? // FREE CCNA // EP 2
5.0 / 5 (0 votes)