What is Access and Trunk port in Computer Network?
In a Local Area Network, a network switch is a physical device that connects multiple devices together using LAN cables. The ports on a network switch are physical slots in which LAN cables can be plugged.
Depending on the capacity requirement, the switch may have fewer or a large number of ports. n the number of hosts increases. Unless a VLAN is configured, all ports are of the same type. In a switch with a VLAN configuration, a port may be either a trunk or an access type.
What is an access port in a Switch?
Ports are, by default, access ports. The use of cables is required for the connection of computers and other devices to form a LAN over a switch. Any computer connected to the access port is capable of sending messages to any other computer.
On the switch, the message is broadcast by the switch and received by the intended computer. When a switch is connected to another switch, the broadcast is also received by that switch
In the case of VLAN, the ports tagged with the same VLAN id only broadcast the messages. If the same VLAN expends to another switch or Router, the far switch/router port should be configured with the same VLAN id. But what if we have multiple VLANs on a switch, we need numerous interfaces on the far Router or switch for each VLAN.
To overcome this issue, another type of port, a switch that can be configured, can carry any VLAN messages. The new port type is the trunk port. In the next section, we explain details about the trunk port type.
What is a Trunk Port in a switch?
The trunk in telecom is a communication channel that can carry different types of Signaling or frequencies over a single physical link. The same applies to the switch for a trunk port. Physically, it is similar to any other port but configured to carry messages for any VLAN.
While configuring VLANs in a switch, the network administrator sets a port as a trunk port type. So that in the future, the network could be expanded by adding more switches.
When to use a trunk port?
Here we are discussing two scenarios where a network administrator needs to configure a port as a trunk port if there are multiple VLANs on a switch located on a floor. But the same network has to expand to another floor after some time.
What to do? There are two options. One carries long cables from the switch for each computer on another floor. Or another simpler option has a single cable from a trunk port and configures a switch on another floor with the same VLAN ids. This way, you may expand other VLANs also.
Another example of a trunk port is interval VLAN routing.