PPP Operation

PPP contains 3 main components:

  • HDLC-like framing for transporting multiprotocol packets over point-to-point links.
  • Extensible Link Control Protocol (LCP) for establishing, configuring, and testing the data-link connection.

    The LCP functions within the data link layer and has a role in establishing, configuring, and testing the data-link connection. The LCP establishes the point-to-point link. The LCP also negotiates and sets up control options on the WAN data link, which are handled by the NCPs.

    The LCP provides automatic configuration of the interfaces at each end, including:

    • Handling varying limits on packet size
    • Detecting common misconfiguration errors
    • Terminating the link
    • Determining when a link is functioning properly or when it is failing

    After the link is established, PPP also uses the LCP to agree automatically on encapsulation formats such as authentication, compression, and error detection.

  • Family of Network Control Protocols (NCPs) for establishing and configuring different network layer protocols. PPP allows the simultaneous use of multiple network layer protocols. Some of the more common NCPs are Internet Protocol (IPv4) Control Protocol, IPv6 Control Protocol, AppleTalk Control Protocol, Novell IPX Control Protocol, Cisco Systems Control Protocol, SNA Control Protocol, and Compression Control Protocol.PPP permits multiple network layer protocols to operate on the same communications link. For every network layer protocol used, PPP uses a separate NCP. For example, IPv4 uses the IP Control Protocol (IPCP) and IPv6 uses IPv6 Control Protocol (IPv6CP).
    NCPs include functional fields containing standardized codes to indicate the network layer protocol that PPP encapsulates. Each NCP manages the specific needs required by its respective network layer protocols. The various NCP components encapsulate and negotiate options for multiple network layer protocols.

    Value (in hex) Protocol Name
    8021 Internet Protocol (IPv4) Control Protocol
    8057 Internet Protocol Version 6 (IPv6) Control Protocol
    8023 OSI Network Layer Control Protocol
    8029 Appletalk Control Protocol
    802b Novell IPX Control Protocol
    c021 Link Control Protocol
    c023 Password Authentication Protocol
    c223 Challenge Handshake Authentication Protocol

Advantages to using PPP including the fact that it is not proprietary. PPP includes many features not available in HDLC:

  • The link quality management feature, monitors the quality of the link. If too many errors are detected, PPP takes the link down.
  • PPP supports PAP and CHAP authentication.

At the physical layer, you can configure PPP on a range of interfaces, including:

  • Asynchronous serial
  • Synchronous serial
  • HSSI
  • ISDN

PPP operates across any DTE/DCE interface (RS-232-C, RS-422, RS-423, or V.35).

The only absolute requirement imposed by PPP is a full-duplex circuit.

PPP Frame structure

Frame fields illustrated in the figure:

 

 

 

 

  • Flag – A single byte that indicates the beginning or end of a frame. The flag field consists of the binary sequence 01111110. In successive PPP frames, only a single Flag character is used.
  • Address – A single byte that contains the binary sequence 11111111, the standard broadcast address. PPP does not assign individual station addresses.
  • Control – A single byte that contains the binary sequence 00000011, which calls for transmission of user data in an unsequenced frame. This provides a connectionless link service that does require the establishment of data links or links stations. On a point-to-point link, the destination node does not need to be addressed. Therefore, for PPP, the Address field is set to 0xFF, the broadcast address. If both PPP peers agree to perform address and control field compression during the LCP negotiation, the Address field is not included.
  • Protocol – Two bytes that identify the protocol encapsulated in the information field of the frame. The 2-byte Protocol field identifies the protocol of the PPP payload. If both PPP peers agree to perform protocol field compression during LCP negotiation, the Protocol field is one byte for the protocol identification in the range 0x00-00 to 0x00-FF. The most up-to-date values of the protocol field are specified in the most recent Assigned Numbers Request For Comments (RFC).
  • Data – Zero or more bytes that contain the datagram for the protocol specified in the protocol field. The end of the information field is found by locating the closing flag sequence and allowing 2 bytes for the FCS field. The default maximum length of the information field is 1,500 bytes. By prior agreement, consenting PPP implementations can use other values for the maximum information field length.
  • Frame Check Sequence (FCS, or chuck sum) – Normally 16 bits (2 bytes). By prior agreement, consenting PPP implementations can use a 32-bit (4-byte) FCS for improved error detection. If the receiver’s calculation of the FCS does not match the FCS in the PPP frame, the PPP frame is silently discarded.
