Jeremy's IT Lab
Day 12Switch/Route

The Life of a Packet

20m5 chapters92 cues11 cards
Day 12YT: 4YrYV2io3as
00:00 / 20:13

Synchronized Transcript

92 cues indexed • Click dialogue or words to jump
Jeremy

Welcome to Jeremy’s IT Lab. This is a free, complete course for the CCNA. If you like these videos, please subscribe to follow along with the series.

Jeremy

Also, please like and leave a comment, and share the video to help spread this free series of videos. Thanks for your help. This video, unlike the last one, is not going to be practical, meaning that you won’t actually go on and configure a Cisco router or switch.

Jeremy

Also, most of the information in this video won’t be new, we’ve already covered most of it in previous videos. However, I decided to make this video because I think it’s very important to make sure you have a good understanding of the complete process a packet goes through when being sent

Jeremy

across networks. Hopefully this video will be a little shorter than the usual ones. Let’s get started. So, what will we cover in this video?

Jeremy

We’ll cover the entire process of sending a packet to a remote destination. This will include things like ARP, encapsulation, de-encapsulation, etc.

Jeremy

Of course, there are different levels of depth we can go into when talking about this process, and I won’t give unnecessary details that would only be expected of a CCNP or CCIE, but in this video I hope to give you a solid understanding to get you ready for your CCNA.

Jeremy

My hope is that this video will help you put all of the pieces together that we learned previously. So, this is the life of a packet, the process a packet goes through when being sent to remote networks.

Jeremy

Here’s the network topology we’ll use for this video. If you watched day 11’s video, you should recognize this topology, as it’s the same one we used to demonstrate static routing.

Jeremy

We’ll follow a packet being sent from PC1 in the 192.168.1.0/24 network, to PC4 in the 192.168.4.0/24 network.

Jeremy

Let’s assume we have pre-configured static routes on these devices, so that the packet will follow the same path as in the static routing video, that is from PC1 to R1, R2, R4, and then PC4.

Jeremy

This doesn’t have to be the path the packet takes, the path that goes via R3 instead of R2 is valid too, but we’ll stick to the same path as last time.

Jeremy

Now, since we’re not just looking at Layer 3 in this video, let me add MAC addresses for these devices. I’ll use 1111 for PC1.

Jeremy

Now, as you know a MAC address is actually 12 hexadecimal characters, but just to save space I’ll shorten them to 4. R1’s G0/2 interface has a mac address of AAAA, and it’s G0/0 interface has a MAC address of BBBB.

Jeremy

That’s something I didn’t mention before, each interface on a network device has a unique MAC address. Note that SW1’s interfaces also have MAC addresses, however for this video it’s not necessary to know the MAC addresses of the switches so to avoid clutter, I’ll

Jeremy

leave them out of this diagram. R2 has a MAC address of CCCC on its g0/0 interface, and DDDD on its G0/1 interface.

Jeremy

R4 has a MAC address of EEEE on its G0/1 interface and FFFE on its G0/2 interface.

Jeremy

I didn’t make it all Fs, because the MAC address of FFFF.FFFF.FFFF, 12 Fs, is the broadcast MAC address, so just to avoid confusion I added that E on the end.

Jeremy

Finally, PC4 has a MAC address of 4444. Okay, so PC1 wants to send some data to PC4, and its encapsulated in this IP header.

Jeremy

The source is 192.168.1.1, PC1’s IP address, and the destination is 192.168.4.1, PC4’s IP address.

Jeremy

Now, because PC1’s IP address is in the 192.168.1.0/24 network, it notices that the address 192.168.4.1 is in a different network, so it knows that it needs to send the packet to its default gateway, which is R1, something we

Jeremy

have already preconfigured. However, in this example PC1 has not sent any traffic yet, so it needs to use ARP, the address resolution protocol, something we covered in a previous video.

Jeremy

Let’s look at the ARP process once more. So PC1 makes this ARP request packet. The source IP is its own IP address and then destination is R1’s G0/2 interface, which is the default gateway configured

