编辑推荐
这是一部传世之作!网络编程专家BillFenner和AndrewM.Rudoff应邀执笔,对W.RichardStevens的经典作品进行修订。书中吸纳了近几年网络技术的发展,增添了IPv6、SCTP协议和密钥管理套接字等内容,深入讨论了新的关键标准、实现和技术。
书中的所有示例都是在UNIX系统上测试通过的真实的、可运行的代码,继承了Stevens一直强调的理念:“学习网络编程的好方法就是下载这些程序,对其进行修改和改进。只有这样实际编写代码才能深入理解有关概念和方法。”读者可以从《UNIX网络编程 卷1 套接字联网API(第3版 英文版)》网站下载这些示例的源代码。
《UNIX网络编程 卷1 套接字联网API(第3版 英文版)》为UNIX网络编程提供全面的指导,是网络研究和开发人员公认的参考书,无论网络编程的初学者还是网络专家都会大受裨益。内容简介
《UNIX网络编程 卷1 套接字联网API(第3版 英文版)》是一部UNIX网络编程的经典之作。书中全面深入地介绍了如何使用套接字API进行网络编程。《UNIX网络编程 卷1 套接字联网API(第3版 英文版)》不但介绍了基本编程内容,还涵盖了与套接字编程相关的高级主题,对于客户/服务器程序的各种设计方法也作了完整的探讨,还深入分析了流这种设备驱动机制。
《UNIX网络编程 卷1 套接字联网API(第3版 英文版)》内容详尽,几乎每章都提供精选的习题,并提供了部分习题的答案,是网络研究和开发人员理想的参考书。作者简介
W.RichardStevens(1951—1999)国际知名的UNIX和网络专家,备受赞誉的技术作家。生前著有《TCP/IP详解》(三卷)、《UNIX环境高级编程》和《UNIX网络编程》(两卷),均为不朽的经典著作。
BillFennerAT&T实验室主任研究员,专攻IP多播、网络管理和测量,他是IETF路由的领域主管之一,是RFC标准文档的批准人。
AndrewM.RudoffSun公司软件工程师,专攻网络、操作系统内核、文件系统和高可用性软件体系结构。目录
Part 1.IntroductionandTCP/IP/简介和TCP/IP 1
Chapter 1.Introduction/简介 3
1.1 Introduction/概述 3
1.2 ASimpleDaytimeClient/一个简单的时间获取客户程序 6
1.3 ProtocolIndependence/协议无关性 10
1.4 ErrorHandling:WrapperFunctions/错误处理:包装函数 11
1.5 ASimpleDaytimeServer/一个简单的时间获取服务器程序 13
1.6 RoadmaptoClient/ServerExamplesintheText/《UNIX网络编程 卷1 套接字联网API(第3版 英文版)》中客户/服务器示例的路线图 16
1.7 OSIModel/OSI模型 18
1.8 BSDNetworkingHistory/BSD网络历史 20
1.9 TestNetworksandHosts/测试用网络及主机 22
1.10 UnixStandards/Unix标准 25
1.11 64-BitArchitectures/64位体系结构 28
1.12 Summary/小结 29
Chapter 2.TheTransportLayer:TOP,UDP,andSCTP/传输层:TCP、UDP和SCTP 31
2.1 Introduction/概述 31
2.2 TheBigPicture/全景图 32
2.3 UserDatagramProtocol(UDP)/用户数据报协议 34
2.4 TransmissionControlProtocol(TCP)/传输控制协议 35
2.5 StreamControlTransmissionProtocol(SCTP)/流控制传输协议 36
2.6 TCPConnectionEstablishmentandTermination/TCP连接的建立和终止 37
2.7 TIME_WAITState/TIME_WAIT状态 43
2.8 SCTPAssociationEstablishmentandTermination/SCTP关联的建立和终止 44
2.9 PortNumbers/端口号 50
2.10 TCPPortNumbersandConcurrentServers/TCP端口号与并发服务器 52
2.11 BufferSizesandLimitations/缓冲区大小及限制 55
2.12 StandardInternetServices/标准因特网服务 61
2.13 ProtocolUsagebyCommonInternetApplications/常见因特网应用所用的协议 62
2.14 Summary/小结 63
Part 2.ElementarySockets/基本套接字 65
Chanter 3.SocketsIntroduction/套接字简介 67
3.1 Introduction/概述 67
3.2 SocketAddressStructures/套接字地址结构 67
3.3 Value-ResultArguments/值-结果参数 74
3.4 ByteOrderingFunctions/字节排序函数 77
3.5 ByteManipulationFunctions/字节操纵函数 80
3.6 inet_aton,inet_addr,andinet_ntoaFunctions/inet_aton、inet_addr和inet_ntoa函数 82
3.7 inet_ptonandinet_ntopFunctions/inet_pton和inet_ntop函数 83
3.8 sock_ntopandRelatedFunctions/sock_ntop和相关函数 86
3.9 readn,writen,andreadlineFunctions/readn、writen和readline函数 88
3.10 Summary/小结 92
Chapter 4.ElementaryTCPSockets/基本TCP套接字 95
4.1 Introduction/概述 95
4.2 socketFunction/socket函数 95
4.3 connectFunction/connect函数 99
4.4 bindFunction/bind函数 101
4.5 listenFunction/listen函数 104
4.6 acceptFunction/accept函数 109
4.7 forkandexecFunctions/fork和exec函数 111
4.8 ConcurrentServers/并发服务器 114
4.9 closeFunction/close函数 117
4.10 getsocknameandgetpeernameFunctions/getsockname和getpeername函数 117
4.11 Summary/小结 120
Chapter 5.TCPClient/ServerExample/TCP客户/服务器示例 121
5.1 Introduction/概述 121
5.2 TCPEchoServer:mainFunction/TCP回送服务器程序:main函数 122
5.3 TCPEchoServer:str_echoFunction/TCP回送服务器程序:str_echo函数 123
5.4 TCPEchoClient:mainFunction/TCP回送客户程序:main函数 124
5.5 TCPEchoClient:str_cliFunction/TCP回送客户程序:str_cli函数 125
5.6 NormalStartup/正常启动 126
5.7 NormalTermination/正常终止 128
5.8 POSIXSignalHandling/POSIX信号处理 129
5.9 HandlingSIGCHLDSignals/处理SIGCHLD信号 132
5.10 waitandwaitpidFunctions/wait和waitpid函数 135
5.11 ConnectionAbortbeforeacceptReturns/accept返回前连接异常中止 139
5.12 TerminationofServerProcess/服务器进程的终止 141
5.13 SIGPIPESignal/SIGPIPE信号 142
5.14 CrashingofServerHost/服务器主机崩溃 144
5.15 CrashingandRebootingofServerHost/服务器主机崩溃及重启 144
5.16 ShutdownofServerHost/服务器主机关机 145
5.17 SummaryofTCPExample/TCP示例小结 146
5.18 DataFormat/数据格式 147
5.19 Summary/小结 151
Chapter 6.I/OMultiplexing:TheselectandpollFunctions/I/O多路复用:select和poll函数 153
6.1 Introduction/概述 153
6.2 I/OModels/I/O模型 154
6.3 selectFunction/select函数 160
6.4 str_cliFunction(Revisited)/再访str_cli函数 167
6.5 BatchInputandBuffering/批量输入和缓冲 169
6.6 shutdownFunction/shutdown函数 172
6.7 str_cliFunction(RevisitedAgain)/三顾str_cli函数 173
6.8 TCPEchoServer(Revisited)/再访TCP回送服务器程序 175
6.9 pselectFunction/pselect函数 181
6.10 pollFunction/poll函数 182
6.11 TCPEchoServer(RevisitedAgain)/三顾TCP回送服务器程序 185
6.12 Summary/小结 188
Chapter 7.SocketOptions/套接字选项? 191
7.1 Introduction/概述 191
7.2 getsockoptandsetsockoptFunctions/getsockopt和setsockopt函数 192
7.3 CheckingifanOptionIsSupportedandObtainingtheDefault/检查选项是否被支持并获取默认值 194
7.4 SocketStates/套接字状态 198
7.5 GenericSocketOptions/通用套接字选项 198
7.6 IPv4SocketOptions/IPv4套接字选项 214
7.7 ICMPv6SocketOption/ICMPv6套接字选项 216
7.8 IPv6SocketOptions/IPv6套接字选项 216
7.9 TCPSocketOptions/TCP套接字选项 219
7.10 SCTPSocketOptions/SCTP套接字选项 222
7.11 fcntlFunction/fcntl函数 233
7.12 Summary/小结 236
Chapter 8.ElementaryUDPSockets/基本UDP套接字 239
8.1 Introduction/概述 239
8.2 recvfromandsendtoFunctions/recvfrom和sendto函数 240
8.3 UDPEchoServer:mainFunction/UDP回送服务器程序:main函数 241
8.4 UDPEchoServer:dg_echoFunction/UDP回送服务器程序:dg_echo函数 242
8.5 UDPEchoClient:mainFunction/UDP回送客户程序:main函数 244
8.6 UDPEchoClient:dg_cliFunction/UDP回送客户程序:dg_cli函数 245
8.7 LostDatagrams/数据报的丢失 245
8.8 VerifyingReceivedResponse/验证接收到的响应 246
8.9 ServerNotRunning/服务器程序未运行 248
8.10 SummaryofUDPExample/UDP示例小结 250
8.11 connectFunctionwithUDP/UDP的connect函数 252
8.12 dg_cliFunction(Revisited)/再论dg_cli函数 256
8.13 LackofFlowControlwithUDP/UDP缺乏流量控制 257
8.14 DeterminingOutgoingInterfacewithUDP/UDP中的外出接口的确定 261
8.15 TCPandUDPEchoServerUsingselect/使用select函数的TCP和UDP回送服务器程序 262
8.16 Summary/小结 264
Chapter 9.ElementarySCTPSockets/基本SCTP套接字 267
9.1 Introduction/概述 267
9.2 InterfaceModels/接口模型 268
9.3 sctp_bindxFunction/sctp_bindx函数 272
9.4 sctp_connectxFunction/sctp_connectx函数 274
9.5 sctp_getpaddrsFunction/sctp_getpaddrs函数 275
9.6 sctp_freepaddrsFunction/sctp_freepaddrs函数 275
9.7 sctp_getladdrsFunction/sctp_getladdrs函数 275
9.8 sctp_freeladdrsFunction/sctp_freeladdrs函数 276
9.9 sctp_sendmsgFunction/sctp_sendmsg函数 276
9.10 sctp_recvmsgFunction/sctp_recvmsg函数 277
9.11 sctp_opt_infoFunction/sctp_opt_info函数 278
9.12 sctp_peeloffFunction/sctp_peeloff函数 278
9.13 shutdownFunction/shutdown函数 278
9.14 Notifications/通知 280
9.15 Summary/小结 286
Chapter 10.SCTPClient/ServerExample/SCTP客户/服务器示例 287
10.1 Introduction/概述 287
10.2 SCTPOne-to-Many-StyleStreamingEchoServer:mainFunction/SCTP一到多式流分回送服务器程序:main函数 288
10.3 SCTPOne-to-Many-StyleStreamingEchoClient:mainFunction/SCTP一到多式流分回送客户程序:main函数 290
10.4 SCTPStreamingEchoClient:str_cliFunction/SCTP流分回送客户程序:str_cli函数 292
10.5 ExploringHead-of-LineBlocking/探究头端阻塞 293
10.6 ControllingtheNumberofStreams/控制流的数目 299
10.7 ControllingTermination/控制终止 300
10.8 Summary/小结 301
Chapter 11.NameandAddressConversions/名字与地址转换 303
11.1 Introduction/概述 303
11.2 DomainNameSystem(DNS)/域名系统 303
11.3 gethostbynameFunction/gethostbyname函数 307
11.4 gethostbyaddrFunction/gethostbyaddr函数 310
11.5 getservbynameandgetservbyportFunctions/getservbyname和getservbyport函数 311
11.6 getaddrinfoFunction/getaddrinfo函数 315
11.7 gai_strerrorFunction/gai_strerror函数 320
11.8 freeaddrinfoFunction/freeaddrinfo函数 321
11.9 getaddrinfoFunction:IPv6/getaddrinfo函数:IPv6 322
11.10 getaddrinfoFunction:Examples/getaddrinfo函数:示例 324
11.11 host_servFunction/host_serv函数 325
11.12 tcp_connectFunction/tcp_connect函数 326
11.13 tcp_listenFunction/tcp_listen函数 330
11.14 udp_clientFunction/udp_client函数 334
11.15 udp_connectFunction/udp_connect函数 337
11.16 udp_serverFunction/udp_server函数 338
11.17 getnameinfoFunction/getnameinfo函数 340
11.18 Re-entrantFunctions/可重入函数 341
11.19 gethostbyname_randgethostbyaddr_rFunctions/gethostbyname_r和gethostbyaddr_r函数 344
11.20 ObsoleteIPv6AddressLookupFunctions/废弃的IPv6地址解析函数 346
11.21 OtherNetworkingInformation/其他联网信息 348
11.22 Summary/小结 349
Part 3.AdvancedSockets/高级套接字 351
Chapter 12.IPv4andIPv6Interoperability/IPv4与IPv6的互操作性 353
12.1 Introduction/概述 353
12.2 IPv4Client,IPv6Server/IPv4客户与IPv6服务器 354
12.3 IPv6Client,IPv4Server/IPv6客户与IPv4服务器 357
12.4 IPv6Address-TestingMacros/IPv6地址测试宏 360
12.5 SourceCodePortability/源代码可移植性 361
12.6 Summary/小结 362
Chapter 13.DaemonProcessesandtheinetdSuperserver/守护进程和inetd超级服务器程序 363
13.1 Introduction/概述 363
13.2 syslogdDaemon/syslogd守护进程 364
13.3 syslogFunction/syslog函数 365
13.4 daemon_initFunction/daemon_init函数 367
13.5 inetdDaemon/inetd守护进程 371
13.6 daemon_inetdFunction/daemon_inetd函数 377
13.7 Summary/小结 379
Chapter 14.AdvancedI/OFunctions/高级I/O函数 381
14.1 Introduction/概述 381
14.2 SocketTimeouts/套接字超时 381
14.3 recvandsendFunctions/recv和send函数 387
14.4 readvandwritevFunctions/readv和writev函数 389
14.5 recvmsgandsendmsgFunctions/recvmsg和sendmsg函数 390
14.6 AncillaryData/辅助数据 395
14.7 HowMuchDataIsQueued?/排队的数据量 398
14.8 SocketsandStandardI/O/套接字和标准I/O 399
14.9 AdvancedPolling/高级轮询技术 402
14.10 Summary/小结 408
Chapter 15.UnixDomainProtocols/Unix域协议 411
15.1 Introduction/概述 411
15.2 UnixDomainSocketAddressStructure/Unix域套接字地址结构 412
15.3 socketpairFunction/socketpair函数 414
15.4 SocketFunctions/套接字函数 415
15.5 UnixDomainStreamClient/Server/Unix域流客户/服务器 416
15.6 UnixDomainDatagramClient/Server/Unix域数据报客户/服务器 418
15.7 PassingDescriptors/描述符传递 420
15.8 ReceivingSenderCredentials/接收发送者的凭证 429
15.9 Summary/小结 432
Chapter 16.NonblockingI/O/非阻塞I/O 435
16.1 Introduction/概述 435
16.2 NonblockingReadsandWrites:str_cliFunction(Revisited)/非阻塞读和写:再论str_cli函数 437
16.3 Nonblockingconnect/非阻塞connect 448
16.4 Nonblockingconnect:DaytimeClient/非阻塞connect:时间获取客户程序 449
16.5 Nonblockingconnect:WebClient/非阻塞connect:Web客户程序 452
16.6 Nonblockingaccept/非阻塞accept 461
16.7 Summary/小结 463
Chapter 17.ioctlOperations/ioctl操作 465
17.1 Introduction/概述 465
17.2 ioctlFunction/ioctl函数 466
17.3 SocketOperations/套接字操作 466
17.4 FileOperations/文件操作 468
17.5 InterfaceConfiguration/接口配置 468
17.6 get_ifi_infoFunction/get_ifi_info函数 469
17.7 InterfaceOperations/接口操作 480
17.8 ARPCacheOperations/ARP高速缓存操作 481
17.9 RoutingTableOperations/路由表操作 483
17.10 Summary/小结 484
Chapter 18.RoutingSockets/路由套接字 485
18.1 Introduction/概述 485
18.2 DatalinkSocketAddressStructure/数据链路套接字地址结构 486
18.3 ReadingandWriting/读和写 487
18.4 sysctlOperations/sysctl操作 495
18.5 get_ifi_infoFunction(Revisited)/get_ifi_info函数 500
18.6 InterfaceNameandIndexFunctions/接口名字和索引函数 504
18.7 Summary/小结 508
Chapter 19.KeyManagementSockets/密钥管理套接字 511
19.1 Introduction/概述 511
19.2 ReadingandWriting/读和写 512
19.3 DumpingtheSecurityAssociationDatabase(SADB)/安全关联数据库的转储 514
19.4 CreatingaStaticSecurityAssociation(SA)/创建静态安全关联 517
19.5 DynamicallyMaintainingSAs/动态维护安全关联 524
19.6 Summary/小结 528
Chapter 20.Broadcasting/广播 529
20.1 Introduction/概述 529
20.2 BroadcastAddresses/广播地址 531
20.3 UnicastversusBroadcast/单播和广播的比较 532
20.4 dg_cliFunctionUsingBroadcasting/使用广播的dg_cli函数 535
20.5 RaceConditions/竞争状态 538
20.6 Summary/小结 547
Chapter 21.Multicasting/多播 549
21.1 Introduction/概述 549
21.2 MulticastAddresses/多播地址 549
21.3 MulticastingversusBroadcastingonaLAN/局域网上多播和广播的比较 553
21.4 MulticastingonaWAN/广域网上的多播 556
21.5 Source-SpecificMulticast/源特定多播 558
21.6 MulticastSocketOptions/多播套接字选项 559
21.7 mcast_joinandRelatedFunctions/mcast_join和相关函数 565
21.8 dg_cliFunctionUsingMulticasting/使用多播的dg_cli函数 570
21.9 ReceivingIPMulticastInfrastructureSessionAnnouncements/接收IP多播基础设施会话声明 571
21.10 SendingandReceiving/发送和接收 575
21.11 SimpleNetworkTimeProtocol(SNTP)/简单网络时间协议 579
21.12 Summary/小结 584
Chapter 22.AdvancedUDPSockets/高级UDP套接字 587
22.1 Introduction/概述 587
22.2 ReceivingFlags,DestinationIPAddress,andInterfaceIndex/接收标志、目的IP地址和接口索引 588
22.3 DatagramTruncation/数据报截断 594
22.4 WhentoUseUDPInsteadofTCP/何时用UDP代替TCP 594
22.5 AddingReliabilitytoaUDPApplication/给UDP应用增加可靠性 597
22.6 BindingInterfaceAddresses/绑定接口地址 608
22.7 ConcurrentUDPServers/并发UDP服务器 612
22.8 IPv6PacketInformation/IPv6分组信息 615
22.9 IPv6PathMTUControl/IPv6路径MTU控制 618
22.10 Summary/小结 620
Chapter 23.AdvancedSCTPSockets/高级SCTP套接字 621
23.1 Introduction/概述 621
23.2 AnAutoclosingOne-to-Many-StyleServer/自动关闭的一到多式服务器程序 621
23.3 PartialDelivery/部分递送 622
23.4 Notifications/通知 625
23.5 UnorderedData/无序的数据 629
23.6 BindingaSubsetofAddresses/绑定地址子集 630
23.7 DeterminingPeerandLocalAddressInformation/确定对端和本端地址信息 631
23.8 FindinganAssociationIDGivenanIPAddress/给定IP地址找出关联ID 635
23.9 HeartbeatingandAddressFailure/心搏和地址不可达 636
23.10 PeelingOffanAssociation/关联剥离 637
23.11 ControllingTiming/定时控制 639
23.12 WhentoUseSCTPInsteadofTCP/何时用SCTP代替TCP 641
23.13 Summary/小结 643
Chapter 24.Out-of-BandData/带外数据 645
24.1 Introduction/概述 645
24.2 TCPOut-of-BandData/TCP带外数据 645
24.3 sockatmarkFunction/sockatmark函数 654
24.4 TCPOut-of-BandDataRecap/TCP带外数据小结 661
24.5 Summary/小结 662
Chapter 25.Signal-DrivenI/O/信号驱动I/O 663
25.1 Introduction/概述 663
25.2 Signal-DrivenI/OforSockets/套接字的信号驱动I/O 664
25.3 UDPEchoServerUsingSIGIO/使用SIGIO的UDP回送服务器程序 666
25.4 Summary/小结 672
Chapter 26.Threads/线程 675
26.1 Introduction/概述 675
26.2 BasicThreadFunctions:CreationandTermination/基本线程函数:创建和终止 676
26.3 str_cliFunctionUsingThreads/使用线程的str_cli函数 679
26.4 TCPEchoServerUsingThreads/使用线程的TCP回送服务器程序 681
26.5 Thread-SpecificData/线程特定数据 686
26.6 WebClientandSimultaneousConnections(Continued)/Web客户与同时连接(续) 694
26.7 Mutexes:MutualExclusion/互斥锁 697
26.8 ConditionVariables/条件变量 701
26.9 WebClientandSimultaneousConnections(Continued)/Web客户与同时连接(续) 705
26.10 Summary/小结 707
Chapter 27.IPOptions/IP选项 709
27.1 Introduction/概述 709
27.2 IPv4Options/IPv4选项 709
27.3 IPv4SourceRouteOptions/IP源路径选项 711
27.4 IPv6ExtensionHeaders/IPv6扩展首部 719
27.5 IPv6Hop-by-HopOptionsandDestinationOptions/IPv6步跳选项和目的选项 719
27.6 IPv6RoutingHeader/IPv6路由首部 725
27.7 IPv6StickyOptions/IPv6粘附选项 731
27.8 HistoricalIPv6AdvancedAPI/历史性IPv6高级API 732
27.9 Summary/小结 733
Chapter 28.RawSockets/原始套接字 735
28.1 Introduction/概述 735
28.2 RawSocketCreation/原始套接字创建 736
28.3 RawSocketOutput/原始套接字输出 737
28.4 RawSocketInput/原始套接字输入 739
28.5 pingProgram/ping程序 741
28.6 tracerouteProgram/traceroute程序 755
28.7 AnICMPMessageDaemon/一个ICMP消息守护进程 769
28.8 Summary/小结 786
Chapter 29.DatalinkAccess/数据链路访问 787
29.1 Introduction/概述 787
29.2 BSDPacketFilter(BPF)/BSD分组过滤器 788
29.3 DatalinkProviderInterface(DLPI)/数据链路提供者接口 790
29.4 Linux:SOCK_PACKETandPF_PACKET/Linux:SOCK_PACKET和PF_PACKET 791
29.5 libpcap:PacketCaptureLibrary/libpcap:分组捕获函数库 792
29.6 libnet:PacketCreationandInjectionLibrary/libnet:分组构造与注入函数库 793
29.7 ExaminingtheUDPChecksumField/检查UDP的校验和字段 793
29.8 Summary/小结 815
Chapter 30.Client/ServerDesignAlternatives/多种客户/服务器设计方式 817
30.1 Introduction/概述 817
30.2 TCPClientAlternatives/各种TCP客户程序设计方式 819
30.3 TCPTestClient/TCP测试用客户程序 820
30.4 TCPIterativeServer/TCP迭代服务器程序 821
30.5 TCPConcurrentServer,OneChildperClient/TCP并发服务器程序,每个客户一个子进程 822
30.6 TCPPreforkedServer,NoLockingAroundaccept/TCP预先派生子进程服务器程序,accept无上锁保护 826
30.7 TCPPreforkedServer,FileLockingAroundaccept/TCP预先派生子进程服务器程序,accept使用文件上锁保护 832
30.8 TCPPreforkedServer,ThreadLockingAroundaccept/TCP预先派生子进程服务器程序,accept使用线程上锁保护 835
30.9 TCPPreforkedServer,DescriptorPassing/TCP预先派生子进程服务器程序,传递描述符 836
30.10 TCPConcurrentServer,OneThreadperClient/TCP并发服务器程序,每个客户一个线程 842
30.11 TCPPrethreadedServer,per-Threadaccept/TCP预先创建线程服务器程序,每个线程各自accept 844
30.12 TCPPrethreadedServer,MainThreadaccept/TCP预先创建线程服务器程序,主线程统一accept 846
30.13 Summary/小结 849
Chapter 31.STREAMS/ 851
31.1 Introduction/概述 851
31.2 Overview/概貌 851
31.3 getmsgandputmsgFunctions/getmsg和putmsg函数 856
31.4 getpmsgandputpmsgFunctions/getpmsg和putpmsg函数 857
31.5 ioctlFunction/ioctl函数 857
31.6 TransportProviderInterface(TPI)/传输提供者接口 858
31.7 Summary/小结 868
Appendix A.IPv4,IPv6,ICMPv4,andICMPv6/
IPv4、IPv6、ICMPv4和ICMPv6 869
A.1 Introduction/概述 869
A.2 IPv4Header/IPv4首部 869
A.3 IPv6Header/IPv6首部 871
A.4 IPv4Addresses/IPv4地址 874
A.5 IPv6Addresses/IPv6地址 877
A.6 InternetControlMessageProtocols(ICMPv4andICMPv6)/因特网控制消息协议(ICMPv4和ICMPv6) 882
Appendix B.VirtualNetworks/虚拟网络 885
B.1 Introduction/概述 885
B.2 TheMBone 885
B.3 The6bone 887
B.4 IPv6Transition:6to4/IPv6过渡:6to4 889
Appendix C.DebuggingTechniques/调试技术 891
C.1 SystemCallTracing/系统调用跟踪 891
C.2 StandardInternetServices/标准因特网服务 893
C.3 sockProgram/sock程序 893
C.4 SmallTestPrograms/小测试程序 896
C.5 tcpdumpProgram/tcpdump程序 896
C.6 netstatProgram/netstat程序 896
C.7 lsofProgram/lsof程序 897
Appendix D.MiscellaneousSourceCode/其他源代码 899
D.1 unp.hHeader/unp.h头文件 899
D.2 config.hHeader/config.h头文件 904
D.3 StandardErrorFunctions/标准错误处理函数 910
Appendix E.SolutionstoSelectedExercises/精选习题答案 913
Bibliography /参考文献 947