Skip to content

Conversation

@cmoeller-dx
Copy link

@cmoeller-dx cmoeller-dx commented Aug 12, 2020

IPv6:
This commit adds the ability to parse packets, captured by ipv6 speakers.
It is also possible to parse multiprotocol BGP-messages. IPv4 (testing required) and IPv6 are understood protocols.

Filtering source and destination ipv6 addresses is also possible. Filtering REACH_NLRI and UNREACH_NLRI fields are currently not implemented.

Output could look like this:

[BGPMessage UPDATE] - 134 Bytes
|- MAC: 08:ec:f5:2a:8f:c9 -> 40:a6:b7:03:d1:28
|- IP: [1337:7f8:0:0:0:c4:0:1]:23492 -> [de34:7f8:0:0:0:42:ace:666]:179
|- Timestamp: 2020-08-03 18:49:01.458039 (1596480541.458039)
|
|- Path Attributes: 
|--- MP_REACH_NLRI:
|----- Next Hop:
|----- 1337:7f8:0:0:0:c5:0:1
|----- 1337:0:0:0:aec:ace:eac:ce1
|----- 
|----- NLRI:
|----- 1337:42:95::/48
.
.
.

Because of the differnces between ipv4 and ipv6 i changed the signature of the following classmethod

BGPRoute.from_binary(cls, prefix, prefix_length) 
-> 
BGPRoute.from_binary(cls, prefix, prefix_length, proto=BGPStatics.IP4_CODE)

This allows us to interpret ipv6 prefixes. The only thing which is not implemented is the ability to represent the ipv6 address as a number (16byte int). For consistency reason, i understand why one would implement a BGPRoute.decimal_ip_to_string() function for ipv6, but its not necessary at this point since its not used.
Feel free to contribute if you want to :)

VLAN/QinQ:
Ethernet frames containing a VLAN or QinQ tag are now able to be processed.
Filtering is also possible: --filter-service-vlan --filter-customer-vlan
If theres a VLAN tag only, use --filter-customer-vlan

With this commit no options or filter syntax changed, so you can use the parser just like before that commit.

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.

1 participant