How PPP Works
PPP is essentially an assortment of protocols that work together to supply a full complement of serial-based networking features.
The PPP standard at present is RFC 1661, which divides the components of PPP into three general categories:
- A method for encapsulating multi-protocol datagrams, PPP can support datagrams from more than one protocol system.
- A Link Control Protocol (LCP) for establishing, configuring, and testing the connection. PPP negotiates configuration settings
and thus eliminates compatibility problems.
- A family of Network Control Protocols (NCPs) supporting upper-layer protocol systems. PPP can include separate sub-layers that
provide separate interfaces to TCP/IP.
The following sections discuss these components of PPP.
PPP Data
The primary purpose of PPP is to forward datagrams, which could be of more than one protocol type. For example an IP or another OSI
network layer datagram. PPP must also forward data relevant to the protocols that establish and manage the serial/modem connection.
Devices exchange several types of messages and requests during a PPP connection. These are: LCP packets, used to establish, manage,
and close the connection; authentication packets, which support PPP's optional authentication protocols; and NCP packets, which
interface PPP with various protocol stacks.
The LCP data exchanged at the beginning of the connection configures the common connection parameters. NCP protocols then configure
network protocol-specific parameters that are supported by the PPP connection.
PPP Connections
A PPP connection is established as follows:
A connection is established and the LCP negotiation process starts.
If this negotiation process specifies that authentication should take place, the communicating devices enter an authentication phase,
which is managed by the Password Authentication Protocol (PAP).
PPP then uses NCP packets to specify protocol-specific configuration information for the supported protocol stacks. For example IPCP for TCP/IP.
PPP then transmits datagrams received from upper-layer protocols.
The PPP connection is closed using LCP termination packets.
Link Control Protocol (LCP)
Much of the versatility of the PPP protocol comes from the internal LCP functions that establish, manage, and terminate connections. There
are three types of LCP packets:
- Link configuration packets
- Link termination packets
- Link maintenance packets
The following describes how LCP configuration packets enable the communicating devices to establish a connection. Device A sends an LCP
Configure-request packet to Device B. The configure-request packet includes a proposal for any connection parameters Device A would like
to negotiate for the connection. These parameters include the Maximum Receive Unit (MRU), which defines a maximum length for data enclosed
in a PPP frame, the authentication protocol, and the quality control protocol. The quality control protocol defines how the connection
monitors for reliable delivery, compression protocol settings, and other configuration choices.
Should Device B accept all the configuration options submitted in the Configure-Request packet, it would respond with a Configure-Ack
(Acknowledge) packet. If all configuration options transmitted with the Configure-Request are recognizable but some are not acceptable to
Device B then it would respond with a Configure-Nak (Not Acknowledged) packet. Device B then returns a list of unacceptable parameters
with alternative values. Device A then responds to the Configure-Nak with a new configuration request using adjusted values. This process
continues until all values are accepted.
If the Configure-Request packet includes unrecognizable options, Device B would return a Configure-Reject packet listing all unacceptable
options. There are other types of LCP packets as well. These assist in the overseeing of modem connections.
A code field identifies the LCP packet type. An Identifier field identifies the packet and matches up requests with acknowledgments. As
previously mentioned, LCP controls the configuration, maintenance and termination of a PPP connection. For example, the Terminate-Request
and Terminate-Ack packets are used to request and acknowledge termination of the connection. Code-Reject and Protocol-Reject reject requests
for an unknown code or protocol. Echo-Request, Echo-Reply, and Discard-Request provide maintenance, quality assurance, and troubleshooting
capabilities.