Home >Common Problem >What is the main function of IP

What is the main function of IP

青灯夜游
青灯夜游Original
2022-11-23 11:45:2812998browse

The main functions of ip are: 1. Define the basic unit of computer-wide data transmission and stipulate the format of data transmission on the Internet; 2. Define the routing function that needs to be completed and determine the path of data transmission; 3. Define the rules of unreliable packet delivery, specifying when and how to process packets by hosts and routers, and specifying the conditions under which packets are abandoned and how to send error messages.

What is the main function of IP

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

IP refers to Internet Protocol, the abbreviation of Internet Protocol, which is the network layer protocol in the TCP/IP system. The purpose of designing IP is to improve the scalability of the network: first, to solve Internet problems and realize the interconnection of large-scale and heterogeneous networks; second, to separate the coupling relationship between top-level network applications and underlying network technologies to facilitate the two. Develop independently. According to the end-to-end design principle, IP only provides a connectionless, unreliable, best-effort packet transmission service to the host.

The purpose of IP protocol design and the three main functions implemented are:

  • First: IP protocol defines the entire computer network data The basic unit of transmission specifies the format of data transmission on the Internet;

  • Second: The IP protocol defines the routing function that needs to be completed and determines the path of data transmission;

  • Third: The IP protocol defines the rules of unreliable packet delivery, specifies when and how to process packets by hosts and routers, and specifies the conditions under which packets are abandoned and how to send error messages.

What is the main function of IP

Services provided by IP protocol

The services provided by IP are roughly Can be summarized into two categories:

  • Transmission of IP information packets.

  • Segmentation and reassembly of IP packets.

IP packet transmission

IP is a protocol for information transmission between networks. It can transfer IP information packets from the source device (such as the user's computer) to the destination device (such as a department's www server). In order to achieve this goal, IP must rely on two mechanisms: IP address and IP router.

  • IP address

    IP stipulates that all devices on the network must have a unique IP address, just like the recipient address must be indicated on the email. Only the postman can deliver the mail. In the same way, each IP information packet must contain the IP address of the destination device so that the information packet can be correctly sent to the destination. The same device cannot have multiple IP addresses. All network devices using IP have at least one unique IP address.

  • IP routing

    The Internet is a large network formed by many network connections. If you want to transmit IP information packets on the Internet, in addition to ensuring that each device on the network has a unique IP address, there must also be a transmission mechanism between networks to transmit IP information packets to the destination through each network. land. This delivery mechanism is called IP routing.

    Each network is connected to each other through a router. The function of the router is to select the transmission path for IP information packets. In other words, IP packets must be sent to their destinations only through the cooperation of routers along the way. In the process of IP routing, the router is responsible for selecting the path, and the IP information packet is the object to be transmitted.

    What is the main function of IP
    IP routing description

    IP address and IP routing are the basis for IP packet transmission. In addition, there is a very important feature when transmitting IP information packets, which is the use of connectionless transmission methods. The connectionless transmission method means that when IP information packets are transmitted, the source device and the destination device can deliver the IP information packets without having to be connected in advance. That is, the source device completely ignores the destination device and simply sends out IP information packets one by one. As for whether the destination device receives each information packet and whether it receives the correct information packet, the upper layer protocol (such as TCP) is responsible for checking.

    The advantage of using non-connection is that it simplifies the process and improves the efficiency of transmission. In addition, since IP information packets must be transmitted between routers through the IP routing mechanism, connectionless transmission methods are easier to operate in this mechanism.

    Compared with the non-connection transmission method, there is also a connection transmission method, that is, both the source and destination devices must establish a connection before further transmission of data. TCP uses the connection transmission method.

Segmentation and reassembly of IP packets

In order to put an IP message in different physical frames, the maximum IP message length can only be equal to the minimum MTU value of all physical networks on this path. When the datagram passes through a network that can transmit larger frames, it is not economical to limit the size of the datagram to below the smallest MTU value on the Internet; When the datagram traverses this subnet, it cannot be encapsulated in a frame.

When the IP protocol sends IP messages, it generally chooses an appropriate initial length. If the MTU value of the intermediate physical network that this packet needs to go through is smaller than the length of the IP packet, the IP protocol divides the data part of the packet into several smaller data pieces to form a smaller packet, and then puts to be sent in a physical frame. Each small message is called a segment. Segmentation is generally performed on the router. If the router receives an IP packet from a certain network interface and wants to forward it to another network, and the MTU of the network is smaller than the length of the IP packet, then the IP packet must be divided into multiple small IP segments. Send them separately.

Reassembly is the reverse process of segmentation, which reassembles several IP segments and restores them to the original IP packets. When the destination receives an IP packet, it can determine whether it is a fragment based on its fragment offset and MF flag bit. If the MF bit is 0 and the fragmentation offset is 0, it indicates that this is a complete IP datagram. Otherwise, if the segment offset is not 0, or the MF flag is 1, it indicates that it is a segment. At this time, the destination needs to perform segmentation reorganization. The IP protocol determines which segments belong to the same original message based on the value of the identifier field in the IP message header, and determines the position of the segment in the original message based on the segment offset. If all the fragments of an IP datagram arrive at the destination correctly, they are reorganized into a complete message and handed over to the upper layer protocol for processing.

The summary is as follows: During the transmission process, IP information packets may pass through many networks using different technologies. Assume that the IP information packet is sent from the ATM network and the original length is 9180B. If the IP routing passes through the Ethernet network, it will face the obstacle that the information packet is too large to be transmitted on the Ethernet network. In order to solve this problem, the router must have a mechanism for segmenting and reassembling IP packets to segment overly long packets so that they can be transmitted on a network with a smaller maximum transmission unit. The split IP information packet is received by the destination device and reassembled to restore the original IP information packet.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What is the main function of IP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn