《经典原版书库》系列丛书是响应教育部提出的使用原版国外教材的号召,为国内高校的计算机教学度身打造的。在广泛地征求并听取丛书的“专家指导委员会”的意见后,最终选定了30多种篇幅内容适度、讲解鞭辟入里的教材,其中的大部分已经被M.I.T、Stanford、U.C.Berkley、C.M.U.等世界名牌大学采用。丛书不仅涵盖了程序设计、数据结构、操作系统、计算机体系结构、数据库、编译原理、软件工程、图形学、通信与网络、离散数学等国内大学计算机专业普遍开设的核心课程,而且各具特色——有的出自语言设计者之手、有的历三十年而不衰,有的已被全世界的几百所高校采用。在这些圆熟通博的名师大作的指引之下,读者必将在计算机科学的宫殿中由登堂而入室。
本书是其中一册。
\r\n
Preface \r\n\r\nChapter 1. Introduction\r\n\r\n1.1 Introduction\r\n1.2 Source Code Presentation\r\n1.3 History\r\n1.4 Appication Programming Interfaces\r\n1.5 Example Program\r\n1.6 System Calls and Library Functions\r\n1.7 Network Implementation Overview\r\n1.8 Descriptors\r\n1.9 Mbufs(Memory Buffers)and Output Processing\r\n1.10 Input Processing\r\n1.11 Network Implementation Overview Revisited\r\n1.12 Interrupt Levels and Concurrency\r\n1.13 Source Code Organization\r\n1.14 Test Network\r\n1.15 Summary\r\n\r\nChapter 2. Mbufs:Memory Buffers\r\n\r\n2.1 Introduction\r\n2.2 Code Introduction\r\n2.3 Mbuf Definitions\r\n2.4 mbuf Structure\r\n2.5 Simple Mbuf Macros and Functions\r\n2.6 m_devget and m_pullup Functions\r\n2.7 Summary of Mbuf Macros and Functions\r\n2.8 Summary of Net/3 Networking Data Structures\r\n2.9 m_copy and Cluster Reference Counts\r\n2.10 Alternatives\r\n2.11 Summary\r\n\r\nChapter 3. Interface Layer\r\n\r\n3.1 Introduction\r\n3.2 Code Introduction\r\n3.3 ifnet Structure\r\n3.4 ifaddr Structure\r\n3.5 sockaddr Structure\r\n3.6 ifnet and ifaddr Specialization\r\n3.7 Network Initialization\r\n3.8 Ethernet Initialization\r\n3.9 SLIP Initialization\r\n3.10 Loopback Initialization\r\n3.11 if_attach Function\r\n3.12 ifinit Function\r\n3.13 Summary\r\n\r\nChapter 4. Interfaces:Ethernet\r\n\r\n4.1 Introduction\r\n4.2 Code Introduction\r\n4.3 Ethernet Interface\r\n4.4 ioctl System Call\r\n4.5 Summary\r\n\r\nChapter 5. Interfaces:SLIP and Loopback\r\n\r\n5.1 Introduction\r\n5.2 Code Introduction\r\n5.3 SLIP Interface\r\n5.4 Loopback Interface\r\n5.5 Summary\r\n\r\nChapter 6. IP Addressing\r\n\r\n6.1 Introduction\r\n6.2 Code Introduction\r\n6.3 Interface and Address Summary\r\n6.4 sockaddr_in Structure\r\n6.5 in_ifaddr Structure\r\n6.6 Address Assigment\r\n6.7 Interface ioctl Processing\r\n6.8 Internet Utility Functions\r\n6.9 ifnet Utility Functions\r\n6.10 Summary\r\n\r\nChapter 7. Domains and Protocols\r\n\r\n7.1 Introduction\r\n7.2 Code Introduction\r\n7.3 domain Structure\r\n7.4 protosw Structure\r\n7.5 IP domain and protosw Structures\r\n7.6 pffindproto and pffindtype Functions\r\n7.7 pfctlinput Function\r\n7.8 IP Initialization\r\n7.9 sysctl System Call\r\n7.10 Summary\r\n\r\nChapter 8. IP:Internet Protocol\r\n\r\n8.1 Introduction\r\n8.2 Code Introduction\r\n8.3 IP Packets\r\n8.4 Input Processing:ipintr Function\r\n8.5 Forwarding:ip_forward Function\r\n8.6 Output Processing:ip_output Function\r\n8.7 Internet Checksum:in_cksum Function\r\n8.8 setsockopt and getsockopt System Calls\r\n8.9 ip_sysctl Function\r\n8.10 Summary\r\n\r\nChapter 9. IP Option Processing\r\n\r\n9.1 Introduction\r\n9.2 Code Introduction\r\n9.3 Option Format\r\n9.4 ip_dooptions Function\r\n9.5 Record Route Option\r\n9.6 Source and Record Route Options\r\n9.7 Timestamp Option\r\n9.8 ip_insertoptions Function\r\n9.9 ip_pcbopts Function\r\n9.10 Limitations\r\n9.11 Summary\r\n\r\nChapter 10. IP Fragmentation and Reassembly\r\n\r\n10.1 Introduction\r\n10.2 Code Introduction\r\n10.3 Fragmentation\r\n10.4 ip_optcopy Function\r\n10.5 Reassembly\r\n10.6 ip_reass Function\r\n10.7 ip_slowtimo Function\r\n10.8 Summary\r\n\r\nChapter 11. ICMP:Internet Control Message Protocol\r\n\r\n11.1 Introduction\r\n11.2 code Introduction\r\n11.3 icmp Structure\r\n11.4 ICMP protosw Structure\r\n11.5 Input Processing:icmp_input Function\r\n11.6 Error Processing\r\n11.7 Request Processing\r\n11.8 Redirect Processing\r\n11.9 Reply Processing\r\n11.10 Output Processing\r\n11.11 icmp_error Function\r\n11.12 icmp_reflect Function\r\n11.13 icmp_send Function\r\n11.14 icmp_sysctl Funtion\r\n11.15 Summary\r\n\r\nChapter 12. IP Multicasting\r\n\r\n12.1 Introduction\r\n12.2 Code Introduction\r\n12.3 Ethernet Multicast Addresses\r\n12.4 ether_multi Structure\r\n12.5 Ethernet Multicast Reception\r\n12.6 in_multi Structure\r\n12.7 ip_moptions Structure\r\n12.8 Multicast Socket Options\r\n12.9 Multicast TTL Values\r\n12.10 ip_setmoptions Function\r\n12.11 Joining an IP Multicast Group\r\n12.12 Leaving an IP Multicast Group\r\n12.13 ip_getmoptions Function\r\n12.14 Multicast Input Processing:ipintr Function\r\n12.15 Multicast Output Processing:ip_output Function\r\n12.16 Performance Considerstions\r\n12.17 Summary\r\n\r\nChapter 13. IGMP:Internet Group Management Protocol\r\n\r\n13.1 Introduction\r\n13.2 Code Introduction\r\n13.3 igmp Structure\r\n13.4 IGMP protosw Structure\r\n13.5 Joining a Group:igmp_joingroup Function\r\n13.6 igmp_fasttimo function\r\n13.7 Imput Processing:igmp_input Function\r\n13.8 Leaving a Group:igmp_leavegroup\r\n13.9 Summary\r\n\r\nChapter 14. IP Multicast Routing\r\n\r\n14.1 Introduction\r\n14.2 Code Introduction\r\n14.3 Multicast Output Processing Revisited\r\n14.4 mrouted Daemon\r\n14.5 Virtual Interfaces\r\n14.6 IGMP Revisited\r\n14.7 Multicast Routing\r\n14.8 Multicast Forwarding:ip_mforward Function\r\n14.9 Cleanup:ip_mrouter_done Function\r\n14.10 Summary\r\n\r\nChapter 15. Socket Layer\r\n\r\n15.1 Introduction\r\n15.2 Code Introduction\r\n15.3 socket Structure\r\n15.4 System Calls\r\n15.5 Processes,Descriptors,and Sockets\r\n15.6 socket System Call\r\n15.7 getsock and sockargs functions\r\n15.8 bind system Call\r\n15.9 listen System Call\r\n15.10 tsleep and wakeup Functions\r\n15.11 accept System Call\r\n15.12 sonewconn and soisconnected Functions\r\n15.13 connect System call\r\n15.14 shutdown System Call\r\n15.15 close System Call\r\n15.16 Summary\r\n\r\nChapter 16. Socket I/O\r\n\r\n16.1 Introduction\r\n16.2 Code Introduction\r\n16.3 socket Buffers\r\n16.4 write,writev,sendto,and sendmsg System Calls\r\n16.5 sendmsg System Call\r\n16.6 senit Function\r\n16.7 sosend Function\r\n16.8 read,readv,recvfrom,and recvmsg System Calls\r\n16.9 recvmsg System Call\r\n16.10 recvit Function\r\n16.11 soreceive Function\r\n16.12 soreceive Code\r\n16.13 Select System Call\r\n16.14 Summary\r\n\r\nChapter 17. Socket Options\r\n\r\n17.1 Introduction\r\n17.2 Code Introduction\r\n17.3 setsockopt System\r\n17.4 getsockopt System\r\n17.5 fcntl and ioctl System\r\n17.6 getsockname System Call\r\n17.7 getpeername System Call\r\n17.8 Summary\r\n\r\nChapter 18. Radix Tree Routing Tables\r\n\r\n18.1 Introduction\r\n18.2 Routing Table Structure\r\n18.3 Routing Sockets\r\n18.4 Code Introduction\r\n18.5 Radix Node Data Structures\r\n18.6 Routing Structures\r\n18.7 Initialization:route_init and rtable_init Functions\r\n18.8 Initialization:rn_init and rn_inithead Functions\r\n18.9 duplicate Keys and Mask Lists\r\n18.10 rn_match Function\r\n18.11 rn_search Function\r\n18.12 Summary\r\n\r\nChapter 19. Routing Requests and Routing Messages\r\n\r\n19.1 Introduction\r\n19.2 rtalloc and rtallocl Funtions\r\n19.3 RTFREE Macro and rtfree Function\r\n19.4 rtrequest Function\r\n19.5 rt_setgate Function\r\n19.6 rtinit Function\r\n19.7 rtredirect Function\r\n19.8 Routing Message Structures\r\n19.9 rt_missmsg Function\r\n19.10 rt_ifmsg function\r\n19.11 rt_newaddrmsg function\r\n19.12 rt_msg1 Function\r\n19.13 rt_msg2 Function\r\n19.14 sysctl_rtable Function\r\n19.15 sysctl_dumpentry Function\r\n19.16 sysctl_iflist Function\r\n19.17 Summary\r\n\r\nChapter 20. Routing Sockets\r\n\r\n20.1 Introduction\r\n20.2 routedomain and protosw Structures\r\n20.3 Routing Control Blocks\r\n20.4 raw_init Function\r\n20.5 route_output Function\r\n20.6 rt_xaddrs Function\r\n20.7 rt_setmetrics Function\r\n20.8 raw_input Function\r\n20.9 route_usrreq Function\r\n20.10 raw_usrreq Function\r\n20.11 raw_attach,raw_detach,and raw_disconnect Function\r\n20.12 Summary\r\n\r\nChapter 21. ARP:Address Resolution Protocol\r\n\r\n21.1 Introduction\r\n21.2 ARP and the Routing Table\r\n21.3 Code Introduction\r\n21.4 ARP Structures\r\n21.5 arpwhohas Function\r\n21.6 arprequest Function\r\n21.7 arpintr Function\r\n21.8 in_arpinput Function\r\n21.9 ARP Timer Functions\r\n21.10 arpresolve Function\r\n21.11 arplookup Function\r\n21.12 Proxy ARP\r\n21.13 arp_rtrequest Functions\r\n21.14 ARP and Multicasting\r\n21.15 Summary\r\n\r\nChapter 22. Protocol Control Blocks\r\n\r\n22.1 Introduction\r\n22.2 Code Introduction\r\n22.3 inpcb Structure\r\n22.4 in_pcballoc and in_pcbdetach Functions\r\n22.5 Binding,Connecting,and Demultiplexing\r\n22.6 in_pcblookup Function\r\n22.7 in_pcbbind Function\r\n22.8 in_pcbconnect Function\r\n22.9 in_pcbdisconnect Function\r\n22.10 in_setsockaddr and in_stepeeraddr Functions\r\n22.11 in_pcbnotify,in_rtchange,and in_losing Functions\r\n22.12 Implementation Refinements\r\n22.13 Summary\r\n\r\nChapter 23. UDP:User Datagram Protocol\r\n\r\n23.1 Introduction\r\n23.2 Code Introduction\r\n23.3 UDP protosw Structure\r\n23.4 UDP Header\r\n23.5 udp_init Function\r\n23.6 udp_ouput Function\r\n23.7 udp_input Function\r\n23.8 udp_saveopt Function\r\n23.9 udp_ctlinput Function\r\n23.10 udp_usrreq Function\r\n23.11 udp_sysctl Function\r\n23.12 Implementation Function\r\n23.13 Summary\r\n\r\nChapter 24. TCP:Transmission Control Protocol\r\n\r\n24.1 Introduction\r\n24.2 Code Introduction\r\n24.3 TCP protosw Structure\r\n24.4 TCP Header\r\n24.5 TCP Control Block\r\n24.6 TCP State Transition Diagram\r\n24.7 TCP Sequence Numbers\r\n24.8 tcp_init Funtion\r\n24.9 Summary\r\n\r\nChapter 25. TCP Timers\r\n\r\n25.1 Introduction\r\n25.2 Code Introduction\r\n25.3 tcp_canceltimers Function\r\n25.4 tcp_fasttimo Function\r\n25.5 tcp_slowtimo Function\r\n25.6 tcp_timers Function\r\n25.7 Retransmission Timer Calculations\r\n25.8 tcp_newtcpcb Function\r\n25.9 tcp_setpersist Function\r\n25.10 tcp_xmit_timer Function\r\n25.11 Retransmission Timeout:tcp_timers Function\r\n25.12 An RTT Example\r\n25.13 Summary\r\n\r\nChapter 26. TCP Output\r\n\r\n26.1 Introduction\r\n26.2 tcp_output Overview\r\n26.3 Determine if a Segment Should be Sent\r\n26.4 TCP Options\r\n26.5 Window Scale Option\r\n26.6 Timestamp Option\r\n26.7 Send a Segment\r\n26.8 tcp_template Function\r\n26.9 tcp_respond Function\r\n26.10 Summary\r\n\r\nChapter 27. TCP Functions\r\n\r\n27.1 Introduction\r\n27.2 tcp_drain Function\r\n27.3 tcp_drop Function\r\n27.4 tcp_close Function\r\n27.5 tcp_mss Function\r\n27.6 tcp_ctlinput Function\r\n27.7 tcp_notify Function\r\n27.8 tcp_quench Function\r\n27.9 TCP_REASS Macro and tcp_reass Funtion\r\n27.10 tcp_trace Function\r\n27.11 Summary\r\n\r\nChapter 28. TCP Input\r\n\r\n28.1 Introduction\r\n28.2 Preliminary Processing\r\n28.3 tcp_dooptions Function\r\n28.4 Header Prediction\r\n28.5 TCP Input:Slow Path Processing\r\n28.6 Initiation of Passive Open,Completion of Active Open\r\n28.7 PAWS:Protection Against Wrapped Sequence Numbers\r\n28.8 Trim Segment so Data is Within Window\r\n28.9 Self-Connects and Simultaneous Opens\r\n28.10 Record Timestamp\r\n28.11 RST Processing\r\n28.12 Summary\r\n\r\nChapter 29. TCP Input(Continued)\r\n\r\n29.1 Introduction\r\n29.2 ACK Processing Overview\r\n29.3 Completion of Passive Opens and Simultaneous Opens\r\n29.4 Fast Retransmit and Fast Recovery Algorithms\r\n29.5 ACK Processing\r\n29.6 Update Window Information\r\n29.7 Urgent Mode Processing\r\n29.8 tcp_pulloutofband Function\r\n29.9 Processing of Received Data\r\n29.10 FIN Processing\r\n29.11 Final Processing\r\n29.12 Implementaion Refinements\r\n29.13 Header Compression\r\n29.14 Summary\r\n\r\nChapter 30. TCP User Requests\r\n\r\n30.1 Introduction\r\n30.2 tcp_usrreq Function\r\n30.3 tcp_attach Function\r\n30.4 tcp_disconnect Function\r\n30.5 tcp_usrclosed Function\r\n30.6 tcp_ctloutput Function\r\n30.7 Summary\r\n\r\nChapter 31. BPF:BSD Packet Filter\r\n\r\n31.1 Introduction\r\n31.2 Code Introduction\r\n31.3 bpf_if Structure\r\n31.4 bpf_d Structure\r\n31.5 BPF Input\r\n31.6 BPF Output\r\n31.7 Summary\r\n\r\nChapter 32. Raw IP\r\n\r\n32.1 Introduction\r\n32.2 Code Introduction\r\n32.3 Raw IP protosw Structure\r\n32.4 rip_inif Function\r\n32.5 rip_input Function\r\n32.6 rip_ouput Function\r\n32.7 rip_usrreq Function\r\n32.8 rip_ctloutput Function\r\n32.9 Summary\r\n\r\nEpllogue\r\n\r\nAppendix A. Solutions to Selected Exercises\r\n\r\nAppendix B.Source Code Availability\r\n\r\nAppendix C. RFC 1122 Compliance\r\n\r\nC.1 Link-Layer Requirements\r\nC.2 IP Requirements\r\nC.3 IP Options Requirements\r\nC.4 IP Fragmentation and Reassembly Requirements\r\nC.5 ICMP Requirements\r\nC.6 Multicasting Requirements\r\nC.7 IGMP Requirements\r\nC.8 Routing Requirements\r\nC.9 ARP Requirements\r\nC.10 UDP Requirements\r\nC.11 TCP Requirements\r\n\r\nBibliography\r\n\r\nIndex