Live data from Hacker News

GoBGP: BGP Implemented in Go

github.com

111–120 of 130 posts

Re: GoBGP: BGP Implemented in Go

#111
post #57
post #30

Earlier quoted context omitted.

I didn't say it was. But then: I don't trust that Cisco C code at all . Do you?

Yes. It currently runs over 70% of global internet and considering all kinds of error conditions that show up on the global internet the code is extremely stable.

Extremely stable, but not extremely secure. This could be said for many companies, and Cisco shouldn't really be singled out here, but I think this is part of tptacek's overall point. The world should move away from huge C code-bases for critical infrastructure and adopt "safer" languages (Personally I love Go, but Rust may be a better option for high-speed packet routing).

Re: GoBGP: BGP Implemented in Go

#112
post #104

Earlier quoted context omitted.

Can mio be pulled into the stdlib, then? I fear a world of gevent/Twisted, EventMachine/Celluloid/base Ruby, Boost/a litany of other options.

I wouldn't mind pulling it into the standard library if we're sure it's mature enough to be ready. In the meantime, though, it's the de facto standard async I/O framework, and I don't see that changing anytime soon.

Agree 100%.

Re: GoBGP: BGP Implemented in Go

#113
post #57

Earlier quoted context omitted.

Yes. It currently runs over 70% of global internet and considering all kinds of error conditions that show up on the global internet the code is extremely stable.

Sendmail used to run on something like 90% of the global Internet. And mail in the 1990s pretty much did work, pretty reliably. Would you have banked your site's security on the quality of Sendmail 8.6.12's code?

Slam dunk on that comment! Such systems, due to lots of debugging, can work reliably in a narrow set of use cases where specific features have massive use. Then there's the uncommon, usage scenarios and features that get much less debugging. Then there's all the patches they keep distributing to fix... "things."

And then the fact that safe, reliable code is only first step toward secure code where an intelligence, malicious person is targeting it. Totally different ballpark that neither Sendmail nor Cisco handled so well. Small shops like Sentinel and Secure64 did way better with a tiny fraction of the money. So, it has to be intentional for the extra profit at customers' expense.

Re: GoBGP: BGP Implemented in Go

#114
post #100

I remember years ago when every new PHP application would have "PHP" before its name. PHPNuke, PHPMyadmin, etc, etc. Seeing the same trend with Go now. Why add the language name to the software name? Real question...

Another real question: What is the better approach? Generic names (eg. "bgpd")? That seems decent if you have an over-arching project to group the generic stuff under (eg. "Apache httpd"). Making up codenames for everything (eg. "Zebra")? It's a pain to think of those, and they're rarely descriptive or meaningful.

I don't really like the language-name-prefix thing either. It makes the language seem like the important thing about the project. Sometimes it is the most important thing, but even then, that is mostly only true at the beginning of a project when attracting contributors is most critical. But I'm not sure the other approaches are much better.

Re: GoBGP: BGP Implemented in Go

#115
post #33
post #11

This is the sort of thing Go really shines on: network and infrastructure services that would ordinarily be provided by big ugly C programs, where the latency requirements are significant but not as bad as raw packet forwarding. If your current best alternative is a C program, I'm not sure why you wouldn't seriously consider replacing any of the following with Go (or Rust) programs: * Authority DNS * DNS caches * ntp…

You will be doing battle with the GC in many of these applications. Yes, even 1.5+. 10ms is an eternity to do no workload.

From 1.5 to 1.6 @brianhatfield saw pauses in a 8GB heap & 150M allocs/min go from 40ms to ~3ms [0].

[0]: https://twitter.com/brianhatfield/status/692778741567721473

Re: GoBGP: BGP Implemented in Go

#116
I really dislike projects that assume you know the definition of an acronym and never (1) expand it nor (2) explain it. BGP is super important to the GoBGP project. It deserves at least a mention somewhere in the first 4 sentences introducing the project. Gahh!

Re: GoBGP: BGP Implemented in Go

#117
post #84

Earlier quoted context omitted.

You are not doing event-driven programming just to scale I/O, you are doing it to avoid mutexes and concurrent memory access, to have easy cancellation, easy management of connections and other resources, etc.

