network communication terminology

c/s is client/server, b/s is browser/server.

 

ipv4 192.168..... (intranet ip) through the router's NAT (a table is maintained to convert the ip to the external network); when ipv6 is popularized, there is no need to use a router.

 

The subnet mask has only one effect:

It is to divide an IP address into two parts: network address and host address.

  • A network whose subnet mask is "255.255.255.0":

The last number can be arbitrarily changed in the range of 0~255, so 256 IP addresses can be provided. But the actual number of IP addresses available is 256-2, or 254, because the host number cannot be all "0" or all "1".

  • A network whose subnet mask is "255.255.0.0":

The last two numbers can be arbitrarily changed in the range of 0~255, which can provide 255² IP addresses. But the actual number of IP addresses available is 255²-2, or 65023.

The subnet mask cannot be set too large:

If the range is too large, it is likely that the data sent to the target host that is not in the same subnet as the local host will be considered to be in the same subnet due to a wrong judgment. Then, the data packet will circulate in this subnet. Until it times out and discards, the data cannot reach the target host correctly, resulting in network transmission errors.

The subnet mask cannot be set too small:

If the scope is too small, the communication between machines originally belonging to the same subnet will be regarded as cross-subnet transmission, and the data packets will be handed over to the default gateway for processing, which will inevitably increase the burden on the default gateway and reduce network efficiency.

example:

If the size of a network does not exceed 254 computers, it is enough to use "255.255.255.0" as the subnet mask. Now most LANs will not exceed this number, so "255.255.255.0" is the most commonly used IP address subnet. Netmask; if a university has more than 1500 computers, a LAN of this size can use "255.255.0.0".

 

Gateway:

Only by setting the IP address of the gateway, the TCP/IP protocol can realize the mutual communication between different networks.

So which machine's IP address is this IP address?

The IP address of the gateway is the IP address of the device with routing function. The device with routing function includes a router, a server with routing protocol enabled (essentially equivalent to a router), and a proxy server (also equivalent to a router).

 

Router ( called default gateway in Windows , gateway is route ) .

 

A default gateway is a node in a computer network that forwards data packets to other networks.

In a typical TCP/IP network, nodes (such as servers, workstations, and network devices) have a defined default route setting (pointing to the default gateway). The next hop IP address for sending packets can be specified without a specific route.

The default gateway is the default gateway, and the default gateway is a subset of the default gateway.

 

DNS:

It is the server that performs domain name resolution.

 

MAC:

The MAC address is like the ID number on our ID card, which is globally unique.

 

Logical port:

Different services are distinguished by "IP address + port number".

 

Communication principle:

It is too troublesome to write an IP address to access, so with a domain name, it will first access the local hosts, if not, it will go to the network to access the DNS server, the DNS server will help us find the target server, and then return the corresponding IP address.

 

 

Definition of big and small endian mode

Big-endian mode means that the high bits of data are stored in the low address of the memory, and the low bits of the data are stored in the high address of the memory. This storage mode is a bit similar to treating the data as a string sequence: the address is determined by Small to large increases, and data is placed from high to low;

Little-endian mode means that the high bits of the data are stored in the high address of the memory, and the low bits of the data are stored in the low address of the memory. This storage mode effectively combines the high and low addresses and data bit weights. The value is high, and the weight of the low address part is low, which is consistent with our logic method.

The interception of Java NIO (Chinese version) is described in detail in the book as follows:

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324805899&siteId=291194637