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.
The Controller distributes keys, the edge builds a tunnel, BFD runs inside it, and the route becomes usable.
- KeysController sharesthem over OMP
- IPsec tunneledge to remoteTLOC address
- BFD insidehellos andmeasurements
- Route usableBFD up,TLOC resolved
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.
Does not form, flaps, or stays up with drops.
- Does not formBFD down,0 transitions
- Flapsup and down,high transitions
- Up, dropsBFD up,large packets fail
| Family | Likely cause | Evidence | Fix |
|---|---|---|---|
| Does not form | Firewall or NAT blocks the tunnel ports | BFD down, route unresolved; ping to the remote transport address works | Permit the UDP ports for your release |
| Does not form | Colours cannot form a tunnel (restrict) | Tunnel interface restrict set on one end | Align colours or remove the restrict |
| Does not form | Encapsulation mismatch | IPsec on one end, GRE on the other | Use the same encapsulation on both |
| Flaps | Loss or jitter on one transport | High transitions on one colour only | Provider ticket; compare with the other colour |
| Flaps | BFD timers tight for the link | Short outages in history, link otherwise fine | Tune timers after measuring |
| Up, drops | Tunnel MTU smaller than the packet | Small ping works, large fails with the DF bit set | Adjust MTU or TCP MSS |
| Up, drops | Policy or QoS drops a class | Only one application fails | Check the data policy and queue drops |
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.
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 ReachPing the remote transport addressfrom the local transport interface
- 2 PortsFirewall or NAT permitsthe tunnel ports for the release
- 3 ColoursColour pair and restrictsettings allow a tunnel
- 4 Tunnel typeIPsec on both ends,not IPsec against GRE
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.
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
A down tunnel with no transitions has not formed. A tunnel with many transitions formed and keeps dropping.
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.
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
| Measure | Value | Reading |
|---|---|---|
| Outage length | 11 seconds each time | Longer than the 7-second detection time, so BFD declares the tunnel down |
| Gap between outages | 3,598 and 3,603 seconds | About one hour, so the cause is regular, not random |
| Time of the outage | 13 to 14 minutes past the hour | Ask the provider about an hourly job or link event at that time |
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.
| Multiplier | Detection time | 4 s burst | 9 s burst | 11 s outage |
|---|---|---|---|---|
| 3 | 3 s | Drops tunnel | Drops tunnel | Drops tunnel |
| 5 | 5 s | Absorbed | Drops tunnel | Drops tunnel |
| 7 | 7 s | Absorbed | Drops tunnel | Drops tunnel |
| 10 | 10 s | Absorbed | Absorbed | Drops tunnel |
| 12 | 12 s | Absorbed | Absorbed | Absorbed |
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.
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)
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)
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.
| Ping | Payload | Result | Range after the ping |
|---|---|---|---|
| 1 | 1422 | Fail | 1372 to 1422 |
| 2 | 1397 | Pass | 1397 to 1422 |
| 3 | 1409 | Pass | 1409 to 1422 |
| 4 | 1415 | Pass | 1415 to 1422 |
| 5 | 1418 | Pass | 1418 to 1422 |
| 6 | 1420 | Fail | 1418 to 1420 |
| 7 | 1419 | Fail | 1418 to 1419 |
| Quantity | Value | How it is worked out |
|---|---|---|
| Largest passing payload | 1418 bytes | Last passing ping in the search |
| IP packet size | 1446 bytes | 1418 plus 8 bytes of ICMP header and 20 bytes of IP header |
| TCP segment size (MSS) | 1406 bytes | 1446 minus 20 bytes of IP header and 20 bytes of TCP header |
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
A tunnel shows state down and 0 transitions. What does that suggest?
The mpls tunnel to the hub has 23 transitions and the biz-internet tunnel has 0. Where is the fault most likely?
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?
The mpls tunnel drops for 11 seconds once an hour. Hello interval 1 second, multiplier 7. Why does BFD declare the tunnel down?
With a 1-second hello, which multiplier absorbs an 11-second outage in the simple model, and what does it cost?
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?
The path carries 1446-byte IP packets. What TCP MSS fits, for IPv4 with no TCP options?