The link control protocol (LCP) frames are transmitted during the link establishment and termination phases, and periodically during the life of the link. They are used to negotiate the configuration of the PPP link, and to test and maintain the link, once it is established. LCP frames have the general form shown in Figure A-3.
The address field is one octet in length, and is part of the HDLC-like framing for PPP. It is always set to 0xff.
The control field is one octet in length, and is part of the HDLC-like framing for PPP. It is always set to 0x03.
The protocol id identifies the type of information contained in the information field of the frame, and is always 0xc021 for LCP frames.
The code field is one octet in length and identifies the type of LCP frame, based on the following codes:
0x01 Configure-request 0x07 Code-reject
0x02 Configure-ack 0x08 Protocol-reject
0x03 Configure-nak 0x09 Echo-request
0x04 Configure-reject 0x0a Echo-reply
0x05 Terminate-request 0x0b Discard-request
0x06 Terminate-ack
The id field is one octet in length, and carries an identifier that is used to match associated requests and replies.
The length field is two octets in length, and indicates the total length of the LCP frame including the Code, Id, length, and data fields. The length must not exceed the maximum receive unit (MRU).
The data field is zero or more octets in length, as indicated by the length field. It contains the information associated with the frame, which may be configuration options, frame information, or simple data.
In some cases, the data field includes a magic number, which is four octets in length, and which is used to detect a looped-back condition and other link level anomalies. The magic number is a negotiated parameter, and is set to zero by default. When set, it contains a unique, randomly-generated sequence of digits that identifies the initial source of the frame. If two frames of the same type with the same magic number are received, there is a high probability that the link is looped back, and that the second frame is a reflection of the original.
Link configuration frames are transmitted during the link establishment phase. The data field of a link configuration frame carries information used to negotiate the configuration options for the link. The Link configuration frames are:
Configure-request
Code 0x01. Request the establishment of a link with a particular configuration. Represents the start of the link establishment phase. Terminate-request frames are transmitted periodically until either a valid response is received, or the number of frames sent exceeds the value of the lcp_max_restart parameter in the file ppp.conf.
Configure-ack
C ode 0x02. Acknowledge the receipt of a recognizable Configure-request frame, and accept the requested configuration. Represents the end of the link establishment phase.
Configure-nak
Code 0x03. Acknowledge the receipt of a recognizable Configure-request frame, but reject some or all of the requested configuration.
Configure-reject
Code 0x03. Reject a Configure-request frame because it is not recognizable or because the requested configuration is not acceptable.
Link termination frames are transmitted during the link termination phase. The link termination frames are:
Terminate-request
Code 0x05. Request the termination of a link. Represents the start of the link termination phase.
Terminate-ack
Code 0x06. Acknowledge the receipt of a recognizable Terminate-request frame, and accept the termination request. Represents the end of the link termination phase.
Link maintenance frames are transmitted periodically to test and maintain the link. The link termination frames are:
Code-reject
Code 0x07. Rejects an LCP frame that has an invalid code field.
Protocol-reject
Code 0x08. Rejects a PPP frame that has an invalid protocol id.
Echo-request
Code 0x09. Requests a response, in the form of an Echo-reply frame, from the remote end-point. Used to test that the link is still up.
Echo-reply
Code 0x10. Responds to a valid Echo-request frame. Used to test that the link is still up.
Discard-request
Code 0x11. Sends a frame which is silently discarded at the remote endpoint. Used as a debugging mechanism.