Beej

beej.us · Personal blog · on HN since 2008

Brian "Beej" Hall writes free programming guides on network programming, C, Unix IPC, and networking concepts.

What HN saysCommenters call his network programming guide a classic. They recommend it as approachable yet deep, and as a top pick for learning networking.
233HN people shared it
151linked it in comments
94stories submitted
6.4Kstory points
3 months agolast shared
2008people per year2026

Most-shared posts

  1. 1
    Beej's Guide to Network Programming
    72 people · 427 points · first shared 2008 · 44 comments on HN
  2. 2
    Beej's Guide to C Programming (2007)
    22 people · 461 points · first shared 2014 · 79 comments on HN
  3. 3
    Beej updated the classic Linux network programming guide
    20 people · 428 points · first shared 2015 · 77 comments on HN
  4. 4
    Beej's Guide to Network Programming (1994-2020)
    15 people · 1.0K points · first shared 2020 · 165 comments on HN
  5. 5
    Beej's Guide to Network Programming
    15 people · 382 points · first shared 2009 · 47 comments on HN
  6. 6
    Beej's Guide to Network Programming (2012)
    6 people · 181 points · first shared 2008 · 31 comments on HN
  7. 7
    Beej's Guide to Networking Concepts
    5 people · 55 points · first shared 2023 · 9 comments on HN
  8. 8
    Making
    5 people · 19 points · first shared 2026 · discussion on HN
  9. 9
    Beej's Guide to Network Programming
    5 people · 2 points · first shared 2023 · discussion on HN
  10. 10
    Beej's Quick Guide to GDB (2009)
    4 people · 177 points · first shared 2015 · 28 comments on HN
  11. 11
    Index
    4 people · first shared 2018
  12. 12
    Beej's Guide to Git
    3 people · 1.1K points · first shared 2025 · 311 comments on HN
  13. 13
    Beej's Guide to Unix IPC (2010)
    3 people · 225 points · first shared 2009 · 31 comments on HN
  14. 14
    Beej's Guide to Network Concepts
    3 people · 15 points · first shared 2023 · 1 comments on HN
  15. 15
    Bgnet
    3 people · first shared 2018

What HN people wrote when they linked it

