Add Book to My BookshelfPurchase This Book Online

Chapter 14 - Networking with Sockets

UNIX Systems Programming for SVR4
David A. Curry
 Copyright © 1996 O'Reilly & Associates, Inc.

Chapter Summary
In this chapter, we examined the Berkeley networking paradigm, called sockets. This paradigm is used throughout the world when writing networking applications for UNIX systems. For the most part, is is portable to just about any version of UNIX, since most vendors simply adopted Berkeley's implementation. The only significant difference between versions are the socket options available via the getsockopt and setsockopt functions.
Network programming is actually fairly straightforward. The functions are relatively simple to understand, and there are no major “gotchas” to be wary of. For a more complete understanding of UNIX network programming, though, you should examine some of the actual network programs used on the typical UNIX system, such as ping, tftp, and rlogin. Seeing how commands that you use every day are written will help you to better understand just how all these pieces are glued together.
If you would like to conduct this examination on your own, the Berkeley 4.4BSD Lite operating system distribution is widely available on the Internet. It contains the full source code to a number of commonly used UNIX network programs, including ping, rlogin, rsh, telnet, ftp, tftp, routed, and named. Source code for the Linux, 386BSD, and FreeBSD operating systems is also available on the Internet; these operating systems are based, at least in part, on the Berkeley code, and also make good reference sources.
If you prefer to be guided through the examination, the definitive reference on the topic is W. Richard Stevens' UNIX Network Programming, published by Prentice-Hall. Stevens covers the network programming functions in detail, and then reinforces the dicsussion by examining the source code for a number of common UNIX networking programs, including ping, tftp, lpr, rlogin, and rmt. The discussion of these programs breaks them down almost line by line, explaining what they do. If you plan to be doing a substantial amount of network programming, you'll find this book indispensable.

Previous SectionNext Section
Books24x7.com, Inc © 2000 –  Feedback