In Internet protocols, the IP address is useless. Without an effective and correct IP Address Allocation, we cannot make the Internet work. Now let's talk about the relevant issues. For the basic content of the IP Internet protocol, please read from below.
Addressing
There is a difference between the name, address, and route. The name is what we are looking for. The address indicates where the name is located and how the route solves the problem. IP addresses mainly handle address issues. The upper-layer protocol is used to map names and addresses. The IP Module maps the address and the local network address, and ing the local network address and route is a task of Low-layer protocol.
The address is 32-bit long and consists of a network number and a local address. There are three types of addresses: the highest bit of class A is 0, the last 7 bits represent the network number, the other 24 bits represent the local address, the first two bits of Class B are 10, and the last 14 bits represent the network address, the other 16 bits indicate the local address. The three bits in Class C are 110, the last 21 bits indicate the network number, and the other 8 bits represent the local address.
When you map a network address to a local network address, note that some hosts may use several different IP addresses. We can consider the local network address as a MAC address ). We must be able to process a host with several processing ports, and each port has several logical Internet Protocol Addresses.
Segmentation
For different networks, the size of packets transmitted may be different. Therefore, the function of dividing large packets into small ones is required. A datagram can also be marked as "non-segmented". If a datagram is marked, it cannot be segmented under any circumstances. If the destination cannot be reached without segmentation, the package will be abandoned halfway. The IP module is invisible to the IP address module for re-segmentation and re-reorganization within the region network. This method can also be used.
The segment and reorganization of the Region network add tags to the segment, and the receiver uses these tags to differentiate different segments. The segment offset field tells the receiver where to place the segment, and the multi-segment mark indicates the last segment. A datagram can be reorganized using different domains. A tag domain is used to uniquely mark a datagram. It is the original sender setting and must be unique throughout the network transmission process. The sender sets the multi-segment tag to zero and the segment offset to zero.
Let us assume that the Internet protocol module divides a large datagram into two small ones. The IP module first obtains the data header, then separates the data into two parts, and adds the data header to the two parts. Data is separated by 8 bytes. The second segment is not necessarily 8 bytes, but the first segment must be. We call the 8-bit bytes in the first section the number of blocks NFB ). The first newly generated data packet is the first data segment generated, and the multi-segment mark is 1. The second newly generated data packet is the second data segment generated, the multipart mark is equal to the value in the original datagram, and the segment offset is equal to the value in the original datagram plus NFB. The above process can be expanded from 2 to N.
For segment reorganization, the following four domains must have the same values: Tag, source address, target address, and protocol. Recombine different datagram data into a new segment based on its own offset. the offset of the first segment is 0, and the multi-segment of the last segment is marked as 0.
Gateway
The gateway transmits data packets between different networks, and the gateway also implements the gateway-to-Gateway Protocol GGP), which is used to transmit routing and other control information. The high-level protocols in the gateway do not need to be implemented at all. GGP functions can be implemented in the Internet protocol module.