Related products:
The Linux TCP/IP Stack: Networking for Embedded Systems (Networking Series) (Networking Series)
GNU/Linux Application Programming (Programming Series)
Linux Kernel Development (2nd Edition)
Linux Programming by Example : The Fundamentals
Understanding Linux Network Internals
|
Programming
The Definitive Guide to Linux Network Programming (Expert's Voice)
Format: Paperback
Author: Keir Davis
ReleaseDate: 05 August, 2004
Publisher: Apress
Rating:
very good overview of linux network programming
I was a bit apprehensive at first since it's published by apress which I had actually never heard of (but that's my own ignorance); and I was glad to find that the explanations are clear as day and there is plenty of code to illustrate what has been talked about. I'm still reading this book but I have to say that I'm very impressed with it so far. I really appreciate the section that covers the different design choices when building a network application. Basically, this book is about getting the job done - and it's very refreshing reading a book that doesn't bore you with useless information.
My only criticism is that there is a bit of inconsistency between the code examples - nothing too big - but it became a bit annoying seeing one C lib function used in a previous example and then another similar function used in the next example.
This book also assumes that you have an intermediate knowledge of the material (it is written on the book itself actually) but at least for me this was not a problem and even if you are not sure about something googling that information would be a piece of cake.
Short, yet, Excellent.
I would like to see a more advanced version of this book in the future. A very insteresting book. 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!.
An adequate introduction to the subject
Therefore, individuals who prefer to do network programming in PERL will have to find another book. This book gives a good general overview of network programming for the Linux operating system along with the C source code used for the implementation. It is written for the beginner to network programming, but could serve as a general reference for more seasoned network programmers. Due to the straightforward way in which the authors explain the ideas, the book can be rapidly assimilated by those readers who are pressed for time and need to get to the frontiers of the subject with little delay. I only read the first 7 chapters of the book, and so this review will be confined to these.
In chapter 1, the authors give an elementary and general overview of networks. All of the discussion is very easy to understand, and should be helpful for newcomers. In particular, the idea of a port is sometimes a source of confusion for those who are new to networking, sometimes viewing them as being hardware interfaces on network devices. They are rather virtual destinations, and allow a standardization of just what kind of network traffic can be passed to and from a node.
Chapter 2 is an introduction to socket functions, a `socket' being explained as an abstraction for network communication. The Linux operating system uses the Berkeley socket interface (over TCP/IP), and the basic network I/O functions and the notion of a `socket descriptor' are explained in detail. A client/server configuration is used to illustrate the function calls utilized in sockets. Address data structures, such as `sockaddr_in', `linger', and `servent', are discussed. The authors also address the need for specifying the network byte order, so as not have to deal with issues of just how numbers are represented on a particular machine. Code is given for a simple application consisting of a string transfer from server to client.
In chapter 3, the authors concentrate on how to transfer files between a client and server but over the (connectionless) UDP protocol using `datagram sockets. ' The discussion clearly points out the differences between TCP/IP and UDP in client/server network communications when doing file transfer. A very brief discussion is given for error handling.
The authors go into more of the details of protocol architectures and methods. An important part of this discussion is the difference between `stateful' servers, which maintain information about the current connections with its clients, and `stateless' servers that do not. A fairly thorough discussion is given on the different methods for maintaining state in a server, using the concept of `sessions'. The role of the HTTP protocol in maintaining a session in a stateless server is outlined, along with the role of `session IDs' for this purpose. The authors also discuss how to maintain state on the client side, using cookies, hidden form variables, and URL parameters.
The next part of the book deals with design issues and decisions and how to develop network programs that function in the client-server environment. Explicit programs are given that illustrate multiplexing, forking, and preforking, the latter of which will alleviate somewhat the costs associated with creating child processes during the initialization of the application. The authors also discuss multithreading, and its advantages in performance versus its disadvantages in stability (due to its use of shared memory). They also give the usual cautions in the use of multithreading, such as the need for mutexes when using global variables shared among threads, and when dealing with servers that must maintain a large number of persistent connections. For readers in the scientific community, a very useful section on how to deal with large amounts of data using nonblocking sockets is given.
Only a cursory discussion is given of "thick" and "thin" clients in this part, probably since the book is about Linux-based network programming. In non-Linux environments, thin-client architectures have become very important in recent years. The authors do discuss issues from both the client-side and the server-side, such as the differences between `monolithic' and `modular' clients, and the use of daemons on network servers. The advantages for using `privilege dropping" are also outlined, this being used in Web server programming for binding ports, and in giving an application superuser status. .
|
|