TCP/IP详解 卷2 实现(英文版)

TCP/IP详解 卷2 实现(英文版) pdf epub mobi txt 电子书 下载 2025

[美] 加里·R.赖特(Gary R.Wright),[美] 理查德·史蒂文斯(W.Richard Stevens) 著
图书标签:
  • TCP/IP
  • 网络协议
  • 网络编程
  • 操作系统
  • 计算机网络
  • 协议分析
  • 数据通信
  • 网络安全
  • Unix
  • Linux
想要找书就要到 新城书站
立刻按 ctrl+D收藏本页
你会得到大惊喜!!
出版社: 人民邮电出版社
ISBN:9787115401281
版次:1
商品编码:11862011
品牌:异步图书
包装:平装
开本:16开
出版时间:2016-01-01
用纸:胶版纸
页数:1131
正文语种:英文版

具体描述

编辑推荐

  1. 网络专家W. Richard Stevens的传世之作。
  2. TCP/IP领域的不朽经典。
  3. 任何TCP/IP领域技术人员不可或缺的案头书。
  4. 提供大量TCP/IP协议实现代码。
  《TCP/IP详解》是已故网络专家、技术作家W. Richard Stevens的传世之作,内容详尽,被誉为TCP/IP领域的不朽名著。
  本书是《TCP/IP详解》三卷本的第2卷,重点关注TCP/IP协议的实现问题。书中介绍了一个实际的TCP/IP实现,并给出了这一实现的完整源代码,大约有15 000行C代码。此外,几乎每章都提供精选的习题,并在附录中提供了部分习题的答案。
  这一卷要求读者对TCP/IP协议的工作原理以及操作系统原理有初步的了解。对TCP/IP协议不是很熟悉的读者应先阅读《TCP/IP详解》的第1卷,该书对TCP/IP协议族有比较透彻的描述。

内容简介

  本书是TCP/IP领域的经典之作!书中完整而详细地介绍了TCP/IP协议是如何实现的。本书介绍了一个实际的TCP/IP实现,并给出了这一实现的完整源代码,帮助读者全面掌握TCP/IP的实现。本书内容详尽,几乎每章都提供精选的习题,并在附录中提供了部分习题的答案。

作者简介

  Gary R. Wright,研究TCP/IP多年。他是Connix公司的董事长,Connix公司主要提供Internet接入和咨询服务。

  W. Richard Stevens(1951—1999),国际知名的UNIX和网络专家,备受赞誉的技术作家。生前著有《TCP/IP详解》(三卷)、《UNIX环境高级编程》和《UNIX网络编程》(两卷),均为不朽的经典著作。

目录

Chapter 1. Introduction/概述    1
1.1 Introduction / 概述 1
1.2 Source Code Presentation / 源代码表示 1
1.3 History / 历史 3
1.4 Application Programming Interfaces / 应用编程接口 5
1.5 Example Program / 示例程序 5
1.6 System Calls and Library Functions / 系统调用和库函数 7
1.7 Network Implementation Overview / 网络实现概述 9
1.8 Descriptors / 描述符 10
1.9 Mbufs (Memory Buffers) and Output Processing / Mbuf与输出处理 15
1.10 Input Processing / 输入处理 19
1.11 Network Implementation Overview Revisited / 网络实现概述(续) 22
1.12 Interrupt Levels and Concurrency / 中断级别与并发 23
1.13 Source Code Organization / 源代码组织 26
1.14 Test Network / 测试网络 28
1.15 Summary / 小结 29

Chapter 2. Mbufs: Memory Buffers / Mbuf:存储器缓冲区 31
2.1 Introduction / 概述 31
2.2 Code Introduction / 代码介绍 36
2.3 Mbuf Definitions / Mbuf定义 37
2.4 mbuf Structure / mbuf结构 38
2.5 Simple Mbuf Macros and Functions / 简单的Mbuf宏和函数 40
2.6 m_devget and m_pullup Functions / m_devget和m_pullup函数 44
2.7 Summary of Mbuf Macros and Functions / Mbuf宏和函数小结 51
2.8 Summary of Net/3 Networking Data Structures / Nef/3联网数据结构小结 54
2.9 m_copy and Cluster Reference Counts / m_copy和簇引用计数 56
2.10 Alternatives / 其他选择 60
2.11 Summary / 小结 60

Chapter 3. Interface Layer / 接口层 63
3.1 Introduction / 概述 63
3.2 Code Introduction / 代码介绍 64
3.3 ifnet Structure / ifnet结构 65
3.4 ifaddr Structure / ifaddr结构 73
3.5 sockaddr Structure / sockaddr结构 74
3.6 ifnet and ifaddr Specialization / ifnet和ifaddr专用化 76
3.7 Network Initialization Overview / 网络初始化概述 77
3.8 Ethernet Initialization / 以太网初始化 80
3.9 SLIP Initialization / SLIP初始化 82
3.10 Loopback Initialization / 环回初始化 85
3.11 if_attach Function / if_attach函数 85
3.12 ifinit Function / ifinit函数 93
3.13 Summary / 小结 94

