The TCP/IP detailed Volume 2 describes the TCP/IP stack source code for 4.4bsd-lite (a release of the BSD operating system released in 1994), which is followed by a number of implementations of the network protocol Stacks for UNIX and non-UNIX (including Linux) operating systems.
The book is nearly 900 pages and tells about 15000 lines of code. This is the second time I have read so much of the source code to explain the book, all the way up and down, and spent a few months. I did not read all of the content, I only focused on what I was interested in, so I read about 70% of this book. The processing of IP options, fragmentation and reassembly of IP, IP multicasting, IGMP protocol, etc. are all ignored by me. In this book, I focus mainly on the implementation of the Routing and the basic TCP/IP protocol stack (mainly the Protocol and TCP protocol). After reading, finally to a complete TCP/IP protocol stack implementation has a general understanding. I would like to advise those who want to learn TCP/IP protocol, "TCP/IP Detailed Volume 1" is a must-see classic books, but Volume 2 will have to look at personal ability to do. Don't buy this book unless you have a few years of C programming experience and a strong desire to understand the implementation of TCP/IP and the determination to be ready to read a lot of source code. Then the result of this book may be: sale, send people, pad monitor, can't find ... Before buying a physical book, take a look at the electronic version, the electronic version can be seen to buy a physical book is not too late.
The new year, ready to add the notes of Volume 2, is a summary of their own study of the book. The content of this book is too complex, some notes are certainly not clear, I do not have so much time. So I'll introduce some of the common system invocation implementations of network programming: socket, bind, listen, accept, connect, read, write, shutdown, close. The students who are interested in network programming are certainly as curious as I am about the implementation of these system calls. The implementations of these system calls are protocol related, so I'll also cover the implementation of the TCP protocol in detail.
There is no doubt that the contents of the note will contain large chunks of source code. In introducing a system call, I will list the relevant key data structure definitions, key global variables, and key functions. For the definition of the data structure, comments are very straightforward in English, and if necessary, I will introduce some of the key members. For key functions, I try to add a detailed Chinese note to the reference book. However, I may delete some code snippets that do not affect the basic process. In this case I will make a statement in advance.
Well, say so much, let's get started.