CN110401730B - IP address generation method and device - Google Patents

IP address generation method and device Download PDF

Info

Publication number
CN110401730B
CN110401730B CN201910675426.XA CN201910675426A CN110401730B CN 110401730 B CN110401730 B CN 110401730B CN 201910675426 A CN201910675426 A CN 201910675426A CN 110401730 B CN110401730 B CN 110401730B
Authority
CN
China
Prior art keywords
message
packet
address
time
lifetime
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.)
Active
Application number
CN201910675426.XA
Other languages
Chinese (zh)
Other versions
CN110401730A (en
Inventor
林大伟
陈登
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910675426.XA priority Critical patent/CN110401730B/en
Publication of CN110401730A publication Critical patent/CN110401730A/en
Application granted granted Critical
Publication of CN110401730B publication Critical patent/CN110401730B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/659Internet protocol version 6 [IPv6] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/72Routing based on the source address
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Abstract

The application provides an IP address generation method and device, after an electronic device constructs a first IP address according to a RA message at a first time point, a reconstruction period is determined according to the first RA message, when a first time length between a second time point when the electronic device receives a second RA message and the first time point is less than a second time length corresponding to the reconstruction period, the second RA message is discarded, and the IP address is reconstructed according to the second RA message only when the first time length is greater than or equal to the second time length. In the process, whether the IP address is reconstructed or not is determined according to the reconstruction period, and the generation of a new IP address when an RA message is received every time is avoided, so that the purpose of reducing the power consumption of the electronic equipment is achieved.

Description

IP address generation method and device
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to an IP address generation method and device.
Background
With the increasing development of the internet, the number of various networking devices is increasing day by day, so that the original 32-bit Internet Protocol (IP) addresses are gradually exhausted, and the requirements of internet users cannot be met. The internet protocol version 6 (IPv 6) extends the length of the IP address to 128 bits, and can effectively meet the present and future internet access requirements. Common IPv6 address allocation methods include a stateless address auto-configuration (SLAAC) method.
The SLAAC mode belongs to a stateless address allocation mode, and an electronic device receives a Router Advertisement (RA) message broadcasted by a router, extracts prefix information from the RA message, and automatically generates a complete IPv6 address by using the prefix information, wherein the IPv6 address is valid within a period of time, and the period of time is called as a life cycle of an IPv6 address. In the process of generating the IPv6 address, the router broadcasts an RA message, the electronic equipment receives the RA message, analyzes prefix information carried by the RA message, automatically generates an IPv6 address according to the prefix information, and uses a new IPv6 address.
In the process of generating the IPv6 address, once the electronic device receives the RA packet, a new IPv6 address is generated according to the RA packet. In many places, due to some factors, the router broadcasts the RA message frequently, so that the electronic device continuously constructs a new IPV6 address, which results in a serious increase in power consumption of the electronic device.
Disclosure of Invention
The embodiment of the application provides an IP address generation method and device, and the purpose of reducing the power consumption of electronic equipment is achieved by reducing the unreasonable times of reconstructing an IP address.
In a first aspect, an embodiment of the present application provides an IP address generating method, which is described in the context of an electronic device, and includes: the electronic equipment determines a reconstruction period according to the first RA message after constructing the first IP address according to the first RA message at the first time point, discards the second RA message when the first time length between the second time point when the electronic equipment receives the second RA message and the first time point is less than the second time length corresponding to the reconstruction period, and reconstructs the IP address according to the second RA message only when the first time length is greater than or equal to the second time length. By adopting the scheme, the electronic equipment determines whether to reconstruct the IP address according to the reconstruction period, so that the generation of a new IP address when an RA message is received every time is avoided, and the purpose of reducing the power consumption of the electronic equipment is realized.
In a feasible design, a reconstruction period is determined according to a first router broadcast RA message received from a router at a first time point, a first Internet protocol IP address is constructed, the reconstruction period is used for indicating the period of reconstructing the IP address, and a second RA message broadcast by the router is received at a second time point; determining whether a first time length between the first time point and a second time point is greater than or equal to a second time length, wherein the second time length is a time length corresponding to a reconstruction period; and if the first duration is greater than or equal to the second duration, generating a second IP address according to the second RA message. By adopting the scheme, the electronic equipment determines the reconstruction period according to the prefix information option of the first RA message, the life cycle of the default router, the reachable time and the retransmission timer, and determines whether to reconstruct the IP address according to the reconstruction period, so that the generation of a new IP address when the RA message is received every time is avoided, and the purpose of reducing the power consumption of the electronic equipment is realized.
In one possible design, before the electronic device determines whether the first time duration between the first time point and the second time point is greater than or equal to the second time duration, the electronic device further analyzes the first RA message to obtain a prefix information option, a life cycle of a default router, an reachable time, and a retransmission timer; and determining the reconfiguration period according to the prefix information option, the life cycle of the default router, the reachable time and the retransmission timer. By adopting the scheme, the electronic equipment updates the IP address and restarts the timer in time according to the configuration of the router when the configuration of the router changes by comparing the RA messages.
In a feasible design, when the electronic device determines a reconstruction cycle according to a prefix information option, a life cycle of a default router and reachable time, the electronic device analyzes the prefix information option to obtain an effective life cycle and a priority life cycle, wherein the effective life cycle is used for indicating the online effective time of a first RA message prefix and the priority life cycle is used for indicating the effective time of a first IP address in a priority state; and determining the shortest period from the effective life cycle, the priority life cycle, the life cycle of the default router, the reachable time and the retransmission timer, and taking the shortest period as the reconstruction period. By adopting the scheme, the electronic equipment updates the IP address and restarts the timer in time according to the configuration of the router when the configuration of the router changes by comparing the RA messages.
In one possible design, if the first duration is less than the second duration, the electronic device determines whether the first RA message and the second RA message are the same; and if the first RA message is different from the second RA message, constructing a second IP address according to the second RA message. By adopting the scheme, the electronic equipment updates the IP address and restarts the timer in time according to the configuration of the router when the configuration of the router changes by comparing the RA messages.
In a feasible design, the electronic device determines whether the first RA message and the second RA message are the same, and determines whether a check code carried by the first RA message and a check code carried by the second RA message are the same; if the check code carried by the first RA message is different from the check code carried by the second RA message, determining that the first message is different from the second message; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message. By adopting the scheme, the purpose of judging whether the messages are the same or not is realized by comparing the checksums of the RA messages, and compared with the mode of comparing the messages, the mode of comparing the checksums is more efficient.
In a feasible design, if the first RA message is different from the second RA message, the electronic device updates the reconfiguration period according to the second RA message after constructing the second IP address according to the second RA message.
In a second aspect, an embodiment of the present application provides an IP address generating apparatus, including:
a transceiving unit 11, configured to receive a first router broadcast RA packet from a router at a first time point, and receive a second RA packet broadcast by the router at a second time point
A processing unit 12, configured to determine a reconfiguration period according to the first RA packet, and construct a first internet protocol IP address, where the reconfiguration period is used to indicate a period for reconfiguring an IP address, determine whether a first duration between the first time point and the second time point is greater than or equal to a second duration, where the second duration is a duration corresponding to the reconfiguration period, and if the first duration is greater than or equal to the second duration, generate a second IP address according to the second RA packet.
In a feasible design, before determining whether the first duration between the first time point and the second time point is greater than or equal to the second duration, the processing module is further configured to parse the first RA packet to obtain a prefix information option, a lifetime of a default router, an reachable time, and a retransmission timer, and determine the reconfiguration period according to the prefix information option, the lifetime of the default router, the reachable time, and the retransmission timer.
In a feasible design, the processing module is configured to analyze the prefix information option to obtain an effective lifetime and a priority lifetime, where the effective lifetime is used to indicate an online effective time of the first RA packet prefix, and the priority lifetime is used to indicate an effective time of the first IP address in a priority state, and a shortest period is determined from the effective lifetime, the priority lifetime, the lifetime of the default router, the reachable time, and the retransmission timer, and is used as the reconfiguration period.
In a feasible design, the processing module is further configured to determine whether the first RA packet is the same as the second RA packet if the first duration is shorter than the second duration, and construct a second IP address according to the second RA packet if the first RA packet is not the same as the second RA packet.
In a feasible design, the processing module is configured to determine that the first packet is different from the second packet if the check code carried in the first RA packet is determined to be the same as the check code carried in the second RA packet; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message.
In a feasible design, the processing module is further configured to, if the first RA packet is different from the second RA packet, update the reconfiguration period according to the second RA packet after constructing a second IP address according to the second RA packet.
In a third aspect, an embodiment of the present application provides an electronic device, including a first chip and a second chip, wherein,
the first chip is configured to send an RA message broadcast by a first router from a router to a second chip according to a first RA message received at a first time point, determine a reconfiguration period according to the first RA message, receive a second RA message broadcast by the router at a second time point, and send the second RA message to the second chip when a first duration between the first time point and the second time point is greater than or equal to a second duration, where the second duration is a duration corresponding to a reconfiguration period, and the reconfiguration period is used to indicate a period for reconfiguring an IP address;
the second chip is used for constructing a first IP address according to the first RA message at a first time point and constructing a second IP address according to the second RA message at a second time point.
In a feasible design, the first chip is further configured to parse the first RA packet to obtain a prefix information option, a lifetime of the default router, an reachable time, and a retransmission timer, and determine the reconfiguration period according to the prefix information option, the lifetime of the default router, the reachable time, and the retransmission timer.
In a feasible design, the first chip is configured to parse the prefix information option to obtain an effective lifetime and a priority lifetime, where the effective lifetime is used to indicate an online effective time of the prefix of the first RA packet, and the priority lifetime is used to indicate an effective time of the first IP address in a priority state, and the reconfiguration period is determined according to the effective lifetime, the priority lifetime, the lifetime of the default router, and the reachable time.
In a feasible design, the first chip is further configured to determine whether the first RA packet is the same as the second RA packet, and if the first RA packet is not the same as the second RA packet, construct the second IP address according to the second RA packet.
In a feasible design, the first chip is configured to determine whether a check code carried by the first RA message is the same as a check code carried by the second RA message, and if the check code carried by the first RA message is different from the check code carried by the second RA message, determine that the first message is different from the second message; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message.
In a feasible design, the first chip is further configured to update the reconfiguration period according to the second RA packet.
In a fourth aspect, an embodiment of the present application provides an IP address generating apparatus, where the IP address generating apparatus has a behavior function of an electronic device in the foregoing method embodiment. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions. The modules may be software and/or hardware.
In one possible design, the IP address generating apparatus includes a processor and a transceiver, where the processor is configured to determine a reconfiguration period and construct a first internet protocol IP address according to a first router broadcast RA packet from the router received by the transceiver at a first time point, where the reconfiguration period is used to indicate a period for reconfiguring an IP address, receive a second RA packet broadcast by the router at a second time point, determine whether a first duration between the first time point and the second time point is greater than or equal to a second duration, where the second duration is a duration corresponding to the reconfiguration period, and generate a second IP address according to the second RA packet if the first duration is greater than or equal to the second duration.
In a fifth aspect, embodiments of the present application provide a computer program product containing instructions, which when run on an electronic device, cause the electronic device to perform the method of the first aspect or the various possible implementations of the first aspect.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium, which stores instructions that, when executed on an electronic device, cause the electronic device to perform the above-mentioned first aspect or the method in each possible implementation manner of the first aspect.
According to the IP address generation method and device provided by the embodiment of the application, after the electronic equipment constructs the first IP address according to the RA message at the first time point, a reconstruction period is determined according to the first RA message, when the first time length between the second time point when the electronic equipment receives the second RA message and the first time point is less than the second time length corresponding to the reconstruction period, the second RA message is discarded, and the IP address is reconstructed according to the second RA message only when the first time length is greater than or equal to the second time length. In the process, whether the IP address is reconstructed or not is determined according to the reconstruction period, and the generation of a new IP address when an RA message is received every time is avoided, so that the purpose of reducing the power consumption of the electronic equipment is achieved.
Drawings
Fig. 1 is a schematic view of a scenario in which an IP address generation method according to an embodiment of the present application is applied;
fig. 2 is a flowchart of an IP address generation method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a working environment to which the IP address generation method provided in the embodiment of the present application is applied;
fig. 4 is a schematic diagram of a format of an RA packet in the IP address generation method according to the embodiment of the present application;
fig. 5 is a schematic format diagram of a prefix information option of an RA packet in the IP address generation method according to the embodiment of the present application;
fig. 6 is a schematic diagram of a life cycle in a prefix information option in the IP address generation method according to the embodiment of the present application;
fig. 7 is a flowchart of another IP address generation method provided in an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an IP address generating apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an IP address generating apparatus according to an embodiment of the present application.
Detailed Description
With the rapid spread of IPv6, more and more electronic devices use IPv6 addresses. The common IPv6 address allocation method is the SLAAC method. In the SLAAC mode, the electronic device automatically constructs an IPv6 address according to prefix information of a received RA packet, so that the electronic device can be connected to an IPv6 network very conveniently, and can be used in a plug-and-play manner without manually configuring a redundant IPv6 address or deploying a Dynamic Host Configuration Protocol (DHCP) server. Based on the SLAAC mode, the router can flexibly set the life cycle of the IPv6 address in the RA message, so that smooth transition of a new IPv6 address and an old IPv6 address of the electronic equipment is realized. However, due to the problem of router network configuration, the router frequently sends a Router Advertisement (RA) message, so that the electronic device frequently reconstructs an IPv6 address according to the newly received RA message, and overwrites the old IPv6 address with the new IPv6 address. For example, after the electronic device constructs the IP address each time, a timer is started, the duration of the timer is a valid life cycle of the IP address, for example, 8 hours, 12 hours, and the IP address is invalid after the timer expires. Before the IP address is invalid, if the electronic equipment receives a new RA message, the IPv6 address is reconstructed according to the RA message, the new IPv6 address is used, a new timer is started according to the information in the new RA message, and the previous timer and the old IPv6 address are discarded. It is clear that frequent reconstruction of IPv6 addresses results in increased power consumption of electronic devices.
In view of this, embodiments of the present application provide an IP address generation method and apparatus, which determine whether to reconstruct an IP address according to a reconstruction period, so as to avoid generating a new IP address each time an RA packet is received, thereby achieving a purpose of reducing power consumption of an electronic device.
The electronic devices referred to in the embodiments of the present application may be devices capable of providing voice and/or data connectivity to a user, handheld devices with wireless connectivity, other processing devices connected to a wireless modem. In an embodiment of the present application, the electronic device may communicate with one or more core networks or the internet through a router via a Radio Access Network (RAN), and may be a mobile electronic device, such as a mobile phone (or "cellular" phone), a computer, and a data card, for example, a portable, pocket, hand-held, computer-embedded, or vehicle-mounted mobile device, which exchanges languages and/or data with the RAN. Examples of such devices include Personal Communication Service (PCS) phones, cordless phones, Session Initiation Protocol (SIP) phones, Wireless Local Loop (WLL) stations, Personal Digital Assistants (PDAs), tablet computers (pads), and computers with wireless transceiving functions. A wireless electronic device may also be referred to as a system, a subscriber unit (subscriber unit), a subscriber station (subscriber station), a mobile station (mobile station), a Mobile Station (MS), a remote station (remote station), an Access Point (AP), a remote electronic device (remote terminal), an access electronic device (access terminal), a user electronic device (user terminal), a user agent (user agent), a Subscriber Station (SS), a user equipment (CPE), a terminal (terminal), a User Equipment (UE), a Mobile Terminal (MT), etc. The wireless electronic device may also be a wearable device and a next generation communication system, e.g. an electronic device in a 5G network or an electronic device in a Public Land Mobile Network (PLMN) network for future evolution, an electronic device in an NR communication system, etc.
Fig. 1 is a schematic view of a scenario in which the IP address generation method according to the embodiment of the present application is applied. Referring to fig. 1, the scenario includes: the electronic equipment is connected with the router, the electronic equipment is connected with the wireless access network through the router, and then the electronic equipment is communicated with one or more core networks or the Internet. In this embodiment, the router broadcasts the RA message, and the electronic device determines whether to reconstruct the IP address according to the content of the RA message, thereby solving the problem of increased power consumption caused by the electronic device frequently constructing the IP address according to the RA message.
Next, based on the architecture shown in fig. 1, the IP address generation method according to the embodiment of the present application will be described in detail. For example, see fig. 1.
Fig. 2 is a flowchart of an IP address generation method according to an embodiment of the present application. The present embodiment is explained from the perspective of an electronic device, and the present embodiment includes:
101. the router broadcasts a first RA message at a first time point.
Correspondingly, the electronic device receives the first RA packet at a first time point.
102. Determining a reconstruction period according to a first router broadcast RA message received from a router at a first time point, and constructing a first Internet Protocol (IP) address.
Wherein the reconfiguration period is used for indicating a period for reconfiguring the IP address. The first IP address corresponds to a lifetime, which is, for example, 8 hours, 6 hours, 12 hours, etc., and the reconfiguration period corresponds to a first and second duration, which is, for example, 4 hours, 6 hours, etc.
For example, when the electronic device first accesses the network, after receiving the first RA packet, determine a reconfiguration period according to the first RA packet, analyze prefix information of the first RA packet, and automatically generate a first IP address according to the prefix information, where the IP address is, for example, an IPv6 unicast address. Typically, an IPv6 address has a lifetime, also referred to as the lifetime of the IPv6 address.
For another example, after the electronic device establishes wireless connection with the router and the life cycle of the current IP address is finished, the electronic device receives the first RA packet and generates the first IP address based on prefix information carried in the first RA packet.
For another example, after the electronic device establishes wireless connection with the router, in the life cycle of the current IP address, the electronic device receives a first RA message, where the first RA message indicates that the configuration of the router changes, and at this time, the electronic device determines a reconfiguration period according to the first RA message, and generates the first IP address based on prefix information carried in the first RA message.
103. And receiving a second RA message broadcast by the router at a second time point.
For example, if the router broadcasts the RA packet according to the first cycle, the electronic device receives the RA packet according to the first cycle. At this time, the duration between the first time point and the second time point is just the duration corresponding to the first period, that is, the period of sending the RA packet by the router. Assuming that the first period is 10 seconds, the router sends an RA message every 10 seconds. When the first time point is 12:00, the second time point is 10 seconds past 12 points.
For another example, when the configuration of the router at the second time point is changed, the router sends the second RA packet in time, where the first time length between the second time point and the first time point may be a time length corresponding to the first period or may be shorter than the time length corresponding to the first period. Assuming that the first period is 10 seconds, the router sends an RA message every 10 seconds. If the first time point is 12:00 and the configuration of the router changes when 5 seconds pass the 12 point, the second time point is 5 seconds pass the 12 point.
104. Determining whether a first time length between the first time point and the second time point is greater than or equal to a second time length, and if the first time length is greater than or equal to the second time length, executing step 105; if the first duration is less than the second duration, step 106 is executed.
Illustratively, each time the electronic device generates an IP address, a reconfiguration period is determined in addition to starting a timer for the lifetime of the IP address. The duration of the first timer is a life cycle of the IP address, for example, 8 hours, 12 hours, and the IP address is invalid after the timer is finished. After the first IP address is constructed, each time a second RA message is received, the electronic device needs to determine whether a first duration between a first time point at which the first RA message is received and a second time point at which the second RA message is received is greater than or equal to a second duration, and if the first duration is greater than or equal to the second duration, step 105 is executed; if the first duration is less than the second duration, step 106 is performed.
In addition, in order to prevent the boundary effect, the first duration is greater than or equal to the second duration, which may be understood as the first duration being greater than or equal to the product of the second duration and a coefficient, for example, a coefficient less than or equal to 1 such as 0.8, 0.9, and the like, and the embodiments of the present application are not limited thereto.
105. And generating a second IP address according to the second RA message.
For example, if the first duration is greater than or equal to the second duration, it indicates that a reconfiguration period of the IP address has elapsed since the generation of the first IP address. At this time, even if the timer corresponding to the life cycle of the first IP address is not finished, the electronic device generates the second IP address according to the second RA message, and restarts the first timer according to the life cycle of the second IP address.
106. And discarding the second RA message.
Illustratively, if the configuration of the router is not changed, the electronic device directly discards the second RA packet, and avoids frequently reconstructing an IP address according to the latest received RA packet, thereby achieving the purpose of reducing the power consumption of the electronic device.
According to the IP address generation method provided by the embodiment of the application, after the electronic equipment constructs the first IP address according to the RA message at the first time point, a reconstruction period is determined according to the first RA message, when the first time length between the second time point when the electronic equipment receives the second RA message and the first time point is less than the second time length corresponding to the reconstruction period, the second RA message is discarded, and the IP address is reconstructed according to the second RA message only when the first time length is greater than or equal to the second time length. In the process, whether the IP address is reconstructed or not is determined according to the reconstruction period, and the generation of a new IP address when an RA message is received every time is avoided, so that the purpose of reducing the power consumption of the electronic equipment is achieved.
In the above embodiment, even if the lifetime of the IP address is far longer than the period in which the router sends the RA packet, the electronic device determines a reconfiguration period, which is longer than the period in which the router sends the RA packet. Therefore, the electronic equipment does not need to reconstruct the IP address according to the RA message after receiving the RA message every time. The reconfiguration period may be determined according to the correlation time in the RA packet. Next, how to determine the reconstruction period will be described in detail. For example, refer to fig. 3, and fig. 3 is a schematic diagram of an operating environment to which the IP address generation method provided in the embodiment of the present application is applied.
Referring to fig. 3, in the working environment, the electronic device includes a first chip and a second chip, the first chip may be a WiFi chip, the second chip may be a processor of the electronic device, and the first chip and the second chip may be regarded as two System On Chips (SOCs) on the electronic device. The WiFi chip is used for sending an RA message received from a router at a first time point to a processor, determining a reconstruction period according to the first RA message, receiving a second RA message broadcast by the router at a second time point, and sending the second RA message to the processor when the WiFi chip determines that a first time length between the first time point and the second time point is greater than or equal to a second time length, wherein the second time length is a time length corresponding to one reconstruction period, and the reconstruction period is used for indicating a period for reconstructing an IP address; the processor is configured to construct a first IP address at a first time point according to the first RA packet, and construct a second IP address at a second time point according to the second RA packet.
According to the above, it can be seen that: in the process of constructing the IP address, an RA message broadcasted by the router is received by the first chip, the first chip determines whether to reconstruct the IP address according to a reconstruction period, and if the first chip determines that the IP address needs to be reconstructed, the RA message is reported to the second chip, so that the second chip reconstructs the IP address according to the second RA message; and if the first chip determines that the IP address does not need to be reconstructed, discarding the second RA message. Next, the RA packet in the embodiment of the present application is described in detail. For example, see fig. 4.
Fig. 4 is a schematic diagram of a format of an RA packet in the IP address generation method according to the embodiment of the present application. Referring to fig. 4, an RA packet includes a packet type (type) field, a code (code) field, a check code (checksum) field, a cur hop limit (cur hop limit) field, a management address configuration (managed address configuration) field, an other state configuration (other state configuration) field, a reserved bit (reserved), a default router lifetime (router lifetime) field, a reachable time (reachable time) field, a retransmission timer (retransmission time) field, and an option (option) field. The management address configuration field is abbreviated as M field, and the other state configuration fields are abbreviated as O field.
Generally, an RA message may include multiple option fields, such as a source link-layer address (source link-layer address) option, a Maximum Transmission Unit (MTU) option, and a prefix information (prefix information) option. The prefix information option fields may be, for example, 0, 1, or more. The prefix information option is explained in detail below. For example, see fig. 5.
Fig. 5 is a schematic format diagram of a prefix information option of an RA packet in the IP address generation method according to the embodiment of the present application. Referring to fig. 5, the prefix information option includes an option type (type) field, a code (code) field, a prefix length (prefix length) field, an L field, an a field, a reserved (reserved) field, a valid lifetime (valid lifetime) field, a preferred lifetime (reserved) field, a reserved 2(reserved2) field, and a prefix field. Wherein, the L field is a connection identifier (on-link flag) field, and the A field is an Autonomous address configuration identifier (Autonomous address-configuration flag) field.
As can be seen from fig. 5: a prefix option field carries two lifetimes, a valid lifetime and a preferred lifetime, which are described in more detail below. For example, see fig. 6.
Fig. 6 is a schematic diagram of a life cycle in a prefix information option in the IP address generation method according to the embodiment of the present application. Referring to fig. 6, the life cycle of an IP address includes four states, namely a transient state, a preferred state, a rejected state and an invalid state. The total duration of the priority state and the deprecation state is called as an effective life cycle, and the duration corresponding to the priority state is a priority life state.
As can be seen from fig. 4 to 6: the RA message sent by the router carries prefix option information, and after receiving the RA message, the electronic equipment can construct an IP address of the electronic equipment according to the prefix information in the prefix option carried by the RA message. Wherein, two life cycles, namely an effective life cycle and a priority life cycle, are bound in prefix information options carried by each RA message.
Next, how to determine the reconstruction period will be described in detail based on fig. 4 to 6.
In a feasible design, before determining whether the first duration between the first time point and the second time point is greater than or equal to the second duration, the electronic device further parses the first RA packet to obtain a prefix information option, a lifetime of a default router, an reachable time, and a retransmission timer, and determines the reconfiguration period according to the prefix information option, the lifetime of the default router, the reachable time, and the retransmission timer.
Illustratively, the electronic device analyzes the first RA packet to obtain a prefix information option, a lifetime (router lifetime) of the default router, reachable time (reachable time), and a retransmission timer (retransmission time), and determines a reconfiguration period according to the information.
In this embodiment, the electronic device determines the reconfiguration period according to the prefix information option of the first RA packet, the life cycle of the default router, the reachable time, and the retransmission timer, and determines whether to reconstruct the IP address according to the reconfiguration period, thereby avoiding generating a new IP address each time the RA packet is received, and achieving the purpose of reducing the power consumption of the electronic device.
In the following, how the electronic device determines the reconfiguration period according to the prefix information option, the lifetime of the default router, the reachable time, and the retransmission timer in the above embodiments is described in detail.
In a feasible design, how the electronic device determines a reconfiguration period according to a prefix information option, a lifetime of a default router, reachable time, and a retransmission timer, the electronic device analyzes the prefix information option to obtain an effective lifetime and a priority lifetime, wherein the effective lifetime is used for indicating the online effective time of the prefix of the first RA packet, and the priority lifetime is used for indicating the effective time of the first IP address in a priority state; and determining the reconstruction period according to the effective life period, the priority life period, the life period of the default router and the reachable time.
For example, when the first RA packet only includes one prefix information option, at this time, the first RA packet is analyzed, and 5 pieces of duration information, that is, an effective lifetime, a priority lifetime, a lifetime of a default router, an reachable time, and a retransmission timer, can be obtained, and then, the electronic device determines a minimum duration from the 5 pieces of duration information, and takes the minimum duration as a reconfiguration period.
For another example, when the first RA packet includes multiple prefix information options, the first RA packet is analyzed to obtain a lifetime of a default router, an reachable time, a retransmission timer, multiple effective lifetimes, and multiple priority lifetimes; then, the electronic device determines the minimum duration from the duration information, and the minimum duration is used as a reconstruction period.
It should be noted that, although the foregoing embodiment describes the embodiment of the present application in detail by using the minimum time length as the reconstruction period, the embodiment of the present application is not limited, and in other feasible implementation manners, the reconstruction period may be determined after some operations are performed on the time lengths. Wherein, the operation comprises summation, difference calculation and the like.
In the embodiment shown in fig. 2, if the configuration of the router is not changed, the electronic device discards the second RA packet if the first time length is smaller than the second time length. However, the configuration of the router is often configured by the user, and at this time, if the first time length is smaller than the second time length, the electronic device does not reconstruct the IP address, and there is a possibility that the first IP address is invalid and the electronic device cannot access the network. For example, the electronic device constructs a first IP address at a first time point, the life cycle of the first IP address is 8 hours, the configuration of the router changes at a second time point, the router sends a second RA message to the electronic device, the life cycle of a second IP address constructed according to the second RA message is 6 hours, and the first IP address and the second IP address are the same. If the electronic device does not reconstruct the second IP address, after 6 hours, the first IP address is invalid, and the electronic device cannot access the network. In order to avoid the problem, when the first time length is shorter than the second time length, the electronic equipment judges whether the first RA message is the same as the second RA message, and if the first RA message is not the same as the second RA message, a second IP address is constructed according to the second RA message; and if the first RA message is the same as the second RA message, the electronic equipment discards the second RA message.
In this embodiment, the electronic device updates the IP address and restarts the timer in time according to the configuration of the router when the configuration of the router changes by comparing the RA messages.
In the above embodiment, when the electronic device determines whether the first RA message and the second RA message are the same, it may determine whether the check code carried by the first RA message and the check code carried by the second RA message are the same, and if the check code carried by the first RA message and the check code carried by the second RA message are different, it is determined that the first message and the second message are different; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message.
For example, it is determined whether the first RA packet and the second RA packet are the same, which may be comparing the two packets, or extracting checksum from the first RA packet, extracting checksum from the second RA packet, and comparing whether the two checksums are the same. As can be seen from fig. 4: each RA message carries a check code (checksum), and if the two RA messages are different, their checksums are definitely different, so that it can be determined whether the two RA messages are the same by comparing the check codes of the messages.
In this embodiment, the purpose of determining whether the packets are the same is achieved by comparing the checksums of the RA packets, and the way of comparing the checksums is more efficient compared to the way of comparing the packets.
The above-described IP address generation method will be described in detail below using an example. For example, referring to fig. 7, fig. 7 is a flowchart of another IP address generation method provided in the embodiment of the present invention. The embodiment comprises the following steps:
201. the electronic equipment constructs a first Internet Protocol (IP) address according to a first router broadcast (RA) message received from the router at a first time point.
202. And the electronic equipment receives a second RA message broadcast by the router at a second time point.
203. And the electronic equipment analyzes the second RA message to obtain the IP address of the router.
For example, after the electronic device constructs an IP address each time, one record is stored, a plurality of records form a record table, and a source IP (source IP, SIP) can be used as an index table to find a corresponding record. Table 1 shows the contents of one record in the record table.
TABLE 1
Figure BDA0002143093800000101
Each connection hotspot corresponds to an IP address, that is, an SIP in the table, the IP address is encapsulated in an IP header of an RA message, for example, the identification bit is used to indicate whether the record is valid, when the electronic device is defaulted to generate an IP address based on the RA message for the last time, a reconstruction period obtained according to the RA message is T, and a time point when the WiFi chip of the electronic device sends the RA message to the processor for the last time is T0. The length of one reconstruction period T is the second duration, and the second duration may be, for example, the shortest duration among durations respectively indicated in 5 duration information obtained according to the first RA packet. Wherein, the 5 pieces of duration information are respectively an effective life cycle, a priority life cycle, a life cycle of a default router, an reachable time and a retransmission timer. When the first RA message contains a plurality of prefix information options, analyzing the first RA message to obtain a life cycle of a default router, an reachable time and a retransmission timer, and a plurality of effective life cycles and a plurality of priority life cycles; then, the electronic device determines the minimum duration from the duration information, and the minimum duration is used as a reconstruction period.
204. Determining whether a record corresponding to the IP address exists in the record table according to the SIP corresponding to the hotspot, and if so, executing step 205; if not, go to step 209.
For example, if the SIP corresponding to the IP address exists in the record table, it indicates that the electronic device accesses the router before the second time point, for example, the first IP is the same as the second IP.
If the SIP corresponding to the IP address does not exist in the record table, the electronic equipment is not accessed to the router before the second time point. For example, two hot spots are set on one router, and the IP addresses of the two hot spots are different, so that each hot spot is equivalent to one virtual router for the electronic device. In a period of time, the electronic device initially accesses the virtual router corresponding to the first hot spot, and then, at a second time point, the virtual router to which the second hot spot is directed broadcasts a second RA packet, at this time, since the IP address obtained by the electronic device analyzing the first RA packet is different from the IP address obtained by analyzing the first RA packet, the electronic device performs step 209.
205. Determining whether the first duration is greater than or equal to the second duration, and if the first duration is greater than or equal to the second duration, executing step 208; if the first duration is less than the second duration, go to step 206;
206. determining whether the first RA message is the same as the second RA message, and if the first RA message is the same as the second RA message, performing step 207; if the first RA message is not the same as the second RA message, step 208 is executed;
for example, the electronic device may determine whether the first RA packet and the second RA packet are the same through checksum of the two packets. If the checksum of the first RA packet is the same as the checksum of the second RA packet, it indicates that the first RA packet is the same as the second RA packet, and if the checksum of the first RA packet is different from the checksum of the second RA packet, it indicates that the first RA packet is different from the second RA packet.
207. And discarding the second RA message.
208. And constructing a second IP address according to the second RA message.
209. The electronic device determines whether the record in the record table is smaller than the maximum value, and if the record in the record table is smaller than the maximum value, step 210 is executed; if the record in the record table is equal to the maximum value, go to step 211.
Illustratively, the capacity of a record table is limited, and in order to ensure that a new record can be recorded by the record table, when the record in the record table is equal to the maximum value, it is necessary to delete a part of invalid records, i.e. step 211 is executed; otherwise, the new record is saved in the record table, i.e. step 210 is executed.
210. The new record is saved in the record table, after which step 208 is performed.
211. Part of invalid records in the record table are deleted, and new records are saved in the record table, after which step 208 is executed.
Fig. 8 is a schematic structural diagram of an IP address generation apparatus according to an embodiment of the present application. The IP address generating apparatus according to the present embodiment may be the electronic device described above. As shown in fig. 8, the IP address generating apparatus 100 may include:
a transceiving unit 11, configured to receive a first router broadcast RA packet from a router at a first time point, and receive a second RA packet broadcast by the router at a second time point
A processing unit 12, configured to determine a reconfiguration period according to the first RA packet, and construct a first internet protocol IP address, where the reconfiguration period is used to indicate a period for reconfiguring an IP address, determine whether a first duration between the first time point and the second time point is greater than or equal to a second duration, where the second duration is a duration corresponding to the reconfiguration period, and if the first duration is greater than or equal to the second duration, generate a second IP address according to the second RA packet.
In a feasible design, before determining whether the first duration between the first time point and the second time point is greater than or equal to the second duration, the processing unit 12 is further configured to analyze the first RA packet to obtain a prefix information option, a lifetime of a default router, an reachable time, and a retransmission timer, and determine the reconfiguration period according to the prefix information option, the lifetime of the default router, the reachable time, and the retransmission timer.
In a feasible design, the processing unit 12 is configured to analyze the prefix information option to obtain an effective lifetime and a priority lifetime, where the effective lifetime is used to indicate an online effective time of the prefix of the first RA packet, and the priority lifetime is used to indicate an effective time of the first IP address in a priority state, and a shortest period is determined from the effective lifetime, the priority lifetime, the lifetime of the default router, the reachable time, and the retransmission timer, and is used as the reconstruction period.
In a feasible design, the processing unit 12 is further configured to determine whether the first RA packet is the same as the second RA packet if the first duration is shorter than the second duration, and construct a second IP address according to the second RA packet if the first RA packet is not the same as the second RA packet.
In a feasible design, the processing unit 12 is configured to determine that the first packet is different from the second packet if the check code carried in the first RA packet is determined to be the same as the check code carried in the second RA packet; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message.
In a feasible design, the processing unit 12 is further configured to, if the first RA packet is different from the second RA packet, update the reconfiguration period according to the second RA packet after constructing a second IP address according to the second RA packet.
The IP address generating apparatus provided in this embodiment of the present application may execute the actions of the electronic device in the foregoing method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
It should be noted that, the above transceiver unit may be actually implemented as a transceiver, and may be implemented in a form called by software through a processing element; or may be implemented in hardware. For example, the processing unit may be a processing element separately set up, or may be implemented by being integrated into a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and a function of the processing module may be called and executed by a processing element of the apparatus. In addition, all or part of the units can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, the steps of the method or the units above may be implemented by hardware integrated logic circuits in a processor element or instructions in software.
For example, the above units may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when some of the above units are implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor that can call the program code. As another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 9 is a schematic structural diagram of an IP address generating apparatus according to an embodiment of the present application. As shown in fig. 9, the IP address generating apparatus 200 may include: a processor 21 (e.g., CPU), a memory 22, a transceiver 23; the transceiver 23 is coupled to the processor 21, and the processor 21 controls the transceiving action of the transceiver 23; the memory 22 may include a random-access memory (RAM) and may further include a non-volatile memory (NVM), such as at least one disk memory, and the memory 22 may store various instructions for performing various processing functions and implementing the method steps of the present application. Optionally, the IP address generating apparatus according to the present application may further include: a communication bus 24 and a communication port 25. The transceiver 23 may be integrated in the transceiver of the IP address generating device, or may be a separate transceiving antenna on the IP address generating device. A communication bus 24 is used to enable communication connections between the elements. The communication port 25 is used to realize connection communication between the IP address generating apparatus and other peripheral devices.
In the embodiment of the present application, the memory 22 is used for storing computer executable program codes, and the program codes comprise instructions; when the processor 21 executes the instruction, the instruction causes the processor 21 of the IP address generating apparatus to execute the processing action of the first network node in the above method embodiment, and causes the transceiver 23 to execute the transceiving action of the first network node in the above embodiment, which has similar implementation principles and technical effects, and is not described herein again; alternatively, the memory 22 is used for storing computer executable program code, which includes instructions; or, when the processor 21 executes the instruction, the instruction causes the processor 21 of the IP address generating apparatus to execute the processing action of the second network node in the foregoing embodiment of the method, and causes the transceiver 23 to execute the transceiving action of the second network node in the foregoing embodiment, which has similar implementation principles and technical effects, and is not described herein again.
In the embodiments provided in the present application, the method provided in the embodiments of the present application is mainly introduced from the perspective of electronic equipment. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
The term "plurality" herein means two or more. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship; in the formula, the character "/" indicates that the preceding and following related objects are in a relationship of "division".
It is to be understood that the various numerical references referred to in the embodiments of the present application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of the present application.
It should be understood that, in the embodiment of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
It is understood that, in the embodiment of the present application, the memory may be a non-volatile memory, such as a Hard Disk Drive (HDD) or a solid-state drive (SSD), and may also be a volatile memory (RAM), for example. The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, 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 be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units 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 form of hardware, and can also be realized in a form of a software functional unit.
The method provided by the embodiment of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, a second network node, a terminal, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., Digital Video Disk (DVD)), or a semiconductor medium (e.g., SSD), among others.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. An IP address generation method, comprising:
determining a reconstruction period according to a first router broadcast RA message received from a router at a first time point, and constructing a first Internet protocol IP address, wherein the reconstruction period is used for indicating a period for reconstructing the IP address, and the reconstruction period is minimum duration information determined from information included in the RA message;
receiving a second RA message broadcast by the router at a second time point;
determining whether a first time length between the first time point and the second time point is greater than or equal to a second time length, wherein the second time length is a time length corresponding to a reconstruction period;
and if the first duration is greater than or equal to the second duration, generating a second IP address according to the second RA message.
2. The method of claim 1, wherein prior to determining whether the first duration between the first point in time and the second point in time is greater than or equal to the second duration, further comprising:
analyzing the first RA message to obtain a prefix information option, a life cycle of a default router, reachable time and a retransmission timer;
and determining the reconstruction period according to the prefix information option, the life cycle of the default router, the reachable time and the retransmission timer.
3. The method of claim 2, wherein determining the reconfiguration period based on the prefix information option, the lifetime of the default router, and the reachable time comprises:
analyzing the prefix information option to obtain an effective life cycle and a priority life cycle, wherein the effective life cycle is used for indicating the online effective time of the prefix of the first RA message, and the priority life cycle is used for indicating the effective time of the first IP address in a priority state;
and determining the shortest cycle from the effective life cycle, the priority life cycle, the life cycle of the default router, the reachable time and the retransmission timer, and taking the shortest cycle as the reconstruction cycle.
4. The method according to any one of claims 1 to 3, further comprising:
if the first time length is less than the second time length, judging whether the first RA message and the second RA message are the same;
and if the first RA message is different from the second RA message, constructing a second IP address according to the second RA message.
5. The method of claim 4, wherein the determining whether the first RA packet and the second RA packet are the same comprises:
judging whether the check code carried by the first RA message is the same as the check code carried by the second RA message;
if the check code carried by the first RA message is different from the check code carried by the second RA message, determining that the first message is different from the second message; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message.
6. The method according to claim 4 or 5, wherein if the first RA packet and the second RA packet are different, after constructing a second IP address according to the second RA packet, the method further comprises:
and updating the reconstruction period according to the second RA message.
7. An IP address generating apparatus, comprising:
a receiving and sending unit, configured to receive, at a first time point, a first router broadcast RA packet from a router, and receive, at a second time point, a second RA packet broadcast by the router
A processing unit, configured to determine a reconfiguration period according to the first RA packet, and construct a first internet protocol IP address, where the reconfiguration period is used to indicate a period for reconfiguring an IP address, and the reconfiguration period is minimum duration information determined from information included in the RA packet; and determining whether a first time length between the first time point and the second time point is greater than or equal to a second time length, wherein the second time length is a time length corresponding to a reconstruction period, and if the first time length is greater than or equal to the second time length, generating a second IP address according to the second RA message.
8. The apparatus of claim 7,
the processing unit is further configured to, before determining whether the first duration between the first time point and the second time point is greater than or equal to the second duration, parse the first RA packet to obtain a prefix information option, a lifetime of a default router, an reachable time, and a retransmission timer, and determine the reconfiguration period according to the prefix information option, the lifetime of the default router, the reachable time, and the retransmission timer.
9. The apparatus of claim 8,
the processing unit is configured to analyze the prefix information option to obtain an effective lifetime and a priority lifetime, where the effective lifetime is used to indicate an online effective time of the first RA packet prefix, and the priority lifetime is used to indicate an effective time of the first IP address in a priority state, and a shortest period is determined from the effective lifetime, the priority lifetime, the lifetime of the default router, the reachable time, and the retransmission timer, and is used as the reconstruction period.
10. The apparatus according to any one of claims 7 to 9,
the processing unit is further configured to determine whether the first RA packet is the same as the second RA packet if the first duration is shorter than the second duration, and construct a second IP address according to the second RA packet if the first RA packet is not the same as the second RA packet.
11. The apparatus of claim 10,
the processing unit is configured to determine that the first message is different from the second message if the check code carried by the first RA message is different from the check code carried by the second RA message; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message.
12. The apparatus of claim 10 or 11,
the processing unit is further configured to, if the first RA packet is different from the second RA packet, update the reconfiguration period according to the second RA packet after constructing a second IP address according to the second RA packet.
13. An electronic device comprising a first chip and a second chip, wherein,
the first chip is configured to send an RA message broadcast by a first router from a router to a second chip according to a first RA message received at a first time point, determine a reconfiguration period according to the first RA message, receive a second RA message broadcast by the router at a second time point, and send the second RA message to the second chip when a first duration between the first time point and the second time point is greater than or equal to a second duration, where the second duration is a duration corresponding to a reconfiguration period, and the reconfiguration period is used to indicate a period for reconfiguring an IP address;
the second chip is used for constructing a first IP address according to the first RA message at a first time point and constructing a second IP address according to the second RA message at a second time point.
14. The apparatus of claim 13,
the first chip is further configured to parse the first RA packet to obtain a prefix information option, a lifetime of a default router, an reachable time, and a retransmission timer, and determine the reconfiguration period according to the prefix information option, the lifetime of the default router, the reachable time, and the retransmission timer.
15. The apparatus of claim 14,
the first chip is configured to analyze the prefix information option to obtain an effective lifetime and a priority lifetime, where the effective lifetime is used to indicate an online effective time of the first RA packet prefix, and the priority lifetime is used to indicate an effective time of the first IP address in a priority state, and the reconfiguration period is determined according to the effective lifetime, the priority lifetime, the lifetime of the default router, and the reachable time.
16. The apparatus according to any one of claims 13 to 15,
the first chip is further configured to determine whether the first RA packet is the same as the second RA packet, and if the first RA packet is not the same as the second RA packet, construct the second IP address according to the second RA packet.
17. The apparatus of claim 16,
the first chip is configured to determine whether a check code carried by the first RA message is the same as a check code carried by the second RA message, and determine that the first message is different from the second message if the check code carried by the first RA message is different from the check code carried by the second RA message; and if the check code carried by the first RA message is the same as the check code carried by the second RA message, determining that the first message is the same as the second message.
18. The apparatus according to claim 16 or 17,
the first chip is further configured to update the reconfiguration period according to the second RA packet.
CN201910675426.XA 2019-07-25 2019-07-25 IP address generation method and device Active CN110401730B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910675426.XA CN110401730B (en) 2019-07-25 2019-07-25 IP address generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910675426.XA CN110401730B (en) 2019-07-25 2019-07-25 IP address generation method and device

