Options
MAC addresses on switch ports
masterk
Member Posts: 46 ■■□□□□□□□□
in CCNA & CCENT
Hello all, i have a quick question thats doing my head in!
For example say i have a simple switched network, Switch 1 has PC A and PC B connected to it. When PC A sends a packet to PC B, included in that packet (after the ARP is sorted) is the source mac address of PC A and the dest MAC address of PC B.
The question i have is, why does each port/interface on the switch have its own MAC address? PC A is sending its packet to PC B's MAC address so why does the switch port need its own?
Any help appreciated!!
For example say i have a simple switched network, Switch 1 has PC A and PC B connected to it. When PC A sends a packet to PC B, included in that packet (after the ARP is sorted) is the source mac address of PC A and the dest MAC address of PC B.
The question i have is, why does each port/interface on the switch have its own MAC address? PC A is sending its packet to PC B's MAC address so why does the switch port need its own?
Any help appreciated!!
Comments
-
Optionsmattau Member Posts: 218the switch port doesnt have its own i didnt think ? doesnt this happen ?
when the switch first starts up it sends broadcasts to every one connected to the switch asking them what their mac is?
it learns what devices are connected to it and then adopts that devices mac address to the specific switch port, so when the switch receives a packet it knows hey switch port 1 has pc A connected to it lets forward it out that port ?
I am learning to so dont trust what i say is true_____________________________________
CCNP ROUTE - passed 20/3/12
CCNP SWITCH - passed 25/10/12
CCNP TSHOOT - passed 11/12/12 -
Optionsbillyr Member Posts: 186when the switch first starts up it sends broadcasts to every one connected to the switch asking them what their mac is?
Not quite. The mac table is empty on a switch to start with, it fills it up as it receives MAC addresses from the host devices, it doesn't go out to ask for them. P.Cs tend to be quite chatty though so when you first look in the MAC table and you see a bunch of addresses listed it does appear as if the switch has asked for them. -
Optionsmasterk Member Posts: 46 ■■□□□□□□□□the switch port doesnt have its own i didnt think ? doesnt this happen ?
when the switch first starts up it sends broadcasts to every one connected to the switch asking them what their mac is?
it learns what devices are connected to it and then adopts that devices mac address to the specific switch port, so when the switch receives a packet it knows hey switch port 1 has pc A connected to it lets forward it out that port ?
I am learning to so dont trust what i say is true
Thanks for the reply, if you log onto a switch and view the ports you can see each port has its own MAC address which increments upwards from the switches core MAC address, i just wondered why each port needed one!
The question is asked here aswell: Mac Address On Switches Ports/interfaces - ProProfs Forums
But the answer doesnt really answer the question as fully as i would like, as the PC isnt sending its frame to the ports MAC address? -
Optionswastedtime Member Posts: 586 ■■■■□□□□□□Thanks for the reply, if you log onto a switch and view the ports you can see each port has its own MAC address which increments upwards from the switches core MAC address, i just wondered why each port needed one!
The question is asked here aswell: Mac Address On Switches Ports/interfaces - ProProfs Forums
But the answer doesnt really answer the question as fully as i would like, as the PC isnt sending its frame to the ports MAC address? -
OptionsHeero Member Posts: 486wastedtime wrote: »Not positive on this and I can't test it at the moment, but I believe that those are used on a routed interfaces. A regular layer 2 switch would probably only have 1 for configuration.
As far as i'm aware this is how it's done. Layer 3 interfaces need MACs, not layer 2 only interfaces. -
Optionschmorin Member Posts: 1,446 ■■■■■□□□□□how do you think the switch knows what port to forward packets out of? it needs a unique identifier of some kind, wouldn't it?Currently PursuingWGU (BS in IT Network Administration) - 52%| CCIE:Voice Written - 0% (0/200 Hours)mikej412 wrote:Cisco Networking isn't just a job, it's a Lifestyle.
-
Optionshermeszdata Member Posts: 225As far as i'm aware this is how it's done. Layer 3 interfaces need MACs, not layer 2 only interfaces.
This is not correct. Interfaces operate on layers 1 and 2. MAC address are a subset of the layer 2 topology to provide physical addressing of devices (Ports). IP addresses are Layer 3 an provide for logical addressing (path determination) within the internetwork.
Going back to each port on a switch having its own mac address. This is standards based. The standard states that every device/port has its own hard coded mac address. This even includes the core cpu of a device (which as an example, MicroSoft uses when registering their OSs). Routers with several serial modules have individual MACs coded into each module as well as the core CPUs MAC.
These are concepts one must completely understand if they are going to pass the tests necessary to gain certification.JohnCurrent Progress:
Studying:CCNA Security - 60%, CCNA Wireless - 80%, ROUTE - 10% (Way behind due to major Wireless Project)Exams Passed:
CCNA - 640-802 - 17 Jan 2011 -- CVOICE v6 - 642-436 - 28 Feb 2011
2011 Goals
CCNP/CCNP:Voice -
OptionsHeero Member Posts: 486hermeszdata wrote: »This is not correct. Interfaces operate on layers 1 and 2. MAC address are a subset of the layer 2 topology to provide physical addressing of devices (Ports). IP addresses are Layer 3 an provide for logical addressing (path determination) within the internetwork.
Going back to each port on a switch having its own mac address. This is standards based. The standard states that every device/port has its own hard coded mac address. This even includes the core cpu of a device (which as an example, MicroSoft uses when registering their OSs). Routers with several serial modules have individual MACs coded into each module as well as the core CPUs MAC.
These are concepts one must completely understand if they are going to pass the tests necessary to gain certification.
Tell me why a layer 2 only switch would need to have a mac for each switchport instead of just 1 for the actual switch? I'm thinking about it from the perspective of "how would it work?" and not "this is what they do." When does the switch use the MAC address of the port? -
Optionshermeszdata Member Posts: 225Tell me why a layer 2 only switch would need to have a mac for each switchport instead of just 1 for the actual switch? I'm thinking about it from the perspective of "how would it work?" and not "this is what they do." When does the switch use the MAC address of the port?
I am going to answer this question with a question!
How does a switch know which port is which when it makes forwarding decisions?
Answer: MAC Addresses
Below is the output from one of my 3550 switches:SwitchVoIP2#sh mac-address-table Mac Address Table ------------------------------------------- Vlan Mac Address Type Ports ---- ----------- -------- ----- All 0009.e8b5.2300 STATIC CPU All 0009.e8b5.2301 STATIC CPU All 0009.e8b5.2302 STATIC CPU All 0009.e8b5.2303 STATIC CPU All 0009.e8b5.2304 STATIC CPU All 0009.e8b5.2305 STATIC CPU All 0009.e8b5.2306 STATIC CPU All 0009.e8b5.2307 STATIC CPU All 0009.e8b5.2308 STATIC CPU All 0009.e8b5.2309 STATIC CPU All 0009.e8b5.230a STATIC CPU All 0009.e8b5.230b STATIC CPU All 0009.e8b5.230c STATIC CPU All 0009.e8b5.230d STATIC CPU All 0009.e8b5.230e STATIC CPU All 0009.e8b5.230f STATIC CPU All 0009.e8b5.2310 STATIC CPU All 0009.e8b5.2311 STATIC CPU All 0009.e8b5.2312 STATIC CPU All 0009.e8b5.2313 STATIC CPU All 0009.e8b5.2314 STATIC CPU All 0009.e8b5.2315 STATIC CPU All 0009.e8b5.2316 STATIC CPU All 0009.e8b5.2317 STATIC CPU All 0009.e8b5.2318 STATIC CPU All 0009.e8b5.2319 STATIC CPU All 0009.e8b5.231a STATIC CPU All 0009.e8b5.231b STATIC CPU All 0009.e8b5.231c STATIC CPU All 0009.e8b5.231d STATIC CPU All 0009.e8b5.231e STATIC CPU All 0009.e8b5.231f STATIC CPU All 0009.e8b5.2320 STATIC CPU All 0009.e8b5.2321 STATIC CPU All 0009.e8b5.2322 STATIC CPU All 0009.e8b5.2323 STATIC CPU All 0009.e8b5.2324 STATIC CPU All 0009.e8b5.2325 STATIC CPU All 0009.e8b5.2326 STATIC CPU All 0009.e8b5.2327 STATIC CPU All 0009.e8b5.2328 STATIC CPU All 0009.e8b5.2329 STATIC CPU All 0009.e8b5.232a STATIC CPU All 0009.e8b5.232b STATIC CPU All 0009.e8b5.232c STATIC CPU All 0009.e8b5.232d STATIC CPU All 0009.e8b5.232e STATIC CPU All 0009.e8b5.232f STATIC CPU All 0009.e8b5.2330 STATIC CPU All 0009.e8b5.2331 STATIC CPU All 0009.e8b5.2332 STATIC CPU All 0100.0c00.0000 STATIC CPU All 0100.0ccc.cccc STATIC CPU All 0100.0ccc.cccd STATIC CPU All 0100.0ccd.cdce STATIC CPU All 0180.c200.0000 STATIC CPU All 0180.c200.0001 STATIC CPU All 0180.c200.0002 STATIC CPU All 0180.c200.0003 STATIC CPU All 0180.c200.0004 STATIC CPU All 0180.c200.0005 STATIC CPU All 0180.c200.0006 STATIC CPU All 0180.c200.0007 STATIC CPU All 0180.c200.0008 STATIC CPU All 0180.c200.0009 STATIC CPU All 0180.c200.000a STATIC CPU All 0180.c200.000b STATIC CPU All 0180.c200.000c STATIC CPU All 0180.c200.000d STATIC CPU All 0180.c200.000e STATIC CPU All 0180.c200.000f STATIC CPU All 0180.c200.0010 STATIC CPU 1 000d.6517.092c DYNAMIC Fa0/48 1 0014.6988.206c DYNAMIC Fa0/2 25 000d.6517.092c DYNAMIC Fa0/48 Total Mac Addresses for this criterion: 75
Note that there are only 3 lines that give a port association. These are the hostes connected to the switch. The majority (72) have the CPU association and are hard coded in the switch's ASIC and the ASIC, which takes care of the forwarding decisions uses the appropriate MAC to forward frames through and get to teh proper switch port.JohnCurrent Progress:
Studying:CCNA Security - 60%, CCNA Wireless - 80%, ROUTE - 10% (Way behind due to major Wireless Project)Exams Passed:
CCNA - 640-802 - 17 Jan 2011 -- CVOICE v6 - 642-436 - 28 Feb 2011
2011 Goals
CCNP/CCNP:Voice -
OptionsHeero Member Posts: 486Check out this thread.
https://learningnetwork.cisco.com/thread/10473
The following is what i see on my 2960s AND my 3750s with ip unicast-routing disabled.Switch#show mac-address-table Mac Address Table ------------------------------------------- Vlan Mac Address Type Ports ---- ----------- -------- ----- All 0100.0ccc.cccc STATIC CPU All 0100.0ccc.cccd STATIC CPU All 0180.c200.0000 STATIC CPU All 0180.c200.0001 STATIC CPU All 0180.c200.0002 STATIC CPU All 0180.c200.0003 STATIC CPU All 0180.c200.0004 STATIC CPU All 0180.c200.0005 STATIC CPU All 0180.c200.0006 STATIC CPU All 0180.c200.0007 STATIC CPU All 0180.c200.0008 STATIC CPU All 0180.c200.0009 STATIC CPU All 0180.c200.000a STATIC CPU All 0180.c200.000b STATIC CPU All 0180.c200.000c STATIC CPU All 0180.c200.000d STATIC CPU All 0180.c200.000e STATIC CPU All 0180.c200.000f STATIC CPU All 0180.c200.0010 STATIC CPU All ffff.ffff.ffff STATIC CPU Total Mac Addresses for this criterion: 20 Switch#
Apparently, they are all for different protocols where the switch has to respond to traffic.CDP UDLD/DTP/VTP/Pagp= 0100.0ccc.cccc
CGMP = 0100.0ccc.cccd
system-cpp-bpdu-range = 0180.C200.0000 - 0180.C200.000F
GARP = 0180.C200.0020 - 0180.C200.002F
None of the MACs from the interfaces are in the mac-address-table.
I understand that from a programming standpoint, the switch needs some way to identify switchports, but I can't think of a reason it couldn't be an identifier other than a MAC address. -
Optionsnetworker050184 Mod Posts: 11,962 ModThe port MAC is used as the source in STP, DTP, CDP etc. I'm not quite sure if they are used in forwarding decisions to identify interfaces though. Never heard of that and never seen any of the interface MACs in the MAC table, but they could be hidden entries or something.An expert is a man who has made all the mistakes which can be made.
-
OptionsHeero Member Posts: 486networker050184 wrote: »The port MAC is used as the source in STP, DTP, CDP etc. I'm not quite sure if they are used in forwarding decisions to identify interfaces though. Never heard of that and never seen any of the interface MACs in the MAC table, but they could be hidden entries or something.
So then how about a dumb layer 2 switch that doesnt do STP, DTP, CDP, or anything like that. Lets say auto-negotiation (speed/duplex), auto mdi/mdix, and ethernet switching only (like what you would get out of a cheapo unmanaged switch. -
Optionsnetworker050184 Mod Posts: 11,962 ModI have no idea. I could look around on google a bit, but I'm sure you have access to that as well.An expert is a man who has made all the mistakes which can be made.
-
OptionsForsaken_GA Member Posts: 4,024I think that this might be being overthunk.
Essentially, any device which has the possibility of originating traffic needs to have a MAC address. Switches can originate traffic. Fairly simple concept.
Now I could see an argument as to whether or not one MAC for the entire switch would do, but usually it's the MAC of the interface it's going out that's used as the source (for example, dual homed server... traffic which originates on eth1 is going to have eth1's mac, not eth0's), so the switch would be following common practice with that as well.
It should be even more obvious in the case of layer 3 capable switches. Since *every* port on the switch has the potential to be turned into a routed link, that would also require each interface to have a MAC -
Optionsmasterk Member Posts: 46 ■■□□□□□□□□Forsaken_GA wrote: »I think that this might be being overthunk.
Essentially, any device which has the possibility of originating traffic needs to have a MAC address. Switches can originate traffic. Fairly simple concept.
Now I could see an argument as to whether or not one MAC for the entire switch would do, but usually it's the MAC of the interface it's going out that's used as the source (for example, dual homed server... traffic which originates on eth1 is going to have eth1's mac, not eth0's), so the switch would be following common practice with that as well.
It should be even more obvious in the case of layer 3 capable switches. Since *every* port on the switch has the potential to be turned into a routed link, that would also require each interface to have a MAC
Ok, so your saying when i send a packet through my switch, the device i am sending to on the same switch see's the source MAC address on that packet as the interface on the switch port that the sender is attached to? Not the sender themselves? -
OptionsForsaken_GA Member Posts: 4,024Ok, so your saying when i send a packet through my switch, the device i am sending to on the same switch see's the source MAC address on that packet as the interface on the switch port that the sender is attached to? Not the sender themselves?
No, not if they're on the same network segment. If the switch is in layer 3 mode and the hosts are on different segments, then yes, it would do that, because the switch is functioning as a router at that point, not a switch.
But if the two devices that are communicating with each other are in the same layer 2 domain, then the source and destination macs will be that of the two nodes that are communicating.
What I am saying is that if the switch itself originates traffic, whether it be for STP, CDP, IGMP, or whatever, it'll be using it's own MAC address.