PadhaikoAll subjects

Data Link Layer

Computer Networks (ENCT 304)

Open in the Padhaiko app

3.1 Data link layer functions - Framing, error control, flow control, access control

The Data Link Layer (Layer 2) transforms the raw, unverified transmission facility of the physical layer into a reliable, structured communication link between adjacent nodes on a network.

Definition

Primary Functions of the Data Link Layer

  1. Framing: Encapsulates network layer packets into discrete logical units called frames by delimiting boundaries using header and trailer markers.
  2. Error Control: Detects and corrects transmission errors introduced by physical channel noise through error-detecting codes and retransmission protocols (Automatic Repeat Request, ARQ).
  3. Flow Control: Prevents a fast sender from overwhelming a slow receiver with more frames than its input buffer can process.
  4. Media Access Control (MAC): Coordinates access to shared broadcast transmission media to minimize or resolve packet collisions among multiple transmitting stations.
  5. Physical Addressing: Embeds unique hardware (MAC) addresses in frame headers to ensure frames are received by the intended adjacent interface.

Framing Techniques

To delineate where one frame ends and the next begins, data link protocols use three primary framing methods:

  1. Character (Byte) Count:
    • The frame header contains an integer field specifying the total number of characters/bytes in the frame.
    • Weakness: If transmission noise corrupts the count field, the receiver loses framing synchronization entirely and cannot locate subsequent frames.
  2. Byte (Character) Stuffing:
    • Used in byte-oriented protocols (such as PPP). Frames start and end with a reserved flag byte (e.g., 0x7E in HDLC/PPP).
    • Stuffing Rule: If the pattern 0x7E occurs naturally inside the user payload, the sender inserts an Escape character (ESC, 0x7D) immediately before it. If 0x7D itself appears in user data, it is escaped as 0x7D 0x5D. The receiver strips out the escape character, restoring original payload transparency.
  3. Bit Stuffing:
    • Used in bit-oriented protocols (such as HDLC). Every frame begins and ends with the unique flag byte 01111110 ().
    • Stuffing Rule: Whenever the transmitting hardware detects five consecutive s in the user payload bitstream, it automatically inserts (stuffs) a bit immediately following the fifth .
    • The receiving hardware continuously monitors incoming bits: whenever it observes five consecutive s followed by a , it automatically discards (destuffs) the bit. If five s are followed by a and then a , it recognizes the true end-of-frame flag 01111110.

3.2 Error control codes: Parity, checksum, CRC

Physical transmission channels are subject to thermal noise, electromagnetic interference, and signal attenuation, which can flip bits during transit. Error control incorporates detection and correction algorithms:

1. Parity Checks

2. Internet Checksum

Used extensively at higher layers (IPv4 header, TCP, UDP):

3. Cyclic Redundancy Check (CRC)

The Cyclic Redundancy Check is an exceptionally powerful, hardware-friendly polynomial division code deployed in Ethernet (FCS), Wi-Fi, and storage controllers.

Definition

Cyclic Redundancy Check (CRC) Mechanism

A data block of bits is treated as algebraic coefficients of a polynomial of degree . Sender and receiver agree upon a fixed Generator Polynomial of degree :

  1. Append zero bits to the data bitstream, forming .
  2. Divide by the generator polynomial using modulo-2 arithmetic (binary polynomial division where addition and subtraction are identical to bitwise XOR, with no carries or borrows).
  3. The division yields an remainder polynomial , called the Frame Check Sequence (FCS).
  4. The transmitted frame polynomial is:
  1. The receiver divides the incoming frame by using modulo-2 arithmetic. If the remainder is strictly zero, no error is detected; otherwise, the frame is corrupted and discarded.

Standard generator polynomials:

CRC-32 detects all single-bit errors, all double-bit errors, all odd numbers of bit errors, and all burst errors of length .


3.3 Data link protocols: PPP, HDLC