Jeremy

on PC1. Next is the MAC addresses. This is a minor point, but note that I put the source IP before the destination IP, but the destination MAC before the source MAC.

Jeremy

That’s because, in the IPv4 header the source IP address comes first, but in the ethernet header the destination MAC address comes first.

Jeremy

Anyway, just a minor point. The destination MAC address is the broadcast MAC address of all Fs, because it doesn’t know the MAC address of R1, so it will send the frame to all hosts on the network.

Jeremy

Finally the source MAC address is its own MAC address. So, it sends the frame, which SW1 receives and broadcasts out of all its interfaces except the one it received the frame on.

Jeremy

In this example, only PC1 and R1 are connected to SW1, so that means that SW1 will forward the frame out of it’s G0/0 interface.

Jeremy

To translate the meaning of this frame into English, PC1 is saying ‘Hi 192.168.1.254. What’s your MAC address?’.

Jeremy

Although I’m not going to really talk about the switches much in this video, note that SW1 learns PC1’s MAC address on its G0/1 interface when the frame arrives on its G0/1 interface.

Jeremy

When this broadcast frame arrives on R1, it notices that the destination IP is its own IP, so it creates this ARP reply frame to send back to PC1.

Jeremy

Although the ARP request message was broadcast, because R1 learned PC1’s IP and MAC addresses from the ARP request message, the ARP reply can be sent unicast directly to PC1.

Jeremy

So, that’s what R1 does. To translate this ARP reply message into english, basically it means Hi 192.168.1.1 This is 192.168.1.254.

Jeremy

My MAC address is aaaa. Note that SW1 will learn R1’s MAC address from this message, when the frame arrives on its G0/0 interface.

Jeremy

So, now PC1 knows the MAC address of its default gateway, so it encapsulates the packet with this ethernet header. Keep in mind, the original packet is not changed, the destination address remains PC4’s IP address, NOT R1’s IP address.

Jeremy

Only at Layer 2 is the destination set to R1’s MAC address. So, it sends the frame to R1. R1 receives it, and removes the ethernet header.

Jeremy

It looks up the destination in its routing table. The most specific match is this entry for the 192.168.4.0/24 network, which specifies a next hop of 192.168.12.2.

Jeremy

So, R1 will have to encapsulate this packet with an Ethernet frame with the appropriate MAC address for 192.168.12.2.

Jeremy

However, R1 doesn’t know R2’s MAC address yet. So, how will it learn R2’s MAC address? It will use ARP, of course.

Jeremy

The source IP address of this ARP request will be R1’s, and the destination will be R2’s. The destination MAC address is all Fs, the broadcast MAC address, because R1 doesn’t know R2’s MAC address, and the source is bbbb, which

Jeremy

is the MAC address of R1’s G0/0 interface. So, it sends the arp request, and R2 receives it. Basically, what this ARP request says is Hi 192.168.12.2, what’s your MAC address?

Jeremy

R2 receives the broadcast, and since the destination IP address matches its own IP address, it makes this ARP reply to send to R1.

Jeremy

Once again, because it learned the IP and MAC addresses of R1 from the ARP request, it doesn’t have to broadcast the frame. So, it sends this ARP reply back, which basically says hi 192.168.12.1, this is 192.168.12.2.

Jeremy

My MAC address is cccc. Okay, now R1 knows R2’s MAC address, so it can encapsulate the packet with an Ethernet header, inserting R2’s MAC address in the destination field, and the MAC address of R1’s G0/0 interface in the source

Jeremy

field, and it sends it to R2. After receiving the frame, R2 removes the Ethernet header. R2 then looks up the destination IP address in its routing table, and the most specific match is this one for 192.168.4.0/24, with

Jeremy

a next hop of 192.168.24.4. Although 192.168.24.0/24 is a connected network to R2, it doesn’t know the MAC address of R4.

Jeremy

