Computer networking OSI model has seven layers. Data link layer is the second of the seven layers. It is part of the TCP/IP reference model link layer (Bagad & Dhotre, 2009). It is a protocol layer that is involved in data transfer between network nodes, which are adjacent in a wide area network, or between nodes, which are found on the same segment of local area network (Lammle, 2007). It provides both procedural and functional means of data transfer between entities of the network (Leiden & Wilensky, 2009).

It can also be used to detect and correct errors which could occur in the physical layer. There are several examples of data link networks (Dean, 2009). They include the point to point protocol (PPP), local area network Ethernet, ADCCP and HDLC for point to point connections. The concern of data link layer is to deliver frames within LAN devices (Goralski, 2009). The frames cannot be able to cross local network boundaries. Higher layer functions such as global addressing and internetwork routing enable data link layer to focus on addressing, media arbitration and local delivery.

This makes data link layer to be analogue of neighborhood traffic cop which strives to arbitrate between different parties which contend to access the medium. Any attempt by frames to access a medium at the same time results in collision of frames (Dean, 2009). Data link layer enables devices to detect and recover or even prevent such collisions. Use of unambiguous hardware address affects frames delivery in data link layer devices. The header of a frame has source and address of the destination which shows the device where frame originated and the device which will receive and process the frame.

Data link layer sub layers There are two sub layers of data link layer. These are logical link control sub-layer and media access control sub layer (Lammle, 2007). The logical link control sub layer is the uppermost sub layer. It is involved in multiplexing protocols which run atop the data link layer. It also provides flow control, error notification and acknowledgement (Bagad & Dhotre, 2009). It is also involved in the specification of mechanisms for addressing stations and for controlling data exchange between the receiver and the sender. Media control sub layer is below the logical link control sub layer.

It is divided into distributed and centralized media access control (Goralski, 2009). It determines the boundaries of frames through time, byte stuffing, bit stuffing and character counting based frame synchronization. Functions of data link layer Data link layer is involved in the transformation of the physical layer. It also acts as a facility for raw transmission to a link, which is responsible for node-to-node communication (Bagad & Dhotre, 2009). The specific objectives of data link include addressing, framing, media access control, error control and flow control.

Framing involves division of the received stream of bits into frames, which are manageable data units (Leiden & Wilensky, 2009). Frames are messages or packets. Addressing involves addition of headers to the frames during definition of addresses (Dean, 2009). A flow control mechanism is imposed by the data link layer incase the rate of data absorption by the receiver is lower than the rate of data production in the sender (Goralski, 2009). Reliability is usually added to the physical layer by the data link layer through addition mechanism which detects and retransmits damaged, lost or duplicate frames.

Data link layer protocols are also involved in the determination of the device which is in control of the link at any specific time when one link is connected by two or more devices. Design issues Data link layer is involved in provision of several service semantics. These include reliable delivery, best effort and acknowledged delivery (Leiden & Wilensky, 2009). In data link layer, delivery of frames to the receiver is carried out reliably following the same order through which they are generated by the sender. Sending order and frames which require retransmission are tracked by connection state.

Acknowledgement to the sender is not returned by the receiver and therefore the successful delivery of the frame is not known by the sender (Bagad & Dhotre, 2009). This constitutes best effort. This is appropriate since higher layers are able to recover from errors and thus loss in performance is usually minimal. This ensures that errors are infrequent and thus very little is gained by the data link layer when it is performing the recovery. This also appropriate in real time applications which require “better never than late” semantics. This implies that no data is better than old data (Leiden & Wilensky, 2009).

Acknowledgement delivery involves the receiver returning an acknowledgement frame to the sender to indicate that a data frame has been properly received (Dean, 2009). This sits between the reliable delivery and best effort so that the connection effort is kept by the sender but unacknowledged frames may not necessarily be retransmitted (Goralski, 2009). Likewise the received packets may be handed to higher layers by the receiver in the same order in which they arrive and disregards the order of sending. Each frame has a unique sequence number assigned to it which is used to indicate the frame to which the acknowledgement refers to.

Unacknowledged frames are usually retransmitted by the sender (Lammle, 2007). Framing The raw bit streams of the physical layer are usually translated by the data link layer into discrete units referred to as frames (Lammle, 2007). The receiver detects the frame boundaries through length count, bit stuffing, character stuffing and encoding violation. Length count involves making the first field in the header of the frame to be the frame’s length. This enables the receiver to know the bigness of the current frame and helps it to determine the end of the next frame (Dean, 2009).

Using such a method to determine frame boundaries is disadvantageous in that synchronization of the receiver is lost when the bits become garbled (Bagad & Dhotre, 2009). Thus corruption of bits in the count during transmission will make the receiver to think that the frame has few bits than the actual number. In spite the fact that checksum is able to detect incorrect frames resynchronization to the start of a new frame by the receiver is usually difficult. Due to the shortcoming of this method, it is no longer being used (Goralski, 2009). In bit stuffing, reserved bit patterns are used to indicate the beginning and the end of a frame.