High-Level Data Link Control (HDLC)

Standardized by ISO (ISO 3309 / 4335), HDLC is a foundational bit-oriented synchronous data link protocol:

Point-to-Point Protocol (PPP)

Standardized in RFC 1661, PPP is a byte-oriented protocol designed for direct communication over dial-up, DSL (PPPoE), and leased serial lines:


3.4 Logical link control (LLC) and media access control (MAC) sublayers

In local area networks (LANs), multiple devices share a single common transmission medium. To separate medium-independent functions from medium-dependent hardware mechanisms, the IEEE 802 committee partitioned the OSI Data Link Layer into two distinct sublayers:

AspectLogical Link Control (LLC)Media Access Control (MAC)
OSI Sublayer PositionUpper sublayer of Layer 2 (interfaces with Layer 3 Network Layer)Lower sublayer of Layer 2 (interfaces with Layer 1 Physical Layer)
Medium DependenceCompletely independent of underlying physical transmission mediumHardware-dependent; tailored to specific physical media (copper, fiber, RF)
Core FunctionsMultiplexes multiple network protocols; provides flow and error controlFrame delineation, physical MAC addressing, channel access contention
Addressing MechanismService Access Points: Destination SAP (DSAP) and Source SAP (SSAP)48-bit physical hardware MAC addresses burned into the NIC
Standard ScopeSingle standard: IEEE 802.2 used uniformly across all 802 LANsDiverse standards: IEEE 802.3 (Ethernet), 802.11 (Wi-Fi), 802.15 (Bluetooth)

3.5 Random access protocols: ALOHA, CSMA, CSMA/CD, CSMA/CA

In broadcast networks, when two or more nodes transmit simultaneously over a shared channel, their signals collide and corrupt the data. Multiple Access protocols coordinate channel usage:

1. Pure ALOHA

Developed by Norman Abramson at the University of Hawaii (1970):

Maximum throughput occurs at :

2. Slotted ALOHA

Roberts (1972) improved ALOHA efficiency by discretizing channel time:

Maximum throughput occurs at :

3. Carrier Sense Multiple Access (CSMA)

Instead of blindly transmitting like ALOHA, CSMA requires stations to "listen before talk" (carrier sensing). If the channel is sensed busy, transmission is deferred:

4. CSMA/CD (Carrier Sense Multiple Access with Collision Detection — IEEE 802.3)

Deploys "listen while talk" in wired Ethernet:

  1. Station senses the channel; if idle, begins transmitting.
  2. Station continues monitoring the channel voltage while transmitting its frame.
  3. If the signal voltage exceeds normal threshold, a collision is detected.
  4. Station aborts transmission immediately, broadcasts a jam signal to notify all network stations, and backs off.
  5. Truncated Binary Exponential Backoff: After -th consecutive collision (), the station waits a random integer number of slot times ( in ), where:

After 10 collisions, backoff range freezes at ; after 16 failed attempts, the frame is aborted.

In Ethernet with maximum round-trip propagation time , .

5. CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance — IEEE 802.11)

In wireless RF environments, collision detection is physically impossible because a station's own transmitter swamps its sensitive receiver (dynamic range mismatch) and nodes cannot sense collisions at distant receivers (hidden terminal problem). Therefore, Wi-Fi uses collision avoidance:


3.6 Token based protocols: Token bus, token ring, FDDI

