Course contents

Unit 11: Lifecycle and deep troubleshootingLesson 11.4 (4 of 7 in this unit)54 of 63 in the Advanced Cisco SD-WAN course

IPsec/BFD failures and packet drops

Tunnels that do not form, flap, or stay up while large packets fail, and the BFD and MTU evidence for each.

Advanced · 18 min read

You'll learn to explain how an IPsec tunnel and its BFD session depend on each other, separate tunnel-down, flapping and drops-with-tunnel-up faults, and collect the evidence that identifies each.

Technical definition

A tunnel failure in Cisco SD-WAN is a problem on the data plane between two edges. Each edge builds an IPsec tunnel to the other end's TLOC, with encryption keys distributed through the Controller, and runs BFD inside that tunnel. BFD is both the health check and the source of loss, latency and jitter measurements, so a failure shows up first as a BFD session that is down, flapping or measuring badly.

How the tunnel and BFD fit together

An SD-WAN edge does not negotiate keys with every other edge. The Controller carries the encryption key information in OMP updates, and each edge uses it to build an IPsec tunnel to the TLOC it wants to reach. Once the tunnel exists, BFD starts inside it. A route that points to that TLOC is usable only while the BFD session is up.

Diagram
From TLOC to usable route
From TLOC to usable route

The Controller distributes keys, the edge builds a tunnel, BFD runs inside it, and the route becomes usable.

  1. KeysController sharesthem over OMP
  2. IPsec tunneledge to remoteTLOC address
  3. BFD insidehellos andmeasurements
  4. Route usableBFD up,TLOC resolved
A fault at any step leaves the route known but unusable, and the BFD state is where you see it.

This is why BFD is the first thing to read for any tunnel complaint. Its state, its transition count and the colours on each end tell you which tunnel and which transport is affected.

Three kinds of failure

Most tunnel faults fall into three families, and they need different evidence. A tunnel that does not form is a reachability or configuration problem. A tunnel that forms and drops is usually loss or jitter on the underlay. A tunnel that stays up while traffic fails is usually a size or policy problem. Decide which family you are in before you touch a setting.

Diagram
Three failure families
Three failure families

Does not form, flaps, or stays up with drops.

Tunnel complaint
  • Does not formBFD down,0 transitions
  • Flapsup and down,high transitions
  • Up, dropsBFD up,large packets fail
The BFD state and transition counter tell you which family.
Diagram
Tunnel faults: cause, evidence and fix
Tunnel faults: cause, evidence and fix
FamilyLikely causeEvidenceFix
Does not formFirewall or NAT blocks the tunnel portsBFD down, route unresolved; ping to the remote transport address worksPermit the UDP ports for your release
Does not formColours cannot form a tunnel (restrict)Tunnel interface restrict set on one endAlign colours or remove the restrict
Does not formEncapsulation mismatchIPsec on one end, GRE on the otherUse the same encapsulation on both
FlapsLoss or jitter on one transportHigh transitions on one colour onlyProvider ticket; compare with the other colour
FlapsBFD timers tight for the linkShort outages in history, link otherwise fineTune timers after measuring
Up, dropsTunnel MTU smaller than the packetSmall ping works, large fails with the DF bit setAdjust MTU or TCP MSS
Up, dropsPolicy or QoS drops a classOnly one application failsCheck the data policy and queue drops
Port numbers, counter names and defaults differ between releases. Check Cisco's firewall port list and release notes for yours.

A tunnel that does not form: checks in order

When the tunnel is down with zero transitions, work from the bottom of the stack upwards. Each check removes one family of causes, and a pass moves the search to the next one.

Diagram
Tunnel down: four checks in order
Tunnel down: four checks in order

First prove the remote transport address is reachable. Then confirm the firewall or NAT permits the tunnel ports. Then confirm the colours and restrict settings allow a tunnel. Last, confirm both ends use the same tunnel type.

  1. 1 ReachPing the remote transport addressfrom the local transport interface
  2. 2 PortsFirewall or NAT permitsthe tunnel ports for the release
  3. 3 ColoursColour pair and restrictsettings allow a tunnel
  4. 4 Tunnel typeIPsec on both ends,not IPsec against GRE
Stop at the first check that fails. Later checks mean little until the earlier ones pass.

Reading the BFD sessions

