|
|||||||||||||||||||||||||||||||||||||
| ISBN: 3527704094 ISBN: 3527704094 ISBN: 3527704094 ISBN: 3527704094 | |||||||||||||||||||||||||||||||||||||
|
Wir empfehlen: | ||||||||||||||||||||||||||||||||||||
2. Packet Specification RATP transmits data over a full-duplex communication link. Data may be transmitted in both directions over the link. A stream of data is communicated by being broken up into 8-bit pieces called octets. These octets are serially accumulated to form a packet. The packet is the unit of data communicated over the link. The protocol virtually guarantees that the data transmitted at one end, if received, arrives unaltered and intact at the other end. Within an octet all eight bits contain data. All eight bits must be preserved by the link interface and associated device driver. In many operating systems this is ensured by placing the connection into RAW or BINARY data mode. During normal operation packets are transmitted and acknowledged one at a time over the link in each direction. Each packet is composed of a HEADER followed by a DATA portion. The DATA portion may be empty. NOTE: 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. RATP can automatically detect this situation during connection initiation and utilizes a special packing strategy when full 8-bit communication is not possible. This is entirely transparent to any client software. See Appendix I for a discussion of this case. 2.1. Header Format Byte No. +-------------------------------+ Header Portion of a Packet
RS-232 provides a self-clocking communications medium. The wires over which data flows are often placed in 'noisy' environments where the noise can appear as added unwanted data. For this reason the beginning of a packet is denoted by a one octet SYNCH pattern. This allows the receiver to discard noise which appears on the connection prior to the reception of a packet. The SYNCH pattern is defined to be the one octet hex 01, the ASCII Start Of Header character <SOH>. The SYNCH pattern should ideally be unlikely to occur as the result of noise. Differing modems, etc. have differing responses to noise so this is hard to achieve. The pattern chosen is thought to be a good compromise since many modems manifest noise by setting the high order bits. Situations will occur in which receiver is scanning for the beginning of a packet and a spurious SYNCH pattern is seen. To detect situations of this type a header checksum is provided (see below). 2.1.2. Control Bits The first octet following the SYNCH pattern contains a 5-bit field of control flags and two 1-bit sequence number fields. The last bit is reserved and must be zero. 2.1.2.1. SYN - Synchronize Flag Synchronize the connection. No data may be sent in a packet which has the SYN flag set. 2.1.2.2. ACK - Acknowledge Flag Acknowledge number is significant. Data may accompany a packet which has this flag set as long as neither of SYN, RST, nor FIN are also set. Once a connection has been established this is always set. 2.1.2.3. RST - Reset Flag Reset the connection. This is a method by which one end of a connection can reset the other when an anomalous condition is detected. No data may be sent in a packet which has the RST flag set. 2.1.2.4. FIN - Finishing Flag This indicates that no more data will be sent to the other end of the connection. It also indicates that no more data will be accepted. No data may be sent in a packet which has the FIN flag set. 2.1.2.5. SN - Sequence Number The Sequence Number associated with this packet. 2.1.2.6. AN - Acknowledge Number If the ACK control flag is set this is the next Sequence Number the sender of the packet is expecting to receive. 2.1.2.7. EOR - End of Record This bit is provided as an aid for higher level protocols which may need to fragment their packets. The Internet protocol for example often uses packets as large as 576 octets. A packet of such size would require fragmentation when transported using this protocol. The EOR bit if set provides information to the higher level that a record is terminated in this packet. It is for information only and is the responsibility of the higher level to set/clear it when building packets to send. The interface to the protocol must provide a method of reading/setting/clearing this bit. 2.1.2.8. SO - Single Octet One application thought to be of special importance is single character transmission --- a user communicates from the keyboard of a personal computer to another computer over an unreliable link. Since rapid interactive response is desirable it is expected that many of the characters typed will be transmitted individually. To minimize the overhead of this special case the SO control flag is provided. The SO flag has no meaning if either the SYN, RST, or FIN flags are set. Assume none of those flags are set, then if the SO flag is set it indicates that a single octet of data is contained in this packet. Since the amount of data is known to be one octet the LENGTH field is superfluous and itself contains the data octet. The data portion of the packet is not transmitted. The SO flag removes the need to transmit the data portion of the packet in this special case. Without the SO flag seven octets would be required of the packet, with it only four are needed and so transmission efficiency is improved by 40 percent. The header checksum protects the single octet of data. 2.1.3. Length The second octet following the SYNCH pattern holds length information. If the SYN bit is present this contains the maximum number of data octets the receiver is allowed to transmit in any single packet to the sender. This quantity is called the MDL. A sender may indicate his unwillingness to accept any data octets by specifying an MDL of zero. In this case presumably all the data would be moving from the sender to the receiver. Obviously if data is to be transmitted both sides of a connection cannot have an MDL of zero. If neither the SYN, RST, nor FIN flags are set this is an 8-bit field called LENGTH. In this case if the SO flag bit is set then LENGTH contains a single octet of data. Otherwise it contains the count of data octets in this packet. From zero (0) to MDL octets of data may appear in a single packet. MDL is limited to a maximum of 255. 2.1.4. Header Checksum The header checksum algorithm is the 8-bit equivalent of the 16-bit data checksum detailed below. It is built and processed in an similar manner but is eight bits wide instead of sixteen. When sending the header checksum octet is initially cleared. An 8-bit sum of the control, length, and header checksum octets is formed employing end-around carry. That sum is then complemented and stored in the header checksum octet. Upon receipt the 8-bit end-around carry sum is formed of the same three octets. If the sum is octal 377 the header is presumed to be valid. In all other cases the header is assumed to be invalid. The reasons for providing this separate protection to the header are discussed in the chapter dealing with error handling. The header checksum covers the control and data length octets. It does not include the SYNCH pattern. |
|
||||||||||||||||||||||||||||||||||||
| |<< First < Previous Index Next > Last >>| | |||||||||||||||||||||||||||||||||||||
|
Back to the topic site: ScientificPublication.com/Startseite/Informatik/Spezifikationen External Links to this site are permitted without prior consent. Publication List: Realible Asynchronous Transfer Protocol | |||||||||||||||||||||||||||||||||||||
| Home | deutsch | Set bookmark | Send a friend a link | Impressum | |||||||||||||||||||||||||||||||||||||