CN108183977B - Method and device for dynamically distributing IPv4 public address through IPv6 Internet - Google Patents

Method and device for dynamically distributing IPv4 public address through IPv6 Internet Download PDF

Info

Publication number
CN108183977B
CN108183977B CN201810196121.6A CN201810196121A CN108183977B CN 108183977 B CN108183977 B CN 108183977B CN 201810196121 A CN201810196121 A CN 201810196121A CN 108183977 B CN108183977 B CN 108183977B
Authority
CN
China
Prior art keywords
ipv4 public
public address
ipv4
address
target
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
CN201810196121.6A
Other languages
Chinese (zh)
Other versions
CN108183977A (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201810196121.6A priority Critical patent/CN108183977B/en
Publication of CN108183977A publication Critical patent/CN108183977A/en
Application granted granted Critical
Publication of CN108183977B publication Critical patent/CN108183977B/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
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/686Types of network addresses using dual-stack hosts, e.g. in Internet protocol version 4 [IPv4]/Internet protocol version 6 [IPv6] networks

Landscapes

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

Abstract

The embodiment of the invention provides a method and a device for dynamically distributing an IPv4 public address through an IPv6 Internet, wherein the method comprises the following steps: receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address; if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark; and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address. The device performs the above method. The method and the device for dynamically distributing the IPv4 public address through the IPv6 internet, provided by the embodiment of the invention, can improve the utilization rate of IPv4 public address resources, thereby ensuring the interconnection and intercommunication of an IPv4 network and an IPv6 network in a transition stage.

Description

Method and device for dynamically distributing IPv4 public address through IPv6 Internet
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a device for dynamically distributing an IPv4 public address through an IPv6 Internet.
Background
With the rapid development of internet technology, the number of global IPv4 users is also rapidly increasing, and a series of serious problems of IPv4, including insufficient address space, routing scalability problems, etc., are also highlighted.
The IPv6 protocol is the next generation internet protocol and is used in place of IPv 4. The IPv6 has the characteristics of huge address space (2^128), layered addressing and routing mechanisms, better security, mobility support and the like. However, in a period of the future, the IPv6 and the IPv4 coexist for a long time, and in order to make the IPv6 and the IPv4 compatible, that is, to implement the interconnection and the intercommunication between the IPv6 network and the IPv4 network, an IPv4 public address is required, whereas an IPv4 public address is an extremely scarce resource, and the utilization rate of the IPv4 public address resource in the prior art is low, thereby affecting the interconnection and the intercommunication between the IPv4 network and the IPv6 network.
Therefore, how to avoid the above-mentioned drawbacks and improve the utilization rate of the IPv4 public address resource is a problem to be solved urgently.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method and a device for dynamically distributing an IPv4 public address through an IPv6 Internet.
In a first aspect, an embodiment of the present invention provides a method for dynamically allocating an IPv4 public address through an IPv6 internet, where the method includes:
receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address;
if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark;
and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address.
In a second aspect, an embodiment of the present invention provides an apparatus for dynamically allocating an IPv4 public address through an IPv6 internet, where the apparatus includes:
a receiving unit, configured to receive a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address;
the generating unit is used for extracting a target IPv4 public address from the IPv4 public address resource and generating a target address added with an IPv6 prefix mark if judging that the IPv4 public address resource which is not allocated exists;
and the distribution unit is used for distributing the target address to the user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access the IPv4 network through the IPv6 network according to the target address.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising:
receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address;
if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark;
and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform a method comprising:
receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address;
if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark;
and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address.
The method and the device for dynamically distributing the IPv4 public address through the IPv6 internet, provided by the embodiment of the invention, can improve the utilization rate of IPv4 public address resources, thereby ensuring the interconnection and intercommunication of an IPv4 network and an IPv6 network in a transition stage.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for dynamically allocating IPv4 public addresses via IPv6 Internet according to an embodiment of the present invention;
FIG. 2 is a diagram of a system for dynamically allocating IPv4 public addresses via IPv6 Internet according to an embodiment of the present invention;
FIG. 3 is a general flowchart of an embodiment of the present invention for dynamically allocating IPv4 public addresses via IPv6 Internet;
FIG. 4 is a schematic structural diagram of an apparatus for dynamically allocating an IPv4 public address through an IPv6 Internet according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow chart of a method for dynamically allocating an IPv4 public address through an IPv6 internet according to an embodiment of the present invention, and as shown in fig. 1, the method for dynamically allocating an IPv4 public address through an IPv6 internet according to an embodiment of the present invention includes the following steps:
s1: receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries the user identification and the time period for the user to use the IPv4 public address.
Specifically, the device receives a request for acquiring an IPv4 public address sent by a user terminal; the request carries the user identification and the time period for the user to use the IPv4 public address. Fig. 2 is a system structure diagram for dynamically allocating an IPv4 public address through an IPv6 internet according to an embodiment of the present invention, and the device may be a server, an apparatus, or the like including the core IPv4/IPv6 translator in fig. 2. The user terminal may be a terminal including the user side IPv4/IPv6 translator in fig. 2, or the like. The user identification may be a user name, a user number, etc. The time period of the user using the IPv4 public address can be understood as a time period from the time when the user initiates the request, and can be expressed in time granularity of minutes, hours, days, and the like.
S2: if the IPv4 public address resources which are not allocated exist, extracting the target IPv4 public address from the IPv4 public address resources, and generating the target address with the IPv6 prefix mark.
Specifically, if the device judges that the unallocated IPv4 public address resource exists, the device extracts the target IPv4 public address from the IPv4 public address resource and generates the target address with the IPv6 prefix mark. Examples are as follows: user X finds 4 IPv4 public addresses (here 4 are examples and are not specifically limited) of 60 minutes (a time period using IPv4 public addresses).
The core translator (corresponding device) checks 1.0.10.0/24 (corresponding to IPv4 public address resources) whether there are enough resources that have not been allocated yet, and if so, extracts 1.0.10.8/30 (corresponding to target IPv4 public address) and performs translation with the purpose: generating a target address with an IPv6 prefix tag attached, wherein the translation rule can be as follows:
IPv6 prefix pre-stored in device: 2001: da8:0: a: 64
Destination address with IPv6 prefix tag attached: 3ffe:3200:5:1:0100:0a08: 94.
S3: and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address.
Specifically, the device allocates the target address to the user terminal corresponding to the user identifier, starts timing, and provides the user terminal with access to the IPv4 network via the IPv6 network according to the target address when the timing duration is within the time period. With reference to the above examples: the device allocates 3ffe:3200:5:1:0100:0a08: 94 to the user X, starts timing, and as long as the timing duration is within 60 minutes, the target address is always valid for the user X, namely the user X can access the IPv4 network through the IPv6 network according to the target address. When the time duration exceeds 60 minutes, the device can recycle the allocated target address (i.e. the target address is invalid for user X) and restore the target address to the non-allocated IPv4 public address (i.e. restore 1.0.10.8/30).
The request for obtaining the IPv4 public address may also carry the number of IPv4 public addresses (refer to 4 in the above example), and if there are more than 4 unallocated IPv4 public address resources in the device, 4 target IPv4 public addresses (i.e., 1.0.10.8/30 described above) are also extracted from the IPv4 public address resources, and a target address with an IPv6 prefix tag attached thereto (i.e., 3ffe:3200:5: 0100: 08:/94 described above) is generated.
If the device has the unallocated IPv4 public address resources but the unallocated quantity is less than the carried quantity of the acquired IPv4 public addresses, the unallocated IPv4 public address resources are correspondingly processed according to the preset rules. Assuming that the number of the unallocated IPv4 public address resources is 3, all of the 3 unallocated IPv4 public address resources may generate target addresses to which IPv6 prefix tags are attached, or select 1 or 2(n ═ 2) designated IPv4 public addresses from the 3 unallocated IPv4 public address resources, and generate a corresponding number (1 or 2) of target addresses to which IPv6 prefix tags are attached; wherein n is less than the sum of all the unallocated IPv4 public addresses (i.e. n < 3).
A prompt message can be further sent to the user X; the prompting message may include:
the IPv4 has the message that the public address resources are insufficient (namely the number of requests is 4, and the maximum number of requests which can be provided actually is 3);
and/or the presence of a gas in the gas,
the real number of the allocated IPv4 public address resources and the amount of the carried difference between the number of the acquired IPv4 public addresses and the real number. Taking n as an example, 2, the following is explained: that is, the real number of the allocated IPv4 public address resources is 2, and the balance number is 4-2, and is also 2.
If the device does not have the IPv4 public address resource which is not allocated yet, a notification message for prompting the user to have no IPv4 public address resource is sent to the user X.
Fig. 3 is a general flowchart of an embodiment of dynamically allocating an IPv4 public address through an IPv6 internet, and a brief description is made as follows in conjunction with fig. 3 for a user terminal (user X) to access an IPv4 network through an IPv6 network according to the target address:
core translator configuration parameters:
the IPv6 prefix and IPv4 public address resources of the core translator a are respectively as follows:
2001:da8:0:a::/64,1.0.10.0/24
user-side translator configuration parameters:
for example, there are 3 user side translators, corresponding to the IPv6 prefix of the user side translator, the IPv4 private address resource is:
user-side translator X: 3ffe:3200:5:1: 64: 10.5.1.0/24
User-side translator Y: 3ffe:3200:5:2: 64: 10.5.2.0/24
User-side translator Z: 3ffe:3200:5:3: 64: 10.5.3.0/24.
And receiving a request for acquiring the IPv4 public address sent by the user terminal (corresponding to the user request, a section of IPv4 address is used in a certain period).
If there is an IPv4 public address resource that has not been allocated, extracting a target IPv4 public address from the IPv4 public address resource (corresponding to satisfying a judgment condition that "the core translator checks the IPv4 address pool for resources" in fig. 3).
And generating a target address with an IPv6 prefix tag attached, allocating the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network via an IPv6 network according to the target address (corresponding to "check setting timeout switch, core translator configuration translation rule, notify user" in fig. 3).
The translation parameters of the user side translator (corresponding to the user terminal) are as follows:
source IPv6 prefix: 3ffe:3200:5:1:0100:0a08: 94
Target IPv6 prefix: 2001: da8:0: a: 64
IPv4 public address: 1.0.10.8
When an IPv4 client of user X initiates access to a WEB server 3.0.0.6 of the IPv4 Internet using a dynamically allocated IPv4 public address 1.0.10.9 (obtained according to 1.0.10.8), the header information of the transmitted packet (corresponding to the user sending an IPv4 message) is
TCP,1.0.10.9%X,3.0.0.6#80
The header information grouped by the user side translator X is: TCP, [3ffe:3200:5:1:0100:0a09: ] # X, [2001: da8:0: a:0300:0006: ] #80 (corresponding to "user side translator receives IPv4 message, translates into IPv6 message, sends IPv6 message")
After core translation, the header information of the packet transmitted by the core translator (corresponding to "the core translator receives the IPv6 message, translates into the IPv4 message, and sends the IPv4 message") is:
TCP,1.0.10.9%X,3.0.0.6#80
the header information of the packet returned by the IPv4 server (corresponding to "internet IPv4 server provides service and sends IPv4 message") is:
TCP,3.0.0.6#80,1.0.10.9%X
the core translator uses the prefix of the user side translator X according to the IPv4 address range, 3ffe:3200:5:1: 64, the header information of the transmitted packet (corresponding to the fact that the core translator receives the IPv4 message, uses the user prefix, translates into the IPv6 message and sends the IPv6 message) is as follows:
TCP,[2001:da9:0300:0006::]#80,[3ffe:3200:5:1:0100:0a09::]#X
after passing through the user side translator, the header information of the packet transmitted by the user side translator (corresponding to the steps of receiving the IPv6 message by the user side translator, translating into the IPv4 message and sending the IPv4 message) is as follows
TCP,3.0.0.6#80,1.0.10.9%X
This process is repeated until the communication is complete.
The method for dynamically distributing the IPv4 public address through the IPv6 internet, provided by the embodiment of the invention, can improve the utilization rate of IPv4 public address resources, thereby ensuring the interconnection and intercommunication of the IPv4 network and the IPv6 network in the transition stage.
On the basis of the above embodiment, the method further includes:
and when the timing duration exceeds the time period, recovering the allocated target address and restoring the target address to the unallocated IPv4 public address.
Specifically, when the timing duration exceeds the time period, the device recycles the allocated target address and restores the allocated target address to the unallocated IPv4 public address. Reference may be made to the above embodiments, which are not described in detail.
The method for dynamically allocating the IPv4 public address through the IPv6 internet, provided by the embodiment of the invention, can recycle the allocated target address and restore the target address to the unallocated IPv4 public address, and further can improve the utilization rate of IPv4 public address resources, so that the efficiency of interconnection and intercommunication between the IPv4 network and the IPv6 network is optimized.
On the basis of the above embodiment, the request also carries the number of public addresses for obtaining IPV 4; correspondingly, if there is an unallocated IPv4 public address resource, extracting a target IPv4 public address from the IPv4 public address resource, and generating a target address with an IPv6 prefix tag attached thereto, including:
if the number of the unallocated IPv4 public address resources is larger than the number, extracting the target IPv4 public addresses equal to the number from the IPv4 public address resources, and generating the target addresses with IPv6 prefix marks attached.
Specifically, if the device judges that the number of the unallocated IPv4 public address resources is larger than the number of the unallocated IPv4 public address resources, the device extracts the target IPv4 public addresses equal to the number of the unallocated IPv4 public address resources and generates the target addresses with IPv6 prefix marks. Reference may be made to the above embodiments, which are not described in detail.
The method for dynamically distributing the IPv4 public addresses through the IPv6 Internet, provided by the embodiment of the invention, can provide the target IPv4 public addresses with the number equal to that of the acquired IPv4 public addresses, and better meets the actual requirements of users.
On the basis of the above embodiment, the method further includes:
if the unallocated IPv4 public address resources exist but the unallocated quantity is less than the carried quantity of the acquired IPv4 public addresses, the unallocated IPv4 public address resources are correspondingly processed according to the preset rules.
Specifically, if the device determines that the unallocated IPv4 public address resources exist but the unallocated number is less than the number of the acquired IPv4 public addresses, the device performs corresponding processing on the unallocated IPv4 public address resources according to a preset rule. Reference may be made to the above embodiments, which are not described in detail.
The method for dynamically allocating the IPv4 public address through the IPv6 internet provided by the embodiment of the invention can reasonably perform corresponding processing on the IPv4 public address resource which is not allocated under a specific condition.
On the basis of the above embodiment, the correspondingly processing the unallocated IPv4 public address resource according to the preset rule includes:
and generating all the target addresses with IPv6 prefix labels attached by all the unallocated IPv4 public address resources.
Specifically, the device generates all the target addresses with IPv6 prefix labels attached to all the IPv4 public address resources which are not allocated. Reference may be made to the above embodiments, which are not described in detail.
Or the like, or, alternatively,
selecting one or n designated IPv4 public addresses from the unallocated IPv4 public address resources and generating a corresponding number of target addresses attached with IPv6 prefix tags; wherein n is less than the sum of all the unallocated IPv4 public addresses.
Specifically, the device selects one or n designated IPv4 public addresses from the unallocated IPv4 public address resources and generates a corresponding number of target addresses with IPv6 prefix tags attached; wherein n is less than the sum of all the unallocated IPv4 public addresses. Reference may be made to the above embodiments, which are not described in detail.
The method for dynamically allocating the IPv4 public address through the IPv6 internet provided by the embodiment of the invention can further and reasonably process the IPv4 public address resource which is not allocated under a specific condition.
On the basis of the above embodiment, the method further includes:
sending a prompt message to a user terminal corresponding to the user identifier; the prompting message comprises: the IPv4 public address resource is insufficient; and/or the real number of the distributed IPv4 public address resources and the difference number between the number of the carried acquired IPv4 public addresses and the real number.
Specifically, the device sends a prompt message to the user terminal corresponding to the user identifier; the prompting message comprises: the IPv4 public address resource is insufficient; and/or the real number of the distributed IPv4 public address resources and the difference number between the number of the carried acquired IPv4 public addresses and the real number. Reference may be made to the above embodiments, which are not described in detail.
The method for dynamically allocating the IPv4 public address through the IPv6 internet, provided by the embodiment of the invention, can provide prompt messages for the user in real time, and is beneficial to the user to timely know the allocation condition of IPv4 public address resources and the like.
On the basis of the above embodiment, the method further includes:
and if the IPv4 public address resource which is not allocated does not exist, sending a notification message for prompting the user that the user does not have the IPv4 public address resource to the user terminal corresponding to the user identifier.
Specifically, if the device determines that the unallocated IPv4 public address resource does not exist, the device sends a notification message prompting the user that the user does not have the IPv4 public address resource to the user terminal corresponding to the user identifier. Reference may be made to the above embodiments, which are not described in detail.
The method for dynamically distributing the IPv4 public address through the IPv6 internet, provided by the embodiment of the invention, can enable a user to know the condition that no IPv4 public address resource exists in time.
Fig. 4 is a schematic structural diagram of an apparatus for dynamically allocating an IPv4 public address through an IPv6 internet according to an embodiment of the present invention, and as shown in fig. 4, an embodiment of the present invention provides an apparatus for dynamically allocating an IPv4 public address through an IPv6 internet, including a receiving unit 1, a generating unit 2, and an allocating unit 3, where:
the receiving unit 1 is used for receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address; the generating unit 2 is configured to extract a target IPv4 public address from the IPv4 public address resource and generate a target address with an IPv6 prefix tag if it is determined that there is an unallocated IPv4 public address resource; the allocating unit 3 is configured to allocate the target address to the user terminal corresponding to the user identifier, start timing, and provide the user terminal with access to an IPv4 network via an IPv6 network according to the target address when a timing duration is within the time period.
Specifically, the receiving unit 1 is configured to receive a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address; the generating unit 2 is configured to extract a target IPv4 public address from the IPv4 public address resource and generate a target address with an IPv6 prefix tag if it is determined that there is an unallocated IPv4 public address resource; the allocating unit 3 is configured to allocate the target address to the user terminal corresponding to the user identifier, start timing, and provide the user terminal with access to an IPv4 network via an IPv6 network according to the target address when a timing duration is within the time period.
The device for dynamically distributing the IPv4 public address through the IPv6 internet, provided by the embodiment of the invention, can improve the utilization rate of IPv4 public address resources, thereby ensuring the interconnection and intercommunication of the IPv4 network and the IPv6 network in a transition stage.
The apparatus for dynamically allocating an IPv4 public address through an IPv6 internet according to the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and its functions are not described herein again, and refer to the detailed description of the above method embodiments.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device includes: a processor (processor)501, a memory (memory)502, and a bus 503;
the processor 501 and the memory 502 complete communication with each other through a bus 503;
the processor 501 is configured to call program instructions in the memory 502 to perform the methods provided by the above-mentioned method embodiments, for example, including: receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address; if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark; and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address; if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark; and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including: receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address; if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark; and distributing the target address to a user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the electronic device and the like are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may also be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (6)

1. A method for dynamically assigning IPv4 public addresses via IPv6 internet, comprising:
receiving a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address; the time period of the user using the IPv4 public address is the time period counted from the moment when the user initiates the request;
if the IPv4 public address resources which are not allocated exist, extracting a target IPv4 public address from the IPv4 public address resources, and generating a target address with an IPv6 prefix mark;
distributing the target address to a user terminal corresponding to the user identifier, starting timing, and allowing the user terminal to access an IPv4 network through an IPv6 network according to the target address when the timing duration is within the time period; when the timing duration exceeds the time period, recovering the allocated target address and recovering the target address to the unallocated IPv4 public address;
wherein, the request also carries the number of obtaining IPv4 public addresses; correspondingly, if there is an unallocated IPv4 public address resource, extracting a target IPv4 public address from the IPv4 public address resource, and generating a target address with an IPv6 prefix tag attached thereto, including:
if the number of the unallocated IPv4 public address resources is larger than the number, extracting the target IPv4 public addresses equal to the number from the IPv4 public address resources, and generating the target addresses with IPv6 prefix marks attached;
if the unallocated IPv4 public address resources exist but the unallocated quantity is less than the carried quantity of acquired IPv4 public addresses, the unallocated IPv4 public address resources are correspondingly processed according to a preset rule;
the corresponding processing of the unallocated IPv4 public address resource according to the preset rule comprises:
generating all the unallocated IPv4 public address resources into a target address with an IPv6 prefix mark;
or the like, or, alternatively,
selecting one or n designated IPv4 public addresses from the unallocated IPv4 public address resources and generating a corresponding number of target addresses attached with IPv6 prefix tags; wherein n is less than the sum of all the unallocated IPv4 public addresses.
2. The method of claim 1, further comprising:
sending a prompt message to a user terminal corresponding to the user identifier; the prompting message comprises:
the IPv4 public address resource is insufficient;
and/or the presence of a gas in the gas,
the real number of the allocated IPv4 public address resources and the amount of the carried difference between the number of the acquired IPv4 public addresses and the real number.
3. The method of claim 1, further comprising:
and if the IPv4 public address resource which is not allocated does not exist, sending a notification message for prompting the user that the user does not have the IPv4 public address resource to the user terminal corresponding to the user identifier.
4. An apparatus for dynamically assigning an IPv4 public address via an IPv6 internet, comprising:
a receiving unit, configured to receive a request for acquiring an IPv4 public address sent by a user terminal; the request carries a user identifier and a time period for the user to use the IPv4 public address;
the generating unit is used for extracting a target IPv4 public address from the IPv4 public address resource and generating a target address added with an IPv6 prefix mark if judging that the IPv4 public address resource which is not allocated exists;
the distribution unit is used for distributing the target address to the user terminal corresponding to the user identifier, starting timing, and when the timing duration is within the time period, providing the user terminal to access an IPv4 network through an IPv6 network according to the target address; when the timing duration exceeds the time period, recovering the allocated target address and recovering the target address to the unallocated IPv4 public address;
wherein, the request also carries the number of obtaining IPv4 public addresses; correspondingly, the generating unit is configured to:
if the number of the unallocated IPv4 public address resources is larger than the number, extracting the target IPv4 public addresses equal to the number from the IPv4 public address resources, and generating the target addresses with IPv6 prefix marks attached;
if the unallocated IPv4 public address resources exist but the unallocated quantity is less than the carried quantity of acquired IPv4 public addresses, the unallocated IPv4 public address resources are correspondingly processed according to a preset rule;
the corresponding processing of the unallocated IPv4 public address resource according to the preset rule comprises:
generating all the unallocated IPv4 public address resources into a target address with an IPv6 prefix mark;
or the like, or, alternatively,
selecting one or n designated IPv4 public addresses from the unallocated IPv4 public address resources and generating a corresponding number of target addresses attached with IPv6 prefix tags; wherein n is less than the sum of all the unallocated IPv4 public addresses.
5. An electronic device, comprising: a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 3.
6. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1 to 3.
CN201810196121.6A 2018-03-09 2018-03-09 Method and device for dynamically distributing IPv4 public address through IPv6 Internet Active CN108183977B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810196121.6A CN108183977B (en) 2018-03-09 2018-03-09 Method and device for dynamically distributing IPv4 public address through IPv6 Internet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810196121.6A CN108183977B (en) 2018-03-09 2018-03-09 Method and device for dynamically distributing IPv4 public address through IPv6 Internet

Publications (2)

Publication Number Publication Date
CN108183977A CN108183977A (en) 2018-06-19
CN108183977B true CN108183977B (en) 2021-01-26

Family

ID=62553331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810196121.6A Active CN108183977B (en) 2018-03-09 2018-03-09 Method and device for dynamically distributing IPv4 public address through IPv6 Internet

Country Status (1)

Country Link
CN (1) CN108183977B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114244842B (en) * 2021-12-23 2023-07-25 绿盟科技集团股份有限公司 Secure resource scheduling method and device, electronic equipment and storage medium
CN116132397B (en) * 2022-11-28 2024-05-14 赛尔新技术(北京)有限公司 IPv 6-to-IPv 4 conversion method and conversion device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102487407B (en) * 2010-12-03 2015-03-25 华为终端有限公司 Network address translating method and equipment and system
CN103037343B (en) * 2011-09-30 2017-08-25 中兴通讯股份有限公司 Report method, the apparatus and system of charging message
CN104468159A (en) * 2013-09-16 2015-03-25 中兴通讯股份有限公司 Management method and device of dynamic host configuration protocol server and relay
US20160344688A1 (en) * 2015-05-22 2016-11-24 Apple Inc. Communicating via IPv6-only Networks Using IPv4 Literal Identifiers
CN107105026B (en) * 2017-04-14 2020-02-11 中国联合网络通信有限公司沈阳市分公司 IPV4/IPV6 exchange application platform

Also Published As

Publication number Publication date
CN108183977A (en) 2018-06-19

Similar Documents

Publication Publication Date Title
CN104010285A (en) Short message filtering method and system, short message service center and terminal
US8825750B2 (en) Application server management system, application server management method, management apparatus, application server and computer program
CN1761263B (en) System and method for avoiding a network address collision
CN108183977B (en) Method and device for dynamically distributing IPv4 public address through IPv6 Internet
EP2434703A1 (en) Method and terminal for transmitting service data
US20170005812A1 (en) Policy control method and device
CN106464745B (en) Server, client and the method for data synchronization of DNS
CN106101171B (en) Server connection method and device
CN110012118B (en) Method and controller for providing Network Address Translation (NAT) service
CN110769080B (en) Domain name resolution method, related product and computer readable storage medium
CN109194525A (en) A kind of network node configuration method and management node
CN108566345B (en) Traffic scheduling processing method, user side translator and core translator
CN111431818B (en) Cross-domain request flow distribution method and device, storage medium and computer equipment
CN109246024B (en) Method, device, terminal equipment and storage medium for load sharing in networking
CN105187312A (en) Method, device and router for carrying out network communication on batch terminal equipment
CN109413224B (en) Message forwarding method and device
CN108494751B (en) Method and device for efficiently using IPv4 public address
CN105208137A (en) Internet Protocol (IP) address allocation methods, device, server and terminal
US10044672B2 (en) IPv6 address assignment method and apparatus
CN112104680B (en) Method, device and equipment for determining edge application and storage medium
CN115632893B (en) Honeypot generation method and device
KR101278282B1 (en) Apparatus for transmitting and receiving device management messages in broadband wireless network, and method thereof
CN115065664B (en) Internet protocol address recycling method, electronic equipment and storage medium
US10791088B1 (en) Methods for disaggregating subscribers via DHCP address translation and devices thereof
CN113938814B (en) Service scheduling method, UPF, system and medium of content distribution network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant