Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data link layer (LLC).

Similar presentations


Presentation on theme: "Data link layer (LLC)."— Presentation transcript:

1 Data link layer (LLC)

2 Data Link Layer Second layer in OSI reference model
Functions of Data link layer receives the data (Packets) from the network layer & divide it into manageable units called frames

3 Function (Contd..) Provides the addressing information by adding header to each frame. Physical addresses of source & destination machines are added to each frame.

4 Function (Contd..) Provide flow control mechanism
Provides error control mechanism Access Control When two or more devices are attached to the same link, data link layer protocols determine which device has control over the link at any given time. Providing a well- define service interface to the network layer

5 Sub-layer of Data link layer
Logical Link Control Sub-Layer (LLC) Established and control the logical links between local devices on a network Provides services to the network layer above it and hides the rest of the details of the data link layer to allow different technologies to work seamlessly with the higher layer Medium Access Control Sub-Layer (MAC) Refers to the procedure used by devices to control access to the network medium Example: Ethernet uses the CSMA/CD method of media access control, Token Ring uses token passing

6 Services Provided To Network Layer (LLC service)
The principal service provided by the data link layer to the network layer is the transmission of data from the source network layer to destination network layer. This can be accomplished in 3 ways using LLC which are explained below. Unacknowledged connectionless service Acknowledged connectionless service Connection oriented service

7 Unacknowledged connectionless service
In this type of service source machine sends frames to destination machine but the destination machine does not send any acknowledgement of these frames back to the source. Hence it is called unacknowledged service. There is no connection establishment between source and destination machine before data transfer or release after data transfer. Therefore it is known as connectionless service. There is no error control i.e. if any frame is lost due to noise on the line; no attempt is made to recover it. This type of service is used when error rate is low. It is suitable for real time traffic such as speech.

8 Acknowledged Connectionless Service
In this service, the source machine transmits data with-out establishing connection to the intendant recipient. When the sender sends the data frames to destination, destination machine sends back the acknowledgement of these frames. This type of service provides additional reliability because source machine retransmit the frames if it does not receive the acknowledgement of these frames within the specified time. This service is useful over unreliable channels, such as wireless systems.

9 Acknowledged Connection - Oriented Service
This service is the most sophisticated service provided by data link layer to network layer. It is connection-oriented. It means that connection is establishment between source & destination before any data is transferred. In this service, data transfer has three distinct phases:- Connection establishment Actual data transfer Connection release Here, each frame being transmitted from source to destination is given a specific number and is acknowledged by the destination machine. All the frames are received by destination in the same order in which they are send by the source.

10 Framing It divides the stream of bits received from the network layer into manageable data units called frames, known as framing. Framing in the data link layer separates a message from one source to a destination, or from other messages to other destinations, by adding a sender address and a destination address. The destination address defines where the packet is to go; the sender address helps the recipient acknowledge the receipt. Detecting Frame (variable size frame) boundaries by receiver can be achieved by using one of the following Method (How receiver recognizes start and end of frames?):- Character Count Method Flag byte with byte stuffing Starting and ending flags with bit stuffing Physical layer coding violation

11 Character Count Method
uses a field in 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 follow and hence where the end of the frame is. Problem There is a chance of count being garbled by a transmission error. If so, the destination will be out of synchronization and will be unable to locate the start of the next frame.

12 Character Count Method

13 Flag bytes with byte stuffing
In this method, same byte (Special byte), called a flag byte, is used as both starting and ending delimiter In this way, if the receiver ever loses synchronization, it can just search for the flag byte to find the end of the current frame. Two consecutive flag bytes indicate the end of one frame and start of the next one. Problem When binary data, such as object programs or floating-point numbers, are being transmitted, there may be a chance of occurring flag byte's bit pattern in the data. This situation will interfere with the framing. Solution This problem is solved by inserting a special escape byte (ESC) just before each ''accidental'' flag byte in the data at sender by data link layer which is then removed at receiver by data link layer before the data are given to the network layer. This technique is called byte stuffing or character stuffing. Thus, a framing flag byte can be distinguished from one in the data by the absence or presence of an escape byte before it.

14 Contd..

15 Contd.. What happens if an escape byte occurs in the middle of the data? The answer is that it is stuffed with an escape byte. Thus, any single escape byte is part of an escape sequence, where as a doubled one indicates that a single escape occurred naturally in the data.

16 Flag Bytes with bit stuffing
In this, Bit stuffing use reserved bit patterns to indicate the start and end of a frame.

