Live data from Hacker News

Beej's Guide to Network Programming

beej.us

61–70 of 91 posts

Re: Beej's Guide to Network Programming

#61
post #60

All Beej's guides are fantastic, but if you're interested in Network programming you could do way worse than follow this up with his guide to network concepts. https://beej.us/guide/bgnet0/ If you search Algolia for Beej you'll see his material has been on hacker news numerous times.

Anyone knows of a well-rounded guide that explains the structure of the Internet at large? I know everything listed in the one you linked, but I have a nebulous idea of how anything works after my packet exits my gateway. So, BGP, autonomous systems, peering agreements and other site-to-site routing protocols that keep the entire Internet infrastructure ticking along.

I don't know of any one resource that gives a overview of everything, I find that browsing Wikipedia for each topic gives a good overview of each topic though, with the overview being the "Internet Architecture" category: https://en.wikipedia.org/wiki/Category:Internet_architecture

Some bookmarks I have regarding BGP and peering that dives into it a bit:

- https://www.fortinet.com/resources/cyberglossary/bgp-border-...

- https://aws.amazon.com/blogs/architecture/internet-routing-a...

- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_bg...

Re: Beej's Guide to Network Programming

#62
post #29
post #23

There is also a C guide [1] which has a pretty interesting email policy... I’m generally available to help out with email questions so feel free to write in, but I can’t guarantee a response. I lead a pretty busy life and there are times when I just can’t answer a question you have. When that’s the case, I usually just delete the message. It’s nothing personal; I just won’t ever have the time to give the detailed ans…

I love this level of honesty. It is true, but people never say it

Here's a product (Gmail/Outlook add-on or so): have your own LLM trained over your public texts (articles, books, blog entries, READMEs, Hacker News comments, and so on), mark the emails you can't respond to with the "GPT" label which puts the mail in a queue and if you don't remove the label in 7 days or so, it sends a response with a polite intro "I didn't have the time to get to your email, but here's what I might think as a response".

Re: Beej's Guide to Network Programming

#63
I've been working on the Protohackers [1] exercises in Elixir, putting my own spin on the problems by creating fault tolerant, scalable, high performance solutions-- and have been touching a lot of Elixir that I haven't had the opportunity to otherwise. The "Unusual Database" problem, particularly, has become a very deep rabbit hole assignment as it involves a UDP-based KV database. I stopped just short of clustering.

Writing servers in Elixir is straightforward because of the foundation exposed by Erlang's gen_tcp and gen_udp libraries. When you want to take your TCP server up a notch, try TCP acceptor pooling. There are two viable TCP acceptor pool libraries: Thousand Island, written in pure Elixir, and Ranch, written in Erlang.

Because of these well- abstracted foundation libraries and acceptor pool libraries, it's possible to write robust servers without venturing much into low level network programming. Beej explains the lowest level details well. I've done some of the equivalent work in Rust but found the slow progress of my work unsatisfying and moved back to Elixir quickly.

[1] protohackers.com

Re: Beej's Guide to Network Programming

#64

All Beej's guides are fantastic, but if you're interested in Network programming you could do way worse than follow this up with his guide to network concepts. https://beej.us/guide/bgnet0/ If you search Algolia for Beej you'll see his material has been on hacker news numerous times.

I agree with everything you said. Additionally, I think that the ZeroMQ guide is also a great resource to learn a lot of the common networking patterns, even if you don't plan on using ZeroMQ directly.

https://zguide.zeromq.org/

Re: Beej's Guide to Network Programming

#65
post #38

Open question: in what fields are you working where you really need to work with actual sockets? Most of the network programming I do fall into one of two categories: 1. A library exists to abstract over the bytes-into-sockets layer, meaning I don't need to deal with it; or 2. A library probably exists to abstract over the bytes-into-sockets layer, but I've chosen to ignore it either because I'm truly ignorant of it,…

I often work in a resource constrained environment where my program size is measured in two-digit kilobytes, RAM is measured in the single-digit kilobytes, and it can’t exceed some current measured in mA/h. When I am simply sending a UDP packet, I didn’t need nor can I afford the footprint that these libraries have.

Re: Beej's Guide to Network Programming

#66
post #29

Earlier quoted context omitted.

I love this level of honesty. It is true, but people never say it

I had a work colleague with a similarly refreshing Out-Of-Office E-mail autoresponder that included something like: "I'm on vacation. When I get back I'm not going to have time to read all my missed E-mails. So your mail is going to be ignored and deleted with the other 2,000 unread mails. If it's important, E-mail me again after I return on [date]." That's how you do it!

There is a massive caveat to this strategy "Email me again after I return".

Tssk tssk. Big mistake. Always do the "If it's urgent, contact " approach ;)

Re: Beej's Guide to Network Programming

#67
post #31
post #14

> "The way I see it, it's the educators who hold all the power in the world. No, stop laughing and hear me out. A good instructor can, over the course of their career, create hundreds of millions or even billions of dollars of GDP. Let's say a teacher teaches 40 students a year for 30 years. And Each of those students goes on to work for 40 years. And, due to the quality of instruction, they earn $10,000 more per yea…

> OK but providing value isn't the same as having power. Providing value is absolutely a way of having power. You change the world, that's power. Having power isn't the same as yielding benefit (for yourself).

When people talk about having or not having power, they rarely mean magnitude alone. The more important component is control. Can you wield your power to achieve some specific goal of yours? Can you use this power to overall improve your life, and lives of those you care about? Can you use this power to protect yourself from someone else using their power to achieve something at your expense?

Beej's teaching power only answers "Yes" to the first question here - and that's only if your goals have something to do with teaching or improving the world overall, somewhere, for some people.

Re: Beej's Guide to Network Programming

#68
post #57

Earlier quoted context omitted.

1. Writing the libraries you describe 2. Speaking unusual protocols for which (good) libraries don’t exist. 3. I think interacting with the sockets api can also be relevant for tweaking various options to get better performance (though often there are Linux defaults that can be tweaked instead)

I'm fully aware of the hypotheticals – what I'm curious about is which your personal experiences are with e.g. those three points you list.

I’ve done/do all three of those things. Knowing about the networking stack (protocols, the various things inside Linux, etc) has been pretty relevant.

Re: Beej's Guide to Network Programming

#69
post #63

I've been working on the Protohackers [1] exercises in Elixir, putting my own spin on the problems by creating fault tolerant, scalable, high performance solutions-- and have been touching a lot of Elixir that I haven't had the opportunity to otherwise. The "Unusual Database" problem, particularly, has become a very deep rabbit hole assignment as it involves a UDP-based KV database. I stopped just short of clustering…

I was disappointed last night when I looked at the Protohackers website and it seems to be on hiatus. Such a great idea, but I imagine it's not trivial to manage.

Re: Beej's Guide to Network Programming

#70
post #63

I've been working on the Protohackers [1] exercises in Elixir, putting my own spin on the problems by creating fault tolerant, scalable, high performance solutions-- and have been touching a lot of Elixir that I haven't had the opportunity to otherwise. The "Unusual Database" problem, particularly, has become a very deep rabbit hole assignment as it involves a UDP-based KV database. I stopped just short of clustering…

I was disappointed last night when I looked at the Protohackers website and it seems to be on hiatus. Such a great idea, but I imagine it's not trivial to manage.

I'm grateful that the author managed to take it even this far!
Post reply on HN