Troubleshooting VPNv4 BGP Session Flapping Between Juniper and Cisco over an IPv6/SRv6 Core
Author: Vadivelan
Technologies: MP-BGP, VPNv4, VPNv6, IPv6, SRv6, RFC 8950
Platforms: Juniper ACX7348, Juniper MX and Cisco 8000 Series
1. Introduction
While validating MP-BGP interoperability between Juniper and
Cisco routers in an IPv6-only SRv6 core, I encountered an interesting issue
involving VPNv4 route advertisements.
The BGP session between a Juniper ACX7348 and a Cisco Route
Reflector established successfully. VPNv6 route advertisements were working as
expected.
However, the moment VPNv4 prefixes were advertised from
Juniper router, the BGP session started flapping continuously.
Lab Architecture
The lab consisted of Juniper and Cisco routers participating in an IPv6-only SRv6 transport network.

The routers established MP-BGP sessions using IPv6 loopback
addresses.
Lab topology
|
Device |
Role |
Platform |
BGP
IPv6 Address |
|
JUNIPER-PE01 |
Provider Edge |
Juniper ACX7348 |
2001:db8:100::1 |
|
CISCO-RR01 |
Route Reflector |
Cisco |
2001:db8:200::1 |
|
JUNIPER-RR01 |
Route Reflector |
Juniper |
2001:db8:300::1 |
Network parameters
|
Parameter |
Example
Value |
|
BGP AS |
65000 |
|
BGP session type |
iBGP |
|
Underlay |
Native IPv6 |
|
Transport |
SRv6 |
|
VPNv4 AFI/SAFI |
1/128 |
|
VPNv6 AFI/SAFI |
2/128 |
|
EVPN AFI/SAFI |
25/70 |
|
VPNv4 prefix |
192.0.2.0/26 |
|
VPNv6 prefix |
2001:db8:400::/64 |
|
Route Distinguisher |
65000:101 |
|
Route Target |
target: 65000:101 |
The IPv6 addresses use the RFC 3849 documentation prefix
2001:db8::/32. The IPv4 example uses the RFC 5737 documentation range
192.0.2.0/24.
The goal was to establish VPNv4 and VPNv6 services over an
IPv6/SRv6 transport network.
Problem Description
During the initial testing, the BGP session established
successfully.
However, whenever VPNv4 prefixes were advertised, Cisco
rejected the received BGP UPDATE and reset the session.
The behaviour was consistent.
There is no issue between Juniper ACX to Juniper MX.
EVPN and VPNV6 doesn’t have any issue. So started to focus
on VPNV4 related logs
Also I tried VPNV4 route advertisement between juniper to isolated
the issue but didn’t have any issue between juniper routers for VPNV4. I
started to assume that it could be the multi-vendor issue, required more in-depth
analysis to identify the Root cause.
|
Test
Scenario |
Observed
Result |
|
IPv6 underlay connectivity |
Working |
|
BGP over IPv6 |
Established |
|
VPNv6 advertisements |
Working |
|
VPNv4 capability negotiation |
Successful |
|
VPNv4 prefix advertisement |
BGP session flapping |
|
VPNv4 advertisements removed |
Session stable |
|
SRv6 service advertisement disabled |
Issue persisted |
|
RFC 8950 compliance enabled |
Issue resolved |
This suggested that the problem was not related to IPv6
transport connectivity.
The failure occurred specifically during VPNv4 UPDATE processing.

