UNIX Network Programming Volume 1, Third Edition: The Sockets Networking API By W. Richard Stevens, Bill Fenner, Andrew M. Rudoff

UNIX Network Programming Volume 1 3rd Edition

Download Free UNIX Network Programming Volume 1, Third Edition: The Sockets Networking API Pdf

Introduction: UNIX Network Programming Volume 1 3rd Edition

Getting Started with UNIX Network Programming Volume 1 3rd Edition The Sockets Networking API, This book(UNIX Network Programming Volume 1 3rd Edition The Sockets Networking API Volume 1) is for people who want to write programs that communicate with each other using an application program interface (API) known as sockets. Some readers may be very familiar with sockets already, as that model has become synonymous with network programming. Others may need an introduction to sockets from the ground up. The goal of this book is to offer guidance on network programming for beginners as well as professionals, for those developing new network-aware applications as well as those maintaining existing code, and for people who simply want to understand how the networking components of their system function.
All the examples in this Book(UNIX Network Programming Volume 1 3rd Edition) are actual, runnable code tested on Unix systems. However, many non-Unix systems support the sockets API and the examples are largely operating system-independent, as are the general concepts we present. Virtually every operating system (OS) provides numerous network-aware applications such as Web browsers, email clients, and file-sharing servers. We discuss the usual partitioning of these applications into client and server and write our own small examples of these many times throughout the text.
Presenting this material in a Unix-oriented fashion has the natural side effect of providing background on Unix itself, and on TCP/IP as well. Where more extensive background may be interesting, we refer the reader to other texts. Four texts are so commonly mentioned in this book that we’ve assigned them the following abbreviations:
1) APUE: Advanced Programming in the UNIX Environment [Stevens 1992]
2) TCPv1: TCP/IP Illustrated, Volume 1 [Stevens 1994]
3) TCPv2: TCP/IP Illustrated, Volume 2 [Wright and Stevens 1995]
4) TCPv3: TCP/IP Illustrated, Volume 3 [Stevens 1996]
TCPv2 contains a high level of detail very closely related to the material in this book, as it describes and presents the actual 4.4BSD implementation of the network programming functions for the sockets API (socket, bind, connect, and so on). If one understands the implementation of a feature, the use of that feature in an application makes more sense.

UNIX Network Programming The Sockets Networking API Chapters and Sections

Table Of Contents For UNIX Network Programming Volume 1 3rd Edition

Introduction: UNIX Network Programming Volume 1 3rd Edition
Changes from the Second Edition
Using This Book
Source Code and Errata Availability
Acknowledgments

Part 1: Introduction and TCP/IP
Chapter 1. Introduction

Introduction: UNIX Network Programming Volume 1 3rd Edition
A Simple Daytime Client
Protocol Independence
Error Handling: Wrapper Functions
A Simple Daytime Server
Roadmap to Client/Server Examples in the Text
OSI Model
BSD Networking History
Test Networks and Hosts
Unix Standards
64-Bit Architectures
Summary
Exercises

Chapter 2. The Transport Layer: TCP, UDP, and SCTP

Introduction: UNIX Network Programming Volume 1 3rd Edition
The Big Picture
User Datagram Protocol (UDP)
Transmission Control Protocol (TCP)
Stream Control Transmission Protocol (SCTP)
TCP Connection Establishment and Termination
TIME_WAIT State
SCTP Association Establishment and Termination
Port Numbers
TCP Port Numbers and Concurrent Servers
Buffer Sizes and Limitations
Standard Internet Services
Protocol Usage by Common Internet Applications
Summary
Exercises

Part 2: Elementary Sockets
Chapter 3. Sockets Introduction

Introduction
Socket Address Structures
Value-Result Arguments
Byte Ordering Functions
Byte Manipulation Functions
inet_aton, inet_addr, and inet_ntoa Functions
inet_pton and inet_ntop Functions
sock_ntop and Related Functions
read n, written, and readline Functions
Summary
Exercises

Chapter 4. Elementary TCP Sockets

Introduction: UNIX Network Programming Volume 1 3rd Edition
socket Function
connect Function
bind Function
listen Function
accept Function
fork and exec Functions
Concurrent Servers
close Function
getsockname and getpeername Functions
Summary
Exercises

Chapter 5. TCP Client/Server Example

Introduction
TCP Echo Server: main Function
TCP Echo Server: str_echo Function
TCP Echo Client: main Function
TCP Echo Client: str_cli Function
Normal Startup
Normal Termination
POSIX Signal Handling
Handling SIGCHLD Signals
wait and waitpid Functions
Connection Abort before accepting Returns
Termination of Server Process
SIGPIPE Signal
Crashing of Server Host
Crashing and Rebooting of Server Host
Shutdown of Server Host
Summary of TCP Example
Data Format
Summary
Exercises

Chapter 6. I/O Multiplexing: The select and poll Functions

Introduction
I/O Models
select Function
str_cli Function (Revisited)
Batch Input and Buffering
shutdown Function
str_cli Function (Revisited Again)
TCP Echo Server (Revisited)
pselect Function
poll Function
TCP Echo Server (Revisited Again)
Summary
Exercises

Chapter 7. Socket Options

Introduction
getsockopt and setsockopt Functions
Checking if an Option Is Supported and Obtaining the Default
Socket States
Generic Socket Options
IPv4 Socket Options
IC MPv6 Socket Option
IPv6 Socket Options
TCP Socket Options
SCTP Socket Options
fcntl Function
Summary
Exercises

Chapter 8. Elementary UDP Sockets

Introduction
recvfrom and sendto Functions
UDP Echo Server: main Function
UDP Echo Server: dg_echo Function
UDP Echo Client: main Function
UDP Echo Client: dg_cli Function
Lost Datagrams
Verifying Received Response
Server Not Running
Summary of UDP Example
connect Function with UDP
dg_cli Function (Revisited)
Lack of Flow Control with UDP
Determining Outgoing Interface with UDP
TCP and UDP Echo Server Using select
Summary
Exercises

Chapter 9. Elementary SCTP Sockets

Introduction
Interface Models
sctp_bindx Function
sctp_connectx Function
sctp_getpaddrs Function
sctp_freepaddrs Function
sctp_getladdrs Function
sctp_freeladdrs Function
sctp_sendmsg Function
sctp_recvmsg Function
sctp_opt_info Function
sctp_peeloff Function
shutdown Function
Notifications
Summary
Exercises

Chapter 10. SCTP Client/Server Example

Introduction
SCTP One-to-Many-Style Streaming Echo Server: main Function
SCTP One-to-Many-Style Streaming Echo Client: main Function
SCTP Streaming Echo Client: str_cli Function
Exploring Head-of-Line Blocking
Controlling the Number of Streams
Controlling Termination
Summary
Exercises

Chapter 11. Name and Address Conversions

Introduction
Domain Name System (DNS)
gethostbyname Function
gethostbyaddr Function
getservbyname and getservbyport Functions
getaddrinfo Function
gai_strerror Function
freeaddrinfo Function
getaddrinfo Function: IPv6
getaddrinfo Function: Examples
host_serv Function
tcp_connect Function
tcp_listen Function
udp_client Function
udp_connect Function
udp_server Function
getnameinfo Function
Re-entrant Functions
gethostbyname_r and gethostbyaddr_r Functions
Obsolete IPv6 Address Lookup Functions
Other Networking Information
Summary
Exercises

Part 3: Advanced Sockets
Chapter 12. IPv4 and IPv6 Interoperability

Introduction
IPv4 Client, IPv6 Server
IPv6 Client, IPv4 Server
IPv6 Address-Testing Macros
Source Code Portability
Summary
Exercises

Chapter 13. Daemon Processes and the inetd Superserver

Introduction
syslogd Daemon
syslog Function
daemon_init Function
inetd Daemon
daemon_inetd Function
Summary
Exercises

Chapter 14. Advanced I/O Functions

Introduction
Socket Timeouts
recv and send Functions
readv and writev Functions
recvmsg and sendmsg Functions
Ancillary Data
How Much Data Is Queued?
Sockets and Standard I/O
Advanced Polling
Summary
Exercises

Chapter 15. Unix Domain Protocols

Introduction
Unix Domain Socket Address Structure
socketpair Function
Socket Functions
Unix Domain Stream Client/Server
Unix Domain Datagram Client/Server
Passing Descriptors
Receiving Sender Credentials
Summary
Exercises

Chapter 16. Nonblocking I/O

Introduction
Nonblocking Reads and Writes: str_cli Function (Revisited)
Nonblocking connect
Nonblocking connect: Daytime Client
Nonblocking connect: Web Client
Nonblocking accept
Summary
Exercises

Chapter 17. ioctl Operations

