[BGPCEP-108] AsPath is not parsed correctly (real BGP feed) Created: 15/Jul/14  Updated: 03/Mar/19  Due: 16/Jul/14  Resolved: 18/Jul/14

Status: Resolved
Project: bgpcep
Component/s: General
Affects Version/s: Bugzilla Migration
Fix Version/s: Bugzilla Migration

Type: Bug
Reporter: Peter Gubka Assignee: Milos Fabian
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Attachments: Text File real_feed.log    
External issue ID: 1370
Priority: Normal

 Description   

After connecting to real bgp feed lots of exceptiosn appeared in the log. Then one below should be the source of problems.

Full log in attachment.

2014-07-15 03:10:25.378 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-7-1] TRACE o.o.p.b.r.i.BGPByteToMessageDecoder - Received to decode: ffffffffffffffffffffffffffffffff005102000000364001010040021a02060000fe550000fc120000006d0
00002bd00000d1c00006a744003040a2000fe800404000000004005040000006418a8a1f7
2014-07-15 03:10:25.378 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-7-1] TRACE o.o.p.b.p.i.m.BGPUpdateMessageParser - Started parsing of update message: 000000364001010040021a02060000fe550000fc120000006d000002bd00000d1c00006a7
44003040a2000fe800404000000004005040000006418a8a1f7
2014-07-15 03:10:25.380 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-7-1] DEBUG o.o.p.b.p.s.p.SimpleAttributeRegistry - Parsing attribute type 1
2014-07-15 03:10:25.382 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-7-1] DEBUG o.o.p.b.p.s.p.SimpleAttributeRegistry - Parsing attribute type 2
2014-07-15 03:10:25.403 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-7-1] WARN o.o.p.b.p.i.m.BGPUpdateMessageParser - Could not parse BGP attributes
org.opendaylight.protocol.bgp.parser.BGPParsingException: AS Path segment type unknown : 0
at org.opendaylight.protocol.bgp.parser.impl.message.update.AsPathAttributeParser.parseAsPath(AsPathAttributeParser.java:71) ~[bundlefile:na]
at org.opendaylight.protocol.bgp.parser.impl.message.update.AsPathAttributeParser.parseAttribute(AsPathAttributeParser.java:98) ~[bundlefile:na]
at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleAttributeRegistry.parseAttributes(SimpleAttributeRegistry.java:121) ~[na:na]
at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:87) [bundlefile:na]
at org.opendaylight.protocol.bgp.parser.impl.message.BGPUpdateMessageParser.parseMessageBody(BGPUpdateMessageParser.java:45) [bundlefile:na]
at org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleMessageRegistry.parseBody(SimpleMessageRegistry.java:31) [bundlefile:na]
at org.opendaylight.protocol.bgp.parser.spi.AbstractMessageRegistry.parseMessage(AbstractMessageRegistry.java:60) [bundlefile:na]
at org.opendaylight.protocol.bgp.rib.impl.BGPByteToMessageDecoder.decode(BGPByteToMessageDecoder.java:41) [bundlefile:na]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:241) [bundlefile:4.0.19.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:149) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327) [bundlefile:4.0.19.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327) [bundlefile:4.0.19.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [bundlefile:4.0.19.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126) [bundlefile:4.0.19.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507) [bundlefile:4.0.19.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464) [bundlefile:4.0.19.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378) [bundlefile:4.0.19.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350) [bundlefile:4.0.19.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [bundlefile:4.0.19.Final]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_55]
2014-07-15 03:10:25.407 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-7-1] ERROR o.o.p.b.p.BGPDocumentedException - Error = MALFORMED_ATTR_LIST
org.opendaylight.protocol.bgp.parser.BGPDocumentedException: Could not parse BGP attributes.



 Comments   
Comment by Peter Gubka [ 15/Jul/14 ]

Attachment real_feed.log has been added with description: log file

Comment by Milos Fabian [ 16/Jul/14 ]

The first step - ensure all message's bytes are read, even if deserialization exception is thrown
https://git.opendaylight.org/gerrit/#/c/9027/

Comment by Milos Fabian [ 16/Jul/14 ]

The root cause of problem is bad input - 4-byte AS Numbers are sent in AS path segment (AS set or AS sequence). Parser properly expects 2-byte AS Numbers.
Ref.: http://tools.ietf.org/html/rfc4271#section-4.3

Comment by Milos Fabian [ 17/Jul/14 ]

(In reply to Milos Fabian from comment #2)
> The root cause of problem is bad input - 4-byte AS Numbers are sent in AS
> path segment (AS set or AS sequence). Parser properly expects 2-byte AS
> Numbers.
> Ref.: http://tools.ietf.org/html/rfc4271#section-4.3

The expectation above is incorrect - we must support 4-byte AS Number by default, since AS4Bytes capability is advertised.

Comment by Milos Fabian [ 18/Jul/14 ]

The connection can be established only between BGP speaker and BGP peer, when both advertise support for four-octet AS Number capability, otherwise negotiation fails.
https://git.opendaylight.org/gerrit/#/c/9106/

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