TCP/IP详解 卷3:T/TCP、HTTP、NNTP及UNIX域协议(英文版)

当前位置:首页 > 网络编程 > 网络与通信 > TCP/IP详解 卷3:T/TCP、HTTP、NNTP及UNIX域协议(英文版)

出版社:人民邮电出版社
出版日期:201003
ISBN:9787115222541
作者:W.Richard Stevens
页数:348页

章节摘录

插图:This is the simplest form of UDP client-server application. A common real-worldexample is the Domain Name System (DNS). A DNS client (called a resolver) is nor-mally part of a client application (say, a Telnet client, an FTP client, or a WWWbrowser). The resolver sends a single UDP datagram to a DNS server requesting the IPaddress associated with a domain name. The reply is normally a single UDP datagramfrom the server.If we watch the packets that are exchanged when our client sends the server arequest, we have the time line shown in Figure 1.4. Time increases down the page. Theserver is started first, shown on the right side of the diagram, and the client is startedsometime later.We distinguish between the function call performed by the client and server, andthe action performed by the corresponding kernel. We use two closey spaced arrows,as in the two calls to socket, to show that the kernel performs the requested action andreturns immediately. In the call to sendo, although the kernel returns immediately tothe calling process, a UDP datagram is sent. For simplicity we assume that the sizes ofthe resulting IP datagrams generated by the client's request and the server's reply areboth less than the network's MTU (maximum transmission unit), avoiding fragmenta-tion of the IP datagram.In this figure we also show that the two calls to reevfrora put the process to sleepuntil a datagram arrives. We denote the kernel routines as s 1 eep and wakeup.Finally, we show the times associated with the transaction. On the left side of Fig-ure 1.4 we show the transaction time as measured by the client: the time to send arequest to the server and receive a reply. The values that comprise this transaction timeare shown on the right side of the figure: RTT + SPT, where RTT is the network und-trip time, and SPT is the server processing time for the request. The transaction time forthe UDP client-server, RTT + SPT, is the minimum possible.

前言

本书是《TCP/IP详解》系列书的自然延续:[Stevens, 1994],本书中称为卷1(Volume 1);[Wright and Stevens, 1995],本书中称为卷2(Volume 2)。本书可以分为三部分,每一部分包含一个不同的主题。 (1) TCP事务协议,一般简称T/TCP。这是TCP的扩展,用来使客户-服务器事务更快、更有效,同时也更加可靠。这是通过省略连接开始时的三次握手并缩短连接结束时的TIME_WAIT状态来实现的。我们将看到,对于客户-服务器事务,T/TCP可以达到UDP的性能,而T/TCP还提供了可靠性和适应性,这是与UDP相比的重要改进。事务可以定义为客户向服务器提出的请求以及服务器相应的应答。(术语“事务”指的不是包含加锁、两段提交和回退过程的数据库事务。) (2) TCP/IP应用具体是指HTTP(超文本传送协议,万维网的基础)和NNTP(网络新闻传送协议,Usenet新闻系统的基础)。 (3) Unix域协议。所有的Unix TCP/IP实现都提供这些协议,许多非Unix实现也提供这些协议。它们提供了一种进程间通信(IPC)的形式,并使用与TCP/IP一样的套接字接口。当客户和服务器在同一台主机上时,Unix域协议的速度一般是TCP/IP的两倍。 第一部分(T/TCP的描述)分为两块内容。第1章至第4章对这一协议进行了描述,并提供大量的示例说明其工作原理。卷1的24.7节曾对T/TCP进行了简单描述,本书的这部分内容对其进行了大幅扩展。第二块是第5章至第12章,描述的是4.4BSD-Lite网络代码(即卷2给出的代码)中T/TCP的实际实现。由于第一个T/TCP实现直到1994年9月才发布,而此时卷1已经出版一年,卷2也基本完成,因此T/TCP的示例和实现细节只能在本套书的这一卷中进行详细描述。 第二部分(HTTP和NNTP应用)是卷1的第25章至第30章介绍的TCP/IP应用的延续。在卷1出版后两年的时间里,HTTP技术随着因特网的兴起迅速流行开来,NNTP技术的使用在十几年时间中每年增长75%左右。由于常见的TCP使用方式是在数据交换极少的短连接里(连接的建立和销毁操作占用大部分时间),因此HTTP还是T/TCP的理想候补技术。在繁忙的Web服务器上由数以千计不同类型的客户大量使用HTTP(进而大量使用TCP)使我们可以检测服务器上的实际分组(第14章),并更好地理解卷1和卷2中描述的很多TCP/IP特性。 第三部分的Unix域协议本来是计划安排在卷2中的,但是由于卷2的篇幅已达到1200页,所以删掉了。在题为《TCP/IP详解》的一套书中讲述非TCP/IP协议看上去有点奇怪,但是Unix域协议早在将近15年前的4.2BSD版本中就首次实现了,与BSD TCP/IP的首次实现时间差不多。Berkeley衍生内核中大量使用了Unix域协议,但通常都是“在掩护下”使用的,大多数用户感觉不到它们的存在。除了作为Berkeley衍生内核中Unix管道的基础技术外,Unix域协议还大量用于客户和服务器在同一台主机(常见的工作站)上的XWindow 系统。Unix域套接字技术用于在进程之间传递描述符,这是一种用于进程间通信的强大技术。由于Unix域协议中套接字API(应用程序接口)与TCP/IP中的套接字API几乎相同,因此只需要改动很少的代码,Unix域协议就可以轻松地提高应用程序的性能。以上三部分内容可以独立阅读。

