No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

AR100-S, AR110-S, AR120-S, AR150-S, AR160-S, AR200-S, AR1200-S, AR2200-S, and AR3200-S V200R009 CLI-based Configuration Guide - Ethernet Switching

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Basic Concepts of VLAN

Basic Concepts of VLAN

VLAN Tags

Definition and Function

A device identifies packets from different VLANs according to the information contained in VLAN tags. IEEE 802.1Q adds a 4-byte VLAN tag between the Source address and Length/Type fields of an Ethernet frame, as shown in Figure 3-6.

Figure 3-6  IEEE 802.1Q tagged frame format

A VLAN tag contains four fields. Table 3-1 describes the fields.

Table 3-1  Fields in a VLAN tag
Field Length Description Value
TPID 2 bytes Tag Protocol Identifier (TPID), indicating the frame type.

The value 0x8100 indicates an 802.1Q-tagged frame. An 802.1Q-incapable device discards the 802.1Q frames.

IEEE 802.1Q protocol defines the value of the field as 0x8100. However, manufacturers can define their own TPID values and users can then modify the value to realize interconnection of devices from different manufacturers.

PRI 3 bits Priority (PRI), indicating the frame priority.

The value ranges from 0 to 7. A larger value indicates a higher priority. If congestion occurs, the device sends packets with higher priorities first.

CFI 1 bit Canonical Format Indicator (CFI), indicating whether a MAC address is encapsulated in canonical format over different transmission media. CFI is used to ensure compatibility between Ethernet and token ring networks.

The value 0 indicates that the MAC address is encapsulated in canonical format, and the value 1 indicates that the MAC address is encapsulated in non-canonical format. The CFI field has a fixed value of 0 on Ethernet networks.

VID 12 bits VLAN ID (VID), indicating the VLAN to which a frame belongs. VLAN IDs range from 0 to 4095. The values 0 and 4095 are reserved, and therefore valid VLAN IDs range from 1 to 4094.

The device identifies the VLAN that a frame belongs to according to the information contained in the VID field. Broadcast frames are forwarded only in the local VLAN. That is, a broadcast domain is confined to within a single VLAN.

VLAN Tags in Received and Sent Frames
In a VLAN, Ethernet frames are classified into the following types:
  • Tagged frame: frame with a 4-byte VLAN tag
  • Untagged frame: frame without a 4-byte VLAN tag
Common devices process tagged and untagged frames as follows:
  • User hosts, servers and hubs can only receive and send untagged frames.
  • Switches, routers, and ACs can receive and send both tagged and untagged frames.
  • Voice terminals and APs can receive and send tagged and untagged frames simultaneously.

All frames processed in a device carry VLAN tags so as to improve frame processing efficiency.

Link and Interface Types

All frames processed in a router carry VLAN tags. On a live network, some devices connected to a router can only receive and send untagged frames. To enable communication between the Router and these devices, the Router interface must be able to identify the untagged frames and add or remove VLAN tags from the frames. Hosts in the same VLAN may be connected to different Routers, and more than one VLAN may span multiple Routers. To enable communication between hosts, interfaces between Routers must be able to identify and send VLAN frames.

To accommodate different connections and networking, the device defines three interface types (access, trunk, and hybrid) and two link types (access and trunk), as shown in Figure 3-7.

Figure 3-7  Link and interface types

Link Types

As shown in Figure 3-7, Ethernet links fall into the following types, depending on the number of allowed VLANs:

  • Access link

    An access link can transmit data frames of only one VLAN. It connects a device to a user terminal, such as a host or server. Generally, user terminals do not need to know the VLANs to which they belong and cannot identify tagged frames; therefore, only untagged frames are transmitted along an access link.

  • Trunk link

    A trunk link can transmit data frames from multiple VLANs. It connects devices. Frames on a trunk link must be tagged so that other network devices can correctly identify VLAN information in the frames.

Interface Types

As shown in Figure 3-7, Ethernet interfaces are classified into the following types depending on the objects connected to them and the way they process frames:

  • Access interface

    An access interface often connects to a user terminal such as a user host or server that cannot identify VLAN tags, or is used when VLANs do not need to be differentiated. Access interfaces can only receive and send untagged frames, and can add only a unique VLAN tag to untagged frames.

  • Trunk interface

    A trunk interface often connects to a switch, router, AP, or voice terminal that can receive and send tagged and untagged frames simultaneously. It allows tagged frames from multiple VLANs and untagged frames from only one VLAN.

  • Hybrid interface

    A hybrid interface can connect to not only a user terminal (such as a user host or server) or network device (such as a hub) that cannot identify tags, but also a switch, router, voice terminal, or AP that can receive and send tagged and untagged frames. It allows tagged frames from multiple VLANs. Frames sent out from a hybrid interface are tagged or untagged according to the VLAN configuration.

    Hybrid and trunk interfaces are interchangeable in some scenarios, yet hybrid interfaces are required in certain specific scenarios. For example, if an interface connects to different VLAN network segments (such as the router interface connected to a hub in Figure 3-7 ), the interface must be a hybrid interface because it needs to add tags to untagged frames of multiple VLANs.

