SichangHe / internet_route_verification

RPSLyzer: Parse Routing Policy Specification Language from IRR and compare BGP routes against it
MIT License
1 stars 0 forks source link

Data analysis for route verification reports with hill #24

Closed SichangHe closed 1 year ago

SichangHe commented 1 year ago

Following #21.

SichangHe commented 1 year ago

AS pair stats

Polars output in Evcxr. ```elixir Generated stats of 176636 AS pairs in 1925755ms. shape: (176_636, 11) ┌────────┬───────┬───────────┬───────────┬─────────────┬─────────────┬────────────┬────────────┬────────────┬────────────┬──────────────┐ │ from ┆ to ┆ import_ok ┆ export_ok ┆ import_skip ┆ export_skip ┆ import_meh ┆ export_meh ┆ import_err ┆ export_err ┆ relationship │ │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ │ u64 ┆ u64 ┆ u32 ┆ u32 ┆ u32 ┆ u32 ┆ u32 ┆ u32 ┆ u32 ┆ u32 ┆ str │ ╞════════╪═══════╪═══════════╪═══════════╪═════════════╪═════════════╪════════════╪════════════╪════════════╪════════════╪══════════════╡ │ 207797 ┆ 16302 ┆ 29 ┆ 29 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ up │ │ 205943 ┆ 12552 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 2 ┆ 2 ┆ peer │ │ 47866 ┆ 20764 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 9 ┆ 9 ┆ peer │ │ 62503 ┆ 33652 ┆ 0 ┆ 0 ┆ 10 ┆ 10 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ up │ │ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │ │ 41430 ┆ 6939 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 8 ┆ 8 ┆ peer │ │ 133216 ┆ 7545 ┆ 0 ┆ 0 ┆ 30 ┆ 30 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ up │ │ 18888 ┆ 293 ┆ 0 ┆ 0 ┆ 4 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 4 ┆ peer │ │ 208973 ┆ 60893 ┆ 7 ┆ 7 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ 0 ┆ up │ └────────┴───────┴───────────┴───────────┴─────────────┴─────────────┴────────────┴────────────┴────────────┴────────────┴──────────────┘ shape: (9, 12) ┌────────────┬─────────────┬─────────────┬─────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┐ │ describe ┆ from ┆ to ┆ import_ok ┆ export_ok ┆ import_ski ┆ export_ski ┆ import_meh ┆ export_meh ┆ import_err ┆ export_err ┆ relationsh │ │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ p ┆ p ┆ --- ┆ --- ┆ --- ┆ --- ┆ ip │ │ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ --- ┆ --- ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ --- │ │ ┆ ┆ ┆ ┆ ┆ f64 ┆ f64 ┆ ┆ ┆ ┆ ┆ str │ ╞════════════╪═════════════╪═════════════╪═════════════╪════════════╪════════════╪════════════╪════════════╪════════════╪════════════╪════════════╪════════════╡ │ count ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636.0 ┆ 176636 │ │ null_count ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0 │ │ mean ┆ 967749.3288 ┆ 298711.4719 ┆ 82.072024 ┆ 61.007139 ┆ 175.474699 ┆ 197.55778 ┆ 102.129107 ┆ 75.714226 ┆ 75.282366 ┆ 100.679052 ┆ null │ │ ┆ 68 ┆ 48 ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ │ std ┆ 5.9992e7 ┆ 3.2992e7 ┆ 4934.729273 ┆ 2670.04445 ┆ 6171.97207 ┆ 5402.60801 ┆ 1399.56486 ┆ 1972.60153 ┆ 3800.16121 ┆ 6236.16188 ┆ null │ │ ┆ ┆ ┆ ┆ 9 ┆ 1 ┆ ┆ 8 ┆ ┆ 2 ┆ 7 ┆ │ │ min ┆ 1.0 ┆ 1.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ down │ │ 25% ┆ 26575.75 ┆ 5466.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ null │ │ 50% ┆ 52286.5 ┆ 12741.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ null │ │ 75% ┆ 202513.0 ┆ 37595.25 ┆ 0.0 ┆ 1.0 ┆ 28.0 ┆ 30.0 ┆ 26.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ null │ │ max ┆ 4.2926e9 ┆ 4.2926e9 ┆ 1.533988e6 ┆ 749784.0 ┆ 1.794792e6 ┆ 1.533988e6 ┆ 177342.0 ┆ 518285.0 ┆ 816612.0 ┆ 1.794792e6 ┆ up │ └────────────┴─────────────┴─────────────┴─────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┘ ```

as_pair_stats.csv

SichangHe commented 1 year ago

Analysis on AS pair stats

Here, only the number of pairs is considered, the number of successes/skips/errors in the routes are normed (collapsed to 1 for each pair).