Introduction
ioctl Function
Socket Operations
File Operations
Interface Configuration
get_ifi_info Function
Interface Operations
ARP Cache Operations
Routing Table Operations
Summary
Exercises

Chapter 18. Routing Sockets

Introduction
Datalink Socket Address Structure
Reading and Writing
sysctl Operations
get_ifi_info Function (Revisited)
Interface Name and Index Functions
Summary
Exercises

Chapter 19. Key Management Sockets

Introduction
Reading and Writing
Dumping the Security Association Database (SADB)
Creating a Static Security Association (SA)
Dynamically Maintaining SAs
Summary
Exercises

Chapter 20. Broadcasting

Introduction
Broadcast Addresses
Unicast versus Broadcast
dg_cli Function Using Broadcasting
Race Conditions
Summary
Exercises

Chapter 21. Multicasting

Introduction
Multicast Addresses
Multicasting versus Broadcasting on a LAN
Multicasting on a WAN
Source-Specific Multicast
Multicast Socket Options
mcast_join and Related Functions
dg_cli Function Using Multicasting
Receiving IP Multicast Infrastructure Session Announcements
Sending and Receiving
Simple Network Time Protocol (SNTP)
Summary
Exercises

Chapter 22. Advanced UDP Sockets

Introduction
Receiving Flags, Destination IP Address, and Interface Index
Datagram Truncation
When to Use UDP Instead of TCP
Adding Reliability to a UDP Application
Binding Interface Addresses
Concurrent UDP Servers
IPv6 Packet Information
IPv6 Path MTU Control
Summary
Exercises

Chapter 23. Advanced SCTP Sockets

Introduction
An Autoclosing One-to-Many-Style Server
Partial Delivery
Notifications
Unordered Data
Binding a Subset of Addresses
Determining Peer and Local Address Information
Finding an Association ID Given an IP Address
Heartbeating and Address Failure
Peeling Off an Association
Controlling Timing
When to Use SCTP Instead of TCP
Summary
Exercises

Chapter 24. Out-of-Band Data

Introduction
TCP Out-of-Band Data
sockatmark Function
TCP Out-of-Band Data Recap
Summary
Exercises

Chapter 25. Signal-Driven I/O

Introduction
Signal-Driven I/O for Sockets
UDP Echo Server Using SIGIO
Summary
Exercises

Chapter 26. Threads

Introduction
Basic Thread Functions: Creation and Termination
str_cli Function Using Threads
TCP Echo Server Using Threads
Thread-Specific Data
Web Client and Simultaneous Connections (Continued)
Mutexes: Mutual Exclusion
Condition Variables
Web Client and Simultaneous Connections (Continued)
Summary
Exercises

Chapter 27. IP Options

Introduction
IPv4 Options
IPv4 Source Route Options
IPv6 Extension Headers
IPv6 Hop-by-Hop Options and Destination Options
IPv6 Routing Header
IPv6 Sticky Options
Historical IPv6 Advanced API
Summary
Exercises

Chapter 28. Raw Sockets

Introduction
Raw Socket Creation
Raw Socket Output
Raw Socket Input
ping Program
traceroute Program
An IC MP Message Daemon
Summary
Exercises

Chapter 29. Datalink Access

Introduction
BSD Packet Filter (BPF)
Datalink Provider Interface (DLPI)
Linux: SOCK_PACKET and PF_PACKET
libpcap: Packet Capture Library
libnet: Packet Creation and Injection Library
Examining the UDP Checksum Field
Summary
Exercises

Chapter 30. Client/Server Design Alternatives

Introduction
TCP Client Alternatives
TCP Test Client
TCP Iterative Server
TCP Concurrent Server, One Child per Client
TCP Preforked Server, No Locking Around accept
TCP Preforked Server, File Locking Around accept
TCP Preforked Server, Thread Locking Around accept
TCP Preforked Server, Descriptor Passing
TCP Concurrent Server, One Thread per Client
TCP Prethreaded Server, per-Thread accept
TCP Prethreaded Server, Main Thread accept
Summary
Exercises

Chapter 31. Streams

Introduction: UNIX Network Programming Volume 1 3rd Edition
Overview
getmsg and putmsg Functions
getpmsg and putpmsg Functions
ioctl Function
Transport Provider Interface (TPI)
Summary
Exercises

Download Now

Note: If you have any question about Download Free UNIX Network Programming Volume 1 3rd Edition Pdf Then you can comment it.

Related Posts:


Be the first to comment

Leave a Reply

Your email address will not be published.


*