Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic support for constructing PMSI Tunnel info for Ingress Replication #62

Merged
merged 5 commits into from
Jan 23, 2018

Conversation

sanjmonkey
Copy link
Contributor

Hey,
I didn't have time to fully implement RFC6514 but here is some basic construction for sending Ingress Replication PMSI Tunnel Info which I wrote for something else I'm working on... feel free to accept if you find it useful

@coveralls
Copy link

coveralls commented Jan 2, 2018

Coverage Status

Coverage increased (+0.5%) to 60.448% when pulling add37b8 on claranet:master into c892a09 on smartbgp:master.

Copy link
Member

@xiaopeng163 xiaopeng163 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanjmonkey
Copy link
Contributor Author

Sure! I'll add the unit tests.

Though I noticed recently a lot of hw vendors are already implementing draft-ietf-bess-evpn-overlay-10 (which has just gone for WG last call in BESS), and this affects the encoding of PMSI Tunnel Attribute (PTA) label if its sent in EVPN and with certain values of 'encapsulation' extended community... I think I'll add support for that in PTA encoding first as it looks like its here to stay

Note; that evpn-overlay draft will also affect most of the EVPN RT's label1 encoding too, if encapsulation extended community is VXLAN or NVGRE. I dont mind working on a separate PR for that too, unless its already something you're already working on?

Sandy

@xiaopeng163
Copy link
Member

@sanjmonkey that's wonderful, please go on. we are working to improve BGPLS and SRTE recently, and for EVPN we do not have any plan just now.

and thanks for your effort.

@xiaopeng163
Copy link
Member

hi, @sanjmonkey any update for this? or should I merge this PR firstly?

@xiaopeng163
Copy link
Member

@sanjmonkey very thanks, please fix these two pep8 erros

pep8 runtests: commands[0] | flake8
./yabgp/tests/unit/message/test_update.py:292:36: E231 missing whitespace after ','
./yabgp/message/update.py:383:121: E501 line too long (125 > 120 characters)
ERROR: InvocationError: '/home/travis/build/smartbgp/yabgp/.tox/pep8/bin/flake8'

@xiaopeng163
Copy link
Member

thanks, if you have tested these code with real routers, please tell me, I can add them to the commit message, like what kind of routers and what is the version of it.

@sanjmonkey
Copy link
Contributor Author

Hi @xiaopeng163

I sent the following blob:

{
    "attr": {
        "1": 0,
        "2": [[2,[65527]]],
        "5": 0,
        "14": {
            "afi_safi": [
                25,
                70
            ],
            "nexthop": "192.168.1.10",
            "nlri": [
                {
                    "type": 3,
                    "value": {
                        "eth_tag_id": 0,
                        "ip": "192.168.1.10",
                        "rd": "65527:36802"
                    }
                }
            ]
        },
        "16": ["route-target:65527:36802",
               "encapsulation:8"
        ],
        "22": {
            "mpls_label": [60001],
            "tunnel_id": "192.168.1.10",
            "tunnel_type": 6,
            "leaf_info_required": 0
       }
    }
}

and confirmed accepted by the following routers, output of each here included for completeness.

CSR1000v: 15.5(3) S6b

