| 1 |
Metadata-Version: 1.1 |
| 2 |
Name: mrtparse |
| 3 |
Version: 1.6 |
| 4 |
Summary: MRT format data parser |
| 5 |
Home-page: https://github.com/YoshiyukiYamauchi/mrtparse |
| 6 |
Author: Tetsumune KISO, Yoshiyuki YAMAUCHI, Nobuhiro ITOU |
| 7 |
Author-email: [email protected], [email protected], [email protected] |
| 8 |
License: Apache License 2.0 |
| 9 |
Description: mrtparse |
| 10 |
======== |
| 11 |
|
| 12 |
| mrtparse is a module to read and analyze the MRT format data. |
| 13 |
| The MRT format can be used to export routing protocol messages, state changes, and routing information base contents, and is defined in RFC6396_. |
| 14 |
| Programs like Quagga_ / Zebra_, BIRD_, OpenBGPD_ and PyRT_ can dump the MRT format data. |
| 15 |
| You can also download archives from `the Route Views Projects`_, `RIPE NCC`_. |
| 16 |
|
| 17 |
.. _RFC6396: https://tools.ietf.org/html/rfc6396 |
| 18 |
.. _Quagga: http://www.nongnu.org/quagga/ |
| 19 |
.. _Zebra: https://www.gnu.org/software/zebra/ |
| 20 |
.. _BIRD: http://bird.network.cz/ |
| 21 |
.. _OpenBGPD: http://www.openbgpd.org/ |
| 22 |
.. _PyRT: https://github.com/mor1/pyrt |
| 23 |
.. _`the Route Views Projects`: http://archive.routeviews.org/ |
| 24 |
.. _`RIPE NCC`: https://www.ripe.net/analyse/internet-measurements/routing-information-service-ris/ris-raw-data |
| 25 |
|
| 26 |
Supported MRT types |
| 27 |
------------------- |
| 28 |
|
| 29 |
+-------------------+---------+ |
| 30 |
| Name | Value | |
| 31 |
+===================+=========+ |
| 32 |
| TABLE\_DUMP | 12 | |
| 33 |
+-------------------+---------+ |
| 34 |
| TABLE\_DUMP\_V2 | 13 | |
| 35 |
+-------------------+---------+ |
| 36 |
| BGP4MP | 16 | |
| 37 |
+-------------------+---------+ |
| 38 |
| BGP4MP\_ET | 17 | |
| 39 |
+-------------------+---------+ |
| 40 |
|
| 41 |
Supported TABLE_DUMP subtypes |
| 42 |
------------------------------ |
| 43 |
|
| 44 |
+-------------------+---------+ |
| 45 |
| Name | Value | |
| 46 |
+===================+=========+ |
| 47 |
| AFI\_IPv4 | 1 | |
| 48 |
+-------------------+---------+ |
| 49 |
| AFI\_IPv6 | 2 | |
| 50 |
+-------------------+---------+ |
| 51 |
|
| 52 |
Supported TABLE_DUMP_V2 subtypes |
| 53 |
-------------------------------- |
| 54 |
|
| 55 |
+-------------------------------+---------+ |
| 56 |
| Name | Value | |
| 57 |
+===============================+=========+ |
| 58 |
| PEER_INDEX_TABLE | 1 | |
| 59 |
+-------------------------------+---------+ |
| 60 |
| RIB\_IPV4\_UNICAST | 2 | |
| 61 |
+-------------------------------+---------+ |
| 62 |
| RIB\_IPV4\_MULTICAST | 3 | |
| 63 |
+-------------------------------+---------+ |
| 64 |
| RIB\_IPV6\_UNICAST | 4 | |
| 65 |
+-------------------------------+---------+ |
| 66 |
| RIB\_IPV6\_MULTICAST | 5 | |
| 67 |
+-------------------------------+---------+ |
| 68 |
| RIB\_GENERIC | 6 | |
| 69 |
+-------------------------------+---------+ |
| 70 |
| RIB\_IPV4\_UNICAST\_ADDPATH | 8 | |
| 71 |
+-------------------------------+---------+ |
| 72 |
| RIB\_IPV4\_MULTICAST\_ADDPATH | 9 | |
| 73 |
+-------------------------------+---------+ |
| 74 |
| RIB\_IPV6\_UNICAST\_ADDPATH | 10 | |
| 75 |
+-------------------------------+---------+ |
| 76 |
| RIB\_IPV6\_MULTICAST\_ADDPATH | 11 | |
| 77 |
+-------------------------------+---------+ |
| 78 |
| RIB\_GENERIC\_ADDPATH | 12 | |
| 79 |
+-------------------------------+---------+ |
| 80 |
|
| 81 |
Supported BGP4MP/BGP4MP_ET subtypes |
| 82 |
----------------------------------- |
| 83 |
|
| 84 |
+--------------------------------------+---------+ |
| 85 |
| Name | Value | |
| 86 |
+======================================+=========+ |
| 87 |
| BGP4MP\_STATE\_CHANGE | 0 | |
| 88 |
+--------------------------------------+---------+ |
| 89 |
| BGP4MP\_MESSAGE | 1 | |
| 90 |
+--------------------------------------+---------+ |
| 91 |
| BGP4MP\_MESSAGE\_AS4 | 4 | |
| 92 |
+--------------------------------------+---------+ |
| 93 |
| BGP4MP\_STATE\_CHANGE\_AS4 | 5 | |
| 94 |
+--------------------------------------+---------+ |
| 95 |
| BGP4MP\_MESSAGE\_LOCAL | 6 | |
| 96 |
+--------------------------------------+---------+ |
| 97 |
| BGP4MP\_MESSAGE\_AS4\_LOCAL | 7 | |
| 98 |
+--------------------------------------+---------+ |
| 99 |
| BGP4MP\_MESSAGE\_ADDPATH | 8 | |
| 100 |
+--------------------------------------+---------+ |
| 101 |
| BGP4MP\_MESSAGE\_AS4\_ADDPATH | 9 | |
| 102 |
+--------------------------------------+---------+ |
| 103 |
| BGP4MP\_MESSAGE\_LOCAL\_ADDPATH | 10 | |
| 104 |
+--------------------------------------+---------+ |
| 105 |
| BGP4MP\_MESSAGE\_AS4\_LOCAL\_ADDPATH | 11 | |
| 106 |
+--------------------------------------+---------+ |
| 107 |
|
| 108 |
Supported BGP capabilities |
| 109 |
-------------------------- |
| 110 |
|
| 111 |
+--------------------------------------------+---------+ |
| 112 |
| Name | Value | |
| 113 |
+============================================+=========+ |
| 114 |
| Multiprotocol Extensions for BGP-4 | 1 | |
| 115 |
+--------------------------------------------+---------+ |
| 116 |
| Route Refresh Capability for BGP-4 | 2 | |
| 117 |
+--------------------------------------------+---------+ |
| 118 |
| Outbound Route Filtering Capability | 3 | |
| 119 |
+--------------------------------------------+---------+ |
| 120 |
| Graceful Restart Capability | 64 | |
| 121 |
+--------------------------------------------+---------+ |
| 122 |
| Support for 4-octet AS number capability | 65 | |
| 123 |
+--------------------------------------------+---------+ |
| 124 |
| ADD-PATH Capability | 69 | |
| 125 |
+--------------------------------------------+---------+ |
| 126 |
|
| 127 |
Supported BGP attributes |
| 128 |
------------------------ |
| 129 |
|
| 130 |
+-------------------------+---------+ |
| 131 |
| Name | Value | |
| 132 |
+=========================+=========+ |
| 133 |
| ORIGIN | 1 | |
| 134 |
+-------------------------+---------+ |
| 135 |
| AS\_PATH | 2 | |
| 136 |
+-------------------------+---------+ |
| 137 |
| NEXT\_HOP | 3 | |
| 138 |
+-------------------------+---------+ |
| 139 |
| MULTI\_EXIT\_DISC | 4 | |
| 140 |
+-------------------------+---------+ |
| 141 |
| LOCAL\_PREF | 5 | |
| 142 |
+-------------------------+---------+ |
| 143 |
| ATOMIC\_AGGREGATE | 6 | |
| 144 |
+-------------------------+---------+ |
| 145 |
| AGGREGATOR | 7 | |
| 146 |
+-------------------------+---------+ |
| 147 |
| COMMUNITY | 8 | |
| 148 |
+-------------------------+---------+ |
| 149 |
| ORIGINATOR\_ID | 9 | |
| 150 |
+-------------------------+---------+ |
| 151 |
| CLUSTER\_LIST | 10 | |
| 152 |
+-------------------------+---------+ |
| 153 |
| MP\_REACH\_NLRI | 14 | |
| 154 |
+-------------------------+---------+ |
| 155 |
| MP\_UNREACH\_NLRI | 15 | |
| 156 |
+-------------------------+---------+ |
| 157 |
| EXTENDED\_COMMUNITIES | 16 | |
| 158 |
+-------------------------+---------+ |
| 159 |
| AS4\_PATH | 17 | |
| 160 |
+-------------------------+---------+ |
| 161 |
| AS4\_AGGREGATOR | 18 | |
| 162 |
+-------------------------+---------+ |
| 163 |
| AIGP | 26 | |
| 164 |
+-------------------------+---------+ |
| 165 |
| LARGE\_COMMUNITY | 32 | |
| 166 |
+-------------------------+---------+ |
| 167 |
| ATTR\_SET | 128 | |
| 168 |
+-------------------------+---------+ |
| 169 |
|
| 170 |
Requirements |
| 171 |
------------ |
| 172 |
|
| 173 |
Python2 or Python3 or PyPy or PyPy3 |
| 174 |
|
| 175 |
Installation |
| 176 |
------------ |
| 177 |
|
| 178 |
:: |
| 179 |
|
| 180 |
$ pip install mrtparse |
| 181 |
|
| 182 |
or |
| 183 |
|
| 184 |
:: |
| 185 |
|
| 186 |
$ git clone https://github.com/YoshiyukiYamauchi/mrtparse.git |
| 187 |
$ cd mrtparse |
| 188 |
$ python setup.py install |
| 189 |
|
| 190 |
Usage |
| 191 |
----- |
| 192 |
|
| 193 |
:: |
| 194 |
|
| 195 |
from mrtparse import * |
| 196 |
|
| 197 |
or |
| 198 |
|
| 199 |
:: |
| 200 |
|
| 201 |
import mrtparse |
| 202 |
|
| 203 |
Programming |
| 204 |
----------- |
| 205 |
|
| 206 |
First, import the module. |
| 207 |
|
| 208 |
:: |
| 209 |
|
| 210 |
from mrtparse import * |
| 211 |
|
| 212 |
| And pass a MRT format data as a filepath string or file object to a class Reader(). |
| 213 |
| It is also supported gzip and bzip2 format. |
| 214 |
| You can retrieve each entry from the returned object using a loop and then process it. |
| 215 |
|
| 216 |
:: |
| 217 |
|
| 218 |
d = Reader(f) |
| 219 |
for m in d: |
| 220 |
<statements> |
| 221 |
|
| 222 |
We have prepared some example scripts and sample data in `"examples"`_ and `"samples"`_ directory. |
| 223 |
|
| 224 |
.. _`"examples"`: https://github.com/YoshiyukiYamauchi/mrtparse/tree/master/examples |
| 225 |
.. _`"samples"`: https://github.com/YoshiyukiYamauchi/mrtparse/tree/master/samples |
| 226 |
|
| 227 |
Authors |
| 228 |
------- |
| 229 |
|
| 230 |
| Tetsumune KISO [email protected] |
| 231 |
| Yoshiyuki YAMAUCHI [email protected] |
| 232 |
| Nobuhiro ITOU [email protected] |
| 233 |
|
| 234 |
License |
| 235 |
------- |
| 236 |
|
| 237 |
| Licensed under the `Apache License, Version 2.0`_ |
| 238 |
| Copyright © 2017 Tetsumune KISO |
| 239 |
|
| 240 |
.. _`Apache License, Version 2.0`: http://www.apache.org/licenses/LICENSE-2.0 |
| 241 |
|
| 242 |
Keywords: mrt bgp |
| 243 |
Platform: any |
| 244 |
Classifier: Development Status :: 5 - Production/Stable |
| 245 |
Classifier: Intended Audience :: Developers |
| 246 |
Classifier: Intended Audience :: System Administrators |
| 247 |
Classifier: Intended Audience :: Telecommunications Industry |
| 248 |
Classifier: License :: OSI Approved :: Apache Software License |
| 249 |
Classifier: Operating System :: OS Independent |
| 250 |
Classifier: Programming Language :: Python :: 2 |
| 251 |
Classifier: Programming Language :: Python :: 3 |
| 252 |
Classifier: Programming Language :: Python :: Implementation :: PyPy |
| 253 |
Classifier: Topic :: Internet |
| 254 |
Classifier: Topic :: System :: Networking |