3. The Data Link Layer
PPP uses the principles, terminology, and frame structure of the International Organization For Standardization's (ISO) 3309-1979
High-level Data Link Control (HDLC) frame structure [2], as modified by "Addendum 1: Start/stop transmission" [3], which specifies modifications to allow HDLC use in asynchronous environments.
The PPP control procedures use the definitions and Control field encodings standardized in ISO 4335-1979 [4] and ISO 4335-1979/Addendum 1-1979 [5]. PPP framing is also consistent with CCITT Recommendation X.25 LAPB [6], and CCITT Recommendation Q.922 [7], since those are also based on HDLC.
The purpose of this specification is not to document what is already standardized in ISO 3309. It is assumed that the reader is already familiar with HDLC, or has access to a copy of [2] or [6]. Instead, this document attempts to give a concise summary and point out specific options and features used by PPP.
To remain consistent with standard Internet practice, and avoid confusion for people used to reading RFCs, all binary numbers in the following descriptions are in Most Significant Bit to Least Significant Bit order, reading from left to right, unless otherwise indicated. Note that this is contrary to standard ISO and CCITT practice which orders bits as transmitted (network bit order). Keep this in mind when comparing this document with the international standards documents.
3.1 Frame Format
A summary of the PPP HDLC frame structure is shown below. This figure does not include start/stop bits (for asynchronous links), nor any bits or octets inserted for transparency. The fields are transmitted from left to right.
+----------+----------+----------+
| Flag | Address | Control |
| 01111110 | 11111111 | 00000011 |
+----------+----------+----------+
+----------+-------------+---------+
| Protocol | Information | Padding |
| 16 bits | * | * |
+----------+-------------+---------+
+----------+----------+------------------+
| FCS | Flag | Inter-frame Fill |
| 16 bits | 01111110 | or next Address |
+----------+----------+------------------+
The Protocol, Information and Padding fields are described in the Point-to-Point Protocol Encapsulation [1].
Flag Sequence
The Flag Sequence indicates the beginning or end of a frame, and always consists of the binary sequence 01111110 (hexadecimal 0x7e).
The Flag Sequence is a frame separator. Only one Flag Sequence is required between two frames. Two consecutive Flag Sequences constitute an empty frame, which is ignored, and not counted as a FCS error.
Address Field
The Address field is a single octet and contains the binary sequence 11111111 (hexadecimal 0xff), the All-Stations address. PPP does not assign individual station addresses. The All-Stations address MUST always be recognized and received. The use of other address lengths and values may be defined at a later time, or by prior agreement. Frames with unrecognized Addresses SHOULD be silently discarded.
Control Field
The Control field is a single octet and contains the binary sequence 00000011 (hexadecimal 0x03), the Unnumbered Information (UI) command with the P/F bit set to zero. The use of other Control field values may be defined at a later time, or by prior agreement. Frames with unrecognized Control field values SHOULD be silently discarded.
Frame Check Sequence (FCS) Field
The Frame Check Sequence field is normally 16 bits (two octets). The use of other FCS lengths may be defined at a later time, or by prior agreement. The FCS is transmitted with the coefficient of the highest term first.
The FCS field is calculated over all bits of the Address, Control, Protocol, Information and Padding fields, not including any start and stop bits (asynchronous) nor any bits (synchronous) or octets (asynchronous or synchronous) inserted for transparency. This also does not include the Flag Sequences nor the FCS field itself.
Note: When octets are received which are flagged in the Async-Control-Character-Map, they are discarded before calculating the FCS.
For more information on the specification of the FCS, see ISO
3309 [2] or CCITT X.25 [6].
The end of the Information and Padding fields is found by locating the closing Flag Sequence and removing the Frame Check Sequence field.
3.2. Modification of the Basic Frame
The Link Control Protocol can negotiate modifications to the basic HDLC frame structure. However, modified frames will always be clearly distinguishable from standard frames.
Address-and-Control-Field-Compression
When using the default HDLC framing, the Address and Control fields contain the hexadecimal values 0xff and 0x03 respectively.
On transmission, compressed Address and Control fields are formed by simply omitting them.
On reception, the Address and Control fields are decompressed by examining the first two octets. If they contain the values 0xff and 0x03, they are assumed to be the Address and Control fields. If not, it is assumed that the fields were compressed and were not transmitted.
By definition, the first octet of a two octet Protocol field will never be 0xff (since it is not even). The Protocol field value 0x00ff is not allowed (reserved) to avoid ambiguity when Protocol-Field-Compression is enabled and the first Information field octet is 0x03.
When other Address or Control field values are in use, Address-and-Control-Field-Compression MUST NOT be negotiated.