Classifying Frames to a VLAN

As per the IEEE standards, rules are defined for classifying the frames in a VLAN. VLAN classification is accomplished by associating a VLAN ID with each port on the switch. Optionally, frames can be classified according to the protocol identifier contained within the frame. Frame classification priority begins with a VLAN Tag, followed by MAC-based, protocol-based, and finally port-based classification, where the VLAN is recognized by the port VLAN Identifier (PVID). The device supports port-based and protocol-based classification.

Port-Based Classification

For port-based (or PVID-based) classification of frames, the following prerequisites must be met:
  • VLAN must be configured (in the configuration below, this is VLAN 4)
  • PVID for the interfaces must be configured
  • Acceptable frame types must be configured.

Port-based classification requires the association of a specific VLAN ID—the port VLAN Identifier (PVID)—with each port. In port-based classification, the VLAN ID associated with an untagged or priority-tagged frame is determined based on the port on which the frame arrives.

Note:

A port can be a member of only one port-based VLAN.

Note:

If PVID value has not been explicitly configured for a port, PVID assumes a default value of 1.

  1. Execute the following commands to configure PVID for interface P5 as VLAN 4.
    perform the following:
    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enter the Interface Configuration Mode for port gigabitethernet 0/5.
    iS5comm(config)# interface gigabitethernet 0/5
    • Configure the PVID that is to be assigned to untagged / priority-tagged frames.
    iS5comm(config-if)# switchport pvid 4
    • Exit from the Interface Configuration Mode
    iS5comm(config-if)# end
  2. Review the VLAN-related configuration.
    iS5comm# show vlan id 4
    Vlan database
    -------------
    Vlan ID             : 4
    Member Ports        : Gi0/1, Gi0/2, Gi0/3, Gi0/4
    Untagged Ports      : None
    Forbidden Ports     : None
    Name                :
    Status              : Permanent
    Egress Ethertype    : 0x8100
    Service Loopback Status   : Disabled----------------------------------------------------
  3. View the VLAN port configuration table of Port Gi0/5 by executing the following show command.
    perform the following:
    iS5comm# show vlan port config port gigabitethernet 0/5 
    Vlan Port configuration table
    -------------------------------
    Port Gi0/5
    Bridge Port Type                    : Customer Bridge Port
    Port Vlan ID                        : 4
    Port Acceptable Frame Type          : Admit All
    Port Mac Learning Status            : Enabled
    Port Ingress Filtering              : Enabled
    Port Mode                           : Hybrid
    Port Gvrp Status                    : Enabled
    Port Gmrp Status                    : Enabled
    Port Gvrp Failed Registrations      : 0
    Gvrp last pdu origin                : 00:00:00:00:00:00
    Port Restricted Vlan Registration   : Disabled
    Port Restricted Group Registration  : Disabled
    Mac Based Support                   : Disabled
    Subnet Based Support                : Disabled
    Port-and-Protocol Based Support     : Enabled
    Default Priority                    : 0
    Filtering Utility Criteria          : Default
    Port Protected Status               : Disabled
    Ingress EtherType                   : 0x8100
    Egress EtherType                    : 0x8100
    Egress TPID Type                    : Portbased
    Allowable TPID 1                    : 0x0
    Allowable TPID 2                    : 0x0
    Allowable TPID 3                    : 0x0
    Reflection Status                   : Disabled
    -------------------------------------------------------

    Unicast packets should only reach host B as a tagged VLAN 4 packet (see above the Port Vlan ID shown as 4)that is sent by host A.

Port and Protocol-Based Classification

Groups of protocols can be defined and then bound to a port. After the protocol group is bound to a port, every packet originating from a protocol in the group is mapped to a VLAN that is configured in the protocol-based groups. Then, all tagged and untagged frames will be forwarded based on the protocol-to-VLAN mapping.

  1. Execute the following commands to configure protocol-based VLAN classification.
    perform the following:
    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Define a group ID for a specific encapsulation and protocol value combination.
    iS5comm(config)# map protocol ip enet-v2 protocols-group 10
    Note: ip stands for an Ethernet V2 frame that has an IPv4 packet. The protocol number is 0x0800.
    Note: enet-v2 stands for the standard IEEE 802.3 frame format.
    • Exit from the Interface Configuration Mode
    iS5comm(config)# exit
  2. View the configuration details by executing the following show command.
    perform the following:
    show vlan protocols-group
    Protocol Group Table
    --------------------
    ------------------------------------------
    Frame Type      Protocol             Group
    ------------------------------------------
    Enet-v2         IP                 10
    ------------------------------------------
  3. Map the protocol group 10 to the VLAN identifier 4 and to the specified interface Gi0/7.

    perform the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Go to port interface gigabitethernet 0/7.
    iS5comm(config)# interface gigabitethernet 0/7
    iS5comm(config-if)# switchport map protocols-group 10 vlan 4
    Note:

    In this example, the interface GI0/7 is assigned to protocol-based group 10 which is mapped to VLAN 4.

    iS5comm(config)# exit
    iS5comm# show protocol-vlan
    Port Protocol Table
    --------------------------------------
    Port           Group          Vlan ID
    --------------------------------------
    Gi0/7          10             4
    --------------------------------------
    Note:

    From the above shown Port protocol table, we can see that the IP packets received on the interface GI0/ 7 have VLAN ID of 4.