Chapter 4. Interfaces: Ethernet / 接口:以太网95
4.1 Introduction / 概述 95
4.2 Code Introduction / 代码介绍 96
4.3 Ethernet Interface / 以太网接口 98
4.4 ioctl System call / ioctl系统调用 114
4.5 Summary / 小结 125

Chapter 5. Interfaces: SLIP and Loopback / 接口:SLIP和环回127
5.1 Introduction / 概述 127
5.2 Code Introduction / 代码介绍 127
5.3 SLIP Interface / SLIP接口 128
5.4 Loopback Interface / 环回接口 150
5.5 Summary / 小结 153

Chapter 6. IP Addressing / IP编址 155
6.1 Introduction / 概述 155
6.2 Code Introduction / 代码介绍 158
6.3 Interface and Address Summary / 接口和地址小结 158
6.4 sockaddr_in Structure / sockaddr_in结构 160
6.5 in_ifaddr Structure / in_ifaddr结构 161
6.6 Address Assignment / 地址指派 161
6.7 Interface ioctl Processing / 接口ioctl处理 177
6.8 Internet Utility Functions / Internet实用函数 181
6.9 ifnet Utility Functions / ifnet实用函数 182
6.10 Summary / 小结 183

Chapter 7. Domains and Protocols / 域和协议185
7.1 Introduction / 概述 185
7.2 Code Introduction / 代码介绍 186
7.3 domain Structure / domain结构 187
7.4 protosw Structure / protosw结构 188
7.5 IP domain and protosw Structures / IP的domain和protosw结构 191
7.6 pffindproto and pffindtype Functions / pffindproto和pffindtype函数 196
7.7 pfctlinput Function / pfctlinput函数 198
7.8 IP Initialization / IP初始化 199
7.9 sysctl System call / sysctl系统调用 201
7.10 Summary / 小结 204

Chapter 8. IP: Internet Protocol / IP:网际协议 205
8.1 Introduction / 概述 205
8.2 Code Introduction / 代码介绍 206
8.3 IP Packets / IP分组 210
8.4 Input Processing: ipintr Function / 输入处理:ipintr函数 212
8.5 Forwarding: ip_forward Function / 转发:ip_forward函数 220
8.6 Output Processing: ip_output Function / 输出处理:ip_output函数 228
8.7 Internet Checksum: in_cksum Function / Internet检验和:in_cksum函数 234
8.8 setsockopt and getsockopt System calls / setsockopt和getsockopt系统调用 239
8.9 ip_sysctl Function / ip_sysctl函数 244
8.10 Summary / 小结 245

Chapter 9. IP Option Processing / IP选项处理247
9.1 Introduction / 概述 247
9.2 Code Introduction / 代码介绍 247
9.3 Option Format / 选项格式 248
9.4 ip_dooptions Function / ip_dooptions函数 249
9.5 Record Route Option / 记录路由选项 252
9.6 Source and Record Route Options / 源站和记录路由选项254
9.7 Timestamp Option / 时间戳选项 261
9.8 ip_insertoptions Function / ip_insertoptions函数 265
9.9 ip_pcbopts Function / ip_pcbopts函数 269
9.10 Limitations / 一些限制 272
9.11 Summary / 小结 272

Chapter 10. IP Fragmentation and Reassembly / IP分片与重装275
10.1 Introduction / 概述 275
10.2 Code Introduction / 代码介绍 277
10.3 Fragmentation / 分片278
10.4 ip_optcopy Function / ip_optcopy函数 282
10.5 Reassembly / 重装 283
10.6 ip_reass Function / ip_reass函数 286
10.7 ip_slowtimo Function / ip_slowtimo函数 298
10.8 Summary / 小结 300

Chapter 11. ICMP: Internet Control Message Protocol / ICMP:因特网控制消息协议301
11.1 Introduction / 概述 301
11.2 Code Introduction / 代码介绍 305
11.3 icmp Structure / icmp结构308
11.4 ICMP protosw Structure / ICMP的protosw结构309
11.5 Input Processing: icmp_input Function / 输入处理:icmp_input函数 310
11.6 Error Processing / 错误处理313
11.7 Request Processing / 请求处理316
11.8 Redirect Processing / 重定向处理321
11.9 Reply Processing / 回答处理323
11.10 Output Processing / 输出处理324
11.11 icmp_error Function / icmp_error函数 324
11.12 icmp_reflect Function / icmp_reflect函数 328
11.13 icmp_send Function / icmp_send函数 333
11.14 icmp_sysctl Function / icmp_sysctl函数 334
11.15 Summary / 小结 335

