Fred R. Goldstein k1io 25 October 1988 Preface This is a draft description of a potential protocol for providing the Data Link Layer service to packet radio networks in the Amateur Radio Service. This draft presumes a familiarity with the AX.25 protocol adopted by the American Radio Relay League. Actual implementation is not suggested at this time. Intended audience: Amateur packet radio operators. This draft is leading towards an "ARFC". The A802 Metropolitan Area Network Protocol for Amateur Packet Radio I. Introduction Amateur Packet Radio has been practically synonymous with the AX.25 protocol since the early 1980s. While AX.25 has allowed packet operation to become quite popular, it has not proven to be fully sufficient for the task. Instead, it has created a minor industry in Terminal Node Controllers, which have isolated their users, and their computers, from the protocols themselves. A totally different protocol can take the place of AX.25, especially when used with more sophisticated upper layers such as TCP/IP. A candidate for such a protocol can be loosely based upon Local Area Networks which operate over shared cable; A802 takes such an approach. I.1. AX.25 is itself a misnomer AX.25 takes its name from Recommendation X.25 of the CCITT, the international consultative body that makes standards for telephone networks. X.25 itself is a definition for a standard interface into packet switched networks. It defines, in detail, two different layers of software. Layer 2 (or Level 2, in X.25's original terminology) is the Data Link layer, responsible for ensuring error- free transmission between adjacent entities. Layer 3 is the Network layer (originally the Packet layer) which operates across the boundaries of the network, establishing virtual circuits (connections) between users. (Layer 1, the Physical Link layer, simply transfers bits across a data connector, like the widely used RS-232 interface. Modem standards fall within the bounds of Layer 1, but are not part of X.25. Packet radio standards for Layer 1 are only partially covered within this document.) X.25's Data Link layer uses a protocol called LAP-B (Link Access Protocol - Balanced). This has been adapted, with much change, into AX.25. While X.25's network layer has been implemented in some connection-oriented networks, it is not part of AX.25. So the name AX.25 is really a misnomer; it is simply a much modified LAP-B. Like LAP-B, AX.25 is a member of the HDLC (High Level Data Link Control) family of protocols. HDLC frames (which is the correct term for packets at Layer 2) begin and end with a flag character, and allow data transparency by a bit insertion (stuffing) procedure. The last two bytes of the frame are the checksum, or cyclic redundancy check (CRC). Bit stuffing (and removal, on receive) is easily accomplished with specialized hardware, but next to impossible using standard personal computer modem interfaces. Hence the need for a TNC with its HDLC chip. While X.25 is widely used, it really has little in common with packet radio. For one thing, X.25 networks run over point to point wire lines. And LAP-B doesn't worry about addressing (there are only two stations on the wire, one at each end); lengthy address strings were added to create AX.25. II. The data link, the LAN and the MAN Packet radio operators know that their networks are not derived from X.25 wireline networks, as packet networks are often called Local Area Networks (LANs). This is not strictly accurate, since a LAN operates only within a building or campus, but packet radio MANs (metropolitan area networks) are still a lot more like LANs than like X.25 links. LAN protocols don't exactly follow the same layered model as X.25 or LAP-B, either: They don't strictly map into the traditional Layer 1 and Layer 2. The most widely used LAN standards are defined by IEEE committee 802, and include 802.3 (based on Ethernet), 802.4 (token bus) and 802.5 (token ring). Since token-passing has not been successfully demonstrated on packet radio, 802.3 comes closest to modeling radio. Indeed, the name "Ethernet" was coined by its inventors who noted that the coaxial cable was a broadcast medium not entirely unlike radio. Alas, it is also quite different from radio: Not only does it run much faster, but it is virtually lossless. II.1 LAN layers The lowest layer in a LAN, roughly within the physical link layer, is called the Physical Medium Dependent (PMD) layer. This, of course, differs greately between the different types of 802 LANs. The PMD layer is concerned with how bits are transmitted. The next layer up is the Medium Access Control (MAC) layer; this is where the stations on the LAN address each other, and determine when they can transmit. Finally, the Logical Link Control (LLC) layer provides the same types of services as a Data Link layer. There are two LLCs defined in IEEE 802.2; LLC1 provides a datagram service (like UI frames), while LLC2 provides a virtual circuit service (like I frames). LLC2 procedures (the types of frames and how they interact) are very close to LAP-B. II.2 The A802 protocols The LAN protocols found in IEEE 802 provide a model for packet radio. For the sake of discussion, these are herein called "A802"; the IEEE 802 protocols are merely an inspiration, but provide a model, just as X.25's Layer 2 provided a model for AX.25. A802 starts with a different premise than AX.25. It does not use HDLC, so there is no bit stuffing, and ordinary PC asynchronous communications hardware can be used. It also pays a bit less attention to terseness -- LAP-B headers cram a lot into a few bytes, but lack flexibility. As a further note, A802 can be run in either asynchronous or synchronous mode -- a low-end implementation can be sent using a standard asynchronous modem port, and monitored without special hardware. However, net throughput will be higher if synchronous transmission is used, and the two modes are not compatible. Thus any given transmission channel must be either synchronous or asynchronous or some stations will not be able to contact others. II.3 The A802 frame structure An A802 frame takes the following format: Frame { Sync_characters Literal "^V"s Mandatory MAC_header Structure Mandatory LLC_header Structure Mandatory Data String Optional Frame_checksum 2 bytes Mandatory } The sync_character is not part of the A802 frame itself, but is always transmitted at least twice before every frame. It has the literal decimal value of 22, or control-V; its purpose is to allow the receiving modem to establish synchronization. In synchronous mode, it establishes both byte and frame synchronization; in asynchronous mode, it only establishes frame sychronization. Note that HDLC protocols such as AX.25 can send any number of flag characters between frames; IEEE 802.3 precedes each frame with a stream of alternating 1 and 0 bits for synchronization. The A802 "header" consists of two separate sub-layers. The MAC sublayer provides addressing functions, while the LLC sublayer provides both connection-oriented and connectionless options. AX.25's basic functions are still provided, including support for digipeating. II.4 The MAC layer The Medium Access Control layer allows stations to address frames to one another. It is possible for a connection-oriented protocol to have a very small address field; instead of putting a full address (typically here, a call sign) in each frame, a data link control indicator (DLCI) refers to a previously-created connection. This has been done in the pioneering VADGC (Vancouver) packet radio protocols, and is done in both LAP-D (the ISDN follow-on to LAP-B) and X.25's Network Layer, which are connection-oriented. Like AX.25, however, A802 puts the source and destination addresses in every frame, allowing them to be handled as datagrams. A802 also supports digipeating. The fundamental components of a MAC header are the sender's and receiver's addresses. For example, Ethernet (and its follow-on IEEE 802.3) have a 48-bit address, so 96 bits of the MAC header are taken up by addressing. But digipeating makes life more complicated! Digipeating is more precisely referred to as source routed MAC relay: Source routed because the path is specified by the source of the packet, and MAC relay because the frame is simply relayed by the intermediate stations without looking at layers above MAC. (Source routing is supported in IEEE 802.5, the token ring LAN.) The MAC header can be described as MAC_header { Hop_pointer Integer (Mandatory) Destination_address Structure (Mandatory) Intermediate_address_1..7 Structure (Optional) Source_address Structure (Mandatory) Protocol_discriminator Alpha (Mandatory) } II.4.1 Addresses Each address field typically contains a call sign. In a simple two- station connection, the sender of the packet puts its call sign in the Source_address field and puts the other station's call in the Destination_address field. Secondary station IDs can be appended to the callsigns, as can portable identifiers, as the address is not constrained to 8 bytes (unlike AX.25 Version 2.0). II.4.2 Source routing Digipeating is accomodated via the Intermediate_addresses and the hop_pointer. The hop_pointer indicates which of the addresses (destination or intermediate) the frame is being directed to. In a two-station (no digipeater) packet, the Hop_pointer always has a value of 1. If there is one digipeater, then it begins with a value of 2; this means that the receiver recognizes the packet as its own when its own address is in the Intermediate_address_1 position. Likewise, if there are two digipeaters, the first digipeater increments the hop_pointer to 3 so that the second digipeater recognizes its address in the intermediate_address_2 position. And the last digipeater sets the hop_pointer to 1, the position of the destination address. A multicast or broadcast frame is sent with the hop_pointer set to 0. Thus the hop_pointer can have any value from 0 to 8. The hop_pointer is designed to reduce the processing load on receivers; they only have to listen to see if the pointed-to address is their own, and if it is not, then the frame can be ignore. The most common value will be 1; when this occurs, receiving stations may ignore subsequent addresses. (Conversely, when a frame has a hop_pointer value of 8, then every digipeater that hears it must wait until Intermediate_address_8 is sent. This is, of course, a degenerate case, as it is highly unlikely that a chain of 8 digipeaters will work! For identification purposes, the sender (as contrasted with the originator) of each transmitted frame is identified by determining the previous hop in the source routing chain. II.4.3 The protocol discriminator One final field in the MAC header is the protocol discriminator. This allows the upper layers to know what type of protocol the A802 frame is carrying in its data field. It should be noted that in the current Open Systems Interconnection Reference Model, protocol discriminators are taboo -- different protocols at the same node should be distinguished by different addresses. But AX.25 uses a protocol discriminator, Ethernet (pre-802) uses a protocol discriminator, and most TCP/IP users have grown to expect a protocol discriminator. So A802 has one too. (This does not rule out using distinctive addresses, if one chooses to do so.) The protocol discriminator is a single upper-case letter (A-Z). Tentatively values are as follows: Letter Protocol type I IP (as in TCP/IP) R ARP (Address Resolution Protocol) X X.25 Packet layer or OSI CONS (ISO 8208) O OSI Internet Protocol (ISO 8473) T Plain text Other values will be assigned as required. II.4.4. Parsing the MAC header Since some of the header fields are of variable length, they must be separated from one another. There are several techniques that could be used for this. LAP-B uses only fixed-length fields, while AX.25 uses fixed-length addresses with a bit set to indicate whether or not each has already been digipeated and another set to indicate which address is the last. Some protocols (notably those used in Open Systems Interconnection, the OSI program of the International Organization for Standardization) use a tag-length-value technique, which is very flexible but frequently takes at least 3 octets to do anything. A802 is a bit more like natural language -- it relies on taking each byte's values in context. Individual fields can only have certain values, so they end when a separator character, or one which cannot be part of that field, occurs. In A802, the MAC header is encoded using printable ASCII characters. The first octet of the MAC header is always a numeral, in the range 0-9 (although value 9 is presently reserved). This hop_pointer is followed by the destination_address. This can contain the characters A-Z, 0-9, plus the hyphen "-" and slash "/". The secondary station ID field, an AX.25 artifact whose value can be 0 through 15, can further be encoded using one ASCII character representing a hexadecimal digit, in the ranges 0-9 plus a-f, immediately following the call sign. Or a hyphen can be used, noting that K1IO-10 and K1IOa are two different addresses, though both represent the same ss_id. (Should these be equated? This requires further study.) Terse format (K1IO3) is recommended. Intermediate_address fields are optional, inserted only as required. Each one begins with the ASCII character "v", and then encodes call sign the same way as the destination_address. The source_address field, using the same encoding technique, is preceded by the ASCII character "<" (less than, or left-pointing angle bracket). This character is equivalent to the Morse code "DE". II.4.5 Examples of MAC header addressing A packet addressed to K1IO from 4X/WB2ZJQ1 without a digipeater: 1K1IO<4X/WB2ZJQ1 A packet addressed to FG0/K1IO/FS7-3 (K1IO operating portable on St. Martin using an FG0 authorization and the informal suffix FS7, SSID 3) from KA9Q8 via digipeaters WB2ZJQ and NP4XYZ would be initiated: 2FG0/K1IO/FS7-3vWB2ZJQvNP4XYZ