QTECH
Software Configuration Manual
5-65
5.1.2
VLAN Fundamental
To enable packets being distinguished by the VLANs they belong to, a field used to identifying VLANs is
added to packets. As common switches operate on Layer 2, they only process Layer 2 encapsulation information and
the field thus needs to be inserted to the Layer 2 encapsulation information of packets.
The format of the packets carrying the fields identifying VLANs is defined in IEEE 802.1Q, which is issued
in 1999.
In the header of a traditional Ethernet packet, the field following the destination MAC address and the
source MAC address is protocol type, which indicates the upper layer protocol type. Figure 2 illustrates the format of
a traditional Ethernet packet, where DA stands for destination MAC address, SA stands for source MAC address, and
Type stands for upper layer protocol type.
Figure 2 The format of a traditional Ethernet packet
IEEE802.1Q defines a four-byte VLAN Tag field between the DA&SA field and the Type field to carry
VLAN-related information, as shown in Figure 3.
Figure 3 The position and the format of the VLAN Tag field
The VLAN Tag field comprises four sub-fields : the TPID field, the Priority field, the CFI field, and the
VLAN ID field.
·
The TPID field, 16 bits in length and with a value of 0x8100, indicates that a packet carries a VLAN tag with
it.
·
The Priority field, three bits in length, indicates the priority of a packet. For information about packet priority,
refer to QoS Configuration in QoS Volume.
·
The CFI field, one bit in length, specifies whether or not the MAC addresses are encapsulated in standard
format when packets are transmitted across different medium. This field is not described here.
·
The VLAN ID field, 12 bits in length and with its value ranging from 0 to 4095, identifies the ID of the
VLAN a packet belongs to. As VLAN IDs of 0 and 4095 are reserved by the protocol, the actual value of this
field ranges from 1 to 4094.
A network device determines the VLAN to which a packet belongs to by the VLAN ID field the packet
carries. The VLAN Tag determines the way a packet is processed.
5.1.3
VLAN Classification
Based on different criteria, VLANs can be classified into different categories. The following types are the
most commonly used :
·
Port-based
·
802.1Q
·
Policy-based
·
Other types
This chapter will focus on the port-based VLANs and 802.1Q VLANs.
5.1.4
VLAN Interface
VLAN interfaces are virtual interfaces used for communications between different VLANs. Each VLAN can
have one VLAN interface. Packets of a VLAN can be forwarded on network layer through the corresponding VLAN
interface. As each VLAN forms a broadcast domain, a VLAN can be an IP network segment and the VLAN interface
can be the gateway to enable IP address-based Layer 3 forwarding.