Chapter 12. IP Multicasting / IP多播337
12.1 Introduction / 概述 337
12.2 Code Introduction / 代码介绍 340
12.3 Ethernet Multicast Addresses / 以太网多播地址 341
12.4 ether_multi Structure / ether_multi结构342
12.5 Ethernet Multicast Reception / 以太网多播接收344
12.6 in_multi Structure / in_multi 结构345
12.7 ip_moptions Structure / ip_moptions结构 347
12.8 Multicast Socket Options / 多播的套接字选项 348
12.9 Multicast TTL Values / 多播的TTL值348
12.10 ip_setmoptions Function / ip_setmoptions函数 351
12.11 Joining an IP Multicast Group / 加入一个IP多播组355
12.12 Leaving an IP Multicast Group / 离开一个IP多播组366
12.13 ip_getmoptions Function / ip_getmoptions函数 371
12.14 Multicast Input Processing: ipintr Function / 多播输入处理:ipintr函数 373
12.15 Multicast Output Processing: ip_output Function / 多播输出处理:ip_output函数 375
12.16 Performance Considerations / 性能的考虑379
12.17 Summary / 小结 379

Chapter 13. IGMP: Internet Group Management Protocol / Intemet组管理协议381
13.1 Introduction / 概述 381
13.2 Code Introduction / 代码介绍 382
13.3 igmp Structure / igmp结构 384
13.4 IGMP protosw Structure / IGMP的protosw结构 384
13.5 Joining a Group: igmp_joingroup Function / 加入一个组:igmp_joingroup函数 386
13.6 igmp_fasttimo Function / igmp_fasttimo函数 387
13.7 Input Processing: igmp_input Function / 输入处理:igmp_input函数 391
13.8 Leaving a Group: igmp_leavegroup Function / 离开一个组:igmp_leavegroup函数 395
13.9 Summary / 小结 396

Chapter 14. IP Multicast Routing / IP多播选路 397
14.1 Introduction / 概述397
14.2 Code Introduction / 代码介绍398
14.3 Multicast Output Processing Revisited / 多播输出处理(续) 399
14.4 mrouted Daemon / mrouted守护进程 401
14.5 Virtual Interfaces / 虚拟接口 404
14.6 IGMP Revisited / IGMP(续) 411
14.7 Multicast Routing / 多播选路 416
14.8 Multicast Forwarding: ip_mforward Function / 多播转发:ip_mforward函数 424
14.9 Cleanup: ip_mrouter_done Function / 清理:ip_mrouter_done函数 433
14.10 Summary / 小结 434

Chapter 15. Socket Layer / 套接字层 435
15.1 Introduction / 概述435
15.2 Code Introduction / 代码介绍436
15.3 socket Structure / socket结构 437
15.4 System Calls / 系统调用 441
15.5 Processes, Descriptors, and Sockets / 进程、描述符和套接字 445
15.6 socket System Call / socket系统调用447
15.7 getsock and sockargs Functions / getsock和sockargs函数 451
15.8 bind System Call / bind系统调用453
15.9 1isten System Call / 1isten系统调用 455
15.10 tsleep and wakeup Functions / tsleep和wakeup函数 456
15.11 accept System Call / accept系统调用457
15.12 sonewconn and soisconnected Functions / sonewconn和soisconnected函数 461
15.13 connect System call / connect系统调用 464
15.14 shutdown System call / shutdown系统调用 468
15.15 c1ose System call / c1ose系统调用 471
15.16 Summary / 小结 474

Chapter 16. Socket I/O / 套接字I/O 475
16.1 Introduction / 概述475
16.2 Code Introduction / 代码介绍475
16.3 Socket Buffers / 套接字缓冲区 476
16.4 write, writev, sendto, and sendmsg System calls / write、writev、sendto和sendmsg系统调用480
16.5 sendmsg System call / sendmsg系统调用 483
16.6 sendit Function / sendit函数 485
16.7 sosend Function / sosend函数 489
16.8 read, readv, recvfrom, and recvmsg System calls / read、readv、recvfrom和recvmsg系统调用 500
16.9 recvmsg System call / recvmsg系统调用 501
16.10 recvit Function / recvit函数 503
16.11 soreceive Function / soreceive函数 505
16.12 soreceive Code / soreceive代码510
16.13 se1ect System call / se1ect系统调用 524
16.14 Summary / 小结 534

Chapter 17. Socket Options / 套接字选项 537
17.1 Introduction / 概述537
17.2 Code Introduction / 代码介绍 538
17.3 setsockopt System call / setsockopt系统调用 539
17.4 getsockopt System call / getsockopt系统调用 545
17.5 font1 and ioct1 System call / font1和ioct1系统调用 548
17.6 getsockname System call / getsockname系统调用 554
17.7 getpeername System call / getpeername系统调用 554
17.8 Summary / 小结 557

