ā02-28-2020 11:39 PM - edited ā02-28-2020 11:41 PM
hello im having trouble getting the concept on how mac address works.
For example
Say i have two switches and 2 computers connected at each end of the both switches and both switches connected by each other interface. here is the part that gets me why doesn't the switch change the mac address of the destination or is that a router thing?
Studying for the new ccna
Solved! Go to Solution.
ā02-29-2020 01:26 AM - edited ā02-29-2020 01:33 AM
Hi @dolanduck. ,
Layer 2 switches stretch the broadcast domain. In a broadcast domain of any size, the Ethernet MAC address is kept intact when forwarded by the switches out the correct port. There will be no MAC address change. Having said this, communication between your 2 computers in the same IP subnet, say 192.168.1.0/24 is possible and no change of MAC address will happen.
On the other hand, when computers are on different subnets, let's say Subnet A and Subnet B:
Subnet A) 192.168.1.0/24
Subnet B) 192.168.2.0/24
If Computer A in Subnet A needs to communicate to Computer B in Subnet B then:
Computer A sends the frame with the MAC destination the MAC of the Default Gateway IP in Subnet A which is for purpose of this explanation a Router.
Once the Router receives the packet, it will "route" the packet out its corresponding interface that connects to subnet B where the source MAC will now be the Router interface on subnet B and the destination MAC the one of Computer B. This is when MAC change happens.
There is also the ARP process and Unicast flood which are important in this process in real life but are not covered in this answer to keep it simple.
Additionally, this article can be of help:
ā02-29-2020 06:03 AM
Hi,
Things are simpler than that (leave ARP and subnet and broadcast domains aside). Forwarding within the same VLAN/subnet/broadcast domain, across one switch or multiple switches, is done based on the destination MAC address, so this never gets changed. When you need to reach anyone outside your VLAN/subnet/broadcast domain, your packet is still forwarded based on the destination MAC address till it reaches your default gateway, a layer 3 hop, which it now routes the packet further based on the destination IP address and it will change the layer 2 header as well (as it may for example exit a Serial link, of for Ethernet it will change both source , to identify itself, and destination MAC, to identify the next-hop).
Regards,
Cristian Matei.
ā02-29-2020 10:45 AM
ā02-29-2020 01:26 AM - edited ā02-29-2020 01:33 AM
Hi @dolanduck. ,
Layer 2 switches stretch the broadcast domain. In a broadcast domain of any size, the Ethernet MAC address is kept intact when forwarded by the switches out the correct port. There will be no MAC address change. Having said this, communication between your 2 computers in the same IP subnet, say 192.168.1.0/24 is possible and no change of MAC address will happen.
On the other hand, when computers are on different subnets, let's say Subnet A and Subnet B:
Subnet A) 192.168.1.0/24
Subnet B) 192.168.2.0/24
If Computer A in Subnet A needs to communicate to Computer B in Subnet B then:
Computer A sends the frame with the MAC destination the MAC of the Default Gateway IP in Subnet A which is for purpose of this explanation a Router.
Once the Router receives the packet, it will "route" the packet out its corresponding interface that connects to subnet B where the source MAC will now be the Router interface on subnet B and the destination MAC the one of Computer B. This is when MAC change happens.
There is also the ARP process and Unicast flood which are important in this process in real life but are not covered in this answer to keep it simple.
Additionally, this article can be of help:
ā02-29-2020 02:10 AM
so correct me if im wrong so from the that link you sent and what you said.
Computers connected to a switch or that switch connected to a another switch and are in one big broadcast domain, there own bubble.
so by default they are all in vlan1 so they are in one big broadcast domain right ?
so, for vlan1 192.168.0.0/24 all hosts don't need to change mac addresses because they are in the same sub-net. They use arp to find the mac address that belongs to that ip in the same sub-net ?
ā02-29-2020 06:03 AM
Hi,
Things are simpler than that (leave ARP and subnet and broadcast domains aside). Forwarding within the same VLAN/subnet/broadcast domain, across one switch or multiple switches, is done based on the destination MAC address, so this never gets changed. When you need to reach anyone outside your VLAN/subnet/broadcast domain, your packet is still forwarded based on the destination MAC address till it reaches your default gateway, a layer 3 hop, which it now routes the packet further based on the destination IP address and it will change the layer 2 header as well (as it may for example exit a Serial link, of for Ethernet it will change both source , to identify itself, and destination MAC, to identify the next-hop).
Regards,
Cristian Matei.
ā02-29-2020 10:45 AM
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