CN114979075A - IPv6 address generation method and related device - Google Patents

IPv6 address generation method and related device Download PDF

Info

Publication number
CN114979075A
CN114979075A CN202110206724.1A CN202110206724A CN114979075A CN 114979075 A CN114979075 A CN 114979075A CN 202110206724 A CN202110206724 A CN 202110206724A CN 114979075 A CN114979075 A CN 114979075A
Authority
CN
China
Prior art keywords
address
iapd
network
ipv6 address
prefix
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
Application number
CN202110206724.1A
Other languages
Chinese (zh)
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 CN202110206724.1A priority Critical patent/CN114979075A/en
Priority to PCT/CN2022/076316 priority patent/WO2022179410A1/en
Publication of CN114979075A publication Critical patent/CN114979075A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • 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
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Disclosed is an IPv6 address generation method, characterized in that the method comprises: the network equipment sends a configuration request to the DHCPv6 server; the network equipment receives an IAPD address prefix sent by the DHCPv6 server to the network equipment based on the configuration request; the network equipment configures a first IPv6 address for the terminal equipment, a second IPv6 address for a downlink interface of the network equipment and a third IPv6 address for an uplink interface of the network equipment based on the received IAPD address prefix; the first IPv6 address and the second IPv6 address are used for realizing communication between the network device and the terminal device, and the third IPv6 address is used for the network device to access the wide area network. The network device (such as a router) generates an ipv6 address of the uplink interface through the acquired IAPD address prefix, which solves the problem that the router accesses the wide area network, so that data communication can be realized between the terminal device and the wide area network.

Description

