Virtual LANs are intended to group particular stations into logical units. Generally speaking however, the stations themselves are unable to generate or process the necessary VLAN tags.
The data traffic between the network participants always travels via the various interfaces of the distributors in the LAN. These distributors (switches, base stations) thus have to handle the VLAN tags in the data packets according to the particular application, in terms of creating, processing, and if necessary, removing the tags. Because the logical units are connected to the various interfaces of the distributors, the rules governing the generation and processing of VLAN tags are assigned to these individual interfaces.
Let's take up the first example again:
A computer in Marketing sends a data packet to a computer in Sales. The hub in Marketing simply forwards the packet to the switch. The switch receives the packet on port no. 1 and knows that this port belongs to the VLAN with the VLAN-ID 3. It inserts the additional field with the correct VLAN tag into the MAC frame and forwards the packet only on the ports (2 and 5) that also belong to VLAN 3. The base station in Sales receives the packet on the LAN interface. Due to its settings, the base station detects that the WLAN interface also belongs to VLAN 3. It strips the VLAN tag from the MAC frame and transmits the packet on the wireless interface. The WLAN client is able to process the packet, which now has the normal length, like any other data packet without VLAN tagging.