10-28-2011 09:55 AM - edited 03-07-2019 03:06 AM
Hi all,
Does each port on a switch have it's own MAC address? I would think yes. However, it seems like the MAC address rarely comes into play. And here is my reasoning....
Lets say a PC connects to port 3 on a switch. Is the MAC of port 3 in the PC's ARP table? I would think not, because switch port 3 is typically not configured with an IP address (although it could be), and therefore there is no need to resolve an IP to a MAC.
So if the PC is sending a packet to a remote host, what MAC is in the header of the frame? My guess it's the MAC of the default GW (presumably the ethernet port on the router). Is that right?
So it seems like switches have MAC's but they never really get used. Is that right? And I guess that switches don't do any framing at all. They just filter/forward like the book says. I think I just answered my question. Does that all sound about right?
Sorry to ramble on, just trying to get down to the nitty gritty.
Thank You - Joe
Solved! Go to Solution.
10-31-2011 03:18 AM
hi joe,
as far as i know a switch has only one mac address and this is only needed, if you want to send traffic directly to the switch, i.e. you want to open a http session(gui) or like dominic mentioned for administrative traffic.
otherwise the switch will never use its own mac address, as switches dont change a frame.
if a switch receives a frame, or actually a packet of traffic, it will unstrip the packet until layer two, look at the mac address, first source to check if it knows this mac already(if not it will update the cam table) then destination mac to see where to switch the frame. if the dest. mac is in the cam table it will forward the frame to that specific port if the switch does not know the mac it will broadcast the fame out of every port.(besides the port the packet was received)
regarding question 2 and 3:
if the remote host is on the same subnet as the pc sending the packet, the dest. mac will be the mac of the remote host, as if not already known, the pc will arp for the mac.
if the remote host is on a different subnet it will put the mac of the default gateway in the dest. mac header.
and you are right, a switch does not change anything of the packet, resp. frame. only if a packet is routed, then the mac addresses get changed.
regards,
florian
10-28-2011 10:36 AM
The switch will use it's mac for administrative trafic, like sending spanning-tree BPDU.
10-28-2011 10:48 AM
Joe,
have a look at this doc. It explains the use of the internal mac addresses per series.
http://www.cisco.com/en/US/products/hw/switches/ps700/products_tech_note09186a00801c9b4e.shtml
HTH
10-31-2011 03:18 AM
hi joe,
as far as i know a switch has only one mac address and this is only needed, if you want to send traffic directly to the switch, i.e. you want to open a http session(gui) or like dominic mentioned for administrative traffic.
otherwise the switch will never use its own mac address, as switches dont change a frame.
if a switch receives a frame, or actually a packet of traffic, it will unstrip the packet until layer two, look at the mac address, first source to check if it knows this mac already(if not it will update the cam table) then destination mac to see where to switch the frame. if the dest. mac is in the cam table it will forward the frame to that specific port if the switch does not know the mac it will broadcast the fame out of every port.(besides the port the packet was received)
regarding question 2 and 3:
if the remote host is on the same subnet as the pc sending the packet, the dest. mac will be the mac of the remote host, as if not already known, the pc will arp for the mac.
if the remote host is on a different subnet it will put the mac of the default gateway in the dest. mac header.
and you are right, a switch does not change anything of the packet, resp. frame. only if a packet is routed, then the mac addresses get changed.
regards,
florian
10-31-2011 05:50 AM
Florian,
Thanks for the great explanation.
Joe
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide