Common network concepts 1. DHCP Dynamic Host Configuration Protocol (DHCP) is a LAN network Protocol that uses UDP for two purposes: IP addresses are automatically assigned to internal networks or network service providers, and users or internal network administrators are used as central management measures for all computers. 2. A gateway (Application Layer) gateway is essentially an IP address from a network to another network. For example, if Network A and Network B exist, the IP address range of Network A is "192.168.1.1 ~ 192. 168.1.254 ", The subnet mask is 255.255.255.0, And the IP address range of Network B is" 192.168.2.1 ~ 192.168.2.254 ", and the subnet mask is 255.255.255.0. Without a router, the two networks cannot communicate with each other through TCP/IP, even if the two networks are connected to the same vswitch (or hub, the TCP/IP protocol also determines that the hosts in the two networks are in different networks based on the subnet mask (255.255.255.0. To realize the communication between the two networks, you must use the gateway. If the host in Network A finds that the destination host of the data packet is not in the local network, it forwards the data packet to its own gateway, and then the gateway forwards the data packet to the gateway of Network B, the gateway of Network B is then forwarded to a host of Network B. The process in which network A forwards data packets to Network B. The default gateway must be an IP address in the CIDR Block of the computer, but cannot be an IP address in another CIDR block. A Router (Network Layer) Route refers to the process in which a router receives data packets from one interface and redirects the data packets to the destination address and forwards the data packets to another interface. The router uses a series of algorithms to determine the shortest path between networks. 4. For example, if the IP address range is 188.188.0.111 or 188.188.5.222, The subnet mask is set to 255.255.254.0. Is it in the same network segment? IP (A) 188.188.0.111 255.ip (B) 188.188.5.222 255.mask 255.255.254.0 11111111.11111111.11111110.00000000 255.254.0 is composed of 23 1, that is, A 23-bit Mask. Simply put, after converting the decimal IP address into binary format from left to right, if the first 23 bits and 1 are the same, the IP address belongs to the same network segment, the one after the 24-bit path changes randomly and belongs to the same network segment. In this example, the IP address (A) 188.188.0.111 is in the range of 188.188.0.0 ~ 188.188.1.255, which belongs to the same network segment only. The IP address range of IP (B) In the same network segment is 188.188.4.0 ~ The range of 188.188.5.255 is obviously not in the range of IP (A), so IP (A) and IP (B) are not in the same network segment IP 5. the subnet mask uses the binary IP address and subnet mask to determine the network address and host number of a device. That is to say, the subnet mask is used to distinguish the network part and host part of a network. Once the subnet mask is set, the network address and host address are fixed. 6.TCP/ IP Transmission Control Protocol/Internet Protocol is abbreviated as Transmission Control Protocol/Internet Protocol, also known as network communication Protocol, it consists of the IP protocol of the network layer and the TCP protocol of the transport layer. In terms of protocol layered model, TCP/IP consists of four layers: network interface layer, network layer, transmission layer, and application layer. The network layer includes: IP (Internet Protocol) Protocol, ICMP (Internet Control Message Protocol) Protocol, ARP (Address Resolution Protocol) Protocol, and RARP (Reverse ARP) Protocol) the reverse address translation protocol. IP address is the core of the network layer. The next IP address is encapsulated by routing and then handed over to the interface layer. IP datagram is a connectionless service. ICMP is a supplement to the network layer and can send packets back. Used to check whether the network is smooth. The Ping Command sends an ICMP echo packet and tests the network by sending the echo relay. ARP is a forward Address Resolution Protocol. It uses known IP addresses to find the MAC address of the corresponding host. RARP is a Reverse Address Resolution Protocol that determines the IP address through the MAC address. For example, a diskless workstation also has a DHCP service. The transport layer provides communication between applications. Its functions include: 1. formatting information flows; 2. reliable transmission. To implement the latter, the transport layer protocol requires the receiving end to send back the confirmation, and if the group is lost, it must be re-sent, that is, the familiar "three-way handshake" process, so as to provide reliable data transmission. Transport layer protocols are mainly Transmission Control Protocol (TCP) and User Datagram protocol (UDP ). The application layer protocols include FTP, TELNET, DNS, SMTP, RIP, NFS, and HTTP. 7. three-way handshake: host A sends A syn = 1 packet to the server, generates A random seq number = 1234567 packet to the server, host B is known by SYN = 1, and A requires online; the second handshake: after receiving the request, host B must confirm the online information and send ack number = (seq + 1 of host A), syn = 1, ack = 1, generate A packet with seq = 7654321 for the third handshake: After receiving the packet, host A checks whether the ack number is correct, that is, the seq number + 1 sent for the first time, and whether the ack is 1. If yes, host A will send ack number = (seq + 1 of host B), ack = 1 again. After host B receives the message, confirm that the seq value is set to ack = 1, and the connection is established successfully. After three handshakes are completed, data is transmitted between host A and host B.