200 likes | 463 Views
The Data Link Layer. Chapter 3. Data Link Layer Design Issues. Services Provided to the Network Layer Framing Error Control Flow Control. Functions of the Data Link Layer. Provide service interface to the network layer Dealing with transmission errors Regulating data flow.
E N D
The Data Link Layer Chapter 3
Data Link Layer Design Issues • Services Provided to the Network Layer • Framing • Error Control • Flow Control
Functions of the Data Link Layer • Provide service interface to the network layer • Dealing with transmission errors • Regulating data flow
Services Provided to Network Layer (a) Virtual communication. (b) Actual communication. Three Types of Communication Unacknowledged connection less service acknowledged connection less service acknowledged connection Oriented service
Design Issues / Functions of DL Layer • Service Provide To Network layer : • Transfer data from one network layer to another network layer. • Frame Synchronization : • the beginning and End of the frame should be recognized. • Flow Control : • The sender should not send frames faster then the speed of receiver. • Error Control : • Error during transmission in bits must be corrected. • Addressing : • On multipoint link the identity of sender and receiver must be specified.
Design Issues / Functions of DL Layer • Control and data on same link : • The receiver must be able to distinguish control information from the data being transmitted. • Link management : • Procedures for the management of initiation , maintenance and termination of the link between sender and receiver.
Framing • Large block of data may be broken up into small frames at the source because: • limited buffer size at the receiver • A larger block of data has higher probability of error • With smaller frames, errors are detected sooner, and only a smaller amount of data needs to be retransmitted • On a shared medium, such as Ethernet and Wireless LAN, small frame size can prevent one station from occupying medium for long periods
Questions ???? • Design Issues for DLL ? • What is flow control ? • What is addressing ? • What is link management ? • What is control and data on same link ? • Three types of services provided by DLL • What is framing ? • What is time based framing ? • Why time based framing is not successful ? • What is char count method for framing ?
Character Count Method A character stream. (a) Without errors. (b) With one error.
Byte Stuffing • Also referred to as character stuffing. • ASCII characters are used as framing delimiters (e.g. DLE STX and DLE ETX) DLE STX Transparent Data DLE ETX
Byte Stuffing • The problem occurs when these character patterns occur within the “transparent” data. • Solution: sender stuffs an extra DLE into the data stream just before each occurrence of an “accidental” DLE in the data stream. • The data link layer on the receiving end unstuffs the DLE before giving the data to the network layer. DLE STX A B DLE H W DLE ETX DLE STX A B DLE DLE H W DLE ETX
Bit Stuffing • Each frame begins and ends with a special bit pattern called a flag byte [01111110]. • Whenever sender data link layer encounters five consecutive ones in the data stream, it automatically stuffs a 0 bit into the outgoing stream. • When the receiver sees five consecutive incoming ones followed by a 0 bit, it automatically destuffs the 0 bit before sending the data to the network layer.
Bit Stuffing Input Stream 0110111111100111110111111111100000 Stuffed Stream 01101111101100111110011111011111000000 Stuffed bits Unstuffed Stream 0110111111100111110111111111100000
Error Control • When Sender Sends frames to receiver he will reply either positive or negative . • But the receiver will give reply only if It gets the frames • If because of noise frame lost then ??? • So the concept of time was introduce it will manage • Time required to reach to destination • Time required to process it • Time required to reply • If acknowledgement is not received in the time the sender will re transmit frame .
Error Detection: Types of Error • An error occurs when a bit is altered between transmission and reception • Single bit errors • One bit is altered • Adjacent bits are not affected • Burst errors • A cluster of bits with Length B • the first and the last and a number of intermediate bits in error (not necessarily all the bits in the cluster suffer an error) • More common and more difficult to deal with
Flow Control • Handles mismatch between sender’s and receiver’s speed. • Receiver’s buffer limitation. • Feedback-based flow control. • Explicit permission from receiver. • Rate-based flow control. • Implicit mechanism for limiting sending rate. • DLL typically uses feedback-based flow control.
Important Definitions • Code Words : • It is the n bits encoded block that contains message bits and also parity bits • Code Rate : • It is the ratio of the no of Message bits to total no of bits. • Code rate R = k/n • Hammingweight [W(x)] : • X is defined as the no of non zero elements in codeword. • Hamming Distance : • The no of location in which their respective element differs • 1 1 0 1 0 1 0 0 Codeword 1 • 0 1 0 1 1 1 1 0 Codeword 2
Example • Hamming weight for X = 1 1 1 0 0 0 1 1 • Ans is = 5 • Hamming Distance For • 1 1 1 1 0 0 1 0 • 1 1 0 0 1 0 1 1 • Ans is : 4
Error Detection • When data is transmitted there is a chance of error in bits. • We can get error bits by comparing the codeword • There are several methods for error detection • Parity check • Checksum Error Detection • Cyclic Redundancy Check
Parity Check • Append a parity bit to the end of a block of data • Value of parity bit is such that the new data has even (even parity) or odd (odd parity) number of ones • E.g., original data 1110001 -> 11100011 (odd parity) • Even number of bit errors goes undetected • E.g., 11100011 -> 11010011 (undetected!)