IPv6 address generation method and related device
Technical Field
The present application relates to the field of electronic technologies, and in particular, to an IPv6 address generation method and a related apparatus.
Background
Iterations from IPv4 to IPv6 have been a great trend, and conventional IPv6 address deployments include stateless address allocation and stateful address allocation. The stateful Address allocation is to allocate an Identity Association Non-temporary Address (IANA) Address to the terminal device/network device through a Dynamic Host Configuration Protocol for IPV6 (DHCPV 6), and the terminal device/network device accesses the internet using the IANA Address.
The following IPv6 deployment scenarios exist in existing networks: the operator is configured in a stateful address allocation mode, but the DHCPV6 server allocates only an Identity Association Prefix Delegation (IAPD) address Prefix to the terminal device/network device, and does not issue an IANA address.
In this scenario, the terminal device/network device cannot acquire the IANA address and therefore cannot acquire the IPv6 address, so that the terminal device/network device cannot surf the internet.
Disclosure of Invention
The embodiment of the application provides an IPv6 address generating method and a related device, and the IPv6 address of an electronic device can be provided through the method, so that data communication between the electronic device and a wide area network is realized.
In a first aspect, the present application provides an IPV6 address generating method, where the method is applied to a network device, an uplink interface of the network device performs data communication with a DHCPv6 server, and a downlink interface of the network device performs data communication with a terminal device, and the method includes:
the network equipment sends a configuration request to the DHCPv6 server;
the network equipment receives an IAPD address prefix sent by the DHCPv6 server to the network equipment based on the configuration request;
the network equipment configures a first IPv6 address for the terminal equipment, a second IPv6 address for a downlink interface of the network equipment and a third IPv6 address for an uplink interface of the network equipment based on the received IAPD address prefix; the third IPv6 address matches the IAPD address prefix; the first IPv6 address and the second IPv6 address are used for achieving communication between the network device and the terminal device, and the third IPv6 address is used for the network device to access the wide area network.
In the embodiment of the application, when a network device (for example, a router) exists between a terminal device and a DHCPv6 server, the router generates an address of a user side through an acquired IAPD address prefix, and allocates ipv6 addresses to the terminal device and the router based on a communication link between the terminal device and the router, thereby realizing data communication between the terminal device and the router. And the router can also generate an ipv6 address of the uplink interface through the acquired IAPD address prefix, so that the problem that the router accesses a wide area network is solved, and data communication between the terminal device and the wide area network is realized.
In some possible embodiments, the network device sends the configuration request to the DHCPv6 server, which further includes: the network equipment sends an RS message to the DHCPv6 server; the network equipment receives an RA message sent by the DHCPv6 server to the network equipment based on the RS message, and the RA message instructs the network equipment to send a configuration request to the DHCPv6 server to acquire address information. Wherein, the RA message at least includes an address configuration identifier M, and the value of the address configuration identifier M is 1, then the network device obtains the address information by using a stateful address configuration mode. The stateful address configuration uses the DHCPv6 protocol, the network device sends a configuration request to the DHCPv6 server, and the DHCPv6 server returns corresponding configuration information according to the policy.
In some possible embodiments, the method further comprises: the network device configures a third IPv6 address for an uplink interface of the network device based on the received IAPD address prefix, where the third IPv6 address includes: the network equipment receives the IANA address sent by the DHCPv6 server to the network equipment based on the configuration request; the network device configures a third IPv6 address for an uplink interface of the network device based on the received IAPD address prefix, including: and the network equipment selects an IAPD address prefix to configure a third IPv6 address for the uplink interface of the network equipment based on the received IANA address and the IAPD address prefix. It is described herein that even in the case where a router receives an IANA address, the router can generate an ipv6 address for an upstream interface (WAN port) from an IAPD address prefix. Wherein it can be detected that the address prefix of the third IPv6 address matches the IAPD address prefix acquired by the router. For example, if the IAPD address prefix acquired by the router is M bits, the first M bits of the third IPv6 address are the same as the acquired IAPD address prefix.
In some possible embodiments, the length of the IAPD address prefix is M bits, and the network device configures a third IPv6 address for the uplink interface of the network device based on the received IAPD address prefix, including: when M is smaller than N, the network equipment expands the IAPD address prefix with M bits into the IAPD address prefix with N bits, N is a preset numerical value, and M and N are both positive integers; the network equipment adds the N-bit IAPD address prefix to the interface ID of the uplink interface of the network equipment to form a third IPv6 address; the network device takes the third IPv6 address as the network address of the uplink interface of the network device; or when M is equal to N, the network device adds an IAPD address prefix of M bits to an interface ID of an uplink interface of the network device to form a third IPv6 address, where N is a preset value, and M and N are both positive integers; the network device uses the third IPv6 address as the network address for the upstream interface of the network device. A way of generating a third IPv6 address based on an IAPD address prefix is provided herein.
In some possible embodiments, the network device extends an M-bit IAPD address prefix to an N-bit IAPD address prefix, including: the network equipment expands the IAPD address prefix with M bits into the IAPD address prefix with N bits by means of tail part 0 or 1 complementing. Optionally, the IAPD address prefix may be extended to N bits by any combination of tail padding 0 and 1.
In a second aspect, the present application provides a method for generating an IPV6 address, the method including:
the terminal equipment sends a configuration request to the DHCPv6 server;
the terminal equipment receives an IAPD address prefix sent by the DHCPv6 server to the terminal equipment based on the configuration request;
the terminal equipment configures an IPv6 address for the terminal equipment based on the received IAPD address prefix, the IPv6 address is matched with the IAPD address prefix, and the IPv6 address is used for the terminal equipment to access the wide area network.
In the embodiment of the application, when no network device (for example, a router) exists between the terminal device and the DHCPv6 server, the terminal device may generate an ipv6 address as its ipv6 address by using an IAPD address prefix, and access to the wide area network by the terminal device is realized based on the ipv6 address. Even if the terminal device does not acquire the IANA address sent by the DHCPv6 server, the terminal device can access the wide area network.
In some possible embodiments, the terminal device sends the configuration request to the DHCPv6 server, which further includes: the terminal equipment sends an RS message to the DHCPv6 server; and the terminal equipment receives an RA message sent to the terminal equipment by the DHCPv6 server based on the RS message, wherein the RA message instructs the terminal equipment to send a configuration request to the DHCPv6 server so as to acquire address information. The RA message at least includes an address configuration identifier M, and if the value of the address configuration identifier M is 1, the terminal device acquires address information using a stateful address configuration mode. The stateful address configuration uses the DHCPv6 protocol, the terminal device sends a configuration request to the DHCPv6 server, and the DHCPv6 server returns corresponding configuration information according to the policy.
In some possible embodiments, the method further comprises: the terminal device configures an IPv6 address for the terminal device based on the received IAPD address prefix, which includes: the terminal equipment receives an IANA address sent by the DHCPv6 server to the terminal equipment based on the configuration request; the terminal equipment configures an IPv6 address for the terminal equipment based on the received IAPD address prefix, and the method comprises the following steps: and the terminal equipment selects the IAPD address prefix to configure the IPv6 address for the terminal equipment based on the received IANA address and the IAPD address prefix. It is described herein that even in the case where the terminal device receives the IANA address, the terminal device can generate an ipv6 address for an upstream interface (WAN port) from the IAPD address prefix. It can be detected that the address prefix of the third IPv6 address matches the IAPD address prefix acquired by the terminal device. For example, if the IAPD address prefix acquired by the terminal device is M bits, the first M bits of the third IPv6 address are the same as the acquired IAPD address prefix.
In some possible embodiments, the length of the IAPD address prefix is M bits, and the terminal device configures an IPv6 address for the terminal device based on the received IAPD address prefix, including: when M is smaller than N, the terminal equipment expands the IAPD address prefix with M bits into the IAPD address prefix with N bits, N is a preset numerical value, and M and N are both positive integers; the terminal equipment adds the IAPD address prefix of N bits to the interface ID of the terminal equipment to form an IPv6 address; the terminal device takes the IPv6 address as the network address of the terminal device; or when M is equal to N, the terminal equipment adds an IAPD address prefix of M bits to an interface ID of the terminal equipment to form an IPv6 address, wherein N is a preset numerical value, and M and N are both positive integers; the terminal device uses the IPv6 address as the network address of the terminal device. A way to generate IPv6 addresses based on IAPD address prefixes is provided herein. Here, the ipv6 address is the fourth ipv6 address in the embodiment.
In some possible embodiments, the extending, by the terminal device, the IAPD address prefix with M bits to the IAPD address prefix with N bits includes: the terminal equipment expands the IAPD address prefix with M bits into the IAPD address prefix with N bits by a tail part 0 or 1 complementing mode. Alternatively, the IAPD address prefix may be extended to N bits by tail-padding any combination of 0 and 1.
In a third aspect, the present application provides an electronic device, comprising: one or more processors, one or more memories; the one or more memories are coupled to the one or more processors; the one or more memories for storing computer program code, the computer program code including computer instructions; the computer instructions, when executed on the processor, cause the electronic device to perform the IPV6 address generation method of any one of the possible implementations of any of the above aspects.
In a fourth aspect, an embodiment of the present application provides a computer storage medium including computer instructions, which, when executed on an electronic device, cause a communication apparatus to perform a method for generating an IPV6 address in any one of the foregoing possible implementation manners.
In a fifth aspect, the present application provides a computer program product, which when run on a computer, causes the computer to execute the IPV6 address generation method in any one of the above possible implementations.
Drawings
Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present application;
fig. 2A is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2B is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 3A and fig. 3B are schematic flow charts of an ipv6 address generation method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another ipv6 address generation method according to an embodiment of the present application;
fig. 5 is a data diagram of a data packet according to an embodiment of the present application;
fig. 6 is a schematic flowchart of yet another ipv6 address generation method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
As used in this application, the terms "component," "module," "system," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a computing device and the computing device can be a component. One or more components can reside within a process and/or thread of execution and a component can be localized on one computer and/or distributed between 2 or more computers. In addition, these components can execute from various computer readable media having various data structures stored thereon. The components may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., data from two components interacting with one another at a local system, distributed system, and/or across a network such as a wide area network with which the other systems interact by way of the signal).
The technical scheme of the embodiment of the application can be applied to various communication systems, for example: a global system for mobile communication (GSM) system, a Code Division Multiple Access (CDMA) system, a Wideband Code Division Multiple Access (WCDMA) system, a General Packet Radio Service (GPRS), a Long Term Evolution (LTE) system, an LTE Frequency Division Duplex (FDD) system, an LTE Time Division Duplex (TDD) system, a Universal Mobile Telecommunications (UMTS) system, an enhanced data rate GSM evolution (enhanced data for GSM evolution) system, and an EDGE microwave access (EDGE) system. The technical solution of the embodiment of the present application may also be applied to other communication systems, for example, a Public Land Mobile Network (PLMN) system, a fifth generation (5th generation, 5G) system, a communication system after 5G, or a New Radio (NR), and the like, where the 5G mobile communication system includes a non-independent Network (NSA) 5G mobile communication system and/or an independent network (SA) 5G mobile communication system. The technical scheme provided by the application can also be applied to future communication systems, such as a sixth generation mobile communication system. The communication system may also be a PLMN network, a device-to-device (D2D) network, a machine-to-machine (M2M) network, an IoT network, or other network.
As shown in fig. 1, fig. 1 is a system architecture diagram of a communication system according to an embodiment of the present application. The communication system includes a DHCPv6(Dynamic Host Configuration Protocol for IPv6) server 101, a network device 102, and one or more terminal devices (e.g., terminal device 1, terminal device 2, and terminal device 3). The DHCPv6 server 101 can directly establish communication connection with the terminal device to provide network service for the terminal device; and a communication connection can be established between the network device 102 and the terminal device to provide network services for the terminal device. Wherein,
the DHCPv6 server 101 includes devices for accessing a wide area network, such as a base station, a broadband access server (BRAS), an optical network unit, a broadband network service gateway (BNG), a convergence switch, and the like. The base station may include various forms of base stations, such as: macro base stations, micro base stations (also referred to as small stations), relay stations, access points, etc. Alternatively, the DHCPv6 server 101 may be mounted on the above-mentioned device for accessing the wide area network.
The DHCPv6 server 101 may directly establish a communication connection with a terminal device to provide a network service for the terminal device, such as the terminal device 3 in fig. 1; network services can also be provided for terminal devices, such as terminal device 1 and terminal device 2 in fig. 1, by establishing a communication connection with the terminal device through the network device 102.
The network device 102 includes a router, a gateway, and the like, provides functions of connecting to a network and transmitting information, and can be connected to multiple terminal devices to share the network. The network device 102 comprises an uplink interface (WAN port) and a downlink interface (LAN port), the uplink interface of the network device 102 can be connected to the DHCPv6 server 101, and the network device 102 can access the wide area network through the IANA address provided by the DHCPv6 server 101; the downstream interface of the network device 102 may be connected to one or more terminal devices for data communication between the network device 102 and the terminal devices. When a terminal device wants to access a network through the network device 102, both the upstream interface and the downstream interface of the network device 102 need to configure ipv6 addresses so that the network device 102 and other devices can communicate with each other. For example, in fig. 1, the network device 102 is connected to the terminal device 1 through the downlink interface 1, and the network device 102 configures an ipv6 address for the downlink interface 1 and the terminal device 1 respectively, so as to establish a communication link between the network device 102 and the terminal device 1, so that the network device 102 and the terminal device 1 can implement data communication, and then the terminal device 1 can access a wide area network through the network device 102. For another example, the network device 102 is connected to the terminal device 2 through the downlink interface 2, and the network device 102 configures an ipv6 address for the downlink interface 2 and the terminal device 2, respectively, to establish a communication link between the network device 102 and the terminal device 2, so that the network device 102 and the terminal device 2 can implement data communication, and then the terminal device 2 can access the wide area network through the network device 102.
In some embodiments, network device 102 may establish a wireless connection, such as a Wi-Fi connection, with one or more terminal devices. The network device 102 establishes a wireless communication link with the terminal device, and configures an ipv6 address for the network device 102 and the terminal device, respectively, so that the network device 102 and the terminal device can implement data communication, and then the terminal device can access a wide area network through the network device 102.
A terminal device may also be referred to as a User Equipment (UE), an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user equipment. The terminal device may be a Station (ST) in a WLAN, and may be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capability, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle-mounted networking terminal, a computer, a laptop, a handheld communication device, a handheld computing device, a satellite radio, a wireless modem card, a television Set Top Box (STB), a Customer Premises Equipment (CPE), and/or other devices for communicating over a wireless system, as well as a next generation communication system, e.g., a terminal device in a 5G network or a future evolved public land mobile network (public land mobile network, PLMN) terminal equipment in the network, etc.
Fig. 2A exemplarily shows a structural schematic diagram of an electronic device 100 provided in an embodiment of the present application, and the electronic device 100 may be a terminal device (terminal device 1, terminal device 2, and terminal device 3) in the above system architecture.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
The charging management module 140 is configured to receive charging input from a charger.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication applied to the electronic device 100, including UWB, Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) network), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and so on. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel.
The electronic device 100 may implement a photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor.
Fig. 2B schematically illustrates a structural diagram of the network device 102 in the above system architecture provided in the embodiment of the present application. As shown in fig. 2B, network device 102 may include a processor 1021, a memory 1022, a wireless communication processing module 1023, a wired communication processing module 1024, and a power switch 1025. The memory 1022 may be independent and may be connected to the processor 1021 through a bus. Memory 1022 may also be integrated with processor 1021. Wherein a bus is used to enable the connection between these components. Wherein:
processor 1021 is operable to read and execute computer readable instructions. In one implementation, the processor 1021 may mainly include a controller, an operator, and a register. The controller is mainly responsible for instruction decoding and sending out control signals for operations corresponding to the instructions. The arithmetic unit is mainly responsible for performing fixed-point or floating-point arithmetic operation, shift operation, logic operation and the like, and can also perform address operation and conversion. The register is mainly responsible for storing register operands, intermediate operation results and the like temporarily stored in the instruction execution process. In one implementation, the hardware architecture of the processor 1021 may be an Application Specific Integrated Circuits (ASIC) architecture, an MIPS architecture, an ARM architecture, or an NP architecture.
The processor 1021 may be configured to parse signals received by the wireless communication processing module 1023 and/or the wired communication processing module 1024, such as a probe request broadcasted by the electronic device 100, an instruction sent by the electronic device 100, and so on. The processor 1021 may be configured to perform corresponding processing operations according to the parsing result, such as generating a probe response.
In some embodiments, the processor 1021 may be further configured to generate a signal, such as a broadcast signal, sent by the wireless communication processing module 1023 and/or the wired communication processing module 1024, and a signal for feeding back a connection status (such as connection success, connection failure, and the like) sent to the electronic device 100.
A memory 1022 is coupled to the processor 1021 for storing various software programs and/or sets of instructions. In particular implementations, memory 1022 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
The wireless communication processing module 1023 may include one or more of a Bluetooth (BT) communication processing module, a WLAN communication processing module.
In some embodiments, one or more of the Bluetooth (BT) communication processing module and the WLAN communication processing module may listen to signals, such as probe requests, scan signals, etc., transmitted by other devices (e.g., the electronic device 100) and may transmit response signals, such as probe responses, scan responses, etc., so that the other devices (e.g., the electronic device 100) may discover the network device 102 and establish wireless communication connections with the other devices (e.g., the electronic device 100) to communicate with the other devices (e.g., the electronic device 100) via one or more wireless communication technologies in bluetooth or WLAN.
In other embodiments, one or more of the Bluetooth (BT) communication processing module and the WLAN communication processing module may also transmit signals, such as broadcast signals, so that other devices (e.g., electronic device 100) may discover network device 102 and establish wireless communication connections with other devices (e.g., electronic device 100) to communicate with other devices (e.g., electronic device 100) via one or more wireless communication technologies in bluetooth or WLAN.
Power switch 1025 may be used to control the power supplied by the power supply to network device 102.
Wired communications processing module 1024 may be used to connect to a wide area network via an uplink interface, communicating with devices in the wide area network; and may be adapted to connect to a local area network via a downstream interface and communicate with devices in the local area network, wherein,
the upstream interface may also be referred to as a WAN interface. The WAN interface is used to interface the network device 102 to a wide area network and includes, for example, RJ-45 ports, AUI ports, synchronous high speed SERIAL (SERIAL), Asynchronous SERIAL (ASYNC), ISDN BRI ports, and the like. The RJ-45 port is a twisted pair ethernet port through which the network device 102 may interface with fast ethernet. In some embodiments, RJ-45 ports may also be used to establish connections between wide area networks and local area network VLANs (virtual local area networks), as well as to remote networks or the Internet. The high-speed synchronous SERIAL port (SERIAL) is mainly used for connecting network connection modes such as DDN, Frame Relay (Frame Relay), X.25, PSTN (analog telephone line) and the like which are widely applied at present. The asynchronous serial port (ASYNC) is mainly applied to the connection of a Modem or a Modem pool, and can realize that a remote computer dials into a network through a public telephone network. The ISDN BRI port is used for ISDN line to realize connection with Internet or other remote networks through a router, and can realize 128Kbps communication speed.
The downstream interface may also be referred to as a LAN interface. The network device 102 may include one or more LAN interfaces for connection of the network device 102 to a local area network, including, for example, AUI ports, RJ-45 ports, SC ports, and the like. Wherein each LAN interface can be connected to a terminal device. The AUI port is an interface for connecting to a coarse coax cable, and the network device 102 may connect to a 10Base-5 network via a coarse coax transceiver. The RJ-45 port is a twisted pair ethernet port through which the network device 102 may interface with fast ethernet. The SC port is also called an optical fiber port, and is used for connection with an optical fiber. A fiber port is typically a switch with a fiber port that is not directly fiber connected to a workstation, but is connected by fiber to a fast ethernet or gigabit ethernet or the like.
Optionally, the network device 102 further includes one or more configuration interfaces, which include, for example, a Console port, an AUX port, and the like. The Console port is directly connected to the serial port of the computer by using a configuration special connecting wire, and local configuration is carried out by using a terminal simulation program. The AUX port is an asynchronous port, is mainly used for remote configuration, can also be used for dialing connection, and can also be connected with the MODEM through a transceiver.
Based on the above system architecture and the hardware structures of the electronic device 100 and the network device 102, the following describes a flow of a method for acquiring the ipv6 address by the terminal device in two cases in the embodiment of the present application, and before describing a method for generating the ipv6 address, first, a format of the ipv6 address is briefly described. The address length of the ipv6 address is 128 bits, and is composed of eight 16-bit fields, including a 64-bit prefix and a 64-bit interface ID. Wherein the 64-bit prefix is typically a server-assigned prefix or a prefix generated based on a server-assigned field; the interface ID may be automatically configured from the MAC address of the interface or may be manually configured in the EUI-64 format.
In case one, a network device 102 (hereinafter, a router is taken as an example) exists between the terminal device and the DHCPv6 server 101, and the DHCPv6 server 101 provides an ipv6 address for the terminal device through the network device 102. In the system architecture shown in fig. 1, the DHCPv6 server 101 provides ipv6 addresses for the terminal device 1 and the terminal device 2, and the specific method flow is shown in fig. 3A,
step S101, the Router sends a routing Request (RS) message to the DHCPv6 server.
The router sends an RS message, the destination address of the IP packet of which may fill the broadcast address and the source address may fill the MAC address of the requester (the router), the RS message requesting to establish a communication connection with a DHCPv6 server.
Step S102, after receiving the RS packet, the DHCPv6 server sends a Routing Acknowledgement (RA) packet to the Router based on the RS packet.
After receiving the RS message, the DHCPv6 server sends an RA message to the router in response to the RS message. The RA message includes one or more of the following: an address configuration identifier M and other information configuration identifiers O; one or more link prefixes and the life cycle of the link prefixes, and so on.
The router uses a link prefix and an interface ID carried in an RA message to generate a global unicast address, and finishes stateless address configuration; when the value of M is 1, a stateful address configuration mode is used, which means that the router acquires address information through the dynamic host configuration protocol DHCPV 6.
The other information configuration identifier O is used to instruct the router to use a stateless address configuration mode to obtain other configuration information or a stateful address configuration mode to obtain other configuration information, when the value of O is 1, the router uses a stateful address configuration mode to obtain other configuration information through the DHCPV6, and the other configuration information may be information related to a domain name system or information of other services in the network.
After receiving the RA packet, if the RA packet indicates to use address automatic configuration and the value of the address configuration M identifier is 0, step S103, the router obtains address information using a stateless address configuration mode.
The RA message carries correct link prefixes, and the router generates a global unicast address by using the link prefixes and the interface ID to complete stateless address configuration.
Optionally, if the value of the other information configuration identifier O is 0, the terminal device obtains the other configuration information by using a stateless address configuration mode.
After the terminal device receives the RA packet, if the RA packet indicates to use address automatic configuration and the value of the address configuration identifier M is 1, step S104, the router obtains address information using a stateful address configuration mode.
Optionally, if the value of the other information configuration identifier O flag is 1, the terminal device obtains the other configuration information by using a stateful address configuration mode.
The stateful address configuration uses DHCPv6 protocol, a DHCPv6 client (i.e. a router) sends a configuration request to a DHCPv6 server, and the DHCPv6 server returns corresponding configuration information according to a policy.
Step S105, the router sends a configuration request to the DHCPv6 server to request to acquire the IANA address and the IAPD address prefix.
Step S106, the DHCPv6 server sends IANA address and IAPD address prefix to the router based on the received configuration request.
The IANA address is a network side address (ipv6 address) provided by the DHCPv6 server for a network device (router) and provided for an upstream interface (WAN port) of the router for the router to access the wide area network.
IAPD address prefixes, by which a user-side address provided by a router to an end device and an ipv6 address provided by the router to the end device that establishes a connection with the router and an ipv6 address provided to a downstream interface (LAN port) of the router, are used to provide the end device with the user-side address for a network device (router). The user side address is used for data communication between the terminal device and the router. Specifically, the IAPD address prefix is a subnet prefix sent by the DHCPv6 server to the router, which functions to assign a network number to the router, and then the router can subdivide the network number into several segments to be assigned to its interfaces (downstream interface LAN ports), and end devices or other nodes connected in these interfaces, to establish a communication link.
That is, the IAPD address prefix specifies a network segment in which the router can assign addresses to its own downstream interface and other terminal devices (or nodes), and the address of the router upstream interface (WAN port) needs to be provided by the IANA address.
And step S107, the router takes the received IANA address as an ipv6 address of an uplink interface, generates an ipv6 address of a user side based on the received IAPD address prefix, and allocates the ipv6 address of the user side to the terminal equipment.
In the system architecture of fig. 1, the router uses the received IANA address as an ipv6 address of an upstream interface (WAN port); and generating an ipv6 address of the user side based on the received IAPD address prefix, and establishing a communication link between the router and the terminal device. For example, in the system architecture of fig. 1, a router is connected to the terminal device 1 through the downlink interface 1, and the router configures an ipv6 address for the downlink interface 1 and the terminal device 1 respectively based on an IAPD address prefix, so as to establish a communication link between the router and the terminal device 1, so that the router and the terminal device 1 can implement data communication, and then the terminal device 1 can access the wide area network through the router. The terminal device 2 is the same.
For another example, the router and the terminal device establish a wireless connection (e.g., a Wi-Fi connection), the router establishes a communication link between the router and the terminal device, and configures an ipv6 address for the router and the terminal device, respectively, based on the IAPD address prefix, so that the router and the terminal device can implement data communication, and the terminal device can access the wide area network through the router.
As can be seen from this, when a network device (e.g., a router) exists between the terminal device and the DHCPv6 server, the router allocates ipv6 addresses to the communication link between the terminal device and the router based on the acquired IAPD address prefix transmitted by the DHCPv6 server, and uses the acquired IANA address transmitted by the DHCPv6 server as the ipv6 address of the uplink interface (WAN interface) to implement data communication between the terminal device and the internet.
In some embodiments, the router uses the received IANA address as an ipv6 address of an upstream interface (WAN port) and broadcasts a received IAPD address prefix in the local area network, and the end device receives the IAPD address prefix, generates an ipv6 address based on the IAPD address prefix, and uses the address as its ipv6 address. Wherein the ipv6 address may be generated by the end device based on the IAPD address prefix and the interface ID of the end device.
In case two, no network device (such as a router) exists between the terminal device and the DHCPv6 server, and the DHCPv6 server directly provides the ipv6 address for the terminal device. In the system architecture shown in fig. 1, the DHCPv6 server provides an ipv6 address for the terminal device 3, and the specific method flow is shown in fig. 3B.
Step S201, the terminal device sends an RS message to the DHCPv6 server.
And step S202, after receiving the RS message, the DHCPv6 server sends an RA message to the terminal equipment based on the RS message.
After the terminal device receives the RA packet, if the RA packet indicates that the address is automatically configured and the value of the address configuration identifier M is 0, step S203, the terminal device obtains the address information in a stateless address configuration mode.
After the terminal device receives the RA packet, if the RA packet indicates automatic address configuration and the value of the address configuration identifier M is 1, step S204, the terminal device obtains address information by using a stateful address configuration mode. The stateful address configuration uses a DHCPv6 protocol, a DHCPv6 client (namely, a terminal device) sends a configuration request to a DHCPv6 server, and the DHCPv6 server returns corresponding configuration information according to a policy.
The actions performed by the terminal device in steps S201 to S204 may refer to the actions performed by the router in steps S101 to S104, and are not described herein again.
Step S205, the terminal device sends a configuration request to the DHCPv6 server to request to acquire the IANA address.
Step S206, the DHCPv6 server sends the IANA address to the terminal device based on the received configuration request.
Step S207, the terminal device receives the IANA address, the IANA address is used as the ipv6 address of the terminal device, and the terminal device accesses the wide area network based on the ipv6 address.
In some embodiments, step S205 may be replaced by the terminal device sending a configuration request to the DHCPv6 server, requesting an IANA address and an IAPD address prefix, and then the terminal device using the received IANA address as its ipv6 address, and implementing the terminal device accessing the wide area network based on the ipv6 address. If the terminal device is used as a relay network device, the ipv6 address of the user side may also be generated by using the received IAPD address prefix, so as to provide an ipv6 address for the next-level device or node.
As can be seen from this, when there is no network device (e.g., router) between the terminal device and the DHCPv6 server, the terminal device uses the IANA address sent by the DHCPv6 server as its ipv6 address, and thereby the terminal device can access the wide area network.
In some practical scenarios, in the step S106/step S206, the DHCPv6 server may not send an IANA address to the router/terminal device due to the reason of address configuration management, or even due to a configuration error, and the router/terminal device may only obtain an IAPD address prefix and may not obtain the IANA address, so that the router/terminal device may not surf the internet. In case one, when the router requests the DHCPv6 server for the IANA address and IAPD address prefix, the DHCPv6 server does not assign the IANA address to the router, and only sends the IAPD address prefix to the router. Because the router does not receive the IANA address, the uplink interface of the router does not have the ipv6 address, even if the router can allocate the user-side address to the terminal device through the IAPD address prefix, the terminal device in the same local area network as the router cannot surf the internet because the router cannot surf the internet. Similarly, in the second case, when the terminal device requests the DHCPv6 server for the IANA address and the IAPD address prefix, the DHCPv6 server does not allocate the IANA address to the terminal device, and only sends the IAPD address prefix to the terminal device. Because the terminal device does not receive the IANA address, the terminal device does not have the ipv6 address and cannot surf the internet.
In view of the above scenario, the embodiment of the present application provides a method for generating an ipv6 address, which can generate an ipv6 address when a router/terminal device only receives an IAPD address prefix and does not receive an IANA address, thereby implementing internet access. In the case of the above-mentioned situation one, a network device (e.g., a router) exists between the terminal device and the DHCPv6 server, and the DHCPv6 server provides the ipv6 address for the terminal device through the network device. As shown in fig. 4, the method includes:
and step S301, the router sends an RS message to the DHCPv6 server.
And step S302, after receiving the RS message, the DHCPv6 server sends an RA message to the router based on the RS message.
After receiving the RA packet, if the RA packet indicates automatic address configuration and the value of the address configuration M identifier is 0, the router acquires address information using a stateless address configuration mode in step S303.
After the terminal device receives the RA packet, if the RA packet indicates that the address is automatically configured and the value of the address configuration M identifier is 1, step S304, the router acquires the address information by using a stateful address configuration mode.
The actions performed by the router in steps S301 to S304 may refer to the actions performed by the router in steps S101 to S104, which are not described herein again.
Step S305, the router sends a configuration request to the DHCPv6 server to request to acquire the IANA address and the IAPD address prefix.
In some embodiments, step S305 may be replaced by the router sending a configuration request to the DHCPv6 server requesting to obtain the IANA address or IAPD address prefix.
Step S306, the DHCPv6 server sends IAPD address prefix to the router based on the received configuration request.
Step S307, the router generates its ipv6 address based on the received IAPD address prefix, generates an ipv6 address of the user side based on the received IAPD address prefix, and assigns the ipv6 address of the user side to the terminal device.
The router receives the IAPD address prefix sent by the DHCPv6 server, and does not receive the IANA address, as shown in fig. 5, at this time, the data packet received by the router is captured, and it can be seen that the data packet received by the router includes the IAPD address prefix, and does not have the IANA address.
And the router detects that the IANA address sent by the DHCPv6 server is not received, and the router generates an ipv6 address of an uplink interface (WAN port) of the router according to the received IAPD address prefix. The specific generation mode includes that if the length of the address prefix of the IAPD is less than 64 bits, the address prefix of the IAPD is expanded into 64 bits, and the expansion mode can be, for example, tail filling 0; if the IAPD address prefix is 64 bits long, no extensions are needed. Then, an IPv6 address of the router upstream interface WAN port is generated based on the 64-bit IAPD address prefix, and the generation method includes, for example: the newly extended 64-bit IAPD address prefix is + 64-bit interface ID. The interface ID is the interface ID of the router uplink interface, wherein the interface ID can be generated according to the EUI-64 specification and the interface MAC address. It can be detected that the IPv6 address prefix used by the upstream interface (WAN port) of the router matches the IAPD address prefix acquired by the router. In some embodiments, the prefix of the IAPD address acquired by the router is M bits, and the first M bits of the IPv6 address of the uplink interface (WAN port) of the router are the same as the acquired prefix of the IAPD address. Here, the ipv6 address of the upstream interface (WAN port) of the router may also be referred to as a third ipv6 address.
In some embodiments, the generation manner may be further that, when the length of the IAPD address prefix acquired by the router is M bits and the preset length is configured as N bits, M, N is an integer, and M is smaller than N. And expanding the acquired IAPD address prefix into an IAPD address prefix of an N-bit mask in a 0 supplementing mode, wherein the IAPD address prefix is used as the expanded IAPD address prefix. Then, the value of the N-th bit of the N-bit mask of the IAPD address prefix of the expanded N-bit mask is set to be 1 as the minimum address prefix in the address pool, and the value of the last N-M bit in the N-bit mask of the IAPD address prefix of the expanded N-bit mask is set to be 1 as the maximum address prefix in the address pool, so as to generate the IAPD address pool. For example, if N is 64 and M is 60, the 60-bit IAPD address prefix is complemented by 0 at the tail and extended to 64 bits, i.e., bit 61 to bit 64 are 0. Then setting the value of the 64 th bit in the 64-bit IAPD address prefix as 1 as the minimum address prefix in the address pool; the values of the 61 st bit to the 64 th bit in the 64-bit IAPD address prefix are all set to 1 as the largest address prefix in the address pool. The newly extended 64-bit IAPD address prefix may be one of the smallest to largest address prefixes in the address pool. The newly extended 64-bit IAPD address is then prefixed with an interface ID of + 64-bit. The interface ID is the interface ID of the router uplink interface, wherein the interface ID can be generated according to the EUI-64 specification and the interface MAC address. It can be detected that the address prefix of the IPv6 address used by the WAN port of the upstream interface of the router matches the IAPD address prefix acquired by the router.
The router may also generate an IPv6 address of an uplink interface (WAN port) of the router by using the IAPD address prefix in other manners, which is not limited in this embodiment of the present application.
The router generates an ipv6 address on the user side based on the IAPD address prefix, assigns an ipv6 address of a downstream interface (LAN port) of the router, and assigns an ipv6 address to a terminal device connected to the router. The terminal device may access the wide area network through the router based on its ipv6 address. Wherein, the ipv6 address of the terminal device and the ipv6 address of the LAN port are in the same network segment. Here, the ipv6 address assigned to the terminal device by the router may also be referred to as a first ipv6 address, and the ipv6 address of the LAN port of the router may also be referred to as a second ipv6 address.
As can be seen from this, when a network device (for example, a router) exists between the terminal device and the DHCPv6 server, the router generates an address on the user side from the acquired IAPD address prefix, and assigns an ipv6 address to the terminal device and the router based on the communication link between the terminal device and the router, thereby realizing data communication between the terminal device and the router. Under the condition of no IANA address, the router generates an ipv6 address of the uplink interface through an IAPD address prefix, so that the problem that the router accesses a wide area network is solved, and data communication between the terminal equipment and the wide area network is realized.
In some embodiments, in step S306, the DHCPv6 server sends the IANA address and the IAPD address prefix to the router, and the router detects that the IAPD address prefix is received, and even if the router receives the IANA address, the router may generate an ipv6 address of an upstream interface (WAN port) according to the IAPD address prefix, that is, an interface ID of a PD prefix +64bit of 64 bits to be extended, where the interface ID is an interface ID of the upstream interface of the router, where the interface ID may be generated according to an interface MAC address according to the EUI-64 specification.
In some embodiments, based on the system architecture of case one, if the end device does not receive the ipv6 address allocated by the router, the end device may acquire an IAPD address prefix from the router, and then generate an ipv6 address of itself based on the IAPD address prefix, that is, an extended interface ID of a PD prefix of 64 bits +64 bits, where the interface ID is an interface ID of the end device connected to the lan, and the interface ID may be generated according to an interface MAC address according to the EUI-64 specification.
In some embodiments, the router receives an IAPD address prefix, broadcasts the IAPD address prefix in the local area network, and the end device receives the IAPD address prefix and generates its ipv6 address. Wherein the ipv6 address may be generated based on the IAPD address prefix and the interface ID of the end device. The manner in which the terminal device generates the ipv6 address based on the IAPD address prefix may refer to the manner in which the router generates the ipv6 address based on the IAPD address prefix, which is not described herein again.
In this embodiment of the present application, in a case where a network device (for example, a router) exists between a terminal device and a DHCPv6 server, the router allocates an ipv6 address to the terminal device by acquiring an IAPD address prefix, and acquires an ipv6 address of an uplink interface by using the IAPD address prefix, so that even if the router does not acquire an IANA address sent by the DHCPv6 server, data communication between the terminal device and a wide area network can be achieved.
For the second case, no network device (e.g. router) exists between the terminal device and the DHCPv6 server, and the DHCPv6 server directly provides the ipv6 address for the terminal device. As shown in fig. 6, the method includes:
and step S401, the terminal equipment sends an RS message to the DHCPv6 server.
Step S402, after receiving the RS message, the DHCPv6 server sends an RA message to the terminal device based on the RS message.
After the terminal device receives the RA packet, if the RA packet indicates that the address is automatically configured and the value of the address configuration M identifier is 0, step S403, the terminal device obtains the address information in a stateless address configuration mode.
After the terminal device receives the RA packet, if the RA packet indicates automatic address configuration and the value of the address configuration M identifier is 1, step S404, the terminal device obtains address information by using a stateful address configuration mode.
The actions performed by the terminal device in steps S401 to S404 may refer to the actions performed by the router in steps S101 to S104, and are not described herein again.
Step S405, the terminal device sends a configuration request to the DHCPv6 server, and requests an IANA address and an IAPD address prefix.
In some embodiments, step S205 may instead be that the terminal device sends a configuration request to the DHCPv6 server, requesting an IANA address or IAPD address prefix.
Step S406, the DHCPv6 server sends an IAPD address prefix to the end device based on the received configuration request.
In step S407, the terminal device generates an ipv6 address based on the IAPD address prefix, and sets the ipv6 address as its ipv6 address.
The terminal device receives the IAPD address prefix sent by the DHCPv6 server, and does not receive the IANA address, and at this time, captures the data packet received by the terminal device, and can see that the data packet received by the terminal device contains the IAPD address prefix, and does not have the IANA address.
The terminal equipment generates an ipv6 address according to the IAPD address prefix. Specifically, if the length of the IAPD address prefix is less than 64 bits, the IAPD address prefix is extended to 64 bits, and the extension mode may be, for example, tail padding 0; if the IAPD address prefix is 64 bits long, no extensions are needed. Then, an IPv6 address is generated based on the 64-bit IAPD address prefix, and the generation method includes: the newly extended 64-bit PD prefix + 64-bit interface ID. The interface ID is the interface ID of the terminal device connected with the DHCPv6 server, wherein the interface ID can be generated according to the interface MAC address according to the EUI-64 specification. It can be detected that the address prefix of the IPv6 address of the terminal device matches the IAPD address prefix acquired by the terminal device. In some embodiments, the prefix of the IAPD address acquired by the terminal device is M bits, and the first M bits of the IPv6 address of the terminal device are the same as the acquired prefix of the IAPD address. Here, the ipv6 address generated by the terminal device from the IAPD address prefix may also be referred to as a fourth ipv6 address.
In some embodiments, the generation manner may be further that, when the length of the IAPD address prefix acquired by the terminal device is M bits and the preset length is configured to be N bits, where M, N is an integer and M is smaller than N. And expanding the acquired IAPD address prefix into an IAPD address prefix of an N-bit mask in a 0 supplementing mode, wherein the IAPD address prefix is used as the expanded IAPD address prefix. Then, the value of the nth bit of the N-bit mask of the extended N-bit masked IAPD address prefix is set to 1 as the minimum address prefix in the address pool, and the value of the last N-M bit of the N-bit mask of the extended N-bit masked IAPD address prefix is set to 1 as the maximum address prefix in the address pool, thereby generating the IAPD address pool. For example, if N is 64 and M is 60, the 60-bit IAPD address prefix is complemented by 0 at the tail and extended to 64 bits, i.e., bit 61 to bit 64 are 0. Then setting the value of the 64 th bit in the 64-bit IAPD address prefix as 1 as the minimum address prefix in the address pool; the values of the 61 st bit to the 64 th bit in the 64-bit IAPD address prefix are all set to 1 as the largest address prefix in the address pool. The newly extended 64-bit IAPD address prefix may be one of the minimum to maximum address prefixes. The newly extended 64-bit IAPD address is then prefixed with an interface ID of + 64-bit. The interface ID is the interface ID of the router uplink interface, wherein the interface ID can be generated according to the EUI-64 specification and the interface MAC address. It can be detected that the address prefix of the IPv6 address used by the terminal device matches the IAPD address prefix acquired by the terminal device.
The terminal device may also generate the IPv6 address by using the IAPD address prefix in other manners, which is not limited in this embodiment of the present application.
In some embodiments, in step S306, the terminal device receives the IANA address and the IAPD address prefix sent by the DHCPv6 server, and the terminal device detects that the IAPD address prefix is received, and even if the terminal device receives the IANA address, the terminal device may generate an ipv6 address of the uplink interface WAN port according to the IAPD address prefix, that is, an interface ID of the extended 64-bit PD prefix +64bit, where the interface ID is an interface ID of the terminal device connected to the local area network, and the interface ID may be generated according to the interface MAC address according to the EUI-64 specification.
In this embodiment of the application, when there is no network device (e.g., a router) between the terminal device and the DHCPv6 server, the terminal device may generate an ipv6 address as its ipv6 address by using an IAPD address prefix, and access to the wide area network by the terminal device is implemented based on the ipv6 address. Even if the terminal device does not acquire the IANA address sent by the DHCPv6 server, the terminal device can access the wide area network.
In the above embodiments, the implementation may be wholly or partially realized 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 network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (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., DVD), or a semiconductor medium (e.g., solid state disk), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.