show sdwan bfd sessions lists one row per tunnel with the state, the two colours and a transition counter. The counter is the key to separating the families: a tunnel that has not formed has zero transitions and is down, a flapping tunnel has a high count, and a healthy one has a small number.

Example output written for this lesson, simplified; real output has more fields and a different layout
BR-01#show sdwan bfd sessions
SYSTEM IP    SITE ID  STATE  SOURCE COLOR  REMOTE COLOR  TRANSITIONS
10.255.1.1   100      up     mpls          mpls          23
10.255.1.1   100      up     biz-internet  biz-internet  0
10.255.2.2   102      down   biz-internet  biz-internet  0
Three tunnels, three stories. The first is up now but has moved 23 times, so the mpls underlay to the hub is unstable. The second is clean. The third is down with zero transitions, so it has not formed since the router started or since the last change, which points at reachability or configuration, not at loss.
Diagram
Zero transitions or many
Zero transitions or many

A down tunnel with no transitions has not formed. A tunnel with many transitions formed and keeps dropping.

Down, 0 transitionsHas not formedCheck reachability,ports, colours
Many transitionsForms, then dropsCheck loss on theunderlay
The same state, down, can mean opposite things. The counter separates them.

A flapping tunnel

In the output above the mpls tunnel to HUB-01 has moved 23 times while biz-internet has not moved at all. Both tunnels use the same edge, the same software and the same policy, so the difference must lie in what they cross. That narrows the fault to the mpls underlay, and the next step is evidence about that path, not a setting on the router.

Run a long ping from the mpls transport interface to the hub's mpls transport address and count the loss. Read the BFD history for the pattern: outages at the same time each hour suggest a scheduled job or a congested link, and random drops suggest a degraded circuit. Then open a provider ticket with the times and the loss figures. Raising the BFD multiplier is a temporary mitigation that trades slower failover for fewer false alarms, and it does nothing for the loss itself.

Worked example (assumed values, numbers computed by script). The BFD history for the mpls tunnel shows a regular pattern. The hello interval is assumed to be 1 second and the multiplier 7, so the detection time is about 7 seconds.

Example output written for this lesson, simplified; real output has more fields and a different layout
BR-01#show sdwan bfd history
SYSTEM IP    SITE ID  COLOR  STATE  TIME
10.255.1.1   100      mpls   down   09:13:51
10.255.1.1   100      mpls   up     09:14:02
10.255.1.1   100      mpls   down   10:13:49
10.255.1.1   100      mpls   up     10:14:00
10.255.1.1   100      mpls   down   11:13:52
10.255.1.1   100      mpls   up     11:14:03
Six events, three outages. Real history output carries dates and more columns. The times are what matter here.
Diagram
What the history says
What the history says
MeasureValueReading
Outage length11 seconds each timeLonger than the 7-second detection time, so BFD declares the tunnel down
Gap between outages3,598 and 3,603 secondsAbout one hour, so the cause is regular, not random
Time of the outage13 to 14 minutes past the hourAsk the provider about an hourly job or link event at that time
Computed from the six example timestamps above.

Now the tuning question. With a 1-second hello, a loss burst shorter than hello times multiplier is absorbed in this simple model, and a longer one drops the tunnel. The table shows what each multiplier would do with this pattern.

Diagram
Multiplier trade-off with a 1-second hello
Multiplier trade-off with a 1-second hello
MultiplierDetection time4 s burst9 s burst11 s outage
33 sDrops tunnelDrops tunnelDrops tunnel
55 sAbsorbedDrops tunnelDrops tunnel
77 sAbsorbedDrops tunnelDrops tunnel
1010 sAbsorbedAbsorbedDrops tunnel
1212 sAbsorbedAbsorbedAbsorbed
Simplified model; real behaviour depends on where the burst falls among the hellos. Defaults and ranges depend on the release.

Absorbing the 11-second outage takes a multiplier of 12. From then on, every real failure also keeps traffic on a dead tunnel for about 12 seconds before failover. The hourly outage is still happening on the underlay, so the provider ticket is the real fix and the multiplier is a trade, not a repair.

Tunnel up, traffic fails

When BFD is up and the route is resolved, the fault is in what a packet meets on the way. The classic case is size. Encapsulation adds bytes, so the tunnel MTU is lower than the interface MTU, and a full-size packet that fits the LAN does not fit the tunnel. A ping with the do-not-fragment bit finds the limit.