Publications (2)

Publication Number Publication Date
CN110401730A CN110401730A (en) 2019-11-01
CN110401730B true CN110401730B (en) 2021-06-29

Family

ID=68325933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910675426.XA Active CN110401730B (en) 2019-07-25 2019-07-25 IP address generation method and device

Country Status (1)

Country Link
CN (1) CN110401730B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112367257B (en) * 2020-10-30 2022-10-21 新华三技术有限公司 Route notification method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750541A (en) * 2005-09-23 2006-03-22 杭州华为三康技术有限公司 Updating method for forming tree protocol address and exchanger
CN101018234A (en) * 2007-03-15 2007-08-15 杭州华为三康技术有限公司 Routing information publishing method and network address conversion-protocol conversion gateway device
CN102769911A (en) * 2012-07-20 2012-11-07 大唐移动通信设备有限公司 Router advertisement information sending method and device
CN102938735A (en) * 2012-11-15 2013-02-20 北京邮电大学 Method utilizing router advertisement carrying options to issue network address translator (NAT) 64 address prefix
CN103701942A (en) * 2012-09-28 2014-04-02 中国移动通信集团公司 Method, device and system for preventing client from frequently initiating IP (Internet protocol) address allocation request
CN108092841A (en) * 2016-11-22 2018-05-29 中兴通讯股份有限公司 A kind of maintaining method, the apparatus and system of gateway routing iinformation

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100369939B1 (en) * 2000-12-27 2003-01-29 한국전자통신연구원 Method of an Automatic IPv6 Address Generation and IP Address Lookup by using E.164 Telephone Numbers
CN100474839C (en) * 2004-10-12 2009-04-01 上海贝尔阿尔卡特股份有限公司 Network service selection and authentication in IPv6 access network, and automatic configuration without status

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1750541A (en) * 2005-09-23 2006-03-22 杭州华为三康技术有限公司 Updating method for forming tree protocol address and exchanger
CN101018234A (en) * 2007-03-15 2007-08-15 杭州华为三康技术有限公司 Routing information publishing method and network address conversion-protocol conversion gateway device
CN102769911A (en) * 2012-07-20 2012-11-07 大唐移动通信设备有限公司 Router advertisement information sending method and device
CN103701942A (en) * 2012-09-28 2014-04-02 中国移动通信集团公司 Method, device and system for preventing client from frequently initiating IP (Internet protocol) address allocation request
CN102938735A (en) * 2012-11-15 2013-02-20 北京邮电大学 Method utilizing router advertisement carrying options to issue network address translator (NAT) 64 address prefix
CN108092841A (en) * 2016-11-22 2018-05-29 中兴通讯股份有限公司 A kind of maintaining method, the apparatus and system of gateway routing iinformation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Defence Mechanisms Evaluation against RA Flood Attacks for Linux-Victim Node;Samad S. Kolahi等;《Proceedings of APSIPA Annual Summit and Conferencee 2017》;20171215;第1000-1005页 *

