Data-Link Protocols

advertisement
Data-Link Protocols
Data-Link Protocol Functions
Line discipline – coordinates hop-to-hop data delivery where a hop is a computer, a network controller, or
some type of network-connecting device, such as router
It determines which device is transmitting and which is receiving at any point in time
Flow control – the rate at which data is transported over a link
--provides an acknowledgement mechanism that data is received at the destination
--regulate flow of data from sender to receiver
Error control – detects and corrects transmission errors
Framing – recognizing beginning and end of frames (blocks, packets)
Line discipline
ENQ/ACK:
Example of ENQ/ACK line discipline
POLL/SELECT:
Example of poll/select line discipline
Flow control
Stop-and-Wait flow control
•
Source transmits frame
•
Destination receives frame and replies with acknowledgement
•
Source waits for ACK before sending next frame
•
Destination can stop flow by not send ACK
•
Works well for a few large frames
Example of Stop-and-Wait flow control
Sliding Window flow control
Error Control
Detection and correction of errors
Lost frames
Damaged frames
Techniques for error control (Automatic repeat request)
--Error detection
--Positive acknowledgment
--Retransmission after timeout
--Negative acknowledgement and retransmission
Character- and Bit-Oriented Data-Link Protocols
1) Character-oriented protocol
Based on one byte (8-bit)
Use ASCII for control character
Not efficient
2) Bit-oriented protocol
Based on individual bits
One or multiple bits for control
More efficient
Data Transmission Modes
1) Character Mode
In character mode, character codes are transmitted immediately after an operator depresses a key.
The character is sent asynchronously because transmissions are not synchronized with the speed of the
operator’s key strokes and operator’s type at different speeds.
When an operator is not typing, the terminal is in the idle state.
2) Block Mode
In the block mode, data characters are not transmitted immediately as they are typed.
Operators enter characters into their terminals and PC’s where they are stored in buffers and displayed on
the screen.
When an operator is ready to transmit the information displayed on the screen, he or she depresses the
Enter, Send, or Return key, which transmits all the data characters previously entered into memory.
The characters transmitted as a group is called a block or frame of data.
The block mode of transmission is more appropriate for multi-drop data communications circuits
operating in a polling environment.
Asynchronous Data-link Protocols
• Asynchronous protocols treat each character in a bit stream independently.
• Asynchronous protocols, used primarily in modems, feature start and stop bits and variable length
gaps between characters.
• Due to its inherent slowness (stemming from the required addition of start and stop bits and
extended spaces between frames), asynchronous transmission is being replaced by highspeed synchronous transmission.
•
XMODEM
– In 1979 Ward Christiansen designed a file transfer protocol for telephone-line
communication between PCs.
•
half-duplex stop-and-wait ARQ protocol
•
XMODEM frame format
– SOH(Start of Header) : 1 byte
– Header : 2 byte(Sequence number, check the validity of sequence number)
– Data(Binary, ASCII, Boolean, Text, etc.) : 128 byte
– CRC : check for error in the data field
Data Frame
• ACK Frame
• NACK Frame: In XMODEM protocol, transmission begins with the sending of a
NACK frame from the receiver to the sender.
• CAN (cel) Frame aborts the transmission
•
YMODEM
~ is a protocol similar to XMODEM
– data unit is 1024 bytes
– Two CAN (cancel) characters are sent to abort a transmission
– ITU-T CRC-16 is used for error checking
– Multiple files can be sent simultaneously and acknowledged with a single ACK or NAK
characeter
• ZMODEM
~ is a newer protocol combining features of both XMODEM and YMODEM
• BLAST(Blocked Asynchronous Transmission)
~ is full-duplex with sliding window flow control
• Kermit
~ designed at Columbia University
~ is the most widely used asynchronous protocol
IBM’s 83B Asynchronous Data-Link Protocol
• Identical to old Western Electric company’s 8A1/8B1 Service Calling System
• Designed for multi-drop private-line data circuits using an asynchronous data format and
asynchronous modems
• Designed for central-controlled multipoint data circuit with a polling environment
• The primary station is the host and the remote stations are the secondaries
• Uses vertical redundancy checking as the error-detection technique and either symbol substitution
or ARQ for error correction
• Remote stations with 83B protocol may be in one of four operating modes
1) Line monitoring
• simply monitors messages on the circuit looking for transmission with its polling or selection
address
• Station is neither transmitting nor receiving data
2) Transmit
• The station will be in master mode, can send formatted messages, or acknowledgements
3) Receive
• Selected by primary station and designated as a receiver
• The secondary can receive formatted messages, polls or acknowledgements from the primary
station
4) Local
• For a terminal operator to enter information into his or her computer terminal, it must be in the
local mode
• Set into local mode through software commands sent from the primary or the operator can do it
manually from the keyboard
• The secondary station simply monitors the communications channel looking for polls or selection
83B Polling Sequence
• A primary station sends a polling sequence to identify a secondary station as a transmitter
• Sending one or two data-link control characters and then a station polling address (SPA)
E
D
S
E O T = end of Transmission
O
C
P
D C 3 = device control three
T
3
A
S P A = station polling address
• The EOT character is a data-link control character called a clearing character
• EOT places all secondary stations into the line-monitoring mode
• When DC3 follows an EOT, it indicates that the next character is a station polling address
E
D
O
C
A
Station A is the master- A is ASCII character
T
3
83B Response to polls
• Two acknowledgement sequences may be transmitted in response to a poll- a ACK and a NAK
• A positive ACK means that the secondary station received the poll and has no messages to send
but is ready to receive formatted messages
• A negative ACK to a poll means that the secondary station received the poll and has no messages
to send but is not ready to receive
• If a secondary station has a formatted message to send when it is polled, it simply responds with
the message format
S
E
T
message
O
X
T
ACK to a Poll
Function
Positive
A
No messages to transmit
\ C
Ready to receive
K
Negative
\ \
No messages to transmit
Not ready to receive
• When a heading is included, STX terminates the heading and indicates the beginning of the
message
S
S
E
O heading (date, time, etc.) T message data
O
H
X
T
83B selection Sequence
• A primary station sends a selection sequence to identify a secondary station as a receiver
• The receiver must respond to a selection to indicate whether it is ready to receive a message
E
S
O
S
D
SSA = station selection address
T
A
A
DA = device address
• A selection sequence begins with transmission of an EOT character, which ensures that all
secondary stations are in line-monitoring mode
EX:
E
O
A
X
T
83B Polling Sequence
Negative ACK to a Poll selection
\
\
Not ready to receive (printer out of paper or terminal in local)
*
*
Not ready to receive (have a formatted message to transmit)
Positive ACK to a Poll selection
A
\ C ready to receive
K
83B primary message format
Messages transmitted from primary stations use exactly the same data format as messages transmitted
from secondary stations
S
E
T
message
O
X
T
• STX, when transmitted by a primary station, is called a blinding character, as it causes all
previously unselected secondary stations to ignore the transmission
• Only the previously selected secondary station receives the message transmitted by the primary
• The unselected secondary stations remain blinded until they receive an EOT character, at which
time they will return to line monitoring mode and begin looking for polls or selections addressed
for their station
Synchronous Data Link protocols
• BSC- Binary Synchronous Communications
- developed by IBM
– also called as bisync or bisynchronous communications
– usable in both point-to-point and multipoint configuration
– support half-duplex transmission using stop-and-wait ARQ flow control and error
correction
S
S
Y
Y
message block
N
N
– The message block can be a poll, a selection, an acknowledgement, or a message
containing user information
– The SYN character for ASCII is 16 hex and for EBCDIC 32 hex
– The SYN character places the USART receiver in the character (byte) mode and prepares it
to receive data in eight-bit groupings
– With BSC, SYN characters are always transmitted in pairs
– If eight successive bits are received in the middle of a message that is equivalent to a SYN
character, they are ignored
A= 41H
b= 62H
01000001 01100010
1 hex 6 hex
BSC polling sequence
• Two poling formats are used with bisync.
1) General
P
S
S
E
P
S
S
S S
E
P
A
Y
Y
O A Y
Y
P
P
‘’ ‘’
N A
D
N
N
T
D N
N A A
Q D
PAD= pad --- 55 hex or AA hex (01010101 or 10101010)
• To ensure that transitions occur in the data before transmission of the actual message
• The transitions are needed for clock recovery in the receive modem to maintain bit synchronization
• SPA- Station polling address
• Two SPA characters are transmitted for error detection
• A secondary will not recognize or respond to a poll unless its SPA appears twice in succession
• ENQ- enquiry is called a format or line turnaround character because it simply completes the
polling sequence and initiates a line turnaround
• The PAD at the end of the polling sequence is called a trailing pad and is simply a 7F (DEL)
2) Specific poll
P
S
S
E
P
S
S
S S
E
P
A
Y
Y
O A Y
Y
P
P
D D N A
D
N
N
T
D N
N A A
A A
Q D
Device address
twice
• The character sequence for a specific poll is similar to general poll except that the two device
address (DA)
• The two DA characters are transmitted for redundancy error detection
BSC selection sequence
P
S
S
E
P
S
S
S S
E
P
A
Y
Y
O A Y
Y
S
S
D D N A
D
N
N
T
D N
N A A
A A
Q D
STATION SELECTION
ADRESS
BSC message sequence
Positive responses to a block check character
P
S
S
D
P
A
Y
Y
L
0
A
(even numbered blocks)
D
N
N
E
D
Or
P
S
S
D
P
A
Y
Y
L
1
A
(odd numbered blocks)
D
N
N
E
D
Negative response to a block check character (message):
P
S
S
N
P
A
Y
Y
A
A
(even numbered blocks)
D
N
N
K
D
BSC transparency:
It is possible that an eight-bit sequence could occur within the message that is equivalent to a data link
control character.
With bisync, a data-link escape (DLE) character is used to achieve transparency. There are six instances to
precede a character with a DLE.
DLE STX: places the receive controller into the transparent mode.
DLE ETX: used to terminate the last block of transparent text and take the controller out of the
transparent mode.
DLE ETB: used to terminate blocks of transparent text in all blocks of data except the final block.
DLE ITB: used to terminate blocks of transparent text other than the final block when ITB is used for a
block-terminating character.
DLE SYN: used only with transparent messages more than 1 second long.
DLE DLE: used to transmit a bit sequence equivalent to DLE as part of the text.
An example including data-link escape characters in transparent BSC message is
P
S
S
D
S
D
E
B P
A
Y
Y
L
T
message
L
T
C
D
D
N
N
E
X
E
X
C D
SDLC – Synchronous Data Link Control
7E hex
FCS
CRC-
Span of CRC
accumulation
Span of zero insertion
7E hex
•
One beginning and one ending flag for each frame
01111110
address
control
text
FCC
01111110
Beginning Flag
Ending Flag
• The ending flag from one frame is used for the beginning flag for the next frame
text FCC 01111110 address
control
text
FCC
01111110 address control
shared flag
• The last zero of an ending flag can be the first zero of the beginning flag of the next frame
011111101111110
address
control
text
FCC
011111101111110
address
shared 0
shared 0
• Flags are transmitted continuously during the time between frames instead of idle line 1’s
01111110011111100111111001111110 address control text FCC 0111111001111110
Flag
Flag Flag
Flag
Flag
Flag
•
•
A data-link escape (DLE) character is used to achieve transparency i.e., transmission and reception
of any bit pattern
DLE ETX, DLE STX,……..
HDLC – High-Level Data Link Control
• Formal standard developed by ISO
• Same as SDLC, except
– Longer address and control fields
– Larger sliding window size
• Comprises 3 standards that outline the frame structure, control standards and class of operation for
a bit-oriented data-link control
1. ISO 3309-1976(E):
The ISO 3309 standard defines the frame structure, delimiting sequence, transparency
mechanism and error-detection method used with HDLC.
--With HDLC, the frame structure and delimiting sequence are essentially the same as with SDLC.
--An HDLC frame includes a beginning flag field, an address field, a control field, an information field, a
frame check character field, and an ending flag field.
--The delimiting sequence with HDLC is a binary 01111110.
--HDLC uses CRC-16 for error detection with a generating polynomial specified by CCITT V.41.
--At the transmit station, the CRC characters are computed such that when included in the FCC
computations at the receive end, the remainder for an errorless transmission is always FOB8.
--HDLC can use an 8-bit address field or an extended addressing format that is virtually limitless.
If b0 in the address field is a logic 1, the seven remaining bits are the secondary’s address.
If b0 in the address field is a logic 0, the next byte is also part of the address.
If b0 of the second byte is a logic 0, a third address byte follows and so on until an address byte with a
logic 1 for the low-order bit is encountered.
b0=0
b0=0
b0=1
01111110
0XXXXXXX
0XXXXXXX
1XXXXXXX
Flag
1st address byte
2nd address byte
3rd address byte
2. ISO 4335-1979(E):
a) Control field:
The control field can be extended to 16 bits
Seven bits are for “ns” and seven bits are for the “nr”.
With extended control format, there can be a maximum of 127 outstanding frames at any given time.
With HDLC, the supervisory format includes a fourth status condition: selective reject (SREJ).
SREJ is identified by two logic 1’s in bit positions b4 and b5 of a supervisory control field.
With SREJ, a single frame can be rejected
A SREJ calls for retransmission of only one frame identified by the three-bit nr code.
A REJ calls for the retransmission of all frames beginning with frames identified by the three-bit nr code.
b) Information field:
With HDLC, any number of bits may be used for a character in the Information field as long as all
characters have the same number of bits.
HDLC has two operational modes:
i. Asynchronous response mode (ARM): with ARM, secondary stations are allowed to send unsolicited
(voluntary) responses.
To transmit, a secondary does not need to have received a frame from the primary with the P bit set.
If a secondary receives a frame with the P bit set, it must respond with a frame with the F bit set.
ii. Asynchronous disconnect mode (ADM): an ADM is identical to normal disconnect mode except that
the secondary can initiate a DM or RIM response at any time.
3. ISO 7809-1985(E):
The ISO 7809 standard combines previous standards 6159(E) (unbalanced) and 6256(E)
(balanced) and outlines the class of operation necessary to establish the link-level protocol.
i.
Unbalanced operation: This class of operation is logically equivalent to a multipoint privateline circuit with a polling environment. There is a single primary station responsible for central
control of the network. Data transmission may be either half or full duplex.
ii.
Balanced operation: this class of operation is logically equivalent to a two-point private-line
circuit where each station has equal data-link responsibilities. Channel access is accomplished
through contention on a two-wire circuit using the asynchronous response mode. Data
transmission is half duplex on a two-wire circuit and full duplex on a four-wire circuit.
Download
Study collections