WO2019114244A1 - Method and device for converting address character string having short name into ipv6 address - Google Patents

Method and device for converting address character string having short name into ipv6 address Download PDF

Info

Publication number
WO2019114244A1
WO2019114244A1 PCT/CN2018/092767 CN2018092767W WO2019114244A1 WO 2019114244 A1 WO2019114244 A1 WO 2019114244A1 CN 2018092767 W CN2018092767 W CN 2018092767W WO 2019114244 A1 WO2019114244 A1 WO 2019114244A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
address string
string
partial
short name
Prior art date
Application number
PCT/CN2018/092767
Other languages
French (fr)
Chinese (zh)
Inventor
张千里
王继龙
李星
Original Assignee
清华大学
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 清华大学 filed Critical 清华大学
Publication of WO2019114244A1 publication Critical patent/WO2019114244A1/en

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/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/30Types of network names
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/659Internet protocol version 6 [IPv6] addresses

Definitions

  • the present invention relates to the field of computer networks, and in particular, to a method and apparatus for converting an address string having a short name into an IPv6 address.
  • IP addresses become the basis for the entire Internet interconnection and identity differentiation. With the continuous expansion of the Internet, IPv4 addresses are gradually being consumed, and IPv6-based next-generation Internet is being used more and more widely. Compared with IPv4 addresses, the IPv6 address space is much larger, which brings about two aspects. First, the IPv6 address space is huge, which makes it difficult to memorize and express these addresses, especially network operation managers. It is necessary to directly face the address itself, so how to name and memorize these huge addresses becomes more difficult; in addition, in the IPv6 address space, generally, the first 64 bits are specified by the operator, and the last 64 bits can be determined by the user system itself. Specified, generated by stateless mode, so how to plan the last 64 bits makes some meaningful extra functions become an important issue.
  • IPv6 address In terms of the expression of IPv6 address, in RFC5952, several suggestions for textual expression of IPv6 address are proposed. The implementation of these suggestions does not change the problem that IPv6 address is difficult to remember.
  • the IPv6 address generated by the general operating system is The following form: 2402: f000: 6: 1001: 896: cdfe: e07e: 88da, which is very inconvenient to remember.
  • the object of the present invention is to solve at least one of the above technical problems to some extent.
  • the first object of the present invention is to provide a method for converting an address string with a short name into an IPv6 address, and to solve the problem that the IPv6 address is difficult to memorize and express through the mapping of an address string with a short name to an IPv6 address.
  • the specified service identifier and the external network to the subnet's public information acquisition within the subnet can be realized; the mapping between the short name and the IPv6 address can be realized without relying on the third party server, and the third party server is avoided due to the like DNS.
  • the additional security risks, service delays, and additional maintenance costs are incurred; the short names need only be unique within an IPv6 subnet, and there is no need to guarantee global uniqueness like the DNS service, which makes local public services possible.
  • a second object of the present invention is to provide a device for converting an address string having a short name into an IPv6 address.
  • a method for converting an address string with a short name into an IPv6 address includes:
  • determining a front partial address string and a latter partial address string according to the preset separator wherein the front partial address string is in front of the preset splitter in the address string having the short name a partial address string, the latter part of the address string being a partial address string of the address string having the short name after the preset separator;
  • the first partial IPv6 address and the latter partial IPv6 address are connected to form an IPv6 address corresponding to the short-named address string.
  • the determining the front partial address string and the latter partial address string according to the preset separator includes:
  • the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
  • the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
  • the front part address string is the part of the address string having the short name that precedes the preset delimiter
  • the address string, the latter part of the address string is an empty string.
  • the first part of the IPv6 address and the latter part of the IPv6 address are connected to form an IPv6 address corresponding to the address string having the short name, including:
  • the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, and encoding a 4-character encoding rule with 21 bits.
  • the method as described above further includes:
  • the address string with the short name is converted according to the RFC 5952 specification to obtain the IPv6 address corresponding to the address string with the short name.
  • an apparatus for converting a short-named address string into an IPv6 address includes:
  • a determining module configured to determine whether a preset delimiter exists in the address string with the short name, and if yes, triggering the determining module;
  • a determining module configured to determine a front partial address string and a latter partial address string according to the preset separator, wherein the front partial address string is the preset splitter in the address string having the short name The previous part of the address string, the latter part of the address string is the partial address string of the address string having the short name after the preset separator;
  • a conversion module configured to convert a front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and convert the latter partial address string into a latter partial IPv6 address according to a preset encoding rule;
  • a generating module configured to connect the foregoing partial IPv6 address and the latter partial IPv6 address to generate an IPv6 address corresponding to the address string with a short name.
  • the determining module is specifically configured to:
  • the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
  • the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
  • the front part address string is the part of the address string having the short name that precedes the preset delimiter
  • the address string, the latter part of the address string is an empty string.
  • the generating module is specifically configured to:
  • the preceding partial IPv6 address and the post-partial IPv6 address obtained by the obfuscation are connected to form an IPv6 address corresponding to the address string having the short name.
  • the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, and encoding a 4-character encoding rule with 21 bits.
  • the conversion module is further configured to: when the determining module determines that there is no preset delimiter in the address string having the short name, the address having the short name according to the RFC 5952 specification The string is converted to obtain the IPv6 address corresponding to the address string with the short name.
  • FIG. 1 is a schematic flowchart of a method for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention
  • 2 is an exemplary encoding rule for encoding 1 character with 6 bits
  • 3 is an exemplary table of mapping relationship between characters and values
  • FIG. 4 is a schematic structural diagram of an apparatus for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart diagram of a method for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention.
  • the executive body of the method is a device that converts an address string having a short name into an IPv6 address, and the device can be implemented by hardware and/or software.
  • the method for converting an address string having a short name into an IPv6 address includes the following steps:
  • the name of the short name is as consistent as possible with the DNS domain name. For example, take the a-z (case insensitive), 0-9, - 37 characters that may be used in the DNS domain name to name the short name. In addition, when the name length is not enough, you can use the "stop character" to fill, that is, you can use a-z (case insensitive), 0-9, -, stop characters a total of 38 characters to name the short name.
  • An IPv6 address is generally composed of two parts, a first partial IPv6 address and a latter partial IPv6 address. The first part of the IPv6 address is the first 64 bits of the IPv6 address, which is also called the subnet prefix. It is usually specified by the operator.
  • the latter part of the IPv6 address is the last 64 bits of the IPv6 address, also known as the interface identifier, which can be specified by the user system itself.
  • the latter partial IPv6 address can be represented by a short name.
  • an address string having a short name can be understood as an IPv6 address represented by a short name in the latter part of the IPv6 address.
  • step S102 Determine whether a preset separator exists in the address string with the short name, and perform step S103 or step S106.
  • the preset delimiter should not use the string allowed by the DNS.
  • the special string having the escaping property of SHELL, URL, etc. should be avoided, and the preset delimiter can be selected as ⁇ , ⁇ , ⁇ ,
  • the address string of short name with ‘2402:f000:6:1001 ⁇ printer’ the short name is ‘printer’
  • the default separator is ‘ ⁇ ’.
  • short names are set after the preset separator.
  • step S103 If yes, determine the front partial address string and the latter partial address string according to the preset separator, and step S104 is performed.
  • the front part address string is a partial address string in the address string having the short name in front of the preset separator, and the latter part address string is the address character having the short name.
  • the specific implementation manner of “determining the first partial address string and the latter partial address string according to the preset separator” is:
  • the first partial address string is in the address string having the short name in the preset A partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name.
  • the former partial address string is the The subnet prefix
  • the latter part of the address string is a partial address string of the address string having the short name that follows the preset separator.
  • the front part address string is the part of the address string having the short name that precedes the preset delimiter
  • the address string, the latter part of the address string is an empty string.
  • the address string of short name with ‘2402:f000:6:1001 ⁇ printer’ is used.
  • the former part of the address string is ‘2402:f000:6:1001’
  • the last part of the address string is ‘printer’.
  • an address string with a short name of ‘ ⁇ printer’ is used.
  • the former part of the address string is the 'subnet prefix' of the host, and the latter part of the address string is 'printer'.
  • an address string such as ‘ ⁇ printer’ appears it means that the IPv6 address indicated by the address string is in the subnet where the machine is located, that is, the same as the subnet prefix contained in the machine.
  • the address string of short name with ‘2402:f000:6:1001 ⁇ ’ the former part of the address string is ‘2402:f000:6:1001’
  • the last part of the address string is an empty string.
  • the latter part of the IPv6 address is composed of a stop character.
  • step S104 Convert the previous partial address string into the previous partial IPv6 address according to the RFC 5952 specification, and convert the latter partial address string into the latter partial IPv6 address according to the preset encoding rule, and perform step S105.
  • RFC (Request For Comments) 5952 specifies standards for IPv6 addresses.
  • the standard specifies that a complete 128-bit IPv6 address is divided into 8 segments, each segment of 4 characters, such as 2001:0410:0000:1234:FB00:1400:5000:45FF.
  • RFC 5952 specifies that multiple consecutive zero fields can be used with a compression format to omit compression.
  • 2001:0410:0000:1234:FB00:1400:5000:45FF can be abbreviated as 2001:0410::1234:FB00:1400:5000:45FF
  • 0000:0000:0000:0000:0000: 0001 can be abbreviated as ::1.
  • RFC 5952 stipulates that such an omission can only occur once, that is, 3ffe:0000:0000:1010:2a2a:0000:0001 can only be abbreviated as 3ffe:0:0:0:1010:2a2a::1 or 3ffe ::1010:2a2a:0:1, but not abbreviated as 3ffe::1010:2a2a::1.
  • the first part of the address string is used to represent the subnet prefix, and 4 segments are required to represent, for example, 2001:0410:0:1234, with the following: the short part of the address string can be expanded to a maximum of 64 bits. For example, 2001:410:: is expanded to 2001:0410:0000:0000.
  • the former part of the address string '2402:f000:6:1001' is converted to the IPv6 address standard according to the RFC 5952 specification.
  • the first partial IPv6 address is '2402:f000:6:1001'.
  • the preset encoding rule may be an encoding rule that encodes 1 character by 6 bits or an encoding rule of 4 characters by 21 bits, but is not limited thereto.
  • Figure 2 is an exemplary encoding rule for encoding 1 character with 6 bits. As shown in FIG. 2, in an encoding rule in which one character is encoded by 6 bits, every 6 bits is mapped to one character or a stop character. In order to avoid conflict with the settings of the IPv6 network, the 6-bit coded character of '000000' should be avoided.
  • the short name can be unified into 10 characters. If the short name is not enough for 10 characters, the tail is filled with a stop character to form a short character of 10 characters.
  • the subnet prefix can be formed according to the IPv6 prefix selection scheme (as shown in RFC3484) and then connected with the last 64 bits corresponding to the short name.
  • FIG. 3 is an exemplary table of mapping relationship between characters and values.
  • the encoding rule for encoding 4 characters with 21 bits is: according to the hexadecimal notation, each character (including the stop character) corresponds to a value in the hexadecimal notation, and the number of four digits in 38 hexadecimal can be encoded by using 21 bits.
  • the 21-bit coded 4-character encoding rule results in an IPv6 address of up to 12 characters. As shown in Figure 3, for each character, specify a number from 0 to 37, for every four characters ABCD, encode it as a 21-bit representation of the result of A*383+B*382+C*38+D, one Possible mapping from character to value is shown in Figure 3.
  • the 1st bit of the interface identifier is idle.
  • the 7th bit of the interface identifier is not used: the 7th bit of the interface identifier is set to 0, indicating that the interface identifier is not globally unique.
  • step S104 is: “Using the obfuscation algorithm to perform obfuscation processing on the latter part of the IPv6 address; and connecting the pre-part IPv6 address and the post-partial IPv6 address obtained by the obfuscated processing to form The IPv6 address corresponding to the address string having the short name.
  • the obfuscating process on the latter part of the IPv6 address can avoid the last 64 bits set by the system having the same short name in different networks.
  • the confusion algorithm is not limited. For example, the latter part of the IPv6 address and the previous part of the IPv6 address are XORed to obtain the confusing latter part of the IPv6 address.
  • the address string does not have a preset delimiter, it can be understood that the address string does not have a short name. In this case, only the RFC 5952 specification is required to convert it into a standard IPv6 address.
  • a host with a specific service can be used by other users in the network by setting the last 64-bit address of the IPv6 address (the latter 64-bit address, that is, the latter part of the IPv6 address). .
  • the specific steps are as follows:
  • S1 A host with a specific service sets the last 64-bit address of its own IPv6 address to a short name.
  • a typical example is the print service.
  • the host can set its own 64 bits to a short name such as printer. In this way, users in the network can access it through ⁇ printer, thus avoiding the difficulty of local service discovery.
  • the short name since the same short name can be used in different subnets, unlike the domain name system, the short name has a much larger selection space and does not require domain maintenance.
  • S1 A host that provides a specific service to the external network, and sets its own IPv6 post-64-bit address to a short name.
  • a typical example is the attack reporting service.
  • the network administrator of the network when a security incident from a certain network occurs, it is often necessary to notify the network administrator of the network.
  • this process is often subject to the aging of whois information, various contact information. It is stored in the designated department of the operator, and other departments are difficult to access. Therefore, if a system with a short name of report is established for each IPv6 subnet and the network administrators of each subnet are independently maintained, it can provide greater assistance for the coordination and solution of the problems between the interconnection networks.
  • IPv6 addresses When a system or network administrator sets up a server or router, it needs to statically set a large number of IPv6 addresses. It is usually desirable that these IPv6 addresses can be easily memorized. Existing operating system setup methods, whether stateless or stateful, make this process easy to make mistakes, and the generated addresses are difficult to remember. Even if the last 64 bits are just some simple numeric numbers such as ::1:::IPv4 addresses, it is difficult to associate with the server or router. It helps system administrators and network administrators to name and manage IPv6 addresses by using IPv6 addresses with short names.
  • the specific configuration method is as follows:
  • S1 Specify the interface as a static IPv6 address through the configuration file of the operating system.
  • S2 Specifies that the static IPv6 address is a short name format as described above. If the first 64-bit address (the first 64-bit address, that is, the former partial IPv6 address) is not included, the address prefix of the interface is from the IPv6 neighbor discovery protocol. Obtained in.
  • S3 The operating system sets the interface to the corresponding parsed IPv6 address according to the IPv6 address with the short name set by S2, and if it does not contain the first 64-bit address information, the first 64 obtained by using the IPv6 neighbor discovery protocol. Bit address.
  • the present invention relates to a host having a specific service for a specified IPv6 network, and by setting its own 64-bit address after IPv6, it is convenient for use by other users in the network.
  • the specific steps are as follows:
  • S1 A host with a specific service sets its own IPv6 post-64-bit address to a short name.
  • the method for converting an address string having a short name into an IPv6 address includes: obtaining an address string having a short name, and determining whether a preset separator exists in the address string having the short name; Determining a front partial address string and a latter partial address string according to the preset separator; converting the front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and the latter partial address string according to a preset encoding rule Converting to a later partial IPv6 address; connecting the first partial IPv6 address and the latter partial IPv6 address to form an IPv6 address corresponding to the short-named address string.
  • the problem that the IPv6 address is difficult to memorize and express is solved by mapping the address string with the short name to the IPv6 address, thereby realizing the specified service identifier and the external network to the subnet public information acquisition within the subnet;
  • Short-name and IPv6 address mapping can be implemented on a third-party server, avoiding additional security risks, service delays, and additional maintenance costs caused by the introduction of third-party servers like DNS; so that short names only need to be The only one in an IPv6 subnet can be used without having to guarantee global uniqueness like the DNS service, which makes local public service possible.
  • FIG. 4 is a schematic structural diagram of an apparatus for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention.
  • the apparatus for converting an address string having a short name into an IPv6 address in this embodiment includes:
  • a determining module configured to determine whether a preset delimiter exists in the address string with the short name, and if yes, triggering the determining module;
  • a determining module configured to determine a front partial address string and a latter partial address string according to the preset separator, wherein the front partial address string is the preset splitter in the address string having the short name The previous part of the address string, the latter part of the address string is the partial address string of the address string having the short name after the preset separator;
  • a conversion module configured to convert a front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and convert the latter partial address string into a latter partial IPv6 address according to a preset encoding rule;
  • a generating module configured to connect the foregoing partial IPv6 address and the latter partial IPv6 address to generate an IPv6 address corresponding to the address string with a short name.
  • the determining module is specifically configured to:
  • the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
  • the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
  • the front part address string is the part of the address string having the short name that precedes the preset delimiter
  • the address string, the latter part of the address string is an empty string.
  • the generating module is specifically configured to:
  • the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, and encoding a 4-character encoding rule with 21 bits.
  • the conversion module is further configured to: when the determining module determines that the preset delimiter does not exist in the address string with the short name, perform the address string with the short name according to the RFC 5952 specification. Converting to obtain the IPv6 address corresponding to the address string with the short name
  • the device for converting an address string with a short name into an IPv6 address includes: obtaining an address string with a short name, and determining whether a preset separator exists in the address string having the short name; Determining a front partial address string and a latter partial address string according to the preset separator; converting the front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and the latter partial address string according to a preset encoding rule Converting to a later partial IPv6 address; connecting the first partial IPv6 address and the latter partial IPv6 address to form an IPv6 address corresponding to the short-named address string.
  • the problem that the IPv6 address is difficult to memorize and express is solved by mapping the address string with the short name to the IPv6 address, thereby realizing the specified service identifier and the external network to the subnet public information acquisition within the subnet;
  • Short-name and IPv6 address mapping can be implemented on a third-party server, avoiding additional security risks, service delays, and additional maintenance costs caused by the introduction of third-party servers like DNS; so that short names only need to be The only one in an IPv6 subnet can be used without having to guarantee global uniqueness like the DNS service, which makes local public service possible.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • a "computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM).
  • the computer readable medium may even be a paper or other suitable medium on which the program may be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, in other suitable manners. Processing to obtain the program electronically and then storing it in computer memory.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware and in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: discrete with logic gates for implementing logic functions on data signals Logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • An integrated module can also be stored in a computer readable storage medium if it is implemented as a software functional module and sold or used as a standalone product.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Abstract