pkage · 2025-02-05
I remember reading the excellent Beej's Guide to Network Programming[0] and Beej's Guide to Unix IPC[1] as a teenager, which were incredibly approachable while still having depth—fantastic reads both and very influential on the programmer I ended up being. [0] https://beej.us/guide/bgnet/ [1] https://beej.us/guide/bggit/
AnonC · 2025-01-19
I skimmed through it and it looks good. Since I didn’t see this in the list of references, I have to ask — have you heard of the (famous) Beej’s Guide to Network Programming [1]? It’s a classic (in the sense that it’s been around for a long, long time and goes into many more details) on this topic. [1]: https://beej.us/guide/bgnet/
f1shy · 2025-01-19
Actually is extremely simple. I learned by looking the original papers[0] As you say, just lots of bad examples online. The only thing that made me a little bit crazy at the beginning, was the fact that TCP is a stream without delimiters, no packet concept. Other than that, is not more difficult than writing and reading a file. [0] https://docs-archive.freebsd.org/44doc/psd/20.ipctut/paper.pdf Another useful resource: https://beej.us/guide/bgnet/ Edit: beej seems already cited and beloved
GaneshSuriya · 2024-02-20
- operating system in three easy pieces (https://pages.cs.wisc.edu/~remzi/OSTEP) is incredible for learning OS internals - beej's networking guide is the best thing for network layer stuff https://beej.us/guide/ - explained from first principles great too https://explained-from-first-principles.com/ - pintos from Stanford https://web.stanford.edu/class/cs140/projects/pintos/pintos_1.html
ajoseps · 2024-01-10
for classic network programming that's relatively hands on and has a lot of examples, beej's guide to network programming is great (and free online): https://beej.us/guide/bgnet/
BarbaryCoast · 2024-01-10
Wanted to bump this. It's the book I recommend when someone asks, "How can I learn networking". My next favorite is the Top-Down book everyone above mentions. I like that it starts with loading a web page, instead of bits on a wire. And they have pcap files so you don't even need a lab. The Stevens book is the standard text for programmers writing network code. Beej's Guide (https://beej.us/guide/bgnet/) Is how I learned. By the time you get here, you'll know enough to know which book to read next.
TrustPatches · 2023-11-27
Almost done with Beej's Guide to Networking Concepts[1] and absolutely loving it, following along in Go. Gotta check this out and his other guides afterwards [1]: https://beej.us/guide/bgnet0/html/split/index.html
alberth · 2023-11-06
Beej has lots of great guides, check them out: https://beej.us/guide/ Everyone knows the networking guide, but Beej also has: C, UNIX, Python, and many more.
Lukeisun · 2023-10-31
I am not very familiar with this kind of stuff either but I have read through "Beej's Guide to Network Programming" https://beej.us/guide/bgnet/html/split/. Which seems like enough to implement something like OP posted. As for db's/other interesting things, I haven't read them myself but this site seems solid https://build-your-own.org/. If anyone has any real experience with this site, I would love to hear it!
thethimble · 2023-10-05
I’d strongly recommend Beej’s guide to network programming. It’s very approachable and will clear these concepts up for you. https://beej.us/guide/bgnet/html/split/
dharmab · 2023-07-27
A classic on *nix networking fundamentals: https://beej.us/guide/bgnet/ It includes a further reading list: https://beej.us/guide/bgnet/html/split/more-references.html#more-refer… These don't cover iptables and other firewalls themselves, but they give you enough knowledge that you can read the iptables manpage and other manuals and understand them.
gosenx · 2023-07-20
This guide by Beej is pretty good https://beej.us/guide/bgnet0/, he has a similae one on Network programming. Also reading TCP and IP RFCs will greatly help you.
Uehreka · 2023-07-09
I think GP wants something akin to Beej’s guides, where he presents you with like 10 formats on the homepage and you pick the one that works best for your device and use case: https://beej.us/guide/bgnet/
mighmi · 2023-07-07
For a few years, I found myself continuously appreciating Go's design and models more and more. Right now, a bit bored of working in the same paradigm for a decade, I've been trying to find new approaches but find myself rather trapped - as after a novel exploration, it turns out the current approach really does seem to work better. Go's whole concurrency model of Communicating Sequential Processes is cool, although seems to be the aspect I question the most. Erlang's Actor Model does seem a bit superior and Go can introduce footguns at points, but I've yet to really investigate the alternatives as much as I'd like. Also, Beej's guide to network programming https://beej.us/guide/bgnet/html/ mentioned in the beginning really is quite fantastic.
vajrabum · 2023-05-22
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.
ultra_nick · 2023-05-09
Download ebooks and documentation. Use Calibre to organize them. https://calibre-ebook.com/ https://www.gutenberg.org/ Computing systems would be a good subject to study. I'd also recommend downloading Ubuntu to a self booting flash drive. Linux has a lot of useful developer tools for someone without internet. https://beej.us/guide/ https://ubuntu.com/tutorials/create-a-usb-stick-on-windows#1-overview
mikevin · 2023-03-20
This might be a bit extreme but if you really want to learn bottom-up I would suggest nand2tetris https://www.nand2tetris.org/ It's not about networking but it's a good way to understand the picture from electrons wiggling to a basic computer. It involves all the layers below Linux basically and a little bit of overlap. I'm not sure how much it will help in your network programming goals but it's not that hard to do and helped me a lot with fundamentals and knowing which parts of a system are responsible for what. For more direct help I believe Beej's guide to network programming is greatly recommended https://beej.us/guide/bgnet/
simonw · 2023-02-26
Beej's guide to network programming is an absolute classic, dating back to at least 2005 (according to the Internet Archive) - very exiting to see them tackle C programming generally now. https://beej.us/guide/bgnet/
incanus77 · 2023-02-26
The second volume reference is great too, and downloadable as zipped HTML and PDF. https://beej.us/guide/bgclr/
anthomtb · 2023-02-05
I also like writing code in C both professionally and for personal projects. One thing I LOVE about C is the offline documentation for standard libraries. Beej’s guide to network programming is amazing but also reproducible with “man socket” and then wandering down the rabbit hole. (Ref: https://beej.us/guide/bgnet/html/split/) C++, the sprawling beast that it is, you have no choice but to consult some web page to get decent documentation. The same goes for Rust (Please let me know if I am wrong here, I have not used Rust in several years). Maybe it’s just a personal quirk, but when programming I love to shut off Wi-Fi and focus on whatever it is I want to get done. It is not always feasible of course, but it is definitely my preferred way to work. And C is the most amenable language to being offline.
beej71 · 2023-01-22
https://beej.us/ But, like I said, not super impressive. I still maintain though if folks spent the time on it, they could get same the effect they were looking for with 10% the bandwidth.
iamdual · 2022-10-27
He has written other excellent articles. Check more at: https://beej.us/guide/
dimman · 2022-07-26
Interesting read. I’m quite curious of where all the initial misperceptions about sockets comes from. I can highly recommend Beej’s guide to network programming: https://beej.us/guide/bgnet/ That together with Linux/BSD man pages should be everything needed, some great documentation there.
robalni · 2022-07-20
The weirdest thing just happened. I was on https://beej.us/guide/ and I removed the last part of the URL to make it only https://beej.us and I pressed enter. This took me to cnet.com. I have never been on cnet.com before. I have no idea how this happened. Does anyone have a clue? I'm using Firefox if that matters. Did a web server somewhere get hit by a cosmic ray or is beej's server infected by something? This is super weird. When I try to do it again it just takes me to beej's site as expected.
colbyhub · 2022-01-06
I freaking love his guides, I'm currently reading through his C guide: https://beej.us/guide/bgc/ It's very entertaining to read though which holds my attention well, and is well suited to people with existing programming experience. I've tried to read K&R but I keep coming back to Beej's.
systemvoltage · 2022-01-06
I have to point this one out from his guide to C: https://beej.us/guide/bgc/html/split/hello-world.html > Before we go on, why would I even begin to bother pointing out that a pound sign is called an octothorpe? The answer is simple: I think the word octothorpe is so excellently funny, I have to gratuitously spread its name around whenever I get the opportunity. Octothorpe. Octothorpe, octothorpe, octothorpe. I can't find it right now but somewhere in the guide in a different chapter, he randomly inserts "Octothorpe"... good comedy. I think this kind of writing is exceedingly rare and immensely enjoyable.
scudd · 2021-06-27
I think Beej's Guide to Network Programming is IMO hands down the best resource I've come across: https://beej.us/guide/bgnet/ It also doubles as a very great introduction to C, if that something you're interested in. It's funny because both C and socket level programming are often a barrier, or at least they were for me. It's an attestant to the quality of Beej's guide that he introduces both simultaneously, and makes it very approachable. This is one of those sources that helped me disproportionately grow as a programmer in a short period of time.
jka · 2021-06-04
Beej's Guide to Network Programming is a classic: https://beej.us/guide/bgnet/
dylanz · 2021-03-31
... and a good resource for network programming is the classic "Beej's Guide to Network Programming": https://beej.us/guide/bgnet/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close