protocols

7

Click here to load reader

Upload: seravana-kumar

Post on 29-Oct-2014

12 views

Category:

Documents


1 download

DESCRIPTION

imp info

TRANSCRIPT

Page 1: protocols

1

Rakenduslik AndmesideLoeng 14

Sümbol-orienteeritud andmekanali protokollid.

Kristjan Sillmannreaalajasüsteemide õppetool

TTÜ [email protected] 2

Character oriented protocolsData Link protocols

Asynchronous protocols

Synchronous protocols

character-orientedprotocols

character-orientedprotocols

bit-orientedprotocols

example: Binary Synchronous

Xmodem Zmodem Kermit Others

3

Used on:• Point-to-point asynchronous circuits• Typically over phone lines via modem (ex: Bulletin Board

System)• Computer to computer for transfer of data filesDesigned 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

4

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

Asynchronous File Transfer protocols

Page 2: protocols

5

Asynchronous File Transfer:Xmodem

– One of the oldest async file transfer protocols– Uses stop-and-wait ARQ.– Advantages

• Universally available • Copes well with noisy lines

– Disadvantages • Small packet size = high overheads = low efficiency • No batch facility

SOH Block # Block # compl.(128 bytes)

Checksum

Start of Header

6

Asynchronous File Transfer:Xmodem frame

With asynchronous protocols, characters are sent one after another, with variable gaps between them.

SOH

header Data: 128 bytes

CRC

One character

7

Asynchronous File Transfer:extensions of Xmodem

• Xmodem-CRC improves error checking by using CRC-8(instead of checksum)

• Xmodem-1K: Xmodem-CRC + increased efficiency by using 1024 bytes for data

• Zmodem: – Newer protocol than Xmodem– Incorporates features of several protocols– Uses CRC-32 with continuous ARQ (sliding window)– Dynamically adjusts packet size according to

communication circuit conditions– Usually Zmodem is preferred to Xmodem.

8

• ZModem– Advantages

• Large packet size = low overheads = high efficiency • Batch Transfers • Auto receive

– Disadvantages • Relatively susceptible to noisy lines • Not available in all comms packages

• Kermit:– Supports different packet data sizes and error detection

methods– Typically uses 1 KByte packets with CRC-24

• size adjusted during transmission to optimize efficiency

Asynchronous File Transfer:extensions of Xmodem

Page 3: protocols

9

Protocol Size Error Detection Retransmission Medium AccessAsynchronous Transmission 1 Parity Continuous ARQ Full Duplex

File Transfer ProtocolsXMODEM 132 8-bit Checksum Stop-and-wait ARQ Controlled Access

XMODEM-CRC 132 8-bit CRC Stop-and-wait ARQ Controlled Access

XMODEM-1K 1028 8-bit CRC Stop-and-wait ARQ Controlled Access

ZMODEM * 32-bit CRC Continuous ARQ Controlled Access

KERMIT * 24-bit CRC Continuous ARQ Controlled Access

Synchronous ProtocolsSDLC * 16-bit CRC Continuous ARQ Controlled Access

HDLC * 16-bit CRC Continuous ARQ Controlled Access

Token Ring * 32-bit CRC Stop-and wait ARQ Controlled Access

Ethernet * 32-bit CRC Stop-and wait ARQ Contention

PPP * 16-bit CRC Continuous ARQ Full Duplex

* Varies depending upon the message length.

Data Link Protocols

10

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 charactersto control the data link.

Binary Synchronous

11

Binary Synchronous Control Function

ASCII Code EBCDIC Code

Character Hex* Character Hex

ACK 0 DLE, 0 10, 30 DLE, '70' 10, 70

ACK 1 DLE, 1 10, 31 DLE, / 10, 61

DLE DLE 10 DLE 10

ENQ ENQ 05 ENQ 2D

EOT EOT 04 EOT 37

ETB ETB 17 ETB 26

ETX ETX 03 ETX 03

ITB US 1F IUS 1F

NAK NAK 15 NAK 3D

PAD DEL FF 'FF' FF

SOH SOH 01 SOH 01

STX STX 02 STX 02

SYN SYN 16 SYN 32

WACK DLE, ; 10, 3B DLE, , 10, 6B 12

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.

Page 4: protocols

13

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.

14

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.

15

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.

16

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 receiverwill send an ACK.

Page 5: protocols

17

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.

Binary Synchronous synchronization

18

Binary Synchronous

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)

Receiver detects SYN character

Receiver enters hunt mode

Receiver in character synchronization

Direction of transmissionTime

STX

SYNSYNSYN

Frame contents

00 0110100 0011010000110100001000000 0110

19

Binary Synchronous:synchronization

Once in Byte Synchronization, the receiver checks for a STXor 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 ‘1’s character).

20

The sending of control charactersBefore 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 dataNext 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.

Binary Synchronous:transmission modes

Page 6: protocols

21

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

Binary Synchronous:point to point control frames

22

Polling & Selecting: master sends– PAD SYN SYN (addr) ENQ PAD

addr is address of terminal or cluster controllerThe 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)

Binary Synchronous:multipoint control frames

23

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:multipoint control frames

24

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 delayIf 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.

Binary Synchronous:other transmission controls

Page 7: protocols

25

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.

Binary Synchronous:other transmission controls