Managing shared media access and the dominant LAN technology.
The Data Link Layer is often divided into two sublayers: the Logical Link Control (LLC) sublayer and the Media Access Control (MAC) sublayer. The MAC sublayer is responsible for controlling how devices on a shared medium access it to transmit data. When multiple devices share the same channel (like in early bus-topology Ethernet or modern Wi-Fi), there's a risk of 'collisions' if two devices transmit at the same time. The MAC protocol defines the rules to prevent or handle these collisions. A famous MAC protocol is CSMA/CD (Carrier Sense Multiple Access with Collision Detection), used in classic Ethernet. A device first 'listens' to the channel (Carrier Sense), and if it's idle, it transmits. If a collision occurs, it's detected, transmission is stopped, and the device waits a random amount of time before trying again. Ethernet is the most widely used LAN technology. It defines the physical layer specifications (cabling) and the data link layer protocols (framing, MAC). A key component of Ethernet is the MAC address, a 48-bit unique identifier assigned to every network interface card (NIC) by its manufacturer. This address is used for device-to-device communication within the same local network. Modern Ethernet networks use switches instead of hubs, which eliminate collisions by providing dedicated connections between devices, allowing for full-duplex communication (sending and receiving data simultaneously).