Titel:

Realible Asynchronous Transfer Protocol

Startseite
Artikelliste
english
  
ISBN: 3423050012   ISBN: 3423050012   ISBN: 3423050012   ISBN: 3423050012 
 
|<< Anfang     < Zurück     Index     Weiter >     Ende >>|
  Wir empfehlen:       
 

6.8. Packets that are too Small

Assume that a packet has passed its header checksum test but some of the data octets have been dropped by the link. In such a case the receiver's routine which reads data and builds packets is expecting octets which do not arrive. After SRTT the sender will retransmit this packet to the receiver. The receiver will now have enough data to complete the packet. Almost certainly however it will fail the data checksum test. As with any bad packet the receiver will rescan from the octet immediately following the SYNCH pattern for the next SYNCH pattern. In this manner the receiver will eventually see the SYNCH pattern of the retransmitted packet.

I. Inability to Transmit/Receive 8-bit Data

There are some older operating systems and devices which do not permit 8-bit communication over an RS-232 link. Most of these allow restricted 7-bit communication. Where this is an unavoidable problem both ends of the connection must have a protocol layer beneath this protocol. This lower layer will unpack packets it sends over the RS-232 link. It will also repack packets it receives over the RS-232 link. RATP will automatically determine whether or not full 8-bit or restricted 7-bit communication is being used (see below).

The strategy chosen for restricted 7-bit communication is called 4/8 packing. That is, each octet to be sent will be broken up into two 4-bit nibbles. The order of transmission is the high order four bits followed by the low order bits. Each octet to be received will be repacked by the inverse function. The high order nibble will be received first then the low order nibble. These two nibbles will be reassembled into an octet.

I.1. Encoding for Transmission

For those systems which are incapable of 8-bit data transmission over RS-232 links, there are operating systems which in addition place special restrictions on the non-printable ASCII characters. The encoding for 4/8 packing should restrict itself to transmitting data only in the printable 7-bit ASCII range.

I.2. Framing an Octet

The seventh and highest order bit of a transmitted 7-bit ASCII byte is a flag used to indicate whether the high or low order nibble of an octet is contained in this character. This flag bit if set implies that a new octet is being received and that this printable ASCII character contains the high order nibble of an octet in its four low order bits. In addition it implies the next ASCII character received should not have its highest order bit set.

This high order flag bit is set by adding the ASCII character "@" (octal 100) to a data byte. Thus the first nibble of an octet is always transmitted with "@" added to its value. The high order nibble will be transformed into the characters "@" through letter "O".

The lower order nibble of an octet is transmitted with zero "0" added to its value. The low order nibble will be transformed into

characters "0" through "?". When receiving 4/8 packed data, any characters not within the range "0" through letter "O" are discarded.

The octet whose octal value is 45 will be transmitted as two 7-bit printable ASCII characters:

+-------------+
High order |1|0|0|0|1|0|0| First transmitted ("@" + data) = D
+-------------+
Low order |0|1|1|0|1|0|1| Second transmitted ("0" + data) = 5
+-------------+


Since data bytes may be dropped or added at any time it is important to know always which portion of an octet is expected and to deliver only complete octets to the higher protocol level. If a single 7-bit character were completely dropped without being noticed the data stream delivered to the higher level could be shifted by an odd multiple of four bits. In the worst case this condition could remain indefinitely and the higher level would never receive an octet correctly. In such a case no packets would be correctly received, leading to an unusable connection.

To avoid this problem octets are assembled using a state machine driven by the presence of the high order flag bit. The presence of that bit in the 7-bit printable character indicates the beginning of a new octet. The two state machine which assembles octets is described below. A byte received with the high order flag bit set is called "HIGH", the byte without "LOW".

State 0

[Start state] Read a byte from the legal restricted set. This is determined by seeing if the byte is in the legal range "@" to the letter "O". If it was not discard the byte and return to this state.

A HIGH byte was read. Place the four low order bits of the byte into the four high order bits of the assembled octet and go to state 1. Otherwise discard the byte and return to this state.

State 1

Read a byte from the legal restricted set. This is determined by seeing if the byte is in the legal range zero "0" to the letter "O". If it was not discard the byte and return to this state.

If a LOW byte was read subtract zero "0" from the byte placing the four low order bits of the result into the four low order bits of the assembled octet. A full octet has now been assembled. Pass the octet to the higher level and go to state 0.