Chapter 18. Radix Tree Routing Tables / Radix树选路表559
18.1 Introduction / 概述559
18.2 Routing Table Structure / 选路表结构 560
18.3 Routing Sockets / 选路套接字 569
18.4 Code Introduction / 代码介绍570
18.5 Radix Node Data Structures / Radix节点数据结构 573
18.6 Routing Structures / 选路结构 578
18.7 Initialization: route_init and rtable_init Functions / 初始化:route_init和rtable_init函数 581
18.8 Initialization: rn_init and rn_inithead Functions / 初始化:rn_init和rn_inithead函数 584
18.9 Duplicate Keys and Mask Lists / 重复键和掩码列表 587
18.10 rn_match Function / rn_match函数 591
18.11 rn_search Function / rn_search函数 599
18.12 Summary / 小结 599

Chapter 19. Routing Requests and Routing Messages / 选路请求和选路消息601
19.1 Introduction / 概述601
19.2 rtalloc and rtallocl Functions / rtalloc和rtallocl函数 601
19.3 RTFREE Macro and rtfree Function / RTFREE宏和rtfree函数 604
19.4 rtrequest Function / rtrequest函数 607
19.5 rt_setgate Function / rt_setgate函数 612
19.6 rtinit Function / rtinit函数 615
19.7 rtredirect Function / rtredirect函数 617
19.8 Routing Message Structures / 选路消息结构 621
19.9 rt_missmsg Function / rt_missmsg函数 625
19.10 rt_ifmsg Function / rt_ifmsg函数 627
19.11 rt_newaddrmsg Function / rt_newaddrmsg函数 628
19.12 rt_msg1 Function / rt_msg1函数 630
19.13 rt_msg2 Function / rt_msg2函数 632
19.14 sysctl_rtable Function / sysctl_rtable函数 635
19.15 sysctl_dumpentry Function / sysctl_dumpentry函数 640
19.16 sysctl_iflist Function / sysctl_iflist函数 642
19.17 Summary / 小结 644

Chapter 20. Routing Sockets / 选路套接字 645
20.1 Introduction / 概述645
20.2 routedomain and protosw Structures / routedomain和protosw结构 646
20.3 Routing Control Blocks / 选路控制块 647
20.4 raw_init Function / raw_init函数 647
20.5 route_output Function / route_output函数 648
20.6 rt_xaddrs Function / rt_xaddrs函数 660
20.7 rt_setmetrics Function / rt_setmetrics函数 661
20.8 raw_input Function / raw_input函数 662
20.9 route_usrreq Function / route_usrreq函数 664
20.10 raw_usrreq Function / raw_usrreq函数 666
20.11 raw_attach, raw_detach, and raw_disconnect Functions / raw_attach、raw_detach和raw_disconnect函数 671
20.12 Summary / 小结 672

Chapter 21. ARP: Address Resolution Protocol / ARP:地址解析协议 675
21.1 Introduction / 概述675
21.2 ARP and the Routing Table / ARP及选路表 675
21.3 Code Introduction / 代码介绍678
21.4 ARP Structures / ARP结构 681
21.5 arpwhohas Function / arpwhohas函数 683
21.6 arprequest Function / arprequest函数 684
21.7 arpintr Function / arpintr函数 687
21.8 in_arpinput Function / in_arpinput函数 688
21.9 ARP Timer Functions / ARP定时器函数 694
21.10 arpresolve Function / arpresolve函数 696
21.11 arplookup Function / arplookup函数 701
21.12 Proxy ARP / 代理ARP 703
21.13 arp_rtrequest Function / arp_rt request函数 704
21.14 ARP and Multicasting / ARP和多播 710
21.15 Summary / 小结 711

Chapter 22. Protocol Control Blocks / 协议控制块 713
22.1 Introduction / 概述713
22.2 Code Introduction / 代码介绍715
22.3 inpcb Structure / inpcb结构716
22.4 in_pcballoc and in_pcbdetach Functions / in_pcballoc和in_pcbdetach函数 717
22.5 Binding, Connecting, and Demultiplexing / 绑定、连接和多路分配 719
22.6 in_pcblookup Function / in_pcblookup函数 724
22.7 in_pcbbind Function / in_pcbbind函数 728
22.8 in_pcbconnect Function / in_pcbconnect函数 735
22.9 in_pcbdisconnect Function / in_pcbdisconnect函数 741
22.10 in_setsockaddr and in_setpeeraddr Functions / in_setsockaddr和in_setpeeraddr函数 741
22.11 in_pcbnotify, in_rtchange, and in_losing Functions / in_pcbnotify、in_rtchange和 in_losing函数 742
22.12 Implementation Refinements / 实现细化 750
22.13 Summary / 小结 751

Chapter 23. UDP: User Datagram Protocol / UDP:用户数据报协议755
23.1 Introduction / 概述755
23.2 Code Introduction / 代码介绍755
23.3 UDP protosw Structure / UDP的protosw结构 758
23.4 UDP Header / UDP首部 759
23.5 udp_init Function / udp_init函数 760
23.6 udp_output Function / udp_output函数 760
23.7 udp_input Function / udp_input函数 769
23.8 udp_saveopt Function / udp_saveopt函数 781
23.9 udp_ct1input Function / udp_ct1input函数 782
23.10 udp_usrreq Function / udp_usrreq函数 784
23.11 udp_sysct1 Function / udp_sysct1函数 790
23.12 Implementation Refinements / 实现细化 791
23.13 Summary / 小结 793

