Whether the receiver removes the Q tag right away or keeps it for further processing is its own decision.
On a switch, this depends on whether the VLAN ID in question is tagged on the destination port (trunk port) or untagged/native (access port).
Even on an untagged port, the Q tag may sometimes still be present to preserve PCP priority but with a zeroed VLAN ID field - depending on switch and port configuration.
=====================================================================================
What do switches do to tagged and untagged VLAN packets?
Switches strip or add tags depending on the port's settings. Your hypothetical packet tagged VLAN 10 ingressing on port 1 would have its tag stripped and when it egressed port 2 (or port 3, because both are untagged members of VLAN 10).
Similarly, when a packet ingresses port 2 it will be tagged VLAN 10 before egressing port 1, as per the second part of your question.
I know of at least one Ethernet switch implementation that tags frames on ingress on an untagged port, moves all frames around inside the switch as tagged frames. That particualr switch strips tags only when frames egress an untagged port.
I would assume that this type of behavior is probably fairly common, seeing as how the switch needs some way to keep track of the origin VLAN of frames as they move around inside the switch. Since I only know the low-level details of one (now very outdated and no longer manufactured) switch, though, I won't make sweeping generalizations that I can't back up. |