The ASes with the most errors. ```python In [12]: df_from.sort_values(by='import_err', ascending=False).head(20) Out[12]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err from 6939 22 0 41 0 1 2 40 92 13335 21 0 133 269 98 0 23 0 1299 25 0 25 69 0 0 23 0 174 25 0 33 0 0 0 21 76 1239 5 0 11 34 0 0 19 0 9009 8 3 18 3 6 11 19 29 42 6 0 19 0 2 4 18 36 16509 2 0 26 0 4 13 18 37 2906 1 0 28 50 3 0 18 0 20473 6 0 27 0 7 21 18 31 6461 5 0 27 46 0 0 18 0 7713 2 0 11 0 1 7 18 23 54994 5 0 29 90 41 0 18 0 21859 0 0 36 2 25 47 18 30 137409 0 0 9 30 3 0 18 0 132203 2 0 19 51 15 0 17 0 4455 0 8 6 4 2 2 17 15 57976 4 0 14 36 5 0 16 0 3356 19 19 39 0 0 0 16 54 24482 1 0 6 0 1 2 16 21 In [13]: df_from.sort_values(by='export_err', ascending=False).head(20) Out[13]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err from 6939 22 0 41 0 1 2 40 92 174 25 0 33 0 0 0 21 76 3356 19 19 39 0 0 0 16 54 2914 14 0 24 0 0 0 10 42 16509 2 0 26 0 4 13 18 37 42 6 0 19 0 2 4 18 36 15169 1 0 22 0 0 2 14 35 20940 18 2 89 2 37 107 12 33 32934 9 0 21 0 3 9 16 32 20473 6 0 27 0 7 21 18 31 21859 0 0 36 2 25 47 18 30 714 7 2 18 0 5 14 16 29 9009 8 3 18 3 6 11 19 29 58453 6 1 15 0 3 6 15 28 9498 6 0 17 0 3 10 15 27 10310 8 0 19 0 5 11 12 26 1828 3 0 17 0 7 13 15 26 30844 4 12 15 10 3 6 12 24 7713 2 0 11 0 1 7 18 23 9304 5 0 16 0 8 17 15 23 In [14]: df_to.sort_values(by='import_err', ascending=False).head(20) Out[14]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err to 6939 0 1615 0 4055 2133 728 7391 3824 57463 2 103 1 1589 0 0 4484 2842 34224 34 163 15 333 92 37 2054 1717 18106 4 70 0 524 19 5 1917 1388 12552 362 294 0 340 58 55 1197 1050 20764 199 162 76 166 98 127 772 669 37100 7 105 0 396 220 21 759 534 31133 481 448 77 240 137 195 750 565 8492 193 70 64 60 6 13 680 746 3303 514 278 321 234 9 24 606 726 3216 794 577 165 208 67 226 496 465 22652 22 26 6 235 77 11 386 222 23673 1 3 0 158 2 0 342 185 3130 2 4 0 149 1 0 277 130 1403 5 3 0 101 0 0 247 150 20485 327 480 88 202 368 222 211 99 20912 90 29 10 20 3 2 127 142 17819 0 8 0 91 0 0 122 25 174 0 1768 0 3686 6266 1660 115 22 8359 282 252 84 119 111 133 95 59 In [15]: df_to.sort_values(by='export_err', ascending=False).head(20) Out[15]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err to 6939 0 1615 0 4055 2133 728 7391 3824 57463 2 103 1 1589 0 0 4484 2842 34224 34 163 15 333 92 37 2054 1717 18106 4 70 0 524 19 5 1917 1388 12552 362 294 0 340 58 55 1197 1050 1239 0 71 1891 391 0 581 0 883 8492 193 70 64 60 6 13 680 746 3303 514 278 321 234 9 24 606 726 20764 199 162 76 166 98 127 772 669 31133 481 448 77 240 137 195 750 565 37100 7 105 0 396 220 21 759 534 3216 794 577 165 208 67 226 496 465 293 0 27 670 258 0 4 0 398 3741 0 78 716 329 0 18 0 347 22652 22 26 6 235 77 11 386 222 9002 1252 790 518 331 36 306 33 199 23673 1 3 0 158 2 0 342 185 1403 5 3 0 101 0 0 247 150 6461 0 261 2386 1646 0 471 0 144 20912 90 29 10 20 3 2 127 142 ```
Some ASes have "perfect" 50% import_err or export_err rate. Filtered by that, the ASes with the most errors. ```python In [27]: df_from[df_from['%import_err'] == 50.0].sort_values(by='import_err', ascending=False).head(20) Out[27]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err sum %import_ok %export_ok %import_skip %export_skip %import_meh %export_meh %import_err %export_err from 17922 0 0 0 8 0 0 8 0 16 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 65000 0 0 0 6 0 0 6 0 12 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 37727 0 0 0 5 0 0 5 0 10 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 24990 0 0 0 0 0 0 4 4 8 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 35353 0 1 0 0 0 0 4 3 8 0.0 12.500000 0.0 0.0 0.0 0.0 50.0 37.500000 13094 0 1 0 0 0 0 4 3 8 0.0 12.500000 0.0 0.0 0.0 0.0 50.0 37.500000 40633 0 0 0 3 0 0 3 0 6 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 394745 0 1 0 0 0 0 3 2 6 0.0 16.666667 0.0 0.0 0.0 0.0 50.0 33.333333 201376 0 0 0 3 0 0 3 0 6 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 43100 0 0 0 0 0 0 3 3 6 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 14812 0 0 0 3 0 0 3 0 6 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 150220 0 0 0 0 0 0 3 3 6 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 50898 0 0 0 0 0 0 3 3 6 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 63516 0 0 0 0 0 0 3 3 6 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 199399 0 0 0 0 0 0 3 3 6 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 24748 0 0 0 3 0 0 3 0 6 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 65010 0 0 0 2 0 0 2 0 4 0.0 0.000000 0.0 50.0 0.0 0.0 50.0 0.000000 272717 0 0 0 0 0 0 2 2 4 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 204310 0 1 0 0 0 0 2 1 4 0.0 25.000000 0.0 0.0 0.0 0.0 50.0 25.000000 41904 0 0 0 0 0 0 2 2 4 0.0 0.000000 0.0 0.0 0.0 0.0 50.0 50.000000 In [28]: df_from[df_from['%export_err'] == 50.0].sort_values(by='export_err', ascending=False).head(20) Out[28]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err sum %import_ok %export_ok %import_skip %export_skip %import_meh %export_meh %import_err %export_err from 196844 0 0 3 0 0 0 11 14 28 0.000000 0.0 10.714286 0.0 0.0 0.0 39.285714 50.0 137367 0 0 2 0 0 0 11 13 26 0.000000 0.0 7.692308 0.0 0.0 0.0 42.307692 50.0 35005 1 0 0 0 0 0 5 6 12 8.333333 0.0 0.000000 0.0 0.0 0.0 41.666667 50.0 197902 3 0 0 0 0 0 2 5 10 30.000000 0.0 0.000000 0.0 0.0 0.0 20.000000 50.0 201054 1 0 0 0 0 0 4 5 10 10.000000 0.0 0.000000 0.0 0.0 0.0 40.000000 50.0 50384 1 0 0 0 0 0 4 5 10 10.000000 0.0 0.000000 0.0 0.0 0.0 40.000000 50.0 24990 0 0 0 0 0 0 4 4 8 0.000000 0.0 0.000000 0.0 0.0 0.0 50.000000 50.0 58196 1 0 0 0 0 0 3 4 8 12.500000 0.0 0.000000 0.0 0.0 0.0 37.500000 50.0 270648 0 0 3 0 0 0 0 3 6 0.000000 0.0 50.000000 0.0 0.0 0.0 0.000000 50.0 199399 0 0 0 0 0 0 3 3 6 0.000000 0.0 0.000000 0.0 0.0 0.0 50.000000 50.0 34282 2 0 0 0 0 0 1 3 6 33.333333 0.0 0.000000 0.0 0.0 0.0 16.666667 50.0 208210 0 0 1 0 0 0 2 3 6 0.000000 0.0 16.666667 0.0 0.0 0.0 33.333333 50.0 23899 0 0 1 0 0 0 2 3 6 0.000000 0.0 16.666667 0.0 0.0 0.0 33.333333 50.0 64512 0 0 2 0 0 0 1 3 6 0.000000 0.0 33.333333 0.0 0.0 0.0 16.666667 50.0 210043 2 0 1 0 0 0 0 3 6 33.333333 0.0 16.666667 0.0 0.0 0.0 0.000000 50.0 43100 0 0 0 0 0 0 3 3 6 0.000000 0.0 0.000000 0.0 0.0 0.0 50.000000 50.0 50107 1 0 0 0 0 0 2 3 6 16.666667 0.0 0.000000 0.0 0.0 0.0 33.333333 50.0 150220 0 0 0 0 0 0 3 3 6 0.000000 0.0 0.000000 0.0 0.0 0.0 50.000000 50.0 58697 0 0 1 0 0 0 2 3 6 0.000000 0.0 16.666667 0.0 0.0 0.0 33.333333 50.0 50898 0 0 0 0 0 0 3 3 6 0.000000 0.0 0.000000 0.0 0.0 0.0 50.000000 50.0 In [29]: df_to[df_to['%import_err'] == 50.0].sort_values(by='import_err', ascending=False).head(20) Out[29]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err sum %import_ok %export_ok %import_skip %export_skip %import_meh %export_meh %import_err %export_err to 55674 0 0 0 1 0 0 8 7 16 0.0 0.0 0.0 6.250000 0.0 0.0 50.0 43.750000 50482 0 0 0 5 0 0 5 0 10 0.0 0.0 0.0 50.000000 0.0 0.0 50.0 0.000000 64213 0 0 0 4 0 0 5 1 10 0.0 0.0 0.0 40.000000 0.0 0.0 50.0 10.000000 206487 0 2 0 0 0 0 4 2 8 0.0 25.0 0.0 0.000000 0.0 0.0 50.0 25.000000 199354 0 0 0 2 0 0 4 2 8 0.0 0.0 0.0 25.000000 0.0 0.0 50.0 25.000000 52580 0 0 0 3 0 0 3 0 6 0.0 0.0 0.0 50.000000 0.0 0.0 50.0 0.000000 51131 0 0 0 0 0 0 3 3 6 0.0 0.0 0.0 0.000000 0.0 0.0 50.0 50.000000 270868 0 0 0 1 0 0 3 2 6 0.0 0.0 0.0 16.666667 0.0 0.0 50.0 33.333333 140433 0 0 0 0 0 0 3 3 6 0.0 0.0 0.0 0.000000 0.0 0.0 50.0 50.000000 38081 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.000000 0.0 0.0 50.0 50.000000 20130 0 0 0 1 0 0 2 1 4 0.0 0.0 0.0 25.000000 0.0 0.0 50.0 25.000000 37990 0 0 0 2 0 0 2 0 4 0.0 0.0 0.0 50.000000 0.0 0.0 50.0 0.000000 132651 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.000000 0.0 0.0 50.0 50.000000 38946 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.000000 0.0 0.0 50.0 50.000000 44927 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.000000 0.0 0.0 50.0 50.000000 16345 0 0 0 2 0 0 2 0 4 0.0 0.0 0.0 50.000000 0.0 0.0 50.0 0.000000 65222 0 0 0 2 0 0 2 0 4 0.0 0.0 0.0 50.000000 0.0 0.0 50.0 0.000000 49023 0 0 0 1 0 0 2 1 4 0.0 0.0 0.0 25.000000 0.0 0.0 50.0 25.000000 17971 0 0 0 2 0 0 2 0 4 0.0 0.0 0.0 50.000000 0.0 0.0 50.0 0.000000 2653 0 0 0 1 0 0 2 1 4 0.0 0.0 0.0 25.000000 0.0 0.0 50.0 25.000000 In [30]: df_to[df_to['%export_err'] == 50.0].sort_values(by='export_err', ascending=False).head(20) Out[30]: import_ok export_ok import_skip export_skip import_meh export_meh import_err export_err sum %import_ok %export_ok %import_skip %export_skip %import_meh %export_meh %import_err %export_err to 140433 0 0 0 0 0 0 3 3 6 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 51131 0 0 0 0 0 0 3 3 6 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 40633 0 0 2 0 0 0 0 2 4 0.0 0.0 50.0 0.0 0.0 0.0 0.0 50.0 134972 0 0 2 0 0 0 0 2 4 0.0 0.0 50.0 0.0 0.0 0.0 0.0 50.0 24475 2 0 0 0 0 0 0 2 4 50.0 0.0 0.0 0.0 0.0 0.0 0.0 50.0 44927 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 132651 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 38081 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 65000 0 0 2 0 0 0 0 2 4 0.0 0.0 50.0 0.0 0.0 0.0 0.0 50.0 38946 0 0 0 0 0 0 2 2 4 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 204677 0 0 0 0 0 0 1 1 2 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 206350 1 0 0 0 0 0 0 1 2 50.0 0.0 0.0 0.0 0.0 0.0 0.0 50.0 140770 0 0 0 0 0 0 1 1 2 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 142321 0 0 0 0 0 0 1 1 2 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 147100 0 0 0 0 0 0 1 1 2 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 149320 0 0 0 0 0 0 1 1 2 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 150620 0 0 1 0 0 0 0 1 2 0.0 0.0 50.0 0.0 0.0 0.0 0.0 50.0 206366 0 0 0 0 0 0 1 1 2 0.0 0.0 0.0 0.0 0.0 0.0 50.0 50.0 167001 0 0 1 0 0 0 0 1 2 0.0 0.0 50.0 0.0 0.0 0.0 0.0 50.0 169677 0 0 1 0 0 0 0 1 2 0.0 0.0 50.0 0.0 0.0 0.0 0.0 50.0 ```