PPP sessions

There are three phases of establishing a PPP session, as shown in the figure:

  • Phase 1: Link establishment and configuration negotiation – Before PPP exchanges any network layer datagrams, such as IP, the LCP must first open the connection and negotiate configuration options. This phase is complete when the receiving router sends a configuration-acknowledgment frame back to the router initiating the connection.
  • Phase 2: Link quality determination (optional) – The LCP tests the link to determine whether the link quality is sufficient to bring up network layer protocols. The LCP can delay transmission of network layer protocol information until this phase is complete.
  • Phase 3: Network layer protocol configuration negotiation – After the LCP has finished the link quality determination phase, the appropriate NCP can separately configure the network layer protocols, and bring them up and take them down at any time. If the LCP closes the link, it informs the network layer protocols so that they can take appropriate action.

The link remains configured for communications until explicit LCP or NCP frames close the link, or until some external event occurs such as an inactivity timer expiring, or an administrator intervening.

The LCP can terminate the link at any time. This is usually done when one of the routers requests termination, but can happen because of a physical event, such as the loss of a carrier or the expiration of an idle-period timer.

LCP operation (Datalink layer)

LCP operation includes provisions for link establishment, link maintenance, and link termination. LCP operation uses three classes of LCP frames to accomplish the work of each of the LCP phases:

  • Link-establishment frames establish and configure a link (Configure-Request, Configure-Ack, Configure-Nak, and Configure-Reject).
  • Link-maintenance frames manage and debug a link (Code-Reject, Protocol-Reject, Echo-Request, Echo-Reply, and Discard-Request).
  • Link-termination frames terminate a link (Terminate-R equest and Terminate-Ack).
Link Establishment

Link establishment is the first phase of LCP operation, as seen in Figure 3-24. This phase must complete successfully, before any network layer packets can be exchanged. During link establishment, the LCP opens the connection and negotiates the configuration parameters. The link establishment process starts with the initiating device sending a Configure-Request frame to the responder. The Configure-Request frame includes a variable number of configuration options needed to set up on the link.

Figure 3-24

Figure 3-24 PPP Link Establishment

The initiator includes the options for how it wants the link created, including protocol or authentication parameters. The responder processes the request:

  • If the options are not acceptable or not recognized, the responder sends a Configure-Nak or Configure-Reject message. If this occurs and the negotiation fails, the initiator must restart the process with new options.
  • If the options are acceptable, the responder responds with a Configure-Ack message and the process moves on to the authentication stage. The operation of the link is handed over to the NCP.

When NCP has completed all necessary configurations, including validating authentication if configured, the line is available for data transfer. During the exchange of data, LCP transitions into link maintenance.

Link Maintenance

During link maintenance, LCP can use messages to provide feedback and test the link, as shown in Figure 3-25.

  • Echo-Request, Echo-Reply, and Discard-Request: These frames can be used for testing the link.
  • Code-Reject and Protocol-Reject: These frame types provide feedback when one device receives an invalid frame due to either an unrecognized LCP code (LCP frame type) or a bad protocol identifier. For example, if an uninterpretable packet is received from the peer, a Code-Reject packet is sent in response. The sending device will resend the packet.

    Figure 3-25

    Figure 3-25 PPP Link Maintenance

Link Termination

After the transfer of data at the network layer completes, the LCP terminates the link, as shown in Figure 3-26. NCP only terminates the network layer and NCP link. The link remains open until the LCP terminates it. If the LCP terminates the link before NCP, the NCP session is also terminated.

Figure 3-26

Figure 3-26 PPP Link Termination

PPP can terminate the link at any time. This might happen because of the loss of the carrier, authentication failure, link quality failure, the expiration of an idle-period timer, or the administrative closing of the link.

The LCP closes the link by exchanging Terminate packets. The device initiating the shutdown sends a Terminate-Request message. The other device replies with a Terminate-Ack. A termination request indicates that the device sending it needs to close the link. When the link is closing, PPP informs the network layer protocols so that they may take appropriate action.

LCP Packet

