Structuring data into frames and managing the rate of transmission.
Framing is the primary function of the Data Link Layer. It involves breaking the bitstream from the Physical Layer into discrete units called frames. A frame is not just the raw data; it's an encapsulated unit with a header and a trailer added by the DLL. The header contains control information, such as the source and destination physical addresses (MAC addresses). The trailer often contains error detection information, like a CRC value. Well-defined frame boundaries are crucial so the receiver knows where a frame starts and ends. Techniques like character count or byte stuffing are used to ensure the receiver can correctly identify these boundaries. Once data is framed, its transmission needs to be managed. This is where flow control comes in. Flow control is a set of procedures that tells the sender how much data it can transmit before it must wait for an acknowledgment from the receiver. This is essential to prevent a fast sender from flooding a slower receiver with more data than it can process, which would lead to data loss. The simplest form of flow control is the Stop-and-Wait protocol, where the sender transmits one frame and then waits for an acknowledgment (ACK) before sending the next one. While simple and reliable, it's inefficient for long-distance links. More advanced protocols, like Sliding Window protocols (e.g., Go-Back-N, Selective Repeat), allow the sender to transmit multiple frames before needing an ACK, significantly improving efficiency by keeping the communication pipe full.