[BGPCEP-672] ipv4-routes in remote peer's adj-rib-out do not contain path-id Created: 17/May/17  Updated: 20/Jul/21  Resolved: 22/Jan/18

Status: Verified
Project: bgpcep
Component/s: BGP
Affects Version/s: Bugzilla Migration
Fix Version/s: Oxygen

Type: Bug
Reporter: Marek Gradzki Assignee: Claudio David Gasparini
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File honeycomb.log    
External issue ID: 8481
Priority: Normal

 Description   

Following http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html, I configured

1) bgp instance

POST http://localhost:8181/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols

<protocol xmlns="http://openconfig.net/yang/network-instance">
<name>bgp-example</name>
<identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
<bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
<global>
<config>
<router-id>127.0.0.1</router-id>
<as>65000</as>
</config>
</global>
</bgp>
</protocol>

2) remote peer

POST http://localhost:8181/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors

<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
<neighbor-address>127.0.0.2</neighbor-address>
<timers>
<config>
<hold-time>90</hold-time>
<connect-retry>10</connect-retry>
</config>
</timers>
<transport>
<config>
<remote-port>17900</remote-port>
<passive-mode>false</passive-mode>
</config>
</transport>
<config>
<peer-type>INTERNAL</peer-type>
</config>
</neighbor>

3) started remote peer

java -jar ./target/bgp-testtool-0.6.3-Boron-SR3-executable.jar -ra 127.0.0.1:1790 -la 127.0.0.2:17900 -pr 2 -ll DEBUG --active true -as 65000

4) application peer

POST http://localhost:8181/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors

<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
<neighbor-address>10.25.1.10</neighbor-address>
<config>
<peer-group>application-peers</peer-group>
</config>
</neighbor>

5) ipv4 route

POST http://localhost:8181/restconf/config/bgp-rib:application-rib/10.25.1.10/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes

<ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
<path-id>0</path-id>
<prefix>10.0.0.11/32</prefix>
<attributes>
<as-path></as-path>
<origin>
<value>igp</value>
</origin>
<local-pref>
<pref>100</pref>
</local-pref>
<ipv4-next-hop>
<global>10.11.1.1</global>
</ipv4-next-hop>
</attributes>
</ipv4-route>

But when I try to read peer's adj-rib-out, I get:

<adj-rib-out xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
<tables>
<afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">x:linkstate-address-family</afi>
<safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">x:linkstate-subsequent-address-family</safi>
<linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate"></linkstate-routes>
<attributes></attributes>
</tables>
<tables>
<afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
<safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
<ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
<ipv4-route>
<prefix>10.0.0.11/32</prefix>
<attributes>
<as-path></as-path>
<origin>
<value>igp</value>
</origin>
<local-pref>
<pref>100</pref>
</local-pref>
<ipv4-next-hop>
<global>10.11.1.1</global>
</ipv4-next-hop>
</attributes>
</ipv4-route>
</ipv4-routes>
<attributes></attributes>
</tables>
</adj-rib-out>

This causes troubles for Honeycomb, because such data cannot be transformed to BA as path-id is part of route's key.



 Comments   
Comment by Marek Gradzki [ 17/May/17 ]

Here is exception we get in hc while reading ipv4 routes:

java.lang.NullPointerException: Supplied value may not be null
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226) ~[guava-18.0.jar:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.PathId.<init>(PathId.java:33) ~[bgp-parser-api-0.6.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.EncapsulatedValueCodec.deserialize(EncapsulatedValueCodec.java:69) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.ValueContext.deserialize(ValueContext.java:50) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.IdentifiableItemCodec.deserialize(IdentifiableItemCodec.java:101) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.IdentifiableItemCodec.deserialize(IdentifiableItemCodec.java:30) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.KeyedListNodeCodecContext.getBindingChildValue(KeyedListNodeCodecContext.java:64) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.LazyDataObject.getBindingData(LazyDataObject.java:148) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.LazyDataObject.invoke(LazyDataObject.java:71) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at com.sun.proxy.$Proxy19.getKey(Unknown Source) ~[na:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv4.routes.ipv4.routes.Ipv4Route$StreamWriter.serialize(DataObjectSerializerPrototype.java) ~[bgp-inet-0.6.3-Boron-SR3.jar:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv4.routes.Ipv4Routes$StreamWriter.serialize(DataObjectSerializerPrototype.java) ~[bgp-inet-0.6.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry$DataObjectSerializerProxy.serialize(BindingNormalizedNodeCodecRegistry.java:295) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry.toNormalizedNode(BindingNormalizedNodeCodecRegistry.java:106) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec.toNormalizedNode(BindingToNormalizedNodeCodec.java:135) ~[sal-binding-broker-impl-1.4.3-Boron-SR3.jar:na]
[...]

Full trace attached.

Comment by Marek Gradzki [ 17/May/17 ]

Attachment honeycomb.log has been added with description: honeycomb.log

Comment by Marek Gradzki [ 17/May/17 ]

path-id is written to DS if ADD-PATH is configured:

http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#additional-path

Comment by Yrineu Felipe Rodrigues [ 21/Sep/17 ]

At step 4) you're trying to advertise a route without an ASN, that's correct?

Comment by Marek Gradzki [ 17/Jan/18 ]

Not sure if I understand your question. At step 4) I configure application peer.

Then, in step 5), I configure route. Requests were taken from ODL docs.

But this is not that relevant.

 

Underlying issue here is that path-id is part of ipv4-route's key:

https://github.com/opendaylight/bgpcep/blob/stable/nitrogen/bgp/inet/src/main/yang/bgp-inet.yang#L66

And it is not filled if add-path was not configured (e.g. because peer does not support it).

Mdsal's codecs reject to deserialize such data, which

is expected behavior, because key is missing...

 

In my opinion BGP should always write path-id to DS.

Then some filter should be applied to remove ADD-PATH attribute (if peer does not support it),

before it is encoded to BGP message.

 

Comment by Claudio David Gasparini [ 19/Jan/18 ]

Bug confirmed. Based on https://tools.ietf.org/html/rfc6020#section-7.8.2.
All key leafs MUST be given values when a list entry is created.

Comment by Claudio David Gasparini [ 22/Jan/18 ]

https://git.opendaylight.org/gerrit/#/q/topic:BGPCEP-672+(status:open+OR+status:merged)

Generated at Wed Feb 07 19:13:47 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.