0

PC1 ----- (P1) SWITCH1 (P2) ----- (P2) SWITCH2 (P1) ----- PC2

  • Assume two network switches SWITCH1 and SWITCH2 are interconnected to each other through their ports P2 respectively present on each switch.
  • A PC1 is connected to SWITCH1 on port P1 with mac-address aaa.aaa.aaa and an IP address of 10.0.0.1/24. A PC2 is connected to SWITCH2 on port P1 with mac-address bbb.bbb.bbb and IP address 10.0.0.2/24.

I have the following two questions: When PC1 sends an ARP request to determine the mac-address of PC2

  1. What will be the source mac-address in the "ethernet frame" sent out of port P2 of SWITCH1?
  2. What will be the source mac-address in the "ethernet frame" sent out of port P1 of SWITCH2?

Assume: Port P1's mac-address on SWITCH1 is ccc.ccc.ccc. Port P2's mac-address on SWITCH1 is ddd.ddd.ddd. Port P1's mac-address on SWITCH2 is eee.eee.eee. Port P2's mac-address on SWITCH2 is ggg.ggg.ggg. SWITCH1 and SWITCH2 are not aware of the mac-addresses of PC1 and PC2 initially and will flood the ethernet frame containing the ARP request packet out all ports except the port on which it was received on.

Please note that I am NOT interested in knowing the Sender and Target hardware addresses inside the ARP request packet sent from PC1 arriving on port P1 of SWITCH2. I am already aware of what those would be.

I am specifically interested in knowing and trying to understand the Ethernet frame make-up sent out of port P2 of SWITCH1 towards SWITCH2 and then out of port P1 of SWITCH2 towards PC2.

Since the original ARP request from PC1 will be a broadcast ethernet frame I am assuming that both switches will simply forward the ethernet frame with the destination mac-address set to fff.fff.fff out all ports except the port that the frame was received on.

Will SWITCH1 simply forward the ethernet frame received from PC1 keeping the source mac-address intact of PC1 or will it change the source mac-address to that of port P2 of SWITCH1 when forwarding the frame our port P2?

Will SWITCH2 simply forward the ethernet frame received from SWITCH1 keeping the source mac-address intact of PC1 or will it change the source mac-address to that of port P1 when forwarding it out of port P1 towards PC1?

If the source mac-address is changed inside the Ethernet frame when sending the frame out of a port the label "forwarding" seems a little misleading since the source mac-address is modified. In that sense then routers truly forward and IP packet keeping both source and destination IP addresses intact.

2
  • Switches are transparent devices.
    – Ron Maupin
    Jun 28, 2023 at 20:57
  • got it, thanks for your response Jun 28, 2023 at 23:10

1 Answer 1

2

TL;DR ARP requests are broadcast, replies unicast. Source and destination MAC addresses in a frame don't change when it's forwarded.

What will be the source mac-address in the "ethernet frame" sent out of port P2 of SWITCH1?

PC1's.

What will be the source mac-address in the "ethernet frame" sent out of port P1 of SWITCH2?

PC1's.

Port P1's mac-address on SWITCH1 is ccc.ccc.ccc. Port P2's mac-address on SWITCH1 is ddd.ddd.ddd. Port P1's mac-address on SWITCH2 is eee.eee.eee. Port P2's mac-address on SWITCH2 is ggg.ggg.ggg.

The base MAC address of a (managed) switch or the derived port addresses are only used when that switch originates frames. An unmanaged switch doesn't even own a MAC address of its own. A forwarded frame keeps its destination and source addresses until it reaches its destination.

SWITCH1 and SWITCH2 are not aware of the mac-addresses of PC1 and PC2 initially and will flood the ethernet frame containing the ARP request packet out all ports except the port on which it was received on.

No. An ARP request is broadcast. Therefore, its forwarded out of all ports other than the ingress one. The result is the same, but flooding is the wrong term. When the ARP reply is return, the switches have already learned PC1's source address, so the reply isn't flooded.

Note that MAC addresses are 48 bit in size, so they use twelve hexadecimal digits.

If the source mac-address is changed inside the Ethernet frame when sending the frame out of a port the label "forwarding" seems a little misleading since the source mac-address is modified.

It would be, but that's not the way it works. A switch forwards frames unchanged.

In that sense then routers truly forward and IP packet keeping both source and destination IP addresses intact.

Yes! Routers forward packets without changing them (except for the TTL and checksum fields). They seem to change the encapsulating Ethernet frame, but they don't. Actually, they discard the ingress Ethernet frame and forward the encapsulated packet using a new frame.

NAT routers do change the IP packet as they translate either the source, or the destination, or both IP addresses.

2
  • Thanks for your response. In what case would a switch modify the source mac-address when sending a frame out one of it's interfaces? Is it only when originating a frame during for example during spanning-tree path calculations or are there any other special circumstances in which it would do it as well? Jun 28, 2023 at 23:09
  • A switch never changes a frame's source address when forwarding. When a switch originates a frame it uses a source MAC of its own, just like any other node.
    – Zac67
    Jun 29, 2023 at 4:31

Your Answer

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

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