Addison wesley TCPIP illustrated volume 2 the implementation feb 1995 ISBN 020163354x

2.9K 231 0
Addison wesley TCPIP illustrated volume 2 the implementation feb 1995 ISBN 020163354x

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TCP/IP Illustrated, Volume 2: The Implementation By Gary R Wright, W Richard Stevens Publisher : Addison Wesley Pub Date : January 12, 1995 ISBN : 0-201-63354-X Pages : 1200 TCP/IP Illustrated, Volume 2 contains a thorough explanation of how TCP/IP protocols are implemented There isn't a more practical or up-to-date bookothis volume is the only one to cover the de facto standard implementation from the 4.4BSDLite release, the foundation for TCP/IP implementations run daily on hundreds of thousands of systems worldwide Combining 500 illustrations with 15,000 lines of real, working code, TCP/IP Illustrated, Volume 2 uses a teach-by-example approach to help you master Table of • Contents TCP/IP implementation You will learn about such topics as the relationship between the sockets API and the protocol suite, and the differences between a host implementation and a router In addition, the book covers the newest features of the 4.4BSDLite release, including multicasting, long fat pipe support, window scale, timestamp options, and protection against wrapped sequence numbers, and many other topics Comprehensive in scope, based on a working standard, and thoroughly illustrated, this book is an indispensable resource for anyone working with TCP/IP TCP/IP Illustrated, Volume 2: The Implementation By Gary R Wright, W Richard Stevens Publisher : Addison Wesley Pub Date : January 12, 1995 ISBN : 0-201-63354-X Table of • Pages : 1200 Contents Copyright Preface Introduction Organization of the Book Intended Audience Source Code Copyright Acknowledgments Chapter 1 Introduction Section 1.1 Introduction Section 1.2 Source Code Presentation Section 1.3 History Section 1.4 Application Programming Interfaces Section 1.5 Example Program Section 1.6 System Calls and Library Functions Section 1.7 Network Implementation Overview Section 1.8 Descriptors Section 1.9 Mbufs (Memory Buffers) and Output Processing Section 1.10 Input Processing Section 1.11 Network Implementation Overview Revisited Section 1.12 Interrupt Levels and Concurrency Section 1.13 Source Code Organization Section 1.14 Test Network Section 1.15 Summary Chapter 2 Mbufs: Memory Buffers Section 2.1 Introduction Section 2.2 Code Introduction Section 2.3 Mbuf Definitions Section 2.4 mbuf Structure Section 2.5 Simple Mbuf Macros and Functions Section 2.6 m_devget and m_pullup Functions Section 2.7 Summary of Mbuf Macros and Functions Section 2.8 Summary of Net/3 Networking Data Structures Section 2.9 m_copy and Cluster Reference Counts Section 2.10 Alternatives Section 2.11 Summary Chapter 3 Interface Layer Section 3.1 Introduction Section 3.2 Code Introduction Section 3.3 ifnet Structure Section 3.4 ifaddr Structure Section 3.5 sockaddr Structure Section 3.6 ifnet and ifaddr Specialization Section 3.7 Network Initialization Overview Section 3.8 Ethernet Initialization Section 3.9 SLIP Initialization Section 3.10 Loopback Initialization Section 3.11 if_attach Function Section 3.12 ifinit Function 3.13 Summary Chapter 4 Interfaces: Ethernet Section 4.1 Introduction Section 4.2 Code Introduction Section 4.3 Ethernet Interface Section 4.4 ioctl System Call Section 4.5 Summary Chapter 5 Interfaces: SLIP and Loopback Section 5.1 Introduction Section 5.2 Code Introduction Section 5.3 SLIP Interface Section 5.4 Loopback Interface Section 5.5 Summary Chapter 6 IP Addressing Section 6.1 Introduction Section 6.2 Code Introduction Section 6.3 Interface and Address Summary Section 6.4 sockaddr_in Structure Section 6.5 in_ifaddr Structure Section 6.6 Address Assignment Section 6.7 Interface ioctl Processing Section 6.8 Internet Utility Functions Section 6.9 ifnet Utility Functions Section 6.10 Summary Chapter 7 Domains and Protocols Section 7.1 Introduction Section 7.2 Code Introduction Section 7.3 domain Structure Section 7.4 protosw Structure Section 7.5 IP domain and protosw Structures Section 7.6 pffindproto and pffindtype Functions Section 7.7 pfctlinput Function Section 7.8 IP Initialization Section 7.9 sysctl System Call Section 7.10 Summary Chapter 8 IP: Internet Protocol Section 8.1 Introduction Section 8.2 Code Introduction Section 8.3 IP Packets Section 8.4 Input Processing: ipintr Function Section 8.5 Forwarding: ip_forward Function Section 8.6 Output Processing: ip_output Function Section 8.7 Internet Checksum: in_cksum Function Section 8.8 setsockopt and getsockopt System Calls Section 8.9 ip_sysctl Function Section 8.10 Summary Chapter 9 IP Option Processing Section 9.1 Introduction Section 9.2 Code Introduction Section 9.3 Option Format Section 9.4 ip_dooptions Function Section 9.5 Record Route Option Section 9.6 Source and Record Route Options Section 9.7 Timestamp Option Section 9.8 ip_insertoptions Function Section 9.9 ip_pcbopts Function Section 9.10 Limitations Section 9.11 Summary Chapter 10 IP Fragmentation and Reassembly Section 10.1 Introduction Section 10.2 Code Introduction Section 10.3 Fragmentation Section 10.4 ip_optcopy Function Section 10.5 Reassembly Section 10.6 ip_reass Function Section 10.7 ip_slowtimo Function Section 10.8 Summary Chapter 11 ICMP: Internet Control Message Protocol Section 11.1 Introduction Section 11.2 Code Introduction Section 11.3 icmp Structure Section 11.4 ICMP protosw Structure Section 11.5 Input Processing: icmp_input Function Section 11.6 Error Processing Section 11.7 Request Processing Section 11.8 Redirect Processing Section 11.9 Reply Processing Section 11.10 Output Processing Section 11.11 icmp_error Function Section 11.12 icmp_reflect Function Section 11.13 icmp_send Function Section 11.14 icmp_sysctl Function Section 11.15 Summary Chapter 12 IP Multicasting Section 12.1 Introduction Section 12.2 Code Introduction Section 12.3 Ethernet Multicast Addresses Section 12.4 ether_multi Structure Section 12.5 Ethernet Multicast Reception Section 12.6 in_multi Structure Section 12.7 ip_moptions Structure Section 12.8 Multicast Socket Options Section 12.9 Multicast TTL Values Section 12.10 ip_setmoptions Function Section 12.11 Joining an IP Multicast Group Section 12.12 Leaving an IP Multicast Group Section 12.13 ip_getmoptions Function Section 12.14 Multicast Input Processing: ipintr Function Section 12.15 Multicast Output Processing: ip_output Function Section 12.16 Performance Considerations Section 12.17 Summary Chapter 13 IGMP: Internet Group Management Protocol Section 13.1 Introduction Section 13.2 Code Introduction Section 13.3 igmp Structure Section 13.4 IGMP protosw Structure Section 13.5 Joining a Group: igmp_joingroup Function Section 13.6 igmp_fasttimo Function Section 13.7 Input Processing: igmp_input Function Section 13.8 Leaving a Group: igmp_leavegroup Function Section 13.9 Summary Chapter 14 IP Multicast Routing Section 14.1 Introduction Section 14.2 Code Introduction Section 14.3 Multicast Output Processing Revisited Section 14.4 mrouted Daemon Section 14.5 Virtual Interfaces Section 14.6 IGMP Revisited Section 14.7 Multicast Routing Section 14.8 Multicast Forwarding: ip_mforward Function Section 14.9 Cleanup: ip_mrouter_done Function Section 14.10 Summary Chapter 15 Socket Layer Section 15.1 Introduction Section 15.2 Code Introduction Section 15.3 socket Structure Section 15.4 System Calls Section 15.5 Processes, Descriptors, and Sockets Section 15.6 socket System Call Section 15.7 getsock and sockargs Functions Section 15.8 bind System Call Section 15.9 listen System Call Section 15.10 tsleep and wakeup Functions Section 15.11 accept System Call Section 15.12 sonewconn and soisconnected Functions Section 15.13 connect System call Section 15.14 shutdown System Call Section 15.15 close System Call Section 15.16 Summary Chapter 16 Socket I/O Section 16.1 Introduction Section 16.2 Code Introduction Section 16.3 Socket Buffers Section 16.4 write, writev, sendto, and sendmsg System Calls Section 16.5 sendmsg System Call Section 16.6 sendit Function Section 16.7 sosend Function Section 16.8 read, readv, recvfrom, and recvmsg System Calls Section 16.9 recvmsg System Call Section 16.10 recvit Function Section 16.11 soreceive Function Section 16.12 soreceive Code Section 16.13 select System Call Section 16.14 Summary Chapter 17 Socket Options Section 17.1 Introduction Section 17.2 Code Introduction Section 17.3 setsockopt System Call Section 17.4 getsockopt System Call Section 17.5 fcntl and ioctl System Calls Section 17.6 getsockname System Call Section 17.7 getpeername System Call Section 17.8 Summary Chapter 18 Radix Tree Routing Tables Section 18.1 Introduction Section 18.2 Routing Table Structure Section 18.3 Routing Sockets Section 18.4 Code Introduction Section 18.5 Radix Node Data Structures Section 18.6 Routing Structures Section 18.7 Initialization: route_init and rtable_init Functions Section 18.8 Initialization: rn_init and rn_inithead Functions Section 18.9 Duplicate Keys and Mask Lists Section 18.10 rn_match Function Section 18.11 rn_search Function Section 18.12 Summary Chapter 19 Routing Requests and Routing Messages Section 19.1 Introduction Section 19.2 rtalloc and rtalloc1 Functions Section 19.3 RTFREE Macro and rtfree Function Section 19.4 rtrequest Function Section 19.5 rt_setgate Function Section 19.6 rtinit Function Section 19.7 rtredirect Function Section 19.8 Routing Message Structures Section 19.9 rt_missmsg Function Section 19.10 rt_ifmsg Function Section 19.11 rt_newaddrmsg Function Section 19.12 rt_msg1 Function Section 19.13 rt_msg2 Function Section 19.14 sysctl_rtable Function Section 19.15 sysctl_dumpentry Function Section 19.16 sysctl_iflist Function Section 19.17 Summary Chapter 20 Routing Sockets Section 20.1 Introduction Section 20.2 routedomain and protosw Structures Section 20.3 Routing Control Blocks Section 20.4 raw_init Function Section 20.5 route_output Function Section 20.6 rt_xaddrs Function Section 20.7 rt_setmetrics Function Section 20.8 raw_input Function Section 20.9 route_usrreq Function Section 20.10 raw_usrreq Function Section 20.11 raw_attach, raw_detach, and raw_disconnect Functions Section 20.12 Summary Chapter 21 ARP: Address Resolution Protocol Section 21.1 Introduction Section 21.2 ARP and the Routing Table Section 21.3 Code Introduction Section 21.4 ARP Structures Section 21.5 arpwhohas Function Section 21.6 arprequest Function Section 21.7 arpintr Function Section 21.8 in_arpinput Function Section 21.9 ARP Timer Functions Section 21.10 arpresolve Function Section 21.11 arplookup Function Section 21.12 Proxy ARP Section 21.13 arp_rtrequest Function Section 21.14 ARP and Multicasting Section 21.15 Summary Chapter 22 Protocol Control Blocks Section 22.1 Introduction Section 22.2 Code Introduction Section 22.3 inpcb Structure Section 22.4 in_pcballoc and in_pcbdetach Functions Section 22.5 Binding, Connecting, and Demultiplexing Section 22.6 in_pcblookup Function Section 22.7 in_pcbbind Function Section 22.8 in_pcbconnect Function Section 22.9 in_pcbdisconnect Function Section 22.10 in_setsockaddr and in_setpeeraddr Functions Section 22.11 in_pcbnotify, in_rtchange, and in_losing Functions Section 22.12 Implementation Refinements Section 22.13 Summary Chapter 23 UDP: User Datagram Protocol Section 23.1 Introduction Section 23.2 Code Introduction Section 23.3 UDP protosw Structure Section 23.4 UDP Header Section 23.5 udp_init Function Section 23.6 udp_output Function Section 23.7 udp_input Function Section 23.8 udp_saveopt Function Section 23.9 udp_ctlinput Function Section 23.10 udp_usrreq Function Section 23.11 udp_sysctl Function Section 23.12 Implementation Refinements Section 23.13 Summary Chapter 24 TCP: Transmission Control Protocol Section 24.1 Introduction Section 24.2 Code Introduction Section 24.3 TCP protosw Structure Section 24.4 TCP Header Section 24.5 TCP Control Block Section 24.6 TCP State Transition Diagram Section 24.7 TCP Sequence Numbers Section 24.8 tcp_init Function Section 24.9 Summary Chapter 25 TCP Timers Section 25.1 Introduction Section 25.2 Code Introduction Section 25.3 tcp_canceltimers Function Section 25.4 tcp_fasttimo Function Section 25.5 tcp_slowtimo Function Section 25.6 tcp_timers Function Section 25.7 Retransmission Timer Calculations Section 25.8 tcp_newtcpcb Function Section 25.9 tcp_setpersist Function Section 25.10 tcp_xmit_timer Function Section 25.11 Retransmission Timeout: tcp_timers Function Section 25.12 An RTT Example Section 25.13 Summary Chapter 26 TCP Output Section 26.1 Introduction Section 26.2 tcp_output Overview Section 26.3 Determine if a Segment Should be Sent Section 26.4 TCP Options Section 26.5 Window Scale Option Section 26.6 Timestamp Option Section 26.7 Send a Segment Section 26.8 tcp_template Function Section 26.9 tcp_respond Function Section 26.10 Summary Chapter 27 TCP Functions Section 27.1 Introduction Section 27.2 tcp_drain Function Section 27.3 tcp_drop Function http://www.noao.edu/~rstevens/tcplw-extensions.txt Braden, R T 1994 "T/TCPTCP Extensions for Transactions, Functional Specification," RFC 1644, 38 pages (July) Braden, R T., Borman, D A., and Partridge, C 1988 "Computing the Internet Checksum," RFC 1071, 24 pages (Sept.) Provides techniques and algorithms for calculating the checksum used by IP, ICMP, IGMP, UDP, and TCP Braden, R.T., and Postel, J B 1987 "Requirements for Internet Gateways," RFC 1009, 55 pages (June) The equivalent of the Host Requirements RFC for routers This RFC is being replaced by RFC 1716 [Almquist and Kastenholz 1994] Brakmo, L S., O'Malley, S W., and Peterson, L L 1994 "TCP Vegas: New Techniques for Congestion Detection and Avoidance," Computer Communication Review, vol 24, no 4, pp 2435 (Oct.) Describes modifications to the 4.3BSD Reno TCP implementation to improve throughput and reduce retransmissions ftp://ftp.cs.arizona.edu/xkernel/Papers/vegas.ps Carlson, J 1993 "Re: Bug in Many Versions of TCP," Message-ID , Usenet, comp.protocols.tcp-ip Newsgroup (July) Casner, S., Frequently Asked Questions (FAQ) on the Multicast Backbone (MBONE), 1993 ftp://ftp.isi.edu/mbone/faq.txt Cheswick, W R., and Bellovin, S M 1994 Firewalls and Internet Security: Repelling the Wily Hacker Addison-Wesley, Reading, Mass Describes how to set up and administer a firewall gateway and the security issues involved Clark, D D 1982 "Modularity and Efficiency in Protocol Implementation," RFC 817, 26 pages (July) Comer, D E., and Lin, J C 1994 "TCP Buffering and Performance Over an ATM Network," Purdue Technical Report CSD-TR 94-026, Purdue University, West Lafayette, Ind (Mar.) ftp://gwen.cs.purdue.edu/pub/lin/TCP.atm.ps.Z Comer, D E., and Stevens, D L 1993 Internetworking with TCP/IP: Vol III: ClientServer Programming and Applications, BSD Socket Version Prentice-Hall, Englewood Cliffs, N.J Croft, W., and Gilmore, J 1985 "Bootstrap Protocol (BOOTP)," RFC 951, 12 pages (Sept.) Crowcroft, J., Wakeman, I., Wang, Z., and Sirovica,D 1992 "Is Layering Harmful?," IEEE Network, vol 6, no 1, pp 2024 (Jan.) The seven missing figures from this paper appear in the next issue, vol 6, no 2 (March) Dalton, C., Watson, G., Banks, D., Calamvokis, C., Edwards, A., and Lumley, J 1993 "Afterburner," Network, vol 7, no 4, pp 3643 (July) Describes how to speed up TCP by reducing the number of data copies performed, and a specialpurpose interface card that supports this design Deering, S E 1989 "Host Extensions for IP Multicasting," RFC 1112, 17 pages (Aug.) The specification of IP multicasting and IGMP Deering, S E., ed 1991a "ICMP Router Discovery Messages," RFC 1256, 19 pages (Sept.) Deering, S E 1991b "Multicast Routing in a Datagram Internetwork," STAN-CS-92-1415, Stanford University, Palo Alto, Calif (Dec.) ftp://gregorio.stanford.edu/vmtpip/sdthesis.part1.ps.Z Deering, S E., and Cheriton, D P 1990 "Multicast Routing in Datagram Internetworks and Extended LANs," ACM Transactions on Computer Systems 8, no 2, pp 85110 (May) Proposes extensions to common routing techniques to support multicasting Deering, S., Estrin, D., Farinacci, D., Jacobson, V., Liu, C., and Wei, L 1994 "An Architecture for Wide-Area Multicast Routing," Computer Communication Review vol 24, no 4, pp 126135 (Oct.) Droms, R 1993 "Dynamic Host Configuration Protocol," RFC 1541, 39 pages (Oct.) Finlayson, R., Mann, T., Mogul, J C., and Theimer, M 1984 "A Reverse Address Resolution Protocol," 903, 4 pages (June) Floyd, S 1994 Private Communication Forgie, J 1979 "STA Proposed Internet Stream Protocol," IEN 119, MIT Lincoln Laboratory (Sept.) Fuller, V., Li, T., Yu, J Y., and Varadhan, K 1993 "Classless Inter-Domain Routing (CIDR): An Address Assignment and Aggregation Strategy," RFC 1519, 24 pages (Sept.) Hornig, C 1984 "Standard for the Transmission of IP Datagrams over Ethernet Networks," RFC 894, 3 pages (Apr.) Hutchinson, N C., and Peterson, L L 1991 "The xKernel: An Architecture for Implementing Network Protocols," IEEE Transactions on Software Engineering, vol 17, no 1, pp 6476 (Jan.) ftp://ftp.cs.arizona.edu/xkernel/Papers/architecture.ps Itano, W M., and Ramsey, N F 1993 "Accurate Measurement of Time," Scientific American, vol 269, p 56 (July) Overview of historical and current methods for accurate timekeeping Includes a short discussion of international time scales including International Atomic Time (TAI) and Coordinated Universal Time (UTC) Jacobson, V 1988a "Some Interim Notes on the BSD Network Speedup," Message-ID , Usenet, comp.protocols.tcp-ip Newsgroup (July) Jacobson, V 1988b "Congestion Avoidance and Control," Computer Communication Review, vol 18, no 4, pp 314329 (Aug.) A classic paper describing the slow start and congestion avoidance algorithms for TCP ftp://ftp.ee.lbl.gov/papers/congavoid.ps.Z Jacobson, V 1990a "Compressing TCP/IP Headers for Low-Speed Serial Links," RFC 1144, 43 pages (Feb.) Describes CSLIP, a version of SLIP with the TCP and IP headers compressed Jacobson, V 1990b "4BSD TCP Header Prediction," Computer Communication Review, vol 20, no 2, pp 1315 (Apr.) Jacobson, V 1990c "Modified TCP Congestion Avoidance Algorithm," April 30, 1990, end2endinterest mailing list (Apr.) Describes the fast retransmit and fast recovery algorithms ftp://ftp.isi.edu/end2end/end2end-interest-1990.mail Jacobson, V 1990d "Berkeley TCP Evolution from 4.3Tahoe to 4.3-Reno," Proceedings of the Eighteenth Internet Engineering Task Force, p 365 (Sept.), University of British Columbia, Vancouver, B.C Jacobson, V 1993 "Some Design Issues for HighSpeed Networks," Networkshop '93 (Nov.), Melbourne, Australia A set of 21 overheads ftp://ftp.ee.lbl.gov/talks/vj-nws93-1.ps.Z Jacobson, V., and Braden, R T 1988 "TCP Extensions for Long-Delay Paths," RFC 1072, 16 pages (Oct.) Describes the selective acknowledgment option for TCP, which was removed from the later RFC 1323, and the echo options, which were replaced with the timestamp option in RFC 1323 Jacobson, V., Braden, R T., and Borman, D A 1992 "TCP Extensions for High Performance," RFC 1323, 37 pages (May) Describes the window scale option, the timestamp option, and the PAWS algorithm, along with the reasons these modifications are needed [Braden 1993] updates this RFC Jain, R., and Routhier, S A 1986 "Packet Trains: Measurements and a New Model for Computer Network Traffic," IEEE Journal on Selected Areas in Communications, vol 4, pp 11621167 Karels, M J., and McKusick, M K 1986 "Network Performance and Management with 4.3BSD and IP/TCP," Proceedings of the 1986 Summer USENIX Conference, pp 182188, Atlanta, Ga Describes the changes made from 4.2BSD to 4.3BSD with regard to TCP/IP Karn, P., and Partridge, C 1987 "Improving Round- Trip Time Estimates in Reliable Transport Protocols," Computer Communication Review, vol 17, no 5, pp 27 (Aug.) Details of Karn's algorithm to handle the retransmission timeout for segments that have been retransmitted ftp://sics.se/users/craig/karn-partridge.ps Kay, J., and Pasquale, J 1993 "The Importance of Non-Data Touching Processing Overheads in TCP/IP," Computer Communication Review, vol 23, no 4, pp 259268 (Sept.) Kent, C A., and Mogul, J C 1987 "Fragmentation Considered Harmful," Computer Communication Review, vol 17, no 5, pp 390401 (Aug.) Kernighan, B W., and Plauger, P J 1976 Software Tools Addison-Wesley, Reading, Mass Krol, E 1994 The Whole Internet, Second Edition O'Reilly & Associates, Sebastopol, Calif An introduction into the Internet, common Internet applications, and various resources available on the Internet Krol, E., and Hoffman, E 1993 "FYI on 'What is the Internet?'," RFC 1462, 11 pages (May) Lanciani, D 1993 "Re: Bug in Many Versions of TCP," Message-ID , Usenet, comp.protocols.tcpip Newsgroup (July) Leffler, S J., McKusick, M K., Karels, M.J., and Quarterman, J S 1989 The Design and Implementation of the 4.3BSD UNIX Operating System Addison-Wesley, Reading, Mass An entire book on the 4.3BSD Unix system This book describes the Tahoe release of 4.3BSD Lynch, D C 1993 "Historical Perspective," in Internet System Handbook, eds D C Lynch and M T Rose, pp 314 Addison-Wesley, Reading, Mass A historical overview of the Internet and its precursor, the ARPANET Mallory, T., and Kullberg, A 1990 "Incremental Updating of the Internet Checksum," RFC 1141, 2 pages (Jan.) This RFC is updated by RFC 1624 [Rijsinghani 1994 Mano, M M 1993 Computer System Architecture, Third Edition Prentice-Hall, Englewood Cliffs, N.J McCanne, S., and Jacobson, V 1993 "The BSD Packet Filter: A New Architecture for User-Level Packet Capture," Proceedings of the 1993 Winter USENIX Conference, pp 259269, San Diego, Calif A detailed description of the BSD Packet Filter (BPF) and comparisons with Sun's Network Interface Tap (NIT) ftp://ftp.ee.lbl.gov/papers/bpf-usenix93.ps.Z McCloghrie, K., and Farinacci, D 1994a "Internet Group Management Protocol MIB," Internet Draft, 12 pages (Jul.) McCloghrie, K., and Farinacci, D 1994b "IP Multicast Routing MIB," Internet Draft, 15 pages (Jul.) McCloghrie, K., and Rose, M T 1991 "Management Information Base for Network Management of TCP/IPbased Internets: MIB-II," RFC 1213 (Mar.) McGregor, G 1992 "PPP Internet Protocol Control Protocol (IPCP)," RFC 1332, 12 pages (May) McKenney, P E., and Dove, K F 1992 "Efficient Demultiplexing of Incoming TCP Packets," Computer Communication Review, vol 22, no 4, pp 269279 (Oct.) Mogul, J C 1991 "Network Locality at the Scale of Processes," Computer Communication Review, vol 21, no 4, pp 273284 (Sept.) Mogul, J.C 1993 "IP Network Performance," in Internet System Handbook, eds D C Lynch and M T Rose, pp 575675 Addison-Wesley, Reading, Mass Covers numerous topics in the Internet protocols that are candidates for tuning to obtain optimal performance Mogul, J C., and Deering, S E 1990 "Path MTU Discovery," RFC 1191, 19 pages (Apr.) Mogul, J C., and Postel, J B 1985 "Internet Standard Subnetting Procedure," RFC 950, 18 pages (Aug.) Moy, J 1994 "Multicast Extensions to OSPF," RFC 1584, 102 pages (Mar.) Olivier, G 1994 "What is the Diameter of the Internet?," Message-ID , Usenet, comp.unix.wizards Newsgroup (Jan.) Partridge, C 1987 "Implementing the Reliable Data Protocol (RDP)," Proceedings of the 1987 Summer USENIX Conference, pp 367379, Phoenix, Ariz Partridge, C 1993 "Jacobson on TCP in 30 Instructions," Message-ID , Usenet, comp.protocols.tcp-ip Newsgroup (Sept.) Describes a research implementation of TCP/IP being developed by Van Jacobson that reduces TCP receive packet processing down to 30 instructions on a RISC system http://www.kohala.com/~rstevens/vanj.93sep07.txt Partridge, C., and Hinden, R 1990 "Version 2 of the Reliable Data Protocol (RDP)," RFC 1151, 4 pages (Apr.) Partridge, C., Mendez, T., and Milliken, W 1993 Anycasting Service," RFC 1546, 9 pages (Nov.) Partridge, C., and Pink, S 1993 "A Faster UDP," IEEE/ACM Transactions on Networking, vol 1, no 4, pp 429440 (Aug.) Describes implementation improvements to the Berkeley sources to speed up UDP performance about 30% Paxson, V 1994 Private Communication Perlman, R 1992 Interconnections: Bridges and Routers Addison-Wesley, Reading, Mass Piscitello, D M., and Chapin, A L 1993 Open Systems Networking: TCP/IP and OSI AddisonWesley, Reading, Mass Plummer, D C 1982 "An Ethernet Address Resolution Protocol," RFC 826, 10 pages (Nov.) Postel, J B., ed 1981a "Internet Protocol," RFC 791, 45 pages (Sept.) Postel, J B 1981b "Internet Control Message Protocol," RFC 792, 21 pages (Sept.) Postel, J B., ed 1981c "Transmission Control Protocol," RFC 793, 85 pages (Sept.) Postel, J B 1981d "Service Mappings," RFC 795, 4 pages (Sept.) Postel, J B., and Reynolds, J K 1988 "Standard for the Transmission of IP Datagrams over IEEE 802 Networks," RFC 1042, 15 pages (Apr.) Rago, S A 1993 UNIX System V Network Programming Addison-Wesley, Reading, Mass Reynolds, J K., and Postel, J B 1994 "Assigned Numbers," RFC 1700, 230 pages (Oct.) Rijsinghani, A 1994 "Computation of the Internet Checksum via Incremental Update," RFC 1624, 6 pages (May) An update to RFC 1141 [Mallory and Kullberg 1990 Romkey, J L 1988 "A Nonstandard for Transmission of IP Datagrams Over Serial Lines: SLIP," RFC 1055, 6 pages (June) Rose, M T 1990 The Open Book: A Practical Perspective on OSI Prentice-Hall, Englewood Cliffs, N.J Salus, P H 1994 A Quarter Century of Unix AddisonWesley, Reading, Mass Sedgewick, R 1990 Algorithms in C Addison-Wesley, Reading, Mass Simpson, W.A 1993 "The Point-to-Point Protocol (PPP)," RFC 1548, 53 pages (Dec.) Sklower, K 1991 "A Tree-Based Packet Routing Table for Berkeley Unix," Proceedings of the 1991 Winter USENIX Conference, pp 9399, Dallas, Tex Stallings, W 1987 Handbook of ComputerCommunications Standards, Volume 2: Local Network Standards Macmillan, New York Stallings, W 1993 Networking Standards: A Guide to OSI, ISDN, LAN, and MAN Standards Addison-Wesley, Reading, Mass Stevens, W R 1990 UNIX Network Programming Prentice-Hall, Englewood Cliffs, N.J Stevens, W R 1992 Advanced Programming in the UNIX Environment Addison-Wesley, Reading, Mass Stevens, W R 1994 TCP/IP Illustrated, Volume 1: The Protocols Addison-Wesley, Reading, Mass The first volume in this series, which provides a complete introduction to the Internet protocols Tanenbaum, A S 1989 Computer Networks, Second Edition Prentice-Hall, Englewood Cliffs, N.J Topolcic, C 1990 "Experimental Stream Protocol, Version 2 (SY-II)," RFC 1190, 148 pages (Oct.) Torek, C 1992 "Re: A Problem in Bind System Call," Message-ID , Usenet, comp.unix.internals Newsgroup (Nov.) Waitzman, D., Partridge, C., Deering, S E 1988 "Distance Vector Multicast Routing Protocol," RFC 1075, 24 pages (Nov.) Team-Fly ... Protocol Control Blocks Section 22 .1 Introduction Section 22 .2 Code Introduction Section 22 .3 inpcb Structure Section 22 .4 in_pcballoc and in_pcbdetach Functions Section 22 .5 Binding, Connecting, and Demultiplexing... 004.6 '2 9340000 ISBN 0 -20 1-63346-9 (v.l) ISBN 0 -20 1-63354-X (v .2) The BSD Daemon used on the cover of this book is reproduced with the permission of Marshall Kirk McKusick Copyright © 1995 by Addison- Wesley. .. Binding, Connecting, and Demultiplexing Section 22 .6 in_pcblookup Function Section 22 .7 in_pcbbind Function Section 22 .8 in_pcbconnect Function Section 22 .9 in_pcbdisconnect Function Section 22 .10 in_setsockaddr and in_setpeeraddr Functions

