EPVN MPLS label parsing error
Ondrej Zajicek
santiago at crfreenet.org
Mon Oct 13 18:02:03 CEST 2025
On Sat, Oct 11, 2025 at 08:46:00AM +1100, William via Bird-users wrote:
> Hi Ondrej,
>
> Thanks for the fast reply! Just noticed the assorted typo's in the email.
>
> On 10/10/2025 11:42 pm, Ondrej Zajicek wrote:
>
> > On Fri, Oct 10, 2025 at 06:52:28PM +1100, William via Bird-users wrote:
> > > Hi BIRDians,
> > > Been tinkering with EPVN in (built from git on Debian 13.1) hooked into an
> > > Arista vEOS-LAB network, with an IPv6 underlay.
> > Hi
> >
> > I am glad to hear someone is playing with it. Do you use the 'evpn' branch?
>
> Yes I'm using the evpn branch:
>
> BIRD v2.13.1-161-gc5c9bd81-x ready.
You could also try more recent branch 'oz-evpn' (although the following
patch related to VNIs is also not included there).
There are some configuration changes in this branch, encapsulation-specific options are in its own subblock:
protocol evpn {
eth { table etab2; };
evpn;
encapsulation vxlan {
tunnel device "vxlan2";
router address 10.1.1.1;
};
rd 1:12;
route target (rt, 1, 0);
tag 2;
vni 12;
};
> > > Hang on... 627 HEX is 273... looks like the 2 bytes of the latter half of
> > > the RT is being trimmed by 4 bits.
> > First, note that the VNI is not decoded from RT, but from the MPLS field
> > of Multi-Protocol Reach NLRI (14) - last 24 bits (00 2738). It is just a
> > convention for RT to use the same value as VNI.
> >
> > IIRC there is a confusion about this field w.r.t. EVPN, as EVPN can use both
> > MPLS and VXLAN as underlying transport, VXLAN VNIs are 24 bit long, but
> > MPLS labels are 20 bit long and unfortunately padded from the LSB side.
> > So it si read as MPLS label, ignoring the last four bits.
>
> Gotta love standards! So that brings an interesting side case I wouldn't have
> thought of - the "usable" VNI range is trimmed due to this?
No, not really. It is just that EVPN/MPLS (RFC 7432) uses high 20 bits
out of 24, while EVPN/VXLAN uses full 24 bits. But the BIRD EVPN BGP does
not really care about whether it is MPLS or VXLAN (it could be any encapsulation
if it is just an EVPN route reflector).
The attached patch switches BGP code to use full 24 bits.
> > > I couldn't get a hang of the code to try and ID where it's playing up so
> > > sorry, no patch.
> > >
> > > Also, I'm not able to use 4-byte ASNs in the first part of the RT. The docs
> > > indicate that we should be able to, but the config barfs with out-of-range
> > > (was trying to use 1005001 - a subset of the ASNs being used).
> > In which context? From the config file below i see 'import target (rt, 1004001, 10040)',
> > so 32bit ASN.
>
> That was one of my typo's - I meant route descriptor, not route target.
rd / route distinguisher? It works for me even there:
protocol evpn {
...
# rd 1:13;
rd 1005001:10040;
route target (rt, 1, 0);
...
}
--
Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: evpn-fix-24bit-vni.patch
Type: text/x-diff
Size: 1618 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20251013/735dea0b/attachment.bin>
More information about the Bird-users
mailing list