Chapter 24. TCP: Transmission Control Protocol / TCP:传输控制协议 795
24.1 Introduction / 概述795
24.2 Code Introduction / 代码介绍795
24.3 TCP protosw Structure / TCP的protosw结构801
24.4 TCP Header / TCP首部 801
24.5 TCP Control Block / TCP控制块 803
24.6 TCP State Transition Diagram / TCP状态变迁图 805
24.7 TCP Sequence Numbers / TCP序列号807
24.8 tcp_init Function / tcp_init函数 812
24.9 Summary / 小结 815

Chapter 25. TCP Timers / TCP定时器817
25.1 Introduction / 概述817
25.2 Code Introduction / 代码介绍819
25.3 tcp_canceltimers Function / tcp_canceltimers函数 821
25.4 tcp_fasttimo Function / tcp_fasttimo函数 821
25.5 tcp_s1owtimo Function / cp_s1owtimo函数 822
25.6 tcp_timers Function / cp_timers函数 824
25.7 Retransmission Timer Calculations / 重传定时器计算 831
25.8 tcp_newtcpcb Function / tcp_newtcpcb函数 833
25.9 tcp_setpersist Function / tcp_setpersist函数 835
25.10 tcp_xmit_timer Function / tcp_xmit_timer函数 836
25.11 Retransmission Timeout: tcp_timers Function / 重传超时:tcp_timers函数 841
25.12 An RTT Example / RTT示例846
25.13 Summary / 小结 848

Chapter 26. TCP Output / TCP输出 851
26.1 Introduction / 概述851
26.2 tcp_output Overview / tcp_output概述 852
26.3 Determine if a Segment Should be Sent / 确定一个段是否应该发送852
26.4 TCP Options / TCP选项 864
26.5 Window Scale Option / 窗口缩放选项 866
26.6 Timestamp Option / 时间戳选项 866
26.7 Send a Segment / 发送一个段 871
26.8 tcp_template Function / tcp_template函数 884
26.9 tcp_respond Function / tcp_respond函数 885
26.10 Summary / 小结 888

Chapter 27. TCP Functions / TCP函数 891
27.1 Introduction / 概述891
27.2 tcp_drain Function / tcp_drain函数 892
27.3 tcp_drop Function / tcp_drop函数 892
27.4 tcp_close Function / tcp_close函数 893
27.5 tcp_mss Function / tcp_mss函数 897
27.6 tcp_ctlinput Function / tcp_ctlinput函数 904
27.7 tcp_notify Function / tcp_notify函数 904
27.8 tcp_quench Function / tcp_quench函数 906
27.9 TCP_REASS Macro and tcp_reass Function / TCP_REASS宏tcp_reass函数 906
27.10 tcp_trace Function / tcp_trace函数 916
27.11 Summary / 小结 920

Chapter 28. TCP Input / TCP输入923
28.1 Introduction / 概述923
28.2 Preliminary Processing / 初步处理925
28.3 tcp_dooptions Function / tcp_dooptions函数 933
28.4 Header Prediction / 首部预测 934
28.5 TCP Input: Slow Path Processing / TCP输入:慢路径处理 941
28.6 Initiation of Passive Open, Completion of Active Open / 被动打开的开始,主动打开的完成 942
28.7 PAWS: Protection Against Wrapped Sequence Numbers / PAWS:包装序列号保护 951
28.8 Trim Segment so Data is Within Window / 修剪段使数据在窗口中 954
28.9 Self-Connects and Simultaneous Opens / 自连接和同时打开 960
28.10 Record Timestamp / 记录时间戳 963
28.11 RST Processing / RST处理 963
28.12 Summary / 小结 965

Chapter 29. TCP Input (Continued) / TCP输入(续)967
29.1 Introduction / 概述967
29.2 ACK Processing Overview / ACK处理概述 967
29.3 Completion of Passive Opens and Simultaneous Opens / 被动打开和同时打开的完成967
29.4 Fast Retransmit and Fast Recovery Algorithms / 快速重传及快速恢复算法 970
29.5 ACK Processing / ACK处理974
29.6 Update Window Information / 更新窗口信息 981
29.7 Urgent Mode Processing / 紧急模式处理983
29.8 tcp_pulloutofband Function / tcp_pulloutofband函数 986
29.9 Processing of Received Data / 接收到的数据的处理 988
29.10 FIN Processing / FIN处理990
29.11 Final Processing / 最终处理992
29.12 Implementation Refinements / 实现细化994
29.13 Header Compression / 首部压缩 995
29.14 Summary / 小结 1004