The invention discloses a method and a device for converting an address character string having a short name into an IPv6 address. The method solves the problem of difficulties in memorizing and expressing an IPv6 address by means of mapping an address character string having a short name to the IPv6 address, thereby realizing assignment of a service identifier within a subnetwork and acquisition of public information in a subnetwork from an external network. Mapping between a short name and an IPv6 address is achieved without relying on a third-party server, thus preventing the additional security risks, service latency, and additional maintenance overhead caused by introducing a third-party server, such as a DNS. Unlike a DNS service which requires global uniqueness, the invention only requires a short name to be unique in an IPv6 subnetwork, thereby enabling a partially public service to be feasible.

Description

将具有短名字的地址字符串转换为IPv6地址的方法及装置Method and apparatus for converting an address string having a short name into an IPv6 address
相关申请的交叉引用Cross-reference to related applications
本申请要求清华大学于2017年12月13日提交的、发明名称为“将具有短名字的地址字符串转换为IPv6地址的方法及装置”的、中国专利申请号“201711332327.9”的优先权。The present application claims priority from the Chinese Patent Application No. "201711332327.9" filed on Dec. 13, 2017 by Tsinghua University, entitled "Method and Apparatus for Converting an Address String with a Short Name to an IPv6 Address".
技术领域Technical field
本发明涉及计算机网络领域,尤其涉及一种将具有短名字的地址字符串转换为IPv6地址的方法及装置。The present invention relates to the field of computer networks, and in particular, to a method and apparatus for converting an address string having a short name into an IPv6 address.
背景技术Background technique
互联网上的每一个节点都依靠IP地址互相区分和相互联系,IP地址成了整个互联网互联互通、身份区分的基础。随着互联网规模的不断扩张,IPv4地址逐渐消耗,以IPv6为基础的下一代互联网正在得到越来越广泛的应用。与IPv4地址相比,IPv6地址空间要大得多,这带来了两个方面的影响,首先,IPv6地址空间巨大,使得如何记忆、表达这些地址成为一个难题,尤其是网络运营管理人员,常常需要直接面对地址本身,因此如何去命名、记忆这些庞大的地址,变得尤为困难;此外,IPv6地址空间中,一般而言,前64比特为运营商指定,后64比特可以由用户系统本身指定,通过无状态方式生成,因此如何能够对后64比特进行规划,使得实现一些有意义的额外功能,也就成了一个重要的问题。Every node on the Internet relies on IP addresses to distinguish and connect with each other. IP addresses become the basis for the entire Internet interconnection and identity differentiation. With the continuous expansion of the Internet, IPv4 addresses are gradually being consumed, and IPv6-based next-generation Internet is being used more and more widely. Compared with IPv4 addresses, the IPv6 address space is much larger, which brings about two aspects. First, the IPv6 address space is huge, which makes it difficult to memorize and express these addresses, especially network operation managers. It is necessary to directly face the address itself, so how to name and memorize these huge addresses becomes more difficult; in addition, in the IPv6 address space, generally, the first 64 bits are specified by the operator, and the last 64 bits can be determined by the user system itself. Specified, generated by stateless mode, so how to plan the last 64 bits makes some meaningful extra functions become an important issue.
针对IPv6地址的表达方面,在RFC5952中,提出了IPv6地址进行文本表达的几个建议,这些建议的实施,并没有改变IPv6地址难于记忆的问题,举例而言,一般操作系统生成的IPv6地址为如下形式:2402:f000:6:1001:896:cdfe:e07e:88da,这非常不便于记忆。In terms of the expression of IPv6 address, in RFC5952, several suggestions for textual expression of IPv6 address are proposed. The implementation of these suggestions does not change the problem that IPv6 address is difficult to remember. For example, the IPv6 address generated by the general operating system is The following form: 2402: f000: 6: 1001: 896: cdfe: e07e: 88da, which is very inconvenient to remember.
因此,如何解决IPv6地址难以记忆表达成为亟待解决的技术问题。Therefore, how to solve the problem that IPv6 addresses are difficult to memorize and express has become a technical problem to be solved urgently.
发明内容Summary of the invention
本发明的目的旨在至少在一定程度上解决上述的技术问题之一。The object of the present invention is to solve at least one of the above technical problems to some extent.
为此,本发明的第一个目的在于提出的具有短名字的地址字符串转换为IPv6地址方法,通过具有短名字的地址字符串到IPv6地址的映射,来解决IPv6地址难于记忆表达的问题,进而能够实现子网内部的指定服务标识和外网到子网的公开信息获取;不依赖于第三方服务器即可实现短名字与IPv6地址的映射,避免了类似DNS之类的由于引入第三方服务器所带来的额外安全风险、服务延时以及额外的维护成本;使得短名字只需要在一个IPv6子 网中唯一即可,不必像DNS服务那样需要保证全局唯一,这样使得局部公开服务成为可能。Therefore, the first object of the present invention is to provide a method for converting an address string with a short name into an IPv6 address, and to solve the problem that the IPv6 address is difficult to memorize and express through the mapping of an address string with a short name to an IPv6 address. Further, the specified service identifier and the external network to the subnet's public information acquisition within the subnet can be realized; the mapping between the short name and the IPv6 address can be realized without relying on the third party server, and the third party server is avoided due to the like DNS. The additional security risks, service delays, and additional maintenance costs are incurred; the short names need only be unique within an IPv6 subnet, and there is no need to guarantee global uniqueness like the DNS service, which makes local public services possible.
为此,本发明的第二个目的在于提出的具有短名字的地址字符串转换为IPv6地址的装置。To this end, a second object of the present invention is to provide a device for converting an address string having a short name into an IPv6 address.
为了实现上述目的,本发明第一方面实施例的具有短名字的地址字符串转换为IPv6地址的方法,包括:In order to achieve the above object, a method for converting an address string with a short name into an IPv6 address according to the first aspect of the present invention includes:
获取具有短名字的地址字符串;Get an address string with a short name;
判断所述具有短名字的地址字符串中是否存在预设分隔符;Determining whether a preset delimiter exists in the address string having the short name;
若存在,根据所述预设分隔符确定前部分地址字符串和后部分地址字符串,其中,前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If yes, determining a front partial address string and a latter partial address string according to the preset separator, wherein the front partial address string is in front of the preset splitter in the address string having the short name a partial address string, the latter part of the address string being a partial address string of the address string having the short name after the preset separator;
根据RFC 5952规范将前部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址;Converting the previous partial address string into the previous partial IPv6 address according to the RFC 5952 specification, and converting the latter partial address string into the latter partial IPv6 address according to a preset encoding rule;
将所述前部分IPv6地址和所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。The first partial IPv6 address and the latter partial IPv6 address are connected to form an IPv6 address corresponding to the short-named address string.
如上所述的方法,所述根据所述预设分隔符确定前部分地址字符串和后部分地址字符串包括:In the method as described above, the determining the front partial address string and the latter partial address string according to the preset separator includes:
若所述预设分隔符不是所述具有短名字的地址字符串中的第一个字符和最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is not the first character and the last character in the address string having the short name, the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
若所述预设分隔符为所述具有短名字的地址字符串中的第一个字符,获取所述具有短名字的地址字符串所属主机的子网前缀,则前部分地址字符串为所述子网前缀,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
若所述预设分隔符为所述具有短名字的地址字符串中的最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为空字符串。If the preset delimiter is the last character in the address string having the short name, the front part address string is the part of the address string having the short name that precedes the preset delimiter The address string, the latter part of the address string is an empty string.
如上所述的方法,所述将所述前部分IPv6地址和所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址,包括:In the method as described above, the first part of the IPv6 address and the latter part of the IPv6 address are connected to form an IPv6 address corresponding to the address string having the short name, including:
利用混淆算法对所述后部分IPv6地址进行混淆处理;Obfuscating the latter part of the IPv6 address by using an obfuscation algorithm;
将所述前部分IPv6地址和经混淆处理后的得到的所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。And connecting the obtained partial IPv6 address to the obtained IPv6 address after the obfuscated processing to form an IPv6 address corresponding to the address string having the short name.
如上所述的方法,所述预设编码规则为以下编码规则中的一种:用6比特编码1个字符的编码规则、用21比特编码4个字符的编码规则。In the method as described above, the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, and encoding a 4-character encoding rule with 21 bits.
如上所述的方法,还包括:The method as described above further includes:
若不存在,根据RFC 5952规范对所述具有短名字的地址字符串进行转换,以获取所述具有短名字的地址字符串对应的IPv6地址。If not, the address string with the short name is converted according to the RFC 5952 specification to obtain the IPv6 address corresponding to the address string with the short name.
为了实现上述目的,本发明第二方面实施例的具有短名字的地址字符串转换为IPv6地址的装置,包括:In order to achieve the above object, an apparatus for converting a short-named address string into an IPv6 address according to the second aspect of the present invention includes:
获取模块,用于获取具有短名字的地址字符串;An obtaining module for obtaining an address string having a short name;
判断模块,用于判断所述具有短名字的地址字符串中是否存在预设分隔符,若存在,触发确定模块;a determining module, configured to determine whether a preset delimiter exists in the address string with the short name, and if yes, triggering the determining module;
确定模块,用于根据所述预设分隔符确定前部分地址字符串和后部分地址字符串,其中,前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;a determining module, configured to determine a front partial address string and a latter partial address string according to the preset separator, wherein the front partial address string is the preset splitter in the address string having the short name The previous part of the address string, the latter part of the address string is the partial address string of the address string having the short name after the preset separator;
转换模块,用于根据RFC 5952规范将前部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址;a conversion module, configured to convert a front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and convert the latter partial address string into a latter partial IPv6 address according to a preset encoding rule;
生成模块,用于将所述前部分IPv6地址和所述后部分IPv6地址连接,生成所述具有短名字的地址字符串对应的IPv6地址。And a generating module, configured to connect the foregoing partial IPv6 address and the latter partial IPv6 address to generate an IPv6 address corresponding to the address string with a short name.
如上所述的装置,所述确定模块具体用于:The device as described above, the determining module is specifically configured to:
若所述预设分隔符不是所述具有短名字的地址字符串中的第一个字符和最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is not the first character and the last character in the address string having the short name, the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
若所述预设分隔符为所述具有短名字的地址字符串中的第一个字符,获取所述具有短名字的地址字符串所属主机的子网前缀,则前部分地址字符串为所述子网前缀,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
若所述预设分隔符为所述具有短名字的地址字符串中的最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为空字符串。If the preset delimiter is the last character in the address string having the short name, the front part address string is the part of the address string having the short name that precedes the preset delimiter The address string, the latter part of the address string is an empty string.
如上所述的装置,所述生成模块,具体用于:The device as described above, the generating module is specifically configured to:
利用混淆算法对所述后部分IPv6地址进行混淆处理;Obfuscating the latter part of the IPv6 address by using an obfuscation algorithm;
将所述前部分IPv6地址和经混淆处理后的得到的所述后部分IPv6地址连接,形成所 述具有短名字的地址字符串对应的IPv6地址。The preceding partial IPv6 address and the post-partial IPv6 address obtained by the obfuscation are connected to form an IPv6 address corresponding to the address string having the short name.
如上所述的装置,所述预设编码规则为以下编码规则中的一种:用6比特编码1个字符的编码规则、用21比特编码4个字符的编码规则。In the apparatus as described above, the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, and encoding a 4-character encoding rule with 21 bits.
如上所述的装置,所述转换模块还用于在所述判断模块判断在所述具有短名字的地址字符串中不存在预设分隔符时,根据RFC 5952规范对所述具有短名字的地址字符串进行转换,以获取所述具有短名字的地址字符串对应的IPv6地址。The device as described above, wherein the conversion module is further configured to: when the determining module determines that there is no preset delimiter in the address string having the short name, the address having the short name according to the RFC 5952 specification The string is converted to obtain the IPv6 address corresponding to the address string with the short name.
本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。The additional aspects and advantages of the invention will be set forth in part in the description which follows.
附图说明DRAWINGS
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中,The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from
图1为本发明一实施例的将具有短名字的地址字符串转换为IPv6地址的方法的流程示意图;1 is a schematic flowchart of a method for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention;
图2为示例性的用6比特编码1个字符的编码规则;2 is an exemplary encoding rule for encoding 1 character with 6 bits;
图3为示例性的字符与值的映射关系表;3 is an exemplary table of mapping relationship between characters and values;
图4为本发明一实施例的将具有短名字的地址字符串转换为IPv6地址的装置的结构示意图。FIG. 4 is a schematic structural diagram of an apparatus for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention.
具体实施方式Detailed ways
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。The embodiments of the present invention are described in detail below, and the examples of the embodiments are illustrated in the drawings, wherein the same or similar reference numerals are used to refer to the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the drawings are intended to be illustrative of the invention and are not to be construed as limiting.
下面参考附图描述本发明实施例的将具有短名字的地址字符串转换为IPv6地址的方法及装置。A method and apparatus for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention will be described below with reference to the accompanying drawings.
图1为本发明一实施例的将具有短名字的地址字符串转换为IPv6地址的方法的流程示意图。该方法的执行主体为将具有短名字的地址字符串转换为IPv6地址的装置,该装置可以由硬件和/或软件实现。FIG. 1 is a schematic flowchart diagram of a method for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention. The executive body of the method is a device that converts an address string having a short name into an IPv6 address, and the device can be implemented by hardware and/or software.
如图1所示,本实施例提供的将具有短名字的地址字符串转换为IPv6地址的方法,包括以下步骤:As shown in FIG. 1, the method for converting an address string having a short name into an IPv6 address provided in this embodiment includes the following steps:
S101、获取具有短名字的地址字符串。S101. Obtain an address string with a short name.
在本实施例中,短名字的名字尽量与DNS域名相一致。例如,取DNS域名中可能使 用的a-z(不区分大小写)、0-9、-这37个字符进行命名短名字。此外,在名字长度不够时,可以用“停止符”补齐,也就是,可以用a-z(不区分大小写)、0-9、-、停止符共38个字符来命名短名字。IPv6地址一般由两部分组成,前部分IPv6地址和后部分IPv6地址。前部分IPv6地址为IPv6地址的前64比特,又称子网前缀,一般由运营商指定,后部分IPv6地址为IPv6地址的后64比特,又称接口标识,可以由用户系统本身指定。在本实施例中,后部分IPv6地址可以用短名字来表示。在本实施例中,具有短名字的地址字符串可以理解为后部分IPv6地址用短名字表示的IPv6地址。In this embodiment, the name of the short name is as consistent as possible with the DNS domain name. For example, take the a-z (case insensitive), 0-9, - 37 characters that may be used in the DNS domain name to name the short name. In addition, when the name length is not enough, you can use the "stop character" to fill, that is, you can use a-z (case insensitive), 0-9, -, stop characters a total of 38 characters to name the short name. An IPv6 address is generally composed of two parts, a first partial IPv6 address and a latter partial IPv6 address. The first part of the IPv6 address is the first 64 bits of the IPv6 address, which is also called the subnet prefix. It is usually specified by the operator. The latter part of the IPv6 address is the last 64 bits of the IPv6 address, also known as the interface identifier, which can be specified by the user system itself. In this embodiment, the latter partial IPv6 address can be represented by a short name. In this embodiment, an address string having a short name can be understood as an IPv6 address represented by a short name in the latter part of the IPv6 address.
S102、判断所述具有短名字的地址字符串中是否存在预设分隔符,执行步骤S103或步骤S106。S102. Determine whether a preset separator exists in the address string with the short name, and perform step S103 or step S106.
在本实施例中,预设分隔符不应当使用DNS允许的字符串,此外,也应当避开具有SHELL、URL等之中具有转义性质的特殊字符串,预设分隔符可以选择如~、{、}、|等字符。In this embodiment, the preset delimiter should not use the string allowed by the DNS. In addition, the special string having the escaping property of SHELL, URL, etc. should be avoided, and the preset delimiter can be selected as ~, {,}, | and other characters.
以‘2402:f000:6:1001~printer’这一具有短名字的地址字符串为例,短名字为‘printer’,预设分隔符为‘~’。一般而言,短名字设置在预设分隔符的后面。For example, the address string of short name with ‘2402:f000:6:1001~printer’, the short name is ‘printer’, and the default separator is ‘~’. In general, short names are set after the preset separator.
S103、若存在,根据所述预设分隔符确定前部分地址字符串和后部分地址字符串,执行步骤S104。S103. If yes, determine the front partial address string and the latter partial address string according to the preset separator, and step S104 is performed.
在本实施例中,前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串。In this embodiment, the front part address string is a partial address string in the address string having the short name in front of the preset separator, and the latter part address string is the address character having the short name. A partial address string in the string that follows the preset separator.
在一种可能的实现方式中,“所述根据所述预设分隔符确定前部分地址字符串和后部分地址字符串”的具体实现方式为:In a possible implementation manner, the specific implementation manner of “determining the first partial address string and the latter partial address string according to the preset separator” is:
若所述预设分隔符不是所述具有短名字的地址字符串中的第一个字符和最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串。If the preset delimiter is not the first character and the last character in the address string having the short name, the first partial address string is in the address string having the short name in the preset A partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name.
若所述预设分隔符为所述具有短名字的地址字符串中的第一个字符,获取所述具有短名字的地址字符串所属主机的子网前缀,则前部分地址字符串为所述子网前缀,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串。If the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the The subnet prefix, the latter part of the address string is a partial address string of the address string having the short name that follows the preset separator.
若所述预设分隔符为所述具有短名字的地址字符串中的最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为空字符串。If the preset delimiter is the last character in the address string having the short name, the front part address string is the part of the address string having the short name that precedes the preset delimiter The address string, the latter part of the address string is an empty string.
以‘2402:f000:6:1001~printer’这一具有短名字的地址字符串为例,前部分地址字符串为 ‘2402:f000:6:1001’,后部分地址字符串为‘printer’。For example, the address string of short name with ‘2402:f000:6:1001~printer’ is used. The former part of the address string is ‘2402:f000:6:1001’, and the last part of the address string is ‘printer’.
以‘~printer’这一具有短名字的地址字符串为例,前部分地址字符串为所属主机的‘子网前缀’,后部分地址字符串为‘printer’。当出现诸如‘~printer’的地址字符串时,代表着该地址字符串所指的IPv6地址在本机所在的子网里,亦即与本机所含有的子网前缀相同。For example, an address string with a short name of ‘~printer’ is used. The former part of the address string is the 'subnet prefix' of the host, and the latter part of the address string is 'printer'. When an address string such as ‘~printer’ appears, it means that the IPv6 address indicated by the address string is in the subnet where the machine is located, that is, the same as the subnet prefix contained in the machine.
以‘2402:f000:6:1001~’这一具有短名字的地址字符串为例,前部分地址字符串为‘2402:f000:6:1001’,后部分地址字符串为空字符串。后续转换时,后部分IPv6地址全部由停止符构成。For example, the address string of short name with ‘2402:f000:6:1001~’, the former part of the address string is ‘2402:f000:6:1001’, and the last part of the address string is an empty string. In the subsequent conversion, the latter part of the IPv6 address is composed of a stop character.
S104、根据RFC 5952规范将前部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址,执行步骤S105。S104. Convert the previous partial address string into the previous partial IPv6 address according to the RFC 5952 specification, and convert the latter partial address string into the latter partial IPv6 address according to the preset encoding rule, and perform step S105.
S105、将所述前部分IPv6地址和所述后部分IPv6地址连接,生成所述具有短名字的地址字符串对应的IPv6地址。S105. Connect the first partial IPv6 address and the latter partial IPv6 address to generate an IPv6 address corresponding to the short-named address string.
具体地,RFC(Request For Comments,请求注释)5952规范规定了IPv6地址的相关标准。标准规定对于一个完整的128位IPv6地址分成8段表示,每段4个字符,如2001:0410:0000:1234:FB00:1400:5000:45FF。为了便于表达,RFC 5952规定可以使用压缩格式将连续的多个0字段用::来省略压缩。Specifically, the RFC (Request For Comments) 5952 specification specifies standards for IPv6 addresses. The standard specifies that a complete 128-bit IPv6 address is divided into 8 segments, each segment of 4 characters, such as 2001:0410:0000:1234:FB00:1400:5000:45FF. For ease of expression, RFC 5952 specifies that multiple consecutive zero fields can be used with a compression format to omit compression.
例如,2001:0410:0000:1234:FB00:1400:5000:45FF可以简写为2001:0410::1234:FB00:1400:5000:45FF,而0000:0000:0000:0000:0000:0000:0000:0001可以简写为::1。RFC 5952规定这样的省略只能出现一次,也就是说,3ffe:0000:0000:0000:1010:2a2a:0000:0001只能简写为3ffe:0:0:0:1010:2a2a::1或者3ffe::1010:2a2a:0:1,而不能简写为3ffe::1010:2a2a::1。在本发明中,前部分地址字符串用来表示子网前缀,需要4段来表示如2001:0410:0:1234,具有::简写的前部分地址字符串最多只能扩展到64比特长,如2001:410::被扩展为2001:0410:0000:0000。For example, 2001:0410:0000:1234:FB00:1400:5000:45FF can be abbreviated as 2001:0410::1234:FB00:1400:5000:45FF, and 0000:0000:0000:0000:0000:0000:0000: 0001 can be abbreviated as ::1. RFC 5952 stipulates that such an omission can only occur once, that is, 3ffe:0000:0000:0000:1010:2a2a:0000:0001 can only be abbreviated as 3ffe:0:0:0:1010:2a2a::1 or 3ffe ::1010:2a2a:0:1, but not abbreviated as 3ffe::1010:2a2a::1. In the present invention, the first part of the address string is used to represent the subnet prefix, and 4 segments are required to represent, for example, 2001:0410:0:1234, with the following: the short part of the address string can be expanded to a maximum of 64 bits. For example, 2001:410:: is expanded to 2001:0410:0000:0000.
以‘2402:f000:6:1001~printer’这一具有短名字的地址字符串为例,根据RFC 5952规范将前部分地址字符串‘2402:f000:6:1001’转换成符合IPv6地址标准的前部分IPv6地址‘2402:f000:6:1001’。Taking the address string of short name with '2402:f000:6:1001~printer' as an example, the former part of the address string '2402:f000:6:1001' is converted to the IPv6 address standard according to the RFC 5952 specification. The first partial IPv6 address is '2402:f000:6:1001'.
在本实施例中,预设编码规则可以是用6比特编码1个字符的编码规则或用21比特编码4个字符的编码规则,但并不以此为限。In this embodiment, the preset encoding rule may be an encoding rule that encodes 1 character by 6 bits or an encoding rule of 4 characters by 21 bits, but is not limited thereto.
图2为示例性的用6比特编码1个字符的编码规则。图2所示,在用6比特编码1个字符的编码规则中,每6比特映射为一个字符或停止符。为了避免与IPv6网络的设置相冲突,应当避免使用‘000000’这一6比特编码字符。Figure 2 is an exemplary encoding rule for encoding 1 character with 6 bits. As shown in FIG. 2, in an encoding rule in which one character is encoded by 6 bits, every 6 bits is mapped to one character or a stop character. In order to avoid conflict with the settings of the IPv6 network, the 6-bit coded character of '000000' should be avoided.
需要指出的是,使用短名字表征接口标识,需要60比特以对应最长可能的10个字符,这样接口标识中有4比特空闲,在本实施例中,不使用接口标识的第1、2、3、7比特:将 接口标识的第1、2、3比特设置为0以示与其他地址的区分,将接口标识的第7比特设置为0,表示并不是全球唯一的接口标识。It should be noted that using the short name to represent the interface identifier requires 60 bits to correspond to the longest possible 10 characters, so that 4 bits of the interface identifier are idle. In this embodiment, the first and second digits of the interface identifier are not used. 3, 7 bits: Set the first, second, and third bits of the interface identifier to 0 to distinguish it from other addresses, and set the 7th bit of the interface identifier to 0, indicating that it is not the only global interface identifier.
需要指出的是,在编码前,可以将短名字统一成10个字符,如果短名字不够10个字符,则尾部用停止符补齐成10个字符的短名字。It should be pointed out that before encoding, the short name can be unified into 10 characters. If the short name is not enough for 10 characters, the tail is filled with a stop character to form a short character of 10 characters.
以‘2402:f000:6:1001~printer’这一具有短名字的地址字符串为例,在分隔符为‘~’之后的后部分地址字符串为‘printer’,利用图2所示的编码规则进行编码,填充到后64比特中的除去第1、2、3、7比特之外的部分,且第1、2、3、7比特为0,长度不足64比特部分补停止符000001,这样形成的IPv6地址的后64比特为‘0cdd:5197:c104:1041’,即后部分IPv6地址为‘0cdd:5197:c104:1041’。Take '2402:f000:6:1001~printer', an address string with a short name as an example. After the delimiter is '~', the address string is 'printer', using the encoding shown in Figure 2. The rule is encoded and padded to the portion other than the first, second, third, and seventh bits of the last 64 bits, and the first, second, third, and seventh bits are 0, and the length is less than 64 bits, and the stop sign is 000001. The last 64 bits of the formed IPv6 address are '0cdd:5197:c104:1041', that is, the latter part of the IPv6 address is '0cdd:5197:c104:1041'.
将前部分IPv6地址‘2402:f000:6:1001’和后部分IPv6地址‘0cdd:5197:c104:1041’连接形成最终的IPv6地址‘2402:f000:6:1001:cdd:5197:c104:1041’。The previous partial IPv6 address '2402:f000:6:1001' and the latter partial IPv6 address '0cdd:5197:c104:1041' are connected to form the final IPv6 address '2402:f000:6:1001:cdd:5197:c104:1041 '.
特殊的,对于如下符号~printer,表示了本子网内部的一个系统,子网前缀可以根据IPv6前缀选择方案(如RFC3484所示),再与该短名字所对应的后64比特连接而形成。Specifically, for the following symbol ~printer, a system inside the subnet is indicated, and the subnet prefix can be formed according to the IPv6 prefix selection scheme (as shown in RFC3484) and then connected with the last 64 bits corresponding to the short name.
图3为示例性的字符与值的映射关系表。用21比特编码4字符的编码规则为:按照38进制,每个字符(包括停止符)对应38进制中的一个值,四位38进制组成的数字可以使用21比特来进行编码,用21比特编码4字符的编码规则得到的IPv6地址最多可以容纳12个字符。如图3所示,针对每个字符,指定一个0到37的数字,每4个字符ABCD,将其编码为A*383+B*382+C*38+D的结果的21比特表示,一个可能的从字符到值的映射如图3所示。为了避免与IPv6网络设置相冲突,可以将‘-’设置为0。这样接口标识中有1比特空闲,在本实施例中,不使用接口标识的第7比特:将接口标识的第7比特设置为0,表示并不是全球唯一的接口标识。FIG. 3 is an exemplary table of mapping relationship between characters and values. The encoding rule for encoding 4 characters with 21 bits is: according to the hexadecimal notation, each character (including the stop character) corresponds to a value in the hexadecimal notation, and the number of four digits in 38 hexadecimal can be encoded by using 21 bits. The 21-bit coded 4-character encoding rule results in an IPv6 address of up to 12 characters. As shown in Figure 3, for each character, specify a number from 0 to 37, for every four characters ABCD, encode it as a 21-bit representation of the result of A*383+B*382+C*38+D, one Possible mapping from character to value is shown in Figure 3. To avoid conflicts with IPv6 network settings, set ‘-’ to 0. In this embodiment, the 1st bit of the interface identifier is idle. In this embodiment, the 7th bit of the interface identifier is not used: the 7th bit of the interface identifier is set to 0, indicating that the interface identifier is not globally unique.
以‘2402:f000:6:1001~printer’这一具有短名字的地址字符串为例,在分隔符为‘~’之后的后部分地址字符串为‘printer’,使用‘用21比特编码4字符的编码规则’对‘printer’进行编码,填充到后64比特中的除去第7比特之外的部分,且第7比特为0,这样形成地址的后64比特为‘b907:b73f:4e60:dc23’,即后部分IPv6地址为‘0cdd:5197:c104:1041’。Take '2402:f000:6:1001~printer', an address string with a short name as an example. After the separator is '~', the address string is 'printer' and the code is encoded with 21 bits. The character encoding rule 'encodes 'printer' is padded to the portion of the last 64 bits except the 7th bit, and the 7th bit is 0, so that the last 64 bits forming the address are 'b907:b73f:4e60: Dc23', that is, the latter part of the IPv6 address is '0cdd: 5197:c104:1041'.
将前部分IPv6地址‘2402:f000:6:1001’和后部分IPv6地址‘0cdd:5197:c104:1041’连接形成最终的IPv6地址‘2402:f000:6:1001:cdd:5197:c104:1041’。The previous partial IPv6 address '2402:f000:6:1001' and the latter partial IPv6 address '0cdd:5197:c104:1041' are connected to form the final IPv6 address '2402:f000:6:1001:cdd:5197:c104:1041 '.
进一步地,步骤S104的具体实现方式为:“利用混淆算法对所述后部分IPv6地址进行混淆处理;将所述前部分IPv6地址和经混淆处理后的得到的所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。”在本实施例中,对后部分IPv6地址进行混淆处理可以尽可能地避免具有不同网络中具有相同短名字的系统所设置的后64比特相同,混淆算法具体不限。例如,将后部分IPv6地址和前部分IPv6地址进行异或运算 得到混淆后的后部分IPv6地址。Further, the specific implementation manner of step S104 is: “Using the obfuscation algorithm to perform obfuscation processing on the latter part of the IPv6 address; and connecting the pre-part IPv6 address and the post-partial IPv6 address obtained by the obfuscated processing to form The IPv6 address corresponding to the address string having the short name. In this embodiment, the obfuscating process on the latter part of the IPv6 address can avoid the last 64 bits set by the system having the same short name in different networks. The same, the confusion algorithm is not limited. For example, the latter part of the IPv6 address and the previous part of the IPv6 address are XORed to obtain the confusing latter part of the IPv6 address.
S106、若不存在,根据RFC 5952规范对所述具有短名字的地址字符串进行转换,以获取所述具有短名字的地址字符串对应的IPv6地址。S106. If it does not exist, convert the address string with a short name according to the RFC 5952 specification to obtain an IPv6 address corresponding to the address string with the short name.
具体地,若地址字符串不存在预设分隔符,可以理解为该地址字符串没有设置短名字,这时只需RFC 5952规范将其转化成规范的IPv6地址即可。Specifically, if the address string does not have a preset delimiter, it can be understood that the address string does not have a short name. In this case, only the RFC 5952 specification is required to convert it into a standard IPv6 address.
以下对具有短名字系统的几种场景进行介绍。IPv6网络具有短名字之后,使用将会得到较大的改善。具有短名字的地址可以用在本地服务、网络相关信息获取和报告、便于记忆的系统地址指定等方面。The following describes several scenarios with a short name system. After the IPv6 network has a short name, the use will be greatly improved. Addresses with short names can be used for local services, network-related information acquisition and reporting, and easy-to-remember system address designation.
1、针对本地服务场景。1. Target local service scenarios.
对于某个指定IPv6网络,具有特定服务的主机,通过设置自己的IPv6地址的后64比特地址(后64比特地址即后部分IPv6地址)为短名字,从而便于被其他同在本网络的用户使用。具体的步骤如下:For a given IPv6 network, a host with a specific service can be used by other users in the network by setting the last 64-bit address of the IPv6 address (the latter 64-bit address, that is, the latter part of the IPv6 address). . The specific steps are as follows:
S1:具有特定服务的主机,将自己的IPv6地址的后64比特地址设置为短名字。S1: A host with a specific service sets the last 64-bit address of its own IPv6 address to a short name.
S2:本网络中的其他用户通过其短名字,直接访问该主机的特定服务。S2: Other users in the network directly access the specific services of the host through their short names.
一个典型的例子如打印服务,主机可以将自己的后64比特设置为printer这样的短名字,这样,本网内的所用用户都可以通过~printer来访问,从而避免了本地服务发现的困难。此外,由于同样的短名字在不同的子网中都可以使用,因此和域名系统不同,短名字的选择空间要大得多,而且也无需域名维护的费用。A typical example is the print service. The host can set its own 64 bits to a short name such as printer. In this way, users in the network can access it through ~printer, thus avoiding the difficulty of local service discovery. In addition, since the same short name can be used in different subnets, unlike the domain name system, the short name has a much larger selection space and does not require domain maintenance.
2、针对网络相关信息的获取和报告场景。2. For the acquisition and reporting of network related information.
对于指定的IPv6网络,可以通过建立特定名字的主机系统,以便于外网了解该网的一些信息。具体的步骤如下:For a given IPv6 network, you can establish a host system with a specific name so that the external network can know some information about the network. The specific steps are as follows:
S1:为外网提供特定服务的主机,将自己的IPv6后64比特地址设置为短名字。S1: A host that provides a specific service to the external network, and sets its own IPv6 post-64-bit address to a short name.
S2:外网中的其他用户通过其短名字,直接访问该主机的特定服务。S2: Other users in the external network directly access the specific service of the host through their short names.
一个典型的例子如攻击报告服务,目前的网络中,出现来自于某个网络的安全事件时,常常需要通知该网络的网络管理人员,然而,这一过程常常受到whois信息老化,各种联系信息存储在运营商的指定部门,而其他部门都难于访问的问题。因此,如果针对每个IPv6子网,建立一个具有短名字为report的系统,并有各个子网的网络管理人员独立维护,对于互联网络间问题的协调解决,能够提供较大的帮助。A typical example is the attack reporting service. In the current network, when a security incident from a certain network occurs, it is often necessary to notify the network administrator of the network. However, this process is often subject to the aging of whois information, various contact information. It is stored in the designated department of the operator, and other departments are difficult to access. Therefore, if a system with a short name of report is established for each IPv6 subnet and the network administrators of each subnet are independently maintained, it can provide greater assistance for the coordination and solution of the problems between the interconnection networks.
3、针对便于记忆的系统地址指定场景。3. Specify the scene for the system address that is easy to remember.
通常系统或网络管理员在设置服务器或路由器时,需要静态设置大量的IPv6地址,通常希望这些IPv6地址能够便于记忆。现有操作系统设置方法,无论是无状态还是有状态,都使得这一过程容易犯错,而且生成的地址也难于记忆。即使后64比特只是一些简单的数 字编号如::1、::IPv4地址之类,也难于和该服务器、路由器相关联。通过使用具有短名字的IPv6地址,有助于系统管理员、网络管理员对IPv6地址的命名和管理。具体的配置方法如下:Usually, when a system or network administrator sets up a server or router, it needs to statically set a large number of IPv6 addresses. It is usually desirable that these IPv6 addresses can be easily memorized. Existing operating system setup methods, whether stateless or stateful, make this process easy to make mistakes, and the generated addresses are difficult to remember. Even if the last 64 bits are just some simple numeric numbers such as ::1:::IPv4 addresses, it is difficult to associate with the server or router. It helps system administrators and network administrators to name and manage IPv6 addresses by using IPv6 addresses with short names. The specific configuration method is as follows:
S1:通过操作系统的配置文件指定该接口为静态IPv6地址。S1: Specify the interface as a static IPv6 address through the configuration file of the operating system.
S2:指定该静态IPv6地址为如上所述的含有短名字的格式,如果其中不含有前64比特地址(前64比特地址即前部分IPv6地址),则说明该接口的地址前缀从IPv6邻居发现协议中获得。S2: Specifies that the static IPv6 address is a short name format as described above. If the first 64-bit address (the first 64-bit address, that is, the former partial IPv6 address) is not included, the address prefix of the interface is from the IPv6 neighbor discovery protocol. Obtained in.
S3:操作系统根据S2所设置的含有短名字的IPv6地址,将该接口设置为相应的解析后的IPv6地址,如果其中不含有前64比特地址信息,则使用IPv6邻居发现协议所获得的前64比特地址。S3: The operating system sets the interface to the corresponding parsed IPv6 address according to the IPv6 address with the short name set by S2, and if it does not contain the first 64-bit address information, the first 64 obtained by using the IPv6 neighbor discovery protocol. Bit address.
本发明涉及了一种对于某个指定IPv6网络,具有特定服务的主机,通过设置自己的IPv6后64比特地址,从而便于被其他同在本网络的用户使用。具体的步骤如下:The present invention relates to a host having a specific service for a specified IPv6 network, and by setting its own 64-bit address after IPv6, it is convenient for use by other users in the network. The specific steps are as follows:
S1:具有特定服务的主机,将自己的IPv6后64比特地址设置为短名字。S1: A host with a specific service sets its own IPv6 post-64-bit address to a short name.
S2:本网络中的其他用户通过其短名字,直接访问该主机的特定服务。S2: Other users in the network directly access the specific services of the host through their short names.
本实施例提供的具有短名字的地址字符串转换为IPv6地址的方法,包括:获取具有短名字的地址字符串,判断所述具有短名字的地址字符串中是否存在预设分隔符;若存在,根据所述预设分隔符确定前部分地址字符串和后部分地址字符串;根据RFC 5952规范将前部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址;将所述前部分IPv6地址和所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。由此,通过具有短名字的地址字符串到IPv6地址的映射,来解决IPv6地址难于记忆表达的问题,进而能够实现子网内部的指定服务标识和外网到子网的公开信息获取;不依赖于第三方服务器即可实现短名字与IPv6地址的映射,避免了类似DNS之类的由于引入第三方服务器所带来的额外安全风险、服务延时以及额外的维护成本;使得短名字只需要在一个IPv6子网中唯一即可,不必像DNS服务那样需要保证全局唯一,这样使得局部公开服务成为可能。The method for converting an address string having a short name into an IPv6 address provided in this embodiment includes: obtaining an address string having a short name, and determining whether a preset separator exists in the address string having the short name; Determining a front partial address string and a latter partial address string according to the preset separator; converting the front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and the latter partial address string according to a preset encoding rule Converting to a later partial IPv6 address; connecting the first partial IPv6 address and the latter partial IPv6 address to form an IPv6 address corresponding to the short-named address string. Therefore, the problem that the IPv6 address is difficult to memorize and express is solved by mapping the address string with the short name to the IPv6 address, thereby realizing the specified service identifier and the external network to the subnet public information acquisition within the subnet; Short-name and IPv6 address mapping can be implemented on a third-party server, avoiding additional security risks, service delays, and additional maintenance costs caused by the introduction of third-party servers like DNS; so that short names only need to be The only one in an IPv6 subnet can be used without having to guarantee global uniqueness like the DNS service, which makes local public service possible.
图4为本发明一实施例的将具有短名字的地址字符串转换为IPv6地址的装置的结构示意图。FIG. 4 is a schematic structural diagram of an apparatus for converting an address string having a short name into an IPv6 address according to an embodiment of the present invention.
如图4所示,本实施例的将具有短名字的地址字符串转换为IPv6地址的装置,包括:As shown in FIG. 4, the apparatus for converting an address string having a short name into an IPv6 address in this embodiment includes:
获取模块,用于获取具有短名字的地址字符串;An obtaining module for obtaining an address string having a short name;
判断模块,用于判断所述具有短名字的地址字符串中是否存在预设分隔符,若存在,触发确定模块;a determining module, configured to determine whether a preset delimiter exists in the address string with the short name, and if yes, triggering the determining module;
确定模块,用于根据所述预设分隔符确定前部分地址字符串和后部分地址字符串,其 中,前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;a determining module, configured to determine a front partial address string and a latter partial address string according to the preset separator, wherein the front partial address string is the preset splitter in the address string having the short name The previous part of the address string, the latter part of the address string is the partial address string of the address string having the short name after the preset separator;
转换模块,用于根据RFC 5952规范将前部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址;a conversion module, configured to convert a front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and convert the latter partial address string into a latter partial IPv6 address according to a preset encoding rule;
生成模块,用于将所述前部分IPv6地址和所述后部分IPv6地址连接,生成所述具有短名字的地址字符串对应的IPv6地址。And a generating module, configured to connect the foregoing partial IPv6 address and the latter partial IPv6 address to generate an IPv6 address corresponding to the address string with a short name.
进一步地,所述确定模块具体用于:Further, the determining module is specifically configured to:
若所述预设分隔符不是所述具有短名字的地址字符串中的第一个字符和最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is not the first character and the last character in the address string having the short name, the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
若所述预设分隔符为所述具有短名字的地址字符串中的第一个字符,获取所述具有短名字的地址字符串所属主机的子网前缀,则前部分地址字符串为所述子网前缀,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
若所述预设分隔符为所述具有短名字的地址字符串中的最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为空字符串。If the preset delimiter is the last character in the address string having the short name, the front part address string is the part of the address string having the short name that precedes the preset delimiter The address string, the latter part of the address string is an empty string.
进一步地,所述生成模块,具体用于:Further, the generating module is specifically configured to:
利用混淆算法对所述后部分IPv6地址进行混淆处理;Obfuscating the latter part of the IPv6 address by using an obfuscation algorithm;
将所述前部分IPv6地址和经混淆处理后的得到的所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。And connecting the obtained partial IPv6 address to the obtained IPv6 address after the obfuscated processing to form an IPv6 address corresponding to the address string having the short name.
进一步地,所述预设编码规则为以下编码规则中的一种:用6比特编码1个字符的编码规则、用21比特编码4个字符的编码规则。Further, the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, and encoding a 4-character encoding rule with 21 bits.
进一步地,所述转换模块还用于在所述判断模块判断在所述具有短名字的地址字符串中不存在预设分隔符时,根据RFC 5952规范对所述具有短名字的地址字符串进行转换,以获取所述具有短名字的地址字符串对应的IPv6地址Further, the conversion module is further configured to: when the determining module determines that the preset delimiter does not exist in the address string with the short name, perform the address string with the short name according to the RFC 5952 specification. Converting to obtain the IPv6 address corresponding to the address string with the short name
关于本实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。With regard to the apparatus in this embodiment, the specific manner in which the respective modules perform the operations has been described in detail in the embodiment relating to the method, and will not be explained in detail herein.
本实施例提供的具有短名字的地址字符串转换为IPv6地址的装置,包括:获取具有短名字的地址字符串,判断所述具有短名字的地址字符串中是否存在预设分隔符;若存在,根据所述预设分隔符确定前部分地址字符串和后部分地址字符串;根据RFC 5952规范将前 部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址;将所述前部分IPv6地址和所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。由此,通过具有短名字的地址字符串到IPv6地址的映射,来解决IPv6地址难于记忆表达的问题,进而能够实现子网内部的指定服务标识和外网到子网的公开信息获取;不依赖于第三方服务器即可实现短名字与IPv6地址的映射,避免了类似DNS之类的由于引入第三方服务器所带来的额外安全风险、服务延时以及额外的维护成本;使得短名字只需要在一个IPv6子网中唯一即可,不必像DNS服务那样需要保证全局唯一,这样使得局部公开服务成为可能。The device for converting an address string with a short name into an IPv6 address provided by the embodiment includes: obtaining an address string with a short name, and determining whether a preset separator exists in the address string having the short name; Determining a front partial address string and a latter partial address string according to the preset separator; converting the front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and the latter partial address string according to a preset encoding rule Converting to a later partial IPv6 address; connecting the first partial IPv6 address and the latter partial IPv6 address to form an IPv6 address corresponding to the short-named address string. Therefore, the problem that the IPv6 address is difficult to memorize and express is solved by mapping the address string with the short name to the IPv6 address, thereby realizing the specified service identifier and the external network to the subnet public information acquisition within the subnet; Short-name and IPv6 address mapping can be implemented on a third-party server, avoiding additional security risks, service delays, and additional maintenance costs caused by the introduction of third-party servers like DNS; so that short names only need to be The only one in an IPv6 subnet can be used without having to guarantee global uniqueness like the DNS service, which makes local public service possible.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms is not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, various embodiments or examples described in the specification, as well as features of various embodiments or examples, may be combined and combined.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。Moreover, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining "first" or "second" may include at least one of the features, either explicitly or implicitly. In the description of the present invention, the meaning of "a plurality" is at least two, such as two, three, etc., unless specifically defined otherwise.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logic function or process. And the scope of the preferred embodiments of the invention includes additional implementations, in which the functions may be performed in a substantially simultaneous manner or in an opposite order depending on the functions involved, in the order shown or discussed. It will be understood by those skilled in the art to which the embodiments of the present invention pertain.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM), 只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer readable medium, Used in conjunction with, or in conjunction with, an instruction execution system, apparatus, or device (eg, a computer-based system, a system including a processor, or other system that can fetch instructions and execute instructions from an instruction execution system, apparatus, or device) Or use with equipment. For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM). In addition, the computer readable medium may even be a paper or other suitable medium on which the program may be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, in other suitable manners. Processing to obtain the program electronically and then storing it in computer memory.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that portions of the invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware and in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: discrete with logic gates for implementing logic functions on data signals Logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。A person skilled in the art can understand that all or part of the steps carried by the method of the above embodiment can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium. , including one or a combination of the steps of the method embodiments.
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. An integrated module can also be stored in a computer readable storage medium if it is implemented as a software functional module and sold or used as a standalone product.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。The above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like. Although the embodiments of the present invention have been shown and described, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the invention. The embodiments are subject to variations, modifications, substitutions and variations.

Claims (10)

  1. 一种将具有短名字的地址字符串转换为IPv6地址的方法,其特征在于,包括:A method for converting an address string having a short name into an IPv6 address, comprising:
    获取具有短名字的地址字符串;Get an address string with a short name;
    判断所述具有短名字的地址字符串中是否存在预设分隔符;Determining whether a preset delimiter exists in the address string having the short name;
    若存在,根据所述预设分隔符确定前部分地址字符串和后部分地址字符串,其中,前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If yes, determining a front partial address string and a latter partial address string according to the preset separator, wherein the front partial address string is in front of the preset splitter in the address string having the short name a partial address string, the latter part of the address string being a partial address string of the address string having the short name after the preset separator;
    根据RFC 5952规范将前部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址;Converting the previous partial address string into the previous partial IPv6 address according to the RFC 5952 specification, and converting the latter partial address string into the latter partial IPv6 address according to a preset encoding rule;
    将所述前部分IPv6地址和所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。The first partial IPv6 address and the latter partial IPv6 address are connected to form an IPv6 address corresponding to the short-named address string.
  2. 如权利要求1所述的方法,其特征在于,所述根据所述预设分隔符确定前部分地址字符串和后部分地址字符串包括:The method according to claim 1, wherein said determining the front partial address string and the latter partial address string according to said preset separator comprises:
    若所述预设分隔符不是所述具有短名字的地址字符串中的第一个字符和最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is not the first character and the last character in the address string having the short name, the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
    若所述预设分隔符为所述具有短名字的地址字符串中的第一个字符,获取所述具有短名字的地址字符串所属主机的子网前缀,则前部分地址字符串为所述子网前缀,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
    若所述预设分隔符为所述具有短名字的地址字符串中的最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为空字符串。If the preset delimiter is the last character in the address string having the short name, the front part address string is the part of the address string having the short name that precedes the preset delimiter The address string, the latter part of the address string is an empty string.
  3. 如权利要求1或2所述的方法,其特征在于,所述将所述前部分IPv6地址和所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址,包括:The method according to claim 1 or 2, wherein the connecting the first partial IPv6 address and the latter partial IPv6 address to form an IPv6 address corresponding to the short-named address string comprises:
    利用混淆算法对所述后部分IPv6地址进行混淆处理;Obfuscating the latter part of the IPv6 address by using an obfuscation algorithm;
    将所述前部分IPv6地址和经混淆处理后的得到的所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。And connecting the obtained partial IPv6 address to the obtained IPv6 address after the obfuscated processing to form an IPv6 address corresponding to the address string having the short name.
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述预设编码规则为以下编码规则中的一种:用6比特编码1个字符的编码规则、用21比特编码4个字符的编码规则。The method according to any one of claims 1-3, wherein the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, encoding 4 encodings with 21 bits The encoding rules for characters.
  5. 如权利要求1-4任一项所述的方法,其特征在于,还包括:The method of any of claims 1-4, further comprising:
    若不存在,根据RFC 5952规范对所述具有短名字的地址字符串进行转换,以获取所述具有短名字的地址字符串对应的IPv6地址。If not, the address string with the short name is converted according to the RFC 5952 specification to obtain the IPv6 address corresponding to the address string with the short name.
  6. 一种将具有短名字的地址字符串转换为IPv6地址的装置,其特征在于,包括:An apparatus for converting an address string having a short name into an IPv6 address, comprising:
    获取模块,用于获取具有短名字的地址字符串;An obtaining module for obtaining an address string having a short name;
    判断模块,用于判断所述具有短名字的地址字符串中是否存在预设分隔符,若存在,触发确定模块;a determining module, configured to determine whether a preset delimiter exists in the address string with the short name, and if yes, triggering the determining module;
    确定模块,用于根据所述预设分隔符确定前部分地址字符串和后部分地址字符串,其中,前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;a determining module, configured to determine a front partial address string and a latter partial address string according to the preset separator, wherein the front partial address string is the preset splitter in the address string having the short name The previous part of the address string, the latter part of the address string is the partial address string of the address string having the short name after the preset separator;
    转换模块,用于根据RFC 5952规范将前部分地址字符串转换成前部分IPv6地址,以及根据预设编码规则将后部分地址字符串转换成后部分IPv6地址;a conversion module, configured to convert a front partial address string into a front partial IPv6 address according to the RFC 5952 specification, and convert the latter partial address string into a latter partial IPv6 address according to a preset encoding rule;
    生成模块,用于将所述前部分IPv6地址和所述后部分IPv6地址连接,生成所述具有短名字的地址字符串对应的IPv6地址。And a generating module, configured to connect the foregoing partial IPv6 address and the latter partial IPv6 address to generate an IPv6 address corresponding to the address string with a short name.
  7. 如权利要求6所述的装置,其特征在于,所述确定模块具体用于:The device according to claim 6, wherein the determining module is specifically configured to:
    若所述预设分隔符不是所述具有短名字的地址字符串中的第一个字符和最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is not the first character and the last character in the address string having the short name, the first partial address string is in the address string having the short name in the preset a partial address string preceding the separator, the latter partial address string being a partial address string following the preset separator in the address string having the short name;
    若所述预设分隔符为所述具有短名字的地址字符串中的第一个字符,获取所述具有短名字的地址字符串所属主机的子网前缀,则前部分地址字符串为所述子网前缀,后部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符后面的部分地址字符串;If the preset delimiter is the first character in the address string having the short name, and obtaining the subnet prefix of the host to which the address string having the short name belongs, the former partial address string is the a subnet prefix, the latter part of the address string is a partial address string of the address string having a short name after the preset separator;
    若所述预设分隔符为所述具有短名字的地址字符串中的最后一个字符,则前部分地址字符串为所述具有短名字的地址字符串中在所述预设分割符前面的部分地址字符串,后部分地址字符串为空字符串。If the preset delimiter is the last character in the address string having the short name, the front part address string is the part of the address string having the short name that precedes the preset delimiter The address string, the latter part of the address string is an empty string.
  8. 如权利要求6或7所述的装置,其特征在于,所述生成模块,具体用于:The device according to claim 6 or 7, wherein the generating module is specifically configured to:
    利用混淆算法对所述后部分IPv6地址进行混淆处理;Obfuscating the latter part of the IPv6 address by using an obfuscation algorithm;
    将所述前部分IPv6地址和经混淆处理后的得到的所述后部分IPv6地址连接,形成所述具有短名字的地址字符串对应的IPv6地址。And connecting the obtained partial IPv6 address to the obtained IPv6 address after the obfuscated processing to form an IPv6 address corresponding to the address string having the short name.
  9. 如权利要求6-8任一项所述的装置,其特征在于,所述预设编码规则为以下编码规则中的一种:用6比特编码1个字符的编码规则、用21比特编码4个字符的编码规则。The apparatus according to any one of claims 6-8, wherein the preset encoding rule is one of the following encoding rules: encoding a 1-character encoding rule with 6 bits, and encoding 4 bits with 21 bits The encoding rules for characters.
  10. 如权利要求6-9任一项所述的装置,其特征在于,所述转换模块还用于在所述判断模块判断在所述具有短名字的地址字符串中不存在预设分隔符时,根据RFC 5952规范对所述具有短名字的地址字符串进行转换,以获取所述具有短名字的地址字符串对应的IPv6地址。The apparatus according to any one of claims 6 to 9, wherein the conversion module is further configured to: when the determining module determines that there is no preset delimiter in the address string having the short name, The address string with a short name is converted according to the RFC 5952 specification to obtain an IPv6 address corresponding to the address string having the short name.