Ngày đăng: 26/03/2019, 16:00

Từ khóa liên quan

Mục lục

  • Main Page

  • Table of Contents

  • Copyright

  • Preface

    • Introduction

    • Organization of the Book

    • Intended Audience

    • Source Code Copyright

    • Acknowledgments

  • Chapter 1. Introduction

    • 1.1 Introduction

    • 1.2 Source Code Presentation

    • 1.3 History

    • 1.4 Application Programming Interfaces

    • 1.5 Example Program

    • 1.6 System Calls and Library Functions

    • 1.7 Network Implementation Overview

    • 1.8 Descriptors

    • 1.9 Mbufs (Memory Buffers) and Output Processing

    • 1.10 Input Processing

    • 1.11 Network Implementation Overview Revisited

    • 1.12 Interrupt Levels and Concurrency

    • 1.13 Source Code Organization

    • 1.14 Test Network

    • 1.15 Summary

  • Chapter 2. Mbufs: Memory Buffers

    • 2.1 Introduction

    • 2.2 Code Introduction

    • 2.3 Mbuf Definitions

    • 2.4 mbuf Structure

    • 2.5 Simple Mbuf Macros and Functions

    • 2.6 m_devget and m_pullup Functions

    • 2.7 Summary of Mbuf Macros and Functions

    • 2.8 Summary of Net/3 Networking Data Structures

    • 2.9 m_copy and Cluster Reference Counts

    • 2.10 Alternatives

    • 2.11 Summary

  • Chapter 3. Interface Layer

    • 038 - 3.1 Introduction

    • 039 - 3.2 Code Introduction

    • 040 - 3.3 ifnet Structure

    • 041 - 3.4 ifaddr Structure

    • 042 - 3.5 sockaddr Structure

    • 043 - 3.6 ifnet and ifaddr Specialization

    • 044 - 3.7 Network Initialization Overview

    • 045 - 3.8 Ethernet Initialization

    • 046 - 3.9 SLIP Initialization

    • 047 - 3.10 Loopback Initialization

    • 048 - 3.11 if_attach Function

    • 049 - 3.12 ifinit Function

    • 050 - 3.13 Summary

  • Chapter 4. Interfaces: Ethernet

    • 4.1 Introduction

    • 4.2 Code Introduction

    • 4.3 Ethernet Interface

    • 4.4 ioctl System Call

    • 4.5 Summary

  • Chapter 5. Interfaces: SLIP and Loopback

    • 5.1 Introduction

    • 5.2 Code Introduction

    • 5.3 SLIP Interface

    • 5.4 Loopback Interface

    • 5.5 Summary

  • Chapter 6. IP Addressing

    • 6.1 Introduction

    • 6.2 Code Introduction

    • 6.3 Interface and Address Summary

    • 6.4 sockaddr_in Structure

    • 6.5 in_ifaddr Structure

    • 6.6 Address Assignment

    • 6.7 Interface ioctl Processing

    • 6.8 Internet Utility Functions

    • 6.9 ifnet Utility Functions

    • 6.10 Summary

  • Chapter 7. Domains and Protocols

    • 7.1 Introduction

    • 7.2 Code Introduction

    • 7.3 domain Structure

    • 7.4 protosw Structure

    • 7.5 IP domain and protosw Structures

    • 7.6 pffindproto and pffindtype Functions

    • 7.7 pfctlinput Function

    • 7.8 IP Initialization

    • 7.9 sysctl System Call

    • 7.10 Summary

  • Chapter 8. IP: Internet Protocol

    • 8.1 Introduction

    • 8.2 Code Introduction

    • 8.3 IP Packets

    • 8.4 Input Processing: ipintr Function

    • 8.5 Forwarding: ip_forward Function

    • 8.6 Output Processing: ip_output Function

    • 8.7 Internet Checksum: in_cksum Function

    • 8.8 setsockopt and getsockopt System Calls

    • 8.9 ip_sysctl Function

    • 8.10 Summary

  • Chapter 9. IP Option Processing

    • 9.1 Introduction

    • 9.2 Code Introduction

    • 9.3 Option Format

    • 9.4 ip_dooptions Function

    • 9.5 Record Route Option

    • 9.6 Source and Record Route Options

    • 9.7 Timestamp Option

    • 9.8 ip_insertoptions Function

    • 9.9 ip_pcbopts Function

    • 9.10 Limitations

    • 9.11 Summary

  • Chapter 10. IP Fragmentation and Reassembly

    • 10.1 Introduction

    • 10.2 Code Introduction

    • 10.3 Fragmentation

    • 10.4 ip_optcopy Function

    • 10.5 Reassembly

    • 10.6 ip_reass Function

    • 10.7 ip_slowtimo Function

    • 10.8 Summary

  • Chapter 11. ICMP: Internet Control Message Protocol

    • 11.1 Introduction

    • 11.2 Code Introduction

    • 11.3 icmp Structure

    • 11.4 ICMP protosw Structure

    • 11.5 Input Processing: icmp_input Function

    • 11.6 Error Processing

    • 11.7 Request Processing

    • 11.8 Redirect Processing

    • 11.9 Reply Processing

    • 11.10 Output Processing

    • 11.11 icmp_error Function

    • 11.12 icmp_reflect Function

    • 11.13 icmp_send Function

    • 11.14 icmp_sysctl Function

    • 11.15 Summary

  • Chapter 12. IP Multicasting

    • 12.1 Introduction

    • 12.2 Code Introduction

    • 12.3 Ethernet Multicast Addresses

    • 12.4 ether_multi Structure

    • 12.5 Ethernet Multicast Reception

    • 12.6 in_multi Structure

    • 12.7 ip_moptions Structure

    • 12.8 Multicast Socket Options

    • 12.9 Multicast TTL Values

    • 12.10 ip_setmoptions Function

    • 12.11 Joining an IP Multicast Group

    • 12.12 Leaving an IP Multicast Group

    • 12.13 ip_getmoptions Function

    • 12.14 Multicast Input Processing: ipintr Function

    • 12.15 Multicast Output Processing: ip_output Function

    • 12.16 Performance Considerations

    • 12.17 Summary

  • Chapter 13. IGMP: Internet Group Management Protocol

    • 13.1 Introduction

    • 13.2 Code Introduction

    • 13.3 igmp Structure

    • 13.4 IGMP protosw Structure

    • 13.5 Joining a Group: igmp_joingroup Function

    • 13.6 igmp_fasttimo Function

    • 13.7 Input Processing: igmp_input Function

    • 13.8 Leaving a Group: igmp_leavegroup Function

    • 13.9 Summary

  • Chapter 14. IP Multicast Routing

    • 14.1 Introduction

    • 14.2 Code Introduction

    • 14.3 Multicast Output Processing Revisited

    • 14.4 mrouted Daemon

    • 14.5 Virtual Interfaces

    • 14.6 IGMP Revisited

    • 14.7 Multicast Routing

    • 14.8 Multicast Forwarding: ip_mforward Function

    • 14.9 Cleanup: ip_mrouter_done Function

    • 14.10 Summary

  • Chapter 15. Socket Layer

    • 15.1 Introduction

    • 15.2 Code Introduction

    • 15.3 socket Structure

    • 15.4 System Calls

    • 15.5 Processes, Descriptors, and Sockets

    • 15.6 socket System Call

    • 15.7 getsock and sockargs Functions

    • 15.8 bind System Call

    • 15.9 listen System Call

    • 15.10 tsleep and wakeup Functions

    • 15.11 accept System Call

    • 15.12 sonewconn and soisconnected Functions

    • 15.13 connect System call

    • 15.14 shutdown System Call

    • 15.15 close System Call

    • 15.16 Summary

  • Chapter 16. Socket I/O

    • 16.1 Introduction

    • 16.2 Code Introduction

    • 16.3 Socket Buffers

    • 16.4 write, writev, sendto, and sendmsg System Calls

    • 16.5 sendmsg System Call

    • 16.6 sendit Function

    • 16.7 sosend Function

    • 16.8 read, readv, recvfrom, and recvmsg System Calls

    • 16.9 recvmsg System Call

    • 16.10 recvit Function

    • 16.11 soreceive Function

    • 16.12 soreceive Code

    • 16.13 select System Call

    • 16.14 Summary

  • Chapter 17. Socket Options

    • 17.1 Introduction

    • 17.2 Code Introduction

    • 17.3 setsockopt System Call

    • 17.4 getsockopt System Call

    • 17.5 fcntl and ioctl System Calls

    • 17.6 getsockname System Call

    • 17.7 getpeername System Call

    • 17.8 Summary

  • Chapter 18. Radix Tree Routing Tables

    • 18.1 Introduction

    • 18.2 Routing Table Structure

    • 18.3 Routing Sockets

    • 18.4 Code Introduction

    • 18.5 Radix Node Data Structures

    • 18.6 Routing Structures

    • 18.7 Initialization: route_init and rtable_init Functions

    • 18.8 Initialization: rn_init and rn_inithead Functions

    • 18.9 Duplicate Keys and Mask Lists

    • 18.10 rn_match Function

    • 18.11 rn_search Function

    • 18.12 Summary

  • Chapter 19. Routing Requests and Routing Messages

    • 19.1 Introduction

    • 19.2 rtalloc and rtalloc1 Functions

    • 19.3 RTFREE Macro and rtfree Function

    • 19.4 rtrequest Function

    • 19.5 rt_setgate Function

    • 19.6 rtinit Function

    • 19.7 rtredirect Function

    • 19.8 Routing Message Structures

    • 19.9 rt_missmsg Function

    • 19.10 rt_ifmsg Function

    • 19.11 rt_newaddrmsg Function

    • 19.12 rt_msg1 Function

    • 19.13 rt_msg2 Function

    • 19.14 sysctl_rtable Function

    • 19.15 sysctl_dumpentry Function

    • 19.16 sysctl_iflist Function

    • 19.17 Summary

  • Chapter 20. Routing Sockets

    • 20.1 Introduction

    • 20.2 routedomain and protosw Structures

    • 20.3 Routing Control Blocks

    • 20.4 raw_init Function

    • 20.5 route_output Function

    • 20.6 rt_xaddrs Function

    • 20.7 rt_setmetrics Function

    • 20.8 raw_input Function

    • 20.9 route_usrreq Function

    • 20.10 raw_usrreq Function

    • 20.11 raw_attach, raw_detach, and raw_disconnect Functions

    • 20.12 Summary

  • Chapter 21. ARP: Address Resolution Protocol

    • 21.1 Introduction

    • 21.2 ARP and the Routing Table

    • 21.3 Code Introduction

    • 21.4 ARP Structures

    • 21.5 arpwhohas Function

    • 21.6 arprequest Function

    • 21.7 arpintr Function

    • 21.8 in_arpinput Function

    • 21.9 ARP Timer Functions

    • 21.10 arpresolve Function

    • 21.11 arplookup Function

    • 21.12 Proxy ARP

    • 21.13 arp_rtrequest Function

    • 21.14 ARP and Multicasting

    • 21.15 Summary

  • Chapter 22. Protocol Control Blocks

    • 22.1 Introduction

    • 22.2 Code Introduction

    • 22.3 inpcb Structure

    • 22.4 in_pcballoc and in_pcbdetach Functions

    • 22.5 Binding, Connecting, and Demultiplexing

    • 22.6 in_pcblookup Function

    • 22.7 in_pcbbind Function

    • 22.8 in_pcbconnect Function

    • 22.9 in_pcbdisconnect Function

    • 22.10 in_setsockaddr and in_setpeeraddr Functions

    • 22.11 in_pcbnotify, in_rtchange, and in_losing Functions

    • 22.12 Implementation Refinements

    • 22.13 Summary

  • Chapter 23. UDP: User Datagram Protocol

    • 23.1 Introduction

    • 23.2 Code Introduction

    • 23.3 UDP protosw Structure

    • 23.4 UDP Header

    • 23.5 udp_init Function

    • 23.6 udp_output Function

    • 23.7 udp_input Function

    • 23.8 udp_saveopt Function

    • 23.9 udp_ctlinput Function

    • 23.10 udp_usrreq Function

    • 23.11 udp_sysctl Function

    • 23.12 Implementation Refinements

    • 23.13 Summary

  • Chapter 24. TCP: Transmission Control Protocol

    • 24.1 Introduction

    • 24.2 Code Introduction

    • 24.3 TCP protosw Structure

    • 24.4 TCP Header

    • 24.5 TCP Control Block

    • 24.6 TCP State Transition Diagram

    • 24.7 TCP Sequence Numbers

    • 24.8 tcp_init Function

    • 24.9 Summary

  • Chapter 25. TCP Timers

    • 25.1 Introduction

    • 25.2 Code Introduction

    • 25.3 tcp_canceltimers Function

    • 25.4 tcp_fasttimo Function

    • 25.5 tcp_slowtimo Function

    • 25.6 tcp_timers Function

    • 25.7 Retransmission Timer Calculations

    • 25.8 tcp_newtcpcb Function

    • 25.9 tcp_setpersist Function

    • 25.10 tcp_xmit_timer Function

    • 25.11 Retransmission Timeout: tcp_timers Function

    • 25.12 An RTT Example

    • 25.13 Summary

  • Chapter 26. TCP Output

    • 26.1 Introduction

    • 26.2 tcp_output Overview

    • 26.3 Determine if a Segment Should be Sent

    • 26.4 TCP Options

    • 26.5 Window Scale Option

    • 26.6 Timestamp Option

    • 26.7 Send a Segment

    • 26.8 tcp_template Function

    • 26.9 tcp_respond Function

    • 26.10 Summary

  • Chapter 27. TCP Functions

    • 27.1 Introduction

    • 27.2 tcp_drain Function

    • 27.3 tcp_drop Function

    • 27.4 tcp_close Function

    • 27.5 tcp_mss Function

    • 27.6 tcp_ctlinput Function

    • 27.7 tcp_notify Function

    • 27.8 tcp_quench Function

    • 27.9 TCP_REASS Macro and tcp_reass Function

    • 27.10 tcp_trace Function

    • 27.11 Summary

  • Chapter 28. TCP Input

    • 28.1 Introduction

    • 28.2 Preliminary Processing

    • 28.3 tcp_dooptions Function

    • 28.4 Header Prediction

    • 28.5 TCP Input: Slow Path Processing

    • 28.6 Initiation of Passive Open, Completion of Active Open

    • 28.7 PAWS: Protection Against Wrapped Sequence Numbers

    • 28.8 Trim Segment so Data is Within Window

    • 28.9 Self-Connects and Simultaneous Opens

    • 28.10 Record Timestamp

    • 28.11 RST Processing

    • 28.12 Summary

  • Chapter 29. TCP Input (Continued)

    • 29.1 Introduction

    • 29.2 ACK Processing Overview

    • 29.3 Completion of Passive Opens and Simultaneous Opens

    • 29.4 Fast Retransmit and Fast Recovery Algorithms

    • 29.5 ACK Processing

    • 29.6 Update Window Information

    • 29.7 Urgent Mode Processing

    • 29.8 tcp_pulloutofband Function

    • 29.9 Processing of Received Data

    • 29.10 FIN Processing

    • 29.11 Final Processing

    • 29.12 Implementation Refinements

    • 29.13 Header Compression

    • 29.14 Summary

  • Chapter 30. TCP User Requests

    • 30.1 Introduction

    • 30.2 tcp_usrreq Function

    • 30.3 tcp_attach Function

    • 30.4 tcp_disconnect Function

    • 30.5 tcp_usrclosed Function

    • 30.6 tcp_ctloutput Function

    • 30.7 Summary

  • Chapter 31. BPF: BSD Packet Filter

    • 31.1 Introduction

    • 31.2 Code Introduction

    • 31.3 bpf_if Structure

    • 31.4 bpf_d Structure

    • 31.5 BPF Input

    • 31.6 BPF Output

    • 31.7 Summary

  • Chapter 32. Raw IP

    • 32.1 Introduction

    • 32.2 Code Introduction

    • 32.3 Raw IP protosw Structure

    • 32.4 rip_init Function

    • 32.5 rip_input Function

    • 32.6 rip_output Function

    • 32.7 rip_usrreq Function

    • 32.8 rip_ctloutput Function

    • 32.9 Summary

  • Epilogue

  • Appendix A. Solutions to Selected Exercises

    • Chapter 01

    • Chapter 02

    • Chapter 03

    • Chapter 04

    • Chapter 05

    • Chapter 06

    • Chapter 07

    • Chapter 08

    • Chapter 09

    • Chapter 10

    • Chapter 11

    • Chapter 12

    • Chapter 13

    • Chapter 14

    • Chapter 15

    • Chapter 16

    • Chapter 17

    • Chapter 18

    • Chapter 19

    • Chapter 20

    • Chapter 21

    • Chapter 22

    • Chapter 23

    • Chapter 24

    • Chapter 25

    • Chapter 26

    • Chapter 27

    • Chapter 28

    • Chapter 29

    • Chapter 30

    • Chapter 31

    • Chapter 32

  • Appendix B. Source Code Availability

    • URLs: Uniform Resource Locators

    • 4.4BSD-Lite

    • Operating Systems that Run the 4.4BSD-Lite Networking Software

    • RFCs

    • GNU Software

    • PPP Software

    • mrouted Software

    • ISODE Software

  • Appendix C. RFC 1122 Compliance

    • C.1 Link-Layer Requirements

    • C.2 IP Requirements

    • C.3 IP Options Requirements

    • C.4 IP Fragmentation and Reassembly Requirements

    • C.5 ICMP Requirements

    • C.6 Multicasting Requirements

    • C.7 IGMP Requirements

    • C.8 Routing Requirements

    • C.9 ARP Requirements

    • C.10 UDP Requirements

    • C.11 TCP Requirements

  • Bibliography

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan