(Last Updated )

AX.25 Amateur Packet-Radio
Link-Layer Protocol
Version 2.2, November 1997



AX.25 Amateur Packet-Radio
Link-Layer Protocol
Version 2.0, October 1984


  • PID Table Updated November, 1997.

    2 AX.25 Link-Layer Protocol Specification

    2.1 Scope and Field of Operation

    In order to provide a mechanism for the reliable transport of data between two signaling terminals, it is necessary to define a protocol that can accept and deliver data over a variety of types of communications links. The AX.25 Link- Layer Protocol is designed to provide this service, independent of any other level that may or may not exist.

    This protocol conforms to ISO Recommendations 3309, 4335 (including DAD 1&2) and 6256 high-level data link control (HDLC) and uses some terminology found in these documents. It also conforms with ANSI X3.66, which describes ADCCP, balanced mode.

    This protocol follows, in principle, the CCITT X.25 Recommendation, with the exception of an extended address field and the addition of the Unnumbered Information (UI) frame. It also follows the principles of CCITT Recommendation Q.921 (LAPD) in the use of multiple links, distinguished by the address field, on a single shared channel.

    As defined, this protocol will work equally well in either half- or full-duplex Amateur Radio environments.

    This protocol has been designed to work equally well for direct connections between two individual amateur packet-radio stations or an individual station and a multiport controller.

    This protocol allows for the establishment of more than one link-layer connection per device, if the device is so capable.

    This protocol does not prohibit self-connections. A self-connection is considered to be when a device establishes a link to itself using its own address for both the source and destination of the frame.

    Most link-layer protocols assume that one primary (or master) device (generally called a DCE, or data circuit- terminating equipment) is connected to one or more secondary (or slave) device(s) (usually called a DTE, or data terminating equipment). This type of unbalanced operation is not practical in a shared-RF Amateur Radio environment. Instead, AX.25 assumes that both ends of the link are of the same class, thereby eliminating the two different classes of devices. The term DXE is used in this protocol specification to describe the balanced type of device found in amateur packet radio.

    2.2 Frame Structure

    Link layer packet radio transmissions are sent in small blocks of data, called frames. Each frame is made up of several smaller groups, called fields. Fig.1 shows the three basic types of frames. Note that the first bit to be transmitted is on the left side.

    First Bit Sent
    FlagAddressControlFCSFlag
    01111110112/560 Bits8 Bits16 Bits01111110
    Fig. 1A -- U and S frame construction

    First Bit Sent
    FlagAddressControlPIDInfo.FCSFlag
    01111110112/560 Bits8 Bits8 BitsN*8 Bits16 Bits01111110
    Fig. 1B -- Information frame construction

    Each field is made up of an integral number of octets (or bytes), and serves a specific function as outlined below.

    2.2.1 Flag Field

    The flag field is one octet long. Since the flag is used to delimit frames, it occurs at both the beginning and end of each frame. Two frames may share one flag, which would denote the end of the first frame, and the start of the next frame. A flag consists of a zero followed by six ones followed by another zero, or 01111110 (7E hex). As a result of bit stuffing (see 2.2.6, below), this sequence is not allowed to occur anywhere else inside a complete frame.

    2.2.2 Address Field

    The address field is used to identify both the source of the frame and its destination. In addition, the address field contains the command/response information and facilities for level 2 repeater operation.

    The encoding of the address field is described in 2.2.13.

    2.2.3 Control Field

    The control field is used to identify the type of frame being passed and control several attributes of the level 2 connection. It is one octet in length, and its encoding is discussed in 2.3.2.1, below.

    2.2.4 PID Field

    The Protocol Identifier (PID) field shall appear in information frames (I and UI) only. It identifies what kind of layer 3 protocol, if any, is in use.

    The PID itself is not included as part of the octet count of the information field. The encoding of the PID is as follows:

    HEX M      L
    S      S
    B      B
    Translation
    0x01 00000001 ISO 8208/CCITT X.25 PLP
    0x06 00000110 Compressed TCP/IP packet. Van Jacobson (RFC 1144)
    0x07 00000111 Uncompressed TCP/IP packet. Van Jacobson (RFC 1144)
    0x08 00001000 Segmentation fragment
    ** yy01yyyy AX.25 layer 3 implemented.
    ** yy10yyyy AX.25 layer 3 implemented.
    0xC3 11000011 TEXNET datagram protocol
    0xC4 11000100 Link Quality Protocol
    0xCA 11001010 Appletalk
    0xCB 11001011 Appletalk ARP
    0xCC 11001100 ARPA Internet Protocol
    0xCD 11001101 ARPA Address resolution
    0xCE 11001110 FlexNet
    0xCF 11001111 NET/ROM
    0xF0 11110000 No layer 3 protocol implemented.
    0xFF 11111111 Escape character. Next octet contains more Level 3 protocol information.

    Where:
    A y indicates all combinations used.

    Note:
    All forms of yy11yyyy and yy00yyyy other than those listed above are reserved at this time for future level 3 protocols. The assignment of these formats is up to amateur agreement. It is recommended that the creators of level 3 protocols contact the ARRL Ad Hoc Committee on Digital Communications for suggested encodings.

    2.2.5 Information Field

    The information field is used to convey user data from one end of the link to the other. I fields are allowed in only three types of frames: the I frame, the UI frame, and the FRMR frame. The I field can be up to 256 octets long, and shall contain an integral number of octets. These constraints apply prior to the insertion of zero bits as specified in 2.2.6, below. Any information in the I field shall be passed along the link transparently, except for the zero-bit insertion (see 2.2.6) necessary to prevent flags from accidentally appearing in the I field.

    2.2.6 Bit Stuffing

    In order to assure that the flag bit sequence mentioned above doesn't appear accidentally anywhere else in a frame, the sending station shall monitor the bit sequence for a group of five or more contiguous one bits. Any time five contiguous one bits are sent the sending station shall insert a zero bit after the first one bit. During frame reception, any time five contiguous one bits are received, a zero bit immediately following five one bits shall be discarded.

    2.2.7 Frame-Check Sequence

    The frame-check sequence (FCS) is a sixteen-bit number calculated by both the sender and receiver of a frame. It is used to insure that the frame was not corrupted by the medium used to get the frame from the sender to the receiver. It shall be calculated in accordance with ISO 3309 (HDLC) Recommendations.

    2.2.8 Order of Bit Transmission

    With the exception of the FCS field, all fields of an AX.25 frame shall be sent with each octet's least-significant bit first. The FCS shall be sent most-significant bit first.

    2.2.9 Invalid Frames

    Any frame consisting of less than 136 bits (including the opening and closing flags), not bounded by opening and closing flags, or not octet aligned (an integral number of octets), shall be considered an invalid frame by the link layer. See also 2.4.4.4, below.

    2.2.10 Frame Abort

    If a frame must be prematurely aborted, at least fifteen contiguous ones shall be sent with no bit stuffing added.

    2.2.11 Interframe Time Fill

    Whenever it is necessary for a DXE to keep its transmitter on while not actually sending frames, the time between frames should be filled with contiguous flags.

    2.2.12 Link Channel States

    Not applicable.

    2.2.13 Address-Field Encoding

    The address field of all frames shall be encoded with both the destination and source amateur call signs for the frame. Except for the Secondary Station Identifier (SSID), the address field should be made up of upper-case alpha and numeric ASCII characters only. If level 2 amateur "repeaters" are to be used, their call signs shall also be in the address field.

    The HDLC address field is extended beyond one octet by assigning the least-significant bit of each octet to be an "extension bit". The extension bit of each octet is set to zero, to indicate the next octet contains more address information, or one, to indicate this is the last octet of the HDLC address field. To make room for this extension bit, the amateur Radio call sign information is shifted one bit left.

    2.2.13.1 Nonrepeater Address-Field Encoding
    If level 2 repeaters are not being used, the address field is encoded as shown in Fig. 2. The destination address is the call sign and SSID of the amateur radio station to which the frame is addressed, while the source address contains the amateur call sign and SSID of the station that sent the frame. These call signs are the call signs of the two ends of a level 2 AX.25 link only.

    First Octet Sent
    Address Field of Frame
    Destination Address Source Address
    A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14
    Fig. 2 -- Nonrepeater Address-Field Encoding

    A1 through A14 are the fourteen octets that make up the two address subfields of the address field. The destination subaddress is seven octets long (A1 thru A7), and is sent first. This address sequence provides the receivers of frames time to check the destination address subfield to see if the frame is addressed to them while the rest of the frame is being received. The source address subfield is then sent in octets A8 through A14. Both of these subfields are encoded in the same manner, except that the last octet of the address field has the HDLC address extension bit set.

    There is an octet at the end of each address subfield that contains the Secondary Station Identifier (SSID). The SSID subfield allows an Amateur Radio operator to have more than one packet-radio station operating under the same call sign. This is useful when an amateur wants to put up a repeater in addition to a regular station, for example. The C bits (see 2.4.1.2, below) and H bit (see 2.2.13.2, below) are also contained in this octet, along with two bits which are reserved for future use.

    Fig. 3A shows a typical AX.25 frame in the nonrepeater mode of operation.

    OctetASCIIBin.DataHex Data
    Flag011111107E
    A1K1001011096
    A280111000070
    A3M100110109A
    A4M100110109A
    A5O100111109E
    A6space0100000040
    A7SSID11100000E0
    A8W10101110AE
    A9B1000010084
    A1040110010068
    A11J1001010094
    A12F100011008C
    A13I1001001092
    A14SSID0110000161
    ControlI001111103E
    PIDnone11110000F0
    FCSpart 1xxxxxxxxHH
    FCSpart 2xxxxxxxxHH
    Flag011111107E
    Bit position76543210
    Fig. 3A -- Nonrepeater AX.25 frame

    The frame shown is an I frame, not going through a level 2 repeater, from WB4JFI (SSID=0) to K8MMO (SSID=0), with no level 3 protocol. The P/F bit is set; the receive sequence number (N(R)) is 1; the send sequence number (N(S)) is 7.

    2.2.13.1.1 Destination Subfield Encoding
    Fig. 3 shows how an amateur call sign is placed in the destination address subfield, occupying octets A1 thru A7.

    OctetASCIIBin.DataHex Data
    A1W10101110AE
    A2B1000010084
    A340110100068
    A4J1001010094
    A5F100011008C
    A6I1001001092
    A7SSIDCRRSSID0
    Bit Position76543210
    Fig. 3 -- Destination Field Encoding

    Where:

    1. The top octet (A1) is the first octet sent, with bit 0 of each octet being the first bit sent, and bit 7 being the last bit sent.
    2. The first (low-order or bit 0) bit of each octet is the HDLC address extension bit, which is set to zero on all but the last octet in the address field, where it is set to one.
    3. The bits marked "r" are reserved bits. They may be used in an agreed-upon manner in individual networks. When not implemented, they should be set to one.
    4. The bit marked "C" is used as the command/response bit of an AX.25 frame, as outlined in 2.4.1.2 below.
    5. The characters of the call sign should be standard seven-bit ASCII (upper case only) placed in the leftmost seven bits of the octet to make room for the address extension bit. If the call sign contains fewer than six characters, it should be padded with ASCII spaces between the last call sign character and the SSID octet.
    6. The 0000 SSID is reserved for the first personal AX.25 station. This establishes one standard SSID for "normal" stations to use for the first station.
    2.2.13.2 Level 2 Repeater-Address Encoding
    If a frame is to go through level 2 amateur packet repeater(s), there is an additional address subfield appended to the end of the address field. This additional subfield contains the call sign(s) of the repeater(s) to be used. This allows more than one repeater to share the same RF channel. If this subfield exists, the last octet of the source subfield has its address extension bit set to zero, indicating that more address-field data follows. The repeater-address subfield is encoded in the same manner as the destination and source address subfields, except for the most-significant bit in the last octet, called the "H" bit. The H bit is used to indicate whether a frame has been repeated or not.

    In order to provide some method of indicating when a frame has been repeated, the H bit is set to zero on frames going to a repeater. The repeater will set the H bit to one when the frame is retransmitted. Stations should monitor the H bit, and discard any frames going to the repeater (uplink frames), while operating through a repeater. Fig. 4 shows how the repeater- address subfield is encoded. Fig. 4A is an example of a complete frame after being repeated.

    OctetASCIIBin.DataHex Data
    A15W10101110AE
    A16B1000010084
    A1740110100068
    A18J1001010094
    A19F100011008C
    A20I1001001092
    A21SSIDHRRSSID1
    Bit Order -->76543210
    Fig. 4 -- Repeater-address encoding
    Where:
    1. The top octet is the first octet sent, with bit 0 being sent first and bit 7 sent last of each octet.
    2. As with the source and destination address subfields discussed above, bit 0 of each octet is the HDLC address extension bit, which is set to zero on all but the last address octet, where it is set to one.
    3. The "R" bits are reserved in the same manner as in the source and destination subfields.
    4. The "H" bit is the has-been-repeated bit. It is set to zero whenever a frame has not been repeated, and set to one by the repeater when the frame has been repeated.

    OctetASCIIBin.DataHex Data
    Flag011111107E
    A1K1001011096
    A280111000070
    A3M100110109A
    A4M100110109A
    A5O100111109E
    A6space0100000040
    A7SSID11100000E0
    A8W10101110AE
    A9B1000010084
    A1040110010068
    A11J1001010094
    A12F100011008C
    A13I1001001092
    A14SSID0110000060
    A15W10101110AE
    A16B1000010084
    A1740110100068
    A18J1001010094
    A19F100011008C
    A20I1001001092
    A21SSID11100011E3
    ControlI001111103E
    PIDnone11110000F0
    FCSpart 1xxxxxxxxHH
    FCSpart 2xxxxxxxxHH
    Flag011111107E
    Bit position76543210
    Fig. 4A -- AX.25 frame in repeater mode

    The above frame is the same as Fig. 3A, except for the addition of a repeater-address subfield (WB4JFI, SSID=1). The H bit is set, indicating this is from the output of the repeater.

    2.2.13.3 Multiple Repeater Operation
    The link-layer AX.25 protocol allows operation through more than one repeater, creating a primitive frame routing mechanism. Up to eight repeaters may be used by extending the repeater-address subfield. When there is more than one repeater address, the repeater address immediately following the source address subfield will be considered the address of the first repeater of a multiple-repeater chain. As a frame progresses through a chain of repeaters, each successive repeater will set the H bit (has-been-repeated bit) in its SSID octet, indicating that the frame has been successfully repeated through it. No other changes to the frame are made (except for the necessary recalculation of the FCS). The destination station can determine the route the frame took to each it by examining the address field.

    The number of repeater addresses is variable. All but the last repeater address will have the address extension bits of all octets set to zero, as will all but the last octet (SSID octet) of the last repeater address. The last octet of the last repeater address will have the address extension bit set to one, indicating the end of the address field.

    It should be noted that various timers (see 2.4.7, below) may have to be adjusted to accommodate the additional delays encountered when a frame must pass through a multiple-repeater chain, and the return acknowledgement must travel through the same path before reaching the source device.

    It is anticipated that multiple-repeater operation is a temporary method of interconnecting stations over large distances until such time that a layer 3 protocol is in use. Once this layer 3 protocol becomes operational, repeater chaining should be phased out.

    2.3 Elements of Procedure

    2.3.1

    The elements of procedure are defined in terms of actions that occur on receipt of frames.

    2.3.2 Control-Field Formats and State Variables

    2.3.2.1 Control-Field Formats
    The control field is responsible for identifying the type of frame being sent, and is also used to convey commands and responses from one end of the link to the other in order to maintain proper link control.

    The control fields used in AX.25 use the CCITT X.25 control fields for balanced operation (LAPB), with an additional control field taken from ADCCP to allow connectionless and round- table operation.

    There are three general types of AX.25 frames. They are the Information frame (I frame), the Supervisory frame (S frame), and the Unnumbered frame (U frame). Fig. 5 shows the basic format of the control field associated with these types of frames.

    Control-Field
    Type
    Control-Field Bits
    7654 3210
    I FrameN(R)P N(S)0
    S FrameN(R)P/FSS01
    U FrameMMMP/FMM11
    Fig. 5 -- Control-field formats

    Where:

    1. Bit 0 is the first bit sent and bit 7 is the last bit sent of the control field.
    2. N(S) is the send sequence number (bit 1 is the LSB).
    3. N(R) is the receive sequence number (bit 5 is the LSB).
    4. The "S" bits are the supervisory function bits, and their encoding is discussed in 2.3.4.2.
    5. The "M" bits are the unnumbered frame modifier bits and their encoding is discussed in 2.3.4.3.
    6. The P/F bit is the Poll/Final bit. Its function is described in 2.3.3. The distinction between command and response, and therefore the distinction between P bit and F bit, is made by addressing rules discussed in 2.4.1.2.
    2.3.2.1.1 Information-Transfer Format
    All I frames have bit 0 of the control field set to zero. N(S) is the sender's send sequence number (the send sequence number of this frame). N(R) is the sender's receive sequence number (the sequence number of the next expected received frame). These numbers are described in 2.3.2.4. In addition, the P/F bit is to be used as described in 2.4.2.
    2.3.2.1.2 Supervisory Format
    Supervisory frames are denoted by having bit 0 of the control field set to one, and bit 1 of the control field set to zero. S frames provide supervisory link control such as acknowledging or requesting retransmission of I frames, and link- level window control. Since S frames do not have an information field, the sender's send variable and the receiver's receive variable are not incremented for S frames. In addition, the P/F bit is used as described in 2.4.2.
    2.3.2.1.3 Unnumbered Format
    Unnumbered frames are distinguished by having both bits 0 and 1 of the control field set to one. U frames are responsible for maintaining additional control over the link beyond what is accomplished with S frames. They are also responsible for establishing and terminating link connections. U frames also allow for the transmission and reception of information outside of the normal flow control. Some U frames may contain information and PID fields. The P/F bit is used as described in 2.4.2.
    2.3.2.2 Control-Field Parameters
    2.3.2.3 Sequence Numbers
    Every AX.25 I frame shall be assigned, modulo 8, a sequential number from 0 to 7. This will allow up to seven outstanding I frames per level 2 connection at a time.
    2.3.2.4 Frame Variables and Sequence Numbers
    2.3.2.4.1 Send State Variable V(S)
    The send state variable is a variable that is internal to the DXE and is never sent. It contains the next sequential number to be assigned to the next transmitted I frame. This variable is updated upon the transmission of each I frame.
    2.3.2.4.2 Send Sequence Number N(S)
    The send sequence number is found in the control field of all I frames. It contains the sequence number of the I frame being sent. Just prior to the transmission of the I frame, N(S) is updated to equal the send state variable.
    2.3.2.4.3 Receive State Variable V(R)
    The receive state variable is a variable that is internal to the DXE. It contains the sequence number of the next expected received I frame. This variable is updated upon the reception of an error-free I frame whose send sequence number equals the present received state variable value.
    2.3.2.4.4 Received Sequence Number N(R)
    The received sequence number is in both I and S frames. Prior to sending an I or S frame, this variable is updated to equal that of the received state variable, thus implicitly acknowledging the proper reception of all frames up to and including N(R)-1.

    2.3.3 Functions of Poll/Final (P/F) Bit

    The P/F bit is used in all types of frames. It is used in a command (poll) mode to request an immediate reply to a frame. The reply to this poll is indicated by setting the response (final) bit in the appropriate frame. Only one outstanding poll condition per direction is allowed at a time. The procedure for P/F bit operation is described in 2.4.2.

    2.3.4 Control Field Coding for Commands and Responses

    The following commands and responses, indicated by their control field encoding, are to be use by the DXE:
    2.3.4.1 Information Command Frame Control Field
    The function of the information (I) command is to transfer across a data link sequentially numbered frames containing an information field.

    The information-frame control field is encoded as shown in Fig. 6. These frames are sequentially numbered by the N(S) subfield to maintain control of their passage over the link-layer connection.

    Control Field Bits
    76543210
    N(R) P N(S) 0
    Fig. 6 -- I frame control field
    2.3.4.2 Supervisory Frame Control Field
    The supervisory frame control fields are encoded as shown in Fig. 7.

    Control Field Type Control Field Bits
    76543210
    Receive ReadyRR N(R)P/F0001
    Receive Not ReadyRNR N(R)P/F0101
    RejectR