The Definitive Guide to Linux Network Programming / Edition 1

The Definitive Guide to Linux Network Programming / Edition 1

4.0 1
by Nathan Yocom, John Turner, Keir Davis
     
 

ISBN-10: 1590593227

ISBN-13: 9781590593226

Pub. Date: 08/03/2004

Publisher: Apress

The Definitive Guide to Linux Network Programming offers a clear, concise treatment of creating clients and servers under the Linux operating system. This book assumes that you know C and have experience developing code on Linux, but it provides everything else you'll need as a programmer for real-world network programming.

Whether you’re a

Overview

The Definitive Guide to Linux Network Programming offers a clear, concise treatment of creating clients and servers under the Linux operating system. This book assumes that you know C and have experience developing code on Linux, but it provides everything else you'll need as a programmer for real-world network programming.

Whether you’re a Windows developer looking to expand to Linux, or you’re a proficient Linux developer looking to incorporate client-server programming into your applications, this book has a wealth of invaluable information to suit your needs.

This book covers design, implementation, debugging, and security. You’ll also learn about the many kinds of socket types, sessioned versus sessionless protocols, and encryption, as well as how to build a custom protocol, how to use SSL, and how to tunnel data.

Table of Contents

  1. Networks and Protocols
  2. Functions
  3. Socket Programming
  4. Protocols, Sessions, and State
  5. Client-Server Architecture
  6. Implementing Custom Protocols
  7. Design Decisions
  8. Debugging and Development Cycle
  9. Case Study: A Networked Application
  10. Securing Network Communication
  11. Authentication and Data Signing
  12. Common Security Problems
  13. Case Study: A Secure Networked Application

Product Details

ISBN-13:
9781590593226
Publisher:
Apress
Publication date:
08/03/2004
Edition description:
2004
Pages:
400
Product dimensions:
7.00(w) x 9.25(h) x 0.83(d)

Table of Contents

About the Authorsxi
About the Technical Reviewerxiii
Acknowledgmentsxv
Introductionxvii
Part 1Fundamentals1
Chapter 1Networks and Protocols3
Circuits vs. Packets3
Internetworking4
Ethernets6
Ethernet Frames7
Addressing8
Internet Protocol17
User Datagram Protocol25
Transmission Control Protocol27
The Client-Server Model31
The Domain Name System33
Summary39
Chapter 2Functions41
What Is a Socket?41
Using Sockets43
Summary63
Chapter 3Socket Programming65
User Datagram Protocol65
File Transfer73
Error Handling83
Summary84
Chapter 4Protocols, Sessions, and State85
State vs. Stateless85
Methods for Maintaining State87
Summary96
Part 2Design and Architecture97
Chapter 5Client-Server Architecture99
Client Test Program99
Multiplexing102
Forking108
Multithreading118
Combining Preforking and Prethreading128
Which Method Should You Choose?130
Dealing with Large Amounts of Data130
Summary135
Chapter 6Implementing Custom Protocols137
What Is a Protocol?137
Designing a Custom Protocol138
Our Chat Protocol142
Protocol Registration150
Summary153
Chapter 7Design Decisions155
TCP vs. UDP155
Application Protocol Choices157
Client-Server Architecture158
Client-Side Considerations161
Server-Side Considerations162
Summary172
Chapter 8Debugging and Development Cycle173
Tools173
Chicken or the Egg177
Debugging178
Defensive Programming179
Summary183
Chapter 9Case Study: A Networked Application185
The Server185
The Client201
Recommendations for Improvements226
Summary227
Part 3Security229
Chapter 10Securing Network Communication231
Tunneling232
Public Key Infrastructure235
Secure Network Programming Using OpenSSL242
Summary260
Chapter 11Authentication and Data Signing261
The Old Scenario261
The Present-Day Scenario262
The PAM Library263
Public Key Authentication268
Single Sign-on278
Summary279
Chapter 12Common Security Problems281
Common Attacks281
Buffer Overflow282
Secure Coding Practices282
Tools of the Trade297
Summary299
Chapter 13Case Study: A Secure Networked Application301
The Necessary Decisions301
Code Design and Layout303
The Code304
Analysis335
Summary339
AppendixIPv6341
IPv6 Addressing342
IPv6 and Linux344
Porting to IPv6345
Future Enhancements354
Summary358
Index361

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >

The Definitive Guide to Linux Network Programming 4 out of 5 based on 0 ratings. 1 reviews.
Guest More than 1 year ago
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.