For example a four bit sequence such as 0111 may be used to delimit frames which follow one another. In this case, a frame lies between two delimiters (Dean, 2009). This presents problems when the delimiter is part of the frame and hence the receiver may think that these are two frames. Bit stuffing enables data link layer to overcome such problems. This involves replacement of every occurrence of two 1’s following one another within the frame with 110 (Bagad & Dhotre, 2009). That is; a zero bit is appended after a pair of 1’s in the data.

This ensures that over appearance of three consecutive 1s do not occur within frames. The receiver converts two 1s followed with a zero bit into two 1s but a sequence of 0111 is recognized as the frame end. This method is advantageous in that it is easy to locate the beginning and the end of a frame even if the frame is damaged (Goralski, 2009). This involves scanning of the arriving data by the receiver to detect the reserved patterns. In addition, resynchronization of the receiver with the sender is quicker to determine the beginning and the end of the frame even if there is garbling of bits in the frame.

This method has a disadvantage of wasting bandwidth due to insertion of additional bits (Lammle, 2007). Character stuffing uses bytes instead of bits used in bit stuffing. Reserved characters are used to indicate the beginning and the end of a frame (Goralski, 2009). For example, two-character sequence DLE STX (Data Link Escape Start of TeXt) could be used to signal the start of a frame and DLE ETX (Data Link Escape End of TeXt) could flag the end of a frame (Dean, 2009). If the two character sequence appears within a frame then character stuffing is used to replace the occurrence of DLE with DLE DLE.

The receiver replaces DLE DLE with a single DLE. Since character is the smallest unit which can be operated on and not all architectures are byte oriented, this method is disadvantageous. Encoding violations involves sending a signal which does not conform to any bit that is legal. For instance, the start and end of a frame in Manchester encoding could be represented by the low-low or high-high signal. This method is advantageous in that there is no bandwidth wasting. This is the method used in the IEEE 802. 4 standard (Bagad & Dhotre, 2009).

Some systems use a combination of these methods to indicate the beginning and the end of the frame. Error control This involves ensuring that all frames are delivered to a destination. It requires acknowledgements, timers and sequence numbers provide this surety. Acknowledgements with retransmission ensure reliable delivery (Dean, 2009). This involves special acknowledgement (ACK) frame returning by the receiver to the sender to indicate that it has received a frame. Negative acknowledgement (NACK) occurs in some systems to indicate incorrectly received frames.

This enables the sender to retransmit the damaged frame. Frames that do not send ACK are resend by retransmission timers (Lammle, 2007). Sequence numbers ensure that duplicate frames are not send during retransmission by assigning each frame a number to enable the receiver to distinguish old copies and new frames. Flow control This ensures that the speed of the sender is controlled to be in line with that of the receiver (Bagad & Dhotre, 2009). This is a dynamic process. Flow control involves extension of credits by the receiver to the sender so that only one frame is sent for each credit.

The rate of transmission is thus controlled by the receiver through handing out credits. Link management Prior to its use in some instances, the data link layer service needs to be opened (Lammle, 2007). For instance during allocation of buffer space and control of blocks open operations are needed. Error detection and correction Redundancy is required in detection and correction of errors. This involves sending data with additional information (Dean, 2009). Error detecting codes and error correcting codes are used to attack errors in data link layer.

Error detecting codes contains enough redundancy bits which detects errors and employs ACKs and retransmission to recover from errors. Error correcting codes contain enough redundancy for detection and correction of errors (Bagad & Dhotre, 2009). Hamming codes are used for single-bit error correction. Error correction is important in simplex links, long delay paths and links with high rates of errors. Error detection is expensive in terms of computation and bandwidth (Goralski, 2009). Polynomial codes or cyclic redundancy codes (CRCs) are the most popular detection codes for errors.

CRC Checksum is a popular error detection codes which are based on CRC or polynomial codes. It is used to detect single bit errors, two isolated single bit errors, odd number of bits and burst errors which are equal to or less than degree. Conclusion Data link layer is the second of the seven layers. It is part of the TCP/IP reference model link layer. It is a protocol layer that is involved in data transfer between network nodes which are adjacent in a wide area network or between nodes which are found on the same segment of local area network.

It provides both procedural and functional means of data transfer between entities of the network. It can also be used to detect and correct errors which could occur in the physical layer. Data link layer is involved in the transformation of the physical layer. It also acts as a facility for raw transmission to a link which is responsible for node to node communication. The specific objectives of data link include addressing, framing, media access control, error control and flow control. There are two sub layers of data link layer. These are logical link control sub layer and media access control sub layer.

The logical link control sub layer is involved in multiplexing protocols which run atop the data link layer. It also provides flow control, error notification and acknowledgement. It is also involved in the specification of mechanisms for addressing stations and for controlling data exchange between the receiver and the sender. Media control sub layer is divided into distributed and centralized media access control. It determines the boundaries of frames through time, byte stuffing, bit stuffing and character counting based frame synchronization.