Network Programming

If you want a book on network programming, there are a few classic choices. [Comer’s] TCP/IP books are a great reference but sometimes is too low level. “Unix Networking Programming” by [Stevens] is the usual choice, but it is getting a little long in the tooth, as well. Now we have “Beej’s Guide to Network Programming Using Internet Sockets.” While the title doesn’t exactly roll off the tongue, the content is right on and fresh. Best part? You can read it now in your browser or in PDF format.

All the topics you’d expect are there in ten chapters. Of course, there’s the obligatory description of what a socket is and the types of sockets you commonly encounter. Then there’s coverage of addressing and portability. There’s even a section on IPV6.

After covering the most common socket API calls, there is a simple example. Then Chapter 7 covers “slightly advanced techniques.” That includes things like the select API call, partial sends, and broadcast packets. Chapter 9 is just man pages which are handy if you have the printed reference on an airplane. Overall, a good modern treatment of the topic.

While the socket API originated at Berkely, just about every network stack looks the same more or less, so if you learn these calls, you’ll do fine on whatever operating system you like, including many microcontrollers.

Usually, when we are looking at networking, our eyes are focused lower in the stack. But if you aren’t reverse engineering, the API is definitely the way to go.

13 thoughts on “Network Programming

  1. Great link.
    It’s good to know that the 7(4?)-layer model is alive and kicking.
    Of course, nowadays we work within frameworks (Qt, anyone?) but it’s always good to know which OS (by which I mean Linux, of course!) calls are being utilised. Furthermore, you might use something like “QTcpSocket::connect() ” but it always pays to know what that is actually doing, and what a TCP socket actually is.

Leave a Reply to MyselfCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.