OSI Layer Data Link
In short: Layer 2 of the OSI model (data link layer) ensures transmission between directly connected devices.
In more detail: Data is packed into frames and given MAC addresses. A checksum (CRC) detects transmission errors.
In Depth
Devices and protocols
Switches and bridges, Ethernet, Wi-Fi, VLAN, ARP, MAC addresses.
Access methods
CSMA/CD (Ethernet) and CSMA/CA (Wi-Fi). See OSI layers, frames.
See also: OSI Layers, Switch, MAC Addresses, Frames