Sub topic 4
Encapsulating traffic on a serial link: HDLC and PPP
Prerequisites and scope
This chapter assumes you know the OSI Layer 2 and Layer 3 split, can read IPv4 addresses and a /30 mask, and can read basic Cisco IOS interface configuration. It builds on the previous chapter, where a leased line gave you a dedicated point-to-point circuit between two routers. The circuit only carries bits. This chapter covers what the two routers put around each packet so the far end can recognize it.
Why a serial link needs encapsulation
Ethernet has a built-in frame format with source and destination MAC addresses. A leased line has neither. It is a bit pipe between exactly two devices, so a frame needs no destination address to pick a receiver. A Layer 2 protocol still has to do four jobs on the link:
- Mark where each frame starts and ends in the continuous bit stream (framing).
- Detect corrupted frames with a frame check sequence (FCS).
- Say which Layer 3 protocol the payload holds, such as IPv4 or IPv6.
- Optionally negotiate parameters, authenticate the peer, and report link state.
Encapsulation is the process of wrapping a packet in a Layer 2 header and trailer for transmission on a link. The two common choices on a router serial interface are HDLC and PPP. Both ends must use the same one. If they differ, the link may show as up at the physical level but no traffic passes.
HDLC
High-Level Data Link Control (HDLC) is a bit-oriented Layer 2 protocol standardized by ISO. A frame has a flag byte (0x7E) at each end, an address field, a control field, the payload, and an FCS.
The ISO standard has no protocol-type field. That is a problem for a router, which may carry IPv4, IPv6, and others over the same link. Cisco added a proprietary 2-byte type field after the control field. The result is often called cHDLC (Cisco HDLC). It is the default encapsulation on Cisco serial interfaces.
Practical consequences:
- cHDLC is simple and has very little overhead.
- It does not authenticate the peer.
- It does not negotiate anything. It sends keepalives to detect a dead link.
- Because the type field is proprietary, a Cisco router running HDLC will not interoperate with another vendor's router running its own HDLC variant.
PPP
Point-to-Point Protocol (PPP) is an open standard (RFC 1661) built on an HDLC-like frame. It adds a protocol field and a set of control protocols, so it is the choice when you need interoperability or features.
PPP has two kinds of control protocols:
- Link Control Protocol (LCP) opens the link, negotiates options such as authentication and multilink, and tests link quality.
- Network Control Protocols (NCPs) configure each Layer 3 protocol. IP Control Protocol (IPCP) handles IPv4, and IPv6CP handles IPv6. Cisco Discovery Protocol also has an NCP (CDPCP).
PPP phases
A PPP link moves through these phases in order.
- Link establishment: LCP exchanges Configure-Request and Configure-Ack messages until both sides agree on options.
- Authentication (optional): PAP or CHAP runs, if configured.
- Network layer: each NCP negotiates its protocol. After IPCP completes, IP packets flow.
- Termination: LCP or the physical layer closes the link.
PAP and CHAP
Password Authentication Protocol (PAP) sends the username and password in clear text, once, at link setup. Anyone who captures that frame learns the password.
Challenge Handshake Authentication Protocol (CHAP) never sends the password. The authenticator sends a random challenge. The peer replies with a hash of the identifier, the shared secret, and the challenge. The authenticator computes the same hash and compares. CHAP uses a three-way handshake and can repeat the challenge during the session, so a stolen reply is useless later.
| Feature | PAP | CHAP |
|---|---|---|
| Password on the wire | Clear text | Never sent, only a hash |
| Handshake | Two-way | Three-way |
| Repeated during session | No | Yes, periodically |
| Who starts | The peer being authenticated | The authenticator |
| Recommendation | Avoid | Use when authenticating |
Other PPP features
- Multilink PPP (MLPPP) bundles several serial links into one logical link and splits packets across them. Use it when you buy two T1 or E1 lines and want one interface.
- Link quality monitoring can shut the link if the error rate passes a threshold.
- Compression and callback exist but are rarely used today.
HDLC and PPP compared
| Property | Cisco HDLC | PPP |
|---|---|---|
| Standard | Cisco proprietary type field | Open (RFC 1661) |
| Multiprotocol support | Yes, via Cisco type field | Yes, via protocol field and NCPs |
| Authentication | None | PAP, CHAP |
| Multilink | No | Yes |
| Parameter negotiation | No | Yes, through LCP |
| Overhead | Lowest | Slightly higher |
| Cisco IOS default | Yes | No |
Configuration
The Topic Spine example sets PPP on a branch leased line. The /30 subnet gives exactly two usable addresses, one for each end.
interface Serial0/0/0
description Leased line to branch
ip address 192.0.2.1 255.255.255.252
encapsulation ppp
no shutdownThe router at the other end needs the same encapsulation and the other address in the subnet.
interface Serial0/0/0
description Leased line to HQ
ip address 192.0.2.2 255.255.255.252
encapsulation ppp
no shutdownTo restore the default, enter encapsulation hdlc on the interface.
Adding CHAP
Each router needs a username entry that matches the peer's hostname, and both entries use the same password. With a router named HQ and another named BRANCH, the configuration looks like this.
! On HQ
hostname HQ
username BRANCH password S3cretKey
interface Serial0/0/0
encapsulation ppp
ppp authentication chap! On BRANCH
hostname BRANCH
username HQ password S3cretKey
interface Serial0/0/0
encapsulation ppp
ppp authentication chapThe username on each router is the name of the other router. The password must match exactly and is case-sensitive.
Verification
Use these commands, in this order:
show interfaces serial 0/0/0shows the encapsulation, line status, and LCP and NCP state. Look forLCP OpenandOpen: IPCP.show ip interface briefshows the interface status in a summary table.ping 192.0.2.2tests end-to-end reachability across the link.debug ppp negotiationanddebug ppp authenticationshow each message. Use them carefully on production routers because they add CPU load.
A healthy link prints lines like these in show interfaces:
Encapsulation PPP, LCP Open
Open: IPCP, CDPCPCommon errors and how to read them
The status line in show ip interface brief has two parts, line and protocol. Reading both tells you which layer failed.
| Symptom | Likely cause |
|---|---|
| `up/up` and ping works | Healthy link |
| `up/down` with PPP | LCP or authentication failed. Check for mismatched CHAP names or passwords. |
| `up/down` with HDLC and PPP mixed | The two ends disagree on encapsulation. |
| `up/up` but no ping | Addresses are in different subnets or mismatched masks. |
| `down/down` | Physical problem: cable, CSU/DSU, or carrier. |
| LCP Open but IPCP not open | A Layer 3 problem such as a duplicate address or no IP address on one end. |
An encapsulation mismatch is a frequent cause. HDLC on one side and PPP on the other leaves the line up. The protocol stays down or flaps because each side discards the other's frames.
Where this fits today
PPP and HDLC are used on serial leased lines between your CE router and the provider. The same PPP machinery appears in other places: PPP over Ethernet (PPPoE) for DSL, and PPP in dial-up and some cellular setups. On a modern WAN built from MPLS or SD-WAN, the handoff is usually Ethernet, so you rarely configure serial encapsulation at all. You still see it in older circuits, in certification exams, and in troubleshooting questions about authentication.
Exercise
Two Cisco routers are joined by a leased line. Router A has encapsulation ppp and router B has the default encapsulation. show ip interface brief shows up/down on both. What is wrong, what should you change, and why does the physical layer still show up?
Show answer
The encapsulations do not match. Router B is using Cisco HDLC while router A uses PPP, so each side discards the other's frames and Layer 2 never completes. The physical layer shows up because the carrier signal is present and does not depend on the framing. Set encapsulation ppp on router B (or encapsulation hdlc on router A), then confirm with show interfaces that LCP is open.
Exercise
You configure ppp authentication chap on both routers HQ and BRANCH. HQ has username BRANCH password Alpha1 and BRANCH has username HQ password alpha1. The link stays up/down. Why?
Show answer
The shared secrets differ in case (Alpha1 versus alpha1). CHAP passwords are case-sensitive, so the hashes do not match and authentication fails. Make both passwords identical, then check debug ppp authentication for a success message.
Exercise
A customer wants to bundle two T1 lines into one logical link between two routers from different vendors. Which encapsulation fits, and why not Cisco HDLC?
Show answer
PPP with Multilink PPP. It is an open standard that works across vendors and supports bundling. Cisco HDLC relies on a proprietary type field and has no multilink feature.