Chapter 30. TCP User Requests / TCP用户请求1007
30.1 Introduction / 概述1007
30.2 tcp_usrreq Function / tcp_usrreq函数 1007
30.3 tcp_attach Function / tcp_attach函数 1018
30.4 tcp_disconnect Function / tcp_disconnect函数 1019
30.5 tcp_usrclosed Function / tcp_usrclosed函数 1021
30.6 tcp_ctloutput Function / tcp_ctloutput函数 1022
30.7 Summary / 小结 1025

Chapter 31. BPF: BSD Packet Filter / BPF:BSD分组过滤程序1027
31.1 Introduction / 概述1027
31.2 Code Introduction / 代码介绍1028
31.3 bpf_if Structure / bpf_if结构 1029
31.4 bpf_d Structure / bpf_d结构 1032
31.5 BPF Input / BPF输入 1040
31.6 BPF Output / BPF输出1046
31.7 Summary / 小结 1047

Chapter 32. 原始IP 1049
32.1 Introduction / 概述1049
32.2 Code Introduction / 代码介绍1050
32.3 Raw IP protosw Structure / 原始IP的protosw结构1051
32.4 rip_init Function / rip_init函数 1053
32.5 rip_input Function / rip_input函数 1053
32.6 rip_output Function / rip_output函数 1056
32.7 rip_usrreq Function / rip_usrreq函数 1058
32.8 rip_ctloutput Function / rip_ctloutput函数 1063
32.9 Summary / 小结 1065

Epilogue / 后记1067

Appendix A. Solutions to Selected Exercises / 精选习题的解答1069

Appendix B. Source Code Availability / 源代码的获取1093

Appendix C. RFC 1122 Compliance / RFC 1122的有关内容1097
C.1 Link-Layer Requirements / 链路层要求1097
C.2 IP Requirements / IP要求1098
C.3 IP Options Requirements / IP选项要求 1102
C.4 IP Fragmentation and Reassembly Requirements / 分片和组装要求1104
C.5 ICMP Requirements / ICMP要求1105
C.6 Multicasting Requirements / 多播要求 1110
C.7 IGMP Requirements / IGMP 要求1111
C.8 Routing Requirements / 选路要求1111
C.9 ARP Requirements / ARP要求 1113
C. 10 UDP Requirements / UDP要求 1113
C. 11 TCP Requirements / TCP要求 1115

Bibliography / 参考文献 1125

前言/序言


