📄 Page
1
(This page has no text content)
📄 Page
2
ACRONYMS ACK acknowledgment flag; TCP header ANSI American National Standards Institute API application program interface ARP Address Resolution Protocol ARPANET Advanced Research Projects Agency network ASCil American Standard Code for Information Interchange BPF BSD Packet Filter BSD Berkeley Software Distnbution cc connection count; T / TCP ., cma: Computer Emergency Response Team CR carriage return OF don' t fragment flag; IP header DNS Domain Name System EOL end of option list FAQ frequently asked question FIN finish flag; TCP header FTP File Transfer Protocol GIF graphics interchange format HTML Hypertext Markup Language HITP Hypertext Transfer Protocol ICMP Internet Control Message Protocol IEEE Institute of Electrical and Electronics Engineers INN InterNet News INND InterNet News Daemon IP Internet Protocol IPC interprocess communication IRTP Internet Reliable Transaction Protocol ISN initial sequence number ISO International Organization for Standardization ISS initial send sequence number LAN local area network LP linefeed MIME multipurpose Internet mail extensions MSL maximum. segment lifetime MSS maximum segment size MTU maximum transmission unit
📄 Page
3
NCSA NFS NNRP NNTP NOAO NOP OSF OSI PAWS PCB POSIX PPP PSH RDP RFC RPC RST RTO RTI SLIP SMTP SP'T SVR4 SYN TAO TCP TIL Telnet UDP URG URI URL URN VMTP WAN WWW ACRONYMS National Center for Supercomputing Applications Network File System Network News Reading Protocol Network News Transfer Protocol National Optical Astronomy Observatories no operation Open Software Foundation open systems interconnection protection against wrapped sequence numbers protocol control block Portable Operating System Interface Point-to-Point Protocol push flag; TCP header Reliable Datagram Protocol Request for Comment remote procedure call reset flag; TCP header retransmission time out round-trip time Serial Line Internet Protocol Simple Mail Transfer Protocol server processing ti.me System V Release 4 synchronize sequence numbers flag; TCP header TCP accelerated open Transmission Control Protocol time-to-live remote terminal protocol User Datagram Protocol urgent pointer flag; TCP header uniform resource identifier uniform resource locator uniform resource name Versatile Message Transaction Protocol wide area network World Wide Web
📄 Page
4
Praise for TCP/IP Illustrated, Volume 3: TCP for Transactions, HTTP, NNTP, and the UNIX® Domain Protocols "An absolutely wonderful example of how to apply scientific thinking and analysis to a technological problem ... it is the highest caliber of technical writing and thinking." - Marcus J. Ranum, Firewall Architect "A worthy successor that continues the series' standards of excellence for both clarity and accuracy. The coverage of TITCP and HITP is particularly timely, given the explosion of tJie World Wule Web." - Vern Paxson, Network Research Group, Lawrence Berkeley National Laboratory "The coverage of tJie HTTP protocol will be invaluable to anyone who needs to understand the detailed behavior of web servers. " - Jeffrey Mogul, Digital Equipment Corporation "Volume 3 is a natural addition to the series. It covers the network aspects of Web services and transaction TCP in depth. " - Pete Haverlock, Program Manager, IBM "In this latest volume of TCP/IP illustrated, Rich Stevens maintains the high standards he set up in the previous volumes: clear presentation and tech nical accuracy to the finest detail. " - Andras Olah, University of Twente "This volume maintains the superb quality of the earlier ones in the series, extending the in-depth examination of networking implementation in new directions. The entire series is a must for anybody who is seriously interested in how the Internet works today. " - Ian Lance Taylor, Author of GNU/faylor UUCP I J
📄 Page
5
Addison-Wesley Professional Computing Series Brian W. Kernighan, Consulting Editor Matthew H. Austem, Generic Programming and the STL: Using and Extending the C++ Standard Template Ubrary David R. Butenhof, Programming with POSTX- Threads Brent Callaghan, NFS illustrated Tom Cargill, C++ Programming Style William R. Cheswick/Steven M Bellovin/ Avie! D. Rubin, Firewalls and Internet Security, Second Edition: Repelling the Wily Hacker David A. Curry, I..INixe System Security: A Guide far Users and System Administrators Stephen C. Dewhurst, C++ Gotchas: Aooiding Common Problems in Coding and Design Erich Gamma/Richard Helm/Ralph Johnson/John Vlissides, Design Patterns: Elements of Reusal1le Ol1je&t-Oriented Software Erich Gamma/Richard Helm/Ralph Johnson/John Vlissides, Design Patterns CD: Elements of Reusable Object-Oriented Software Peter Haggar, Practical Java'" Programming Language Guide David R. Hanson, C Interfaces and Implementations: Technilfues far Creating Reusable Software . ,.. Mark Harrison/Michael McLennan, Effective Tcl/Tk Programming: Writing Better Programs with Tel and Tic Michl Henning/Steve Vmoski, Advanced CORBA• Programming with C++ Brian W. Kernighan/Rob Pike, The Practice of Programming S. Keshav, An Engineering Approach to Computer Networking: ATM Networks, the Internet, and the Telephone Network John Lakos, Large-Scale C++ Software Design Scott Meyers, Effective C++ CD: 85 Specific Ways to Improve Your Programs and Designs Scott Meyers, Effective C++, Second Edition: 50 Specific Ways to Improve Your Programs and Designs Scott Meyers, More Effective C++: 35 New Ways to Improve Your Programs and Designs Scott Meyers, Effective STL: 50 Specific Ways to Improve Your Use of the Standard Templau Ubrary Robert B. Murray, C++ Strategies and Tactics Di\vid R. Musser /Gillmer J. Oerge/ Atul Saini, STL Tutorial and Reference Guide, 5fflmd Editwn: C++ Programming with the Standard Template Library John K. Ousterhout, Tel and the Tic Toolkit Craig Partridge, Gigabit Networking Radia Perlman, Interconnections, Second Edition: Bridges, Routers, Switches, and lnternetworking Protocols Stephen A Rago, UNIX- System V Network Programming . Curt Schimmel, l.1Nix- Systems far Modmi Architectures: Symmetric MulJiprocessing and Caching far Kernel Programmers W. Richard Stevens, Advanced Programming in the UNIX- Environment W. Richard Stevens, TCP/IP ntustrated, Volume 1: fhe Protocols W. Richard Stevens, TCP/IP nlustrated, Volume 3: TCP far 1ransactions, HTTP, NNTP, and the UNIX- Domain Protocols W. Richard Stevens/Gary R Wright, TCP/IP Illustrated Volumes 1-3 Boxed Set John Vt.ega/Gary McGraw, Building Secure Software: How to Aooid Security Problems the Righi Way Gary R. Wright/W. Richard Stevens, TCP/IP Illustrated, Volume 2: The Implementation Rwxi Yuan/ W. Tunothy Strayer, Virtual Private Networks: Technologies and Solutions Please see our web site (http:/ /www.awprofessiona.Lcom/series/profesmonalcomputing) for more information about these titles.
📄 Page
6
- TCPnP Illustrated, Volume 3
📄 Page
7
TCP/IP Illustrated, Volume 3 TCP for Transactions, HTTP, NNTP, and the UNIX• Domain Protocols W. Richard Stevens .. .... ADDISON-WESLEY Boston • San Francisco • New York • Toronto • Montreal London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City
📄 Page
8
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book. and Addison-Wesley was aware of a trademark claim. the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is asswned for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers discounts on this book wb.en ordered in quantity for bulk purchases and special sales. For more information. please contact: U.S. Corporate and Government Sales (800) 382-3419 corpsaJes@pearsontechgroup.com Visit Addison-Wesley on the Web: www.awprofessionaJ.com Library of Congress Cataloging-in-Publication Data Stevens, W. Richard TCP/IP Dlustrated: the protocols/ W. Richard Stevens p. cm.-(Addison-Wesley professional computing series) Includes bibliographical references and index. ISBN 0-201-63495-3 (alk. paper) 1. TCP/IP(Computer network protocol) I. Title. ll. Series. TK5105.55S741994 004.6'2-dc20 Volume 1: The Protocols 0-201-63346-9 Volume 2: The Implementation 0-201-63354-X , Volume 3: TCP for Transactions. HTTP, NNTP, and the UNIX Domain Protocols 0-201-63495-3 The BSD Daemon used on the cover of this book is reproduced with the permission of Marshall KirkMcKusick. Copyright O 1996 by Addison-Wesley All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher. Printed in the United States of America. Published simultaneously in Canada. ISBN 0-321-63495-3 Text printed on recycled paper 13 14 15 1617 18-MA-0706050403 Thirteenth printing, March 2003
📄 Page
9
To my many mentors over the past years, from whom I have learned so much, especially Jim Brault, Dave Hanson, Bob Hunt, and Brian Kernighan.
📄 Page
10
Contents Preface Part 1. TCP for Transactions Chapter 1. T/TCP Introduction 1.1 Introduction 3 1.2 UDP Client-Server 3 1.3 TCP Client-Server 9 1.4 T /TCP Client-Server 17 1.5 Test Network 20 1.6 Timing Example 21 1. 7 Applications 22 1.8 History 24 1.9 Implementations 26 1.1 O Summary 28 Chapter 2. T/TCP Protocol 2.1 Introduction 29 2.2 New TCP Options for T/TCP 30 2.3 T/TCP Implementation Variables 33 2.4 State Transition Diagram 34 2.5 T/TCP Extended States 36 2.6 Summary 38
📄 Page
11
x TCP / IP illustrated Chapter 3. T/TCP Examples 3.1 Introduction 39 3.2 Client Reboot 40 3.3 Normal T/TCP Transaction 42 3.4 Server Receives. Old Duplicate SYN 43 3.5 Server Reboot 44 3.6 Request or Reply Exceeds MSS 45 3. 7 Backward Compatibility 49 3.8 Summary 51 Chapter 4. 4.1 4.2 4.3 4.4 4.5 4.6 Chapter 5. 5.1 5.2 5.3 5.4 Chapter 6. T/TCP Protocol (Continued) Introduction 53 Client Port Numbers and TIME_WAIT State Purpose of the TIME_WAIT State 56 TIME_WAIT State Truncation 59 Avoiding the Three-Way Handshake with TAO Summary 68 T/TCP Implementation: Socket Layer Introduction 69 Constants 70 sosend Function 70 Summary 72 T/TCP Implementation: Routing Table 6.1 Introduction 73 6.2 Code Introduction 74 6 .3 radix_Jlode_head Structure 75 6.4 rtentry Structure 75 6.5 rt_metrics Structure 76 6.6 in_ ini thead Function 76 6.7 in._addroute Function n 6.8 i.n.Jnati:oute Function 78 6.9 in_clsroute Function 78 6.10 in_rtqtimo Function 79 6.11 in_rtqkill Function ~2 6.12 Summary 85 53 62 Chapter 7. 7.1 7.2 7.3 7.4 T/TCP Implementation: Protocol Control Blocks Introduction 87 in_pcbladdr Function in_pcbconnect Function Summary 90 88 89 Chapter 8. T/TCP Implementation: TCP Overview 8.1 Introduction 91 8.2 Code Introduction 91 Contents 39 53 69 73 87 91
📄 Page
12
ICP /IP fflustrated Contents 8.3 TCP protosw Structure 92 8.4 TCP Control Block 93 8.5 tcp_init Function 94 8.6 tcp_slowtimo Function 94 8.7 Summary 95 Chapter 9. TfrCP Implementation: TCP Output 9.1 Introduction 97 9.2 tcp_output Function 97 9.3 Summary 104 Chapter 10. TfrCP Implementation: TCP Functions 10.1 Introduction 105 10.2 tcp..J1.ewtcpcb Function 105 10.3 tcp_rtlookup Function 106 10.4 tcp_gettaocache Function 108 10.5 Retransmission Timeout Calculations 108 10.6 tcp_close Function 112 10.7 tcp_msssend Function 113 10.8 tep...mssrcvd Function 114 10.9 tep_dooptions Function 121 10.10 tcp_reass• Function 122 10.11 Summary 124 Chapter 11. TfrCP Implementation: TCP Input 11 .1 Introduction 125 11 .2 Preliminary Processing 125 11.3 Header Prediction 129 11 .4 Initiation of Passive Open 130 11 .5 Initiation of Active Open 134 11 .6 PAWS: Protection Against Wrapped Sequence Numbers 141 11 .7 ACK Processing 142 11 .8 Completion of Passive Opens and Simultaneous Opens 142 11 .9 ACK Processing (Continued) 143 11.10 FIN Processing 145 11.11 Summary 147 ... Chapter 12. TfrCP Implementation: TCP User Requests 12.1 Introduction 149 12.2 PRU_CONNECT Request 149 12.3 tcp_connect Function 150 12.4 PRU_ SEND and PRU_ SEND_ EOF Requests 154 12.5 tcp_usrclosed Function 155 12.6 tcp_sysctl Function 155 12.7 T/TCP Futures 156 12.8 Summary 158
📄 Page
13
xii TCP / IP lliustrated Part 2. Additional TCP Applications Chapter 13. HTTP: Hypertext Transfer Protocol 13.1 13.2 13.3 13.4 13.5 13.6 13.7 Chapter 14. 14.1 14.2 14.3 14.4 14.5 14.6 14.7 14.8 14.9 14.10 14.11 14.12 14.13 Introduction 161 Introduction to HTTP and HTML 162 HTTP Protocol 165 An Example 170 HTTP Statistics 172 Performance Problems 173 Summary 175 Packets Found on an HTTP Server Introduction 1TT Multiple HTTP Servers 180 Client SYN lnterarrival Time 181 RTT Measurements 185 listen Backlog Queue 187 Client SYN Options 192 Client SYN Retransmissions 195 Domain Names 196 Timing Out Persist Probes 196 Simulation of T!TCP Routing Table Size Mbuf Interaction 202 TCP PCB Cache and Header Prediction Summary 205 200 203 Chapter 15. NNTP: Network News Transfer Protocol 15.1 Introduction 207 15.2 NNTP Protocol 209 15.3 A Simple News Client 212 15.4 A More Sophisticated News Client 214 15.5 NNTP Statistics 215 15.6 Summary 216 Part 3. The Unix Domain Protocols Chapter 16. Unix Domain Protocols: Introduction 16.1 Introduction 221 16.2 Usage 222 16.3 Performance 223 16.4 Coding Examples 224 16.5 Summary 225 Contents 159 161 207 219 221
📄 Page
14
.. -r:a/lP filustrated Contents • Chapter 17. Unix Domain Protocols: Implementation 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 17.10 17.11 17.12 17.13 17.14 17.15 17.16 17.17 17.18 17.19 Introduction 227 Code Introduction 227 Unix domain and protosw Structures Unix Domain Socket Address Structures Unix Domain Protocol Control Blocks uipc_usrreq Function 233 228 230 231 PRU_ATTACH Request and unp_attach Function PRO_DETACH Request and unp_detach Function PRU_BIND Request and unp_bind Function 237 233 236 PRU_CONNECT Request and unp_connect Function PRU_CONNECT2 Request and unp_conneot2 Function 240 245 socketpair System Call 249 pipe System Call 253 PRU_ACCEPT Request 253 PRU_DISCONNECT Request and unp_disconnect Function PRU_SHUTDOWN Request and unp_shutdown Function 257 PRU_ABORT Request and unp_drop Function 258 Miscellaneous Requests 259 Summary 261 Chapter 18. Unix Domain Protocols: 1/0 and Descriptor Passing 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 18.9 18.10 18.11 18.12 Introduction 263 PRO_SEND and PRU_ RCVD Reoiuests Descriptor Passing 269 unp_internalize Function 274 unp_externalize Function 276 unp_discard Function 2TT unp_dispose Function 278 unp_scan Function 278 unp_gc Function 280 unp_mark Function 288 Performance (Revisited) 288 Summary 289 Appendix A. Measuring Network Times A.1 A.2 A.3 RTT Measurements Using Ping 292 Protocol Stack Measurements 294 Latency and Bandwidth 300 Appendix B. Coding Applications for T /TCP Bibliography Index 263 255
📄 Page
15
Preface Introduction and Organization of the Book This book is a logical continuation of the TCP/IP Illustrated series: [Stevens 1994], which we refer to as Volume 1, and [Wright and Stevens 19951 which we refer to as Volume 2. This book is divided into three parts, each covering a different topic: 1. TCP for transactions, commonly called T/TCP. This is an extension to TCP designed to make client-server transactions faster, more efficient, and reliable. This is done by <?mitting TCP's three-way handshake at the beginning of a con nection and shortening the TIME_WAIT state at the end of a connection. We'll see that T /TCP can match UDP's performance for a client-server transaction and that T / TCP provides reliability and adaptability, both major improvements over UDP. A transaction is defined to be a client request to a server, followed by the server's reply. (The term transaction does not mean a database transaction, with locking, two-phase commit, and back.out.) 2. TCP /IP applications, specifically HITP (the Hypertext Transfer Protocol, the foundation of the World Wide Web) and NNfP (the Network News Transfer Protocol, the basis for the Usenet news system). 3. The Unix domain protocols. These protocols are provided by all Unix TCP /IP implementations and on many non-Unix implementations. They provide a form of interprocess communication (IPC) and use the same sockets interface used with TCP /IP. When the client and server are on the same host, the Unix domain protocols are often twice as fast as TCP / IP. xv
📄 Page
16
xvi TCP / IP illustrated rrerau: Part 1, the presentation of T /TCP, is in two pieces. Chapters 1-4 describe the proto col and provide numerous examples of how it works. This material is a major expan sion of the brief presentation of T / TCP in Section 24.7 of Volume 1. The second piece, Chapters 5-12, describes the actual implementation of T / TCP within the 4.4BSD-Lite networking code (i.e., the code presented in Volume 2). Since the first T / TCP imple mentation was not released until September 1994, about one year after Volume 1 was published and. right as Volume 2 was being completed, the detailed presentation of T /TCP, with examples and all the implementation details, had to wait for another vol ume in the series. Part 2, the HTTP and NNTP applications, are a continuation of the TCP / IP applica tions presented in Chapters 25-30 of Volume 1. In the two years since Volume 1 was published, the popularity of HTTP has grown enormously, as the Internet has exploded, and the use of NNTP has been growing about 75% per year for more than 10 years. HTTP is also a wonderful candidate for T / TCP, given its typical use of TCP: short con nections with small amounts of data transferred, where the total ti.me is often domi nated by the connection setup and teardown. The heavy use of HTTP (and therefore TCP} on a busy Web server by thousands of different and varied clients also provides a unique opportunity to examine the actual packets at the server (Chapter 14) and look at many features of TCP / IP that were presented in Volumes 1 and 2. The Unix domain protocols in Part 3 were originally considered for Volume 2 but omitted when its size reached 1200 pages. While it may seem odd to cover protocols other than TCP /IP in a series titled TCP/IP Illustrated, the Unix domain protocols were implemented almost 15 years ago in 4.2BSD alongside the first implementation of BSD TCP / IP. They are used heavily today in any Berkeley-derived kernel, but their use is typically "under the covers," and most users are unaware of their presence. Besides being the foundation for Unix pipes on a Berkeley-derived kernel, another heavy user is the X Window System, when the client and server are on the same host (i.e., on typical workstations). Unix domain sockets are also used to pass descriptors between pro cesses, a powerful technique for interprocess communication. Since the sockets API (application program interface) used with the Unix domain protocols is nearly identical to the sockets API used with TCP /IP, the Unix domain protocols provide an easy way to enhance the performance of local applications with minimal code changes. Each of the three parts can be read by itself. Readers As with the previous two volumes in the series, this volume is intended for anyone wishing to understand how the TCP /IP protocols operate: programmers writing net work applications, system administrators responsible for maintaining computer sys tems and networks utilizing TCP /IP, and users who deal with TCP / IP applications on a daily basis. Parts 1 and 2 assume a basic understanding of how the TCP / IP protocols work. Readers unfamiliar with TCP / IP should consult the first volume in this series, [Stevens 19941 for a thorough description of the TCP /IP protocol suite. The first hall of Part I
📄 Page
17
TCP /TP Illustrated Preface xvii (Chapters 1- 4, the concepts behind T / TCP along with examples} can be read indepen dent of Volume 2, but the remainder of Part 1 (Chapters 5-12, the implementation of T / TCP) assumes familiarity with the 4.4BSD-Lite networking code, as provided with Volume 2 . Many forward and backward references are provided throughout the text, to both topics within this text, and to relevant sections of Volumes 1 and 2 for readers interested in more details. A thorough index is provided, and a list of all the acronyms used throughout the text, along with the compound term for the acronym, appears on the inside front covers. The inside back covers contain an alphabetical cross-reference of all the structures, functions, and macros described in the book and the starting page num ber of the description. This cross-reference also refers to definitions in Volume 2, when that object is referenced from the code in this volume. Source Code Copyright All the source code in this book that is taken from the 4.4BSD-Lite release contains the following copyright notice: /* * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994 .. The Regents of the University of California. All rights reserved . • Redistribution and use in source and binary forms, with or without • modification, are permitted provided that the following conditions • are met: • 1. Redistributions of source code must retain tbe above copyright • notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the • documentation and/or other materials provided with the distribution. • 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: • This product includes software developed by the University of * California, Berkeley and its contributors. • 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission . • * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND * AN'i EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BOT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE • FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BOT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS • OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) AR.ISING IN AN¥ WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */
📄 Page
18
xviii TCP /IP illustrated The routing table code in Chapter 6 contains the following copyright notice: I* * Copyright 1994, 1995 Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software and • its documentation for any purpose and without fee is hereby * granted, provided that both the above copyright notice and this • permission notice appear in all copies, that both the above • copyright notice and this permission notice appear in all * supp,orting documentation, and that the name of M.I.T. not be used * in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. M.I.T. makes • no representations about the suitability of this software for any * purpose. It is provided •as is• without express or implied "warranty. * THIS SOFTWARE IS PROVIDED BY M.I.T. ''AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING , BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCliANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPEC1'.AL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY , * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OOT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * / Preface . .. TypographlcaJ Conventions When we display interactive input and output we'll show our typed input in a bold font, and the computer output 1 i ke this. Comments are added in italics. sun I telnet www. aw. caa 80 Trying 192.207.117.2 ... Connected to aw.com. connect to the H1TP server this line and next output by Telnet client We always include the name of the system as part of the shell prompt (sun in this exam ple) to show on which host the command was run. The names of programs referred to in the text are normally capitalized (e.g., Telnet and Tcpdump) to avoid excessive font changes. Throughout the text we'll use indented, parenthetical notes such as this to describe historical points or implementation details.
📄 Page
19
ta> /JP lliustrated Preface xix Acknowledgments First and foremost I thank my family, Sally, iBill, Ellen, and David, who have endured anothec book along with all my traveling during the past year. This time, however, it really is a "small" book. I thank the technical reviewers who read the manuscript and provided important feedback on a tight timetable: Sa.mi Boulos, Alan Cox, Tony DeSimone, Pete Haverlock, Chris Heigham, Mukesh Kacker, Brian Kernighan, Art Mellor, Jeff Mogul, Marianne Mueller, Andras Olah, Craig Partridge, Vern Paxson, Keith Sklower, Ian Lance Taylor, and Gary Wright. A special thanks to the consulting editor, Brian Kernighan, for his rapid, thorough, and helpful reviews throughout the course of the book, and for his continued encouragement and support. Special thanks are also due Vern Paxson and Andras Olah for their incredibly detailed reviews of the entire manuscript, finding many errors and providing valuable technical suggestions. My thanks also to Vern Paxson for making available his software for analyzing Tcpdump traces, and to Andras Olah for his help with T /TCP over the past year. My thanks also to Bob Braden, the designer of T /TCP, who provided the ref erence source code implementa lion on which Part 1 of this book is based. Others helped in significant ways. Gary Wright and Jim Hogue provided the sys tem. on which the data for Chapter 14 was collected. Doug Schmidt provided a copy of the public domain TTCP program that uses Unix domain sockets, for the timing mea surements in Chapter 16. Craig Partridge provided a copy of the RDP source code to examine. Mike Karels answered lots of questions. My thanks once again to the National Optical Astronomy Observatories (NOAO), Sidney Wolff, Richard Wolff, and Steve Grandi, for providing access to their networks and hosts. Finally, my thanks to all the staff at Addison-Wesley, who have helped over the past years, especially my editor John Wait. As usual, camera-ready copy of the book was produced by the author, a Troff die hard, using the Groff package written by James Clark. I welcome electronic mail from any readers with comments, suggestions, or bug fixes. Tucson, Arizona November 1995 W. Richard Stevens rstevens@noao.edu http://www.noao.edu/-rstevens
📄 Page
20
, Part 7 TCP for Transactions •