Hello Iwase,

> But... the packet library should be follow the "on-wire"(RFC)  
> structure of packet,
> I guess.
> How about omitting "vni" key from "kwargs" before being passed to  
> EVPN NLIR class?
>
>
> $ git diff ryu/services/protocols/bgp/core_managers/table_manager.py
> diff --git  
> a/ryu/services/protocols/bgp/core_managers/table_manager.py  
> b/ryu/services/protocols/bgp/core_managers/table_manager.py
> index 0e084b8..7a4658b 100644
> --- a/ryu/services/protocols/bgp/core_managers/table_manager.py
> +++ b/ryu/services/protocols/bgp/core_managers/table_manager.py
> @@ -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"
> +                # field, 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)
>
>
>
> If Cisco NX-OS advertises "Inclusive Multicast Ethernet Tag Route"  
> with the BGP Encapsulation extended community as VXLAN  
> encapsulation, how about setting "tunnel_type" with "vni" at  
> BGPSpeaker?
>
>
> $ git diff ryu/services/protocols/bgp/bgpspeaker.py
> diff --git a/ryu/services/protocols/bgp/bgpspeaker.py  
> b/ryu/services/protocols/bgp/bgpspeaker.py
> index 6a0025c..a85b0bf 100644
> --- a/ryu/services/protocols/bgp/bgpspeaker.py
> +++ b/ryu/services/protocols/bgp/bgpspeaker.py
> @@ -638,6 +638,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,
>

With regard to the change to bgpspeaker.py: the VNI label is only sent  
when the pmsi_tunnel_type is PMSI_TYPE_INGRESS_REP and the tunnel_type  
is VXLAN (VNI) or NVGRE (VSID). Hence my reasoning for setting the vni  
under the pmsi_tunnel_type if clause.

Having said that, I applied these patches. That is:
- added the new "vni = kwargs.pop('vni', None)" code in  
services/protocols/bgp/core_managers/table_manager.py
- left my changes in, except in services/protocols/bgp/bgpspeaker.py ,  
where I:
   - removed "kwargs[EVPN_VNI] = vni" under "if pmsi_tunnel_type" and  
moved it under "if tunnel_type in" like above.

I've tested the new code ant it still works on the Cisco NX-OS side:


# sh l2route evpn imet all
Topology ID VNI         Prod  Originating Router IP Addr
----------- ----------- ----- ---------------------------------------
311         10311       BGP   10.1.1.126

# sh bgp l2vpn evpn received-paths
    Network            Next Hop            Metric     LocPrf     Weight Path
Route Distinguisher: 65511:10311    (L2VNI 10311)
* e[2]:[0]:[0]:[48]:[dead.beef.0000]:[0]:[0.0.0.0]/216
                       10.1.1.126                                 0  
65500 65501 65511 ?
*>e                   10.1.1.126                                 0  
65500 65501 65511 ?
* e[3]:[0]:[32]:[10.1.1.126]/88
                       10.1.1.126                                 0  
65500 65501 65511 ?
*>e                   10.1.1.126                                 0  
65500 65501 65511 ?


Thanks,
Albert


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to