Login with Facebook
Login
Books
NCERT
CBSE
AIEEE
IITJEE
Tamilnadu
BITS MSSS
ANU
IPE
UPSC
UNIX Network Programming
(
1
,
0
,
3
0
)
Share
1
,
0
0
by
basantm
|
link
add note
see all notes
Contents
Part 1. Introduction and TCP/IP
Chapter 1. Introduction
1.1 Introduction
1.2 A Simple Daytime Client
1.3 Protocol Independence
1.4 Error Handling: Wrapper Functions
1.5 A Simple Daytime Server
1.6 Roadmap to Client/Server Examples in the Text
1.7 OSI Model
1.8 BSD Networking History
1.9 Test Networks and Hosts
1.10 UNIX Standards
1.11 64-Bit Architectures
2. The Transport Layer: TCP, UDP, and SCTP
2.1 Introduction
2.2 The Big Picture
2.3 User Datagram Protocol (UDP)
2.4 Transmission Control Protocol(TCP)
2.5 Stream Control Transmission Protocol (SCTP)
2.6 TCP Connection Establishment and Termination
2.7 TIME - WAIT State
2.8 SCTP Association Establishment and Termination
2.9 Port Numbers
2.10 TCP Port Numbers and Concurrent Servers
2.11 Buffer Sizes and Limitations
2.12 Standard Internet Services
2.13 Protocol Usage by Common Internet Applications
2.14 Summary
3. Sockets Introduction
3.1 Introduction
3.2 Socket Address Structures
3.3 Value-Result Agreements
3.4 Byte Ordering Functions
3.5 Byte Manipulation Functions
3.6 inet_aton, inet_addr, inet__ntoa Functions
3.7 Inet_pton and Inet_ntop Functions
3.8 Sock_ntop and Related Functions
3.9 readn, writen and readline Functions
4. Elementary TCP Sockets
4.1 Introduction
4.2 Socket Function
4.3 Connect Function
4.4 Bind Function
4.5 Listen Function
4.6 accept Function
4.7 fork and Exec Functions
4.8 Concurrent Servers
4.9 Close Function
4.10 getsock name and getpeer name Functions
4.11 Summary
5. TCP Client/Server Example
5.1 Introduction
5.2 TCP Echo Server: main function
5.3 TCp Echo Server:str_echo Function
5.4 TCP Echo Client:Main Function
5.5 TCP Echo Client: Str_Cli Function
5.6 Normal Startup
5.7 Normal Termination
5.8 POSIX Signal Handling
5.9 Handling SIGCHLD Signals
5.10 wait and waitpid Functions
5.11 Connection Abort before Accept Returns
5.12 Termination of Server Process
5.13 SIGPIPE Signal
5.14 Crashing of Server Host
5.15 Crashing and Rebooting of Server Host
5.16 Shutdown of server Host
5.17 Summary of TCP Example
5.18 Data Format
5.19 Summary
6. I/O Multiplexing: The Select and Poll Functions
6.1 Introduction
6.2 I/O Models
6.3 Select Function
6.4 str_cli Function (Revisited)
6.5 Batch Input and Buffering
6.6 shutdown Function
6.7 str_cli Function
6.8 TCP Echo Server
6.9 pselect Function
6.10 poll function
6.11 TCp Echo Server
6.12 Summary
7. Socket Options
7.1 Introduction
7.2 getsockopt and setsockopt Functions
7.3 Checking if an Option is Supported and Obtaining the Default
7.4 Socket States
7.5 Generic Socket Options
7.6 IPv4 Socket Options
7.7 ICMPv6 Socket Option
7.8 IPV6 Socket options
7.9 TCp Socket options
7.10 SCTP Socket Options
7.11 Summary
8. Elementary UDP Sockets
8.1 Introduction
8.2 recvfrom and sendto Functions
8.3 UDP Echo Server: Main function
8.4 UDP Echo Server: dg_echo function
8.5 UDP Echo Client: Main Function
8.6 UDP Echo Client : dg_cli Function
8.7 Lost Diagrams
8.8 Verifying Received Response
8.9 Server not Running
8.10 Summary of UDP Example
8.11 Connect Function with UDP
8.12 dg_cli Function (Revisited)
8.13 Lack of flow control with UDP
8.14 Determining Outgoing interface with UDP
8.15 TCP and UDP Echo Server Using select
8.16 Summary
9. Elementary SCTP Sockets
9.1 Introduction
9.2 Interface Models
9.3 Sctp_bindx Function
9.4 Sctp_connectx Function
9.5 Sctp_getladdrs Function
9.6 Sctp_free laddrs Function
9.7 Sctp_send msg Function
9.8 sctp_recvmasg function
9.9 sctp_opt_info Function
9.10 sctp_peeloff Function
9.11 sctp_opt_info Function
9.12 sctp_peeloff function
9.13 Shutdown Function
9.14 Notifications
9.15 Summary
10. SCTP Client/Server Example
10.1 SCTP
10.2 SCTP One-to-many-style Streaming Echo Server: main Function
10.3 Sctp One -to -Many Streaming Echo Client: main function
10.4 SCTP screaming echo client:str_cli Function
10.5 Exploring Head-of-Line Blocking
10.6 Controlling the number of streams
10.7 Controlling Termination
10.8 Summary
11. Name and Address Conversions
11.1 Introduction
11.2 Domain name system
11.3 gethostbyname function
11.4 gesthostbyaddr function
11.5 getservbyname and getservbyport Functions
11.6 getaddrinfo Function
11.7 gai_strerror Function
11.8 freeaddrinfo function
11.9 getaddrinfo function
11.10 getaddrinfo function: Examples
11.11 host_serv Function
11.12 tcp_connect Function
11.13 tcp_listen Function
11.14 udo_client function
11.15 udp_connect function
11.16 udp_server function
11.17 getname info fuction
11.18 Re-entrant Function
11.19 gethostbyname_r and gethostbyaddr_r functions
11.20 Obsolete IPv6 Address Lookup Functions
11.21 Other Networking Information
11.22 Summary
Part III. Advanced Sockets
12. IPv4 and IPv6 Interoperability
12.1 Introduction
12.2 IPv4 Client, IPv6 Server
12.3 IPv6 CLient, IPv4 Server
12.4 IPv6 Address-Testing Macros
12.5 Source code Portability
12.6 Summary
13. Daemon Processes and the Inetd Superserver
13.1 Introduction
13.2 syslogd Daemon
13.3 syslog Function
13.4 daemon_init Function
13.5 inetd Daemon
13.6 daemon_inetd Function
13.7 Summary
14. Advanced I/O Functions
14.1 Introduction
14.2 Socket Timeouts
14.3 recv and send Functions
14.4 readv and Writev Functions
14.5 recvmsg and sendmsg functions
14.6 Ancillary Data
14.7 How Much Data is Queued?
14.8 Sockets and Standard I/O
14.9 Advanced Polling
14.10 Summary
15. Unix Domain Protocols
15.1 Introduction
15.2 Unix Domain Socket Address Structure
15.3 Socketpair Function
15.4 Socket Functions
15.5 Unix Domain Stream Client/Server
15.6 Unix Domain Datagram Client/Server
15.7 Passing Descriptors
15.8 Receiving Sender Credentials
15.9 Summary
16. Non Blocking I/O
16.1 Introduction
16.2 Non Blocking Reads and Writes: Str_cli Function
16.3 Nonblocking Connect
16.4 Nonblocking connect: Daytime client
16.5 Nonblocking connect:web Client
16.6 Nonblocking Accept
16.7 Summary
17. ioctl Operations
17.1 Introduction
17.2 ioctl Function
17.3 Socket Functions
17.4 File Operations
17.5 Interface Configuration
17.6 get_ifi_info Function
17.7 Interface Operations
17.8 ARP Cache OPerations
17.9 Routing Table Operations
17.10 Summary
18. Routing Sockets
18.1 Introduction
18.2 Datalink Socket Address Structure
18.3 Reading and Writing
18.4 sysctl Operations
18.5 get_ifi_info Function
18.6 Interface Name and Index Functions
19. Key Management Sockets
19.1 Introduction
19.2 Reading and Writing
19.3 Dumping the Security Association Database
19.4 Creating a Static Security Association (SA)
19.5 Dynamically Maintaining SAs
19.6 Summary
20. Broadcasting
20.1 Introduction
20.2 Broadcast Addresses
20.3 Unicast Versus Broadcast
20.4 dg_cli Function using Broadcasting
20.5 Race Conditions
20.6 Summary
21. Multicasting
21.1 Introduction
21.2 Multicast Addresses
21.3 Multicast Versus Broadcasting on a LAN
21.4 Multicasting on a WAN
21.5 Source-Specific Multicast
21.6 Multicast socket options
21.7 mcast_join and Related Functions
21.8 dg_cli Function using multicasting
21.9 Receiving IP Multicast Infrastructure Session Announcements
21.10 Sending and Receiving
21.11 Simple Network Time Protocol
22. Advanced UDP Sockets
22.1 Introduction
22.2 Receiving Flags, Destination IP address and Interface Index
22.3 Datagram Truncation
22.4 When to USe UDP instead of TCP
22.5 Adding Reliability to a UDP Application
22.6 Binding Interface Addresses
22.7 Concurrent UDP Servers
22.8 IPv6 packet Information
22.9 IPv6 Path MTU Control
22.10 Summary
23. Advanced SCTP Sockets
23.1 Introduction
23.2 An Autoclosing One-to-Many-style Server
23.3 Partial Delivery
23.4 Notifications
23.5 Unordered Data
23.6 Binding a Subset of Addresses
23.7 Determining Peer and Local Address Information
23.8 Finding an Association ID given an IP Address
23.9 Heart Beating and Address Failure
23.10 Peeling off an Association
23.11 Controlling Timing
23.12 When to Use SCTP Instead of TCP
23.13 Summary
24.Out-of-Band Data
24.1 Out-of-Band Data
24.2 TCP Out-of-Band Data
24.3 Sockat:mark Function
24.4 TCP out-of-Band Data Recap
25. Signal_driven I/O
25.1 Introduction
25.2 Signal-Driven I/O for Sockets
25.3 UDP Echo Server Using SIGIO
25.4 Summary
26. Threads
26.1 Introduction
26.2 Basic Thread Functions: Creation and Termination
26.3 str_cli Function Using Threads
26.4 TCP Echo Server Using Threads
26.5 Thread-Specific Data
26.6 Web Client and Simultaneous Connections
26.7 Mutexes : Mutual Exclusion
26.8 Condition Variables
26.9 Web Client and Simultaneous Connections
26.10 Summary
27. IP Options
27.1 Introduction
27.2 IPv4 Options
27.3 IPv4 Source Route Options
27.4 IPv6 Extension Headers
27.5 IPv6 Hip-by-Hop Options and Destination Options
27.6 IPv6 Routing Header
27.7 IPv6 Sticky Options
27.8 HIstorical IPv6 Advanced API
27.9 Summary
28. Raw Sockets
28.1 Introduction
28.2 Raw Socket Creation
28.3 Raw Socket Output
28.4 Raw Socket Input
28.5 Ping Program
28.6 Traceroute Program
28.7 An ICMP Message Daemon
28.8 Summary
29. Datalink Access
29.1 Introduction
29.2 BSD Packet Filter (BDF)
29.3 Datalink Provider Interface (DLP)
29.4 Linux: SOCK_POCKET and PF_PACKET
29.5 Linux:SOCK_PACKET and PF_PACKET
29.6 libnet: Packet Creation and Injection Library
29.7 Examining the UDP Checksum Field
29.8 Summary
30. Client/Server Design Alternatives
30.1 Introduction
30.2 TCP Client Alternatives
30.3 TCP test Client
30.4 TCP Iterative Server
30.5 TCP Concurrent Server, One child per Client
30.6 TCP Preforked Server, No lOcking Around Accept
30.7 TCP Preforked Server, File Locking Around accept
30.8 TCP Preforked Server, Thread Locking Around accept
30.9 TCP Preforked Server, Descriptor Passing
30.10 TCP Concurrent Server, One Third per Client
30.11 TCP prethreaded Server, per-thread Accept
30.12 TCP Prethreaded Server, Main Thread Accept
30.13 Summary
31. STREAMS
31.1 Introduction
31.2 Overview
31.3 getmsg and putmsg Functions
31.4 getpsmg and putpsmg Functions
31.5 ioctl Function
31.6 Transport Provider Interface (TPI)
31.7 Summary
Appendix A. IPV4, IPv6, ICMPv4 , and ICMPv6
A.1 Introduction
A.2 IPv4 Header
A.3 IPv6 Header
A.4 IPv4 Addresses
A.5 IPv6 Addresses
A.6 Internet Control Message Protocols (ICMPv4 and ICMPv6)
Appendix .B Virtual Networks
B.1 Introduction
B.2 The MBone
B.3 The 6 Bone
B.4 IPv6 Transition :6 to 4
Appendix C, Debugging Techniques
C.1 System Call Tracing
C.2 Standard Internet Services
C.3 sock Program
C.4 Small Test Programs
C.5 tcddump Program
Appendix D. Miscellaneous Source code
D.1 unp.h Header
D.2 Config. h Header
D.3 Standard Error Functions
Appendix E. Solutions to Selected Exercises
Bibliography
Index
ISBN: 81-297-0710-1
Unix Network Programming
MSSS
Bill Fenner
BITS Pilani
Andrew M.Rudoff
W.Richard Stevens
become moderator
see all followers
Attachments
see all
BITS Pilani Question Paper IInd Semster 2008-09
BITS Pilani Question Paper 2009-10 Regular-2
BITS Pilani Question Paper
BITS Pilani Question Paper MID 2008-09 EC -1 Regular
BITS Pilani Question Paper Ist Semster 2008-09
Your Ad Here