RFC 1661¬†describes PPP in detail. PPP provides a standard method of transporting multi-protocol datagrams over point-to-point links. PPP has three main components-
PPP links provide full-duplex simultaneous bi-directional operation and deliver packets in order. 8-bytes are required to form the encapsulation when used over HDLC (default). PPP encapsulation is shown below-
Protocol field values in the range-
a) 0000 – 3FFF identifies the network layer protocol of specific packets
Some reserved values are –
a) 0001 – Padding
Information field:¬†This field is 0 or more bytes. It contains the datagram for the protocol specified in Protocol field. The maximum length of the Information field, including Padding but excluding Protocol field, is called¬†MRU Maximum Receive Unit, 1500 bytes by default.
Routers R1 & R2 are connected via point-to-point link. The default link-layer protocol is HDLC. To change link-layer encapsulation to PPP, useencapsulation ppp¬†command.
PPP Link Operation:
Each PPP link peer send LCP packets over point-to-point link to configure and test data-link layer. After the link has been established, the peer can be authenticated.
Then PPP send NCP packets to choose & configure one or more network-layer protocols. Once each of the chosen network-layer protocols has been configured, datagrams from each network-layer protocol can be sent over the link.
The link remains available until explicit LCP or NCP packets close the link down or manually shutdown.
A PPP link goes through various phases in the process of configuring, maintaining & terminating the link. The Phase diagram is as shown below-
The different phases of PPP are- DOWN, ESTABLISHING, AUTHENTICATING, UP & TERMINATING.
Initially, when there are no PPP peers, the PPP state is DOWN. PPP transitions to ESTABLISHING state when the physical layer is up and ready to be used. LCP negotiation occurs in this phase. Authentication is optional, so if authentication is configured, PPP transitions to AUTHENTICATING phase and if authentication is successful, PPP transitions to UP phase. PPP shuts down in TERMINATING phase.
1. Physical-layer not ready (Link Dead):
The link begins and ends with this phase. When an event (like Carrier Detection) indicates that physical-layer is ready, PPP will proceed towards Link Establishment Phase.
2. Link Establishment Phase (mandatory):
The LCP (Link Control Protocol) is used to establish a connection. There are three classes of LCP packets-
a) The Link Configuration Packets used to establish & configure a link¬†(Configure-Request, Configure-Ack, Configure-NAK & Configure-Reject).
b) Link Termination packets used to terminate a link¬†(Terminate-Request & Terminate-Ack).
c) Link Maintenance packets used to manage & debug a link¬†(Code-Reject, Protocol-Reject, Echo-Request, Echo-Reply and Discard-Request).
To establish a connection, LCP exchanges Configure packets. Once a Configure-Ack (CONFACK) packet has been sent and received, the exchange is complete and LCP Open state is entered. An LCP Configure-Request received during Authentication or NCP phase causes to return to Link Establishment phase.
debug ppp negotiation
01:47:11.095: Se1/0 LCP: State is Listen
3) Authentication phase (optional):
Authentication is optional in PPP. If PAP or CHAP is configured, PPP enters AUTHENTICATING phase.
4) NCP phase (mandatory):
Once LCP state is Open and link is established, PPP sends NCP packets to choose and configure one or more network-layer protocols (like IP, IPX, AppleTalk, etc). The most common Layer-3 protocol negotiated is IP. The routers exchange¬†IP Control Packets (IPCP)¬†to negotiate options specific to IP.¬†RFC 1332¬†discusses more about IPCP.
IPCP is responsible for configuring, enabling and disabling IP protocol modules on both ends of point-to-point link. IPCP uses same exchange mechanism as LCP. IPCP packets received before reaching NCP phase are silently discarded.¬†IPCP negotiates two options:¬†IP Address¬†&¬†Compression method.
NCP: debug ppp negotiation
If¬†CDP¬†is enabled, CDP negotiation also occurs in NCP phase. To disable CDP, use¬†no cdp run¬†command.
CDP negotiation in NCP phase
5) Install route:
When the router finishes NCP phase successfully, it must¬†install the given IP address of the remote PPP peer¬†in the routing table and can be seen as¬†connected route¬†in the routing table.
Install route of remote PPP peer
NOTE:¬†If the route cannot be seen in the routing table, verify that¬†no peer neighbor-route¬†command is not configured on the router.
ECHOREQ (Echo Request) and ECHOREP (Echo Reply):
PPP uses keepalives to check the availability of the link. These keepalives are Echo Request packets sent by a PPP speaker (by default, once every 10 seconds) to remote PPP peer which replies with Echo Reply packets. By default, if five Echo Request packets are not replied, PPP considers the link down and transitions to DOWN state.
ECHOREQ & ECHOREP