Claims (10)

1. An IPv6 address generation method, applied to a network device, where an uplink interface of the network device performs data communication with a DHCPv6 server, and a downlink interface of the network device performs data communication with a terminal device, the method comprising:
the network equipment sends a configuration request to the DHCPv6 server;
the network equipment receives an IAPD address prefix sent by the DHCPv6 server to the network equipment based on the configuration request;
the network equipment configures a first IPv6 address for the terminal equipment, configures a second IPv6 address for a downlink interface of the network equipment and configures a third IPv6 address for an uplink interface of the network equipment based on the received IAPD address prefix; the third IPv6 address matches the IAPD address prefix; the first IPv6 address and the second IPv6 address are used for achieving communication between the network device and the terminal device, and the third IPv6 address is used for enabling the network device to access a wide area network.
2. The method of claim 1, wherein the network device sends a configuration request to the DHCPv6 server, further comprising:
the network equipment sends an RS message to the DHCPv6 server;
and the network equipment receives an RA message sent to the network equipment by the DHCPv6 server based on the RS message, wherein the RA message indicates that the network equipment sends the configuration request to the DHCPv6 server to acquire address information.
3. The method of claim 1 or 2, wherein the network device configures a third IPv6 address for the upstream interface of the network device based on the received IAPD address prefix, and wherein the method further comprises:
the network equipment receives an IANA address sent by the DHCPv6 server to the network equipment based on the configuration request;
the network device configures a third IPv6 address for an uplink interface of the network device based on the received IAPD address prefix, including:
and the network equipment selects the IAPD address prefix to configure the third IPv6 address for the uplink interface of the network equipment based on the received IANA address and the IAPD address prefix.
4. The method of any of claims 1-3, wherein the IAPD address prefix is M bits in length, and wherein the network device configures a third IPv6 address for an upstream interface of the network device based on the received IAPD address prefix, including:
when the M is smaller than N, the network equipment expands the IAPD address prefix with M bits into an IAPD address prefix with N bits, wherein N is a preset numerical value, and both the M and the N are positive integers;
the network device adds the IAPD address prefix of the N bit to the interface ID of the uplink interface of the network device to form the third IPv6 address;
the network device takes the third IPv6 address as a network address of an uplink interface of the network device; or,
when the M is equal to the N, the network device adds an IAPD address prefix of the M bit to an interface ID of an uplink interface of the network device to form a third IPv6 address, wherein the N is a preset numerical value, and the M and the N are both positive integers;
and the network equipment takes the third IPv6 address as the network address of the uplink interface of the network equipment.
5. An IPv6 address generation method, the method comprising:
the terminal equipment sends a configuration request to a DHCPv6 server;
the terminal equipment receives an IAPD address prefix sent to the terminal equipment by the DHCPv6 server based on the configuration request;
the terminal equipment configures an IPv6 address for the terminal equipment based on the received IAPD address prefix, the IPv6 address is matched with the IAPD address prefix, and the IPv6 address is used for the terminal equipment to access a wide area network.
6. The method of claim 5, wherein the terminal device sends the configuration request to the DHCPv6 server, and wherein the method further comprises:
the terminal equipment sends an RS message to the DHCPv6 server;
and the terminal equipment receives an RA message sent to the terminal equipment by the DHCPv6 server based on the RS message, wherein the RA message indicates that the terminal equipment sends the configuration request to the DHCPv6 server to acquire address information.
7. The method of claim 5 or 6, wherein the terminal device configures an IPv6 address for the terminal device based on the received IAPD address prefix, and further comprising:
the terminal equipment receives an IANA address sent by the DHCPv6 server to the terminal equipment based on the configuration request;
the terminal device configures an IPv6 address for the terminal device based on the received IAPD address prefix, including:
and the terminal equipment selects the IAPD address prefix to configure an IPv6 address for the terminal equipment based on the received IANA address and the IAPD address prefix.
8. The method of any of claims 5-7, wherein the length of the IAPD address prefix is M bits, and wherein the terminal device configures an IPv6 address for the terminal device based on the received IAPD address prefix, and wherein the method comprises:
when the M is smaller than N, the terminal equipment expands the IAPD address prefix with the M bit into an IAPD address prefix with the N bit, wherein the N is a preset numerical value, and the M and the N are both positive integers;
the terminal equipment adds the IAPD address prefix of the N bit to the interface ID of the terminal equipment to form the IPv6 address;
the terminal device takes the IPv6 address as a network address of the terminal device; or,
when the M is equal to the N, the terminal equipment adds an IAPD address prefix of the M bit to an interface ID of the terminal equipment to form the IPv6 address, wherein the N is a preset numerical value, and the M and the N are both positive integers;
and the terminal equipment takes the IPv6 address as the network address of the terminal equipment.
9. An electronic device, comprising: one or more processors, one or more memories; the one or more memories are respectively coupled with the one or more processors; the one or more memories are for storing computer program code comprising computer instructions; the computer instructions, when executed on the processor, cause the electronic device to perform the method of claims 1-4 or the method of claims 5-8.
10. A computer readable medium storing one or more programs, wherein the one or more programs are configured to be executed by the one or more processors, the one or more programs comprising instructions for performing the method of claims 1-4 or the method of claims 5-8.
CN202110206724.1A 2021-02-24 2021-02-24 IPv6 address generation method and related device Pending CN114979075A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110206724.1A CN114979075A (en) 2021-02-24 2021-02-24 IPv6 address generation method and related device
PCT/CN2022/076316 WO2022179410A1 (en) 2021-02-24 2022-02-15 Ipv6 address generation method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110206724.1A CN114979075A (en) 2021-02-24 2021-02-24 IPv6 address generation method and related device

