All Projects → t2mune → Mrtparse

t2mune / Mrtparse

Licence: apache-2.0
MRT format data parser

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Mrtparse

ebook
Third edition of the Computer Networking: Principles, Protocols and Practice ebook
Stars: ✭ 64 (-26.44%)
Mutual labels:  bgp
Bgpalerter
Software to monitor streams of BGP data. Pre-configured for real-time detection of visibility loss, RPKI invalid announcements, hijacks, and more.
Stars: ✭ 367 (+321.84%)
Mutual labels:  bgp
Bgpmon
CSU's BGP Observatory code (bgpmon/pheme)
Stars: ✭ 25 (-71.26%)
Mutual labels:  bgp
gobgp exporter
Prometheus Exporter for GoBGP
Stars: ✭ 15 (-82.76%)
Mutual labels:  bgp
Bgp Battleships
Play battleships using BGP
Stars: ✭ 340 (+290.8%)
Mutual labels:  bgp
Pyexfil
A Python Package for Data Exfiltration
Stars: ✭ 554 (+536.78%)
Mutual labels:  bgp
NeoNetwork
A useless VPN Network ready for peering
Stars: ✭ 46 (-47.13%)
Mutual labels:  bgp
China Operator Ip
中国运营商IPv4/IPv6地址库-每日更新
Stars: ✭ 1,255 (+1342.53%)
Mutual labels:  bgp
Metallb
A network load-balancer implementation for Kubernetes using standard routing protocols
Stars: ✭ 4,306 (+4849.43%)
Mutual labels:  bgp
Vrnetlab
Run virtual routers with docker
Stars: ✭ 731 (+740.23%)
Mutual labels:  bgp
mabo
MRT Parser
Stars: ✭ 46 (-47.13%)
Mutual labels:  bgp
Bgp Dashboard
BGP Dashboard and Monitoring Web Application
Stars: ✭ 268 (+208.05%)
Mutual labels:  bgp
Libnet
A portable framework for low-level network packet construction
Stars: ✭ 640 (+635.63%)
Mutual labels:  bgp
bagpipe-cni
CNI plugin for BaGPipe BGP
Stars: ✭ 14 (-83.91%)
Mutual labels:  bgp
Network Examples
Linux networking examples and tutorials
Stars: ✭ 837 (+862.07%)
Mutual labels:  bgp
freeRouter
freeRouter - networking swiss army knife
Stars: ✭ 26 (-70.11%)
Mutual labels:  bgp
Cnp3
Computer Networking : Principles, Protocols and Practice (first and second edition, third edition is being written on https://github.com/cnp3/ebook)
Stars: ✭ 471 (+441.38%)
Mutual labels:  bgp
Kubernetes Bgp
Kubernetes on Equinix Metal using Calico and MetalLB
Stars: ✭ 87 (+0%)
Mutual labels:  bgp
Peerfinder
Tool to find common points between ASNs on PeeringDB
Stars: ✭ 42 (-51.72%)
Mutual labels:  bgp
Pmacct
pmacct is a small set of multi-purpose passive network monitoring tools [NetFlow IPFIX sFlow libpcap BGP BMP RPKI IGP Streaming Telemetry].
Stars: ✭ 677 (+678.16%)
Mutual labels:  bgp

mrtparse ########

Introduction

| mrtparse is a module to read and analyze the MRT format data. | The MRT format can be used to export routing protocol messages, state changes, and routing information base contents, and is defined in RFC6396_. | Programs like FRRouting_, Quagga_, Zebra_, BIRD_, OpenBGPD_ and PyRT_ can dump the MRT format data. | You can also download archives from the Route Views Projects, RIPE NCC.

.. _RFC6396: https://tools.ietf.org/html/rfc6396 .. _FRRouting: https://frrouting.org/ .. _Quagga: https://www.nongnu.org/quagga/ .. _Zebra: https://www.gnu.org/software/zebra/ .. _BIRD: https://bird.network.cz/ .. _OpenBGPD: http://www.openbgpd.org/ .. _PyRT: https://github.com/mor1/pyrt .. _the Route Views Projects: http://archive.routeviews.org/ .. _RIPE NCC: https://www.ripe.net/analyse/internet-measurements/routing-information-service-ris/ris-raw-data

Support

Python Version

If you want your code to run faster, you should use PyPy or PyPy3.

  • Python2
  • Python3
  • PyPy
  • PyPy3

MRT Type

+-------------------+---------+ | Name | Value | +===================+=========+ | TABLE_DUMP | 12 | +-------------------+---------+ | TABLE_DUMP_V2 | 13 | +-------------------+---------+ | BGP4MP | 16 | +-------------------+---------+ | BGP4MP_ET | 17 | +-------------------+---------+

TABLE_DUMP Subtype

+-------------------+---------+ | Name | Value | +===================+=========+ | AFI_IPv4 | 1 | +-------------------+---------+ | AFI_IPv6 | 2 | +-------------------+---------+

TABLE_DUMP_V2 Subtype

+-------------------------------+---------+ | Name | Value | +===============================+=========+ | PEER_INDEX_TABLE | 1 | +-------------------------------+---------+ | RIB_IPV4_UNICAST | 2 | +-------------------------------+---------+ | RIB_IPV4_MULTICAST | 3 | +-------------------------------+---------+ | RIB_IPV6_UNICAST | 4 | +-------------------------------+---------+ | RIB_IPV6_MULTICAST | 5 | +-------------------------------+---------+ | RIB_GENERIC | 6 | +-------------------------------+---------+ | RIB_IPV4_UNICAST_ADDPATH | 8 | +-------------------------------+---------+ | RIB_IPV4_MULTICAST_ADDPATH | 9 | +-------------------------------+---------+ | RIB_IPV6_UNICAST_ADDPATH | 10 | +-------------------------------+---------+ | RIB_IPV6_MULTICAST_ADDPATH | 11 | +-------------------------------+---------+ | RIB_GENERIC_ADDPATH | 12 | +-------------------------------+---------+

BGP4MP/BGP4MP_ET Subtype

+--------------------------------------+---------+ | Name | Value | +======================================+=========+ | BGP4MP_STATE_CHANGE | 0 | +--------------------------------------+---------+ | BGP4MP_MESSAGE | 1 | +--------------------------------------+---------+ | BGP4MP_MESSAGE_AS4 | 4 | +--------------------------------------+---------+ | BGP4MP_STATE_CHANGE_AS4 | 5 | +--------------------------------------+---------+ | BGP4MP_MESSAGE_LOCAL | 6 | +--------------------------------------+---------+ | BGP4MP_MESSAGE_AS4_LOCAL | 7 | +--------------------------------------+---------+ | BGP4MP_MESSAGE_ADDPATH | 8 | +--------------------------------------+---------+ | BGP4MP_MESSAGE_AS4_ADDPATH | 9 | +--------------------------------------+---------+ | BGP4MP_MESSAGE_LOCAL_ADDPATH | 10 | +--------------------------------------+---------+ | BGP4MP_MESSAGE_AS4_LOCAL_ADDPATH | 11 | +--------------------------------------+---------+

BGP Capability

+--------------------------------------------+---------+ | Name | Value | +============================================+=========+ | Multiprotocol Extensions for BGP-4 | 1 | +--------------------------------------------+---------+ | Route Refresh Capability for BGP-4 | 2 | +--------------------------------------------+---------+ | Outbound Route Filtering Capability | 3 | +--------------------------------------------+---------+ | Graceful Restart Capability | 64 | +--------------------------------------------+---------+ | Support for 4-octet AS number capability | 65 | +--------------------------------------------+---------+ | ADD-PATH Capability | 69 | +--------------------------------------------+---------+

BGP Attribute

+-------------------------+---------+ | Name | Value | +=========================+=========+ | ORIGIN | 1 | +-------------------------+---------+ | AS_PATH | 2 | +-------------------------+---------+ | NEXT_HOP | 3 | +-------------------------+---------+ | MULTI_EXIT_DISC | 4 | +-------------------------+---------+ | LOCAL_PREF | 5 | +-------------------------+---------+ | ATOMIC_AGGREGATE | 6 | +-------------------------+---------+ | AGGREGATOR | 7 | +-------------------------+---------+ | COMMUNITY | 8 | +-------------------------+---------+ | ORIGINATOR_ID | 9 | +-------------------------+---------+ | CLUSTER_LIST | 10 | +-------------------------+---------+ | MP_REACH_NLRI | 14 | +-------------------------+---------+ | MP_UNREACH_NLRI | 15 | +-------------------------+---------+ | EXTENDED COMMUNITIES | 16 | +-------------------------+---------+ | AS4_PATH | 17 | +-------------------------+---------+ | AS4_AGGREGATOR | 18 | +-------------------------+---------+ | AIGP | 26 | +-------------------------+---------+ | LARGE_COMMUNITY | 32 | +-------------------------+---------+ | ATTR_SET | 128 | +-------------------------+---------+

Installation

::

$ pip install mrtparse

or

::

$ git clone https://github.com/t2mune/mrtparse.git
$ cd mrtparse
$ python setup.py install

Usage

First, import the module.

::

from mrtparse import *

or

::

import mrtparse

| And pass a MRT format data as a filepath string or file object to a class Reader(). | It is also supported gzip and bzip2 format. | You can retrieve each entry from the returned object using a loop and then process it. |

::

for entry in Reader(f):
    # Parsed data is stored in "entry.data"
    <statements>

We have prepared some example scripts and sample data in "examples"_ and "samples"_ directory.

.. _"examples": examples .. _"samples": samples

Authors

| Tetsumune KISO [email protected] | Yoshiyuki YAMAUCHI [email protected] | Nobuhiro ITOU [email protected]

License

| Licensed under the Apache License, Version 2.0_ | Copyright (C) 2020 Tetsumune KISO

.. _Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].