So, you know what’s next. R2 will use ARP to discover R4’s MAC address. R2 prepares this ARP request frame, using its own IP and MAC addresses for the source, R4’s IP address as the destination, and the broadcast MAC address,

Jeremy

and it forwards it out of its G0/1 interface. With this ARP request, R2 is saying ‘Hi 192.168.24.4.

Jeremy

What’s your MAC address?’ R4 receives the broadcast, and since the destination IP address is its own it creates this ARP reply frame to send back to R2, once again it already knows R2’s IP and MAC addresses because they were used as the source

Jeremy

addresses for the ARP request. It sends the unicast frame back to R2. With this ARP reply, R4 is saying ‘Hi 192.168.24.2.

Jeremy

This is 192.168.24.4. My MAC address is eeee.’ Now that R2 knows R4’s MAC address, it encapsulates PC1’s packet with an Ethernet header, with a destination MAC address of eeee, which

Jeremy

is R4’s g0/1 interface, and a source MAC address of dddd, which is R2’s g0/1 interface. R4 receives the frame and removes the Ethernet header.

Jeremy

It looks up 192.168.4.1 in its routing table, and the most specific match is this entry for 192.168.4.0/24, which is directly connected via the G0/2 interface.

Jeremy

But, once again R4 doesn’t know PC4’s MAC address yet, so you know what it has to do next. It will use ARP to learn PC4’s MAC address.

Jeremy

It prepares this ARP request frame, again the source IP and MAC addresses are its own, the destination IP address is PC4’s, and the destination MAC is the broadcast MAC address of all F’s.

Jeremy

It sends this message out of its G0/2 interface, saying Hi 192.168.4.1, what’s your MAC address?

Jeremy

Note that SW4 will learn R4’s MAC address on its g0/0 interface from the source MAC address field of this ethernet frame.

Jeremy

After PC4 receives the frame, it checks the destination IP address. Since it is its own IP address, it will send an ARP reply.

Jeremy

The ARP reply will be unicast, using PC4’s IP and MAC addresses for the source and R4’s IP and MAC addresses for the destination.

Jeremy

It sends the frame out of its network interface, saying ‘Hi 192.168.4.254. This is 192.168.4.1.

Jeremy

My MAC address is 4444.’ Note that SW4 learns PC4’s MAC address when it arrives on its G0/1 interface.

Jeremy

Now that R4 knows PC4’s MAC address, it adds an ethernet header to the packet, using its own MAC address on the G0/2 interface as the source address, and PC4’s MAC address as the destination.

Jeremy

R4 sends the frame to PC4, and finally it has reached its destination. Notice that the original packet hasn’t changed throughout the process.

Jeremy

It’s always used the same IP header with a source IP address of 192.168.1.1 and a destination IP address of 192.168.4.1.

Jeremy

Also notice that the switches didn’t actually modify the frames at any point. The switches forwarded the frames and learned the MAC addresses, but they don’t actually de-encapsulate and then re-encapsulate the packet with a new ethernet header.

Jeremy

Okay, now let’s say PC4 sends a reply back to PC1, and we’ve configured static routes on the routers so that the traffic follows the same path on the way back to PC1, going via SW4, R4, R2, R1, SW1, and then reaching PC1.

Jeremy

What will be different? First off, there will be one major difference. Since these devices have already gone through the ARP process, there won’t be any need for ARP requests and replies, the packet will simply be forwarded from device to device, being de-encapsulated and then re-enapsulated

Jeremy

as it is received by and then forwarded by each router. So, that’s it, just a basic walkthrough of how a packet is forwarded between routers to pass it along to its final destination.

Jeremy

Now, as for today’s quiz, I’ll do something different than usual. Instead of having multiple choice questions as usual, we’ll use this same diagram to test your understanding.

Jeremy

Let’s get started with the quiz. Here’s question 1. PC4 sends a packet to PC1.

Jeremy

What is the destination MAC address when it is sent from PC4’s network interface? Pause the video to think about your answer.

