A frame is a unit of communication in the data link layer. Data link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame size becomes too large, then the packet may be divided into small sized frames. At receiver’ end, data link layer picks up signals from hardware and assembles them into frames.
A data link layer frame has the following parts:
Frame Header: It contains the source and the destination addresses of the frame and the control bytes.
Payload field: It contains the message to be delivered.
Trailer: It contains the error detection and error correction bits. It is also called a Frame Check Sequence (FCS).
Flag: Two flag at the two ends mark the beginning and the end of the frame.
A frame header contains the destination address, the source address and three control fields kind, seq, and ack serving the following purposes:
kind: This field states whether the frame is a data frame or it is used for control functions like error and flow control or link management etc.
seq: This contains the sequence number of the frame for rearrangement of out – of – sequence frames and sending acknowledgments by the receiver.
ack: This contains the acknowledgment number of some frame, particularly when piggybacking is used.
The structure of the data link layer frame may be specialized according to the type of protocol used. Let us study the frame structure used in two protocols: Point – to – Point Protocol (PPP) and High-level Data Link Control (HDLC).
Point – to – Point Protocol (PPP) is a communication protocol of the data link layer that is used to transmit multiprotocol data between two directly connected (point-to-point) computers. The fields of a PPP frame are:
Flag: It is of 1 byte that with bit pattern 01111110.
Address: 1 byte which is set to 11111111 in case of the broadcast.
Control: 1 byte set to a constant value of 11000000.
Protocol: 1 or 2 bytes that define the type of data contained in the payload field.
Payload: This carries the data from the network layer. The maximum length of the payload field is 1500 bytes.
FCS: It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code used is CRC (cyclic redundancy code).
High-level Data Link Control (HDLC) is a group of communication protocols of the data link layer for transmitting data between network points or nodes. The fields of an HDLC frame are:
Flag: It is an 8-bit sequence with bit pattern 01111110.
Address: It contains the address of the receiver. The address field may be from 1 byte to several bytes.
Control: It is 1 or 2 bytes containing flow and error control information.
Payload: This carries the data from the network layer. Its length may vary from one network to another.
FCS: It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code used is CRC (cyclic redundancy code)