Data Link Layer_Data Communications&Computer Neworks.pptx

AllankiSanyasiRao 45 views 31 slides Aug 05, 2024
Slide 1
Slide 1 of 31
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31

About This Presentation

Data Link Layer Presentation


Slide Content

FRAMING

Byte Stuffing Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the text.

Bit Stuffing In bit stuffing, extra bits are being added by network protocol designers to data streams. It is generally insertion or addition of extra bits into transmission unit or message to be transmitted as simple way to provide and give signaling information and data to receiver It is type of protocol management simply performed to break up bit pattern that results in transmission to go out of synchronization.

Each frame begins and ends with a special bit pattern called flag byte [01111110]. Whenever the sender data link layer encounters five consecutive ones in the data stream, it automatically stuffs a 0 bit in to 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.

Physical Layer Coding Violations Encoding violation is method that is used only for network in which encoding on physical medium includes some sort of redundancy Encoding of bits as signals includes redundancy. Some bit patterns will never occur as regular data. Ex. 4B/5B: 4 data bits (16 combinations) mapped to 5 data bits (32 combinations). Here we are representing 16 combinations, so 32-16=16 i.e., there are 16 five bit patterns which are never used as data and they are redundant. So this means that these redundant bit patterns can be used for other purposes. Advantage: Easy to distinguish from actual data i.e., easy to find start and end of each frame. This technique is the only one that does not require any kind of bit or byte stuffing.

FLOW AND ERROR CONTROL

The most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data link control. Error Control The error frames are dropped by the receiver and acknowledgement are not sent. Error control in the data link layer is based on automatic repeat request, which is the retransmission of data. The Acknowledgment (ACK) used for reliable delivery. If frame or ACK is lost, no ACK is sent to sender. In this case Sender uses timer to react with average round trip time (RTT) to retransmit the frame. If ACK is lost, receiver receives multiple copies of same frame. To identify multiple copies and remove the duplicated copies of the frame, sequence number is used in the frames.

Flow Control This refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. In data link layer, flow control restricts the number of frames the sender can send before it waits for an acknowledgment from the receiver. Two approaches are commonly used . Feedback based Flow Control - the sender sends frames after it has received acknowledgments from the user. This is used in the data link layer . Rate based Flow Control - These protocols have built in mechanisms to restrict the rate of transmission of data without requiring acknowledgment from the receiver. Used in the network layer and the transport layer.

PROTOCOLS

Data link layer can combine framing, flow control, and error control to achieve the delivery of data from one node to another.

NOISELESS CHANNELS A n ideal channel in which no frames are lost, duplicated, or corrupted. We introduce two protocols for this type of channel. Traditionally four protocols have been defined for the data-link layer to deal with flow and error control: Simple, Stop-and-Wait, Go-Back-N, and Selective Repeat. Although the first two protocols still are used at the data-link layer, the last two have disappeared.

Simple Protocol This is a simple protocol with neither flow nor error control. The data-link layer at the sender gets a packet from its network layer, makes a frame out of it, and sends the frame. The data-link layer at the receiver receives a frame from the link, extracts the packet from the frame, and delivers the packet to its network layer. The data-link layers of the sender and receiver provide transmission services for their network layers.

Stop-and-Wait Protocol It is still very simple. The sender sends one frame and waits for feedback from the receiver. When the ACK arrives, the sender sends the next frame. Note that sending two frames in the protocol involves the sender in four events and the receiver in two events.

1. Problems due to lost data Sender waits for ACK for an infinite amount time Receiver waits for data for an infinite amount of time 2 . Problems due to lost ACK Sender waits for an infinite amount of time for ACK 3 . Problems due to delayed ACK/data After timeout on sender side, a delayed ACK might be wrongly considered as ACK of some other frame. Sender side Rule 1: Send one frame at a time. Rule 2: Send the next frame only after receiving ACK for the previous Receiver side Rule 1: Receive and consume frame Rule 2: After consuming frame, ACK need to be sent (Flow Control)

NOISY CHANNELS Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent. Stop-and-Wait Automatic Repeat Request Idea of stop-and-wait ARQ is straightforward. After transmitting one frame, the sender waits for and acknowledgement before transmitting the next frame. But there are chances for the frame to be lost or ACK to be lost. If the ACK does not arrive after certain period of time, the sender times out and retransmits the original frame. This retransmission is automatic and that is why we call this as automatic repeat request protocol.

Stop-and-wait ARQ = Stop-and-wait + Timeout Timer + Sequence number

Error correction in Stop-and-Wait ARQ is done by keeping a copy of the sent frame and retransmitting of the frame when the timer expires. Drawbacks One frame at a time Poor utilization of bandwidth Poor performance

Assume that, in a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link? The bandwidth-delay product is: 1Mbps x 20ms = 20,000 bits The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and then back again. However, the system sends only 1000 bits. We can say that the link utilization is only 1000/20,000, or 5 percent. For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-Wait ARQ wastes the capacity of the link.

Sliding Window Protocol Send multiple frames at a time. Number of frames to be sent is based on Window size. Each frame is numbered i.e., sequence number

Assignment of sequence numbers to frames is between the range 0 to 2n-1 if the frames’ sequence number is an n-bit field. As a result, the sending window has a size of 2n-1. Modulo-n is used to number the sequence numbers. If the sending window size is set as 3, the sequence numbers will be 0, 1, 2, 0, 1, 2, 0, 1, 2 and so on.
Tags