[HN Gopher] BGP Implemented in Go
       ___________________________________________________________________
        
       BGP Implemented in Go
        
       Author : eatonphil
       Score  : 89 points
       Date   : 2022-03-19 15:46 UTC (7 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | freedomben wrote:
       | Maybe a dumb question nowadays because I stopped using Go around
       | the 1.6 days, but is there still a stop-the-world garbage
       | collector, or any other potential blockers for high
       | performance/real time?
       | 
       | A previous company I worked with chose to build in C++ instead of
       | Go because of that, as the performance requirements were very,
       | very high. I would imagine a serious BGP usage would have very
       | high requirements?
        
         | mitchs wrote:
         | It depends on the context. Not every bgp speaker needs the full
         | internet table and frequent route changes. If you use the
         | network to balance traffic across servers, you just need a bgp
         | speaker on a server to inject a few routes for the ip addresses
         | it will handle. In that case a good api outweighs performance.
        
         | woah wrote:
         | BGP doesn't have very high performance requirements. It does
         | not handle any internet traffic. All it does is configure the
         | kernel routing tables. Even if there's some crazy 1 second GC
         | pause it will not greatly affect the performance of the router.
        
           | lima wrote:
           | Sending or receiving an internet full table (and potentially
           | applying filters/aggregations) is still quite performance
           | intensive, since it needs to happen quickly.
           | 
           | A one-second GC pause won't hurt you but managing the
           | necessary data structures in memory can be challenging.
           | 
           | Anecdotally, gobgp is quite a bit slower than hand-optimized
           | C implementations like frr (not that it matters for most
           | gobgp use cases).
        
             | tptacek wrote:
             | What's challenging about it? Go gives you control over the
             | layout of your objects in memory.
        
         | remram wrote:
         | I don't think BGP requires real-time. Increasing throughput via
         | multithreading is probably much more impactful (for large
         | deployments) and otherwise it doesn't matter.
        
         | tptacek wrote:
         | A BGP route server might be the platonic ideal of a Go problem:
         | it's demanding enough not to be tenable in Python, but not
         | real-time or kernel resident, and mostly data structure --- and
         | just a couple data structures --- intensive.
        
       | 0x20cowboy wrote:
       | I may have missed it, but I read the read me, looked at the main
       | site, looked at the beginning of getting started... nowhere says
       | what BGP stands for / is.
       | 
       | I get it's written in go, but I have no idea what BGP is. Big
       | green pages, binary grepping pipes, boisterous gambling
       | pachyderms?
       | 
       | Jokes aside, y'all might want to give a brief about what this is
       | for us uninitiated.
        
         | cortesoft wrote:
         | BGP is pretty foundational to the internet. At some point, you
         | have to assume hour audience knows the basics. Not everything
         | is an intro.
         | 
         | Also, if you don't know what BGP is, you aren't going to be
         | interested in a project implementing BGP.
        
           | 0x20cowboy wrote:
           | I've been on the internet for quite a long time, but I've
           | never heard of it before. So maybe it's basic knowledge for a
           | given discipline, but maybe not for others?
           | 
           | It's also, I assume by the authors, submitted to hackernews
           | which is a pretty diverse place. "Basics" is relative.
           | 
           | I am not saying there should be a dissertation about how the
           | thing works, but it's generally bad form to use abbreviations
           | without using the long form at least once - for people who
           | would indeed like to search for more information.
        
           | teeray wrote:
           | It's still wise to define acronyms before you use them to
           | enable future Googling (links are better!). Three extra words
           | is a small price to pay to make documentation more friendly
           | to newcomers.
        
             | chockchocschoir wrote:
             | Again, at one point you have to assume either basic
             | knowledge or at least basic knowledge about how to search
             | for things, otherwise everything would be very verbose.
             | 
             | Take one of your repositories as an example:
             | https://github.com/timraymond/pricegrabber
             | 
             | > A gem for interacting with the Pricegrabber API
             | 
             | Should you have to add "Application Programming Interface
             | (API)" the first time you use "API" anywhere? Realistically
             | no, because the audience can be assumed to understand what
             | it means. If they don't, it's only a search away.
             | 
             | Same goes for networking and DNS/BGP/CNAME and more. If
             | you're using a library/server for BGP, you either know what
             | those terms are, or know how to find out more.
             | 
             | But not all resources are meant for beginning who don't
             | know the basic terms in a field, and that's OK, because
             | otherwise everything would be extremely verbose when it
             | doesn't have to.
        
         | nmz wrote:
         | It's that thing facebook messed up the other day and nobody
         | could connect to it.
        
         | fragmede wrote:
         | In this context, BGP stands for Border Gateway Protocol.
         | 
         | I opened a PR to fix that.
         | https://github.com/osrg/gobgp/pull/2535
        
         | ZiiS wrote:
         | Border Gateway Protocol how the internet shares its routing
         | table.
        
         | zinekeller wrote:
         | Border Gateway Protocol
         | (https://en.wikipedia.org/wiki/Border_Gateway_Protocol),
         | basically the GPS of the internet (not technically the same,
         | but it's close enough).
         | 
         | Cloudflare has already a good explanation on how it works, so
         | I'll just point everyone out to this article:
         | https://www.cloudflare.com/learning/security/glossary/what-i...
         | 
         | Also, about that undefined BGP. I'm not sure if this will help
         | explain why BGP wasn't explained, but this is from NTT OSRG
         | (Open-source Research Group), so probably they thought that
         | everyone knew what BGP is (since that you probably won't
         | encounter this otherwise).
         | 
         | Also, they have a Rust version:
         | https://github.com/osrg/rustybgp
        
         | [deleted]
        
       | kxrm wrote:
       | This is great, I have been learning "bird" and finding
       | information on the web about using bird is very challenging since
       | adding bird to any search doesn't necessary make the results
       | better. If this project can maintain and keep their documentation
       | clear, I would totally consider switching to this instead.
        
         | alaties wrote:
         | Yeah... Bird configurations are a little rough to learn. The
         | examples they have on the website are pretty lacking. Their
         | mailing list is usually helpful though.
         | 
         | Quagga is usually easier to find examples for since it's
         | modeled after Cisco switch syntax for configuration (same basic
         | syntax of arista switches).
         | 
         | Both of these really suck to learn as a programmer since you're
         | usually coming into these without much of a network engineering
         | background. I remember struggling a lot with both of these
         | config syntaxes until a network engineer took me under his wing
         | and taught me basics, principles, the engineering challenges of
         | packet switching at scale, etc.
        
       | rayhaanj wrote:
       | I've been working on a BGP implementation in Rust over the last
       | few years: https://github.com/net-control-plane/bgp/
       | 
       | It's still in a proof of concept stage and nowhere as complete as
       | GoBGP though.
        
         | ternaryoperator wrote:
         | Thank you for having a front page that actually says what BGP
         | is.
        
           | zinekeller wrote:
           | I'm not sure if this will help explain the culture or not,
           | but this is from the NTT (the Japanese telecommunications
           | company), so probably they thought that everyone knew what
           | BGP is (since that you probably won't encounter this
           | otherwise).
           | 
           | Also, they have a Rust version:
           | https://github.com/osrg/rustybgp
        
             | kyrra wrote:
             | Searching around, I found someone that benchmarked gobgp,
             | rustybgp, and some others, and gobgp didn't seem to do all
             | that well compared to other implementations.
             | 
             | https://elegantnetwork.github.io/posts/comparing-open-
             | source...
        
         | [deleted]
        
       | kisamoto wrote:
       | As a BGP alternative (in Go) has anyone checked out SCION?
       | 
       | https://github.com/scionproto/scion
        
         | wmf wrote:
         | I gave up when I saw new packet headers which means you might
         | not be able to use existing ASICs.
        
         | xyquadrat wrote:
         | SCION looks very promising, and by now it has also been
         | deployed in Switzerland's financial network, so it seems ready
         | for production:
         | 
         | https://www.six-group.com/en/newsroom/media-releases/2021/20...
         | 
         | (Actually, the original creator of SCION teaches my CompNet
         | course, which is pretty cool. His rants on BGP are quite
         | legendary.)
        
       | pmarreck wrote:
       | A language without default runtime error handling unless you
       | manually check after every line of code, used to control
       | something as important as an Internet gateway? What could
       | possibly go wrong? Please tell me that Go at least has static
       | analysis tooling around it by now
        
         | bradfitz wrote:
         | Good thing C doesn't run the world!
        
       ___________________________________________________________________
       (page generated 2022-03-19 23:00 UTC)