View
0
Download
0
Category
Preview:
Citation preview
HDLC
High-level Data Link Control
Michel Gardie
Telecom & Management SudParis 2October 10, 2009
Summary● Overview and features
● The frame structure Information frames Supervision frames
● Restart rules● Flow control● Exchange modes
Telecom & Management SudParis 3October 10, 2009
Overview● Synchronous
● Bit-oriented
● Full duplex
● Transparent
● Point-to-point or multipoint links
Telecom & Management SudParis 4October 10, 2009
Features● One frame structure
● Several elements of procedure
Telecom & Management SudParis 5October 10, 2009
Frame structure● Data and control information are transmitted
within a single structure:
The frame
Flag0111111
0
Flag0111111
0
Address8 bits
FCS16 bits
Information0 ≤ n < ∞ bits
Control8 bits
Telecom & Management SudParis 6October 10, 2009
Frame fields● Flag
Sequence for synchronisation and delimitation Eight-bit pattern: 01111110
● Address Address of the secondary station A secondary station receives “command” frames
and transmits “response” frames
Telecom & Management SudParis 7October 10, 2009
Frame fields (2)● Information
Contains the user data The field has no maximum length defined
● FCS Frame check sequence 16-bit field; contains a CRC (CRC-16) Used to detect transmission errors
Telecom & Management SudParis 8October 10, 2009
Frame fields (3)● Control
Controls the protocol behaviour Identifies the frames Numbers the information frames Acknowledges the information frames Supervises the data link
Telecom & Management SudParis 9October 10, 2009
Frame characteristics● Transparency
Allows to transmit any bit pattern Insertion of one “0” after five “1”s Suppression of every “0” after five “1”s
The flags must not be modified!
● Frame inter-filling Maintains the synchonisation Continuous transmission of flags
Telecom & Management SudParis 10October 10, 2009
Frame characteristics (2)● Frame abandon
Forces the receiver to discard a frame Sequence of M bits, with M ≥ 7
● Invalid frames Shorter than 32 bits Frame “too long”
Telecom & Management SudParis 11October 10, 2009
Frame types● N(S): number of the
frame sent
● N(R): number of the next expected frame
● P/F: poll/final bit
● S, U: supervision and extra functions
8 7 6 5 4 3 12
N(R)
N(R)
P/F N(S)
S S
U U U U U
0
1
1
0
1
P/F
P/F
F A C INFO FCS F
Information
Supervision
Unnumbered
Telecom & Management SudParis 12October 10, 2009
Information frames● The information field is not empty and its
content is defined by the user
● The frame counters are modulo 8 N(S) number of the sent frame N(R) number of the next expected frame
● The frame can acknowledge other information frames
Telecom & Management SudParis 13October 10, 2009
Supervision frames● No information field
● A counter is transmitted by the frame: N(R)
● This type of frame is used to: acknowledge information frames reject information frames specify the state of the receiving station
Telecom & Management SudParis 14October 10, 2009
Supervision frames (2)● All the supervision frames acknowledge
information frames whose number N(S) is less or equal to N(R) – 1 (modulo n).
Telecom & Management SudParis 15October 10, 2009
Supervision functions● S4, S3 = 0,0
RR Receiver Ready
● S4, S3 = 1,0REJ Reject
● S4, S3 = 0,1RNR Receiver Not Ready
● S4, S3 = 1,1SREJ Selective Reject
8 7 6 5 4 3 12
N(R) S S 10P/F
F A C INFO FCS F
Telecom & Management SudParis 16October 10, 2009
RR Receiver Ready● The receiver is ready to process new information
frames.
● The previous received information frames (up to N(R) - 1) have been correctly processed and their content has been delivered to the user.
Telecom & Management SudParis 17October 10, 2009
RR example● The receiver can receive
several information frames before sending an RR frame.
● N(R) is the next expected frame.
NETWORKDTE
DLDTreq
DLDTreq DLDTind
DLDTind
I 1,0
RR 2
I 0,0
Telecom & Management SudParis 18October 10, 2009
REJ Reject● The receiver requests the retransmission of all
information frames starting from the number N(R).
● The frames received up to N(R) - 1 are acknowledged.
● All the frames received from N(R) are discarded.
Telecom & Management SudParis 19October 10, 2009
REJ example● Frame N(S)=1: bad FCS
● Frame N(S)=2: discarded
● REJ 1 requests the retransmission from 1 and acknowledged the frame N(S)=0.
NETWORKDTE
DLDTreq
DLDTreqDLDTind
DLDTind
REJ 1
I 0,0
DLDTreqI 1,0
I 2,0
I 1,0
I 2,0
DLDTind
Telecom & Management SudParis 20October 10, 2009
RNR Receiver Not Ready● The receiver temporarily cannot receive extra
information frames.
● The previous frames (up to N(R) - 1) were correctly received but their content could not be delivered to the user.
Telecom & Management SudParis 21October 10, 2009
RNR example● The upper layers
cannot receive data
● The frames are acknowledged (RNR)
● After reception by the upper layers, the normal transfer can resume (RR)
NETWORKDTE
DLDTreq
DLDTreq
DLDTind
DLDTind
I 1,0
RNR 2
I 0,0
NETWORKDTE
DLDTreq
DLDTreq
RR 2
Telecom & Management SudParis 22October 10, 2009
SREJ Selective Reject● The receiver requests the retransmission of the
information frame whose number is N(R).
● The next received frames (after N(R)) have been correctly received, and have been stored; the content of these frames has not been delivered to the user.
● The use of this supervision frame is optional.
Telecom & Management SudParis 23October 10, 2009
Restart rules● Some error conditions or abnormal behavior may
occur. The rules of restart resolve these problems.
Wrong N(S) Transmission error Overflow etc.
Telecom & Management SudParis 24October 10, 2009
Wrong N(S)● Any information frame whose N(S) does not
contain the expected value must be discarded; the next frames must be ignored too.
● The station receiving such a frame must then send a REJ frame with N(R) indicating the expected frame number.
Telecom & Management SudParis 25October 10, 2009
Wrong N(S) [SREJ]● Any information frame whose N(S) does not
contain the expected value must be discarded. The eventual next information frames should be stored.
● A station receiving such a frame must then send a SREJ frame with N(R) indicating the expected frame number.
Telecom & Management SudParis 26October 10, 2009
Transmission error● Any frame, whose FCS computation indicates a
transmission error, must be discarded.
● No other specific action should be undertaken by the receiver.
Telecom & Management SudParis 27October 10, 2009
Restart after time-out● A station which does not receive any
acknowledgment before T1 seconds, must retransmit the first unacknowledged information frame.
● The P/F bit of this information frame must be set.
● The station can then resume the transmission after the reception of an acknowledgment with the P/F bit set.
Telecom & Management SudParis 28October 10, 2009
Restart after time-out (1)● The first frame
occurence is lost (bad FCS)
● After a time-out (T1), the frame is sent again
● The frame is normally acknowledged
NETWORKDTE
DLDTreq
DLDTind
I 0,0
I 0,0 P/F
T1
RR 1 P/F
Telecom & Management SudParis 29October 10, 2009
Restart after time-out (2)● The first frame
occurrence is correct
● The RR is lost (bad FCS)
● After T1, the second frame occurrence is discarded (wrong N(S))
NETWORKDTE
DLDTreq
DLDTind
I 0,0
I 0,0 P/F
T1 RR 1
REJ 1 P/F
Telecom & Management SudParis 30October 10, 2009
Bit P/F● A station which receives a command frame with
the P/F bit set, must send a response frame with the P/F bit also set.
● The P/F bit is called P (Poll) in a command frame (e.g. Information frames)
● The P/F bit is called F (Final) in a response frame (e.g. RR, RNR or REJ frames)
Telecom & Management SudParis 31October 10, 2009
Flow control● The mechanism used is a window.
● A station can send up to W information frames before receiving any acknowledgment.
● The window is closed if the station has sent W frames and did not receive any acknowledgment.
● A station cannot send other information frames if its window is closed.
Telecom & Management SudParis 32October 10, 2009
Flow control (cont’d)● The receiver can acknowledge one, several, or all
the information frames previously received.
● When a station acknowledges some information frames, it opens more or less the window of the peer station:
RR or REJ acknowledge the information frames and open the window.
RNR acknowledges the information frames but does not open the window.
Telecom & Management SudParis 33October 10, 2009
Overflow● A station, which cannot receive any more
information frames, sends a RNR frame with N(R) indicating the first unaccepted frame.
● The station sends a RR frame as soon as it is ready again to receive new information frames.
Telecom & Management SudParis 34October 10, 2009
Flow control example● W = 3 → the window size is 3.
● DLDTreq → primitive of service sent by the user of the level 2 (DTE side): DLDTreq = Data Link Data request.
● DLDTind → primitive of service sent by the user of the level 2 (network side): DLDTind = Data Link Data indication.
● I,2,0 → information frame, N(S)=2, N(R)=0
● RR,2 → supervision frame RR, N(R)=2
NETWORKDTE
DLDTreq
DLDTreq
DLDTreq
DLDTreq
DLDTind
DLDTind
DLDTind
DLDTind
W = 3
I 0,0
I 1,0
I 2,0
RR 2
I 3,0
RR 4
Telecom & Management SudParis 35October 10, 2009
Unnumbered frames● No information field
● No frame counter
● Basic control of the data link initialization (connection) connection reject disconnection indication of protocol errors
Telecom & Management SudParis 36October 10, 2009
Unnumbered frames examples
8 7 6 5 4 3 2 1 Meaning
0 0 0 P/F 1 1 1 1 SARMSet Asynchronous Response Mode
0 0 1 P/F 1 1 1 1SABMSet Asynchronous Balanced Mode
0 1 0 P/F 0 0 1 1DISCDisconnect
0 1 1 P/F 0 0 1 1UAUnnumbered Acknowledgment
0 0 0 P/F 1 1 1 1DMDisconnected Mode
1 0 0 P/F 0 1 1 1CMDR / FRMRCommand Reject / Frame Reject
Telecom & Management SudParis 37October 10, 2009
SABM● Frame nature: command.
● Select the balanced mode (LAPB), and establishes the connection
● The stations can both manage the data link.
● The acceptation of the connection is done with a UA frame.
● The rejection of the connection is done with a DM frame.
Telecom & Management SudParis 38October 10, 2009
SARM● Frame nature: command.
● Select the symmetric mode (obsolete), and establishes the connection.
● The stations can both manage the data link.
● The acceptation of the connection is done with a UA frame.
● The rejection of the connection is done with a DM frame.
Telecom & Management SudParis 39October 10, 2009
UA● Frame nature: response
● Accepts a command: Accepts a connection Accepts a disconnection
Telecom & Management SudParis 40October 10, 2009
DISC● Frame nature: command.
● Generates the logical disconnection of the data link between two stations.
● The receiving station must answer with a UA.
Telecom & Management SudParis 41October 10, 2009
DM● Frame nature: response.
● Two functions: Indicates that a station is not logically connected. Rejects a command
● Note: DM and SARM share the same binary coding. The address field is used to make the distinction between these two frames.
Telecom & Management SudParis 42October 10, 2009
FRMR/CMDR● Frame nature: response.
● Rejects a command: after an error; if the requested command is not implemented.
Telecom & Management SudParis 43October 10, 2009
Some parameters● Timer T1
On timeout of this timer, the first unacknowledged information frame must be sent again.
Standard values: T1 = 100, 200, 400, 800, 1600, 2500 ms
● Timer T2 Maximum time that a receiver can wait to
acknowledge an information frame.
Telecom & Management SudParis 44October 10, 2009
Some parameters (cont’d)● N1
Maximum size of an information frame.
● N2 Maximum number of retransmission of the same
information frame. If this value is reached, the link is considered to be
out-of-order. Standard value: 10
Telecom & Management SudParis 45October 10, 2009
Exchange modes definitions
SOURCE DESTINATION
INFORMATION
ACKNOWLEDGMENT
PRIMARY SECONDARY
COMMAND
RESPONSE
Telecom & Management SudParis 46October 10, 2009
Assymetric point-to-point
PRIMARY SECONDARY
SOURCE
Station A Station B
DEST. SOURCE
SEL I
POLL ACK
ACK
II
I I
I
DEST.
Telecom & Management SudParis 47October 10, 2009
Symetric point-to-point
PRIMARY SECONDARY
DEST.SOURCE
Station A Station B
DEST. SOURCE
I
ACK
ACK
II
I I
I
PRIMARYSECONDARY
Telecom & Management SudParis 48October 10, 2009
Balanced point-to-point
DEST.
Station A Station B
SOURCE
SOURCE
DEST.
Com
b ine
d s
tati o
n
Com
b ine
d s
tati o
n
Telecom & Management SudParis 49October 10, 2009
Credits● These slides have been realized with OpenOffice.org 3.1.1
● Creation date: 17 October 2008
● Last modification date: 10 October 2009
● Drawings:
Trash/dustbin: http://pleindetrucs.com/galerie/details.php?image_id=13872
Other drawings made with OOo 3.1.1 draw.
Telecom & Management SudParis 50October 10, 2009
Public Documentation licence Notice
● The contents of this Documentation are subject to the Public Documentation License Version 1.0 (the "License"); you may only use this Documentation if you comply with the terms of this License. A copy of the License is available at http://www.openoffice.org/licenses/PDL.html.
● The Original Documentation is HDLC, High-level Data Link Control. The Initial Writer of the Original Documentation is Michel Gardie Copyright © 2007. All Rights Reserved. (Initial Writer contact(s): michel.gardie@it-sudparis.eu).
● Contributor(s): none.
● NOTE: The text of this Appendix may differ slightly from the text of the notices in the files of the Original Documentation. You should use the text of this Appendix rather than the text found in the Original Documentation for Your Modifications.
Recommended