17 Physical layer coding violation
This method of framing is only applicable to networks in which the encoding on the physical medium contains some redundancy. For example, some LANs encode 1 bit of data by using 2 physical bits. Normally, a 1 bit is a high-low pair and a 0 bit is a low-high pair. The scheme means that every data bit has a transition in the middle, making it easy for the receiver to locate the bit boundaries. The combinations high-high and low-low are not used for data but are used for delimiting frames.

18 Error In digital transmission systems, an error occurs when a bit is altered between transmission and reception; that is, a binary 1 is transmitted and a binary 0 is received, or a binary 0 is transmitted and a binary 1 is received. Two general types of errors can occur: Single bit error Burst errors

19 Single-bit errors If only one bit of a given data unit is changed from 1 to 0 or 0 to 1, such type error is called single-bit error. For example: is transmitted and is received as where only one bit is changed.

20 Burst errors If 2 or more bits in the given data unit have changed then such type error is called burst errors. For example: is transmitted and is received as where more than 1 bit is changed.

21 Flow Control Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Thus, flow control assures that a transmitting entity does not over-whelm a receiving entity with data. Protocols used for Flow control are: Stop and Wait Flow Control Sliding Window Flow Control

22 Stop and Wait Flow Control
Assumptions Data transmission in one direction only. Channel is error free In this Stop-and-Wait Protocol, the sender sends one frame, stops until it receives confirmation from the receiver (okay to go ahead), and then sends the next frame. Disadvantages At a time only one frame can be transmitted. No full utilization of the particular channel. Single message is send in different frames so there is the higher chances of error. If only one frame collides then again whole frame has to be retransmitted.

23 Sliding Window Flow Control
Unlike Stop and wait flow control, multiples frame can be transmitted at same time in sliding window flow control. Advantage Greater Efficiency can be achieved by transmitting multiple frames at a time. Disadvantage This system is very complex.

24 Contd..

25 Error Control Mechanisms to detect and correct errors that occur in the transmission of frames. Data / Information are sent as a sequence of frames; frames arrive in the same order in which they are sent and each transmitted frame suffers an arbitrary and potentially variable amount of delay before reception. In addition, there may be the possibility of two types of errors: Lost frame Damaged frame

26 Contd.. The most common techniques for error control are based on some or all of the following ingredients: Error detection Positive acknowledgment Retransmission after timeout Negative acknowledgment and retransmission Collectively, these mechanisms are all referred to as automatic repeat request (ARQ); the effect of ARQ is to turn an unreliable data link into a reliable one. Three versions of ARQ have been standardized: Stop-and-wait ARQ Go-back-N ARQ Selective-reject ARQ

27 Stop-and-wait ARQ Based on the stop-and-wait flow control technique.
The source station transmits a single frame and then must await an acknowledgment (ACK). No other data frames can be sent until the destination station’s reply arrives at the source station. Two sorts of errors may occur. First, the frame that arrives at the destination could be damaged. The second sort of error is a damaged acknowledgment. Advantage Simplicity Disadvantage Inefficient

28 Contd..

29 Go Back N ARQ In this method, a station may send a series of frames sequentially numbered modulo some maximum value ie. 2m, where m is the size of that sequence number field in bits. The number of unacknowledged frames outstanding is determined by window size, using the sliding-window flow control technique. While no errors occur, the destination will acknowledge incoming frames as usual (or piggybacked acknowledgment). If the destination station detects an error in a frame, it may send a negative acknowledgment for that frame. The destination station will discard that frame and all future incoming frames until the frame in error is correctly received. Thus, the source station, when it receives a REJ(reject ACK), must retransmit the frame in error plus all succeeding frames that were transmitted in the interim. Example: If the receiver detects error in frame f1 then the transmitter gets the rejection (rej 1) after the rejection the future incoming frames are not received by the receiver. The incoming frames discard by the receiver. Then the transmitter must retransmit the frame and also the all other subsequent frames.

30 Contd..

31 Selective Reject ARQ Go Back N, resending all frames slows down the transmission (so inefficient) In selective repeat ARQ, re-send only damaged frames. Sender window size and receiver window size is same Processing at receiver is more complex Advantage More efficient then go back N ARQ because it minimizes the amount of retransmission. Disadvantage Receiver must maintain large buffer size

32 Contd..


Download ppt "Data link layer (LLC)."

Similar presentations


Ads by Google