Rakenduslik Andmeside: Loeng 14
Rakenduslik Andmeside: Loeng 14
Loeng 14
Smbol-orienteeritud andmekanali protokollid.
Xmodem Zmodem
1
Kermit Others
Asynchronous
File Transfer protocols
Used on: Point-to-point asynchronous circuits Typically over phone lines via modem (ex: Bulletin Board System) Computer to computer for transfer of data files Designed to provide error detection and correction facilities for reliable file transfer. Large amount of data to be transmitted i.e. makes sense to group data together into blocks to transmit at same time
Asynchronous
File Transfer protocols
Characteristics of async. file transfer protocols: Group data (binary or text) into blocks to be transmitted (rather than sending character by character), Supply error detection (CRC) symbol(s) with each block Implement ARQ scheme for error correction (resend the blocks which had errors) Xmodem Takes data being transmitted and breaks into blocks Each block has: Start-of-header (SOH) character 1-byte block number 128 bytes of data 1-byte checksum for error checking
3 4
CRC
Checksum
6
Binary Synchronous
Binary Synchronous Communications (BSC or BiSync): Supports EBCDIC, ASCII, and Transcode (rare 6-bit code) Uses Stop-and-Wait ARQ (- the major drawback of BSC) Error Checking A block check character (BCC) in data frame contains error checking information CRC is the most popular method for calculating the BCC The transmission is based on the sending of special characters to control the data link.
Asynchronous Transmission 1 File Transfer Protocols XMODEM XMODEM-CRC XMODEM-1K ZMODEM KERMIT
Synchronous Protocols
8-bit Checksum 8-bit CRC 8-bit CRC 32-bit CRC 24-bit CRC
Stop-and-wait ARQ Controlled Access Stop-and-wait ARQ Controlled Access Stop-and-wait ARQ Controlled Access Continuous ARQ Continuous ARQ Controlled Access Controlled Access
* * * * *
16-bit CRC 16-bit CRC 32-bit CRC 32-bit CRC 16-bit CRC
Stop-and wait ARQ Controlled Access Stop-and wait ARQ Continuous ARQ Contention Full Duplex
9
10
Binary Synchronous
Control Function ACK 0 ACK 1 DLE ENQ EOT ETB ETX ITB NAK PAD SOH STX SYN WACK ASCII Code Character Hex* DLE, 0 10, 30 DLE, 1 10, 31 DLE 10 ENQ 05 EOT 04 ETB 17 ETX 03 US 1F NAK 15 DEL FF SOH 01 STX 02 SYN 16 DLE, ; 10, 3B EBCDIC Code Character Hex DLE, '70' 10, 70 DLE, / 10, 61 DLE 10 ENQ 2D EOT 37 ETB 26 ETX 03 IUS 1F NAK 3D 'FF' FF SOH 01 STX 02 SYN 32 DLE, , 10, 6B
Binary Synchronous
control characters
SYN (Synchronous Idle) Provides the hardware recognizable bit pattern rquired to establish character synchronization at the receiving adapter ENQ (Enquiry) Recognized as a request for a response, or a bid for line control. In some cases it may be used to signify an abnormal end of text or message 'abort'. SOH (Start of Header) Indicates the inclusion of auxiliary data preceding the message text.
11
12
Binary Synchronous
control characters
STX (Start of Text) Indicates the beginning of data in a block. STX may be preceded by a header. Directly behind the STX is the first character of the data field. NAK (Negative Acknowledgement) Indicates that there was an error in a data block. Also used as a response to a bid for line control to indicate a 'Not Ready' condition. DLE (Data Link Escape) Multiple usage as a control character modifier.
Binary Synchronous
control characters
ETB (End of Transmission Block) Indicates an end of data block, but more will follow. Is used to instruct the receiving unit to perform error checking and acknowledge. ETX (End of Text) Same as ETB, only no more blocks will follow. ITB (End of Intermediate Transmission Block) Same as ETB, except that the receiving statio will not acknowledge after the error checking. EOT (End of Transmission) Indicates that a station has no data to transmit.
13 14
Binary Synchronous
control characters
ACK0, ACK1 (positive Acknowledgements) ACK0 ackowledges 'even' numbered blocks (and as a positive response to a line bid) and ACK1 acknowledges 'odd' numbered blocks. DLE EOT (Mandatory Disconnect) Used on a dial-up line to indicate that the dialing unit is hangup and an instruction for the receiving unit to do the same.
Binary Synchronous:
frame formats
Message blocks of BiSync have the following format: Control Frame
Data Frame
Every package that is transmitted is packed between an STX and an ETX character, followed by one (LRC-check) or two (CRC-check) BCCs (Block Check Character). After this (and the check on the receiving side) the receiver will send an ACK.
15 16
Binary Synchronous
synchronization
Binary Synchronous
SYN Direction of transmission SYN SYN Time
The beginning of a transmission can be started with a leading PAD (01010101) character. What must follow are at least 2 SYN characters. For bit synchronization: uses PAD character before each block of characters (frame). For character synchronization: uses two or more SYN (01101000) characters before each frame.
17
Once the receiver has obtained Bit synchronisation it enters what is known as the Hunt Mode. It starts to interpret the received bit stream in a window of eight bits as each new bit is received. In this way it checks whether the last eight bits were equal to a SYN character (to find the start of next byte)
18
Binary Synchronous:
synchronization
Binary Synchronous:
transmission modes
The sending of control characters Before information is send it might be necessary to send a couple of control characters that sets the device in the right mode, like a printer control characters. To indicate that this 'special' information is being send it is preceded by a SOH character. The sending of data Next to the sending of plain ASCII or EBCDIC text, there is also the possibility of sending binary data. To realize this, data is sent in a so called 'transparency-mode'. Which means that every transmission control character is preceded by a DLE character.
19 20
Once in Byte Synchronization, the receiver checks for a STX or SOH character, indicating start of text/header. Once synchronisation has been achieved, SYN (01101000) characters will be continuously sent when data is not being transmitted to ensure that the sender and receiver remain synchronised at both bit and byte level. The trailing PAD character assures that the transmission is held long enough for the last critical character to have been received (usually an "FF all 1s character).
Binary Synchronous:
point to point control frames
Control Frames Question: PAD SYN SYN ENQ PAD (can I send now?) Answer: PAD SYN SYN ACK0 PAD (if ready to receive) PAD SYN SYN NAK PAD (if not ready to receive) PAD SYN SYN WACK PAD (temporarily busy, try later). The requesting station will reply with another ENQ After data is sent, line is freed up by sender with PAD SYN SYN EOT PAD Three seconds later, either party can ENQ
21
Binary Synchronous:
multipoint control frames
Polling & Selecting: master sends PAD SYN SYN (addr) ENQ PAD addr is address of terminal or cluster controller The polled/selected station can respond several ways: If anything waiting to send to host: PAD SYN SYN SOH (Header) STX (Data) ETX BCC BCC PAD PAD SYN SYN EOT PAD (Finished sending) PAD SYN SYN STX ENQ PAD (give me 2 seconds to get ready and then I'll start sending, but don't give the line to someone else)
22
Binary Synchronous:
multipoint control frames
The polled/selected station can respond several ways: If no data waiting (in the station) to send to host: PAD SYN SYN ACK0 PAD (ready to receive) PAD SYN SYN NAK PAD (not ready to receive) PAD SYN SYN WACK PAD (temporarily busy, try again later)
Binary Synchronous:
other transmission controls
Receiver delay If the slave can't cope with the speed of the master is can send a WACK to delay the sending of data to prevent buffer overflows. Sender delay If the master station can't present it's data as fast as the receiving end can it uses a TTD (Temporary Text Delay) character to hold the line (to overcome the non-activity time-out of the slave). Actually a TTD is an illegal sequence of characters (STX, ENQ) on which the slave responds with a NAK.
23 24
Binary Synchronous:
other transmission controls
Abort To abort a block that is already partially sent, the master sends ENQ, on this 'block abort' the slave responds with a NAK and drops all already received data (from this block). If the master sends a EOT before a ETX is received by the station it means a 'station abort. The slave then has a possibility to become master, otherwise the connection is terminated.
25