INTERNET ARCHITECTURE & PROTOCOLS Set # 02 Delivered By: Engr Tahir Niazi
Need for Data Link Layer possibility of transmission errors receiver need to regulate the rate at which data arrive that's why synchronization interfacing techniques are insufficient by themselves. It is necessary to impose a layer of control in each communicating device known as Data Link Control Protocol.
Data Link services Data Link Layer Services are as follows: frame synchronization flow control error control addressing control and data link management
Data Link Layer The most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data link 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. Error control refers to error detection and retransmission. Error control in the data link layer is based on automatic repeat request (ARQ).
Flow Control Enables receiver to regulate the flow of data from a sender by preventing buffer overflow data is in form of frames and some control information transmission time time taken to emit all bits into medium propagation time time for a bit to traverse the link assume here no errors but varying delays
Model of Frame Transmission
Flow and Error control There are three mechanisms Stop-and-Wait ARQ Go-Back-N ARQ Selective Reject ARQ
Stop and Wait ARQ source transmits single frame wait for ACK if received frame damaged, discard it transmitter has timeout if no ACK within timeout, retransmit if ACK damaged, transmitter will not recognize it transmitter will retransmit receive gets two copies of frame use alternate numbering and ACK0 / ACK1
Stop-and-Wait Operations Normal operation The frame is lost The ACK is lost The ACK is delayed
Stop-and-Wait ARQ
Stop-and-Wait ARQ
Stop-and-Wait ARQ
Stop-and-Wait ARQ
Duplex Stop-and-Wait ARQ
Stop-and-Wait ARQ Inefficient use of bandwidth. After sending each frame,sender must wait for the ACK. It works well for few large frames. large block of data is split into small frames. On a shared medium, such as a LAN, medium cannot be occupied by one station for longer time, causing long delays for other stations.
Sliding Windows Flow control allows multiple numbered frames to be in transit receiver has buffer W long transmitter sends up to W frames without ACK ACK includes number of next frame expected sequence number is bounded by size of field (k) frames are numbered modulo 2 k giving max window size of up to 2 k 1 (why?) receiver can ack frames without permitting further transmission (Receive Not Ready) must send a normal acknowledge to resume if have full-duplex link, can piggyback ACKs
Sliding Window Diagram 3-bit seq. #, Win size = 7
Sliding Windows example
Go-Back- N ARQ based on sliding window if no error, ACK as usual use window to control number of outstanding frames if error, reply with rejection(rej) discard that frame and all future frames until error frame received correctly transmitter must go back and retransmit that frame and all subsequent frames
Go Back N - Handling Damaged Frame error in frame i so receiver rejects frame i transmitter retransmits frames from i Lost Frame frame i lost and either transmitter sends i+1 and receiver gets frame i+1 out of seq and sends REJ i or transmitter times out and send ACK with P bit set which receiver responds to with ACK i transmitter then retransmits frames from i
Go Back N - Handling Damaged Acknowledgement receiver gets frame i, sends ack (i+1) which is lost acks are cumulative, so next ack (i+n) may arrive before transmitter times out on frame i if transmitter times out, it sends ack with P bit set can be repeated a number of times before a reset procedure is initiated Damaged Rejection reject for damaged frame is lost handled as for lost frame when transmitter times out
Go-Back- N ARQ:
Go-Back-N ARQ
Go Back N
Go-Back-N ARQ
Go-Back-N ARQ Inefficient all out of order frames are discarded. Many frames are needed to retransmit,hence inefficiently uses the bandwidth. Solution Retransmit only damaged frames. Selective-Reject ARQ is the solution.
Selective Reject also called selective retransmission only rejected frames are retransmitted subsequent frames are accepted by the receiver and buffered receiver must maintain large enough buffer to save post- SREJ frames until frames retransmitted. Receiver need to put that frame in right order hence less widely used useful for satellite links with long propagation delays
Select Reject:
High Level Data Link Control (HDLC) an important data link control protocol Supports both half-duplex and full-duplex over point-topoint and multipoint links. Implements ARQ mechanisms Topics discussed in this section: Configuration Transfer modes Frames HDLC operation
HDLC Station types: Primary - controls operation of link. Frames issued are called commands. Secondary - under control of primary station. Frames issued are called responses. Combined - issues commands and responses. It defines 2 link configurations. link configurations Unbalanced - 1 primary, multiple secondary Balanced - 2 combined stations
Primary & secondary Stations
Combined Station
HDLC Data Transfer:
HDLC Transfer Modes Normal Response Mode (NRM) unbalanced config, primary initiates transfer Secondary only transmit in response to command by primary. used on multi-drop lines, in which a number of terminals are connected to a host computer. Asynchronous Balanced Mode (ABM) balanced config, either station initiates transmission. Most widely used of the three modes. Efficient use of full-duplex point-to-point link.
HDLC Transfer(cont.) Asynchronous Response Mode (ARM) unbalanced config, secondary may initiate transmit without permission from primary. Primary still responsible for initialization, error recovery and logical disconnection. ARM is rarely used; it is applicable to some special situations in which a secondary may need to initiate transmission.
HDLC Frame Structure
Types of HDLC Frames I-frames (Information-frames) carry user data from the network layer U-frame (Unnumbered Frames) U-frames are used to exchange session management and control information between connected devices. S-frame (Supervisory frames) S-frames are used for flow and error control.
HDLC Frames
Flag Fields delimit frame at both ends with 01111110 seq receiver hunts for flag sequence to synchronize Start and end of the frame Address Field: identifies station that sent or will receive frame Not needed for point-to-point link but added for uniformity
Control Field different for different frame type Information - data transmitted to user (next layer up) Flow and error control piggybacked on information frames Supervisory - ARQ when piggyback not used Unnumbered - supplementary link control
Information & FCS Fields Information Field The information field is present only in I-frames and some U-frames. User data for I frame Management information for U frame Frame Check Sequence Field (FCS) used for error detection either 16 bit CRC or 32 bit CRC
HDLC Operation exchange of 3 types of frames between 2 stations Operation consists of three phases Initialization either side initialize the data link and need to agree on three modes(nrm,abm,arm) Data transfer with flow and error control using both I & S-frames (RR, RNR, REJ, SREJ) Disconnection when requested or fault noted
Connection & disconnection
HDLC Operation Figure shows how U-frames can be used for connection establishment and connection release. Node A asks for a connection with a set asynchronous balanced mode (SABM) frame; node B gives a positive response with an unnumbered acknowledgment (UA) frame. After these two exchanges, data can be transferred between the two nodes (not shown in the figure). After data transfer, node A sends a DISC (disconnect) frame to release the connection; it is confirmed by node B responding with a UA (unnumbered acknowledgment).
Q & A IAP, University of Sargodha, CS & IT Dept