Default VLAN

The default VLAN ID of an interface is called the port default VLAN ID (PVID). Frames processed in a device all carry VLAN tags. When the device receives an untagged frame, it adds a VLAN tag to the frame according to the default VLAN of the interface that receives the frame.

For details on how to add or remove tags when the interface receives and sends frames, see Adding and Removing VLAN Tags.

Each interface has a default VLAN. By default, the default VLAN ID of all interfaces is VLAN 1. You can change the default VLAN ID as required.
  • The default VLAN of an access interface is the VLAN allowed by the access interface. You can change the default VLAN of an access interface to change the allowed VLAN.
  • Trunk and hybrid interfaces allow multiple VLANs but have only one default VLAN. Default VLAN and VLANs allowed by the trunk and hybrid interfaces should be configured separately.

Adding and Removing VLAN Tags

Ethernet data frames are tagged or untagged based on the interface type and default VLAN. The following describes how access, trunk, and hybrid interfaces process data frames.

Access Interface

Figure 3-8 and Figure 3-9 shows how an access interface adds and removes VLAN tags.

Figure 3-8  Access interface adding VLAN tags
Figure 3-9  Access interface removing VLAN tags
Trunk Interface

Figure 3-10 and Figure 3-11 shows how a trunk interface adds and removes VLAN tags.

Figure 3-10  Trunk interface adding VLAN tags
Figure 3-11  Trunk interface removing VLAN tags
Hybrid Interface

Figure 3-12 and Figure 3-13 shows how a hybrid interface adds and removes VLAN tags.

Figure 3-12  Hybrid interface adding VLAN tags
Figure 3-13  Hybrid interface removing VLAN tags
Frame Processing on Different Interfaces
Table 3-2  Frame processing based on the port type

Port Type

Untagged Frame Processing

Tagged Frame Processing

Frame Transmission

Access port

Accepts an untagged frame and adds a tag with the default VLAN ID to the frame.

  • Accepts the tagged frame if the frame's VLAN ID matches the default VLAN ID.
  • Discards the tagged frame if the frame's VLAN ID differs from the default VLAN ID.

After the PVID tag is stripped, the frame is transmitted.

Trunk port

  • Adds a tag with the default VLAN ID to the untagged frame and then transmits it if the default VLAN ID is permitted by the port.

  • Adds a tag with the default VLAN ID to the untagged frame and then discards it if the default VLAN ID is denied by the port.
  • Accepts a tagged frame if the VLAN ID carried in the frame is permitted by the port.
  • Discards a tagged frame if the VLAN ID carried in the frame is denied by the port.
  • If the frame's VLAN ID matches the default VLAN ID and the VLAN ID is permitted by the port, the device removes the tag and transmits the frame.
  • If the frame's VLAN ID differs from the default VLAN ID, but the VLAN ID is still permitted by the port, the device will directly transmit the frame.

Hybrid port

  • Adds a tag with the default VLAN ID to an untagged frame and accepts the frame if the port permits the default VLAN ID.

  • Adds a tag with the default VLAN ID to an untagged frame and discards the frame if the port denies the default VLAN ID.
  • Accepts a tagged frame if the VLAN ID carried in the frame is permitted by the port.
  • Discards a tagged frame if the VLAN ID carried in the frame is denied by the port.

If the frame's VLAN ID is permitted by the port, the frame is transmitted. The port can be configured whether to transmit frames with tags.

Interfaces process received frames as follows:
  • Access, trunk, and hybrid interfaces add VLAN tags to received untagged frames. Trunk and hybrid interfaces determine whether to accept untagged frames depending on whether VLANs specified by the VLAN IDs in the frames are allowed, whereas an access interface accepts the untagged frames unconditionally.
  • Access, trunk, and hybrid interfaces determine whether to accept tagged frames depending on whether VLANs specified by the VLAN IDs in the frames are allowed (the VLAN ID allowed by an access interface is the default VLAN ID).
  • Interfaces send frames as follows:

    • An access interface directly removes VLAN tags from frames before sending the frames.
    • A trunk interface removes VLAN tags from frames only when their VLAN IDs are the same as the PVID on the interface.
    • A hybrid interface determines whether to remove VLAN tags from frames based on the interface configuration.

    Frames sent by an access interface are all untagged. On a trunk interface, only frames of one VLAN are sent with tags, and frames of other VLANs are sent without tags. On a hybrid interface, you can specify the VLANs of which frames are sent with or without tags.

Translation
Download
Updated: 2019-05-17

Document ID: EDOC1000174108

Views: 56367

Downloads: 42

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next