Also Published As

Publication number Publication date
CN110401730A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
US11582682B2 (en) Method for determining control plane node, apparatus, and wireless communications system
CN109429274B (en) Configuration method and corresponding device
CN102804711A (en) Transmission of advanced-map information elements in mobile networks
US20190280973A1 (en) Routing method, near field communication controller, device host, and terminal
CN112637799A (en) 5G terminal identification method and device
CN113596816B (en) Control method and device for limited UE (user equipment) capability and computer storage medium
JP2023106571A (en) Monitoring method for pdcch, terminal device, and network device
US11317453B2 (en) Device to device communication method for reducing mutual interference between different types of terminal devices, terminal device and network device
CN111432044A (en) Multi-link equipment MAC address management method and device and multi-link equipment
CN110535812B (en) Message transmission method, communication device and system
CN111224903A (en) Data transmission method, data transmission equipment and computer readable storage medium
CN110401730B (en) IP address generation method and device
US10979554B2 (en) Communication method, wearable device, server, and system
RU2735386C1 (en) Communication method, a terminal device and a network access device
CN111757317A (en) Request processing method, related device and system
WO2018227445A1 (en) Paging method, network device, and terminal device
CN107113853A (en) A kind of D2D unicast communications method, equipment and system
US20200374886A1 (en) Communication method, communications device, and computer program storage medium
US10785750B2 (en) Methods for triggering user equipment to monitor paging message, user equipments, base stations and storage medium
CN109167851B (en) Method and device for acquiring MAC address
CN108401228B (en) Communication method and device
US10368228B2 (en) Terminal discovery method and device
JP6944007B2 (en) Methods, devices, and wireless communication systems to determine control plane nodes
CN111492681A (en) Method and device for reporting information by terminal and computer storage medium
CN111786758B (en) Communication method and device

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
GR01 Patent grant
GR01 Patent grant