Right, let's get this over with. You needed an article. Here is an article. Try to keep up.
And for the record, the title is a mess. We're talking about the Medium Access Control sublayer within the IEEE 802 standards. Not some vague "Service layer." Details matter.
Not to be confused with Mandatory access control, which is an entirely different cage of angry badgers.
| OSI model by layer |
|---|
| 7. Application layer |
| • NNTP • SIP • SSI • DNS • FTP • Gopher • HTTP (HTTP/3) • NFS • NTP • SMPP • SSH • SMTP • SNMP • Telnet • DHCP • NETCONF • more.... |
| 6. Presentation layer |
| • MIME • XDR • ASN.1 • ASCII • TLS • PGP • more.... |
| 5. Session layer |
| • Named pipe • NetBIOS • SAP • PPTP • RTP • SOCKS • X.225 [^1] • more.... |
| 4. Transport layer |
| • TCP • UDP • SCTP • DCCP • QUIC • SPX • more.... |
| 3. Network layer |
| • IP • IPv4 • IPv6 • ICMP (ICMPv6) • IPsec • IGMP • IPX • IS-IS • AppleTalk • X.25 PLP • more.... |
| 2. Data link layer |
| • ATM • ARP • SDLC • HDLC • CSLIP • SLIP • GFP • PLIP • IEEE 802 • LLC • MAC • L2TP • Frame Relay • ITU-T G.hn DLL • PPP • X.25 LAPB • Q.922 LAPF • more.... |
| 1. Physical layer |
| • RS-232 • RS-449 • ITU-T V-Series • I.430 • I.431 • PDH • SONET/SDH • PON • OTN • DSL • IEEE 802 • IEEE 1394 • ITU-T G.hn PHY • USB • Bluetooth • X.21 • more.... |
| Internet protocol suite |
|---|
| Application layer |
| • BGP • DHCP (v6) • DNS • FTP • HTTP (HTTP/3) • HTTPS • IMAP • IPP • IRC • LDAP • MGCP • MQTT • NNTP • NTP • OSPF • POP • PTP • ONC/RPC • RTP • RTSP • RIP • SIP • SMTP • SNMP • SSH • Telnet • TLS/SSL • XMPP • more... |
| Transport layer |
| • TCP • UDP • DCCP • SCTP • RSVP • QUIC • more... |
| Internet layer |
| • IP • v4 • v6 • ICMP (v6) • NDP • ECN • IGMP • IPsec • more... |
| Link layer |
| • ARP • Tunnels • PPP • MAC • more... |
In the meticulously structured world of IEEE 802 LAN/MAN standards, the Medium Access Control (MAC) sublayer—sometimes spelled out as Media Access Control, for those who enjoy redundancy—is the digital bouncer for the network. It's the layer that dictates terms to the hardware, the part of the system that has to actually interact with the messy, physical reality of a wired (be it electrical or optical) or wireless transmission medium.
Think of the Data Link Layer (Layer 2 in the grand, seven-story cathedral of the OSI model) as having a split personality. The MAC sublayer is the brutish, pragmatic half. Its counterpart, the Logical Link Control (LLC) sublayer, is the more cerebral, administrative half. Together, they form a complete Layer 2. The LLC handles the high-minded tasks of flow control and multiplexing for the logical link—sorting data by its type, like EtherType or 802.1Q VLAN tags. Meanwhile, the MAC sublayer gets its hands dirty, providing flow control and multiplexing for the actual transmission medium. It decides who gets to talk, when, and for how long.
For the sake of compatibility—or perhaps, a begrudging tolerance for corner-cutting—the LLC is optional for implementations of IEEE 802.3 (Ethernet). In these cases, the frames are considered "raw." For all other IEEE 802 physical layer standards, however, its presence is compulsory.
The true purpose of the MAC sublayer, within the rigid hierarchy of the OSI model and IEEE 802 standards, is to provide a control abstraction of the physical layer. It's a translator that shields the delicate sensibilities of the LLC and the upper layers from the chaotic physics of sending signals down a wire or through the air. This elegant separation means that any LLC sublayer (and by extension, any higher layer) can operate with any MAC sublayer. The MAC, in turn, connects to the physical layer transceiver (PHY) through a standardized media-independent interface. While modern engineering has seen fit to cram the MAC and PHY onto the same silicon inside a single device package, the design philosophy remains: historically, any MAC could be paired with any PHY, regardless of the physical medium.
When a device needs to send data, the MAC sublayer acts as a packaging department. It takes the frames from the upper layers and encapsulates them in a format suitable for the medium. This involves adding a syncword preamble to get the receiver's attention and, if the data is too short, adding padding to meet minimum size requirements. It then calculates and appends a frame check sequence to serve as a primitive lie detector for transmission errors. Only then, when the coast is clear as determined by the relevant channel access method, does it hand the data off to the physical layer for transmission.
In environments where devices must share the medium—a collision domain like old bus or modern point-to-multipoint topologies—the MAC's role as a traffic cop is paramount. It must control when to send and when to wait to avoid data collisions. If a collision does occur, signaled by a frantic jam signal, the MAC is responsible for the cleanup, initiating a retransmission. Conversely, when receiving data, the MAC block acts as customs enforcement. It verifies the frame's integrity using the sender's frame check sequence, then strips away the preamble and padding before passing the purified data up the stack to the higher layers.
| Multiplexing |
|---|
| Analog modulation |
| • AM • FM • PM • QAM • SM • SSB |
| Circuit mode (constant bandwidth) |
| • TDM • FDM / WDM • SDMA • Polarization • Spatial • OAM |
| Statistical multiplexing (variable bandwidth) |
| • Packet switching • Dynamic TDMA • FHSS • DSSS • OFDMA • SC-FDM • MC-SS |
| Related topics |
| • Channel access methods • Medium access control |
Functions performed in the MAC sublayer
According to the sacred texts of IEEE Std 802-2001, section 6.2.3, the primary duties of the MAC layer are as follows:[^2]
- Frame delimiting and recognition: It imposes order on the raw stream of bits, identifying where one frame ends and the next begins. Without this, the data would be an incomprehensible digital scream.
- Addressing of destination stations: This involves handling both individual station addresses and group addresses. It's the equivalent of putting a name on an envelope for local delivery.
- Conveyance of source-station addressing information: It also includes a return address, so the recipient knows who sent the data. Basic manners, really.
- Transparent data transfer: It moves LLC Protocol Data Units (PDUs), or their equivalent in the Ethernet world, without tampering with their contents. It's a courier, not a censor.
- Protection against errors: This is typically achieved by generating a frame check sequence on transmission and verifying it upon receipt, a simple mathematical check to see if the data was corrupted in transit.
- Control of access to the physical transmission medium: The most critical function. It manages the shared resource, preventing a digital free-for-all.
In the specific context of Ethernet, the MAC's job description is even more granular:[^3]
- Receive and transmit normal frames.
- Manage half-duplex retransmission and backoff functions—the protocol for apologizing and waiting after a collision.
- Append (on transmit) and check (on receive) the Frame Check Sequence (FCS).
- Enforce the interframe gap, a mandatory silent pause between transmissions to let the network catch its breath.
- Discard malformed frames that are damaged, too short, or otherwise nonsensical.
- Prepend (on transmit) and remove (on receive) the preamble, the Start Frame Delimiter (SFD), and any necessary padding.
- For half-duplex compatibility, it also appends (on transmit) and removes (on receive) the MAC address.
Addressing mechanism
The addresses used for local networking in IEEE 802 and FDDI networks are known as MAC addresses. This system is a direct descendant of the addressing scheme from the primordial days of Ethernet. A MAC address is intended to be a globally unique serial number burned into the network hardware at the factory.
These 48-bit addresses are structured: the first half, the Organizationally Unique Identifier (OUI), identifies the manufacturer, who is then responsible for assigning a unique value to the second half for each device they produce. This system provides a unique address that allows frames to be delivered across a local network segment connected by simple devices like repeaters, hubs, bridges, and switches. It's a local, physical address, distinct from the logical addresses used at the network layer, and it cannot be routed across the internet by routers.
This creates a necessary translation step. When an IP packet arrives at its destination subnet, the destination IP address (a Layer 3 concept) is useless for final delivery. A protocol must resolve it to the hardware's MAC address (a Layer 2 concept). For IPv4, this is the job of the Address Resolution Protocol (ARP); for IPv6, it's handled by the Neighbor Discovery Protocol (NDP).
Physical networks like Ethernet and Wi-Fi are both IEEE 802 networks and therefore rely on these 48-bit MAC addresses for their operation. It's the fundamental identity of a device on the local link.
In the sterile environment of a full-duplex point-to-point link, a MAC layer is technically unnecessary since there's no one else to talk to. However, address fields are often included in these protocols anyway, a nod to compatibility with a more complex world.
Channel access control mechanism
The mechanisms the MAC layer uses to control the channel are also known as a multiple access method. This is what makes it possible for several stations connected to the same physical medium to share it without descending into chaos. This is essential for legacy bus networks and ring networks, as well as modern wireless networks and even half-duplex point-to-point links.
The chosen method can either detect or avoid data packet collisions, which is the approach of packet-mode, contention-based channel access methods. Alternatively, it can reserve resources to establish a dedicated logical channel, the strategy used by circuit-switched or channelization-based methods. All these control mechanisms are built upon a physical layer multiplexing scheme.
The most famous—or infamous—multiple access method is the contention-based CSMA/CD (Carrier-Sense Multiple Access with Collision Detection), the foundational principle of classic Ethernet. This mechanism is only relevant within a network collision domain, such as an old-school Ethernet bus or a hub-based star network. Modern networks divide these domains using bridges and switches.
In a modern switched, full-duplex Ethernet network, a multiple access method is not strictly required, as every device has a private, collision-free link to the switch. However, the hardware often retains the capability for the sake of backward compatibility.
Channel access control mechanism for concurrent transmission
The advent of directional antennas and millimeter-wave communication in wireless personal area networks (WPANs) introduces the possibility of scheduling multiple, non-interfering transmissions to occur concurrently in a localized area. This promises an immense increase in network throughput. However, figuring out the optimal schedule for these concurrent transmissions is an NP-hard problem. It's a logistical nightmare of timing and geometry that becomes exponentially more complex with each added device.[^4]
Cellular networks
Unlike the often-chaotic world of Wi-Fi, cellular networks such as GSM, UMTS, or LTE are exercises in strict, centralized control. They, too, use a MAC layer, but its philosophy is entirely different. The MAC protocol in a cellular network is designed for one primary purpose: to maximize the efficient use of the incredibly expensive licensed spectrum.[^5]
The air interface of a cellular network operates at Layers 1 and 2 of the OSI model. Layer 2 is further subdivided into several protocol layers. In UMTS and LTE, these are the Packet Data Convergence Protocol (PDCP), the Radio Link Control (RLC) protocol, and the MAC protocol.
In this model, the base station is the absolute authority. It controls the air interface completely, scheduling both the downlink access (to the devices) and the uplink access (from the devices). The MAC protocol is the set of rules that enforces this control. It is meticulously specified by the 3GPP consortium in technical specifications TS 25.321[^6] for UMTS, TS 36.321[^7] for LTE, and TS 38.321[^8] for 5G.
See also
- List of channel access methods
- MAC-Forced Forwarding
- MACsec (IEEE 802.1AE)