Idiomatic Go code also doesn't use mutexes and concurrent memory access, unless you're trying to argue that channels are implicitly mutexes. Also: you now seem to be subtly backing off your original point. Can we stipulate that the performance of most network programs would not be meaningfully improved by switching from M:N I/O scheduled threads to async I/O?

My original point was about _predictability_ of performance and accidental complexity, that M:N threads with synchronous APIs introduce. But either way, they use way more memory, than necessary and also have to implicitly and explicitly synchronize every little thing, so performance on any meaningful load is going to be very meaningfully worse, than that of event loops.

Still, I want to reiterate, that event loops in modern languages are more about managing complexity, than performance.

Re: GoBGP: BGP Implemented in Go

#118

Earlier quoted context omitted.

> All of these services would be better suited for a language which has blessed async IO, concurrency, parallelism primitives. Go has these, Rust does not. pthreads are not the answer. Go does not have truly async I/O. It has a userspace (M:N) implementation of threaded, synchronous I/O. There is a distinction, and it's not an academic one. Rust uses the kernel-level (1:1) implementation of threaded, synchronous I/O,…

Can you be a bit clearer on the distinction here? It's "synchronous" in the sense that the code is straight-line synchronous, but threads are scheduled in part based on I/O events (IIRC, this used to be the primary way threads were scheduled). Yes, every connection has a (small) thread stack associated with it. But in a "truly asynchronous" network program, every connection still has memory associated with it; it's j…

> Yes, every connection has a (small) thread stack associated with it. But in a "truly asynchronous" network program, every connection still has memory associated with it; it's just that the memory doesn't take the form of a procedure stack.

That's also true with 1:1 threading. It's just that the context switching is handled by the kernel.

Semantically, there's no difference between what Go does and what NPTL does. The difference is in implementation: Go does a lot of the work itself in userspace, while NPTL does the work in the kernel. (I say NPTL not to be pedantic but because there were pthreads implementations in Linux that used Golang-like schedulers. They were abandoned in favor of NPTL because the extra complexity was judged to not be worth it for small if any performance gains.)

You're right of course that you need per-connection state in any model. But with a state machine you can be much more compact than a call stack. Modern compilers (I doubt this includes Go 6g/8g, but haven't checked) will do stack coloring to reduce stack usage, but the overhead is still significant because compilers essentially always choose runtime performance of straight-line code over stack compactness wherever there's a tradeoff. State machine compilers, like C#'s async/await compiler, make the opposite choice, and as a result they can use less memory. Moreover, with state machines you can go the extra mile and really pack your state into a tiny fixed-size allocation you can allocate with a segregated fit arena. That's pretty much unbeatable for performance.

Re: GoBGP: BGP Implemented in Go

#119
post #11

This is the sort of thing Go really shines on: network and infrastructure services that would ordinarily be provided by big ugly C programs, where the latency requirements are significant but not as bad as raw packet forwarding. If your current best alternative is a C program, I'm not sure why you wouldn't seriously consider replacing any of the following with Go (or Rust) programs: * Authority DNS * DNS caches * ntp…

> I'm not sure why you wouldn't seriously consider replacing any of the following with Go

just curious about this: are there folks trying out dpdk with go ? implementing these control-plane applications in vanilla sockets (or close-to-zero-wrappers on those), doesn't seem fruitful anymore.

fwiw, i have been doing dpdk stuff, but have been mostly using C...

Re: GoBGP: BGP Implemented in Go

#120
post #78
post #40

Earlier quoted context omitted.

The viewpoint you were espousing was, if I understand correctly: I should replace all my existing services with Go/Rust equivalents, unless they handle packets directly. My objection is that you are advocating this in the same narrow-focused way that people advocate node with npm, python with pip, ruby with gem: little or no cooperation with the whole system is available yet. This is perfectly fine from the point of…

If the Debian people don't want to include Go for some logistical or religious or religiously logistical reason, that's fine with me. I don't think people should run critical infrastructure from Debian releases --- when things go wrong, you want to be prepared to patch source on a moment's notice, rather than waiting for the upstream synchronization dance --- but hardly anyone seems to agree with me on that, either.…

[deleted]
Post reply on HN