深入理解网络通信的基石:TCP/IP协议栈的底层实现机制 在当今互联互通的世界中,网络通信已成为无处不在的基础设施。从我们日常浏览网页、发送电子邮件,到企业级的数据传输和分布式系统运行,一切都离不开TCP/IP协议栈的支撑。然而,在网络技术飞速发展的背后,其核心的TCP/IP协议栈是如何工作的?它的每一个层是如何协作,又是如何在复杂的网络环境中实现可靠、高效的数据传输的?对于那些希望深入探究网络通信本质,而非仅仅停留在应用层面的专业人士、开发者和研究者而言,理解TCP/IP协议栈的底层实现机制至关重要。 本书将带领您踏上一段深入剖析TCP/IP协议栈实现细节的旅程。我们不会止步于对协议定义的描述,而是将重点放在这些协议是如何在实际操作系统中被实现出来的。通过对Unix/Linux等主流操作系统的网络实现进行细致的讲解,本书旨在为您揭示TCP/IP协议栈在网络接口层、IP层、TCP层以及UDP层等关键环节的内部运作原理。 网络接口层:网络通信的起点与终点 任何网络通信的起点都始于网络接口层,它负责将上层协议封装的数据包转换为可以在物理介质上传输的比特流,并在接收端将比特流重新组装成数据帧。本书将深入探讨这一层的关键组件,包括各种网络接口设备(如以太网卡、Wi-Fi适配器)的工作方式、链路层协议(如ARP, RARP, ICMP)的实现细节。您将了解到地址解析协议(ARP)是如何在IP地址和MAC地址之间建立映射关系的,以及反向地址解析协议(RARP)在某些特殊场景下的作用。同时,我们还将剖析网际控制报文协议(ICMP)在网络诊断和错误报告中的关键作用,例如ping命令背后所依赖的ICMP Echo Request/Reply消息的实现原理。 IP层:无连接的全局寻址与路由 互联网协议(IP)作为TCP/IP协议栈的核心,负责在网络中为数据包提供无连接的、不可靠的寻址和路由功能。本书将详细阐述IP数据包的结构,包括IP头部中的各种字段(版本、头部长度、服务类型、总长度、标识、标志、片偏移、生存时间、协议类型、头部校验和、源IP地址、目的IP地址等),并深入分析它们在数据包传输过程中的作用。我们将重点讲解IP层的路由机制,包括路由表的构建、查找以及数据包的转发过程。您将理解路由器是如何根据目的IP地址选择最佳路径来传递数据包的,以及IP层如何处理分片和重组以适应不同网络的最大传输单元(MTU)。此外,我们还会探讨IP地址的分配、子网划分以及IPv4向IPv6的过渡性技术。 TCP层:可靠的面向连接的数据传输 传输控制协议(TCP)是TCP/IP协议栈中最复杂的协议之一,它提供了可靠的、面向连接的数据流服务。本书将对TCP的实现机制进行最详尽的解读。我们将从TCP三次握手和四次挥手的过程入手,深入解析TCP连接建立和终止的细节,以及其中的各种标志位(SYN, ACK, FIN, RST)的含义和作用。 在数据传输阶段,我们将重点分析TCP的拥塞控制和流量控制机制。您将了解到TCP如何通过各种拥塞避免算法(如慢启动、拥塞避免、快重传、快恢复)来动态调整发送速率,以避免网络拥塞。同时,我们也会详细讲解滑动窗口机制,包括发送窗口和接收窗口的工作原理,以及如何通过确认应答(ACK)和超时重传机制来保证数据的可靠传输。本书还将深入探讨TCP的序列号和确认号机制,这是TCP实现有序、无损数据传输的关键。您将理解TCP如何确保接收到的数据段是按照正确的顺序进行组装,以及如何处理可能发生的重复数据段。 此外,我们还将介绍TCP的其他重要特性,如紧急数据处理、端口号的作用以及TCP的性能优化。对于网络应用程序开发者而言,理解TCP的这些底层实现原理,将有助于他们编写出更健壮、更高效的网络应用。 UDP层:快速的无连接数据报服务 与TCP的可靠性不同,用户数据报协议(UDP)提供了一种快速、无连接的数据报服务。本书将介绍UDP数据报的结构,以及它在哪些场景下是比TCP更优的选择。您将了解到UDP的头部非常简洁,只包含源端口、目的端口、长度和校验和。我们将分析UDP的实现原理,并探讨其在DNS查询、流媒体传输、在线游戏等对实时性要求高但对丢包容忍度较高的应用中的使用。 操作系统网络栈的实现细节 除了对各个协议的深入剖析,本书还将特别关注这些协议在实际操作系统中的实现细节。我们将以Unix/Linux系统为例,讲解网络套接字(socket)接口是如何与TCP/IP协议栈进行交互的。您将了解到应用程序通过socket API发出的请求是如何被内核的网络堆栈接收、处理,并最终转化为网络数据包发送出去的。反之,当数据包到达时,内核又是如何解析并将其传递给相应的应用程序的。 我们将探讨内核如何管理网络缓冲区、套接字描述符,以及如何处理中断和软中断来高效地接收和发送数据。对于那些对操作系统内核和网络编程感兴趣的读者,本书将提供宝贵的洞察。 贯穿始终的实践视角 本书并非纯理论的堆砌,而是力求将理论知识与实际应用相结合。通过大量的代码示例和伪代码,读者可以直观地理解协议的设计意图和实现方式。我们还将提及一些用于网络调试和性能分析的工具,例如tcpdump, Wireshark等,并演示如何利用这些工具来观察和分析TCP/IP协议栈的实际运行情况,从而更好地诊断和解决网络问题。 谁将从中受益? 网络工程师和系统管理员: 深入理解TCP/IP协议栈的运作机制,能够更有效地配置、维护和排查网络设备和服务器。 网络应用开发者: 掌握TCP/IP协议栈的底层实现,有助于编写出更高效、更可靠的网络应用程序,并能更好地利用网络资源。 操作系统开发者: 为从事操作系统网络部分的开发和优化提供坚实的基础。 计算机科学专业学生和研究者: 深入理解网络通信的核心原理,为进一步学习更高级的网络技术奠定坚实基础。 总结 TCP/IP协议栈是现代互联网的基石,理解其底层实现机制是掌握网络通信技术的关键。本书将以严谨的逻辑、详尽的讲解和丰富的实践指导,带领您深入探索TCP/IP协议栈的内部世界。通过阅读本书,您将不仅能够理解“是什么”,更能理解“为什么”以及“如何”。让我们一同开启这场揭示网络奥秘的深入之旅,为构建更稳定、更高效的网络世界贡献力量。

用户评价

评分

收到《TCP/IP详解 卷2:实现》后,我迫不及待地翻阅了一下。这本书的厚度就已经说明了其内容的丰富程度,相信绝对能够满足那些对TCP/IP协议栈底层实现有着极高追求的读者。我比较关注的部分是关于TCP的可靠传输机制,包括序列号、确认应答、超时重传等。这些机制是如何协同工作,保证数据包不丢失、不重复、按序到达的,一直是我想深入了解的。书中对这些机制的详细剖析,应该能够让我豁然开朗。此外,我也对TCP的流量控制和拥塞控制这两个非常重要的方面充满了期待。了解这些控制机制的原理,对于在复杂的网络环境中设计和部署高性能的网络应用至关重要。这本书的“实现”二字,预示着它会从代码和数据结构的角度去讲解,这对于我这种更偏向于实践的读者来说,非常有吸引力。我希望通过这本书的学习,能够对TCP/IP协议栈的内部运作有一个更加深刻和全面的认识,从而在实际工作中游刃有余。