Publications (1)

Publication Number Publication Date
CN114979075A true CN114979075A (en) 2022-08-30

Family

ID=82972994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110206724.1A Pending CN114979075A (en) 2021-02-24 2021-02-24 IPv6 address generation method and related device

Country Status (2)

Country Link
CN (1) CN114979075A (en)
WO (1) WO2022179410A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115767510B (en) * 2022-11-16 2024-05-28 烽火通信科技股份有限公司 Ipv6 self-adaptive networking method, system and PD client

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101984636A (en) * 2010-10-25 2011-03-09 华为技术有限公司 Prefix distribution method, device and system
CN102340452A (en) * 2011-10-14 2012-02-01 中兴通讯股份有限公司 Single-Internet protocol version 6 (IPv6)-address-prefix-based routing transmission method and wireless equipment
CN102497456A (en) * 2011-12-06 2012-06-13 太仓市同维电子有限公司 System and method for realizing automatic generation of client address on basis of dynamic host configuration protocol (DHCP) protocol
US8681695B1 (en) * 2009-10-14 2014-03-25 Juniper Networks, Inc. Single address prefix allocation within computer networks
US20140355609A1 (en) * 2013-05-31 2014-12-04 Cisco Technology, Inc Routing aggregation and prefix delegation
CN104243454A (en) * 2014-08-28 2014-12-24 杭州华三通信技术有限公司 IPv6 message filtering method and device
CN108848100A (en) * 2018-06-27 2018-11-20 清华大学 A kind of stateful IPv6 address generating method and device
CN111586197A (en) * 2020-04-23 2020-08-25 中国信息通信研究院 Method and device for redistributing address prefixes

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8681695B1 (en) * 2009-10-14 2014-03-25 Juniper Networks, Inc. Single address prefix allocation within computer networks
CN101984636A (en) * 2010-10-25 2011-03-09 华为技术有限公司 Prefix distribution method, device and system
CN102340452A (en) * 2011-10-14 2012-02-01 中兴通讯股份有限公司 Single-Internet protocol version 6 (IPv6)-address-prefix-based routing transmission method and wireless equipment
CN102497456A (en) * 2011-12-06 2012-06-13 太仓市同维电子有限公司 System and method for realizing automatic generation of client address on basis of dynamic host configuration protocol (DHCP) protocol
US20140355609A1 (en) * 2013-05-31 2014-12-04 Cisco Technology, Inc Routing aggregation and prefix delegation
CN104243454A (en) * 2014-08-28 2014-12-24 杭州华三通信技术有限公司 IPv6 message filtering method and device
CN108848100A (en) * 2018-06-27 2018-11-20 清华大学 A kind of stateful IPv6 address generating method and device
CN111586197A (en) * 2020-04-23 2020-08-25 中国信息通信研究院 Method and device for redistributing address prefixes

