In computer networking, multiple independent network segments must be linked together to form a cohesive, scalable communication infrastructure. This is accomplished using specialized connecting devices that operate at different layers of the Open Systems Interconnection (OSI) model.
Connecting devices are categorized based on the highest OSI layer at which they operate. A device's functional layer dictates its ability to inspect, modify, and filter incoming traffic.
+-------------------------------------------------------------+
| Layer 5-7: Application/Presentation/Session | Gateways |
+-------------------------------------------------------------+
| Layer 3: Network Layer | Routers/L3 Sw.|
+-------------------------------------------------------------+
| Layer 2: Data Link Layer | Bridges/L2 Sw.|
+-------------------------------------------------------------+
| Layer 1: Physical Layer | Hubs/Repeaters|
+-------------------------------------------------------------+The table below outlines these devices alongside their active protocol layers and primary data units:
| Device Category | Operating Layer | Protocol Data Unit (PDU) | Primary Function | | :--- | :--- | :--- | :--- | | Passive Hub / Repeater | Layer 1 (Physical) | Bits | Signal amplification/regeneration, physical connection extension | | Active Hub | Layer 1 (Physical) | Bits | Multi-port signal regeneration and distribution | | Bridge | Layer 2 (Data Link) | Frames | Filtering and forwarding based on MAC addresses | | Two-Layer Switch | Layer 2 (Data Link) | Frames | High-speed, multi-port bridging | | Router / Three-Layer Switch | Layer 3 (Network) | Packets | Path selection and logical addressing translation | | Gateway | Layers 1 to 7 | Messages / Data | Protocol translation and application-level linking |
A repeater is a Layer 1 device designed to extend the physical boundaries of a Local Area Network (LAN). Over long physical mediums, electrical, optical, or wireless signals suffer from attenuation, which limits the maximum segment length.
+----------+ +----------+
======| Segment 1 |=== [Repeater] ===| Segment 2 |======
+----------+ +----------+
(Weakened Signal) (Regenerated Signal)Key characteristics of repeaters include:
A hub is essentially a multi-port repeater. It connects multiple hosts physically in a star topology but behaves logically as a shared bus topology.
A bridge operates at Layer 2 (Data Link) and partitions a large, congested LAN into smaller, isolated collision domains.
+-----------------+
| Bridge |
| [Filtering Table] |
+--------+--------+
|
+----------+----------+
| |
+-----+-----+ +-----+-----+
| LAN 1 | | LAN 2 |
| (Segment) | | (Segment) |
+-----------+ +-----------+A learning bridge dynamically builds and maintains its forwarding (or filtering) table. Initially, the table is empty. It populates this table by inspecting the source MAC address of incoming frames on each interface.
The learning process operates as follows:
To ensure high availability, network administrators often introduce redundant paths between switches or bridges. However, redundant Layer 2 topologies cause three severe issues if left unmanaged:
+------------+
+----> Switch A <----+
| +-----+------+ |
| | |
[Host 1] | [Host 2]
| v |
+----> Switch B <----+
+------------+
(Redundant loops generate broadcast storms)To resolve this, bridges use the Spanning Tree Protocol (STP) (standardized in IEEE 802.1D). STPmodels the network as a graph , where represents the switches and LAN segments, and represents the links. It calculates a minimum spanning tree to systematically disable redundant links, leaving exactly one active logical path between any two nodes.
A router is a Layer 3 (Network) device that routes data packets across independent networks (different subnets, LANs, and WANs).
A three-layer (Layer 3) switch is a high-performance device that blends Layer 2 switching with Layer 3 routing capability.
A gateway is a protocol converter that can operate across all seven layers of the OSI model. It translates data between completely incompatible network environments (for example, connecting a legacy IBM SNA mainframe architecture to an IP-based TCP/IP network).
A backbone network provides a high-capacity transmission path to link multiple individual LANs. No user stations are directly connected to the backbone; instead, the backbone connects network distribution devices (like switches and routers).
In a bus backbone, the underlying topology is a shared bus. A single transmission line (such as a coaxial cable or fiber run) links the different LAN distribution devices through bridges or switches.
+-------+ +-------+ +-------+
| LAN 1 | | LAN 2 | | LAN 3 |
+---+---+ +---+---+ +---+---+
| Bridge | Bridge | Bridge
=======#================#================#======= (Bus Backbone)In a star backbone, the backbone topology is a star. A central switch or router acts as the hub, connecting all individual LANs.
+-------+
| LAN 1 |
+---+---+
|
+-----+-----+
| Central |
+---------+ Backbone +---------+
| | Switch | |
+-+-+ +-----+-----+ +-+-+
|LAN 2| | |LAN 3|
+---+ | +---+
+---+---+
| LAN 4 |
+-------+Two geographicsally separated LANs can be linked using remote bridges connected over a point-to-point wide-area link (such as a leased fiber line or microwave link). The point-to-point link acts logically as a transparent bridge interface.
A Virtual Local Area Network (VLAN) is a logical local area network configured entirely through software on Layer 2 switches rather than physical wiring.
+-----------------------------------------+
| L2 Switch |
| [VLAN 10: Sales] [VLAN 20: IT] |
+----+---------+---------+---------+------+
| | | |
+---+ +---+ +---+ +---+
|PC1| |PC2| |PC3| |PC4|
+---+ +---+ +---+ +---+To identify which VLAN a frame belongs to as it crosses a trunk link, switches insert an 802.1Q tag into the standard Ethernet header. This -byte header insertion is placed directly after the Source MAC address field:
+----------+----------+-------------------+----------+---------+-----+
| Dest MAC | Src MAC | 802.1Q Tag | Type/Len | Payload | FCS |
| (6 bytes)| (6 bytes)| TPID/TCI (4 bytes)| (2 bytes)| | |
+----------+----------+-------------------+----------+---------+-----+Within the -byte 802.1Q Tag:
0x8100 to denote that the frame contains 802.1Q tagging.0 and 4095).To understand how VLANs operate in practice, we will examine a step-by-step Cisco IOS configuration on a Cisco Switch and Router using Packet Tracer.
SALES. IP Subnet: 192.168.1.0/24. Ports: fa0/1 and fa0/2.IT. IP Subnet: 192.168.2.0/24. Ports: fa0/3 and fa0/4.fa0/5 connected to the router's physical interface fa0/0.fa0/0.10 and fa0/0.20. +------------+
| Router |
| (fa0/0) |
+-----+------+
| (Trunk Link)
|
+-----+------+
| Switch |
| (fa0/5) |
+--+---+---+--+
| | |
+-------------------+ | +-------------------+
| | |
+-----+-----+ +-----+-----+ +-----+-----+
| VLAN 10 | | VLAN 10 | | VLAN 20 |
| PC1 | | PC2 | | PC3 |
+-----------+ +-----------+ +-----------+Create the two database entries for VLAN 10 and VLAN 20 on the switch:
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name SALES
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name IT
Switch(config-vlan)# exitAssign the switch access ports to their respective VLANs and configure fa0/5 as a trunk port to carry the multi-VLAN traffic up to the router:
! Configure ports fa0/1 and fa0/2 for VLAN 10 (SALES)
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
Switch(config)# interface fa0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
! Configure ports fa0/3 and fa0/4 for VLAN 20 (IT)
Switch(config)# interface fa0/3
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit
Switch(config)# interface fa0/4
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit
! Alternative shortcut to configure ports in bulk:
! Switch(config)# interface range fa0/1 - 4
! Switch(config-if-range)# switchport mode access
! Configure port fa0/5 as a trunk link
Switch(config)# interface fa0/5
Switch(config-if)# switchport mode trunk
Switch(config-if)# exitAssign static IP addresses to the connected workstations:
192.168.1.10255.255.255.0192.168.1.1192.168.1.20255.255.255.0192.168.1.1192.168.2.10255.255.255.0192.168.2.1192.168.2.20255.255.255.0192.168.2.1Enable Inter-VLAN Routing by dividing the physical router interface fa0/0 into two distinct logical sub-interfaces. Each sub-interface acts as the default gateway for its assigned VLAN.
Note: The physical interface
fa0/0must not have an IP address assigned to it directly. It must simply be enabled (no shutdown) so the sub-interfaces can process traffic.
Router> enable
Router# configure terminal
! Bring up the physical interface fa0/0
Router(config)# interface fa0/0
Router(config-if)# no shutdown
Router(config-if)# exit
! Configure Sub-Interface for VLAN 10
Router(config)# interface fa0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address 192.168.1.1 255.255.255.0
Router(config-subif)# exit
! Configure Sub-Interface for VLAN 20
Router(config)# interface fa0/0.20
Router(config-subif)# encapsulation dot1Q 20
Router(config-subif)# ip address 192.168.2.1 255.255.255.0
Router(config-subif)# exitConnecting devices operate at different layers: Repeaters/Hubs at L1 (Physical), Bridges/Two-Layer Switches at L2 (Data Link), Routers/Three-Layer Switches at L3 (Network), and Gateways across all layers (L1-L7).
Bridges forward frames using dynamic MAC address tables. To prevent infinite loops in redundant topologies, they run the Spanning Tree Protocol (STP) to construct a loop-free logical tree.
VLANs segment a physical local area network into multiple logical broadcast domains using software configurations rather than physical rewiring.
Access ports carry traffic for a single, designated VLAN (typically connecting to end hosts), whereas trunk ports carry multiplexed traffic for multiple VLANs over a single physical link (typically connecting switches/routers).
An inter-VLAN routing technique where a single physical router interface is divided into multiple logical sub-interfaces, each configured with 802.1Q encapsulation to act as a default gateway for a specific VLAN.
Test your understanding with 5 questions
Which of the following statements is true regarding a physical-layer repeater?
When a transparent bridge forwards a frame from LAN 1 to LAN 2, how does it handle the source and destination physical (MAC) addresses?
In a redundant bridge topology, why is the Spanning Tree Protocol (STP) necessary?
Which of the following port configurations should be used on a switch interface that connects directly to a single end-user workstation?
In a Router-on-a-Stick (R.O.A.S.) configuration, why is it necessary to create logical sub-interfaces on the router's physical port?
6 Modules
6 Modules