Chapter I. Overview
- TCP/IP protocol family: four-layer protocol system
- Link layer (Data Link layer, network interface layer)
Device drivers and network interface cards.
- Network layer (Internet layer)
Handles the grouping of activities in the network, Point-to-point services. IP, ICMP, IGMP
- Transport Layer
Provides end-to-end communication. TCP, UDP
- Application Layer
Process application details. Telnet, FTP, SMTP, SNMP
- Part of the concept
- The simplest way to construct the Internet is to connect two or more networks through a router (Router).
The advantage of routers is that they provide connectivity for different types of physical networks: Ethernet, Token Ring, point-to-point links, and so on.
- The Network Layer IP protocol provides an unreliable service.
Just move the packet from the source address to the destination address as quickly as possible
- Internet Address: Category + network number + host number
IP address length 32bit (4 bytes) ABCDE class 01 bytes 102 bytes 1103 Bytes 1110 11110
- Domain Name System (DNS) provides mappings between IP addresses and host names
- Packaging. Each layer adds some header information (some with tail information) to the incoming data to the next layer
The data unit that TCP transmits to IP is called TCP packet segment or TCP segment (TCP segment);
The data unit that the IP transmits to the interface layer is called the IP datagram (IP datagram),
More accurately, the transmission unit between IP and network interface layer should be grouping (packet), can be IP datagram, or it can be a slice of IP datagram (fragment);
A bit stream transmitted over Ethernet is called a frame
- When the destination host receives an Ethernet data frame, it removes the packet header from the protocol stack from the bottom up to determine the upper layer protocol to receive the data. This process is called separation (demultiplexing);
- Applications on the server are generally identified by the port number . Well-known port number 1~1023 (reserved port number)
The client usually does not care about the port number, guaranteed to be unique, so the client's slogan is also called the temporary port number, mostly allocated 1024~5000. (The port is released after the program shuts down because the client is not running for a long time)
FTP 21,tcp 23
- All official standards regarding the Internet are published in the RFC(Request for Comment) document. With a digital ID, the larger the number, the more new the content.
- When you use TCP and UDP to provide the same service, you typically select the same port number.
Many port numbers are odd: Historically, these ports derive from the Transport Layer Protocol NCP (Network Control Protocol) of the ARPANET, and the NCP is simplex, not full-duplex, so each application requires two connections, and a pair of odd and even port numbers are reserved. When TCP and UDP are called standard transport layer protocols, only one port number is required per application.
- Internet and Internet meanings are different
The internet means connecting multiple networks together with a common protocol family;
The Internet refers to a collection of hosts (more than 1 million) that communicate with each other over TCP/IP worldwide. The internet is an internet, but the internet is not equal to the Internet.
- The common cornerstone of constructing the Internet is routers.
Chapter Two link layer
- There are three main purposes of the link layer
- Sending and receiving IP datagrams for IP modules;
- Send ARP request and receive ARP reply for ARP module; (ARP Address Resolution Protocol)
- Send RARP requests and accept RARP responses for Rarp. (RARP Inverse Address Resolution Protocol)
- The term Ethernet is generally referred to as a standard published jointly by the Digital equipment company DEC, Intel Corporation, and Xerox Corporation in 1982.
It is the main LAN technology used by TCP/IP today.
The IEEE802 committee published a standard set. 802.3 for the entire CSMA/CD network, 802.4 for the token bus network, 802.5 for the Token Ring network, the common characteristics of these three are defined by the 802.2 standard.
- Serial lines IP (slip:serial line IP) and compressed SLIP (called Cslip)
A simple form of encapsulating an IP datagram on a serial line. Add a special character at the beginning and end of the datagram (end character 0xc0)
- Point-to-Point Protocol PPP
The defect of slip has been modified.
- Loopback interface (Loopback Interface)
Allow client programs and service programs running on the same host to communicate over TCP.
Most systems assign 127.0.0.1 to this interface and are named localhost. An IP datagram passed to the loopback interface cannot appear on any network.
- Maximum Transmission Unit MTU
Ethernet and 802.3 have a limit on the length of the data frame, this feature of the link layer is called the MTU, the maximum transmission unit.
The IP layer needs to be fragmented (fragmentation) if the datagram to be transmitted is larger than the MTU
- Communication between two hosts on the same network, it is important that the minimum MTU in the two host paths is called the Path MTU.
- Serial Line throughput calculation
e.g. line rate 9600 b/s, one byte 8 bit, one starting bit, one stop bit, then the rate is 9600/(8+2) = 960 b/s (Bytes/sec)
Transferring a 1024-byte packet requires 1024/960 = 1066 MS, and two application interactions will have to wait for a normal time of 533MS (refer to both in opposite directions). (research says interactive responses over 100~200ms are considered bad)
"TCP/IP Detailed Volume 1: Protocol" Reading notes (Chapter I overview & Chapter II link layer)