Unlike contention-based random access protocols, token-based systems are deterministic collision-free protocols:

  1. Token Ring (IEEE 802.5):
    • Stations are wired logically and physically in a closed loop. A special 3-byte control frame called the token continuously circulates around the ring.
    • When a station with pending data captures the free token, it flips a bit in the token (converting it to a start-of-frame delimiter), appends its data frame, and transmits it downstream.
    • Each downstream station inspects the frame; if the destination MAC matches, it copies the frame and sets frame-status bits (A = 1, C = 1).
    • The frame returns to the sender, which strips the frame from the ring and releases a new free token.
    • Active Monitor Station: Eliminates orphaned frames and regenerates lost tokens.
  2. Token Bus (IEEE 802.4):
    • Stations are physically connected via a linear coaxial or broadband bus, but logically organized in a circular token ring ordered by descending station addresses.
    • Common in industrial manufacturing automation (MAP architecture).
  3. Fiber Distributed Data Interface (FDDI):
    • An ANSI / ISO standard operating at over optical fiber up to connecting up to stations.
    • Dual Counter-Rotating Rings: Features a Primary Ring (transmits data and tokens clockwise) and a Secondary Ring (transmits counter-clockwise).
    • If a fiber cable is severed or a station fails, neighboring stations automatically reconfigure internal optical bypass switches to loop (wrap) the primary ring into the secondary ring, creating a single continuous folded ring (self-healing ring).

3.7 Ethernet (IEEE 802.3) and its evolution, bridged and switched Ethernet

Ethernet is the universal dominant LAN technology. Originally designed by Robert Metcalfe at Xerox PARC (1973), it was standardized under IEEE 802.3.

The IEEE 802.3 Ethernet Frame Format

Standard IEEE 802.3 Ethernet MAC Frame Format
Field NameSize (Bytes)Purpose and Structure
Preamble7 bytesAlternating pattern 10101010 used by receiver to synchronize bit clock
Start of Frame Delimiter (SFD)1 byteByte 10101011 indicating that destination address immediately follows
Destination MAC Address6 bytes48-bit hardware address of receiving station (unicast, multicast, broadcast)
Source MAC Address6 bytes48-bit hardware address of transmitting network interface card
Length / EtherType2 bytesValue denotes length (802.3); value (0x0600) denotes protocol Type (Ethernet II: 0x0800 for IPv4, 0x86DD for IPv6, 0x0806 for ARP)
Payload Data46 to 1500 bytesNetwork layer PDU (e.g., IP datagram). Padded to if payload
Frame Check Sequence (FCS)4 bytes32-bit CRC (CRC-32) computed over destination, source, type, and payload

Evolution: Shared Bus Bridged Switched Ethernet

  1. Shared Bus / Hubs: All devices share a single coaxial cable or hub, forming one shared collision domain operating in half-duplex CSMA/CD.
  2. Bridged Ethernet (Transparent Bridging):
    • Multiport bridges connect LAN segments. A bridge maintains a Forwarding Database (MAC table) via:
      • Learning: Reads the source MAC address of every arriving frame and records (Source MAC, Ingress Port, Aging Timer) in its table.
      • Forwarding / Filtering: Inspects the destination MAC address. If the destination MAC is in the table on a different port, it forwards the frame to that specific port only; if on the same port, it drops (filters) it.
      • Flooding: If destination MAC is unknown or is a broadcast/multicast address, the bridge floods the frame to all ports except the arrival port.
  3. Spanning Tree Protocol (IEEE 802.1D STP):
    • Redundant physical links between bridges prevent single points of failure but create fatal forwarding loops, resulting in catastrophic broadcast storms and duplicate frame delivery.
    • STP dynamically elects a Root Bridge and disables (blocks) redundant switch ports, calculating a loop-free logical spanning tree. If an active link fails, blocked ports are automatically unblocked.
  4. Switched Ethernet: Modern Ethernet replaces shared links entirely with dedicated full-duplex microsegmentation on high-speed hardware ASIC switches. Collisions are eliminated ( collision-free), rendering CSMA/CD obsolete in full-duplex gigabit/10-gigabit links.

3.8 WLAN (Wi-Fi) and IEEE 802.11

Standardized by IEEE 802.11, Wireless Local Area Networks (WLANs) provide high-speed untethered network connectivity using RF spectrum in the unlicensed ISM () and UNII (, ) bands:

802.11 Architectural Topologies

