mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-09 22:36:10 +02:00
BGPSpeaker: Advertise VNI on EVPN Multicast Ethernet-Tag
For the interoperability with other MP BGP EVPN VXLAN implementations (e.g., Cisco NX-OS), this patch enables to advertise the VNI with the PMSI Tunnel attribute on the Inclusive Multicast Ethernet Tag Route messages. Suggested-by: Albert Siersema <albert@mediacaster.nl> Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
6e78aa3b94
commit
e13f46b256
@ -581,18 +581,25 @@ class BGPSpeaker(object):
|
||||
|
||||
``vni`` specifies an Virtual Network Identifier for VXLAN
|
||||
or Virtual Subnet Identifier for NVGRE.
|
||||
If tunnel_type is not 'vxlan' or 'nvgre', this field is ignored.
|
||||
If tunnel_type is not TUNNEL_TYPE_VXLAN or TUNNEL_TYPE_NVGRE,
|
||||
this field is ignored.
|
||||
|
||||
``next_hop`` specifies the next hop address for this prefix.
|
||||
|
||||
``tunnel_type`` specifies the data plane encapsulation type
|
||||
to advertise. By the default, this encapsulation attribute is
|
||||
not advertised.
|
||||
to advertise.
|
||||
By the default, this attribute is not advertised.
|
||||
The supported encapsulation types are TUNNEL_TYPE_VXLAN and
|
||||
TUNNEL_TYPE_NVGRE.
|
||||
|
||||
``pmsi_tunnel_type`` specifies the type of the PMSI tunnel attribute
|
||||
used to encode the multicast tunnel identifier.
|
||||
This field is advertised only if route_type is
|
||||
EVPN_MULTICAST_ETAG_ROUTE.
|
||||
By the default, this attribute is not advertised.
|
||||
The supported PMSI tunnel types are PMSI_TYPE_NO_TUNNEL_INFO and
|
||||
PMSI_TYPE_INGRESS_REP.
|
||||
This attribute can also carry vni if tunnel_type is specified.
|
||||
|
||||
``redundancy_mode`` specifies a redundancy mode type.
|
||||
The supported redundancy mode types are REDUNDANCY_MODE_ALL_ACTIVE
|
||||
@ -638,6 +645,9 @@ class BGPSpeaker(object):
|
||||
EVPN_ETHERNET_TAG_ID: ethernet_tag_id,
|
||||
IP_ADDR: ip_addr,
|
||||
})
|
||||
# Set tunnel type specific arguments
|
||||
if tunnel_type in [TUNNEL_TYPE_VXLAN, TUNNEL_TYPE_NVGRE]:
|
||||
kwargs[EVPN_VNI] = vni
|
||||
# Set PMSI Tunnel Attribute arguments
|
||||
if pmsi_tunnel_type in [
|
||||
PMSI_TYPE_NO_TUNNEL_INFO,
|
||||
|
||||
@ -36,6 +36,7 @@ from ryu.lib.packet.bgp import EvpnEsi
|
||||
from ryu.lib.packet.bgp import EvpnArbitraryEsi
|
||||
from ryu.lib.packet.bgp import EvpnNLRI
|
||||
from ryu.lib.packet.bgp import EvpnMacIPAdvertisementNLRI
|
||||
from ryu.lib.packet.bgp import EvpnInclusiveMulticastEthernetTagNLRI
|
||||
from ryu.lib.packet.bgp import IPAddrPrefix
|
||||
from ryu.lib.packet.bgp import IP6AddrPrefix
|
||||
|
||||
@ -543,6 +544,10 @@ class TableCoreManager(object):
|
||||
if route_type == EvpnMacIPAdvertisementNLRI.ROUTE_TYPE_NAME:
|
||||
# MPLS labels will be assigned automatically
|
||||
kwargs['mpls_labels'] = []
|
||||
if route_type == EvpnInclusiveMulticastEthernetTagNLRI.ROUTE_TYPE_NAME:
|
||||
# Inclusive Multicast Ethernet Tag Route does not have "vni",
|
||||
# omit "vni" from "kwargs" here.
|
||||
vni = kwargs.pop('vni', None)
|
||||
subclass = EvpnNLRI._lookup_type_name(route_type)
|
||||
kwargs['route_dist'] = route_dist
|
||||
esi = kwargs.get('esi', None)
|
||||
|
||||
@ -319,7 +319,8 @@ class VrfTable(Table):
|
||||
pattrs[BGP_ATTR_TYEP_PMSI_TUNNEL_ATTRIBUTE] = \
|
||||
BGPPathAttributePmsiTunnel(pmsi_flags=0,
|
||||
tunnel_type=pmsi_tunnel_type,
|
||||
tunnel_id=tunnel_id)
|
||||
tunnel_id=tunnel_id,
|
||||
vni=kwargs.get('vni', None))
|
||||
|
||||
puid = self.VRF_PATH_CLASS.create_puid(
|
||||
vrf_conf.route_dist, nlri.prefix)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user