CN112911026A - Address application method, device and equipment - Google Patents
Address application method, device and equipment Download PDFInfo
- Publication number
- CN112911026A CN112911026A CN201911223340.XA CN201911223340A CN112911026A CN 112911026 A CN112911026 A CN 112911026A CN 201911223340 A CN201911223340 A CN 201911223340A CN 112911026 A CN112911026 A CN 112911026A
- Authority
- CN
- China
- Prior art keywords
- address
- terminal device
- interface
- request message
- network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000004044 response Effects 0.000 claims description 52
- 230000015654 memory Effects 0.000 claims description 25
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/20—Support for services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the application discloses an address application method, an address application device and address application equipment, which are used for saving the bandwidth of network equipment. The method comprises the following steps: the network equipment receives a first request message from first terminal equipment, wherein the first request message is used for applying for an Internet Protocol (IP) address of the first terminal equipment; the network equipment acquires a first IP address of an interface connected with the first terminal equipment; when a first corresponding relation exists, the network equipment sends a second request message to the first equipment according to the first request message, the first corresponding relation is the corresponding relation between a first IP address of the interface and a first indication, the first indication is used for indicating that the first IP address of the interface is preferentially used as the IP address of the terminal equipment applying for the terminal equipment connected with the interface, the second request message comprises the first IP address of the interface, the second request message is used for applying for the IP address of the first terminal equipment, and the IP address of the first terminal equipment and the first IP address of the interface belong to the same network segment.
Description
Technical Field
The present application relates to the field of communications, and in particular, to an address application method, apparatus, and device.
Background
A Dynamic Host Configuration Protocol (DHCP) belongs to a local area network Protocol, and defines a client (client), a server (server), and a relay agent (relay). Wherein, the server is used for allocating an Internet Protocol (IP) address to the client through the relay.
Specifically, the client sends a first message to the relay, where the first message is used to apply for an IP address. The relay fills the IP address of the interface (hereinafter referred to as interface IP address) receiving the first message into the first message as a gateway address to obtain a second message, and sends the second message to the server. After receiving the second message, the server allocates an IP address for the client according to the interface IP address in the second message, wherein the IP address is the same as the network segment to which the interface IP address belongs, and then the server issues the IP address to the client through the relay.
When the interface of the relay receiving the first message corresponds to a plurality of interface IP addresses, the traditional method is that the relay generates a plurality of second messages, each second message carries one interface IP address, and the relay sends the plurality of second messages to the server, so that the server issues the allocated IP addresses to the client according to the interface IP addresses in the plurality of second messages. In practice, however, only one IP address is ultimately needed by the client, so this approach results in wasted bandwidth.
Disclosure of Invention
The embodiment of the application provides an address application method, an address application device and address application equipment, which are used for saving the bandwidth of network equipment.
In a first aspect, an embodiment of the present application provides an address application method, where the network device may be a forwarding device such as a router and a switch. The address application method comprises the following steps: first, a network device receives a first request message from a first terminal device, where the first request message is used to apply for an internet protocol IP address of the first terminal device. Secondly, the network device obtains a first IP address of an interface connected with the first terminal device. When a first corresponding relation exists, the network equipment sends a second request message to the first equipment according to the first request message, the first corresponding relation is the corresponding relation between a first IP address of the interface and a first indication, the first indication is used for indicating that the first IP address of the interface is preferentially used as the IP address of the terminal equipment applying for the terminal equipment connected with the interface, the second request message comprises the first IP address of the interface, the second request message is used for applying for the IP address of the first terminal equipment, and the IP address of the first terminal equipment and the first IP address of the interface belong to the same network segment. In this embodiment of the present application, when the network device has a corresponding relationship between the first IP address of the interface and the first indication, it indicates that the possibility of applying for the IP address for the first terminal device by using the first IP address is high, so that the IP address can be applied for the first terminal device by using the first IP address, that is, the bandwidth of the network device is saved while the success rate of the application is ensured.
Optionally, when the network device receives the request packet from the first terminal device for the first time, that is, the first request packet, the method further includes: the first request message includes an identifier of the first terminal device. After the network device receives the first request packet from the first terminal device, the method further includes: the network device stores an identification of the first terminal device. If the first device does not have the IP address which is in the same network segment as the first IP address and can be allocated, the first terminal device needs to reinitiate the request message for the applied IP address, and at this time, the network device cannot apply for the IP address for the first terminal device by using the first IP address which has failed to apply for the first terminal device, but needs to apply for the IP address by using another address. Specifically, the method further comprises: and the network equipment receives a third request message from the first terminal equipment, wherein the second request message is used for applying for the IP address of the first terminal equipment. When the identifier of the first terminal device exists in the network device, the network device is considered to have applied for the IP address for the first terminal device but failed to apply, so the network device obtains the second IP address of the interface connected with the first terminal device. And the network equipment sends a fourth request message to the first equipment according to the third request message, wherein the fourth request message comprises a second IP address of the interface, the fourth request message is used for applying for the IP address of the first terminal equipment, and the IP address of the first terminal equipment and the second IP address of the interface belong to the same network segment. That is, when the application by using the first IP address fails, the network device re-applies by using the second IP address to improve the application success rate and save the bandwidth of the network device. The second IP address may be any one of IP addresses corresponding to interfaces to which the first terminal is connected, except for the first IP address.
Further, after the network device receives the first reply packet from the first device, the method further includes: and the network equipment generates a second corresponding relation, wherein the second corresponding relation is the corresponding relation between a second IP address of the interface and a second indication, and the second indication is used for indicating that the second IP address of the interface which is preferentially used is the IP address of the terminal equipment which is connected with the interface and applies for the terminal equipment. The first response message is used for indicating that the IP address of the second terminal equipment is successfully allocated. That is, if the network device uses the second IP address to successfully apply for the IP address of the first terminal device, the network device may generate the second corresponding relationship, and the second corresponding relationship is used to subsequently apply for the IP address of the terminal device, so as to save the bandwidth of the network device on the premise of ensuring successful application. Optionally, the network device may also delete the previously stored identifier of the first terminal device.
Optionally, the first corresponding relationship may be implemented by: the network equipment receives a fifth request message from the second terminal equipment through the interface, wherein the fifth request message is used for applying for the IP address of the second terminal equipment; the network equipment sends a sixth request message to the first equipment, wherein the sixth request message comprises a first IP address of an interface, and the interface is connected with the second terminal equipment; the network device receives a second response message sent by the first device according to the sixth request message, wherein the second response message comprises an IP address of the second terminal device, and the IP address of the second terminal device and the first IP address of the interface belong to the same network segment; the network equipment sends the IP address of the second terminal equipment to the second terminal equipment; and when the network equipment receives a third response message from the first equipment, the network equipment generates a first corresponding relation, and the third response message is used for indicating that the IP address of the second terminal equipment is successfully distributed. That is, the first corresponding relationship is automatically generated by the network device according to the successful application of the IP address for the second terminal device. It is understood that the first corresponding relationship may be configured in advance, and the present application is not limited specifically.
In a second aspect, an embodiment of the present application provides an address application apparatus, where the apparatus is applied to a network device, and the apparatus includes: a first receiving unit, configured to receive a first request packet from a first terminal device, where the first request packet is used to apply for an internet protocol IP address of the first terminal device; a first acquiring unit, configured to acquire a first IP address of an interface connected to a first terminal device; the first sending unit is used for sending a second request message to the first equipment according to the first request message when a first corresponding relation exists, the first corresponding relation is the corresponding relation between a first IP address of the interface and a first indication, the first indication is used for indicating that the first IP address of the interface which is preferentially used is the IP address of the terminal equipment which is connected with the interface and applies for the terminal equipment, the second request message comprises the first IP address of the interface, the second request message is used for applying for the IP address of the first terminal equipment, and the IP address of the first terminal equipment and the first IP address of the interface belong to the same network segment.
Optionally, the first request message includes an identifier of the first terminal device; the device still includes: the storage unit is used for storing the identifier of the first terminal device after receiving the first request message from the first terminal device.
Optionally, the apparatus further comprises: a second receiving unit, configured to receive a third request packet from the first terminal device, where the second request packet is used to apply for an IP address of the first terminal device; a second acquiring unit configured to acquire a second IP address of an interface connected to the first terminal device when the identifier of the first terminal device is present in the storage unit; and the second sending unit is used for sending a fourth request message to the first equipment according to the third request message, wherein the fourth request message comprises a second IP address of the interface, the fourth request message is used for applying for the IP address of the first terminal equipment, and the IP address of the first terminal equipment and the second IP address of the interface belong to the same network segment.
Optionally, the apparatus further comprises: the first generating unit is configured to generate a second corresponding relationship when receiving a first response message from the first device, where the second corresponding relationship is a corresponding relationship between a second IP address of the interface and a second indication, the second indication is used to indicate that the second IP address that preferentially uses the interface is an IP address of a terminal device that is connected to the interface and applies for the terminal device, and the first response message is used to indicate that the IP address of the second terminal device is successfully allocated.
Optionally, the apparatus further comprises: a second receiving unit, configured to receive a fifth request packet from the second terminal device through the interface, where the fifth request packet is used to apply for an IP address of the second terminal device; a third sending unit, configured to send a sixth request packet to the first device, where the sixth request packet includes a first IP address of an interface, and the interface is connected to the second terminal device; a third receiving unit, configured to receive a second response message sent by the first device according to the sixth request message, where the second response message includes an IP address of the second terminal device, and the IP address of the second terminal device and the first IP address of the interface belong to the same network segment; a fourth sending unit, configured to send the IP address of the second terminal device to the second terminal device; the second generating unit is further configured to generate the first corresponding relationship when the network device receives a third response packet from the first device, where the third response packet is used to indicate that the IP address of the second terminal device is successfully allocated.
In a third aspect, an embodiment of the present application provides an address application device, where the device includes: a processor and a memory; a memory to store instructions; and the processor is used for executing the instructions in the memory and executing the address application method.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which is characterized by including instructions, when the instruction is executed on a computer, causing the computer to execute the address application method.
Drawings
FIG. 1 is a schematic diagram of a system 100 provided by an embodiment of the present application;
fig. 2 is a flowchart of an address application method provided in an embodiment of the present application;
fig. 3 is a block diagram of an address application apparatus according to an embodiment of the present disclosure;
fig. 4 is a hardware architecture diagram of an address application apparatus according to an embodiment of the present disclosure.
Detailed Description
In a conventional manner, when an interface of the relay receiving the first packet corresponds to a plurality of interface IP addresses, the relay generates a plurality of second packets according to the plurality of interface IP addresses, and each second packet carries one of the interface IP addresses. For example, the interface for the relay to receive the first message corresponds to three interface IP addresses, which are 10.1.1.1, 11.1.1.1, and 12.1.1.1, respectively. Then, the relay generates three second packets, and each of the three second packets carries one of the three interface IP addresses.
After the server receives the plurality of second messages, the address pool of the network segment to which the interface IP address belongs is found according to the interface IP address carried by each second message in the plurality of second messages, and the IP address of the network segment to which the interface IP address belongs is stored in the address pool. For example, the network segment to which the interface IP address 10.1.1.1 belongs is 10.1.1.0, the network segment to which the interface IP address 11.1.1.1 belongs is 11.1.1.0, and the network segment to which the IP address 12.1.1.1 belongs is 12.1.1.0.
If the IP address which can be distributed exists in the address pool, the server sends a third message to the relay, and the third message carries the IP address distributed by the relay for the client.
And after receiving the third message, the Relay sends the IP address carried in the third message to the Client. If the server allocates a plurality of IP addresses to the client according to the plurality of second messages, the client needs to select a proper IP address from the plurality of IP addresses as the IP address of the client. When a certain IP address is selected, the client sends out a broadcast message through the relay and informs the server of the selected IP address. After receiving the broadcast message, the Server determines that the selected IP address is allocated, and other IP addresses not selected by the client are released by the corresponding servers, namely, the IP addresses are still in a state to be allocated.
It can be seen that, since the client only selects one IP address as its IP address, the relay transfers messages between the client and the server for all other IP addresses that are not selected, which results in waste of bandwidth.
In order to solve the technical problem, embodiments of the present application provide an address application method, apparatus, and device, which reduce the waste of bandwidth in the process of a client applying for an IP address.
For convenience of understanding, an application scenario of the embodiment of the present application is first described.
Referring to fig. 1, a schematic diagram of a system 100 provided in an embodiment of the present application is shown.
In fig. 1, the system 100 includes a terminal device 101, a network device 102, and a device 103. The terminal device 101 is connected to the network device 102, and the network device 102 is connected to the device 103.
The terminal device 101 may deploy a DHCP client therein. The terminal 101, which may also be referred to as a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), a terminal, etc., is a device for providing voice and/or data connectivity to a user, or a chip disposed in the device, such as a handheld device with a wireless connection function, a vehicle-mounted device, etc. Currently, some examples of terminal devices are: a mobile phone, a desktop computer, a tablet computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), a wearable device, a Virtual Reality (VR) device, an Augmented Reality (AR) device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety, a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), a home gateway device (5G-gateway, 5G-RG) supporting 5G access, and the like.
A DHCP relay may be deployed in the network device 102. Network device 102 may be a router, switch, or like forwarding device.
The device 103 may deploy a DHCP server, which may specifically be a server or a terminal device.
Referring to fig. 2, the figure is a flowchart of an address application method provided in the embodiment of the present application.
The address application method provided by the embodiment of the present application is described below with reference to fig. 1 and fig. 2.
S101: the terminal device T1 sends a request message R1 to the network device.
In the embodiment of the present application, the terminal device T1 may be, for example, the terminal device 101 in fig. 1, and the network device may be, for example, the network device 102 in fig. 1. In the embodiment of the present application, the request message R1 sent by the terminal device T1 to the network device is used to apply for the IP address of the terminal device T1. In practical applications, the request message R1 may be a discovery (discover) message, and the discovery message may be sent out in a broadcast manner.
S102: the network device receives the request message R1 from the terminal device T1.
S103: the network device obtains the IP address P1 of the interface connected to the terminal device T1, and generates a request message R2 according to the request message R1 and the IP address P1, and stores the identifier of the terminal device T1.
In the embodiment of the present application, when an interface connected to the terminal device T1, that is, an interface of the network device that receives the request message R1, corresponds to multiple IP addresses, an IP address, that is, the IP address P1, may be determined from the multiple IP addresses. The determining manner may be to randomly select one IP address from a plurality of IP addresses, or to select an IP address with the highest priority from the plurality of IP addresses, and the like, and the application is not particularly limited.
For example, see table 1, which is an example of IP addresses and priorities of interfaces connected to the terminal device T1 stored for the network device.
TABLE 1
IP address | Priority level |
10.1.1.1 | 1 |
11.1.1.1 | 0 |
12.1.1.1 | 0 |
Table 1 shows three IP addresses of interfaces connected to the terminal device T1, which are 10.1.1.1, 11.1.1.1, and 12.1.1.1, respectively. At the time of table generation, 10.1.1.1 may be defaulted to the highest priority IP address. The network device determines 10.1.1.1 as IP address P1 from the table.
After determining the IP address P1, the network device generates a request message R2, which carries the IP address P1 in the request message R2.
Optionally, the network device may record the event after receiving the request message R1 from the terminal device T1 for the first time. The recording may be by acquiring and storing the identification of the terminal device T1. The identifier of the terminal T1 is, for example, a Media Access Control (MAC) address of the terminal T1, and the application is not particularly limited. The manner in which the network device obtains the identifier of the terminal device T1 may be, for example, that the terminal device carries the identifier of the terminal device T1 in the request message R1.
S104: the network device sends a request message R2 to the first device.
In the embodiment of the present application, the first device may be, for example, the device 103 in fig. 1.
S105: the first device receives the request message R2, and determines whether there is an IP address P2 belonging to the same network segment as the IP address P1 according to the IP address P1 in the request message R2, and if so, executes S106.
In the embodiment of the present application, as mentioned above, after receiving the request message R2, the first device determines the address pool of the network segment according to the IP address P1 of the request message R2, then determines an unassigned IP address, such as the IP address P2, from the address pool, and then executes S106. That is, the IP address P2 and the IP address P1 belong to the same network segment. For example, if the IP address P1 is 10.1.1.1, then the IP address P2 may be, for example, 10.1.1.100, both belonging to the network segment 10.1.1.0.
In practical applications, after determining the IP address P2, the first device may generate a corresponding tag for the IP address P2, where the tag is used to indicate that the IP address P2 is in an allocation pending state. If the IP address P2 is successfully assigned, the label is changed to the assigned state.
If there is no unassigned IP address in the address pool, the first device may not do subsequent processing.
S106: the first device sends a response message S1 to the network device, where the response message S1 carries the IP address P2.
In the embodiment of the present application, the response message may be, for example, an offer (offer) message.
S107: the network device sends the response message S1 to the terminal device T1.
S108: the terminal device T1 receives the reply message S1 within a preset time period, and acquires the IP address P2 from the reply message S1.
S109: the terminal device T1 confirms whether the IP address P2 is available, and if so, performs S110.
In the case of a large number of terminal devices, the first device may assign the same IP address to a plurality of terminal devices, and in this case, if one of the terminal devices occupies the IP address as its own IP address, the other terminal devices cannot be used any more. Therefore, in this embodiment of the present application, after acquiring the IP Address P2, the terminal device T1 may send an Address Resolution Protocol (ARP) message to other terminal devices, where the ARP message includes the IP Address P2, and is used to determine whether the IP Address P2 is occupied by other terminal devices, and if so, the IP Address P2 is unavailable; if not occupied, the IP address P2 is available, i.e. can be used as the IP address of the terminal device T1.
If the terminal device T1 confirms that the IP address P2 is available, the terminal device T1 determines the IP address P2 as the IP address of the terminal device T1. If the terminal device T1 confirms that the IP address P2 is unavailable, a reject message is sent to the network device, where the reject message is used to indicate that the IP address P2 is unavailable.
If not, the network device resends the request message R2 to the first device. After receiving the request message R2, the first device determines the address pool of the network segment according to the IP address P1 in the request message R2, and then determines an unassigned IP address from the address pool. Since the IP address P2 is occupied as confirmed by the terminal device T1, the IP address P2 is now in an allocated state. Then the first device determines that the unassigned IP address is, for example, IP address P3, IP address P3, and IP address P1, belong to the same network segment. Then, the first device transmits the IP address P3 to the terminal device T1 through the network device, and the terminal device T1 confirms again whether the IP address P3 is available.
S110: the terminal device T1 sends a request message R3 to the network device, where the request message R3 includes an IP address P2.
In the embodiment of the present application, the request message R3 is used to notify the first device that the IP address P2 is selected by the terminal device. Optionally, the request message R3 may further include an IP address of the first device, so that the network device can send the request message R3 to the first device assigned with the IP address P2.
S111: the network device sends a request message R3 to the first device.
Optionally, the network device sends the request message R3 to the first device according to the IP address of the first device in the request message R3.
S112: the first device receives the request message R3 and sends a reply message S2 to the network device.
In the embodiment of the present application, after receiving the request message R3, the first device confirms the IP address P2 as the allocated IP address. The response message S2 sent by the first device to the network device is used to inform the network device that the IP address P2 was successfully allocated. The response message S2 is, for example, an ACK message. Optionally, the response message S2 may carry a use lease of the IP address P2, where the use lease is a time when the terminal device can use the IP address P2 as its own IP address.
S113: the network device receives the response message S2, and generates a first corresponding relationship, where the first corresponding relationship is a corresponding relationship between the IP address P1 and a first indication, and the first indication is used to indicate that the IP address P1 is preferentially used to apply for an IP address for the terminal device connected to the interface, and delete the identifier of the terminal device T1.
As mentioned above, if the network device determines the IP address P1 randomly from a plurality of IP addresses corresponding to the interfaces, the network device generates the first corresponding relationship when receiving the response message S2. The first indication in the first correspondence may be, for example, a priority as shown in table 1. That is, the priority of the IP address P1 is set to the highest priority, and the priorities of the other IP addresses are lower than the priority of the IP address P1.
Of course, if the network device determines the IP address P1 based on table 1, then the first correspondence need not be generated.
After the first corresponding relationship is generated, if the network device receives the request message from the interface corresponding to the first corresponding relationship, the network device may directly apply for the IP address from the first device according to the IP address P1 in the first corresponding relationship.
In addition, since the response message S2 indicates that the IP address of the terminal device T1 was successfully allocated, the network device may delete the previous record of receiving the request message R1, for example, delete the stored identification of the terminal device T1.
S114: the network device sends a response message S2 to the terminal device T1.
When the terminal device T1 receives the response message S2, it can use the IP address P2 as its own IP address.
The flow ends.
S115: when the terminal device T1 does not receive the response message S1 within the preset time period, the terminal device T1 sends the request message R1 to the network device again.
In this embodiment, when there is no unallocated IP address belonging to the same network segment as the IP address P1 in the address pool of the first device, the terminal device T1 does not receive the response message S1 within the preset time period, and at this time, the terminal device T1 initiates the request message R1 to the network device again to apply for the IP address again.
S116: the network device receives the request message R1, determines that the identifier of the terminal device T1 exists, deletes the first correspondence, and obtains the IP address P3 corresponding to the interface connected to the terminal device T1.
When the network device receives the request message R1 again, it is determined that there is a record of the previous received request message R1, for example, it is confirmed that the network device stores the identifier of the terminal device T1, which indicates that the application to the IP address was not successfully performed for the terminal device T1 last time. The network device may delete the first correspondence and apply for the IP address of the terminal device T1 using the other IP address under the interface connected with the terminal device T1.
It is understood that the IP address P3 is different from the IP address P1. For example, IP address P1 is 10.1.1.1 and IP address P3 is 11.1.1.1.
S117: the network device sends a request message R4 to the first device, the request message R4 including an IP address P3.
S118: the first device receives the request message R4, and determines the IP address P4 belonging to the same network segment with the first device according to the IP address P3.
S119: the first device sends a reply message S4 to the network device, the reply message S4 including the IP address P4.
S120: the network device receives the response message S4 and forwards the response message to the terminal device T1.
S121: the terminal device T1 acquires the IP address P4 from the response message S4, then confirms whether the IP address P4 is available, and if so, executes S122.
S122: the terminal device T1 sends a request message R5 to the network device, where the request message R5 includes an IP address P4.
Optionally, the request message R5 further includes an IP address of the first device.
S123: the network device sends a request message R5 to the first device.
Optionally, the network device sends the request message R5 to the first device according to the IP address of the first device.
S124: the first device receives the request message R5 and sends a reply message S5 to the network device.
In this embodiment, the response message S5 is used to indicate that the first device determines that the IP address P4 is successfully allocated to the terminal device T1. Optionally, the response message S5 further includes a lease term for the IP address P4.
S125: the network device generates a second corresponding relationship according to the response message S5, where the second corresponding relationship is a corresponding relationship between the IP address P3 and the second indication, and deletes the identifier of the terminal device T1.
As mentioned above, the second indication is used to indicate that the IP address P3 is preferentially used to apply for the IP address of the terminal device connected to the interface, that is, if the subsequent network device receives the request message from the interface corresponding to the IP address P3, the IP address can be applied to the first device according to the IP address P3. For example, if the network device receives the request packet from the terminal device T2, the interface where the terminal device T2 is connected to the network device is the same interface as the interface where the terminal device T1 is connected to the network device, the network device may send the request packet including the IP address P3 to the first device, that is, the first device is applied for the IP address of the terminal device T2 according to the IP address P3.
S126: the network device sends a response message S5 to the terminal device T1.
In this embodiment, when the IP address P1 corresponding to the interface of the network device is successfully used to allocate an IP address to the terminal device T1, that is, the IP address P2 allocated by the first device to the terminal device T1 is available and belongs to the same network segment as the IP address P1, a corresponding relationship between the IP address P1 and a first indication may be generated, where the first indication is used to indicate that a subsequent network device may apply for an address for the terminal device (e.g., the terminal device T2) by using the IP address again.
In the process, two links save network bandwidth, one is that when the network device applies for the IP address of the terminal device T1, only one IP address of the interface is sent to the first device each time, for example, the IP address P1 is sent first, and if the application for the IP address of the terminal device T1 is successful according to the IP address P1, the other IP addresses of the interface do not need to be sent to the first device to apply for the IP address of the terminal device T1.
The second link of saving bandwidth is that when an IP address of an interface is a successful IP address application for the terminal device T1, a corresponding relationship between the IP address of the interface and an indication, such as the first corresponding relationship or the second corresponding relationship, may be generated, so that the interface receives a request message next time, the interface IP address with the indication is preferentially used to apply for the IP address of the terminal device, thereby increasing the possibility of successful application, and if the application is unsuccessful, the other IP addresses of the interface are used to apply for, thereby reducing the pressure of the network device and saving bandwidth resources.
Referring to fig. 3, a block diagram of an address application apparatus 300 according to an embodiment of the present application is provided.
The address application apparatus 300 provided in the embodiment of the present application may be applied to a network device, and implement the functions of the network device in the embodiment shown in fig. 2.
The address application apparatus 300 includes: a first receiving unit 301, a first obtaining unit 302 and a first sending unit 303. Specifically, the first receiving unit 301 is configured to receive a first request packet from a first terminal device, where the first request packet is used to apply for an internet protocol IP address of the first terminal device; a first obtaining unit 302, configured to obtain a first IP address of an interface connected to a first terminal device; a first sending unit 303, configured to send a second request packet to the first device according to the first request packet when a first corresponding relationship exists, where the first corresponding relationship is a corresponding relationship between a first IP address of the interface and a first indication, the first indication is used to indicate that the first IP address that preferentially uses the interface is an IP address of a terminal device that is connected to the interface and applies for the terminal device, the second request packet includes the first IP address of the interface, the second request packet is used to apply for the IP address of the first terminal device, and the IP address of the first terminal device and the first IP address of the interface belong to the same network segment.
Optionally, the first request message includes an identifier of the first terminal device; the device still includes: the storage unit is used for storing the identifier of the first terminal device after receiving the first request message from the first terminal device.
Optionally, the apparatus further comprises: a second receiving unit, configured to receive a third request packet from the first terminal device, where the second request packet is used to apply for an IP address of the first terminal device; a second obtaining unit, configured to obtain a second IP address of an interface connected to the first terminal device when the identifier of the first terminal device exists in the storage unit; and the second sending unit is used for sending a fourth request message to the first equipment according to the third request message, wherein the fourth request message comprises a second IP address of the interface, the fourth request message is used for applying for the IP address of the first terminal equipment, and the IP address of the first terminal equipment and the second IP address of the interface belong to the same network segment.
Optionally, the apparatus further comprises: the first generating unit is configured to generate a second corresponding relationship when receiving a first response message from the first device, where the second corresponding relationship is a corresponding relationship between a second IP address of the interface and a second indication, the second indication is used to indicate that the second IP address that preferentially uses the interface is an IP address of a terminal device that is connected to the interface and applies for the terminal device, and the first response message is used to indicate that the IP address of the second terminal device is successfully allocated.
Optionally, the apparatus further comprises: a second receiving unit, configured to receive a fifth request packet from the second terminal device through the interface, where the fifth request packet is used to apply for an IP address of the second terminal device; a third sending unit, configured to send a sixth request packet to the first device, where the sixth request packet includes a first IP address of an interface, and the interface is connected to the second terminal device; a third receiving unit, configured to receive a second response message sent by the first device according to the sixth request message, where the second response message includes an IP address of the second terminal device, and the IP address of the second terminal device and the first IP address of the interface belong to the same network segment; a fourth sending unit, configured to send the IP address of the second terminal device to the second terminal device; the second generating unit is further configured to generate the first corresponding relationship when the network device receives a third response packet from the first device, where the third response packet is used to indicate that the IP address of the second terminal device is successfully allocated. For a detailed description of the address application apparatus 300, please refer to the above method embodiments, which are not described herein again.
Correspondingly, the embodiment of the present application further provides an address application device corresponding to the address application apparatus 300, including a processor and a memory; a memory to store instructions; and the processor is used for executing the instructions in the memory and executing the address application method executed by the network equipment provided in the method embodiment.
The hardware configuration of the address application device corresponding to the address application apparatus 300 may be as shown in fig. 4. Fig. 4 is a schematic structural diagram of an address application device according to an embodiment of the present application.
Referring to fig. 4, the apparatus 400 includes: a processor 410, a communication interface 420, and a memory 430. Wherein the number of the processors 410 in the device 400 may be one or more, and one processor is taken as an example in fig. 4. In the embodiment of the present application, the processor 410, the communication interface 420 and the memory 430 may be connected by a bus system or other means, wherein fig. 4 illustrates the connection by the bus system 440.
The processor 410 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. The processor 410 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory 430 may include a volatile memory (english: volatile memory), such as a random-access memory (RAM); the memory 430 may also include a non-volatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (HDD) or a solid-state drive (SSD); the memory 430 may also comprise a combination of memories of the kind described above.
Optionally, memory 430 stores an operating system and programs, executable modules or data structures, or subsets thereof, or extensions thereof, wherein the programs may include various operating instructions for performing various operations. The operating system may include various system programs for implementing various basic services and for handling hardware-based tasks. The processor 410 can read the program in the memory 430 to implement the method for adjusting the traffic flow provided by the embodiment of the present application.
The bus system 440 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus system 440 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
An embodiment of the present application further provides an address application system, which includes a terminal device and a network device, where the terminal device may perform the steps of the terminal device in the embodiment shown in fig. 2, and the network device may perform the steps of the network device in the embodiment shown in fig. 2.
An embodiment of the present application further provides an address application system, which includes a network device and a first device, where the network device may perform the steps of the network device in the embodiment shown in fig. 2, and the first device may perform the steps of the first device in the embodiment shown in fig. 2.
An embodiment of the present application further provides an address application system, including a terminal device, a network device, and a first device, where the terminal device may perform the steps of the terminal device in the embodiment shown in fig. 2, the network device may perform the steps of the network device in the embodiment shown in fig. 2, and the first device may perform the steps of the first device in the embodiment shown in fig. 2.
Embodiments of the present application also provide a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform the method provided by the above method embodiments and executed by a network device.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical module division, and other division manners may be available in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be obtained according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, each module unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a hardware form, and can also be realized in a software module unit form.
The integrated unit, if implemented as a software module unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in this invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The above-described embodiments are intended to explain the objects, aspects and advantages of the present invention in further detail, and it should be understood that the above-described embodiments are merely exemplary embodiments of the present invention.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911223340.XA CN112911026A (en) | 2019-12-03 | 2019-12-03 | Address application method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911223340.XA CN112911026A (en) | 2019-12-03 | 2019-12-03 | Address application method, device and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112911026A true CN112911026A (en) | 2021-06-04 |
Family
ID=76104298
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911223340.XA Pending CN112911026A (en) | 2019-12-03 | 2019-12-03 | Address application method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112911026A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113645324A (en) * | 2021-08-04 | 2021-11-12 | 湖北美和易思教育科技有限公司 | IP distribution method and system based on queue |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1889572A (en) * | 2006-07-27 | 2007-01-03 | 杭州华为三康技术有限公司 | Internet protocol address distributing method and dynamic main machine configuration protocol relay |
CN102404418A (en) * | 2011-11-18 | 2012-04-04 | 华为数字技术有限公司 | Method, device and system for allocating IP address to user terminal |
CN107547684A (en) * | 2017-08-15 | 2018-01-05 | 新华三技术有限公司 | A kind of IPv6 address distribution methods and device |
WO2018155908A1 (en) * | 2017-02-22 | 2018-08-30 | 엘지전자(주) | Method for transmitting or receiving data through relay in wireless communication system and apparatus therefor |
-
2019
- 2019-12-03 CN CN201911223340.XA patent/CN112911026A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1889572A (en) * | 2006-07-27 | 2007-01-03 | 杭州华为三康技术有限公司 | Internet protocol address distributing method and dynamic main machine configuration protocol relay |
CN102404418A (en) * | 2011-11-18 | 2012-04-04 | 华为数字技术有限公司 | Method, device and system for allocating IP address to user terminal |
WO2018155908A1 (en) * | 2017-02-22 | 2018-08-30 | 엘지전자(주) | Method for transmitting or receiving data through relay in wireless communication system and apparatus therefor |
CN107547684A (en) * | 2017-08-15 | 2018-01-05 | 新华三技术有限公司 | A kind of IPv6 address distribution methods and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113645324A (en) * | 2021-08-04 | 2021-11-12 | 湖北美和易思教育科技有限公司 | IP distribution method and system based on queue |
CN113645324B (en) * | 2021-08-04 | 2023-09-29 | 武汉美和易思数字科技有限公司 | Queue-based IP distribution method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111432044B (en) | Multi-link equipment MAC address management method and device and multi-link equipment | |
US9729501B2 (en) | System and data card for stateless automatic configuration of IPv6 address and method for implementing the same | |
CN108307002B (en) | A kind of DHCP message processing method and device | |
EP3264731B1 (en) | Method, relay agent, and system for acquiring internet protocol address in network | |
US10979285B2 (en) | Service transmission method, device, and system | |
CN106657330B (en) | User data migration method and user data backup method, device and system | |
EP2434703A1 (en) | Method and terminal for transmitting service data | |
US9438557B2 (en) | Adaptive dynamic host configuration protocol assignment with virtual local area network pool | |
CN102647486A (en) | Address allocation method, device and system | |
CN102843441B (en) | Method and device for controlling address configuration way | |
CN108989476B (en) | Address allocation method and device | |
CN103384282B (en) | The method and BRAS of a kind of acquisition IPV6ND addresses | |
WO2018058620A1 (en) | Ip address allocation method and device | |
CN101873320B (en) | Client information verification method based on DHCPv6 relay and device thereof | |
US20180083918A1 (en) | Information processing system, proxy server, address duplication prevention method, and computer-readable recording medium | |
CN109120741B (en) | Duplicate address detection method and device and computer readable storage medium | |
CN108429822B (en) | Communication system, IPv6 address allocation method and device and distributed gateway | |
CN111669309B (en) | A method for establishing VxLAN, wireless controller and switch | |
CN112911026A (en) | Address application method, device and equipment | |
CN109088955B (en) | Message processing method and device | |
CN108259636B (en) | Message processing method and device | |
WO2018006684A1 (en) | Message processing method and device, and router | |
CN104025490B (en) | The method of resource request, server and resource allocation system | |
CN102860116B (en) | A kind of connection reconstruction method, apparatus and system | |
CN114124737B (en) | Method and device for controlling user equipment to access network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210604 |
|
WD01 | Invention patent application deemed withdrawn after publication |