Figure 3-27 shows the fields in an LCP packet:

  • Code: The Code field is 1 byte in length and identifies the type of LCP packet.
  • Identifier: The Identifier field is 1 byte in length and is used to match packet requests and replies.
  • Length: The Length field is 2 bytes in length and indicates the total length (including all fields) of the LCP packet.
  • Data: The Data field is 0 or more bytes as indicated by the length field. The format of this field is determined by the code.

    Figure 3-27

    Figure 3-27 LCP Packet Codes

Each LCP packet is a single LCP message consisting of an LCP Code field identifying the type of LCP packet, an identifier field so that requests and replies can be matched, and a Length field indicating the size of the LCP packet and LCP packet type-specific data.

Each LCP packet has a specific function in the exchange of configuration information depending on its packet type. The Code field of the LCP packet identifies the packet type according to Table bllow.

LCP Code LCP Packet Type Description
1 Configure-Request Sent to open or reset a PPP connection. Configure-Request contains a list of LCP options with changes to default option values.
2 Configure-Ack Sent when all of the values of all of the LCP options in the last Configure-Request received are recognized and acceptable. When both PPP peers send and receive Configure-Acks, the LCP negotiation is complete.
3 Configure-Nak Sent when all the LCP options are recognized, but the values of some options are not acceptable. Configure-Nak includes the mismatching options and their acceptable values.
4 Configure-Reject Set when LCP options are not recognized or not acceptable for negotiation. Configure-Reject includes the unrecognized or non-negotiable options.
5 Terminate-Request Optionally sent to close the PPP connection.
6 Terminate-Ack Sent in response to a Terminate-Request.
7 Code-Reject Sent when the LCP code is unknown. The Code-Request message includes the rejected LCP packet.
8 Protocol-Reject Sent when the PPP frame contains an unknown Protocol ID. The Protocol-Reject message includes the rejected LCP packet. Protocol-Reject is typically sent by a PPP peer in response to PPP NCP for a LAN protocol not enabled on the PPP peer.
9 Echo-Request Optionally sent to test PPP connection.
10 Echo-Reply Sent in response to an Echo-Request. The PPP Echo-Request and Echo-Reply are not related to the ICMP Echo Request and Echo Reply messages.
11 Discard-Request Optionally sent to exercise the link in the outbound direction.

 

Configuration Options

PPP can be configured to support various optional functions, as shown in Figure 3-28. These optional functions include

  • Authentication using either PAP or CHAP
  • Compression using either Stacker or Predictor
  • Multilink that combines two or more channels to increase the WAN bandwidth

    Figure 3-28

    Figure 3-28 PPP Configuration Options

To negotiate the use of these PPP options, the LCP link-establishment frames contain option information in the data field of the LCP frame, as shown in Figure 3-29. If a configuration option is not included in an LCP frame, the default value for that configuration option is assumed.

Figure 3-29

Figure 3-29 LCP Option Fields

This phase is complete when a configuration acknowledgment frame has been sent and received.

NCP Explained (Network layer)

After the link has been initiated, the LCP passes control to the appropriate NCP.

NCP Process

Although initially designed for IP packets, PPP can carry data from multiple network layer protocols by using a modular approach in its implementation. PPP’s modular model allows LCP to set up the link and then transfer the details of a network protocol to a specific NCP. Each network protocol has a corresponding NCP and each NCP has a corresponding RFC.

There are NCPs for IPv4, IPv6, IPX, AppleTalk, and many others. NCPs use the same packet format as the LCPs.

After the LCP has configured and authenticated the basic link, the appropriate NCP is invoked to complete the specific configuration of the network layer protocol being used. When the NCP has successfully configured the network layer protocol, the network protocol is in the open state on the established LCP link. At this point, PPP can carry the corresponding network layer protocol packets.

IPCP Example

As an example of how the NCP layer works, the NCP configuration of IPv4 (IPCP, Internet Protocol Control Protocol), which is the most common Layer 3 protocol, is shown in Figure 3-30. After LCP has established the link, the routers exchange IPCP messages, negotiating options specific to the IPv4 protocol. IPCP is responsible for configuring, enabling, and disabling the IPv4 modules on both ends of the link. IPv6CP is an NCP with the same responsibilities for IPv6.

Figure 3-30Figure 3-30 PPP NCP Operation

