Data Link Layer

Function of Data Link Layer

 

The data link layer has number of specific functions to carry out. this functions include providing a well define services interface to a network layer determining how the bit of the physical layer are grouped into frames dealing with transmission error regulating the flow of the frames so that the slow receiver do not lose data by fast sender and general link management

Data Link Layer Function
Service provided to the network layer:

The capability of the information connect layer is to offer types of assistance to Network layer,

the principle service is transferring data from network layer one source machines to network layer on the destination machine.

The job of data link layer is to transmit the bit to the destination machine so there can be handed over to the network layer.

Role of the data link layer:
In the network layer receive the data from the upper layer. 
The data link layer Adds a header which is called the frame header.
The data Where The Fame header was edit at the data link layer are passed to the physical layer at that time, the data are coated into bit strings 0’s and 1’s at the receiver site the opposite operation is perform. in other word the bit streams of 0’s and 1’s receive from the physical layer are converted into frames, and Frame headers are taken out and the data is passed through the network layer.

 

Framing

The usual approach is to is for data link layer to break the bit stream up into discrete frames and compute checksum for each frames. when a frame arrives at a destination the checksum is recomputed. if a newly computed checksum is different from the one contained in the frame, the data link layer knows that and error has occurred and take step to deal with it.

 

Breaking the bit stream up into frame is more difficult than it at first affairs.

We will look at 3 commonly used method:

  • Character count
  • Starting and ending character with character stuffing
  • Starting and ending with stuffing
 
Character count:

The first framing method use the field is the header to specify the number of characters in the frame.
When the data link layer at the destination sees the character count, it knows how many characters follows, and hence which the end of the frame.

 

Trouble with this algorithm is that the count can be grabled (uncleared) by a transmission error.

 

Data Link Layer Function

first bit represent the number of bit follows. 4 means  it has total 4 bit, After the end of 4 bit the next bit is again the header representing next bit. 

Starting and Ending Character with Character Stuffing:
 
Starting and ending character with character stuffing framing. The second framing method gets around the problem of resend synchronization after an error has occur by having each friends start with a CI character sequence dlstx and end with sequence dle is data link escape sDX start of text is end of text in this way if they if the destination ever loses that track of the frame boundary all it has to do is look for d l e s TX or DNA etx character for figure out where it is.
Data Link Layer Function
Starting and ending with stuffing

 

The third techniques allows the Frame to contain any number of bits and allows the character count with a arbitrary number of Bits per character.

It works like this each frame begins and end with specific bit Pattern 01111110, called the flag bit whenever the senders data link layer encounter five consecutive onc in the data it automatically stuff the zero(0) bit into the outgoing bit stream. 

this bit stuffing is analogous to character stuffing in which the DLE is stuff into the outgoing characteristics before DLE in the data.

In the receiver side the  consecutive 5 1 beat followed by zero bit it automatically this stuff the zero bit.it automatically destuffs (delete) the 0 bit.

Untitled Diagram 61

Flow control:

Another important design issue that occurs in data link layer is that what to do with the sender data that systematically wants to transmit it frames faster than the receiver can accept them. the situation can easily occurs when the sender is running on the faster computer and receiver is running on the slower machine.
The usual solution is to introduce flow control throttle (force) the sender into sending no faster than the receiver can handle that traffic.

Error detection:

In Data Link Layer the data error Detection is take placed the error detection is based on parity bit It can 

  1. Even Parity
  2. Odd Parity 

Error correction:

In data Link Layer the error correction is take place using:

  1. Hamming Code
  2. CRC

Data transfer system:


Unicast:


 data is transferred to a specific terminal by specify a single address in the network.


Multicast:

Data is transferred to all the terminal in the network group, the same data is sent by more terminals in the network.


Broadcast:

 data is transferred to all the terminals in the net worth data is sent to any number of terminals in the network vice president address which means the entire network.