Sub topic 4
Encapsulating traffic on a serial link: HDLC and PPP
This chapter assumes you can read basic router CLI and know the leased line model from the previous chapter. A leased line carries bits between two routers. Both ends still need to agree on how to wrap an IP packet into a frame. That wrapper is the Layer 2 encapsulation.
Why serial links need an encapsulation
A serial link has no MAC addresses and no switch. It has exactly two endpoints, so the frame needs no destination address. The encapsulation still has to do three jobs:
- mark where each frame starts and ends
- say which Layer 3 protocol the payload carries
- detect corrupted frames with a frame check sequence (FCS)
HDLC
High-Level Data Link Control (HDLC) is the default encapsulation on Cisco serial interfaces. The ISO standard version has no field for the payload protocol. Cisco added a proprietary type field, so Cisco HDLC works between two Cisco routers but is not interoperable with other vendors' HDLC.
HDLC is simple and has little overhead. It has no authentication, no negotiation, and no link-quality features.
PPP
Point-to-Point Protocol (PPP) is a standard, so it works between vendors. It has two control components:
- Link Control Protocol (LCP) opens the link, negotiates options, and can check link quality. Its magic numbers detect looped-back lines.
- Network Control Protocols (NCPs) configure each Layer 3 protocol. IPCP handles IPv4 and IPv6CP handles IPv6.
PPP also supports authentication with PAP or CHAP, and Multilink PPP, which bundles several links into one logical link. CHAP is preferred over PAP. It uses a hashed challenge and response, so the password never crosses the wire.
Configuring PPP on a leased line
The example below uses a /30 subnet, which provides two usable host addresses for the two routers.
interface Serial0/0/0
description Leased line to branch
ip address 192.0.2.1 255.255.255.252
encapsulation ppp
no shutdownTo add CHAP, each router needs a username that matches the peer's hostname, and both sides need the same password. On the HQ router, with the branch router named BRANCH:
username BRANCH password S3cret
!
interface Serial0/0/0
ppp authentication chapThe branch router needs the mirror-image configuration. Its username is HQ, with the same password.
Verifying and troubleshooting
Run show interfaces serial 0/0/0. A healthy PPP link reports Encapsulation PPP, LCP Open, and Open: IPCP. Common failures:
| Symptom | Likely cause |
|---|---|
| Line up, line protocol down | Encapsulation mismatch (HDLC on one end, PPP on the other) |
| LCP stuck, or closes after opening | CHAP username or password mismatch |
| LCP open, no IPCP | Address problem, such as the two ends in different subnets |
| Line down | Physical or provider fault, not an encapsulation issue |
Choosing between them
Use PPP unless there is a reason not to. It works with other vendors, adds authentication, and gives you better diagnostics. HDLC is acceptable between two Cisco routers on a trusted link, but it offers little beyond lower overhead.
Exercise
A new leased line shows "line protocol is down" on the HQ router while the interface is up. HQ uses encapsulation ppp and the branch router has the default encapsulation. What is wrong, and what is the fix?
Show answer
The ends have mismatched encapsulations. The branch router is running Cisco HDLC, so LCP never opens. Configure encapsulation ppp on the branch serial interface. If CHAP is configured, check that the usernames and passwords match on both sides.