Also Published As

Publication number Publication date
WO2022179410A1 (en) 2022-09-01

Similar Documents

Publication Publication Date Title
CN105722058B (en) User equipment and information forwarding method
JP6746682B2 (en) Ways to exchange connectivity
KR101692259B1 (en) Method and apparatus and computer readable record media for communication on Wi-Fi(wireless fidelity) direct multi-group network
WO2012169855A2 (en) Method and apparatus for finding a neighbor in a wireless communication system
KR20090033365A (en) System and method for high speed local connectivity between local devices
CN106576119B (en) Method and apparatus for delegating prefixes to Wi-Fi clients
JP6619311B2 (en) Wireless communication apparatus and wireless communication method
CN109729549B (en) Communication method and device
CN114342332B (en) Communication method, device and system
US20190223192A1 (en) Time slot reassignment mechanism for radio access technology coexistence improvement
US10567338B2 (en) Method and apparatus for setting up relay link in wireless communication system
JP6702563B2 (en) Wireless communication device
WO2012149783A1 (en) Method, device, and user equipment applicable in accessing mobile network
US20140211801A1 (en) Multiple media access control (mac) address resolution vertical travel
KR20210091154A (en) Extended connection method and extended connection system for Bluetooth devices
JP6876847B2 (en) Wireless communication device and wireless communication method
EP3345377A1 (en) Enhanced neighbor discovery for communication networks
JP2018160782A (en) Radio communication device and radio communication method
AU2018402038A1 (en) BWP frequency hopping configuration method, network device and terminal
CN112398959A (en) RLC channel determination method and device
JP2023521621A (en) Method, Apparatus, and System for Edge Network Management Server Discovery
CN112019489B (en) Verification method and device
WO2022179410A1 (en) Ipv6 address generation method and related device
US20150319132A1 (en) Method, terminal, and server for providing communication service
JP6905580B2 (en) Wireless communication 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