Example output written for this lesson, simplified; real output has more fields and a different layout
BR-01#ping vrf 10 192.168.10.1 size 1472 df-bit
Sending 5, 1472-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
Packet sent with the DF bit set
.....
Success rate is 0 percent (0/5)
The full-size packet fails. Repeat the test with a smaller size, such as 1372, to find where it starts to pass. The largest size that works, plus the headers, is the usable path MTU for that traffic.
Example output written for this lesson, simplified; real output has more fields and a different layout
BR-01#ping vrf 10 192.168.10.1 size 1372 df-bit
Sending 5, 1372-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
Packet sent with the DF bit set
!!!!!
Success rate is 100 percent (5/5)
The smaller packet passes. Set the tunnel MTU and the TCP maximum segment size so that large flows fit, and confirm the change with the same two pings. If only one application fails and the pings pass at every size, look at the data policy and the queue drops instead.

Find the limit in seven pings

Worked example (assumed path, numbers computed by script). The pings above bracket the limit: 1372 passes and 1472 fails. Assume the path carries IP packets up to 1446 bytes. Halving the range each time finds the largest passing payload in seven pings.

Diagram
Halving the range with DF-bit pings
Halving the range with DF-bit pings
PingPayloadResultRange after the ping
11422Fail1372 to 1422
21397Pass1397 to 1422
31409Pass1409 to 1422
41415Pass1415 to 1422
51418Pass1418 to 1422
61420Fail1418 to 1420
71419Fail1418 to 1419
The largest passing payload is 1418 bytes. The assumed limit is hidden in this example so the search has something to find.
Diagram
From ping result to settings
From ping result to settings
QuantityValueHow it is worked out
Largest passing payload1418 bytesLast passing ping in the search
IP packet size1446 bytes1418 plus 8 bytes of ICMP header and 20 bytes of IP header
TCP segment size (MSS)1406 bytes1446 minus 20 bytes of IP header and 20 bytes of TCP header
IPv4 with no options. Confirm with the same pings after the change, because real tunnels can add fields.

Use the packet size to check the tunnel MTU and the segment size to set the TCP MSS adjustment on the service side. The field names for both differ between releases and between template and CLI configuration.

Learn more: Forwarding, MTU and Tunnel EncapsulationSD-WAN Root-Cause Framework

Test yourself

Predict · scenario 1

A tunnel shows state down and 0 transitions. What does that suggest?

Predict · scenario 2

The mpls tunnel to the hub has 23 transitions and the biz-internet tunnel has 0. Where is the fault most likely?

Predict · scenario 3

BFD is up, the route is resolved, a 1472-byte ping with DF fails and a 1372-byte ping passes. What is the likely cause?

Predict · scenario 4

The mpls tunnel drops for 11 seconds once an hour. Hello interval 1 second, multiplier 7. Why does BFD declare the tunnel down?

Predict · scenario 5

With a 1-second hello, which multiplier absorbs an 11-second outage in the simple model, and what does it cost?

Predict · scenario 6

A DF-bit ping passes at payload 1418 and fails at 1419. ICMP and IP headers add 28 bytes. What IP packet size does the path carry?

Predict · scenario 7

The path carries 1446-byte IP packets. What TCP MSS fits, for IPv4 with no TCP options?

FAQ

Is BFD a separate fault domain from IPsec?
No. BFD packets travel inside the tunnel, so a BFD session cannot be up unless the tunnel works end to end. When BFD is down, the tunnel is the first suspect, and the underlay beneath it is the second.
Why can BFD be up while large transfers fail?
BFD packets are small. Larger packets can be dropped by an MTU limit on the path or by a provider policy while BFD stays up, so a working BFD session says the path passes small packets, not every packet.
Does raising the BFD multiplier fix flapping?
It hides short bursts of loss by waiting longer before declaring the tunnel down, at the cost of slower failover. The underlay still has loss. Raise the multiplier only as a measured trade, after the cause is understood.
How long does BFD take to declare a tunnel down?
About the hello interval times the multiplier. With an assumed 1-second hello and a multiplier of 7 that is about 7 seconds. Defaults and ranges depend on the release, so read the values on your own edges before doing the arithmetic.
How many pings does it take to find the MTU limit?
Halving the range each time needs about seven pings for a 100-byte range. Stepping down by ten bytes from the top can take ten pings for the same range, so search by halving.