The Hidden and Exposed Terminal Problems

Key IEEE 802.11 Wireless Standards Evolution
StandardFrequency BandMaximum Theoretical Physical Data RateModulation / Channel Bandwidth
802.11bDSSS, CCK ()
802.11aOFDM ()
802.11gOFDM ()
802.11n (Wi-Fi 4) / MIMO (up to 4 spatial streams),
802.11ac (Wi-Fi 5)256-QAM, MU-MIMO,
802.11ax (Wi-Fi 6)1024-QAM, OFDMA, Target Wake Time

3.9 VLAN and its importance

Definition

Virtual Local Area Network (VLAN)

A Virtual LAN (VLAN) is a logical subgrouping of network devices configured by software to communicate as if they were attached to the same isolated physical broadcast domain, regardless of their actual physical switch attachment.

Importance and Engineering Benefits of VLANs

  1. Broadcast Containment: Broadcast frames (such as ARP requests and DHCP discoveries) are confined strictly within the originating VLAN, preventing network congestion across other departments.
  2. Enhanced Security: Sensitive departmental traffic (e.g., Finance or Human Resources) is cryptographically or logically isolated at Layer 2; cross-VLAN communication requires routing through an explicit Layer 3 firewall or access control list (ACL).
  3. Cost Reduction and Geographic Flexibility: Users moving offices do not require physical recabling; administrators simply reassign their switch port to the appropriate VLAN via software configuration.

Access Ports vs. Trunk Ports and IEEE 802.1Q Tagging


3.10 Virtual circuit switching: ATM, MPLS

Connection-oriented virtual circuit networks combine the high throughput and predictable QoS of circuit switching with the flexible multiplexing efficiency of packet switching:

Asynchronous Transfer Mode (ATM)

Multiprotocol Label Switching (MPLS)

MPLS (IETF RFC 3031) has superseded ATM as the universal high-speed core transport protocol for Internet Service Providers:


Worked Out Examples

Example 3.1

3.1

A transmitter uses Cyclic Redundancy Check (CRC) error detection. The transmitter wants to send an 8-bit user data bitstring:

Sender and receiver agree upon the generator polynomial:

  1. Convert the generator polynomial into its corresponding binary divisor representation.
  2. Determine the degree of the generator polynomial and calculate the number of zero bits that must be appended to the data bitstring.
  3. Perform modulo-2 polynomial division to determine the -bit Frame Check Sequence (FCS) remainder.
  4. Construct the complete transmitted codeword bitstring and verify that the codeword is divisible by without remainder.

Formulating Divisor Binary and Augmented Data:

  • The generator polynomial is:

This corresponds directly to the binary divisor:

  • Degree of is .
  • Therefore, append zeros to the right of the data bitstring :

Executing Modulo-2 Long Division: Modulo-2 division uses bitwise XOR (with no borrows or carries):

Text
            10001111  (Quotient)
      -----------------
10101 ) 101001000000
        10101
        -----
        000011000000  -> Bring down next bits until length equals 5
            11000
            10101
            -----
            011010
             10101
             -----
             011110
              10101
              -----
              010110
               10101
               -----
               00011  -> Remainder (4 bits): 0011

The division yields the FCS remainder:

Constructing and Verifying Transmitted Codeword:

  • The transmitted codeword is formed by replacing the appended 4 zeros with the remainder :
  • Verification at Receiver: Dividing by using modulo-2 arithmetic leaves remainder . Hence, error-free transmission is confirmed.
Answer:
  1. Binary divisor: .
  2. Polynomial degree ; append zeros.
  3. FCS remainder: .
  4. Transmitted codeword: .
Example 3.2

3.2

A legacy IEEE 802.3 CSMA/CD Ethernet bus operates at transmission speed (). The maximum physical distance between the two farthest stations across the bus is . Assume:

