I was asked an interesting question by my collegue for which I answered him but he wasn't convinced. I wanted to check if my answer was right too...
I have a PC which is part of Vlan 10. the port on which the pc is configured is configured as follows
switchport mode access
switchport access vlan 10.
That PC now receives a tagged traffic with vlan 10. What does the Switch / Host do with this traffic?
My answer was: the tag gets removed when it is sent out to the ports in Vlan 10 but he said that he somehow manages to send the tagged traffic . then I said since the tag is Vlan 10 and the switchport also is a part of vlan 10 I said that it would process the traffic.
but looks like he tried that and he said it would not. can somebody tell me what would happen in this case?
did i go wrong in my explanation / understanding?
The PC sends traffic packets with no tag value into the VLAN 10 access port of the switch. This switch tags the traffic with the VLAN identifier for transport through the switch infrastructure. As these packets are sent out VLAN 10 access ports to reach destinations in the VLAN, the tag value is removed.
By default hosts doens't understand 802.1Q lenguage, but switches certainly do. Firstable if the switch is configured as above the host will not receive the VLAN 10 tag, and if ever receives it it will drop it, since (as i already said) hosts don't understand 802.1Q tags. When the switch receives traffic destined to the host on VLAN 10 the switch will process the traffic, and just before sending it to the VLAN 10 host it will remove the tag.
Traffic goes from host1 connected to fa0/1 of Switch 1 to the host2 connected to fa0/1 of Switch 2. Both the ports are into VLAN 1.
When switch 1 receives data from host 1, it will tag the frame with VLAN 1 information.
The frame will travel over the trunk link between 2 switches with the VLAN tag.
Switch2 will strip off the VLAN tag. Then forward the data to the host 2.
Is my understanding correct?
Yes, absolutely correct. But remember that the process described by you was assuming that VLAN 1 is not the native VLAN of the trunk (which is the default). You're correct!