Why Are MAC Addresses Used?

ElectroPulse

Limp Gawd
Joined
Aug 19, 2013
Messages
129
Hello, all!

A couple of days ago I started studying for the CCENT/CCNA. I've been screwing with Packet Tracer (such a friggin' cool tool!) doing some "what if?" and "how does this work?" experimentation, trying to answer some questions I've been coming up with.

My latest question was "Well, I've read that your MAC address doesn't make it past your router, so how does the layer 2 header change when a frame is sent onto the internet?" I set up a simple topology with a computer1 <-> switch1 <-> router1 <-> router2 <-> switch2 <-> computer2, and watched the frames go through. I pinged from computer1 to computer2, and watched the source and destination MAC addresses change from computer1's interface and router1's MAC (respectively) to router1's WAN interface and router2's WAN interface, then to router1's internal interface and computer2's interface. Question answered.

However, this got me thinking... Routers operate at layer 3, so is there even a functional purpose in updating the MACs in the layer 2 header when being transferred between the routers? Then, this question lead to the question that brought me to create this thread: Why are MAC addresses even used within a LAN? I know most switches operate at layer 2, so MAC addresses are needed, but why don't all switches operate at layer 3 to eliminate this need? I can understand the need for a burned-in address being assigned to interfaces as a unique, unchangeable (MAC spoofing aside) identifier for purposes of DHCP and stuff, but why is it used for transferring data between computers? It feels redundant having two source and destination addresses (MAC and IP) on each frame, when simply an IP address should suffice (at least it appears that way) if everything operated on layer 3.

Anyway, figured I'd ask here to find out the reason... I'm trying to wrap my head around as much networking-related stuff as I can :)

Thanks!
ElectroPulse
 
MAC address is layer 2 and is what switches (well layer 2 switches) use
IP address is layer 3 and is what routers use.

A switch will 'marry' an IP to a MAC and pass the IP on up the layers.

Layer 1 is physical, cabling etc
Layer 2 is MAC
Layer 3 is IP's
 
A switch will 'marry' an IP to a MAC and pass the IP on up the layers.

As you pointed out a traditional switch is layer 2. It knows nothing about an IP. There is no IP+MAC "marriage" on a traditional L2 switch level. The CAM table in a switch will "marry" MAC + port so the switch knows what port to forward a packet. Also, it may not seem like it now but there there other protocols that are in no way related to TCP/IP that are still in use.
 
Thank you for the replies!

Yes, I'm aware of the difference between layer 2 and layer 3 switches... I was just curious why we don't use layer 3 switches instead, eliminating the need for MAC addresses, at least for the application of transferring data between computers. I was thinking it was maybe just because that was the way the system was originally designed, and so we're stuck with it until there is a complete redesign of how networking works.

Also, it may not seem like it now but there there other protocols that are in no way related to TCP/IP that are still in use.

Alright, that works for an answer! I figured there was something beyond the scope of what I've learned so far that required layer 2. I'm curious... Could you list a couple of the most commonly used of those protocols so I can read up on them a bit?

Thanks again!
ElectroPulse
 
As you pointed out a traditional switch is layer 2. It knows nothing about an IP. There is no IP+MAC "marriage" on a traditional L2 switch level. The CAM table in a switch will "marry" MAC + port so the switch knows what port to forward a packet. Also, it may not seem like it now but there there other protocols that are in no way related to TCP/IP that are still in use.

You are indeed correct, it's all coming back...that's what comes of trying to over-simplify something
 
"Going up" a layer doesn't remove the need for the lower layers.

If you want to communicate on layer 3, you still need to communicate on layer 2 and 1, too, which is kinda self-evident if you actually look at packets and how they are composed.
 
Electro,
Here's a G Drive link to my university Networking class material (PDF) on Link Layer LAN/Mac layer stuff. Perhaps you can derive more understanding as to the importance of the MAC address.

Note that at this layer (2, Link Layer), you have 0 routers in play. It's all switches. No IPs, but simply switches and switch tables that map MAC addresses to be forwarded to the appropriate interfaces and routed out along the appropriate wire vectors.
 
Last edited:
Backwards compatibility. Back when all this was initially designed things like programmable registers to store a customizable 32 bit ID for the network interface was stupid expensive vs just giving it a hard wired ID and say "look for this and only this, and pass the rest up to the main system where complex circuits like your fancy 4 byte register can be used for more than one thing." The cost to redesign the whole network stack to get rid of a layer isn't worth what little you'd get back in the form of a few free bytes in the packet, especially considering that if we did it your way then all those old Layer 3 IPv4 unmanaged and un-upgradable switches would be useless and require replacement to implement IPv6, where all these, as you seem to see them, redundant layer 2 switches can route IPv4 or IPv6 just fine, because they just talk to other network interfaces directly via their MAC address and don't give two shits about what's being said.


So I guess also forwards compatibility.
 
The simple answer is it was designed that way over time and it would take a total redesign of networking to change it which would cost billions.
Until ethernet is replaced by something else I don't see it changing.
 
Mac is just a physical house address of a network capable device.

an IP is a virtually assigned address that is mapped to a mac address.

For instance... Network card has a factory burned in mac address that can't be changed and theroetically only one instance of it exist in the world. An IP can be changed an infinite amount of times and a switch just registers mac id to a port on the switch. An IP address is what higher layer stuff uses to find resources on a network.
 
Back
Top