Calculate:

  1. The one-way cable propagation delay in microseconds ().
  2. The total worst-case round-trip propagation time (), including repeater delays.
  3. The absolute minimum frame size in bits and bytes necessary to ensure collision detection operates reliably.
  4. Explain why Ethernet standardizes the minimum frame size at ().

Calculating One-Way and Worst-Case Round-Trip Delay:

  • One-way cable propagation delay:
  • Worst-case round-trip propagation time ():

Evaluating Minimum Frame Size Requirement: In CSMA/CD, the frame transmission time must be at least equal to the worst-case round-trip collision slot time:

In bytes:

Why IEEE Standardizes at (): To provide an engineering safety margin and accommodate maximum permissible cable topologies with repeaters and long drop cables (worst-case slot time of ):

If a frame is smaller than , the transmitter would complete transmission before the collision signal arrived back, wrongly concluding the frame was delivered without collision.

Answer:
  1. One-way propagation delay: .
  2. Total round-trip collision time: .
  3. Minimum calculated frame size: ().
  4. Standard Ethernet specifies () to cover maximum allowable worst-case topologies with an engineering safety margin.
Example 3.3

3.3

A shared broadcast radio channel operates at a digital transmission rate of (). Multiple ground stations generate fixed-length packets of . Assume Poisson frame arrival statistics across all stations with aggregate offered traffic rate .

  1. Calculate the frame transmission time in milliseconds ().
  2. Determine the maximum theoretical channel throughput in under Pure ALOHA, and state the value of offered traffic load at which this occurs.
  3. Determine the maximum theoretical channel throughput in under Slotted ALOHA, and state the value of offered traffic load at which this occurs.
  4. Explain mathematically why Slotted ALOHA achieves exactly twice the throughput of Pure ALOHA.

Calculating Frame Transmission Time: The time required to transmit one 1000-bit frame onto the channel:

Evaluating Maximum Throughput for Pure ALOHA and Slotted ALOHA:

  • Pure ALOHA Throughput:

Differentiating with respect to and setting to zero yields maximum throughput at :

Maximum throughput in kbps:

  • Slotted ALOHA Throughput:

Maximum throughput occurs at :

Maximum throughput in kbps:

Mathematical Justification of Performance Advantage:

  • In Pure ALOHA, stations transmit asynchronously at any moment. A packet transmitted at time is vulnerable to collisions from any packet that started transmitting between and . Thus, the vulnerable period is , yielding collision-free probability .
  • In Slotted ALOHA, stations transmit only at synchronized slot boundaries. A packet is vulnerable only to packets that arrived during the preceding single slot (). Thus, the vulnerable period is cut in half to , doubling the maximum throughput from to .
Answer:
  1. Frame transmission time: .
  2. Pure ALOHA: Max throughput = () at .
  3. Slotted ALOHA: Max throughput = () at .
  4. Slotted ALOHA restricts transmissions to discrete slot boundaries, reducing the collision vulnerable period from to , thereby doubling channel efficiency.

Practice Exercises

Practice Exercises — Data Link Layer & MAC Protocols

Question 1

Explain the Bit Stuffing framing algorithm. A data link transmitter receives the following payload bitstream from the network layer:

  1. Show the exact bitstream after bit stuffing is applied at the transmitter.
  2. Explain how the receiving data link layer recognizes frame boundaries and restores the original bitstream.

Bit Stuffing Algorithm and Transformation:

  • Rule: The flag pattern is (). Whenever the sender detects five consecutive s in user data, it immediately inserts a stuffed bit, regardless of whether the subsequent bit is a or a .
  • Input stream breakdown:
    • 0110 : No five consecutive 1s.
    • 11111 : Five consecutive 1s detected stuff a 0 followed by 1.
    • 0 : Followed by zero.
    • 11111 : Five consecutive 1s detected stuff a 0 followed by 0.
    • 010 : No five consecutive 1s.
    • 11111 : Five consecutive 1s detected stuff a 0 followed by remaining 11001.
  • Concatenating all stuffed segments:

