6.1 – Introduction to the Link Layer
- Any device that runs a link-layer protocol is called a node.
- Includes hosts, routers, switches and WiFi access points.
- Communication channels that connect adjacent nodes along the communication path are called links.
- A transmitting node encapsulates the datagram in a link-layer frame and transmits the frame over the link.
6.1.1 – The services Provided by the Link Layer
- Possible services that can be offered by a link-layer protocol include:
- Framing:
- Encapsulation of network-layer datagrams.
- A frame consists of a data field, in which the network-layer datagram is inserted, and a number of header fields. The structure of the frame is specified by the link-layer protocol.
- Link access:
- A medium access control (MAC) protocol specifies the rules by which a frame is transmitted onto the link.
- Point-to-Point links that have a single sender and receiver at the ends of the same link has a simple MAC protocol:
- The sender can send a frame whenever the link is idle.
- Multiple nodes sharing a single broadcast link (multiple access problem):
- The MAC protocol serves to coordinate the frame transmission of the many nodes.
- Reliable delivery:
- Guarantees to move each network-layer datagram across the link without error.
- Similar to a transport-layer reliable delivery service, a link-layer reliable delivery service can be achieved with acknowledgments and retransmission.
- A link-layer reliable delivery service is often used for links that are prone to high error rates, such as a wireless link.
- Error detection and correction:
- The link-layer hardware in a receiving node can incorrectly decide that a bit in a frame is zero when it was transmitted as a one, and vice versa.
- Such errors are introduced by signal attenuation and electromagnetic noise.
- Because there is no need to forward a datagram that has an error, many link-layer protocols provide a mechanism to detect such bit errors.
- This is done by having the transmitting node include error-detection bits in the frame, and having the receiving node perform an error check.
6.1.2 – Where Is the Link Layer Implemented
- For the most part, the link layer is implemented in a network adapter, also sometimes known as a network interface card (NIC).
- At the heart of the network adapter is the link-layer controller, usually a single, special-purpose chip that implements many of the link-layer services.
- Thus much of the link-layer controller’s functionality is implemented in hardware
- Until the late 1990s, most network adapters were physically separate cards (such as PCMCIA card or plug-in card fitting into a PC’s PCI card slot), but increasingly, network adapters are being integrated onto the host’s motherboard.
- On the sending side, the controller takes a datagram that has been created and stored in host memory by the higher layer of the protocol stack, encapsulates the datagram in a link-layer frame, and then transmits the frame into the communication link, following the link-access protocol.
- On the receiving side, a controller receives the entire frame, and extracts the network-layer datagram. If the link layer performs error detection, then it is the sending controller that sets the error-detection bits in the frame header and it is the receiving controller that performs error detection.
- INSERT IMAGE
- Shows that part of the link layer is implemented in software that runs on the host’s CPU. The software components of the link layer implement higher-level link-layer functionality such as assembling link-layer addressing information and activating the controller hardware.
- On the receiving side, link-layer software responds to controller interrupts, handling error conditions and passing a datagram up to the network layer.