TCP/IP Architecture, Design and Implementation in Linux

TCP/IP Architecture, Design and Implementation in Linux

Sameer Seth

Language: English

Pages: 772

ISBN: 0470147733

Format: PDF / Kindle (mobi) / ePub

This book provides thorough knowledge of Linux TCP/IP stack and kernel framework for its network stack, including complete knowledge of design and implementation. Starting with simple client-server socket programs and progressing to complex design and implementation of TCP/IP protocol in linux, this book provides different aspects of socket programming and major TCP/IP related algorithms. In addition, the text features netfilter hook framework, a complete explanation of routing sub-system, IP QOS implementation, and Network Soft IRQ. This book further contains elements on TCP state machine implementation,TCP timer implementation on Linux, TCP memory management on Linux, and debugging TCP/IP stack using lcrash













of the socket option to be set. optlen: This is the length of the optional value that is passed to the kernel to mark the end of option length. The reason is that optlen is a pointer to void. getsockopt(). getsockopt() is an interface provided to get the value of socket option (see Fig. 1.23). The arguments are the same as they are for setsockopt(), with the difference being that they are used to fetch the value of the socket options. 1.7.4 Option Values SO_DEBUG. This turns on debugging at

ip_route_output_slow() 14.12.4 ip_dev_find() 14.12.5 __in_dev_get() 14.12.6 inet_select_addr() 14.12.7 ROUTE__SCOPES 14.12.8 fib_lookup() Summary 533 534 535 535 536 537 538 540 540 543 543 544 546 547 548 549 550 550 551 552 553 554 557 558 558 559 561 563 563 564 566 576 577 578 580 581 589 xvii CONTENTS 15 IP QUALITY OF SERVICE IN LINUX (IP QoS) 15.1 Introduction 15.2 Basic Components of Linux Traffic Control 15.3 Linux Implementation of pfifo_fast qdisc 15.4 Queueing Discipline Data

Let’s see how it actually happens with the help of an example. In Fig. 2.28a–e, we illustrate the relation between send congestion window, window advertised by the sender, and segments acknowledged. When the connection is just established, we can see that the congestion window is 1 mss and the receiver window is 12 mss as shown in Fig. 2.28a. So, one segment s1 is transmitted; and until it is acknowledged, the situation will remain the same as shown in Fig. 2.28a. Once s1 is acknowledged, the

4.4) tcp_bhash = tcp_hashinfo.__tcp_bhash (Fig. 4.5) tcp_listening_hash = tcp_hashinfo.__tcp_listening_hash (Fig. 4.6) tcp_ehash Figure 4.4 illustrates snapshot of hash table for sockets in established state. First half of the hash table is reserved for established sockets and rest for sockets in TIME_WAIT State. This hash table is discussed later in the chapter. 4.2.4 tcp_listening_hash Figure 4.5 illustrates snapshot of hash table hashing all the sockets in TCP_LISTEN STATE in the system.

We 169 CLIENT SIDE SETUP Figure 4.25b. Code flow for connect process (continued). Figure 4.26. Routing table hash bucket. 170 KERNEL IMPLEMENTATION OF TCP CONNECTION SETUP have gotten the routing entry for the destination, and we still need to do some sanity checks on the routing flag. If the routing flag (rt→rt_flags) is set to RTCF_MULTICAST or RTCF_BROADCAST, we return error, which means that our destination is multicast or broadcast and we want to connect only to such unicast addresses.

Download sample