Basics of Network Programming (1)

1 OSI seven-layer model (theory)

Seven-layer model, also known as OSI (Open System Interconnection). The reference model is a standard system developed by the International Organization for Standardization (ISO) for the interconnection between computers or communication systems, generally known as the OSI reference model or the seven-layer model.
It is a seven-layer, abstract model body, including not only a series of abstract terms or concepts, but also specific protocols.

layered meaning
application layer An interface between web services and end users (HTTP, FTP, TFTP protocols, etc.)
presentation layer Data representation, security, compression (JPEG, ASCll, EBCDIC, encrypted formats, etc.)
session layer Establish, manage, terminate session links
transport layer Define the protocol port number for transmitting data, as well as flow control and error checking (that is, the way of transmitting data TCP, UDP)
Network layer Carry out logical address addressing, realize path selection between different networks, and data routing (ip4, ip6)
data link layer Data transmission within a LAN, combining bits into bytes and then into frames
physical layer Physical Media Link

2 TCP/IP network protocol model (actual development)

TCP/IP is a set of communication protocols used to realize network interconnection. The Internet network architecture takes TCP/IP as the core. The reference model based on TCP/IP divides the protocol into four layers, which are (from bottom to top): network interface layer, Internet interconnection layer, transport layer, and application layer.

layered meaning
application layer The application layer corresponds to the upper layer of the OSI reference model, providing users with various services (FTP, Telnet, DNS, SMTP)
transport layer Corresponding to the transport layer of the OSI reference model, it provides end-to-end communication functions (UDP, TCP) for application layer entities
internet layer The Internet interconnection layer corresponds to the network layer of the OSI reference model, and mainly solves the communication problem from host to host
network interface layer The network access layer corresponds to the physical layer and data link layer in the OSI reference model and is responsible for monitoring the exchange of data between the host and the network

3 Network layer IPV4 protocol

Internet Protocol version 4 (English: Internet Protocol version 4, IPv4), also known as the fourth version of the Internet Communication Protocol, is the fourth revision of the Internet Protocol development process and the first widely deployed version of the protocol. IPv4 is the core of the Internet and the most widely used version of the Internet protocol. Its successor version is IPv6. Until 2011, when IANAIPv4 addresses were completely exhausted, IPv6 was still in the early stages of deployment.

	**IP地址 = 网络位 + 主机位** 
	网络位:IP地址所在的网段
	主机位:在局域网内的主机编号
	子网掩码:搭配IP地址使用,区分IP地址中的网络位和主机位
			 子网掩码是1的部分对应IP地址网络位
			 子网掩码是0的部分对应IP地址主机位
			 比如我们常用到的随便一个IP:192.168.0.189他的子网掩码为255.255.255.0

Classification of IP
Public IP address: the IP address that can directly access the Internet
Private IP address: the IP address that cannot directly access the
Internet MAC address: the physical address of the network card address, which is inherent in the machine and will not be repeated
Port number: the number that uniquely identifies different processes of the same host (0 - 65535)

IP type brief description
Network segment number The IP address 192.168.0.0 with the network bits unchanged and the host bits all 0
broadcast number The IP address 192.168.0.255 with the network bits unchanged and the host bits all 1
Class A IP (1.0.0.0 - 126.255.255.255) Subnet mask: 255.0.0.0 Generally used to manage large-scale networks, private IP: 10.0.0.0 - 10.255.255.255
class B ip (128.0.0.0 - 191.255.255.255) Subnet mask: 255.255.0.0 is generally used to manage large and medium-sized networks, private IP: 172.16.0.0 - 172.31.255.255
C class ip (192.0.0.0 - 223.255.255.255) Subnet mask: 255.255.255.0 is generally used to manage small and medium-sized networks, private IP: 192.168.0.0 - 192.168.255.255
D class ip (224.0.0.0 - 239.255.255.255) Generally used for multicast transmission
E class ip (240.0.0.0 - 255.255.255.254) for scientific experiments
class B ip (128.0.0.0 - 191.255.255.255) Subnet mask: 255.255.0.0 is generally used to manage large and medium-sized networks, private IP: 172.16.0.0 - 172.31.255.255

insert image description here

Guess you like

Origin blog.csdn.net/m0_58193842/article/details/128707804