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

Route stats & stacked area plot vs im/export #72

Closed SichangHe closed 10 months ago

SichangHe commented 11 months ago
Generated stats of 26447600 routes in 2680762ms.

The currently generated route stats is 2.5G and it looks like this:

import_ok,export_ok,import_skip,export_skip,import_unrec,export_unrec,import_meh,export_meh,import_err,export_err,skip_regex_tilde,skip_regex_with_set,skip_community,skip_import_empty,skip_export_empty,unrec_filter_set,unrec_as_routes,unrec_route_set,unrec_as_set,unrec_as_set_route,unrec_some_as_set_route,unrec_aut_num,unrec_peering_set,spec_uphill,spec_uphill_tier1,spec_tier1_pair,spec_import_peer_oifps,spec_import_customer_oifps,spec_export_customers,spec_as_is_origin_but_no_route,err_filter,err_filter_as_num,err_filter_as_set,err_filter_prefixes,err_filter_route_set,err_remote_as_num,err_remote_as_set,err_except_peering_right,err_peering,err_regex,rpsl_as_name,rpsl_filter,rpsl_regex,rpsl_unknown_filter,recursion
1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,5,0,0,0,0,0,0
0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,6,0,0,0,0,0,0
0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,784,0,0,784,0,0,0,0,0,0
2,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,8914,6362,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
SichangHe commented 11 months ago

File: route_stats.csv.gz.

SichangHe commented 11 months ago
In [12]: df.describe().applymap("{0:.2f}".format)
Out[12]:
         import_ok    export_ok  import_skip  export_skip import_unrec export_unrec   import_meh   export_meh   import_err   export_err skip_regex_tilde skip_regex_with_set skip_community skip_import_empty skip_export_empty unrec_filter_set unrec_as_routes unrec_route_set unrec_as_set unrec_as_set_route unrec_some_as_set_route unrec_aut_num unrec_peering_set  spec_uphill spec_uphill_tier1 spec_tier1_pair spec_import_peer_oifps spec_import_customer_oifps spec_export_customers spec_as_is_origin_but_no_route   err_filter err_filter_as_num err_filter_as_set err_filter_prefixes err_filter_route_set err_remote_as_num err_remote_as_set err_except_peering_right  err_peering    err_regex rpsl_as_name  rpsl_filter   rpsl_regex rpsl_unknown_filter    recursion
count  26447600.00  26447600.00  26447600.00  26447600.00  26447600.00  26447600.00  26447600.00  26447600.00  26447600.00  26447600.00      26447600.00         26447600.00    26447600.00       26447600.00       26447600.00      26447600.00     26447600.00     26447600.00  26447600.00        26447600.00             26447600.00   26447600.00       26447600.00  26447600.00       26447600.00     26447600.00            26447600.00                26447600.00           26447600.00                    26447600.00  26447600.00       26447600.00       26447600.00         26447600.00          26447600.00       26447600.00       26447600.00              26447600.00  26447600.00  26447600.00  26447600.00  26447600.00  26447600.00         26447600.00  26447600.00
mean          0.91         0.47         0.53         0.69         0.55         0.87         0.54         0.61         0.37         0.26             0.00                0.00           0.00              0.53              0.69             0.00            0.00            0.16         1.53            1031.76                  701.64          0.62              0.00         0.49              0.36            0.11                   0.02                       0.00                  0.01                           0.17         0.05              0.04              0.01                0.00                 0.00           1288.92              0.02                     0.00      1288.71         0.00         0.00         0.00         0.00                0.00         0.00
std           0.84         0.79         0.71         0.83         0.71         0.88         0.68         0.76         0.51         0.45             0.01                0.00           0.09              0.71              0.83             0.00            0.05            7.92        33.23            3050.69                 2106.73          1.12              0.04         0.86              0.58            0.32                   0.12                       0.01                  0.15                           0.53         0.31              0.29              0.13                0.00                 0.03           2705.73              0.25                     0.00      2705.79         0.01         0.02         0.00         0.00                0.00         0.00
min           0.00         0.00         0.00         0.00         0.00         0.00         0.00         0.00         0.00         0.00             0.00                0.00           0.00              0.00              0.00             0.00            0.00            0.00         0.00          -32230.00               -32522.00          0.00              0.00         0.00              0.00            0.00                   0.00                       0.00                  0.00                           0.00         0.00              0.00              0.00                0.00                 0.00              0.00              0.00                     0.00         0.00         0.00         0.00         0.00         0.00                0.00         0.00
25%           0.00         0.00         0.00         0.00         0.00         0.00         0.00         0.00         0.00         0.00             0.00                0.00           0.00              0.00              0.00             0.00            0.00            0.00         0.00               0.00                    0.00          0.00              0.00         0.00              0.00            0.00                   0.00                       0.00                  0.00                           0.00         0.00              0.00              0.00                0.00                 0.00              0.00              0.00                     0.00         0.00         0.00         0.00         0.00         0.00                0.00         0.00
50%           1.00         0.00         0.00         0.00         0.00         1.00         0.00         0.00         0.00         0.00             0.00                0.00           0.00              0.00              0.00             0.00            0.00            0.00         0.00               0.00                    0.00          0.00              0.00         0.00              0.00            0.00                   0.00                       0.00                  0.00                           0.00         0.00              0.00              0.00                0.00                 0.00              1.00              0.00                     0.00         1.00         0.00         0.00         0.00         0.00                0.00         0.00
75%           1.00         1.00         1.00         1.00         1.00         1.00         1.00         1.00         1.00         1.00             0.00                0.00           0.00              1.00              1.00             0.00            0.00            0.00         0.00               2.00                    5.00          1.00              0.00         1.00              1.00            0.00                   0.00                       0.00                  0.00                           0.00         0.00              0.00              0.00                0.00                 0.00            488.00              0.00                     0.00       488.00         0.00         0.00         0.00         0.00                0.00         0.00
max           8.00         7.00         8.00         7.00         9.00         9.00         6.00         6.00         5.00         5.00             1.00                2.00          32.00              8.00              7.00             3.00            3.00          843.00      4846.00           30096.00                32457.00         18.00              6.00         9.00              2.00            2.00                   2.00                       1.00                 17.00                          54.00        16.00             16.00              8.00                2.00                 3.00          14127.00             28.00                     0.00     14127.00         2.00         4.00         0.00         0.00                1.00         0.00
SichangHe commented 11 months ago

