成功加入购物车
‘’
[美] 史蒂文斯 、[美] 芬纳 、[美] 鲁道夫 著 / 人民邮电出版社 / 2009-11 / 平装
售价 ¥ 14.00 1.1折
定价 ¥129.00
品相 八五品
上书时间2021-07-22
UNIX网络编程 卷1
《UNIX网络编程卷1:套接字联网API(英文版第3版)》是一部UNIX网络编程的经典之作。书中全面深入地介绍了如何使用套接字API进行网络编程。全书不但介绍了基本编程内容,还涵盖了与套接字编程相关的高级主题,对于客户/服务器程序的各种设计方法也作了完整的探讨,最后还深入分析了流这种设备驱动机制。
《UNIX网络编程卷1:套接字联网API(英文版第3版)》内容详尽且具权威性,几乎每章都提供精选的习题,并提供了部分习题的答案,是网络研究和开发人员理想的参考书。
W.RichardStevens(1951—1999)国际知名的UNIX和网络专家,备受赞誉的技术作家。生前著有《TCP/IP详解》(三卷)、《UNIX环境高级编程》和《UNIX网络编程》(两卷),均为不朽的经典著作。
BillFennerAT&T实验室的主要技术人员,专攻IP多播、网络管理和测量,他是IETF路由的领域主管之一,负责审批作为RFC出版的所有路由相关文档。
AndrewM.RudoffSun公司的资深软件工程师,专攻网络、操作系统内核、文件系统和高可用性软件体系结构。
Part1IntroductionandTCP/IP1简介和TCP/IPChapter1Introduction3简介1.1Introduction3概述1.2ASimpleDaytimeClient6一个简单的时间获取客户程序1.3ProtocolIndependence10协议无关性1.4ErrorHandling:WrapperFunctions11错误处理:包装函数1.5ASimpleDaytimeServer13一个简单的时间获取服务器程序1.6RoadmaptoClient/ServerExamplesintheText16本书中客户/服务器示例的路线图1.7OSIModel18OSI模型1.8BSDNetworkingHistory20BSD网络历史1.9TestNetworksandHosts22测试用网络及主机1.10UnixStandards25Unix标准1.1164-BitArchitectures2864位体系结构1.12Summary29小结Chapter2TheTransportLayer:TOP,UDP,andSCTP31传输层:TCP、UDP和SCTP2.1Introduction31概述2.2TheBigPicture32全景图2.3UserDatagramProtocol(UDP)34用户数据报协议2.4TransmissionControlProtocol(TCP)35传输控制协议2.5StreamControlTransmissionProtocol(SCTP)36流控制传输协议2.6TCPConnectionEstablishmentandTermination37TCP连接的建立和终止2.7TIME_WAITState43TIME_WAIT状态2.8SCTPAssociationEstablishmentandTermination44SCTP关联的建立和终止2.9PortNumbers50端口号2.10TCPPortNumbersandConcurrentServers52TCP端口号与并发服务器2.11BufferSizesandLimitations55缓冲区大小及限制2.12StandardInternetServices61标准因特网服务2.13ProtocolUsagebyCommonInternetApplications62常见因特网应用所用的协议2.14Summary63小结Part2ElementarySockets65基本套接字Chanter3SocketsIntroduction67套接字简介3.1Introduction67概述3.2SocketAddressStructures67套接字地址结构3.3Value-ResultArguments74值-结果参数3.4ByteOrderingFunctions77字节排序函数3.5ByteManipulationFunctions80字节操纵函数3.6inet_aton,inet_addr,andinet_ntoaFunctions82inet_aton、inet_addr和inet_ntoa函数3.7inet_ptonandinet_ntopFunctions83inet_pton和inet_ntop函数3.8sock_ntopandRelatedFunctions86sock_ntop和相关函数3.9readn,writen,andreadlineFunctions88readn、writen和readline函数3.10Summary92小结Chapter4ElementaryTCPSockets95基本TCP套接字4.1Introduction95概述4.2socketFunction95socket函数4.3connectFunction99connect函数4.4bindFunction101bind函数4.5listenFunction104listen函数4.6acceptFunction109accept函数4.7forkandexecFunctions111fork和exec函数4.8ConcurrentServers114并发服务器4.9closeFunction117close函数4.10getsocknameandgetpeernameFunctions117getsockname和getpeername函数4.11Summary120小结Chapter5TCPClient/ServerExample121TCP客户/服务器示例5.1Introduction121概述5.2TCPEchoServer:mainFunction122TCP回送服务器程序:main函数5.3TCPEchoServer:str_echoFunction123TCP回送服务器程序:str_echo函数5.4TCPEchoClient:mainFunction124TCP回送客户程序:main函数5.5TCPEchoClient:str_cliFunction125TCP回送客户程序:str_cli函数5.6NormalStartup126正常启动5.7NormalTermination128正常终止5.8POSIXSignalHandling129POSIX信号处理5.9HandlingSIGCHLDSignals132处理SIGCHLD信号5.10waitandwaitpidFunctions135wait和waitpid函数5.11ConnectionAbortbeforeacceptReturns139accept返回前连接异常中止5.12TerminationofServerProcess141服务器进程的终止5.13SIGPIPESignal142SIGPIPE信号5.14CrashingofServerHost144服务器主机崩溃5.15CrashingandRebootingofServerHost144服务器主机崩溃及重启5.16ShutdownofServerHost145服务器主机关机5.17SummaryofTCPExample146TCP示例小结5.18DataFormat147数据格式5.19Summary151小结Chapter6I/OMultiplexing:TheselectandpollFunctions153I/O多路复用:select和poll函数6.1Introduction153概述6.2I/OModels154I/O模型6.3selectFunction160select函数6.4str_cliFunction(Revisited)167再访str_cli函数6.5BatchInputandBuffering169批量输入和缓冲6.6shutdownFunction172shutdown函数6.7str_cliFunction(RevisitedAgain)173三顾str_cli函数6.8TCPEchoServer(Revisited)175再访TCP回送服务器程序6.9pselectFunction181pselect函数6.10pollFunction182poll函数6.11TCPEchoServer(RevisitedAgain)185三顾TCP回送服务器程序6.12Summary188小结Chapter7SocketOptions191套接字选项7.1Introduction191概述7.2getsockoptandsetsockoptFunctions192getsockopt和setsockopt函数7.3CheckingifanOptionIsSupportedandObtainingtheDefault194检查选项是否被支持并获取默认值7.4SocketStates198套接字状态7.5GenericSocketOptions198通用套接字选项7.6IPv4SocketOptions214IPv4套接字选项7.7ICMPv6SocketOption216ICMPv6套接字选项7.8IPv6SocketOptions216IPv6套接字选项7.9TCPSocketOptions219TCP套接字选项7.10SCTPSocketOptions222SCTP套接字选项7.11fcntlFunction233fcntl函数7.12Summary236小结Chapter8ElementaryUDPSockets239基本UDP套接字8.1Introduction239概述8.2recvfromandsendtoFunctions240recvfrom和sendto函数8.3UDPEchoServer:mainFunction241UDP回送服务器程序:main函数8.4UDPEchoServer:dg_echoFunction242UDP回送服务器程序:dg_echo函数8.5UDPEchoClient:mainFunction244UDP回送客户程序:main函数8.6UDPEchoClient:dg_cliFunction245UDP回送客户程序:dg_cli函数8.7LostDatagrams245数据报的丢失8.8VerifyingReceivedResponse246验证接收到的响应8.9ServerNotRunning248服务器程序未运行8.10SummaryofUDPExample250UDP示例小结8.11connectFunctionwithUDP252UDP的connect函数8.12dg_cliFunction(Revisited)256再论dg_cli函数8.13LackofFlowControlwithUDP257UDP缺乏流量控制8.14DeterminingOutgoingInterfacewithUDP261UDP中的外出接口的确定8.15TCPandUDPEchoServerUsingselect262使用select函数的TCP和UDP回送服务器程序8.16Summary264小结Chapter9ElementarySCTPSockets267基本SCTP套接字9.1Introduction267概述9.2InterfaceModels268接口模型9.3sctp_bindxFunction272sctp_bindx函数9.4sctp_connectxFunction274sctp_connectx函数9.5sctp_getpaddrsFunction275sctp_getpaddrs函数9.6sctp_freepaddrsFunction275sctp_freepaddrs函数9.7sctp_getladdrsFunction275sctp_getladdrs函数9.8sctp_freeladdrsFunction276sctp_freeladdrs函数9.9sctp_sendmsgFunction276sctp_sendmsg函数9.10sctp_recvmsgFunction277sctp_recvmsg函数9.11sctp_opt_infoFunction278sctp_opt_info函数9.12sctp_peeloffFunction278sctp_peeloff函数9.13shutdownFunction278shutdown函数9.14Notifications280通知9.15Summary286小结Chapter10SCTPClient/ServerExample287SCTP客户/服务器示例10.1Introduction287概述10.2SCTPOne-to-Many-StyleStreamingEchoServer:mainFunction288SCTP一到多式流分回送服务器程序:main函数10.3SCTPOne-to-Many-StyleStreamingEchoClient:mainFunction290SCTP一到多式流分回送客户程序:main函数10.4SCTPStreamingEchoClient:str_cliFunction292SCTP流分回送客户程序:str_cli函数10.5ExploringHead-of-LineBlocking293探究头端阻塞10.6ControllingtheNumberofStreams299控制流的数目10.7ControllingTermination300控制终止10.8Summary301小结Chapter11NameandAddressConversions303名字与地址转换11.1Introduction303概述11.2DomainNameSystem(DNS)303域名系统11.3gethostbynameFunction307gethostbyname函数11.4gethostbyaddrFunction310gethostbyaddr函数11.5getservbynameandgetservbyportFunctions311getservbyname和getservbyport函数11.6getaddrinfoFunction315getaddrinfo函数11.7gai_strerrorFunction320gai_strerror函数11.8freeaddrinfoFunction321freeaddrinfo函数11.9getaddrinfoFunction:IPv6322getaddrinfo函数:IPv611.10getaddrinfoFunction:Examples324getaddrinfo函数:示例11.11host_servFunction325host_serv函数11.12tcp_connectFunction326tcp_connect函数11.13tcp_listenFunction330tcp_listen函数11.14udp_clientFunction334udp_client函数11.15udp_connectFunction337udp_connect函数11.16udp_serverFunction338udp_server函数11.17getnameinfoFunction340getnameinfo函数11.18Re-entrantFunctions341可重入函数11.19gethostbyname_randgethostbyaddr_rFunctions344gethostbyname_r和gethostbyaddr_r函数11.20ObsoleteIPv6AddressLookupFunctions346废弃的IPv6地址解析函数11.21OtherNetworkingInformation348其他联网信息11.22Summary349小结Part3AdvancedSockets351高级套接字Chapter12IPv4andIPv6Interoperability353IPv4与IPv6的互操作性12.1Introduction353概述12.2IPv4Client,IPv6Server354IPv4客户与IPv6服务器12.3IPv6Client,IPv4Server357IPv6客户与IPv4服务器12.4IPv6Address-TestingMacros360IPv6地址测试宏12.5SourceCodePortability361源代码可移植性12.6Summary362小结Chapter13DaemonProcessesandtheinetdSuperserver363守护进程和inetd超级服务器程序13.1Introduction363概述13.2syslogdDaemon364syslogd守护进程13.3syslogFunction365syslog函数13.4daemon_initFunction367daemon_init函数13.5inetdDaemon371inetd守护进程13.6daemon_inetdFunction377daemon_inetd函数13.7Summary379小结Chapter14AdvancedI/OFunctions381高级I/O函数14.1Introduction381概述14.2SocketTimeouts381套接字超时14.3recvandsendFunctions387recv和send函数14.4readvandwritevFunctions389readv和writev函数14.5recvmsgandsendmsgFunctions390recvmsg和sendmsg函数14.6AncillaryData395辅助数据14.7HowMuchDataIsQueued?398排队的数据量14.8SocketsandStandardI/O399套接字和标准I/O14.9AdvancedPolling402高级轮询技术14.10Summary408小结Chapter15UnixDomainProtocols411Unix域协议15.1Introduction411概述15.2UnixDomainSocketAddressStructure412Unix域套接字地址结构15.3socketpairFunction414socketpair函数15.4SocketFunctions415套接字函数15.5UnixDomainStreamClient/Server416Unix域流客户/服务器15.6UnixDomainDatagramClient/Server418Unix域数据报客户/服务器15.7PassingDescriptors420描述符传递15.8ReceivingSenderCredentials429接收发送者的凭证15.9Summary432小结Chapter16NonblockingI/O435非阻塞I/O16.1Introduction435概述16.2NonblockingReadsandWrites:str_cliFunction(Revisited)437非阻塞读和写:再论str_cli函数16.3Nonblockingconnect448非阻塞connect16.4Nonblockingconnect:DaytimeClient449非阻塞connect:时间获取客户程序16.5Nonblockingconnect:WebClient452非阻塞connect:Web客户程序16.6Nonblockingaccept461非阻塞accept16.7Summary463小结Chapter17ioctlOperations465ioctl操作17.1Introduction465概述17.2ioctlFunction466ioctl函数17.3SocketOperations466套接字操作17.4FileOperations468文件操作17.5InterfaceConfiguration468接口配置17.6get_ifi_infoFunction469get_ifi_info函数17.7InterfaceOperations480接口操作17.8ARPCacheOperations481ARP高速缓存操作17.9RoutingTableOperations483路由表操作17.10Summary484小结Chapter18RoutingSockets485路由套接字18.1Introduction485概述18.2DatalinkSocketAddressStructure486数据链路套接字地址结构18.3ReadingandWriting487读和写18.4sysctlOperations495sysctl操作18.5get_ifi_infoFunction(Revisited)500get_ifi_info函数18.6InterfaceNameandIndexFunctions504接口名字和索引函数18.7Summary508小结Chapter19KeyManagementSockets511密钥管理套接字19.1Introduction511概述19.2ReadingandWriting512读和写19.3DumpingtheSecurityAssociationDatabase(SADB)514安全关联数据库的转储19.4CreatingaStaticSecurityAssociation(SA)517创建静态安全关联19.5DynamicallyMaintainingSAs524动态维护安全关联19.6Summary528小结Chapter20Broadcasting529广播20.1Introduction529概述20.2BroadcastAddresses531广播地址20.3UnicastversusBroadcast532单播和广播的比较20.4dg_cliFunctionUsingBroadcasting535使用广播的dg_cli函数20.5RaceConditions538竞争状态20.6Summary547小结Chapter21Multicasting549多播21.1Introduction549概述21.2MulticastAddresses549多播地址21.3MulticastingversusBroadcastingonaLAN553局域网上多播和广播的比较21.4MulticastingonaWAN556广域网上的多播21.5Source-SpecificMulticast558源特定多播21.6MulticastSocketOptions559多播套接字选项21.7mcast_joinandRelatedFunctions565mcast_join和相关函数21.8dg_cliFunctionUsingMulticasting570使用多播的dg_cli函数21.9ReceivingIPMulticastInfrastructureSessionAnnouncements571接收IP多播基础设施会话声明21.10SendingandReceiving575发送和接收21.11SimpleNetworkTimeProtocol(SNTP)579简单网络时间协议21.12Summary584小结Chapter22AdvancedUDPSockets587高级UDP套接字22.1Introduction587概述22.2ReceivingFlags,DestinationIPAddress,andInterfaceIndex588接收标志、目的IP地址和接口索引22.3DatagramTruncation594数据报截断22.4WhentoUseUDPInsteadofTCP594何时用UDP代替TCP22.5AddingReliabilitytoaUDPApplication597给UDP应用增加可靠性22.6BindingInterfaceAddresses608绑定接口地址22.7ConcurrentUDPServers612并发UDP服务器22.8IPv6PacketInformation615IPv6分组信息22.9IPv6PathMTUControl618IPv6路径MTU控制22.10Summary620小结Chapter23AdvancedSCTPSockets621高级SCTP套接字23.1Introduction621概述23.2AnAutoclosingOne-to-Many-StyleServer621自动关闭的一到多式服务器程序23.3PartialDelivery622部分递送23.4Notifications625通知23.5UnorderedData629无序的数据23.6BindingaSubsetofAddresses630绑定地址子集23.7DeterminingPeerandLocalAddressInformation631确定对端和本端地址信息23.8FindinganAssociationIDGivenanIPAddress635给定IP地址找出关联ID23.9HeartbeatingandAddressFailure636心搏和地址不可达23.10PeelingOffanAssociation637关联剥离23.11ControllingTiming639定时控制23.12WhentoUseSCTPInsteadofTCP641何时用SCTP代替TCP23.13Summary643小结Chapter24Out-of-BandData645带外数据24.1Introduction645概述24.2TCPOut-of-BandData645TCP带外数据24.3sockatmarkFunction654sockatmark函数24.4TCPOut-of-BandDataRecap661TCP带外数据小结24.5Summary662小结Chapter25Signal-DrivenI/O663信号驱动I/O25.1Introduction663概述25.2Signal-DrivenI/OforSockets664套接字的信号驱动I/O25.3UDPEchoServerUsingSIGIO666使用SIGIO的UDP回送服务器程序25.4Summary672小结Chapter26Threads675线程26.1Introduction675概述26.2BasicThreadFunctions:CreationandTermination676基本线程函数:创建和终止26.3str_cliFunctionUsingThreads679使用线程的str_cli函数26.4TCPEchoServerUsingThreads681使用线程的TCP回送服务器程序26.5Thread-SpecificData686线程特定数据26.6WebClientandSimultaneousConnections(Continued)694Web客户与同时连接(续)26.7Mutexes:MutualExclusion697互斥锁26.8ConditionVariables701条件变量26.9WebClientandSimultaneousConnections(Continued)705Web客户与同时连接(续)26.10Summary707小结Chapter27IPOptions709IP选项27.1Introduction709概述27.2IPv4Options709IPv4选项27.3IPv4SourceRouteOptions711IP源路径选项27.4IPv6ExtensionHeaders719IPv6扩展首部27.5IPv6Hop-by-HopOptionsandDestinationOptions719IPv6步跳选项和目的选项27.6IPv6RoutingHeader725IPv6路由首部27.7IPv6StickyOptions731IPv6粘附选项27.8HistoricalIPv6AdvancedAPI732历史性IPv6高级API27.9Summary733小结Chapter28RawSockets735原始套接字28.1Introduction735概述28.2RawSocketCreation736原始套接字创建28.3RawSocketOutput737原始套接字输出28.4RawSocketInput739原始套接字输入28.5pingProgram741ping程序28.6tracerouteProgram755traceroute程序28.7AnICMPMessageDaemon769一个ICMP消息守护进程28.8Summary786小结Chapter29DatalinkAccess787数据链路访问29.1Introduction787概述29.2BSDPacketFilter(BPF)788BSD分组过滤器29.3DatalinkProviderInterface(DLPI)790数据链路提供者接口29.4Linux:SOCK_PACKETandPF_PACKET791Linux:SOCK_PACKET和PF_PACKET29.5libpcap:PacketCaptureLibrary792libpcap:分组捕获函数库29.6libnet:PacketCreationandInjectionLibrary793libnet:分组构造与注入函数库29.7ExaminingtheUDPChecksumField793检查UDP的校验和字段29.8Summary815小结Chapter30Client/ServerDesignAlternatives817多种客户/服务器设计方式30.1Introduction817概述30.2TCPClientAlternatives819各种TCP客户程序设计方式30.3TCPTestClient820TCP测试用客户程序30.4TCPIterativeServer821TCP迭代服务器程序30.5TCPConcurrentServer,OneChildperClient822TCP并发服务器程序,每个客户一个子进程30.6TCPPreforkedServer,NoLockingAroundaccept826TCP预先派生子进程服务器程序,accept无上锁保护30.7TCPPreforkedServer,FileLockingAroundaccept832TCP预先派生子进程服务器程序,accept使用文件上锁保护30.8TCPPreforkedServer,ThreadLockingAroundaccept835TCP预先派生子进程服务器程序,accept使用线程上锁保护30.9TCPPreforkedServer,DescriptorPassing836TCP预先派生子进程服务器程序,传递描述符30.10TCPConcurrentServer,OneThreadperClient842TCP并发服务器程序,每个客户一个线程30.11TCPPrethreadedServer,per-Threadaccept844TCP预先创建线程服务器程序,每个线程各自accept30.12TCPPrethreadedServer,MainThreadaccept846TCP预先创建线程服务器程序,主线程统一accept30.13Summary849小结Chapter31STREAMS85131.1Introduction851概述31.2Overview851概貌31.3getmsgandputmsgFunctions856getmsg和putmsg函数31.4getpmsgandputpmsgFunctions857getpmsg和putpmsg函数31.5ioctlFunction857ioctl函数31.6TransportProviderInterface(TPI)858传输提供者接口31.7Summary868小结AppendixAIPv4,IPv6,ICMPv4,andICMPv6869IPv4、IPv6、ICMPv4和ICMPv6A.1Introduction869概述A.2IPv4Header869IPv4首部A.3IPv6Header871IPv6首部A.4IPv4Addresses874IPv4地址A.5IPv6Addresses877IPv6地址A.6InternetControlMessageProtocols(ICMPv4andICMPv6)882因特网控制消息协议(ICMPv4和ICMPv6)AppendixBVirtualNetworks885虚拟网络B.1Introduction885概述B.2TheMBone885B.3The6bone887B.4IPv6Transition:6to4889IPv6过渡:6to4AppendixCDebuggingTechniques891调试技术C.1SystemCallTracing891系统调用跟踪C.2StandardInternetServices893标准因特网服务C.3sockProgram893sock程序C.4SmallTestPrograms896小测试程序C.5tcpdumpProgram896tcpdump程序C.6netstatProgram896netstat程序C.7lsofProgram897lsof程序AppendixDMiscellaneousSourceCode899其他源代码D.1unp.hHeader899unp.h头文件D.2config.hHeader904config.h头文件D.3StandardErrorFunctions910标准错误处理函数AppendixESolutionstoSelectedExercises913精选习题答案Bibliography947参考文献Index955索引
展开全部
配送说明
...
相似商品
为你推荐
开播时间:09月02日 10:30