媒体关注与评论

“本书绝对是将科学的思考与分析应用于技术问题的典范……它代表了顶级的技术写作和思考水准。”   ——Marcus J.Ranum,防火墙架构师 “很有价值的第3卷,延续了本系列叙述清晰、技术准确的极高标准。这一卷详细地讨论了T/TCP和HTTP协议。”   ——Vern Paxson, 劳伦斯伯克利国家实验室网络研究小组 “你若想深入了解Web服务器的行为,本书关于HTTP协议的描述对你具有不可估量的价值。”   ——Jeffrey Mogul,DEC公司 “第3卷是本系列书的自然延伸。它深入阐述了Web服务和T/TCP的网络特性。”   ——Pete Haverlock, IBM公司项目经理 “在这最新一卷里,Richard Stevens保持了他在前两卷里设定的高标准,即精准到位地清晰阐释每一处细节。”   ——Andras Olah,荷兰屯特大学 “本卷保持了前两卷的超高质量,对于新方向上的网络实现展开了深入研究。整个系列对于想认真了解今日因特网原理的读者来说,不可或缺。”   ——Ian Lance Taylor,GNU/Taylor UUCP的发明人

内容概要

W. Richard Stevens 国际知名的UNIX和网络专家,备受赞誉的技术作家。他1951年2月5日出生于赞比亚,后随父母回到美国。中学时就读于弗吉尼亚菲什伯恩军事学校,1973年获得密歇根大学航空和航天工程学士学位。1975年至1982年,他在亚利桑那州图森市的基特峰国家天文台从事计算机编程工作,业余时间喜爱飞行运动,做过兼职飞行教练。这期间他分别在1978年和1982年获得亚利桑那大学系统工程硕士和博士学位。此后他去康涅狄格州纽黑文的健康系统国际公司任主管计算机服务的副总裁。1990年他回到图森,从事专业技术写作和咨询工作。写下了多种经典的传世之作,包括《TCP/IP详解》(三卷)、《UNIX环境高级编程》和《UNIX网络编程》(两卷)。Stevens于1999年9月1日去世,年仅48岁。2000年他被国际权威机构USENIX追授“终身成就奖”。

书籍目录