评分

拿到《TCP/IP详解 卷2:实现》这本英文原版,我感到非常兴奋。一直以来,我对网络通信的底层原理都怀有极大的兴趣,尤其是TCP/IP协议栈是如何在复杂的网络环境中实现可靠、高效的数据传输的。这本书的副标题“实现”二字,让我看到了它与众不同之处。我预感这本书不会仅仅停留在协议定义的层面,而是会深入到协议在操作系统中的具体实现细节,这对于我这样喜欢刨根问底的读者来说,无疑是巨大的吸引力。我特别期待书中关于TCP连接管理,比如三次握手和四次挥手的详细解释,以及TCP是如何通过各种机制保证数据传输的可靠性和顺序性的。此外,书中对UDP协议的讲解,也让我对它在某些场景下的优势有了更深的认识。我相信,通过学习这本书,我将能够更清晰地理解数据包在网络中是如何被封装、传输和解封装的,以及各种网络设备在其中扮演的角色。这本书将成为我深入理解网络世界的强大助力。

评分

对于任何一个希望在网络领域有所建树的工程师来说,《TCP/IP详解 卷2:实现》都绝对是一本不容错过的经典。从我初步翻阅的体验来看,这本书的内容深度和广度都令人惊叹。它不仅仅是停留在协议定义的层面,更重要的是深入到了协议的实际实现细节。我特别期待书中关于IP层路由选择、数据包转发的讲解,这涉及到网络中最基础也是最核心的部分。同时,TCP层中的各种拥塞控制算法,比如Tahoe、Reno、Cubic等,它们在不同网络条件下的表现和优缺点,也是我非常感兴趣的内容。这本书的另一大亮点在于它强调“实现”,这意味着它会通过代码示例、数据结构分析等方式来解释协议的运作。这对于理解协议在操作系统中的具体落地非常有帮助。我计划将这本书作为我近期学习的重点,认真地去理解每一个概念,并尝试将书中的知识应用到实际的网络编程和故障排除中。我相信,这本书的学习经历将极大地提升我的网络技术功底。

评分

我终于拿到了《TCP/IP详解 卷2:实现》的英文原版,这真是一件令人激动的事情。一直以来,我对TCP/IP协议栈的底层实现原理都充满了好奇,那些看似抽象的概念,背后到底是如何运作的?这本书的出现,无疑为我揭开这层神秘面纱提供了绝佳的机会。我迫不及待地翻开了第一页,试图从中一窥究竟。虽然我还没有深入阅读,但从目录和章节标题中,我已经能感受到它磅礴的知识体系。从IP层的分片与重组,到TCP层的连接建立与关闭,再到UDP的简单高效,每一个环节都似乎蕴含着精妙的设计。我特别期待能够理解那些关于拥塞控制、流量控制的算法,以及它们是如何在现实网络中保证数据传输的稳定性和效率的。我知道这本书会包含大量的代码示例和图表,这对我这样一个喜欢动手实践的读者来说,无疑是巨大的福音。我相信,通过对这本书的学习,我能够更深入地理解网络通信的本质,并为日后的网络编程和故障排查打下坚实的基础。这本书不仅仅是一本技术书籍,更像是一张通往网络世界深处的藏宝图,等待我去探索和挖掘。

评分

这本书对于想要深入理解网络协议栈的工程师来说,绝对是一笔宝贵的财富。我目前还在啃读,但可以肯定地说,它所包含的信息量是巨大的,而且深入到了很多其他书籍不会触及的细节。我尤其对书中关于TCP连接状态机和各个状态转移的详细阐述感到印象深刻,这对于理解TCP的可靠性保证至关重要。还有TCP的拥塞控制算法,书中对此的解读应该是非常详尽的,能够帮助我们理解网络是如何动态调整发送速率以避免拥塞的。另外,书中对IP分片和重组的处理机制的讲解,也让我对不同MTU的网络环境下的数据传输有了更清晰的认识。对于那些对网络底层工作原理感到困惑,或者希望优化网络性能、进行网络调试的开发者来说,这本书的价值是难以估量的。它不仅仅是理论的堆砌,更强调的是“实现”,这意味着它会从代码层面去剖析协议的运作,这对于实际工作非常有指导意义。我打算花足够的时间去消化这些内容,争取把每一个细节都弄明白。

评分

京东618活动给力~东西好速度快~赞

评分

还可以,英文读起来比较简单,没有什么难度,非常值得看。

评分

很经典的一本书,强烈推荐,很实用。。。

评分

感觉字体有点虚,不知道是不是普遍问题

评分

这书很奇怪,英文版的还弄个双语目录。

评分

挺好的,推荐,不错的东西,好好好

评分

蛮好~~~~~~~~~~~~

评分

618囤货,经典书籍,收藏啦。

评分

经典书籍,努力学习中!

相关图书

本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度google,bing,sogou

© 2025 book.cndgn.com All Rights Reserved. 新城书站 版权所有