PCT/CN2018/092767 2017-12-13 2018-06-26 Method and device for converting address character string having short name into ipv6 address WO2019114244A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711332327.9A CN108093095B (en) 2017-12-13 2017-12-13 Method and device for converting address character string with short name into IPv6 address
CN201711332327.9 2017-12-13

Publications (1)

Publication Number Publication Date
WO2019114244A1 true WO2019114244A1 (en) 2019-06-20

Family

ID=62175318

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/092767 WO2019114244A1 (en) 2017-12-13 2018-06-26 Method and device for converting address character string having short name into ipv6 address

Country Status (2)

Country Link
CN (1) CN108093095B (en)
WO (1) WO2019114244A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108093095B (en) * 2017-12-13 2020-01-21 清华大学 Method and device for converting address character string with short name into IPv6 address
CN110677507B (en) * 2019-08-30 2022-03-11 视联动力信息技术股份有限公司 Method, system, equipment and storage medium for accessing video network terminal
CN113721853B (en) * 2021-08-31 2022-08-30 浩鲸云计算科技股份有限公司 NVMe (network video Me) -based multi-path load balancing implementation method
CN116149732B (en) * 2023-02-15 2023-10-27 深圳大学 Hardware automatic execution method, system and product of data flow task

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1467672A (en) * 2003-06-18 2004-01-14 北京爱思美网科技发展有限公司 Method for converting multilingual electronic mail address
CN103636182A (en) * 2011-04-11 2014-03-12 斯凯普公司 System and method for translating network addresses
CN108093095A (en) * 2017-12-13 2018-05-29 清华大学 Address character string with short name word is converted to the method and device of IPv6 addresses

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1514593A (en) * 2003-08-06 2004-07-21 浙江大学 Method of automatic forming IPV9 address and searching corresponding IP address and system
US7573903B2 (en) * 2005-01-13 2009-08-11 Yokogawa Electric Corporation IPv6/IPv4 translator
JP4052522B2 (en) * 2006-04-12 2008-02-27 松下電器産業株式会社 Network device and network device management method
CN102035899B (en) * 2009-09-24 2014-12-10 中兴通讯股份有限公司 Method and device for determining addresses in IPv6 (internet protocol version 6) based LAN (local area network)
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
CN103297554B (en) * 2012-03-02 2016-09-28 深圳市中兴通讯技术服务有限责任公司 The method and device of IPv4 and IPv6 compatible processing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1467672A (en) * 2003-06-18 2004-01-14 北京爱思美网科技发展有限公司 Method for converting multilingual electronic mail address
CN103636182A (en) * 2011-04-11 2014-03-12 斯凯普公司 System and method for translating network addresses
CN108093095A (en) * 2017-12-13 2018-05-29 清华大学 Address character string with short name word is converted to the method and device of IPv6 addresses