Preface xvPart 1. TCP for Transactions 1Chapter 1. TFFCP Introduction 31.1 Introduction 31.2 UDP Client-Server 31.3 TCP Client-Server 91.4 T/TCP Client-Server 171.5 Test Network 201.6 Timing Example 211.7 Applications 221.8 History 241.9 Implementations 261.10 Summary 28Chapter 2. T/TCP Protocol 292.1 Introduction 292.2 New TCP Options for T/TCP 302.3 T/TCP Implementation Variables 332.4 State Transition Diagram 342.5 T/TCP Extended States 362.6 Summary 38Chapter 3. T/TOP Examples 393.1 Introduction 393.2 Client Reboot 403.3 Normal T/TCP Transaction 423.4 Server Receives Old Duplicate SYN 433.5 Server Reboot 443.6 Request or Reply Exceeds MSS 453.7 Backward Compatibility 493.8 Summary 51Chapter 4. T/TCP Protocol (Continued) 534.1 Introduction 534.2 Client Port Numbers and TIME WAIT State 534.3 Purpose of the TIME,,,WAIT State 564.4 TIME WAIT State Truncation 594.5 Avoiding the Three-Way Handshake with TAO 624.6 Summary 68Chapter 5. T/TCP Implementation: Socket Layer 695.1 Introduction 695.2 Constants 705.3 sosend Function 705.4 Summary 72Chapter 6.T/TOP Implementation: Routing Table 736.1 Introduction 736.2 Code Introduction 746.3 radix node head Structure 756.4 r t ent ry Structure 756.5 rt metrics Structure 766.6 in inithead Function 766.7 in addroute Function 776.8 in matroute Function 786.9 in clsroute Function 786.10 in. r tqt imo Function 796.11 in. rtqkil i Function 826.12 Summary 85Chapter 7. T/TCP Implementation: Protocol Control Blocks 877.1 Introduction 877.2 in_pcbladdr Function 887.3 in pcbconnect Function 897.4 Summary 90Chapter 8. T/TCP Implementation: TCP Overview 918.1 Introduction 918.2 Code Introduction 918.3 TCP protosw Structure 928.4 TCP Control Block 938.5 tcp init Function 948.6 tcp s lowt imo Function 948.7 Summary 95Chapter 9. T/TCP Implementation: TCP Output 979.1 Introduction 979.2 tcp output Function 979.3 Summary 104Chapter 10. T/TCP Implementation: TOP Functions 10510.1 Introduction 10510.2 tcp newtcpcb Function 10510.3 tcp rt lookup Function 10610.4 tcp gettaocache Function 10810.5 Retransmission Timeout Calculations 10810.6 tcp close Function 11210.7 tcp_ms s s end Function 11310.8 tcp ms s rcvd Function 11410.9 tcp dooptions Function 12110.10 tcp reass Function 12210.11 Summary 124Chapter 11.T/TCP Implementation: TCP Input 12511.1 Introduction 12511.2 Preliminary Processing 12511.3 Header Prediction 12911.4 Initiation of Passive Open 13011.5 Initiation of Active Open 13411.6 PAWS: Protection Against Wrapped Sequence Numbers 14111.7 ACK Processing 14211.8 Completion of Passive Opens and Simultaneous Opens 14211.9 ACK Processing (Continued) 14311.10 Summary 147Chapter 12. T/TCP Implementation: TOP User Requests 14912.1 Introduction 14912.2 PRU CONNECT Request 14912.3 tcp connect Function 15012.4 PRU SEND and PRU SEND EOF Requests 15412.5 tcp_usrclosed Function 15512.6 tcp sysctl Function 15512.7 T/TCP Futures 15612.8 Summary 158Part 2. Additional TCP Applications 159Chapter 13, HTTP: Hypertext Transfer Protocol 16113.1 Introduction 16113.2 Introduction to HTTP and HTML 16213.3 HTTP Protocol 16513.4 An Example 17013.5 HTTP Statistics 17213.6 Performance Problems 17313.7 Summary 175Chapter 14. Packets Found on an HTTP Server 17714.1 Introduction 17714.2 Multiple HTTP Servers 18014.3 Client SYN Interarrival Time 18114.4 RTT Measurements 18514.5 1isten Backlog Queue 18714.6 Client SYN Options 19214.7 Client SYN Retransmissions 19514.8 Domain Names 19614.9 Timing Out Persist Probes 19614.10 Simulation of T/TCP Routing Table Size 20014.11 Mbuf Interaction 20214.12 TCP PCB Cache and Header Prediction 20314.13 Summary 205Chapter 15. NNTP: Network News Transfer Protocol 20715.1 Introduction 20715.2 NNTP Protocol 20915.3 A Simple News Client 21215.4 A More Sophisticated News Client 21415.5 NNTP Statistics 21515.6 Summary 216Part 3. The Unix Domain Protocols 219Chapter 16. Unix Domain Protocols: Introduction 22116.1 Introduction 22116.2 Usage 22216.3 Performance 22316.4 Coding Examples 22416.5 Summary 225Chapter 17. Unix Domain Protocols: Implementation 22717.1 Introduction 22717.2 Code Introduction 22717.3 Unix domain and protosw Structures 22817.4 Unix Domain Socket Address Structures 23017.5 Unix Domain Protocol Control Blocks 23117.6 uipc .usrreq Function 23317.7 PRU ATTACH Request and unp attach Function 23317.8 PRU DETACH Request and unp detach Function 23617.9 PRU_BIN# Request and unp_bind Function 23717.10 PRU_CONNECT Request and unp connect Function 24017.11 PRU_CONNECT2 Request and unp connect2 Function 24517.12 socketpair System Call 24917.13 pipe System Call 25317.14 PRU ACCEPT Request 25317.15 PRU DISCONNECT Request and unp disconnect Function 25517.16 PRU SHUTDOWN Request and unp shutdown Function 25717.17 PRU ABORT Request and unp .drop Function 25817.18 Miscellaneous Requests 25917.19 Summary 261Chapter 18. Unix Domain Protocols: I/O and Descriptor Passing 26318.1 Introduction 26318.2 PRU_SEND and PRU RCVD Requests 26318.3 Descriptor Passing 26918.4 unp internalize Function 27418.5 unp external i ze Function 27618.6 unp_discard Function 27718.7 unp dispose Function 27818.8 unp scan Function 27818.9 unp. gc Function 28018.10 unp mark Function 28818.11 Performance (Revisited) 28818.12 Summary 289Appendix A. Measuring Network Times 291A.1 RTT Measurements Using Ping 292A.2 Protocol Stack Measurements 294A.3 Latency and Bandwidth 300Appendix B. Coding Applications for T/'I'CP 303Bibliography309Index 315