Note: the specific report item counts ("skip_regex_tilde" through "recursion") only recorded the items that contributed to the parent report type. For example, only the "skip" items are recorded for "skip" reports:

https://github.com/SichangHe/internet_route_verification/blob/ec6422d92e00eb03b75186a84d6dca2cebd5c385/route_verification/bgp/src/stats/route.rs#L82-L88

SichangHe commented 11 months ago
CDF of number of import/export VS routes looks like this. ![image](https://github.com/SichangHe/internet_route_verification/assets/84777573/184c433f-d1c2-4518-a827-44697a8d53ad)
CDF of percentages of import/export VS routes looks like this. ![image](https://github.com/SichangHe/internet_route_verification/assets/84777573/8529446f-d3e2-4a24-ad13-50a1805b1996)
SichangHe commented 11 months ago
SichangHe commented 11 months ago
Stack area plot: percentages of import vs routes. ![image](https://github.com/SichangHe/internet_route_verification/assets/84777573/8b1b47b7-09f5-4324-815a-4f29cc1c5fd4) (Showing floats because x-axis unit is 1e7.)
Stack area plot: percentages of export vs routes. ![image](https://github.com/SichangHe/internet_route_verification/assets/84777573/8ec8783e-c987-4030-a81d-934c4e77fb68)

Same sorting as #69.

Generated using https://github.com/SichangHe/internet_route_verification_meta/commit/97c46e8bcae972afd6f36e11781099a173421ad4.

SichangHe commented 11 months ago

These generated PDF files are really large.

463M route-export-percentages-stacked-area-squared.pdf
853M route-export-percentages-stacked-area.pdf
818M route-import-percentages-stacked-area-squared.pdf
846M route-import-percentages-stacked-area.pdf
SichangHe commented 11 months ago
Rasterized stack area plots [route-export-percentages-stacked-area-squared.pdf](https://github.com/SichangHe/internet_route_verification/files/13175329/route-export-percentages-stacked-area-squared.pdf) [route-export-percentages-stacked-area.pdf](https://github.com/SichangHe/internet_route_verification/files/13175330/route-export-percentages-stacked-area.pdf) [route-import-percentages-stacked-area-squared.pdf](https://github.com/SichangHe/internet_route_verification/files/13175331/route-import-percentages-stacked-area-squared.pdf) [route-import-percentages-stacked-area.pdf](https://github.com/SichangHe/internet_route_verification/files/13175332/route-import-percentages-stacked-area.pdf)
SichangHe commented 11 months ago

Stack area plot: percentages of import vs routes. image

(Showing floats because x-axis unit is 1e7.)

Stack area plot: percentages of export vs routes. Same sorting as #69.

Generated using SichangHe/internet_route_verification_meta@97c46e8.

@cunha blocky?

cunha commented 10 months ago

Is it blocky because of the sampling? I think it's still OK: although we lose some resolution, we can still see the cases that happen together and how often each case happens.