Jeremy

The answer is FFFE, which is the MAC address of R4’s G0/2 interface. That’s because, to send the packet to PC1, which is in a remote network, PC4 must send the packet to its default gateway, R4, first.

Jeremy

To do that, it encapsulates the packet with an ethernet header, with its default gateway’s MAC address as the destination. Okay, let’s go to question 2.

Jeremy

PC4 sends a packet to PC1. What is the source MAC address when it is received on R1’s Gi0/0 interface?

Jeremy

Pause the video to think about your answer. The answer is CCCC, which is the MAC address of R2’s G0/0 interface.

Jeremy

When R2 sends the packet to R1 en route to its destination, PC1, it encapsulates the packet with an Ethernet header using its own MAC address as the source MAC address.

Jeremy

Okay, let’s go to question 3. PC4 sends a packet to PC1. What is the source MAC address when it is sent from SW1’s Gi0/1 interface?

Jeremy

Pause the video to think about your answer. The answer is AAAA, which is the MAC address of R1’s G0/2 interface.

Jeremy

SW1 doesn’t alter the frame to use its own MAC address, it simply forwards the frame out of the correct interface, or floods it if it doesn’t know the destination.

Jeremy

Let’s go to question 4. PC4 sends a packet to PC1. What is the destination IP address when it is sent from R4’s Gi0/1 interface?

Jeremy

Pause the video to think about your answer. The answer is 192.168.1.1, which is the IP address of PC1.

Jeremy

Although each router modifies the source and destination MAC addresses in the Ethernet header as it forwards the packet, they don’t modify the original packet itself, so the destination IP address won’t change.

Jeremy

Since PC4 is sending the packet to PC1, that means the destination will be PC1’s IP address, 192.168.1.1. Let’s go to question 5.

Jeremy

PC4 sends a packet to PC1. What is the source IP address when it is received on R1’s Gi0/0 interface?

Jeremy

Pause the video to think about your answer. The answer is 192.168.4.1, which is the IP address of PC4.

Jeremy

As I said in the last question, the original packet is not modified as the routers forward it to its destination, so through the whole route the source IP address remains PC4’s IP address, 192.168.4.1.

Jeremy

Okay, for this video there will once again be supplementary materials to help you practice what you’ve learned. There will be a packet tracer lab in which you use packet tracer’s ‘simulation’ mode to analyze a packet and test your knowledge and understanding.

Jeremy

That will be the next video. And that’s it, there won’t be a flashcard deck this video since there wasn’t actually any new information in this video.

Jeremy

However, if there are some new points that you picked up in this video, feel free to make your own flashcards. Actually, even though I make flashcard decks for each video, I also think its a good idea to make your own flashcards too, if there is anything else you want to remember.

Jeremy

You can also edit the flashcards I provide, or delete some flashcards if you think some of them are not necessary. The flashcards are just a tool to help you, so feel free to use them however you think is best.

Jeremy

Okay, that’s all for today’s video. Good luck with your studies. Thank you for watching. Please subscribe to the channel, like the video, leave a comment, and share the video with anyone else studying for the CCNA.

Jeremy

If you want to leave a tip, check the links in the description. I'm also a Brave verified publisher and accept BAT, or Basic Attention Token, tips via the Brave browser.

Jeremy

That's all for now.

Keyboard shortcuts

Shortcuts are ignored while you are typing in a search box, note field, or the scratchpad.

Playback

SpaceK
Play or pause
←→
Seek 5 seconds
JL
Seek 10 seconds
C
Toggle in-video captions

Scrubber (when focused)

←→
Seek 5 seconds
Shift←/→
Seek 10 seconds
Page UpPage Down
Seek 30 seconds
HomeEnd
Jump to start or end

Flashcards

Space
Reveal the answer
1234
Grade Again / Hard / Good / Easy

Navigation

←→
Move between study-mode tabs
HomeEnd
First or last study-mode tab
?
Open or close this sheet