ITS323 Data Link Control Data Link Control Flow Control Error Control Data Link Control Protocols Example Protocols ITS323: Introduction to Data Communications Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 5 August 2014 ITS323Y14S1L07, Steve/Courses/2014/s1/its323/lectures/datalink.tex, r3262
ITS323 Contents Data Link Control Data Link Control Flow Control Data Link Control Protocols Error Control Example Protocols Flow Control Error Control Example Data Link Layer Protocols
ITS323 Data Link Control Protocols Data Link Control ◮ Physical layer concentrates on sending signals over Data Link Control transmission link Flow Control ◮ More control and management is needed to send data Error Control over data communications link Example Protocols ◮ Frame synchronization: start and end of each frame ◮ Flow control: ensure sender does not send too fast for receiver ◮ Error control: correct bit errors introduced by transmission system ◮ Addressing: must specify identity of two stations communicating ◮ Control and data: receiver must distinguish between control and data information ◮ Link management: setup and maintain the link ◮ Hence, data link layer (and data link control protocols) ◮ We will focus on Flow Control and Error Control
ITS323 Contents Data Link Control Data Link Control Flow Control Data Link Control Protocols Error Control Example Protocols Flow Control Error Control Example Data Link Layer Protocols
ITS323 Flow Control Data Link Control Receivers typically have a finite amount of memory (buffer Data Link Control space) to store received data before processing Flow Control Error Control Packet from Packet to Example Protocols Network layer Network layer Memory (buffer) to store frames before transmitted Process frame and Tx Memory (buffer) to Data Link store frames for sent Layer to Network layer Process frame and Tx Physical Layer
ITS323 Flow Control Data Link Control Flow control aims to ensure sending entity does not Data Link Control overwhelm receiving entity Flow Control ◮ If sender sends too fast for receiver, then buffer may Error Control Example Protocols overflow ◮ Result of buffer overflow: data is lost, possibly need to retransmit, which reduces performance ◮ Flow control tries to prevent buffer overflow ◮ Assume no errors but varying delays ◮ Flow control is also used in transport layer, e.g. TCP
ITS323 Analysing and Illustrating Protocols Data Link Control Data Link Control Computer A Computer B Flow Control Data Error Control Example Protocols Application Application Transport Transport Network Network Data Link Data Link Physical Physical Processing and queuing at each layer Transmission by physical layer Propagation across link
ITS323 Analysing and Illustrating Protocols Data Link Control Data Link Control 1. Data arrives from 8. Data sent to Network layer Network layer Flow Control 2. Queue data 7. Queue data Error Control Data Link Data Link 3. Process data 6. Process data Example Protocols 4. Transmit frame 5. Frame propagates
ITS323 Analysing and Illustrating Protocols Data Link Control Data Link Control A B Data arrives from Flow Control Network layer Error Control Start transmitting Example Protocols First bit received time End transmitting Last bit received Data delivered to Network layer
ITS323 Analysing and Illustrating Protocols Data Link Control Data Link Control A B Flow Control Error Control Example Protocols Transmission time Propagation time
ITS323 Stop-and-Wait Flow Control Data Link Control Frame Types Data Link Control Flow Control ◮ DATA: contains information to be sent Error Control ◮ ACKnowledgement: acknowledges receipt of data Example Protocols Rules ◮ Source transmits a DATA frame ◮ Source waits for ACK frame before sending next DATA frame ◮ Destination receives DATA frame and replies with an ACK if ready for more data ◮ Destination can stop flow of data by not sending ACK
ITS323 Stop-and-Wait Flow Control Data Link Control Data Link Control A B Data1 arrives Flow Control Error Control DATA frame 1 Example Protocols wait for buffer space Data2 arrives Data1 delivered ACK frame 1 DATA frame 2 Data2 delivered ACK frame 2 Data3 arrives DATA frame 3
ITS323 Example of Stop-and-Wait Performance Data Link Control Source has 3 × 1000 Byte messages to be sent immediately. Data Link Control Destination takes 1 µ s to process each frame. DATA frame Flow Control contains 1000 Bytes data plus 20 Byte header. ACK frame is Error Control 20 Bytes. Link is 2km, 1Mb/s and velocity of 2 × 10 8 m/s. Example Protocols What is the throughput?
ITS323 Efficiency of Stop-and-Wait Flow Control Data Link Control ◮ Best-case efficiency, η , for stop-and-wait flow control: Data Link Control Flow Control Data η = Error Control Data + Hdr + Ack + 2 × Prop Example Protocols where: Data, Hdr, Ack are transmission times of original data in DATA frame, header in DATA frame and ACK frame respectively; Prop is link propagation time ◮ Efficient when data transmission time is much larger than propagation time ◮ Inefficient for links with very high data rate (e.g. optical), large distance (e.g. satellite) or small data frames
ITS323 What Size Frames To Use? Data Link Control ◮ Protocols often limit size of packets (frames), i.e. Data Link Control maximum number of bytes of data or payload Flow Control ◮ Large frames minimise header overheads Error Control ◮ Small frames: Example Protocols ◮ Allow more data to be sent when receive buffers are limited ◮ Introduce small overhead if a retransmission is required ◮ Allow fair sharing amongst multiple users ◮ Optimal packet size depends on overheads, and desired throughput and delay performance
ITS323 Sliding-Window Flow Control Data Link Control ◮ Stop-and-wait allows only 1 frame to be in transit at a Data Link Control time Flow Control ◮ Sliding-window flow control allows multiple frames to Error Control be in transit at a time Example Protocols Sequence Numbers ◮ Each frame header contains k -bit sequence number (wraps back to 0 after 2 k − 1) ◮ Keep track of frames sent and acknowledged
ITS323 Sliding-Window Flow Control Data Link Control The Sender Data Link Control Flow Control ◮ Sender is allowed to send up to W frames without Error Control receiving ACK Example Protocols ◮ Sender records: ◮ Last frame acknowledged ◮ Last frame transmitted ◮ Current window size
ITS323 Sliding-Window Flow Control Data Link Control The Receiver Data Link Control Flow Control ◮ Receiver has buffer space for W frames Error Control ◮ Receiver records: Example Protocols ◮ Last frame acknowledged ◮ Last frame received ◮ Current window size ◮ Receiver sends an ACK (or Receiver Ready, RR) frame ◮ ACK contains sequence number of next expected DATA frame
ITS323 Example of Sliding Window Protocol Data Link Control Data Link Control Flow Control Error Control Example Protocols
ITS323 Example of Sliding Window Protocol Data Link Control Source always has data ready to send; DATA frame contains Data Link Control 9000 bits payload, 1000 bits header; ACK frame is 1000 bits; Flow Control data rate 100kb/s; propagation 200ms. What is efficiency if Error Control using 2-bit sequence number? 3-bits? Example Protocols
ITS323 Additional Features of Sliding Window Data Link Control ◮ Receive Not Ready frame: acknowledges received Data Link Control frames but does not allow any more data Flow Control ◮ Piggybacking: DATA frame header contains sequence Error Control number of DATA and sequence number of ACK Example Protocols (acknowledgement number) ◮ If no DATA to send, normal ACK is transmitted ◮ If no new ACK, previous ACK number is repeated in DATA frame
ITS323 Contents Data Link Control Data Link Control Flow Control Data Link Control Protocols Error Control Example Protocols Flow Control Error Control Example Data Link Layer Protocols
ITS323 Error Control Data Link Control ◮ Need to detect and correct of errors such as: Data Link Control ◮ Lost frames: frame not received Flow Control ◮ Damaged frames: frame received with errors Error Control ◮ Common techniques used: Example Protocols ◮ Error detection and FEC (discussed in previous topic) ◮ Positive acknowledgment: destination returns a positive ACK after successfully receiving error-free frames ◮ Retransmission after timeout: source retransmits a frame that has not been ACKed after predetermined time ◮ Negative acknowledgement and retransmission: destination returns negative ACK for frames in which an error is detected ◮ Last 3 techniques are called automatic repeat request (ARQ). Three versions: ◮ Stop-and-wait ARQ ◮ Go-back-N ARQ ◮ Selective-reject ARQ
Recommend
More recommend