Skip to content

Conversation

@brunoerg
Copy link

@brunoerg brunoerg commented Nov 21, 2022

Instead of donwloading a lib like libbgpdump and calling it with a sh script, we could have a Python script to do the same work.

@brunoerg brunoerg force-pushed the 2022-11-parse-python branch from 6602c19 to b631d4c Compare November 22, 2022 12:37
Copy link

@dunxen dunxen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

Running it against dumps currently.

@brunoerg brunoerg force-pushed the 2022-11-parse-python branch from b631d4c to a6eef95 Compare November 24, 2022 17:06
@brunoerg brunoerg marked this pull request as ready for review November 25, 2022 11:26
print(f"Processing {file}...")
to_dump = ""
for entry in bgp:
if isinstance(entry.body, TableDumpV2):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support V1 tables too? I vaguely recall seeing such dumps too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only added support for V1 tables because I realized bgpdump does it as well but I can drop it. Realized just one of the dumps was V1.

route.attr.asPath
for route
in entry.body.routeEntries])
else:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the dumps can contain other entries besides just v1 and v2 table dumps. Does the BGPDump package already filter those out, or should we be explict?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it already filter them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    @property
    def routeEntries(self):

        if self._routeEntries is not None:
            return self._routeEntries
        self._routeEntries = []
        for i in range(0, self.body.entry_count):
            self._routeEntries.append(TableDumpV2RouteEntry(self.bgp, self.body.entries[i]))
        return self._routeEntries

@sipa
Copy link
Owner

sipa commented Dec 2, 2022

Actually, I'm kind of confused about the state of the software here. I'm not sure I was using any of the code in the remote_dumps/ directory. I wrote my own download script in the construct/ directory, and a more advanced bottleneck constructing one in bottleneck.py.

@brunoerg
Copy link
Author

brunoerg commented Dec 5, 2022

Actually, I'm kind of confused about the state of the software here

I feel the same haha. Seems like this project is the best fit to move asmap stuff forward, but it seems hard to contribute since there is a lack of documentation and project management. I'm willing to help manage this if you want.

@sipa
Copy link
Owner

sipa commented Dec 5, 2022

@brunoerg Please do!

Feel free to reuse whatever is usable anywhere in the repo. I think that I was using:

  • To download dumps, the code in construct/construct.py.
  • For converting dump files to human-readable dumps, either the bgpdump command-line tool, or bgpdump.py (I vaguely remember the latter being too slow, but unsure). If your quagga_parse.py is sufficiently fast to be usable, so much the better.
  • The bottleneck.py script to convert (sets of) human-readable dumps into a text file with iprange->asn mappings.
  • The asmap-cli.py tool to convert those mappings into binary asmap files.

@brunoerg
Copy link
Author

brunoerg commented Dec 7, 2022

Thanks, @sipa! I'm gonna move it forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants