CAIDA / pybgpstream

Python bindings for BGPStream
https://bgpstream.caida.org
BSD 2-Clause "Simplified" License
29 stars 23 forks source link

empty result set for 2012-01-01 08:00:00 #43

Closed chenrui333 closed 3 years ago

chenrui333 commented 3 years ago

I am following the tutorial_print.py and trying to run the script for 2012-01-01 08:00:00, but somehow I only got empty result, how can I troubleshoot it? Thanks!

related code

stream = pybgpstream.BGPStream(
    filter='collector rrc06 and type ribs',
    from_time="2011-01-01 08:00:00",
    until_time="2011-01-01 08:01:00",
)

for rec in stream.records():
    print(rec.status, rec.project +"."+ rec.collector, rec.time)
    for elem in rec:
        print("\t", elem.type, elem.peer_address, elem.peer_asn, \
            elem.type, elem.fields)
chenrui333 commented 3 years ago

add collectors solve my issue.

albertodainotti commented 3 years ago

@chenrui333 The issue is not related to BGPStream or to how you add the collectors. The issue you're seeing is because that RIPE RIS collector had actually almost no data in its RIB dump: http://data.ris.ripe.net/rrc06/2011.01/
Scroll to the bottom of that page and you see all those RIBS are only 161 bytes each, whereas starting from Jan 13th 2011 they are 3MB.

Also, as a general recommendation, when you go after a specific RIB dump, it's better to indicate time ranges 5 or 10 minutes before and after the top of the hour instead of the exact hour and 1 min later. The RIB dumps are not always dumped at the exact top of the hour, and they're available only every 8 hours (RIPE RIS) or 2 hours (Route Views), so there is no risk of getting unwanted data from another RIB if you extend the time range of few minutes before and after, i.e., you will still get just that single RIB but you're sure to get it.