Switch port types

In order to have a clear understanding of how VLANs work, it is important to be aware of how VLANs and ports are assigned inside the switch. Depending on how the VLANs and ports are assigned inside the Layer 2 switch, the ports of the switch can be divided into two types as follows

  • Access port
  • Trunk port

An access port is a port that is assigned to only one VLAN. It can forward only Ethernet frames of the VLAN to which it is assigned. On the other hand, a trunk port is a port that is assigned to multiple VLANs and can forward Ethernet frames of multiple VLANs.

Access ports and trunk ports are sometimes referred to collectively as “switch port”. In contrast to Layer 3 switch ports, the term “switch port” should be considered to refer to ports as Layer 2 switches.

This page provides a detailed explanation of access ports.

Important points for Layer 2 switch ports

  • Be aware of VLAN and port assignments properly.
  • Access ports are ports that are assigned to only one VLAN.
  • Trunk ports are ports that are assigned to multiple VLANs.

Access port

As mentioned earlier, an access port is a port that is assigned to a single VLAN; a Layer 2 switch that supports VLANs does not have any VLANs at all by default. Even without any special configuration, a Layer 2 switch has VLAN 1 by default, and all ports are assigned to VLAN 1. In other words, they are access ports for VLAN1. Since all ports are ports of VLAN1, Ethernet frames can be forwarded between all ports.

From this default state, you can create a new VLAN inside the Layer 2 switch if necessary. However, the newly created VLAN does not have any ports assigned to it. You need to assign ports to the newly created VLAN.

Figure Creating a VLAN and Assigning Ports
Figure Creating a VLAN and Assigning Ports

VLAN Membership

The VLAN assigned to a port is called VLAN membership, and there are two ways to configure VLAN membership.

  • Port based VLAN(Static VLAN)
  • Dynamic VLAN

When configuring an access port, it is important to know what VLAN to assign, or VLAN membership.

Port based VLAN

Port-based VLAN is a configuration that fixes the VLAN to which a port is assigned. Configure the assignment of ports and VLANs in advance, such as VLAN1 for ports 1 to 3, VLAN10 for ports 4 to 5, and so on. Port based VLAN is also called static VLAN because the assignment of ports to VLANs is fixed. This is because the VLAN to which a port is assigned will not change unless the configuration is changed. Port based VLAN is easy to understand and simple to configure. On the other hand, if you change the port to which the host is connected, you will have to change the port based VLAN configuration accordingly.

 Figure Port-based VLAN
Figure Port-based VLAN

Dynamic VLAN

With dynamic VLAN, the VLAN to which a port is assigned is not fixed. Depending on the host connected to the port, it automatically determines the VLAN assigned to the port.

The information used to determine the VLAN assignment includes the host’s MAC address, IP address, and the user name using the host. The following figure shows an overview of user-based dynamic VLANs. If a PC is connected to port 1 of the Layer 2 switch and logged in with the user name “gene”, port 1 is assigned to VLAN 10. if the port to which the PC is connected is changed to port 3, port 3 is automatically assigned to VLAN 10 if the user logs in with the same user name “gene”.

Figure Dynamic VLAN Overview
Figure Dynamic VLAN Overview

In this way, with dynamic VLAN, even if the port to which a host is connected is changed, the port to which it is connected is automatically assigned to the same VLAN. Dynamic VLANs make it possible to control the VLAN to which a host belongs without depending on the host’s physical connection port. However, it is more difficult to implement dynamic VLAN than port based VLAN, as it requires an authentication server.

In addition, the wiring of a wired LAN is not changed so often. Therefore, a common method of assigning ports to a VLAN would be to use port based VLAN.

Comparison of port based VLAN and dynamic VLAN

The following table summarizes the characteristics of port based VLAN and dynamic VLAN. Please be aware again that both are ways of determining the VLAN to be assigned to a port.

Table Port-based VLAN and Dynamic VLAN

 

Port based VLAN(Static VLAN)

Dynamic VLAN

Characteristics

Configure port and VLAN assignments statically.

Dynamically assign port to VLAN based on the user name of the host connected to the port.

Merit

It will be a simple configuration that is easy to understand.

Belonging to a VLAN without depending on the physical wiring of the host

demerit

If you change the port to which the host is connected, you will also need to change the configuration.

Additional authentication servers, etc., will be required.