Data Link Control Protocolsjain/cse473-05/ftp/i_7dlc.pdf · 7-1 Washington University in St. Louis...
Transcript of Data Link Control Protocolsjain/cse473-05/ftp/i_7dlc.pdf · 7-1 Washington University in St. Louis...
7-1©2005 Raj JainCSE473sWashington University in St. Louis
Data Link Control Data Link Control ProtocolsProtocols
Raj Jain Washington UniversitySaint Louis, MO 63131
These slides are available on-line at:http://www.cse.wustl.edu/~jain/cse473-05/
7-2©2005 Raj JainCSE473sWashington University in St. Louis
OverviewOverview
q Flow Control
q Effect of propagation delay, speed, frame size
q Error Recovery
q HDLC
7-3©2005 Raj JainCSE473sWashington University in St. Louis
Flow ControlFlow Control
q Flow Control Goals: 1. Sender does not flood the receiver, 2. Maximize throughput
q Sender throttled until receiver grants permission
7-4©2005 Raj JainCSE473sWashington University in St. Louis
SpaceSpace--Time DiagramsTime Diagrams
Space
Time
7-5©2005 Raj JainCSE473sWashington University in St. Louis
Stop and Wait Flow ControlStop and Wait Flow Control
Data
Ack
Ack
Data
tframe
tprop =1
2α + 1
U=2tprop+tframe
tframe
α =tprop
tframe
=Distance/Speed of SignalBits Transmitted /Bit rate
=Distance × Bit rateBits Transmitted × Speed of Signal
Light in vacuum= 300 m/μsLight in fiber = 200 m/μsElectricity = 250 m/μs
7-6©2005 Raj JainCSE473sWashington University in St. Louis
Utilization: ExamplesUtilization: Examplesq Satellite Link: Propagation Delay tprop = 270 ms
Frame Size = 500 Bytes = 4 kbData rate = 56 kbps ⇒ tframe = 4/56 = 71 msα = tprop/tframe = 270/71 = 3.8U = 1/(2α+1) = 0.12
q Short Link: 1 km = 5 μs, Rate=10 Mbps, Frame=500 bytes ⇒ tframe= 4k/10M= 400 μsα=tprop/tframe=5/400=0.012 ⇒ U=1/(2α+1)=0.98
Note: The textbook uses B for tprop and L for tframe
7-7©2005 Raj JainCSE473sWashington University in St. Louis
Efficiency PrincipleEfficiency Principle
q For all protocols, the maximum utilization (efficiency) is a non-increasing function of α.
α
MaxUtilization
Not Possible
Protocol 1Protocol 2
Best possible
α =tprop
tframe
=Distance × Bit rateBits Transmitted ×Speed of Signal
7-8©2005 Raj JainCSE473sWashington University in St. Louis
Sliding Window ProtocolsSliding Window Protocols
q Window = Set of sequence numbers to send/receiveq Sender window
q Sender window increases when ack receivedq Packets in sender window must be buffered at
source
7-9©2005 Raj JainCSE473sWashington University in St. Louis
Sliding Window DiagramSliding Window Diagram
7-10©2005 Raj JainCSE473sWashington University in St. Louis
Sliding Window Example Sliding Window Example
7-11©2005 Raj JainCSE473sWashington University in St. Louis
Sliding Window Protocol EfficiencySliding Window Protocol Efficiency
Data
Ack
tframe
tprop
U=W tframe
2tprop+tframe
=
W2α+1
1 if W>2α+1
7-12©2005 Raj JainCSE473sWashington University in St. Louis
Effect of Window SizeEffect of Window Size
α
U
q Larger window is better for larger α
7-13©2005 Raj JainCSE473sWashington University in St. Louis
PiggybackingPiggybacking
Data
Data+Ack
tframe
tprop
Header Ack DataHeader Data
7-14©2005 Raj JainCSE473sWashington University in St. Louis
Error ControlError Controlq Error Control = Deliver frames without error, in the proper
order to network layerq Error control Mechanisms:
q Ack/Nack: Provide sender some feedback about other endq Time-out: for the case when entire packet or ack is lostq Sequence numbers: to distinguish retransmissions from
originals
Timeout
7-15©2005 Raj JainCSE473sWashington University in St. Louis
StopStop--andand--Wait ARQWait ARQ
AutomaticRepeatreQuest(ARQ)
7-16©2005 Raj JainCSE473sWashington University in St. Louis
GoGo--BackBack--N ARQN ARQ
q Receiver does not cache out-of-order framesq Sender has to go back and retransmit all frames after
the lost frame
RcvrSender
1
Nack 11
01
2
2
3
3
7-17©2005 Raj JainCSE473sWashington University in St. Louis
GoGo--backback--N (Cont)N (Cont)All possible scenarios are handled:1. Damaged Frame:
q Frame received with errorq Frame lostq Last frame lost
2. Damaged Ack:q One ack lost, next one makes itq All acks lost
3. Damaged Nack:q Maximum Window = 2n -1
with n-bit sequence numbers
7-18©2005 Raj JainCSE473sWashington University in St. Louis
Selective Reject ARQSelective Reject ARQ
q Receiver caches out-of-order framesq Sender retransmits only the lost frame
RcvrSender
1
Nack 11
01
2
4
3
5
7-19©2005 Raj JainCSE473sWashington University in St. Louis
Selective Reject: Window SizeSelective Reject: Window Size
01234567
0Ack
Sequence number space > 2 window sizeWindow size < 2n-1
Timeout
7-20©2005 Raj JainCSE473sWashington University in St. Louis
Performance: Maximum UtilizationPerformance: Maximum Utilizationq Stop and Wait Flow Control: U = 1/(1+2α)q Window Flow Control:
q Stop and Wait ARQ: U = (1-P)/(1+2α)q Go-back-N ARQ:
q Selective Reject ARQ:
U = 1 W> 2α+1
W/(2α+1) W< 2α+1{
U = (1-P)/(1+2αP) W> 2α+1
W(1-P)/[(2α+1)(1-P+wP)] W< 2α+1{U =
(1-P) W> 2α+1
W(1-P)/(2α+1) W< 2α+1{
7-21©2005 Raj JainCSE473sWashington University in St. Louis
Performance ComparisonPerformance Comparison1.0
0.8
0.6
0.4
0.2
0.00.1 1 10 100 1000
α
Util
izat
ion
Stop-and-wait
W= 127 Go-back-N
W=7 Go-back-N & W= 7 Selective-reject
W= 127 Selective-reject
More bps or longer distance
7-22©2005 Raj JainCSE473sWashington University in St. Louis
HDLC FamilyHDLC Familyq Synchronous Data Link Control (SDLC): IBMq High-Level Data Link Control (HDLC): ISOq Link Access Procedure-Balanced (LAPB): X.25q Link Access Procedure for the D channel (LAPD): ISDNq Link Access Procedure for modems (LAPM): V.42q Link Access Procedure for half-duplex links (LAPX): Teletexq Point-to-Point Protocol (PPP): Internetq Logical Link Control (LLC): IEEEq Advanced Data Communications Control Procedures (ADCCP): ANSIq V.120 and Frame relay also use HDLC
7-23©2005 Raj JainCSE473sWashington University in St. Louis
q Primary station: Issue commandsq Secondary Station:Issue responsesq Combined Station: Both primary and secondaryq Unbalanced Configuration: One or more secondaryq Balanced Configuration: Two combined stationq Normal Response Mode (NRM): Response from secondaryq Asynchronous Balanced Mode (ABM): Combined Stationq Asynchronous Response Mode (ARM): Secondary may respond before
command
HDLCHDLC
7-24©2005 Raj JainCSE473sWashington University in St. Louis
HDLC Frame StructureHDLC Frame StructureFrameFormat
Control Field Format
Extended Address Field
Extended Control Field......
0 N(S) P/F N(R)1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8
1 0 S 0 0 0 0 P/F N(R)InformationSupervisory
N(S)= Send sequence number N(R)= Receive sequence number S= Supervisory function bits M= Unnumbered bits P/F= Poll/final bit
I: InformationS: SupervisoryU: Unnumbered
8 8 8n 16 or 32 8Address Control INFORMATION FCS FLAG
Extendable Extendable
0 N(S) P/F N(R)1 0 S P/F N(R)1 1 M P/F M
0 0 18n
Flag8
bits
7-25©2005 Raj JainCSE473sWashington University in St. Louis
111111111111011111101111110
After bit-stuffing1111101111101101111101011111010
Bit StuffingBit Stuffing
q HDLC Flag = 01111110q Every where else in the frame:
Replace 11111 with 111110
Original Pattern
7-26©2005 Raj JainCSE473sWashington University in St. Louis
(b) An inverted bit splits a frame in two
Transmitted
(c) An inverted bit merges two frames
Transmitted
Bit inverted
Bit inverted
Flag
Flag
Flag
Flag
Flag Flag
Flag
Flag
FlagFlag Received
Received
Bit Stuffing (Cont)Bit Stuffing (Cont)
7-27©2005 Raj JainCSE473sWashington University in St. Louis
HDLC FramesHDLC Frames
q Information Frames: User dataq Piggybacked Acks: Next frame expectedq Poll/Final = Command/Response
q Supervisory Frames: Flow and error controlq Go back N and Selective Rejectq Final ⇒ No more data to send
q Unnumbered Frames: Controlq Mode setting commands and responsesq Information transfer commands and responsesq Recovery commands and responsesq Miscellaneous commands and responses
7-28©2005 Raj JainCSE473sWashington University in St. Louis
HDLC Commands and ResponsesHDLC Commands and ResponsesName Information (I)Supervisory (S)
Receive Ready (RR)
Receive Not Ready (RNR)
Reject (REJ)
Selective Reject (SREJ)Unnumbered (U)
Set Normal Response /Extended Mode (SNRM / SNRME)
Set Asynchronous Response /Extended Mode (SARM / SARME)
Set Asynchronous Balanced /Extended Mode (SABM / SABME)
Set Initialization Mode (SIM)
FunctionC/R
C/R
C/R
C/R
C/R
C
C
C
C
DescriptionExchange user data
Positive Acknowledgement; ready to receive I-frame
Positive acknowledgement; not ready to receive
Negative acknowledgement; go back N
Negative acknowledgement;selective rejectSet mode;extended=two-octet control
fieldSet mode;extended=two-octet control
fieldSet mode;extended=two-octet control
fieldInitialize link control functions in addressed station
7-29©2005 Raj JainCSE473sWashington University in St. Louis
HDLC Commands and Responses (cont)HDLC Commands and Responses (cont)
Name Function DescriptionDisconnect (DISC)Unnumbered Acknowledgement (UA)
Disconnect Mode (DM)Request Disconnect (RD)Request Initialization Mode (RIM)
Unnumbered Information (UI)Unnumbered Poll (UP)Reset (RSET)Exchange Identification (XID)
Test (TEST)
Frame Reject (FRMR)
CR
RRR
C/RCCC/R
C/R
R
Terminate logical link connectionAcknowledges acceptance of one of the
above set-mode commandsSecondary is logically disconnectedRequest for DISC commandInitialization needed; request for SIM
commandUsed to exchange control informationUsed to solicit control informationUsed for recovery; resets N(R), N(S)Used to request/report identity and
statusExchange identical information fields
for testingReports receipt of unacceptable frame
7-30©2005 Raj JainCSE473sWashington University in St. Louis
Examples of HDLC OperationExamples of HDLC OperationSABM
SABM
UA
DISC
UA
I,0,0I,0,1I,1,1I,2,1I,1,3I,3,2I,2,4I,3,4RR,4
I,3,0RNR,4RR,0,PRNR,4,FRR,0,PRR,4,FI,4,0
Timeout
(a) Link setup anddisconnect
(b) Two-way dataexchange
(c) Busy condition
7-31©2005 Raj JainCSE473sWashington University in St. Louis
Examples of Operation (Cont)Examples of Operation (Cont)I,3,0I,4,0I,5,0Rej, 4I,4,0I,5,0I,6,0
I,2,0RR,3I,3,0RR,0,PRR,3,FI,3,0RR,4
(d) Reject Recovery (e) Timeout Recovery
**
Timeout
7-32©2005 Raj JainCSE473sWashington University in St. Louis
SummarySummary
q Flow Control: Stop and Wait, Sliding windowq Effect of propagation delay, speed, frame sizeq Piggybackingq Error Control: Stop and wait ARQ, Go-back-N, Selective
Rejectq HDLC: Primary and secondary stations, NRM, ABM, ARMq HDLC Frames: Flag, Bit stuffing, I-Frame, RR, RNR
7-33©2005 Raj JainCSE473sWashington University in St. Louis
Reading AssignmentReading Assignment
q Read Chapter 7 and Appendix 7A of 7th edition of Stallings.
q Do the following Exercise from the textbook: 7.8 (maximum link utilizations)
q There is no need to submit the answers. Next Monday is the first mid-term.