Also Published As

Publication number Publication date
CN108093095B (en) 2020-01-21
CN108093095A (en) 2018-05-29

Similar Documents

Publication Publication Date Title
WO2019114244A1 (en) Method and device for converting address character string having short name into ipv6 address
Gont et al. Network reconnaissance in ipv6 networks
Cheshire et al. DNS-based service discovery
US7779158B2 (en) Network device
JP5812008B2 (en) Name database server, name resolution system, entry search method, and entry search program
Rose et al. DNAME Redirection in the DNS
JPWO2012053162A1 (en) Name database server, name resolution system, entry search method, and entry search program
JP2014512142A (en) System and method for translating network addresses
WO2017075869A1 (en) Configuration method and service method of local dns root server
CN110995883A (en) Method, system and storage medium for DHCPv6 fixed address configuration based on EUI-64
Cheshire et al. RFC 6763: DNS-based service discovery
US9819641B2 (en) Method of and a processing device handling a protocol address in a network
WO2016150014A1 (en) Method and apparatus for generating internet protocol address prefix
US11122004B1 (en) Externally applying internal network domain name system (DNS) policies
WO2021208843A1 (en) Segment routing header compression method and apparatus and service processing method and apparatus
CN115941192A (en) IPv6 address prefix coding method and device, storage medium and electronic equipment
KR100547119B1 (en) The method for generating IPv6 address using interface ID and device thereof
US9306900B2 (en) Communication device, communication system, and communication method
Gont et al. RFC 7707: Network Reconnaissance in IPv6 Networks
WO2009151310A1 (en) System and method for representing internet protocol version 6 (ipv6) addresses
WO2024074201A1 (en) Network devices, data structure, methods and system for communication according to a network protocol, address structure and router address range structure for a network device
Richardson et al. RFC 9164: Concise Binary Object Representation (CBOR) Tags for IPv4 and IPv6 Addresses and Prefixes
Vaughn RFC 9456: Updates to the TLS Transport Model for SNMP
CN112422337A (en) Method, system and device for generating log identification
Representing Internet Engineering Task Force (IETF) P. Hoffman Request for Comments: 8427 ICANN Category: Informational July 2018

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18888388

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18888388

Country of ref document: EP

Kind code of ref document: A1