1

Since the destination and source MAC addresses in a frame in a LAN change, how does it know where to finish, as the destination is only the next hop?

And if there is a switch, which connects to hosts and another switch, and the 2nd switch connects to other hosts, on the master switch, does it store the MAC address for the 2nd switch in association with the 2nd switch, or the MAC address for the 2nd switch while associating it as the host?

Image for the question

1
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 14, 2017 at 21:19

3 Answers 3

2

To answer the first part of your question: The MAC address doesn't change on frames within a LAN, only after passing through an L3 gateway/router where they could be changing Ethernet LAN/ broadcast domain or even changing to some medium other than Ethernet.

And part two: The switches are transparent, but switch one will learn all the MAC addresses for devices connected to switch two are on the port facing that switch and will forward the frames out that port.

1

Since the destination and source mac address in a frame in a LAN change, how does it know where to finish, as the destination is only the next hop?

That is incorrect. The source and destination MAC addresses in a frame do not change on a LAN.

The source and destination MAC addresses in a frame are the real source and destination MAC addresses of the source and destination hosts on a LAN. A switch will read the source address of frames coming into a port, and it will use that information in order to build its MAC address table for which MAC address can be found on which port. It will then deliver the frame to the port for the destination MAC address it finds in its MAC address table. If it can't find the destination MAC address in its MAC address table, it will flood the frame to all other ports.

You may be thinking about the frame being stripped from a packet when it crosses a router, and the router needs to create a new frame with new source and destination MAC addresses for the next hop, but switches on a LAN are transparent devices. The only changes made to a frame may be the addition of a VLAN tag when a frame crosses a trunk, or the removal of a VLAN tag when a frame exits an access port.

4
  • Thank you. But as far as the 2nd question goes...what is the answer? How does it work? Jul 11, 2016 at 17:01
  • The router doesn't care about the source MAC of the next-hop. It rewrites the source MAC to that of its exit interface when forwarding the frame, and changes the destination MAC to that of the next-hop. In the event of an unknown unicast, a switch will flood the frame to all ports except the port on which the frame originated. Jul 11, 2016 at 17:02
  • The second question is moot. The switches are transparent. The switch stores the host MAC addresses in the MAC address table to show which ports the source MAC addresses were seen. The first switch only sees the host MAC addresses on a port. It is possible that there would be traffic from a switch management interface on a VLAN, but that would be the only switch MAC address seen on the port, and it is because the management interface is just another host on the VLAN.
    – Ron Maupin
    Jul 11, 2016 at 17:10
  • @JohnJensen, I believe I explained that the router would create a new frame for the next hop with new source and destination MAC addresses for that hop. It doesn't really rewrite anything since the original frame was stripped.
    – Ron Maupin
    Jul 11, 2016 at 17:12
0

In response to your 2nd question, the answer is - it depends. If there is VLAN tagging between your two switches, then the L2 header would be modified with one or more VLAN tags on the connection between the two switches (however, this is not to say that any MAC addresses directly associated with the 2960s themselves would be involved in any kind of forwarding decision between the PCs - they wouldn't be).

Assuming VLAN tagging is not being used in your example, then the answer would be no. Each switch would only know that there are multiple MAC addresses learned on each of its interfaces that have the connection to the other switch.

The top 2960 would have a MAC address table with 4 entries, and those entires would be the PC MAC addresses. One PC MAC on each of those ports, and 2 PC MACs learned via the interface that the bottom 2960 connects to.

Similarly, the bottom 2960 would also have a MAC address table with 4 entries. One per PC MAC that was directly connected to the switch, and another 2 PC MACs learned via the interconnected interface to the top switch.

Edit: And for completeness, as Ron pointed out, the L2 header is not modified when the frames are not crossing an L3 boundary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.