Wireshark packet captures reveal how Layer 2 MAC addresses and Layer 3 IP addresses serve distinct roles in network communication, with each operating at a different scope during data transmission. A practical, live capture demonstrates how destination addresses differ at each layer and why that distinction matters for routing traffic across networks.
Layer 2 vs Layer 3 Addressing
I thought we could take a look at Wireshark to see what the differences are between layer 2 and layer 3 addresses. What I've done is I pulled up a website, wikipedia.org, and then I actually went to a page, so information is being transferred back and forth. I've looked at one of these frames now, and let's take a look at the layer 2 addressing and the layer 3 addressing and the differences between those two.
Here on layer 3 we've got an address of 192 a, and that is the local machine. Just to prove it to you, I can bring up a command prompt, type in ipconfig, and on here I see that IP address right there. It's a 45 address.
It is going to a destination address of 19835.26.9. If I were to look that up, that is the host address of the Wikipedia site, so that's where this packet is going to.
But from a MAC address standpoint, or a layer 2 standpoint, I've got this address right here, 54 1379 94 5F FFF. It's a hexadecimal number. So where is that? If I look this up, I can do that with ipconfig, and this time I'll do a /all. I'll look at that Wi-Fi interface once again, and with that IP address that's associated with it, it's the MAC address of that machine. So that's no surprise: both the source IP address and the source MAC address are from the same machine. That makes sense so far.
Now what we see is the destination is 18 E8 29 20 5E F7, so that's the destination MAC address. Now what is the destination from a layer 2 standpoint? Let's take a look at that. I'm going to this time type in arp -a to see all of the ARP table that we have, and I can see that this MAC address shows up right here. And the IP address associated with it — does that sound like the default gateway? Let me see. I'm going to type in ipconfig again, and I look at this Wi-Fi connection right here, and that is the default gateway.
So there you have it. The layer 3 destination IP address is that remote machine that's somewhere out there in the world, but the destination MAC address is the local default gateway. What's going to happen is that this is going to be sent, from a layer 2 perspective, to that local default gateway. Then at that point in time that information is no longer valid, as it routes that traffic and sends it to its next destination. It gets rid of that layer 1 and layer 2, but it keeps that layer 3, because that layer 3 IP address is going to remain the same until it gets to its destination. It's the MAC address that's going to keep changing for every single hop.
In fact, there might be different technologies along the way, so maybe it's not a MAC address at all. Maybe it's a different type of layer 2 address depending on the technology that's used from one router to the next router. So it's going to change as it goes from layer 3 device to layer 3 device. There's the difference, visually, between a layer 2 address, a MAC address, and a layer 3 IP address.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →