Basic socket concepts
Stream)
Connection)
Blocking and non-blocking)
Synchronous and asynchronous)
IP address
The IP address is the unique IP address identifier in the Internet.
The IP address is a 32-bit long (to be expanded to 128 bits)
Each Internet package must contain an IP address
Use the dotted-decimal Notation:
Separate the four-byte numbers of the IP address in decimal format with dots, for example, 202.112.58.200 (0xca703ac8)
Subnet Mask (subnet mask)
It is also represented in dotted decimal format, for example, 255.255.0.0.
It is used to specify the subnet (LAN) range. The subnet range can be obtained by performing operations on the mask and the IP address.
For example, the IP address 166.111.160.1 and 166.111.161.45, subnet mask: 255.255.254.0, so the two IP addresses are in the same subnet.
Byte order:
There are two types of byte sequence: nbo and HBO.
Network byte order ):
It stores data in a sequence from high to low and uses a unified network byte sequence on the network to avoid compatibility issues.
Host byte order (HBO, host byte order ):
HBO varies with different machines and is related to CPU design.
For example, the Motorola 68k series, HBO and nbo are the same, intel X86 series, and HBO is opposite to nbo.
Comparison Between OSI model and TCP/IP protocol in ISO/OSI Layer-7 protocol model
Http://www.aka.org.cn/Lectures/002/Lecture-2.1.8/Lecture-2.1.8/new_page_1.htm
For details, refer to the socket mode with continuity and orderliness.