IPCP negotiates two options:

  • Compression: Allows devices to negotiate an algorithm to compress TCP and IP headers and save bandwidth. The Van Jacobson TCP/IP header compression reduces the size of the TCP/IP headers to as few as 3 bytes. This can be a significant improvement on slow serial lines, particularly for interactive traffic.
  • IPv4-Address: Allows the initiating device to specify an IPv4 address to use for routing IP over the PPP link, or to request an IPv4 address for the responder. Prior to the advent of broadband technologies such as DSL and cable modem services, dialup network links commonly used the IPv4 address option.

After the NCP process is complete, the link goes into the open state, and LCP takes over again in a link maintenance phase. Link traffic consists of any possible combination of LCP, NCP, and network layer protocol packets. When data transfer is complete, NCP terminates the protocol link; LCP terminates the PPP connection.

Configure PPP

 

Enabling PPP on an Interface

To set PPP as the encapsulation method used by a serial interface, use the encapsulation ppp interface configuration command.

The following example enables PPP encapsulation on interface serial 0/0/0:

R3# configure terminal

R3(config)# interface serial 0/0/0

R3(config-if)# encapsulation ppp

The encapsulation ppp interface command has no arguments. Remember that if PPP is not configured on a Cisco router, the default encapsulation for serial interfaces is HDLC.

PPP Compression Commands

Point-to-point software compression on serial interfaces can be configured after PPP encapsulation is enabled. Because this option invokes a software compression process, it can affect system performance. If the traffic already consists of compressed files, such as .zip, .tar, or .mpeg, do not use this option.

The command syntax for the compress command is

Router(config-if)# compress [ predictor | stac ]
  • predictor (optional): Specifies that a predictor compression algorithm will be used
  • stac (optional): Specifies that a Stacker (LZS) compression algorithm will be used

To configure compression over PPP, enter the following commands:

R2(config)# interface serial 0/0/0

R2(config-if)# encapsulation ppp

R2(config-if)# compress [ predictor | stac ]
PPP Link Quality Monitoring Command

Recall that LCP provides an optional link quality determination phase. In this phase, LCP tests the link to determine whether the link quality is sufficient to use Layer 3 protocols. The ppp quality percentage command ensures that the link meets the quality requirement set; otherwise, the link closes down. The command syntax for the ppp quality command is

Router(config-if)# ppp quality percentage

  • percentage: Specifies the link quality threshold. Range is 1 to 100.

The percentages are calculated for both incoming and outgoing directions.

The outgoing quality is calculated by comparing the total number of packets and bytes sent to the total number of packets and bytes received by the destination node.

The incoming quality is calculated by comparing the total number of packets and bytes received to the total number of packets and bytes sent by the destination node.

If the link quality percentage is not maintained, the link is deemed to be of poor quality and is taken down. Link Quality Monitoring (LQM) implements a time lag so that the link does not bounce up and down.

The following configuration example monitors the data dropped on the link and avoids frame looping:

R2(config)# interface serial 0/0/0

R2(config-if)# encapsulation ppp

R2(config-if)# ppp quality 80

Use the no ppp quality command to disable LQM. The following example shows link quality being used between R1 and R2:

Partial running-config for R1

hostname R1

!

interface Serial 0/0/0

 ip address 10.0.1.1 255.255.255.252

 ipv6 address 2001:db8:cafe:1::1/64

 encapsulation ppp

 ppp quality 80

Partial running-config for R2

hostname R2

!

interface Serial 0/0/0

 ip address 10.0.1.2 255.255.255.252

 ipv6 address 2001:db8:cafe:1::2/64

 encapsulation ppp

 ppp quality 80
Multilink

 

Multilink PPP (also referred to as MP, MPPP, MLP, or Multilink) provides a method for spreading traffic across multiple physical WAN links, as shown in Figure 3-32. Multilink PPP also provides packet fragmentation and reassembly, proper sequencing, multivendor interoperability, and load balancing on inbound and outbound traffic.

Figure 3-32

Figure 3-32 PPP Multilink

MPPP allows packets to be fragmented and sends these fragments simultaneously over multiple point-to-point links to the same remote address. The multiple physical links come up in response to a user-defined load threshold. MPPP can measure the load on just inbound traffic, or on just outbound traffic, but not on the combined load of both inbound and outbound traffic.