Receiver De-Stuffing and Delimiting Operation:

  • The receiver scans incoming bits. Whenever it observes five consecutive s:
    • If the 6th bit is a , it is recognized as a stuffed bit and is automatically discarded (de-stuffed).
    • If the 6th bit is a and the 7th bit is a , the receiver recognizes the genuine end-of-frame flag 01111110.
    • If the 6th and 7th bits are both s (1111111), it indicates a transmission error or abort signal.
Answer:
  1. Stuffed bitstream: 011011111010111110001011111011001 (three -bits stuffed after each run of five s).
  2. The receiver discards any -bit immediately following five consecutive s, and identifies 01111110 as the true frame boundary.
Question 2

A data link layer uses CRC error detection with generator polynomial:

The transmitter transmits a 10-bit data message:

  1. Represent the generator polynomial as a binary bitstring.
  2. Compute the 4-bit CRC Frame Check Sequence (FCS) remainder using modulo-2 arithmetic.
  3. Formulate the transmitted codeword frame.

Divisor Bitstring and Modulo-2 Division:

  • (, degree ).
  • Append zeros to : ().
  • Execute modulo-2 division by :
    • bring down .
    • bring down bits .
    • bring down .
    • bring down .
    • remainder is .
  • The 4-bit remainder FCS is:

Constructing Transmitted Codeword:

  • Appending the FCS remainder to the original 10-bit data:
Answer:
  1. Divisor bitstring: .
  2. FCS remainder: .
  3. Transmitted codeword: .
Question 3

Compare CSMA/CD (Ethernet) and CSMA/CA (Wi-Fi) multiple access mechanisms. Explain why CSMA/CD cannot be used directly in wireless local area networks, detailing the Hidden Terminal Problem and the RTS/CTS mechanism.

Why CSMA/CD Fails in Wireless Networks:

  1. Dynamic Signal Power Range: Wireless transmissions attenuate rapidly with distance (inverse square law). A station's own transmitter radiates strong local RF power that completely overwhelms the millivolt-level signal from a distant colliding station; the station cannot hear collisions while transmitting.
  2. Half-Duplex Radio Constraints: Standard Wi-Fi transceivers cannot transmit and receive simultaneously on the exact same radio channel.
  3. Hidden Terminal Problem: Two wireless stations ( and ) separated by a wall or distance may both be within range of an Access Point (), but cannot detect each other's RF carriers. If both transmit simultaneously to , a destructive collision occurs at despite carrier sensing at and .

The RTS/CTS Solution in CSMA/CA:

  • Sender sends a short Request to Send (RTS) control frame containing the intended data transmission duration.
  • Receiver broadcasts a Clear to Send (CTS) frame containing the reserved duration.
  • Hidden terminal hears 's CTS and updates its internal Network Allocation Vector (NAV) timer, voluntarily suppressing its own transmissions until 's data and ACK complete.
Answer:

CSMA/CD is unworkable in wireless LANs due to enormous RF dynamic range differences, half-duplex radio hardware, and hidden terminal problems. CSMA/CA uses collision avoidance with interframe spaces (DIFS/SIFS), random backoff, and the RTS/CTS handshake (which alerts hidden terminals via CTS broadcast and NAV timer reservations) to prevent collisions before they occur.

Question 4

Describe how a Transparent Learning Switch operates. Explain how it builds its Forwarding Database (CAM table) and describe the three actions (filtering, forwarding, and flooding) it performs upon receiving a frame. Explain the purpose of the Spanning Tree Protocol (STP).

Transparent Learning Switch Operation:

  • A switch begins with an empty Media Access Control (MAC) address table.
  • Learning (Source Address Inspection): Whenever a frame arrives on port , the switch reads its Source MAC address and records the mapping (Source MAC, Port P_x, Timestamp) into its Content-Addressable Memory (CAM) table.
  • Forwarding Decision (Destination Address Inspection):
    1. Filtering: If the Destination MAC is in the table and resides on the same ingress port , the frame is filtered (discarded), as the destination already received it directly.
    2. Forwarding: If the Destination MAC is in the table on a different port , the switch selectively forwards the frame only out of port .
    3. Flooding: If the Destination MAC is not in the table, or is a broadcast/multicast address, the switch floods the frame out of all ports except the arrival port .

Role of Spanning Tree Protocol (IEEE 802.1D STP):

  • Redundant physical links between switches create closed switching loops. When a switch floods an unknown or broadcast frame, the frame circulates endlessly around the loop in both directions, consuming bandwidth (broadcast storm) and corrupting MAC tables.
  • STP uses Bridge Protocol Data Units (BPDUs) to elect a Root Bridge, compute shortest path costs, and selectively place redundant ports into a blocking state, guaranteeing a loop-free logical tree while maintaining automatic standby failover paths.
Answer:

A transparent switch automatically learns host locations by recording arriving Source MACs into its CAM table. It forwards known unicast frames to the specific destination port, filters frames on the same port, and floods unknown/broadcast frames out all other ports. The Spanning Tree Protocol (STP) prevents devastating broadcast storms by dynamically blocking redundant physical loops, creating a loop-free active forwarding topology.

Question 5

Explain the concept of a Virtual Local Area Network (VLAN) and distinguish between Access Ports and Trunk Ports.

  1. Describe the structure of the IEEE 802.1Q tag header.
  2. Calculate the maximum theoretical number of distinct VLANs supported by the 802.1Q standard.
  3. Explain how "Router-on-a-Stick" enables inter-VLAN routing using a single physical router interface.

Access Ports, Trunk Ports, and 802.1Q Tag Structure:

  • Access Port: Connects end-user hosts; belongs to a single VLAN and transmits standard untagged frames.
  • Trunk Port: Connects switch-to-switch or switch-to-router; multiplexes traffic for multiple VLANs using IEEE 802.1Q tags inserted between Source MAC and EtherType:
    • TPID (Tag Protocol Identifier, 16 bits): Set to 0x8100 to indicate an 802.1Q frame.
    • PCP (Priority Code Point, 3 bits): Layer 2 802.1p Quality of Service priority.
    • DEI (Drop Eligible Indicator, 1 bit): Congestion discard indicator.
    • VID (VLAN Identifier, 12 bits): Identifies the VLAN.
  • Maximum VLAN Count: With , there are possible IDs. Since VID (reserved for priority frames) and VID (reserved) cannot be assigned, there are:

Inter-VLAN Routing via "Router-on-a-Stick":

  • Because switches maintain strict Layer 2 isolation between different VLANs, traffic cannot pass between VLAN 10 and VLAN 20 within the switch.
  • In "Router-on-a-Stick", a single physical Ethernet cable connects a trunk switch port to a router physical interface.
  • The router physical interface is partitioned into logical sub-interfaces (e.g., FA0/0.10 and FA0/0.20), each configured with 802.1Q encapsulation for its respective VLAN ID and assigned that VLAN's default gateway IP.
  • Traffic from VLAN 10 travels up the trunk link tagged as VLAN 10, is routed by the router CPU into the VLAN 20 sub-interface, and is sent back down the same physical link tagged as VLAN 20.
Answer:
  1. Access ports carry untagged single-VLAN traffic; trunk ports carry multiplexed multi-VLAN traffic tagged with a 802.1Q header (TPID 0x8100, PCP, DEI, VID).
  2. Maximum usable VLAN IDs: ().
  3. Router-on-a-Stick configures logical sub-interfaces on a single physical router port connected to a switch trunk, routing tagged frames across subnets over the same physical cable.
← Physical LayerNetwork Layer (part 1: 4.1–4.6) →