|A node can be a router or computer or any other computing device. Data is packaged into frames for transport across the underlying physical network. A frame contains a frame header, Payload field which contains the actual packet and a frame trailer|
Sub layers Of Data Link Layer:
The Data Link layer being the most complex layer in the OSI model is often divided into two parts, the Media Access Control sublayer and the Logical Link Control sublayer.
Logical Link Control sublayer:
It specifies the mechanisms which should be used in order to address the stations over the transmission medium and for controlling the data exchanged between the sender and receiving machines.
Media Access Control sublayer:
The sublayer below the logical Link Control layer is Media Access Control (MAC). The most common functions of this sublayer is:
- To determine who is allowed to access the media
- To represent a frame structure with MAC addresses inside
- To determine the start and end of a frame.
Services Provided to the Network Layer :
1. Data Transfer :
The main service that the DLL provides to network layer is the transfer of data. It transmits the bits to the destination machine so that they can be handed over to the network layer on the destination machine.The figure below shows the case of virtual transmission path followed and the actual path but for simplicity we consider the case of virtual path followed
The data transfer service provided by the DLL may occur in three forms : a. Unacknowledged connectionless service. b. Acknowledged connectionless service. c. Acknowledged connection-oriented service.
1a. Unacknowledged connectionless service :
In this type of service,the sender sends data to the destination but the destination does not send an acknowledgment(in simple words confirmation of the received data) to the sender. In this case, if a frame is lost,energy is not wasted to recover it.This service is helpful in those fields where error rate is very low. This method of communication in DLL is widely used in LANS.
1b. Acknowledged connectionless service :
In this type of service,the sender sends data to the destination but this time, destination sends an acknowledgment for each frame to the sender.The similarity between Unacknowledged and acknowledged are similar in one field, that is no logical connection is established neither destroyed before and after the data transfer.This service is useful over unreliable networks like wireless networks because in this case if a frame does not reach the destination during a particular time interval,then it is resent.
1c. Acknowledged connection-oriented service :
As the name indicates,in connection oriented service, data transfers takes place in three different phases. In the first phase, the connection is established between the sender and receiver. In this phase both sides initialize some variables and counters that are used for recognition of the frames. In the second phase, one or more frames are actually transmitted. In the third ( final) phase, the connection is released. By releasing the connection, the variables, buffers, and other resources used to maintain the connection are also released.
2. Framing :
As discussed above that DLL breaks the packets into frames of data. To deal with each frame separately, in order to detect errors if any,this process of framing requires recognition of frames.The frames can be recognized by recognizing the start and end. Four main methods to recognize the boundaries of the frame are: a. Character count. b. Flag bytes with byte stuffing. c. Starting and ending flags, with bit stuffing. d. Physical layer coding violations.
2a. Character Count :
This method uses a field in the header that specifies the number of characters in the frame. The data link layer at the destination uses the value of the header to know where the frame starts and where it ends. For example,if the value in the header is 5, it takes the next 5 characters and after that if the header value is 8, then it takes the next 8 values and so on. The main problem with this method is that if any sort of transmission error occurs and the value in the header changes,then there is no way to recover,as no information is available about the start and end of frame. Because of this reason, this method is very rare.
2b. Flag bytes with byte stuffing :
In this method, start and end of frames are recognized with the help of flag bytes.Each frames starts with and ends with a flag byte.. Two consecutive flag bytes indicate the end of one frame and start of the next one. The flag bytes used in the figure/example used is named as "ESC" flag byte.
This framing method is only applicable in 8-bit character codes which is a major disadvantage of this method as not all character codes use 8-bit characters e.g Unicode.
2c. Starting and ending flags, with bit stuffing :
In this method, frames contain an arbitrary number of bits and allows character codes with an arbitrary number of bits per character. In his case, each frame starts and ends with a special bit pattern, 01111110. In the data a 0 bit is automatically stuffed into the outgoing bit stream Whenever the sender's data link layer finds five consecutive 1s. This bit stuffing is similar to byte stuffing, in which an escape byte is stuffed into the outgoing character stream before a flag byte in the data. When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it automatically destuffs (i.e., deletes) the 0 bit. Bit Stuffing is completely transparent to network layer as byte stuffing. The figure below gives an example of bit stuffing.
2d. Physical layer coding violations :
This method of framing finds its application in networks in which the change of data into code on the physical medium contains some repeated or duplicate data. For example, some LANs encode 1 bit of data by using 2 physical bits.
3. ERROR CONTROL :
The third and also very important service provided by the DLL to Network Layer is to control the errors in transmission i.e to provide reliable data transmission.It can be provided if a connection receives an acknowledgment for what it has sent. But sometimes due to hardware problems,the frame or the acknowledgment may get lost in the path. These time of problems are solved by introducing a timer which has an interval value equal to the interval of reaching of frame to the destination ,processed there plus the time taken by receiver to send an acknowledgment and the time it takes to reach the sender again.This interval is quite long enough to take all these processes get done. If a frame does not reach the destination in time specified by the timer,then that frame is retransmitted.But another problem is that Network layer may receive a frame multiple times. in order to avoid this, a sequence number is attached to all outgoing frames. With this technique,the receiver would be able to distinguish between the retransmitted and the original frame.
4. FLOW CONTROL :
Sometimes, a situation occurs when the sender systematically sends data at a speed higher than the receiving rate of receiver.This usually happens when a sender uses a fast computer and the receiver has a slow or heavy loaded system. To control the flow of data due to occurrence of this problem, two approaches are used.
- Feedback-based Flow control
- Rate-based Flow control
4a. Feedback-based Flow control :
In this case,the sender sends data according to the orders of receiver. The receiver asks the sender to send data or only tells him the current situation at the end of the receiver.
4b. Rate-based Flow control :
In this case, no feedback of the receiver is required because its protocol has a built in mechanism that does not allow the sender to send data at a very fast rate.it limits the sending rate of the sender.
|← Router - Definition, Router Mode or Sub Systems||Channel Allocation - Dynamic & Static Channel Allocation →|