Configuring MPPP in two steps.

Step 1. Create a multilink bundle.

  • The interface multilink  number  command creates the multilink interface.
  • In interface configuration mode, an IP address is assigned to the multilink interface. In this example, both IPv4 and IPv6 addresses are configured on routers R3 and R4.
  • The interface is enabled for multilink PPP  ppp multilink.
  • The interface is assigned a multilink group numberppp multilink group 1.

Step 2. Assign interfaces to the multilink bundle. Each interface that is part of the multilink group:

  • Is enabled for PPP encapsulation.
  • Is enabled for multilink PPP in interface configuration mode:   R3(conf-if)# ppp multilink
  • Is bound to the multilink bundle using the multilink group number configured in Step 1:   R3(conf-if)# ppp multilink group 1

The following example shows multilink PPP configured between R3 and R4:

Partial running-config for R3

hostname R3

!

interface Multilink 1                      //step1 starts//

 ip address 10.0.1.1 255.255.255.252

 ipv6 address 2001:db8:cafe:1::1/64

 ppp multilink

 ppp multilink group 1
 
!                                       //step1 ends//

interface Serial 0/1/0                    //step2 starts//

 no ip address

 encapsulation ppp

 ppp multilink

 ppp multilink group 1

!                         //step2 ends//

interface Serial 0/1/1

 no ip addressint 

 encapsulation ppp

 ppp multilink

 ppp multilink group 1

Partial running-config for R4

hostname R4

!

interface Multilink 1

 ip address 10.0.1.2 255.255.255.252

 ipv6 address 2001:db8:cafe:1::2/64

 ppp multilink

 ppp multilink group 1

!

interface Serial 0/0/0

 no ip address

 encapsulation ppp

 ppp multilink

 ppp multilink group 1

!

interface Serial 0/0/1

 no ip address

 encapsulation ppp

 ppp multilink

 ppp multilink group 1

To disable PPP multilink, use the no ppp multilink command.

Verifying PPP Configuration

Use the show interfaces serial command to verify proper configuration of HDLC or PPP encapsulation.

Example 3-3 Using show interfaces serial to Verify a PPP Encapsulation

R2#show interfaces serial 0/0/0

Serial0/0/0 is up, line protocol is up

  Hardware is GT96K Serial

  Internet address is 10.0.1.2/30

  MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,

     reliability 255/255, txload 1/255, rxload 1/255

  Encapsulation PPP, LCP Open

  Open: IPCP, IPV6CP, CCP, CDPCP,, loopback not set

  Keepalive set (10 sec)

  CRC checking enabled

<Output omitted for brevity>

When you configure HDLC, the output of the show interfaces serial command should display encapsulation HDLC. When PPP is configured, the LCP and NCP states also display. Notice that NCPs IPCP and IPv6CP are open for IPv4 and IPv6 because R1 and R2 were configured with both IPv4 and IPv6 addresses.

Table 3-6 Verifying PPP Commands

Command Description
show interfaces Displays statistics for all interfaces configured on the router.
show interfaces serial Displays information about a serial interface.
show ppp multilink CDisplays information about a PPP multilink interface.

The show ppp multilink command verifies that PPP multilink is enabled on R3, as shown in Example 3-4. The output indicates the interface Multilink 1, the hostnames of both the local and remote endpoints, and the serial interfaces assigned to the multilink bundle.

Example 3-4 Verifying PPP Multilink

R3# show ppp multilink

Multilink1

  Bundle name: R4

  Remote Endpoint Discriminator: [1] R4

  Local Endpoint Discriminator: [1] R3

  Bundle up for 00:01:20, total bandwidth 3088, load 1/255

  Receive buffer limit 24000 bytes, frag timeout 1000 ms

    0/0 fragments/bytes in reassembly list

    0 lost fragments, 0 reordered

    0/0 discarded fragments/bytes, 0 lost received

    0x2 received sequence, 0x2 sent sequence

  Member links: 2 active, 0 inactive (max 255, min not set)

    Se0/1/1, since 00:01:20

    Se0/1/0, since 00:01:06

No inactive multilink interfaces

R3#

Show the multilink interface information:

 show interface multilink link_number