Datalink Protocol New
Datalink Protocol New
• Asynchronous Protocols
• Synchronous Protocols
– Character-Oriented Protocols
– Bit-Oriented Protocols
Data Link Protocol Categories
Asynchronous protocols
- treat each character in a bit stream independently
- use start and stop bits to frame the data units
- inexpensive
- used primarily in modems
Synchronous protocols
- take the whole bit stream and chop it into characters
of equal size
- faster than asynchronous transmission
Asynchronous Protocols
XMODEM Frame
- half-duplex stop-and-wait ARQ protocol
• ZMODEM
– Combining features of both XMODEM and YMODEM
• KERMIT
– Most widely used asynchronous protocol
Synchronous Protocols
Character-oriented protocols
(or byte-oriented protocols)
- the frame or packet is interpreted as a series of characters
Bit-oriented protocols
- the frame or packet is interpreted as a series of bits
Character-Oriented
Protocols
Binary Synchronous
Communication (BSC)
- the best-known character-oriented protocol
SYN – 0010110
STX – 0000010
ETX – 0000011
BSC Frame with Header
SOH – 0000001
ITB – 0011111
Multiblock Frame
Multiframe Transmission
ETB – 0010111
BSC Control Frames
BSC Control Frames cont…
Bit-Oriented Protocols
Station Types:
Primary – issues commands
Secondary – issues responses
Combined – issues both command & response
HDLC Configuration
Information frame
Supervisory frame
Unnumbered frame
HDLC Flag F& FCS field
HDLC Address Field
HDLC Control Field
22
NRM It refers to standard primary –secondary relationship. In this mode secondary
device must have permission from primary device before transmitting. Once permission has been
granted, the secondary may initiate a response transmission of one or more frames containing data
23
(ARM)Asynchronous response
mode
A secondary may initiate a transmission
without permission from the primary
whenever the channel is idle. ARM does not
alter the primary-secondary relationship in
any other way. ALL transmissions from a
secondary(even to another secondary on the
same link) must still be made to the primary
for relay to a final destination.
Asynchronous Balanced Mode
• All stations are equal
• Stations in point-to-point configurations act as both primary and
secondary(combined)
• Either combined station may initiate transmission with the
other combined station without permission
25
(ARM)Asynchronous response
mode
A secondary may initiate a transmission
without permission from the primary
whenever the channel is idle. ARM does not
alter the primary-secondary relationship in
any other way. ALL transmissions from a
secondary(even to another secondary on the
same link) must still be made to the primary
for relay to a final destination.
HDLC Frames
• Three types; each functions as an envelope to
transmit a specific type of message
• Information frames (I-frames) – transports user
data and control info relating to user data
• Supervisory frames (S-frames) – used to
transport control info for data link layer flow
and error controls
• Unnumbered frames (U-frames) – used for
system mgmt and link mgmt
27
HDLC Frame
28
Flag Field
• Marks the beginning and end of frame and
provides synchronization with 01111110
29
Address Field
• Contains address of secondary station that is
originator or destination of the frame
• If created by primary, contains a to address
• If created by secondary, contains a from
address
• May be one byte or several bytes long
30
Control Field
• One- or two-byte segment for flow
management
• Fields differ depending on frame type
• First or first and second bits identify type of
frame
• All three frame types contain a poll/final (P/F)
bit; used to identify whether frame was sent by
primary to a secondary or from secondary to
primary 31
Information Field
• Contains user’s data in an I-frame; network
management in a U-frame; not included in an
S-frame
• Often used in a data frame to acknowledge
receipt of another separate frame – called
piggybacking
32
FCS Field
• Error detection field
• Stores either two- or four-byte CRC
33
Different Control Frames
• I-frame – used for user information and
transport and piggyback acknowledgements
• S-frame – used for acknowledgement, flow
control, and error control when piggybacking is
not appropriate
• U-frame – used to exchange session
management and control information between
devices
University of South 34
Data Transparency
• To address the possibility that a bit pattern may
match flag field indicator and be
misinterpreted, bit stuffing may be used
• Anytime 5 consecutive 1s are encountered, a
redundant 0 is inserted
• Identifies that the current sequence is not a flag
University of South 35
Bit Stuffing and Removal
University of South 36
Control Field
• all three types contain a bit called (Poll/Final) P/F
bit
I-Frame
• N(S) : sequence # of the sent frame
• N(R) : sequence # of frame expected in return
• N(R) is ACK field
• If last frame received is error free
N(R) number will be the next frame in sequence
• If the frame was not received correctly
N( R) number will be the number of damaged frame indicating
the need for retransmission
37
Poll/Final
• P/F = 1 POLL or Final
– Poll if frame is sent by the primary
– Final if frame is sent by the secondary
38
• Receive Ready (RR)
– Positive ACK of a received I- frame
– POLL
– Negative response to poll
– Positive response to select
• Receive Not Ready (RNR)
– Primary uses it for for select with P=1
– It Ack the receipt of a frame and announces that
the receiver is busy
– Negative response to select with f=1
• Reject (REJ)
– This is a NAK frame that can be used in Go-back-n
• Selective reject (SREJ)
– This is a NAK frame used in Selective Repeat ARQ
40
Use of P/F Field
Example
• The figure shows an exchange using piggybacking where
is no error
– Station A begins the exchange of information with an
I-frame numbered 0 followed by another I-frame
numbered 1.
– Station B piggybacks its acknowledgment of both
frames onto an I-frame of its own.
– Station B’s first I-frame is also numbered 0 [N(S)
field] and contains a 2 in its N(R) field,
acknowledging the receipt of A’s frames 1 and 0 and
indicating that it expects frame 2 to arrive next.
– Station B transmits its second and third I-frames
(numbered 1 and 2) before accepting further frames
from station A.
– Its N(R) information, therefore, has not changed: B
frames 1 and 2 indicate that station B is still
expecting A frame 2 to arrive next.
42
Example
• In the previous Example,
suppose frame 1 sent from
station B to station A has an
error.
• Station A informs station B to
resend frames 1 and 2 (the
system is using the Go-Back-N
mechanism)
• Station A sends a reject
supervisory frame to announce
the error in frame 1
43
Polling Example
asking the secondary if it has anything to send
44
Selecting Example
A primary wishes to send data to
secondary
45
U-Frame Control Field
U-Frame Control Field
Command/response Meaning
SNRM Set normal response mode
SNRME Set normal response mode (extended)– control field 2 bytes
SABM Set asynchronous balanced mode
SABME Set asynchronous balanced mode (extended)
UP Unnumbered poll
UI Unnumbered information
UA Unnumbered acknowledgment
RD Request disconnect
DISC Disconnect
DM Disconnect mode
RIM Request information mode
SIM Set initialization mode
RSET Reset
XID Exchange ID
FRMR Frame reject
48
•
U-frame Mode setting
Mode-setting commands sent by the primary or
combined station wishing to control an exchange
• If a combined station wishes to establish a
temporary primary-to-secondary relationship
with another station it sends a U-frame
containing code 00-001 (Normal Response
Mode)
49
U-frame Disconnection
• There are three disconnection codes
– One command from acting primary or combined
station
• disconnection (DISC 00 010) is sent by the 1st station to
the 2nd station to terminate the connection
– Two responses from the receiving station
• request disconnect (RD 00 010) is a request by the 2nd
station to the 1st that a DISC be issued.
• disconnect mode (DM 11 000) is transmitted by the
addressed station as a negative response to mode-
setting command
50