Whether you just want to learn the concepts and practices that allow network programming to work or want to polish your skills in this area, The Definitive Guide to Linux Network Programming will serve you well. I have rarely seen a book about programming that managed to bridge the gap between newcomer and expert so well. The authors clearly aimed this book for those who are programmers, yet they have made it accessible even to those who are not. Depending on how much you know about network programming, you can start at different points in the book. The authors kindly make suggestions in the introduction as to which sections are most relevant for those who are more expert already. I was very impressed by the extensive amount of code that is included. In many cases, you will be able to program simply by using the examples in the book. That resource is nicely extended by two lengthy case studies that are intended to help you think your way through the process as well as to integrate the book's subjects. The first case study is for a networked chat application that is written in C++. The second case study looks at the many tricky security questions associated with any networked application. The book is filled with guidelines and suggestions for when to favor which approaches among the many that Linux offers you. I was especially pleased to find out about many development and debugging tools that make the job easier. Here's the book's structure: Part One deals with the basics (networks, protocols, functions, socket programming, sessions and state). Part Two looks at design and architecture (emphasizing design decisions and development processes). Part Three is devoted to security.Read more ›
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
36 of 39 people found the following review helpful
Short, yet, Excellent.26 Feb. 2005
Shadi T. Khasawneh
- Published on Amazon.com
A very insteresting book. I would like to see a more advanced version of this book in the future. It covers the basics of TCP & UDP, and helps you in choosing a suitable design/protocol for your applications, and covers everything related to network programming including security, debugging... Excellent work!
8 of 9 people found the following review helpful
skimpy skimpy skimpy19 July 2008
- Published on Amazon.com
Skimpy coverage, the code compiles with a bazillion warnings, and for me at least the first client/server examples just plain don't work and don't provide useful enough error messages to figure out. It's not until you get to a much later chapter that you learn about debugging techniques that *might* help. This debugging information should either have been moved forward within the book, or should have been forward-referenced from the first example. Additionally the book repeats the same information over and over again, for instance in any example that calls for the use of the INADDR_ANY constant, the author explains what it stands for each and every time. This sort of repetition is simply not acceptable in a book fancying itself as somehow "definitive" yet only 300 or so pages. Furthermore, rather than covering ins and outs of actual network programming, far too much is devoted to the basics of various protocols (the first 20+% of the book), and/or security specifically (the last 20+% of the book). A better title for this book would be Linux Network Programming *Fundamentals*, and as such this would warrant 4 stars, maybe even 5 if it taught debugging earlier. As a *Definitive Guide* though it is a 2 at best; if you want truly definitive, albeit regarding Unix generally and not necessarily Linux, Stevens' "Unix Network Programming" series is the real deal.
6 of 7 people found the following review helpful
fine grained control7 Oct. 2004
- Published on Amazon.com
I'm not sure about the "definitive" claim in the book's title. But after reading the book, I'm quite willing to grant that the authors have indeed done a thorough job. The book calls to mind the now classic series on Internetworking, by Comer and Stevens in the early 90s. If you've been in this game long enough, you know exactly what I mean. Of course, Comer and Stevens were looking at unix boxes hooked to the Internet.
But, as you can see in this book, linux network programming carries over very closely to those unix versions. And both use what is basically the same IPv4, despite the massive physical buildout of the Internet.
The book's code is unabashedly C. No cute user interface to trip over. It can test your knowledge of C quite well. Partly because the coding and handling of network calls is deliberately low level. Using the book's approach, you can get a fine grained appreciation of how to talk across the Internet. Higher level languages like Java and C# come with network libraries that deliberately hide a lot of this detail. Which is good for many applications. But sometimes you might need the performance and control that this book offers.
1 of 1 people found the following review helpful
Good IPV4 Networking coverage with worked examples and an IPV6 Appendix17 Sept. 2011
Neil G. Matthews
- Published on Amazon.com
This 13 chapter book sets high expectations in claiming to be a "definitive guide", but at 350 pages, of which about 20% is worked examples, perhaps a thorough introductory guide would be a better description. The text is deliberately designed in a modular fashion and is divided into three sections: Fundamentals, Design Architecture and Security. The introduction contains a good "What you should read" section that explains the book's structure and how to get the best out of it for the categories of beginner, novice, experienced or expert. This is followed by chapter summaries, so you can quickly identify how you can get the most out of this book and find sections of specific interest. I found the authors did a good job of presenting what could be a dry subject in an interesting style that should suit a broad range of readers. The commented C/C++ source code examples are conveniently available from the publisher's website, but annoyingly I found that the examples wouldn't build as provided.
Chapters 1 to 4 in the Fundamentals section cover Networks and Protocol theory, Network Functions, Socket Programming (datagram vs streaming) and Protocols, Sessions and State. Well explained sample code is presented beginning with the Functions chapter as the book moves into practical examples of Ethernet programming.
Chapters 5 to 9 in the Design Architecture section starts with a very interesting chapter examining the various strengths and weaknesses associated with some example client-server architectures including the Apache 2 Web Server, i.e. multiplexing, multiprocessing servers, single process per client vs the process pool approach and multithreaded servers. Guidance on which approach is best for your specific implementation is provided with the pros and cons summarised in a useful one page table. A chat program demonstrates the use of a custom protocol implementation in chapter 6, which is further developed in the case study in chapter 9, where 40 pages are allocated to describing in detail how this application is implemented in C++. Chapters 7 and 8 look at the various design decisions involved in designing a networked application, i.e. TCP vs UDP, custom application protocol vs established protocol, client-server architecture (two or three tier), thick, thin and modular clients and server considerations such daemonising, logging, privilege dropping and chroot jails. These latter security options are covered in greater detail in the Security section (chapters 10 to 13). The Debugging and Development Cycle is specifically covered in chapter 8. This chapter also covers a few tools that could prove useful development aids as well as providing some tips to ease development process, some of which are covered in more detail in the Security section.
Chapter 10 introduces secure communications using Tunnelling, PKI and OpenSSL, along with a client and server example. Authentification and Data Verification methods using the PAM library along with an in-depth look at PKI management code are covered in chapter 11. Chapter 12 covers common security problems and mitigation steps - useful tips that will help you avoid some common coding security vulnerabilities and finishes with a couple of overview paragraphs on the use of Flawfinder and Splint for security vulnerability code analysis.
The Security section is rounded out by an extensive worked PAM/PKI client & server example (10% of the book content), commencing at the design stage - reinforcing the philosophy that security must be considered at the start - not as a bolt on, with the worked example reinforcing material introduced earlier.
The 19 page appendix on IPV6 covers how to handle the expanded addressing provided by IPV6, how to port existing IPV4 applications to IPV6 and tips on how to create applications that will handle both IPV4 and IPV6.
The 15 page index is fairly comprehensive and there is the eBook version for easier searching if you think you'll be using this as a frequent reference book.
4 of 6 people found the following review helpful
Short, pragmatic guide to C network programming12 Oct. 2004
Jack D. Herrington
- Published on Amazon.com
This is a straightforward walkthrough of developing network clients and servers in C on Linux. Though many of the same principles could be applied to Windows network programming.
The book starts off with a small chapter on architecture. It quickly becomes chapters of annotated code with a few illustrations thrown in. The text is well written and the the book is short enough to make that format workable.
The last section of the book is dedicated to security. Which I appreciate since C programming is so fraught with security problems.
I recommend this book to those looking to write basic network protocols with C. Though I think it should be said that using a wrapper C++ library, or some higher level applications language for network protocol work will be advisable.