编辑推荐

《TCP/IP 详解 卷3:T/TCP、HTTP、NNTP和UNIX域协议(英文版)》是已故网络专家、著名技术作家W. Richard Stevens的传世之作,内容详尽且具权威性,被誉为TCP/IP领域的不朽名著。《TCP/IP 详解 卷3:T/TCP、HTTP、NNTP和UNIX域协议(英文版)》是《TCP/IP详解》三卷本的第3卷,主要讲述高级协议,覆盖当今TCP/IP编程人员和网络管理员必须熟练掌握的T/TCP(TCP事务协议)、HTTP(超文本传送协议)、NNTP(网络新闻传送协议)和Unix域协议。与前面两卷一样,《TCP/IP 详解 卷3:T/TCP、HTTP、NNTP和UNIX域协议(英文版)》有丰富的例子和实现的细节。这一卷的前两部分内容要求读者对TCP/IP协议的工作原理有基本的了解。对TCP/IP协议不是很熟悉的读者先应阅读《TCP/IP详解》的第1卷,该书对TCP/IP协议族有比较透彻的讲述。除第1章至第4章可以独立于《TCP/IP详解》的第2卷阅读外,其余各章要求读者对第2卷中提供的4.4BSD-Lite网络代码比较熟悉。《TCP/IP详解》对于网络应用的开发人员、网络管理员以及任何想了解TCP/IP协议运行原理的人员来说,都是极好的权威参考书。无论是初学者还是功底深厚的网络领域高手,这套书都应是案头必备。

作者简介

《TCP/IP 详解 卷3:T/TCP、HTTP、NNTP和UNIX域协议(英文版)》是TCP/IP领域的经典之作!书中重点讲述高级协议,覆盖了当今TCP/IP编程人员和网络管理员必须熟练掌握的T/TCP(TCP事务协议)、HTTP(超文本传送协议)、NNTP(网络新闻传送协议)和Unix域协议。与前面两卷一样,《TCP/IP 详解 卷3:T/TCP、HTTP、NNTP和UNIX域协议(英文版)》有丰富的例子和实现的细节。
《TCP/IP 详解 卷3:T/TCP、HTTP、NNTP和UNIX域协议(英文版)》适合希望了解TCP/IP协议如何实现的读者阅读,是TCP/IP领域研究人员和开发人员的权威参考书。

图书封面


 TCP/IP详解 卷3:T/TCP、HTTP、NNTP及UNIX域协议(英文版)下载



发布书评

 
 


精彩短评 (总计4条)

  •     中文的什么时候出来阿。
  •     比我想像好的多, 只不过不少地方都改成中文的了, 出版社很贱(个人想法).
  •     这是一本经典的书。。。。。。。。
  •     很不错,值得认真拜读。
 

外国儿童文学,篆刻,百科,生物科学,科普,初中通用,育儿亲子,美容护肤PDF图书下载,。 零度图书网 

零度图书网 @ 2024