Cisco BGP logs
The Cisco Route Reflector reported the following:
%ROUTING-BGP-5-ADJCHANGE_DETAIL:
neighbor 2001:db8:100::1 Up
(VRF: default; AFI/SAFI: 1/128, 2/128, 25/70)
(AS: 65000)
Immediately afterward:
%ROUTING-BGP-5-ADJCHANGE_DETAIL:
neighbor 2001:db8:100::1 Down -
BGP Notification sent, invalid length for attribute
(VRF: default; AFI/SAFI: 1/128, 2/128, 25/70)
(AS: 65000)
The session repeatedly established and reset shortly after
the initial route advertisements.
The important clue was Cisco reporting an invalid BGP
attribute length.
Initial Juniper BGP Configuration
The Juniper Router was configured for MP-BGP over IPv6.
The relevant configuration is shown below.
set protocols bgp group VPN-RR-PEERS type internal
set protocols bgp group VPN-RR-PEERS local-address
2001:db8:100::1
set protocols bgp group VPN-RR-PEERS family inet unicast
extended-nexthop
set protocols bgp group VPN-RR-PEERS family inet-vpn unicast
extended-nexthop
set protocols bgp group VPN-RR-PEERS family inet-vpn unicast
advertise-srv6-service
set protocols bgp group VPN-RR-PEERS family inet-vpn unicast
accept-srv6-service
set protocols bgp group VPN-RR-PEERS family inet6-vpn
unicast advertise-srv6-service
set protocols bgp group VPN-RR-PEERS family inet6-vpn
unicast accept-srv6-service
set protocols bgp group VPN-RR-PEERS neighbor
2001:db8:200::1 description CISCO-RR01
set protocols bgp group VPN-RR-PEERS neighbor
2001:db8:300::1 description JUNIPER-RR01
At first glance, the configuration appeared correct.
VPNv4 extended next-hop support was already enabled:
set protocols bgp group VPN-RR-PEERS family inet-vpn
unicast extended-nexthop
This configuration allowed the routers to negotiate IPv6
next-hop support for VPNv4.
However, an important distinction emerged during
troubleshooting:
Advertising extended next-hop capability does not
necessarily guarantee that the subsequent VPNv4 UPDATE uses the RFC
8950-compliant next-hop encoding.
I also did some research, and someone face the same issue
but resolved it after configuring
Extended next hop but in my case, id didn’t help me to
resolve it.
Solved:
SRv6 VPNv4 NCS540 Interoperability - Cisco Community
Verifying BGP Capability Negotiation
The first troubleshooting step was to determine whether the
Juniper and Cisco routers were negotiating the required BGP capabilities.
Juniper BGP OPEN message
The Juniper BGP trace showed:
BGP SEND MP capability AFI=1, SAFI=128
BGP SEND MP capability AFI=2, SAFI=128
BGP SEND MP capability AFI=25, SAFI=70
These represent:
- VPNv4:
AFI 1, SAFI 128
- VPNv6:
AFI 2, SAFI 128
- EVPN:
AFI 25, SAFI 70
Juniper also advertised the extended next-hop capability:
BGP SEND Extend Nexthop Encoding Capability, code=5
BGP SEND Extended Nexthop Encoding Capability
AFI=1, SAFI=128, Nexthop AFI=2
This confirmed that Juniper advertised IPv6 next-hop
capability for VPNv4.
Cisco BGP OPEN message
The Cisco peer advertised:
BGP RECV MP capability AFI=1, SAFI=128
BGP RECV MP capability AFI=2, SAFI=128
BGP RECV MP capability AFI=25, SAFI=70
Cisco also advertised:
BGP RECV Extended Nexthop Encoding Capability
AFI=1, SAFI=128, Nexthop AFI=2
Finding
Both routers successfully negotiated VPNv4 and extended IPv6
next-hop capabilities.
Therefore, the issue was not caused by missing BGP
address-family configuration or capability negotiation.
The next step was to investigate the actual BGP UPDATE
messages.
Enabling Detailed BGP debug on Juniper
To identify the reason for the session reset, detailed BGP tracing was enabled on the Juniper router.
Trace configuration on Juniper:
set protocols bgp group VPN-RR-PEERS neighbor
2001:db8:200::1 traceoptions file cisco-bgp-debug
set protocols bgp group VPN-RR-PEERS neighbor
2001:db8:200::1 traceoptions file size 10m
set protocols bgp group VPN-RR-PEERS neighbor
2001:db8:200::1 traceoptions flag all
The trace was examined using:
show log cisco-bgp-debug
The following sequence was observed.
Step 1: BGP session establishes
RPD_BGP_NEIGHBOR_STATE_CHANGED:
BGP peer 2001:db8:200::1
changed state from EstabSync to Established
(event RsyncAck)
Step 2: Juniper sends VPNv4 UPDATE
BGP SEND message type 2 (Update) length 129
Step 3: Juniper sends VPNv6 UPDATE
BGP SEND message type 2 (Update) length 141
Step 4: Cisco sends BGP NOTIFICATION
BGP RECV message type 3 (Notification) length 24
BGP RECV Notification code 3
(Update Message Error)
subcode 5 (bad attribute length)
Step 5: BGP session resets
RPD_BGP_NEIGHBOR_STATE_CHANGED:
BGP peer 2001:db8:200::1
changed state from Established to Idle
(event RecvNotify)
This sequence repeated every time the BGP session
re-established and VPNv4 routes were advertised.
Investigation finding
The issue was clearly associated with BGP UPDATE processing.
The next objective was to identify the attribute that Cisco
was rejecting.
Analysing the Cisco BGP NOTIFICATION
The Juniper trace contained the following diagnostic
information:
BGP RECV Notification code 3
(Update Message Error)
subcode 5 (bad attribute length)
BGP RECV Data (3 bytes): 90 0e 00
The complete BGP NOTIFICATION message was:
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
00 18 03 03 05 90 0e 00
Notification decoding
|
Field |
Hexadecimal |
Meaning |
|
BGP message length |
0018 |
24 bytes |
|
BGP message type |
03 |
NOTIFICATION |
|
Error code |
03 |
UPDATE Message Error |
|
Error subcode |
05 |
Attribute Length Error |
|
Attribute flags |
90 |
Optional, non-transitive, extended length |
|
Attribute type |
0e |
MP_REACH_NLRI |
The notification diagnostic data identified the beginning of
the MP_REACH_NLRI attribute header.
Below logs started flooding in Cisco log message.
Cisco was rejecting an UPDATE associated with
MP_REACH_NLRI attribute length validation.
Critical Finding: VPNv4 IPv6 Next-Hop Length and VPNV6
Next-Hop length
The decisive evidence came from examining the actual Juniper
BGP UPDATE trace.
So, I compared the VPNV4 and VPNV6 debug detail because with
VPNV6 we didn’t face any issue and I thought the underlay is IPV6 Core. Side by
Side in notepad ++ I compared the output.
VPNv4 UPDATE
The Juniper router advertised the following VPNv4 route:
BGP SEND message type 2 (Update) length 129
BGP SEND flags 0x40 code Origin(1):
IGP, length(1)
BGP SEND flags 0x40 code ASPath(2):
length 0: <null>
BGP SEND flags 0x40 code LocalPref(5):
100 length(4)
BGP SEND flags 0xc0 code Extended Communities(16):
count(1) target:65000:101
BGP SEND flags 0xc0 code Prefix-SID(40):
Length: 37
BGP SEND SRv6 L3 Service TLV
BGP SEND flags 0x90 code MP_reach(14):
length(37) AFI/SAFI 1/128
BGP SEND nhop 2001:db8:100::1 len 16
BGP SEND 65000:101:192.0.2.0/26
(label 917504)
End-of-Attributes
The critical line was:
BGP SEND nhop 2001:db8:100::1 len 16
Juniper was advertising a 16-byte IPv6 next hop for VPNv4.
VPNv6 UPDATE
The VPNv6 advertisement showed:
BGP SEND message type 2 (Update) length 141
BGP SEND flags 0x40 code Origin(1):
IGP, length(1)
BGP SEND flags 0x40 code ASPath(2):
length 0: <null>
BGP SEND flags 0x40 code LocalPref(5):
100 length(4)
BGP SEND flags 0xc0 code Extended Communities(16):
count(1) target:65000:101
BGP SEND flags 0xc0 code Prefix-SID(40):
Length: 37
BGP SEND SRv6 L3 Service TLV
BGP SEND flags 0x90 code MP_reach(14):
length(49) AFI/SAFI 2/128
BGP SEND nhop 2001:db8:100::1 len 24
BGP SEND 65000:101:2001:db8:400::/64
(label 917520)
End-of-Attributes
The important line was:
BGP SEND nhop 2001:db8:100::1 len 24
The VPNv6 next-hop length was 24 bytes.
Comparison
|
Parameter |
VPNv4 |
VPNv6 |
|
AFI |
1 |
2 |
|
SAFI |
128 |
128 |
|
Next-hop address family |
IPv6 |
IPv6 |
|
Advertised next-hop length |
16 bytes |
24 bytes |
|
Expected VPN next-hop length |
24 bytes |
24 bytes |
|
Observed behaviour |
Cisco rejected UPDATE |
VPNv6 worked |
This difference explained why VPNv6 worked while VPNv4
caused the BGP session to reset.
Understanding RFC 8950
Then is started looking in deep into RFC 8950 defines how
IPv4 and VPNv4 routes can be advertised with IPv6 next hops.
It extends MP-BGP to allow IPv4 reachability information to
use an IPv6 next-hop address.
However, the encoding requirements differ between IPv4
unicast and VPNv4.
9.1 IPv4 unicast with IPv6 next hop
For IPv4 unicast routes, RFC 8950 permits:
- 16-byte
IPv6 next hop
- 32-byte
IPv6 next-hop field containing two addresses
9.2 VPNv4 with IPv6 next hop
For VPNv4, the next-hop field contains an additional 8-byte
Route Distinguisher field.
The single IPv6 VPN next-hop encoding consists of:
|
Component |
Length |
|
Route Distinguisher |
8 bytes |
|
IPv6 next-hop address |
16 bytes |
|
Total |
24 bytes |
Where two VPN IPv6 next hops are present, the total becomes
48 bytes.
Why the additional eight bytes matter
VPNv4 routes include VPN-specific information.
The MP_REACH_NLRI next-hop encoding must therefore follow
the VPN next-hop format.
A 16-byte IPv6 address alone is not the expected RFC 8950
encoding for VPNv4.
In this investigation, Juniper advertised:
VPNv4 next-hop length = 16 bytes
Cisco expected the VPN-specific encoding:
VPNv4 next-hop length = 24 bytes
Consequently, Cisco rejected the UPDATE with:
BGP NOTIFICATION 3/5
Important distinction
The RD associated with the VPNv4 NLRI and the RD field
within the VPN next-hop encoding are separate fields.
They serve different purposes within the BGP UPDATE.
This distinction is particularly important when
troubleshooting VPNv4 over an IPv6-only transport network.
Resolution: Enabling RFC 8950 Compliance
After identifying the encoding mismatch, I enabled the RFC
8950 compliance option in Junos.
Configuration applied
set protocols bgp rfc8950-compliant
The command was applied at the global BGP protocol
hierarchy.
Following the change, the BGP session established
successfully and VPNv4 route exchange began working.
Why the configuration resolved the issue
Before the change, Junos was advertising VPNv4 routes using
a 16-byte IPv6 next-hop field.
Enabling RFC 8950 compliance corrected the interoperability
behaviour observed in the lab.
The important distinction is that the existing:
family inet-vpn unicast extended-nexthop
configuration enabled extended next-hop capability
negotiation, while the additional compliance option addressed the UPDATE
encoding behaviour.
Note: This command was validated in the described lab
environment. Platform-specific support and default behaviour should be checked
before applying it across other Junos releases.
Post-Fix Validation
After applying the RFC 8950 compliance configuration, the
Juniper BGP summary confirmed that both peers were Established.
BGP session summary

The absence of active VPNv6 routes from this particular peer
does not imply that VPNv6 capability negotiation failed.
Route Advertisement Verification
The next step was to verify the prefixes being advertised
toward the Cisco Route Reflector.
Command

These outputs confirmed that the relevant IPv4 and IPv6 VPN
prefixes were selected for advertisement toward the Cisco RR.
Together with the BGP summary, they provided evidence that
the control-plane interoperability issue had been resolved.
Why This Issue Was Difficult to Troubleshoot
Several factors made this issue particularly interesting.
·
BGP established successfully
·
Extended next-hop capability was already
negotiated
·
VPNv6 worked correctly
·
Disabling SRv6 service advertisement did not
resolve the issue
·
Cisco provided the critical diagnostic
information
Key takeaway
When deploying VPNv4 over an IPv6/SRv6 core, successful
MP-BGP capability negotiation is not enough. The actual VPNv4 next-hop encoding
must comply with RFC 8950.
This is an important consideration for network engineers
designing and validating multivendor SRv6 networks.
References
- RFC 8950: Advertising IPv4
Network Layer Reachability Information with an IPv6 Next Hop
- Juniper
BGP User Guide
- Cisco
Community: SRv6 VPNv4 NCS540 Interoperability