Chapter 1: Introduction
The TCP/IP protocol suite forms the basis of the Internet (a wide area network or WAN).
TCP/IP is considered a 4-layer system (networking protocols are usually developed in layers).
Each layer has a different responsibility:
- the link layer (also known as the data-link layer or network interface layer) normally includes the device driver in the operating system and the corresponding network interface card in the computer.
- the network layer (also called internet layer) handles movement of packets around the network. IP (internet protocol), ICMP (Internet Control Message Protocol), and IGMP (internet group management protocol) provide the network layer in the TCP/IP protocol suite.
- the transport layer provides flow of data between two hosts for use for the application layer above. two different protocols: TCP (transmission control protocol) and UDP (user datagram protocol).
- the application layer handles the details for the particular application.
Every interface on an internet must have a unique internet address (also called an IP address). These addresses are 32-bit numbers.
The domain name system (DNS) is a distributed database that provides the mapping between ip addresses and hostnames.
Encapsulation: when an application sends data using TCP, the data is sent down the protocol stack, through each layer, until it is sent as a stream of bits across the network. Each layer adds information to the data by prepending headers (and sometimes adding trailer information) to the data that it receives. The unit of data that TCP sends to IP is called a TCP segment. The unit of data that IP sends to the network interface is called an IP datagram. The stream of bits that flows across the Ethernet is called a frame.
Demultiplexing: when an Ethernet frame is received at the destination host it starts its way up the protocol stack and all the headers are removed by the appropriate protocol box. Each protocol box looks at certain identifiers in its header to determine which box in the next upper layer receives the data. This is called demultiplexing.
The de facto standard for TCP/IP implementations is the one from the computer systems research group at the University of California at Berkeley. Historically this has been distributed with the 4.x BSD system (Berkeley Software Distribution), and with the "BSD networking releases."
Two popular application programming interfaces (APIs) for applications using the TCP/IP protocols are called sockets and TLI (transport layer interface). The former is sometimes called "Berkeley sockets,".
Chapter 2: Link Layer
The loopback interface allows a client and a server on the same host to communicate with each other using TCP/IP.
MTU refers to the maximum transmission unit: the limit on the size of the frame for encapsulation. Path MTU refers to the maximum of the network.
netstat -in provides information on the interfaces on the system.
Chapter 3: Internet Protocol (IP)
All TCP, UDP, ICMP, and IGMP data gets transmitted as IP datagrams.
IP provides an unreliable, connectionless datagram delivery service.
Unreliable: it does not guarantee successful delivery of an IP datagram, rather IP provides a best effort service. Any required reliability must be provided by a higher layer, for example TCP.
Connectionless: IP does not contain state information about successive datagrams. Datagrams can be delivered out of order.
IP uses big endian byte ordering (also called network byte ordering). Systems that use little endian byte ordering must convert header values into big endian or network byte order before transmitting data.
IP routing is simple, especially for a host. If the destination is directly connected to the host (e.g., a point-to-point link) or on a shared network (e.g., Ethernet or token ring), then the IP datagram is sent directly to the destination. Otherwise the host sends the datagram to a default router, and lets the router deliver the datagram to its destination.
The IP layer has a routing table in memory that it searches each time it receives a datagram to send. W