Site hosted by Angelfire.com: Build your free website today!

DATA COMMUNICATIONS
© Copyright Brian Brown, 1995-2000. All rights reserved.

Part 12: Binary Synchronous Protocol

Binary Synchronous | Summary


Introduction
This section briefly discusses the Binary Synchronous protocol, which uses characters of the ASCII set to exchange data.

Objectives
At the end of this section you should be able to

 

SYNCHRONOUS PROTOCOLS
Synchronous protocols involve sending timing information along with the data bytes, so that the receiver can remain in synchronization with the sender. When the sender has no data to transmit, the sender transmits idle flags (a sequence of alternating 0's and 1's) to maintain sender/receiver synchronization. Data bytes are packaged into small chunks called packets, with address fields being added at the front (header) and checksums at the rear of the packet.

The envelope which holds the data and transports it across the link between the sender and receiver is changed, which allows more characters to be sent together, and for error checking to be an inherent feature of this protocol. This overcomes the two main deficiencies of the asynchronous protocol.

 

Character Orientated Protocols (COP)
In character orientated protocols, each character has significance. In other words, when a character arrives at the receiver, the character has two meanings, it's either a data byte, or it's a control byte (which is used as information signals between the sender and receiver). The main COP in use today is known as BI-SYNC, or binary synchronous.

Each character sent is transmitted using the ASCII code. Control bytes obviously have values in ASCII of between 00 and 1F, whereas data bytes have values between 20 and 7F.

Communication takes the form of a hand-shake between the sender and receiver. Communication of a message from sender to receiver takes the following format,

Handshaking As you can see, this is a HALF-DUPLEX (which means only one side talks at once) method of communication. Long messages are broken up into a series of smaller data packets, and transmitted one at a time across the link. Each packet is acknowledged before the next packet is transmitted.

If a packet is not acknowledged, the sender will time out and then retransmit the packet. If the packet is acknowledged by the receiver, the sender sends the next packet and so on until the entire message has been sent. If a packet is received and contains errors, the receiver will send a negative acknowledge, which requests the sender to send it again.

Data bytes contain data according to the ASCII code (for text), or simply a value between 0-255 for binary data. Control bytes determine the behavior of the communication link, and are used for a range of different purposes.

Some examples of control bytes are,

Code Meaning
SYN Synchronize character, it establishes and maintains character synchronization prior to a message block and during transmission. Also used as a fill when there is no messages to be sent
STX Start of Text, transmitted before the first data characters. Signifies that a block of data bytes follows.
ETX End of Text, terminates a data block begun with SOH or STX and terminates the end of a sequence of blocks. The receiver will then send ACK or NACK depending upon the correct receipt of the message blocks.
EOT End of Transmission, this concludes the transmission.
ACK Positive Acknowledge, this is sent by the receiver to indicate successful receipt of the previous message block, or as a successful response to a selection (multipoint) or line bid (point to point).
NAK Negative Acknowledge, this is sent by the receiver to indicate the unsuccessful receipt of the previous message block. It is also used to indicate a negative response to a selection or line bid.
SOH Start of Header, transmitted before header characters, which specify routing or priority information for the message.
ETB End of Transmission Block, indicates the end of the text block which started with STX or SOH. The receiver will then send ACK or NACK depending upon the correct receipt of the message blocks.

Binary Synchronous Message Blocks
Messages are sent in blocks. Message blocks have the following format,

Synchronous message blocks

Each message block can contain up to three parts,

The control characters used to identify these parts are,

SYN characters are used to establish synchronization between the sender and receiver. The message block follows the SYN characters.

A long message is split up into a number of small message blocks by the sender. The trailer for each block consists of a block check character (BCC). As the message block is transmitted, both the sender and receiver each generate their own BCC. At the end of receiving the trailer, the receiver compares its own BCC against that of the senders. If they are the same, this indicates the block has been successfully received without errors, so the receiver will reply using a positive acknowledge (ACK). If the BCC of the receiver does not match that of the sender, the receiver knows an error has occurred during transmission, and will instruct the sender to re-send the block by replying with a negative acknowledge (NACK).

Use of BCC

A preset number of repeated attempts to re-transmit a corrupted message block (upon receiving a NACK) will be made before the sender will abort the transmission.

There is one major problem associated with this protocol. Consider the sending of a binary file, which has not only text, but also contains values which would be interpreted as control codes. What happens if a control character such as ETX occurs in the text field? The receiver would interpret this as the end of the text field and take the next character as the BCC. This is incorrect.

To prevent this problem and allow any characters to appear in the data field (say to transmit a binary file), data transparency is used. This means preceding each control character with the Data Link Escape control character (DLE). If the receiver gets a DLE code, it knows the next byte is a control code. The DLE control character is discarded by the receiver.

What happens if the sender has a DLE code as part of the text block? In this case the sender precedes it with a DLE, and the receiver discards the first and uses the second as a data byte.


Summary
Binary synchronous is a well established protocol and has been around for a number of years. It uses characters to convey both data and control information.

It provides error checking by the inclusion of a Block Check Character, and has the ability to send binary files.


© Copyright B Brown. 1995-2000. All rights reserved.