BGP routing table entry for [3][65527:36802][0][32][192.168.1.10]/17, version 49
BGP Bestpath: deterministic-med
Paths: (1 available, best #1, table EVPN-BGP-Table)
  Advertised to update-groups:
     2          3
  Refresh Epoch 1
  65527, (Received from a RR-client)
    192.168.1.10 from 195.8.68.130 (127.0.0.1)
      Origin IGP, localpref 0, valid, internal, best
      Extended Community: RT:65527:36802 0x30C:0:8
      PMSI Attribute: for EVPN, Flags: 0x0, Tunnel type: 6, length 4, label: 3750 (vni 60001) tunnel parameters: C0A8 010A
      rx pathid: 0, tx pathid: 0x0

xrv9k - 6.2.25

# show bgp l2vpn evpn rd 65527:36802 [3][0][32][192.168.1.10]/80
Tue Jan 23 09:49:49.461 UTC
BGP routing table entry for [3][0][32][192.168.1.10]/80, Route Distinguisher: 65527:36802
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                  0           0
Last Modified: Jan 23 09:47:49.765 for 00:02:00
Paths: (1 available, no best path)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  65527, (Received from a RR-client)
    192.168.1.10 (inaccessible) from 195.8.68.130 (127.0.0.1)
      Received Label 0
      Origin IGP, localpref 0, valid, internal, not-in-vrf
      Received Path ID 0, Local Path ID 0, version 0
      Extended community: Encapsulation Type:8 RT:65527:36802
      PMSI: flags 0x00, type 6, label 60001, ID 0xc0a8010a

Junos vmx: 17.3R1.10

3:65527:36802::0::192.168.1.10/248 IM (1 entry, 1 announced)
        *BGP    Preference: 170/-1
                Route Distinguisher: 65527:36802
                PMSI: Flags 0x0: Label 3750: Type INGRESS-REPLICATION 192.168.1.10
                Next hop type: Indirect, Next hop index: 0
                Address: 0x5b25257c
                Next-hop reference count: 1
                Source: 62.231.143.4
                Protocol next hop: 192.168.1.10
                Indirect next hop: 0x2 no-forward INH Session ID: 0x0
                State: <Active Int Ext>
                Local AS:  8426 Peer AS:  8426
                Age: 3:15       Metric2: 0
                Validation State: unverified
                Task: BGP_8426.62.231.143.4
                Announcement bits (1): 0-BGP_RT_Background
                AS path: 65527 I
                Communities: target:65527:36802 encapsulation:vxlan(0x8)
                Accepted
                Localpref: 0
                Router ID: 62.231.143.4

Nokia: TiMOS-B-15.0.R6 both/x86_64 Nokia 7750

-------------------------------------------------------------------------------
Original Attributes

Network        : N/A
Nexthop        : 192.168.1.10
From           : 62.231.143.4
Res. Nexthop   : N/A
Local Pref.    : 0                      Interface Name : NotAvailable
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None
Connector      : None
Community      : target:65527:36802 bgp-tunnel-encap:VXLAN
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 62.231.143.4
Flags          : Valid  Best  IGP
Route Source   : Internal
AS-Path        : 65527
EVPN type      : INCL-MCAST
ESI            : N/A
Tag            : 0
Originator IP  : 192.168.1.10
Route Dist.    : 65527:36802
Route Tag      : 0
Neighbor-AS    : 65527
Orig Validation: N/A
Add Paths Send : Default
Last Modified  : 00h00m12s
-------------------------------------------------------------------------------
PMSI Tunnel Attributes :
Tunnel-type    : Ingress Replication
Flags          : Type: RNVE(0) BM: 0 U: 0 Leaf: not required
MPLS Label     : VNI 60001
Tunnel-Endpoint: 192.168.1.10
-------------------------------------------------------------------------------

Modified Attributes

Network        : N/A
Nexthop        : 192.168.1.10
From           : 62.231.143.4
Res. Nexthop   : N/A
Local Pref.    : 0                      Interface Name : NotAvailable
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None
Connector      : None
Community      : target:65527:36802 bgp-tunnel-encap:VXLAN
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 62.231.143.4
Flags          : Valid  Best  IGP
Route Source   : Internal
AS-Path        : 65527
EVPN type      : INCL-MCAST
ESI            : N/A
Tag            : 0
Originator IP  : 192.168.1.10
Route Dist.    : 65527:36802
Route Tag      : 0
Neighbor-AS    : 65527
Orig Validation: N/A
Add Paths Send : Default
Last Modified  : 00h00m47s
-------------------------------------------------------------------------------
PMSI Tunnel Attributes :
Tunnel-type    : Ingress Replication
Flags          : Type: RNVE(0) BM: 0 U: 0 Leaf: not required
MPLS Label     : VNI 60001
Tunnel-Endpoint: 192.168.1.10
-------------------------------------------------------------------------------

Nexus NX0S 7.0(3)I6(1) and 7.0(3)I7(2)

Route Distinguisher: 65527:36802    (L2VNI 60001)
BGP routing table entry for [3]:[0]:[32]:[192.168.1.10]/88, version 10926
Paths: (1 available, best #1)
Flags: (0x000012) on xmit-list, is in l2rib/evpn, is not in HW
Multipath: eBGP iBGP

  Advertised path-id 1
  Path type: internal, path is valid, imported same remote RD, is best path
  AS-Path: NONE, path sourced internal to AS
    192.168.1.10 (metric 200) from 195.8.68.130 (127.0.0.1)
      Origin IGP, MED not set, localpref 0, weight 0
      Extcommunity: RT:65527:36802 ENCAP:8
      PMSI Tunnel Attribute:
        flags: 0x00, Tunnel type: Ingress Replication
        Label: 60001, Tunnel Id: 192.168.1.10

  Path-id 1 not advertised to any peer

Sandy

@xiaopeng163 xiaopeng163 merged commit b383ce6 into smartbgp:master Jan 23, 2018
@xiaopeng163
Copy link
Member

thanks a lot, merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants