Multiple Access Overview
The MAC Sublayer
Read aloud is unavailable in this browser.
The Traffic Controller of Network Communication
Imagine an international airport with a single runway shared by hundreds of airlines. The runway itself is a shared resource—only one plane can land or take off at any moment. The air traffic controller's job is to coordinate access: deciding who goes when, preventing collisions, and ensuring efficient use of the runway capacity.
The MAC (Medium Access Control) sublayer is the air traffic controller of computer networks. It sits at a critical junction in the protocol stack, mediating between the raw physical transmission of bits and the higher-level abstraction of frames. It determines when a device can transmit, handles the addressing necessary to identify specific destinations, and manages the shared medium access problem we explored in the previous page.
Understanding the MAC sublayer's position and responsibilities is essential for comprehending how networks actually function at the hardware and software boundary.
This page provides a deep dive into the MAC sublayer: its architectural position within the Data Link Layer, its specific responsibilities, the distinction between MAC and LLC sublayers, hardware and software implementation details, and how the MAC sublayer interfaces with adjacent layers. You'll understand exactly where MAC protocols operate and why this architectural choice matters.
Position in the Protocol Stack
The Data Link Layer (Layer 2 of the OSI model) is unique in that it's officially divided into two sublayers. This division isn't arbitrary—it reflects the fundamentally different concerns of managing shared medium access versus providing a uniform interface to the Network Layer.
The Two Sublayers of the Data Link Layer
1. Logical Link Control (LLC) Sublayer — Upper Half The LLC sublayer provides a uniform interface to the Network Layer regardless of the underlying network technology. It handles:
- Multiplexing of network protocols (allowing multiple Layer 3 protocols over one link)
- Flow control between adjacent nodes
- Error handling and acknowledgment (in some configurations)
- Framing in some network types
2. Medium Access Control (MAC) Sublayer — Lower Half The MAC sublayer deals directly with access to the physical transmission medium. It handles:
- Determining when a station can transmit on a shared medium
- Physical addressing (MAC addresses)
- Frame delimiting and recognition
- Error detection (CRC calculation)
- Interface with the physical layer
Why the Sublayer Division?
The separation of LLC and MAC reflects a practical reality: the challenges of controlling access to different physical media (coaxial cable, twisted pair, wireless, fiber) vary dramatically, while the interface to the Network Layer should remain consistent.
MAC sublayer varies by technology:
- Ethernet MAC handles CSMA/CD (classic) or switch-based forwarding (modern)
- Wi-Fi MAC handles CSMA/CA with RTS/CTS for hidden terminals
- Token Ring MAC handles token passing and priority mechanisms
- Fiber Channel MAC handles credit-based flow control
LLC sublayer provides uniformity:
- IP packets (Layer 3) look the same whether carried over Ethernet, Wi-Fi, or Token Ring
- The Network Layer doesn't need to understand the access method
- New MAC technologies can be introduced without changing higher layers
This architectural separation embodies a fundamental principle of good software design: separation of concerns. The MAC sublayer owns all responsibility for dealing with the specific transmission medium, freeing the LLC and Network Layer to focus on end-to-end communication.
The IEEE 802 committee created this sublayer structure specifically to allow multiple LAN technologies (802.3 Ethernet, 802.5 Token Ring, 802.11 Wi-Fi) to coexist with a common LLC (802.2). This enabled enterprises to mix network technologies while maintaining consistent higher-layer operation.
Core MAC Sublayer Responsibilities
The MAC sublayer has a well-defined set of responsibilities that it must fulfill for any network technology. These responsibilities can be grouped into four major categories:
1. Channel Access Control
The primary and defining responsibility of the MAC sublayer is controlling when a station can transmit data onto the shared medium. This involves:
Access Method Implementation: Executing the specific algorithm for the network type—whether that's carrier sensing for Ethernet, token holding for Token Ring, or contention window management for Wi-Fi.
Collision Handling: Detecting when simultaneous transmissions occur (or avoiding them proactively) and coordinating retransmission. This includes implementing backoff algorithms that determine how long to wait before retrying.
Medium State Monitoring: Continuously tracking whether the channel is idle, busy, or in a collision state. This sensing drives access decisions.
Fairness Enforcement: Ensuring that aggressive stations don't monopolize the channel while other stations starve. Mechanisms like random backoff and token rotation provide fairness.
- •Channel Access Control — Determining when and how stations can transmit on the shared medium, including collision detection/avoidance and backoff algorithms
- •Physical Addressing — Managing 48-bit MAC addresses for source identification and destination targeting on the local network segment
- •Frame Delimiting — Marking frame boundaries with preambles, start frame delimiters, and length/type fields so receivers know where frames begin and end
- •Error Detection — Computing and verifying Frame Check Sequences (typically CRC-32) to detect transmission errors
- •Media-Specific Services — Handling technology-specific features like VLAN tagging, priority queuing, and power management
2. Physical Addressing
The MAC sublayer manages MAC addresses—the globally unique 48-bit (6-byte) identifiers assigned to every network interface. These addresses serve critical functions:
Source Identification: Every transmitted frame carries the sender's MAC address, allowing receivers to know who sent the frame and enabling replies.
Destination Targeting: Frames specify a destination MAC address. This can be:
- Unicast: A single specific interface (individual bit = 0)
- Multicast: A group of interfaces subscribed to the address (individual bit = 1, not broadcast)
- Broadcast: All interfaces on the network segment (FF:FF:FF:FF:FF:FF)
Local Scope: Unlike IP addresses that enable global routing, MAC addresses are meaningful only within a local network segment. Routers strip MAC headers and add new ones for each hop.
MAC Address Structure
A MAC address is typically written as six pairs of hexadecimal digits: 00:1A:2B:3C:4D:5E
| OUI (24 bits) | NIC (24 bits) |
| Organizationally Unique Identifier | Network Interface Controller specific |
| Assigned by IEEE to manufacturer | Assigned by manufacturer to device |
Bit 0 (I/G bit): Individual (0) vs. Group/Multicast (1) Bit 1 (U/L bit): Universally administered (0) vs. Locally administered (1)
3. Frame Delimiting and Structure
The MAC sublayer is responsible for creating recognizable frame boundaries on a stream of bits. This involves:
Preamble: A known bit pattern (typically alternating 1s and 0s) that allows receivers to synchronize their clocks with the incoming signal. Ethernet uses 7 bytes of 10101010.
Start Frame Delimiter (SFD): A specific pattern (10101011 in Ethernet) that signals "the actual frame data begins now."
Length/Type Field: Indicates either the payload length (for IEEE 802.3) or the protocol type (for Ethernet II). Values ≤1500 are lengths; values ≥1536 are protocol types (like 0x0800 for IP).
Frame Check Sequence (FCS): A CRC calculated over the frame contents, appended at the end for error detection.
4. Error Detection
The MAC sublayer provides error detection (not correction) through the Frame Check Sequence:
CRC-32 Polynomial: Most MAC protocols use the standard CRC-32 polynomial for high error detection probability.
Coverage: The CRC covers destination address, source address, length/type, and data payload—everything except preamble and SFD.
Detection Power: CRC-32 detects all burst errors up to 32 bits, all odd-number bit errors, and the vast majority of other error patterns.
Note: The MAC sublayer detects errors but typically doesn't correct them. Corrupted frames are simply discarded. Error recovery (retransmission) is handled by higher layers (TCP) or by lower-layer ARQ protocols where implemented.
MAC vs. LLC: Deep Comparison
While both MAC and LLC are sublayers of the Data Link Layer, they serve fundamentally different purposes. Understanding this distinction is crucial for grasping how network protocols are organized.
Logical Link Control (LLC) — IEEE 802.2
The LLC sublayer sits above the MAC sublayer and provides services that are common across different LAN technologies:
Protocol Multiplexing/Demultiplexing: A single network interface may carry traffic for multiple Network Layer protocols (IPv4, IPv6, IPX, AppleTalk historically). The LLC sublayer uses Service Access Points (SAPs) or SNAP headers to identify which protocol a frame belongs to.
Connection Services (Optional): LLC defines three types of service:
- Type 1 (Unacknowledged Connectionless): Simple datagram delivery, no guarantees. Most common.
- Type 2 (Connection-Oriented): Reliable delivery with sequencing and flow control. Rarely used today.
- Type 3 (Acknowledged Connectionless): Individual datagrams acknowledged. Used in industrial automation.
Uniform Interface: Regardless of whether the underlying MAC is Ethernet, Token Ring, or Wi-Fi, the LLC presents the same interface to the Network Layer.
| Characteristic | MAC Sublayer | LLC Sublayer |
|---|---|---|
| Primary concern | Physical medium access | Network protocol multiplexing |
| Addressing | 48-bit hardware addresses | 8-bit SAP addresses or SNAP |
| Technology dependence | Highly dependent (different per technology) | Technology independent |
| Standardization | IEEE 802.3, 802.5, 802.11, etc. | IEEE 802.2 (common to all) |
| Hardware implementation | Typically in NIC hardware | Often in NIC firmware or driver |
| Frame position | Outer frame structure | Encapsulated within MAC frame |
| Error handling | Detection only (CRC) | Optional acknowledgment/retry |
| Connection support | None (frame-by-frame) | Optional connection-oriented service |
The Modern Reality: LLC's Diminished Role
In contemporary networks, the LLC sublayer has become somewhat vestigial. Several factors contributed to this:
Ethernet II Domination: The original DIX Ethernet (Ethernet II) frame format didn't include an LLC layer—it used the Type field directly for protocol identification. This format became dominant for IP traffic, bypassing 802.2 LLC entirely.
IP Everywhere: With IPv4/IPv6 becoming nearly universal, the protocol multiplexing function became trivial. Networks rarely carry multiple Network Layer protocols anymore.
TCP Reliability: LLC's connection-oriented service (Type 2) duplicates functions already provided by TCP. There's no benefit to reliable delivery at Layer 2 when TCP provides it end-to-end.
Practical Usage Today:
- Most IP over Ethernet uses Ethernet II format (no LLC)
- Wi-Fi frames include an LLC/SNAP header for protocol identification
- Token Ring (now obsolete) used LLC extensively
- Some industrial protocols (Manufacturing Message Specification) use LLC Type 2
The MAC sublayer, by contrast, remains absolutely essential. You cannot transmit on a shared medium without access control, and physical addressing is fundamental to local delivery.
While the OSI model cleanly separates LLC and MAC, real implementations often blur this boundary. Modern NIC drivers handle both sublayers seamlessly. The conceptual distinction remains valuable for understanding responsibilities, even if software doesn't strictly separate them.
Hardware and Software Implementation
The MAC sublayer is unique in the protocol stack: it straddles the boundary between hardware and software. Understanding this implementation split explains why MAC protocols behave as they do and why certain features are fast while others are slow.
Hardware Implementation (NIC)
The Network Interface Card (NIC) implements the most time-critical MAC functions in dedicated hardware:
Preamble and SFD Generation/Detection: The precise timing of the preamble pattern (used for clock synchronization) requires hardware implementation. Software couldn't generate the microsecond-precise timing needed.
CRC Calculation and Verification: Modern NICs compute CRC-32 in hardware at wire speed. Doing this in software would introduce unacceptable latency and CPU overhead.
Carrier Sensing and Collision Detection: In CSMA/CD networks, detecting voltage levels on the wire and recognizing collisions happens at nanosecond timescales—purely in hardware.
MAC Address Filtering: NICs examine the destination address of every frame on the network. Only frames addressed to this NIC (or broadcast/multicast addresses it's listening for) are passed to the driver. This filtering happens in hardware to avoid interrupting the CPU for irrelevant traffic.
Inter-Frame Gap Enforcement: The mandatory gap between frames (96 bit-times for Ethernet) is generated by hardware timers.
| Function | Implementation | Why This Location |
|---|---|---|
| Preamble/SFD handling | Hardware (PHY) | Nanosecond timing precision required |
| CRC calculation | Hardware (MAC controller) | Wire-speed processing, too fast for software |
| Carrier sensing | Hardware (PHY) | Continuous monitoring at electrical level |
| Collision detection | Hardware (MAC controller) | Must respond within bit times |
| MAC address filtering | Hardware (MAC controller) | Every frame examined, would overwhelm CPU |
| Inter-frame gap | Hardware (MAC controller) | Precise timing enforcement |
| Backoff timer | Hardware/Firmware | Random delays, moderate timing requirements |
| Retry counting | Firmware/Driver | Simple counter, not time-critical |
| Statistics collection | Firmware/Driver | Counting frames/bytes for management |
| Promiscuous mode | Hardware + Driver | Filter override decision in driver, execution in hardware |
| VLAN tagging | Hardware/Driver | Tag insertion/removal at wire speed |
Firmware and Driver Implementation
NIC Firmware: Many modern NICs contain embedded processors running firmware that handles:
- Advanced filtering (VLAN, multicast group management)
- Offload features (checksum, segmentation)
- Power management (Wake-on-LAN)
- Management interfaces (SMBus, NC-SI)
Device Drivers: The operating system's NIC driver manages:
- Initialization and configuration of the NIC hardware
- Buffer management for transmit and receive queues
- Interrupt handling when frames arrive or transmissions complete
- Interface to the operating system's network stack
- Protocol-level statistics and error counting
The Hardware/Software Boundary
The placement of functions at this boundary involves tradeoffs:
Hardware Advantages:
- Speed: Wire-rate processing without CPU involvement
- Precision: Exact timing for protocols
- Efficiency: Don't interrupt CPU for every frame
Software Advantages:
- Flexibility: Can update behavior without hardware changes
- Cost: General-purpose CPU cheaper than specialized logic
- Debugging: Easier to troubleshoot and monitor
Trend: Modern NICs push more functionality into hardware ("offload") to achieve higher speeds:
- TCP segmentation offload (TSO)
- Large receive offload (LRO)
- Checksum offload
- VLAN acceleration
- Receive-side scaling (RSS)
This trend continues with "smart NICs" that contain programmable processors capable of running complex networking logic in the NIC itself.
When debugging network issues, understanding the hardware/software split helps identify bottlenecks. If CRC errors spike, that's a physical layer or hardware problem. If frame drops occur but CRCs are fine, look at driver buffer management or CPU saturation.
Layer Interfaces: Above and Below the MAC
The MAC sublayer doesn't operate in isolation—it provides services to layers above and consumes services from layers below. Understanding these interfaces clarifies how data flows through the network stack.
Interface with the Physical Layer (Below)
The Physical Layer provides raw bit transmission services to the MAC sublayer:
Services Consumed by MAC:
- Bit transmission: Converting MAC's frames into physical signals (voltage, light, radio)
- Bit reception: Converting physical signals back into bits
- Carrier sensing: Indicating whether the medium is idle or busy
- Collision indication: Signaling when overlapping transmissions are detected
- Link status: Indicating whether a valid link exists (link up/down)
Data Unit Exchange:
- MAC passes down: Bit streams representing frames
- Physical passes up: Bit streams with possible errors
Timing Information: The Physical Layer provides timing through recovered clock from the preamble. The MAC sublayer relies on this synchronized timing for accurate frame reception.
| Interface | Direction | Information Exchanged |
|---|---|---|
| To Physical (transmit) | Downward | Serial bit stream, transmit request |
| From Physical (receive) | Upward | Serial bit stream, carrier/collision status |
| To LLC/Network (deliver) | Upward | Frame data, source/destination addresses, type |
| From LLC/Network (submit) | Downward | Payload data, destination address, priority |
| Management interface | Lateral | Statistics, configuration, error counts |
Interface with the LLC/Network Layer (Above)
The MAC sublayer provides frame transmission and reception services to higher layers:
Services Provided by MAC:
- Frame transmission: Accept data payloads and destination addresses, handle all access control, return transmission status
- Frame reception: Deliver received payloads with source addresses and frame type/length information
- Address management: Provide the interface's own MAC address for use in building ARP responses, DHCP requests, etc.
- Service quality: In some technologies, support priority levels for traffic differentiation
Abstraction Provided: The LLC/Network Layer doesn't need to know:
- Which access method is used (CSMA/CD, CSMA/CA, token passing)
- How many collisions occurred before successful transmission
- The physical encoding scheme (Manchester, 4B/5B, OFDM)
- The transmission speed or duplex mode
What Higher Layers Must Know:
- Maximum frame size (MTU—Maximum Transmission Unit)
- Whether the link is operational
- Possibly transmission status (success/failure) for specific frames
The Service Primitive Model
Formally, layer interfaces are defined through service primitives—the requests and responses exchanged between layers:
MA-DATA.request: Higher layer requests frame transmission
- Parameters: destination address, payload data, priority
MA-DATA.confirm: MAC reports transmission outcome
- Parameters: success/failure status
MA-DATA.indication: MAC delivers received frame
- Parameters: source address, payload data, type/length
This primitive-based interface allows clean separation: the Network Layer talks in terms of "send this payload to this destination" without knowing anything about collision resolution or carrier sensing.
Real network stacks don't always implement these interfaces exactly as defined in standards. The kernel may combine layers, NICs may bypass the formal stack with hardware offload, and performance optimizations blur boundaries. But the logical separation remains important for understanding and troubleshooting.
MAC Sublayer Across Network Technologies
While the MAC sublayer's responsibilities are consistent, the implementation varies dramatically across network technologies. Each technology's MAC was designed to address specific physical medium characteristics and application requirements.
Ethernet MAC (IEEE 802.3)
Access Method: Originally CSMA/CD; modern switched Ethernet uses full-duplex point-to-point links with no access contention.
Frame Format:
- Preamble: 7 bytes of 10101010
- SFD: 1 byte of 10101011
- Destination Address: 6 bytes
- Source Address: 6 bytes
- Type/Length: 2 bytes
- Data: 46-1500 bytes (padding if needed)
- FCS: 4 bytes CRC-32
Minimum Frame Size: 64 bytes (ensures collision detection in large networks) Maximum Frame Size: 1518 bytes (1522 with VLAN tag)
Key Features:
- Slot time based on propagation delay and minimum frame size
- Binary exponential backoff after collisions
- Broadcast domain extends to all connected devices
| Technology | Access Method | Frame Size | Key Characteristics |
|---|---|---|---|
| Ethernet (802.3) | CSMA/CD → Switch | 64-1518 bytes | Dominant LAN technology, evolved to full-duplex |
| Wi-Fi (802.11) | CSMA/CA + RTS/CTS | Variable to 2346+ bytes | Hidden terminal handling, power management |
| Token Ring (802.5) | Token passing | Variable to 4500+ bytes | Deterministic access, obsolete |
| FDDI | Timed token passing | 4500 bytes maximum | 100 Mbps fiber, largely replaced by Gigabit Ethernet |
| Bluetooth | Frequency hopping + polling | Variable | Master/slave architecture, short range |
| LTE/5G | OFDMA scheduling | Variable | Centralized scheduling by base station |
Wi-Fi MAC (IEEE 802.11)
Access Method: CSMA/CA (Collision Avoidance) because collision detection is impossible in wireless.
Key Differences from Ethernet:
- Four address fields: Supports wireless distribution system with multiple APs
- Duration field: Supports virtual carrier sensing (NAV)
- RTS/CTS: Addresses hidden terminal problem
- Acknowledgments: Every unicast frame must be acknowledged
- Fragmentation: Large frames can be fragmented for reliability
- Power save modes: Stations can sleep and buffer frames at AP
Frame Types:
- Management: Beacons, probe requests/responses, authentication
- Control: RTS, CTS, ACK, Block ACK
- Data: Actual payload frames
Token Ring MAC (IEEE 802.5) — Historical
Access Method: Token passing. Only the station holding the token can transmit.
Key Features:
- Priority mechanism: Frames have priority levels; high-priority frames get the token sooner
- Monitor station: One station monitors ring health, removes orphan frames
- Early token release: Enhanced throughput by releasing token before frame returns
Why It Failed:
- Higher cost per port than Ethernet
- More complex to troubleshoot (ring dependencies)
- Slower adaptation to higher speeds
- Switched Ethernet eliminated Ethernet's collision problems
The Common Thread
Despite these differences, all MAC sublayers perform the same fundamental functions:
- Determine when to transmit
- Address frames to destinations
- Delimit frame boundaries
- Detect transmission errors
The differences lie in how these functions are implemented to suit each medium's physical characteristics.
Understanding MAC-level differences helps in technology selection. Need guaranteed latency? Consider token-based or scheduled access. Need low cost and simplicity? Ethernet. Need mobility? Wi-Fi. Each MAC was designed for specific use cases.
Summary: The MAC Sublayer's Central Role
We've explored the MAC sublayer in depth—its architectural position, responsibilities, implementation, and variation across technologies. Let's consolidate the key insights:
- •The MAC sublayer is the lower half of the Data Link Layer — It handles medium access while the LLC sublayer (above) handles protocol multiplexing and the uniform interface.
- •Four core responsibilities: Channel access control, physical (MAC) addressing, frame delimiting, and error detection via CRC.
- •MAC addresses are 48-bit globally unique identifiers — Assigned by manufacturers with IEEE OUI prefixes, used for local delivery within network segments.
- •Implementation spans hardware and software — Time-critical functions (CRC, carrier sensing) are in NIC hardware; management and configuration are in drivers.
- •Clean interfaces above and below — MAC presents a simple frame service to higher layers while using bit transmission services from the Physical Layer.
- •Technology-specific implementations — Each network technology (Ethernet, Wi-Fi, Token Ring) has a different MAC designed for its medium's characteristics.
What's Next
With the MAC sublayer's architecture and responsibilities clear, we're ready to dive deeper into one of its most critical concerns: collisions. The next page provides an exhaustive treatment of the collision concept—what collisions are, how they're detected, why they're wasteful, and the strategies (detection and avoidance) used to handle them.
Understanding collisions is essential preparation for studying specific MAC protocols like CSMA/CD and CSMA/CA, where collision handling is the core design challenge.
You now understand the MAC sublayer's position in the protocol stack, its distinct responsibilities from the LLC sublayer, how it's implemented across hardware and software, and how it interfaces with adjacent layers. This architectural knowledge will inform your understanding of every MAC protocol we study.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.