Otherwise a HIGH byte was read. Place the four low order bits of the byte into the four high order bits of the assembled octet and return to this state.

Utilizing this state machine to receive 4/8 packed data ensures that the data stream delivered to the higher level will not permanently remain shifted an odd multiple of four bits. The restriction placed upon bytes read removes obviously bad data and in some cases would handle uncontrolled padding or blocking insertion.

I.3. Automatic Detection of 8-bit or 4/8 Packed Data

It is an unavoidable problem that some machines cannot handle unrestricted 8-bit data. Since this is given, it is desirable to be able to automatically detect whether unrestricted 8-bit or restricted 4/8 packing is being used to transmit data on a connection. For the purposes of this discussion those machines capable of transmitting and receiving both unrestricted 8-bit and 4/8 packed data are called smart. Machines are called dumb if they can only transmit and receive 4/8 packed data.

When initiating a connection there are four possible machine configurations and they are:

1. A (smart) opens a connection to B (smart).

2. A (dumb) opens a connection to B (smart).

3. A (dumb) opens a connection to B (dumb).

4. A (smart) opens a connection to B (dumb).

Each case is examined and extensions to the behavior for the LISTEN and SYN-SENT states are provided which allow both types of machines to initiate or receive a connection.

Cases 1 and 2: LISTEN Behavior for a Smart Machine

In these cases machine A initiates a connection to B who is assumed to be in the LISTEN state. B must be able to passively detect whether 8-bit or 4/8 packing is being used and respond accordingly. The method B uses relies upon the detection of a valid first packet. In the LISTEN state B attempts to simultaneously treat the incoming data as if it were both unrestricted 8-bit and 4/8 packed.

The incoming data is in effect fed to two different receiving algorithms. The detection of a valid header will occur to one of these algorithms before the other. If the first valid header was read assuming unrestricted 8-bit data then any resulting connection is assumed to use unrestricted 8-bit data for the life of the connection. If the first valid header assumed 4/8 packing then the resulting connection is assumed to use 4/8 packing for the life of the connection. In the case of the detection of illegal condition in the LISTEN state the protocol will reply with a RST packet in kind.

Case 3: LISTEN Behavior for a Dumb Machine

In this case machine B is the recipient of a connection request and is capable of handling only 4/8 packed data. The LISTEN behavior for machine B assumes that all connections are 4/8 packed. It never deals with unrestricted 8-bit data. As a result it will refuse to open a connection request from a smart machine (see case 4 below).

Case 4: SYN-SENT Behavior for a Smart Machine

In this case machine A attempts to open a connection to machine B. However, A has no knowledge of B's capabilities. A will send its connection request assuming B is smart using unrestricted 8-bit transmission. It will await a reply assuming the response will be unrestricted 8-bit also. If B is in fact dumb it will not return a SYN-ACK because of the restriction imposed by case 3 above. If no connection is made with B using 8-bit data the entire connection initiation is restarted assuming B is dumb, 4/8 packing is used and the response is assumed to be 4/8 packed as well.

The cost of this approach is a longer time to determine whether or not it is possible to open a connection to B. It is twice as long. The advantages of being able to automatically adjust to either unrestricted 8-bit or 4/8 packed data out weigh this disadvantage. RATP will not exhibit the schizophrenic behavior of many other asynchronous protocols when dealing with both classes of machines.

  
Bürgerliches Gesetzbuch BGB
von Helmut Köhler
Siehe auch:
Handelsgesetzbuch HGB: ohne Seehandelsrech...
Arbeitsgesetze
Grundgesetz GG: Menschenrechtskonvention, Europäischer Gerichtsh...
Strafgesetzbuch StGB
Aktiengesetz · GmbH-Gesetz: mit Umwandlungsgesetz, Wertpapiererw...
Zivilprozeßordnung. ZPO
 
   
 
     
|<< Anfang     < Zurück     Index     Weiter >     Ende >>| 

Zurück zur Themenseite:
ScientificPublication.com/Startseite/Informatik/Spezifikationen

Das Setzen von Verweisen (Links) auf diese Seite ist gestattet und bedarf keine vorherige Absprache.

Artikelliste:
Realible Asynchronous Transfer Protocol
   
  Startseite  |  english  |  Bookmark setzen  |  Webseite weiterempfehlen  |  Impressum