CN108632400B - IPv6 address allocation method and Leaf node equipment - Google Patents

IPv6 address allocation method and Leaf node equipment Download PDF

Info

Publication number
CN108632400B
CN108632400B CN201710770578.9A CN201710770578A CN108632400B CN 108632400 B CN108632400 B CN 108632400B CN 201710770578 A CN201710770578 A CN 201710770578A CN 108632400 B CN108632400 B CN 108632400B
Authority
CN
China
Prior art keywords
ipv6 address
address
terminal
ipv6
prefix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710770578.9A
Other languages
Chinese (zh)
Other versions
CN108632400A (en
Inventor
林长望
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201710770578.9A priority Critical patent/CN108632400B/en
Publication of CN108632400A publication Critical patent/CN108632400A/en
Application granted granted Critical
Publication of CN108632400B publication Critical patent/CN108632400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/659Internet protocol version 6 [IPv6] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5069Address allocation for group communication, multicast communication or broadcast communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5084Providing for device mobility

Abstract

The application provides an IPv6 address allocation method, which can be applied to Leaf nodes and comprises the following steps: receiving an IPv6 address request message sent by a first terminal; acquiring IPv6 address prefix configured on VSI which receives the IPv6 address request message on the equipment; generating a first IPv6 address according to the IPv6 address prefix and the MAC address of the first terminal; and returning the generated first IPv6 address to the first terminal. The method solves the defect that the centralized DHCPv6Server does not support backup, and can realize that different terminals can be allocated with different IPv6 addresses and the same IPv6 address is allocated before and after the migration of the same terminal under the condition that a plurality of Leaf nodes independently allocate IPv6 addresses.

Description

IPv6 address allocation method and Leaf node equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to an IPv6(Internet Protocol Version 6, Version 6 of the Internet Protocol) address allocation method and Leaf node devices.
Background
At present, an IPv6 network may configure an IPv6 address by means of address stateless automatic configuration in an ND (Neighbor Discovery) protocol, and the specific process is as follows: after the node is started, a request is sent to the Router through an RS (Router Solicitation) message, the Router returns an RA (Router Advertisement) message, and the node automatically configures the IPv6 address of the interface by using the IPv6 address prefix and other configuration parameters in the RA message. However, in some practical networking, a problem may arise in configuring IPv6 addresses in an address stateless auto-configuration manner, which is described below by way of a specific scenario.
Referring to fig. 1, which is a schematic diagram of a campus network, a Spine node represents a core layer device, a Leaf node represents an Access layer device, and Access and Hub are forwarding devices under Leaf. In fig. 1, a distributed gateway architecture is adopted, Leaf1 and Leaf2 are two independent gateways, both Leaf1 and Leaf2 create a VSI (Virtual Switch Interface) 1 and a VSI2, and VSI1 and VSI2 correspond to two independent VXLAN (Virtual Extensible LAN) networks. In a campus network, teachers and students often divide into different VXLAN networks, for example, in fig. 1, teacher 1 and teacher 2 divide into VXLAN network 1, and student 1 and student 2 divide into VXLAN network 2.
However, if the address stateless automatic configuration mode is adopted in the scenario of fig. 1, since terminals of different VXLAN networks Access Leaf nodes through the same physical device, for example, in fig. 1, a teacher 1 and a student 1 Access Leaf1 through the same physical device (Access), and a teacher 2 and a student 2 Access Leaf2 through the same physical device (Access); at this time, when a Leaf node issues an RA message (including an IPv6 address prefix configured on a VSI) in a multicast manner for a certain VSI, all terminals under the Leaf node may receive the RA message, so that when the Leaf node issues an RA message for each VSI, each terminal under the Leaf node receives the RA messages, so that one terminal under the Leaf node may obtain IPv6 address prefixes configured on multiple VSIs, resulting in the terminal generating multiple IPv6 addresses, and during communication, the terminal may randomly select any one IPv6 address to communicate, which may easily cause address collision between terminals and may easily cause an error when the terminal accesses a VXLAN network.
Disclosure of Invention
In view of the above, the present application provides an IPv6 address allocation method and a Leaf node device.
Specifically, the method is realized through the following technical scheme:
in a first aspect of the present application, a method for allocating an IPv6 address is provided, where the method is applied to a Leaf node, and the method includes:
receiving an IPv6 address request message sent by a first terminal;
acquiring IPv6 address prefixes configured on a virtual switch interface VSI for receiving the IPv6 address request message on the equipment;
generating a first IPv6 address according to the IPv6 address prefix configured on the VSI and the MAC address of the first terminal contained in the IPv6 address request message;
and returning the generated first IPv6 address to the first terminal.
In a second aspect of the present application, a Leaf node device is provided. The Leaf node device has the function of realizing the method, and the function can be realized by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
In one implementation, the apparatus may include:
a receiving unit, configured to receive an IPv6 address request message sent by a first terminal;
an obtaining unit, configured to obtain an IPv6 address prefix configured on a VSI that receives the IPv6 address request message on the device;
an address generating unit, configured to generate a first IPv6 address according to an IPv6 address prefix configured on the VSI and the MAC address of the first terminal included in the IPv6 address request packet;
and the sending unit is used for returning the generated first IPv6 address to the first terminal.
In another implementation, the apparatus may include a communication interface, a processor, a memory, and a bus, where the communication interface, the processor, and the memory are connected to each other through the bus; the processor executes the IPv6 address allocation method according to the first aspect of the present application by reading the logic instructions stored in the memory.
By using the technical scheme of the application, the DHCPv6Server function is directly deployed on the Leaf nodes, 128-bit IPv6 addresses are generated through IPv6 address prefixes configured on VSIs and MAC addresses of terminals, the DHCPv6Server does not need to be deployed in a centralized mode, the defect that the centralized DHCPv6Server does not support backup is overcome, different terminals are allocated with different IPv6 addresses under the condition that a plurality of Leaf nodes independently allocate IPv6 addresses, and address conflict is avoided. When the terminal is migrated, as long as the MAC address of the terminal and the VXLAN network accessed by the terminal are kept unchanged before and after the migration, the IPv6 addresses distributed before and after the migration of the same terminal can be kept unchanged.
Drawings
FIG. 1 is a schematic diagram of a campus network networking in the prior art;
FIG. 2 is a schematic diagram of centralized deployment of DHCPv6Server functionality in the networking shown in FIG. 1;
FIG. 3 is a schematic diagram of a distributed deployment of DHCPv6Server functionality in the networking shown in FIG. 1;
FIG. 4 is a flow chart of a method provided herein;
FIG. 5 is a block diagram of functional blocks of the apparatus provided herein;
fig. 6 is a diagram of the hardware architecture of the device shown in fig. 5 provided herein.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
As described in the background of the present application, in a scenario where a Leaf node is used as a gateway, a plurality of user terminals access the Leaf node through the same physical device, and the user terminals belong to different VXLAN networks (that is, the Leaf node corresponds to a plurality of network segments), an address stateless configuration manner of the ND protocol is adopted to configure an IPv6 address for the terminal, which may cause a terminal address conflict or an error when the terminal accesses the VXLAN network.
In order to avoid the foregoing situation, it may be considered that an address stateful Configuration mode is adopted to allocate an IPv6 address to the terminal, for example, DHCPv6(Dynamic Host Configuration Protocol for IPv6, Dynamic Host Configuration Protocol supporting IPv 6) is an address stateful auto-Configuration Protocol. In the process of address stateful configuration, the DHCPv6server can allocate a complete IPv6 address to the terminal.
The DHCPv6 protocol may support two deployments:
1) the DHCPv6Server function is deployed in a centralized way. Referring to fig. 2, in this way, a DHCPv6server may be added, each Leaf node is connected to the DHCPv6server, and the DHCPv6server uniformly allocates an IPv6 address to the terminal governed by each Leaf node, where the specific allocation manner is that the DHCPv6server records a correspondence between the MAC address of the terminal and the IPv6 address that has been applied for the terminal, when the DHCPv6server receives an IPv6 address request of a terminal, first determines whether the MAC address of the terminal is recorded in the correspondence, if so, reallocates the IPv6 address recorded in the correspondence to the terminal, and if not, allocates an idle IPv6 address to the terminal. The advantage of the centralized deployment of the DHCPv6Server function is that the same terminal can be guaranteed to be allocated with the same IPv6 address before and after the migration. However, the disadvantage of this method is that the current DHCPv6server generally does not support backup, i.e. does not support failover (failover), and the reliability is low.
2) The DHCPv6Server function is deployed in a distributed manner. Referring to fig. 3, the DHCPv6Server function may be deployed directly on a Leaf node, which assigns IPv6 addresses to terminals under its jurisdiction. Since the Leaf node itself supports active-standby deployment, the DHCPv6Server function deployed on the Leaf node naturally supports backup. However, this approach has the disadvantage that each Leaf node independently assigns an IPv6 address to the terminal under its jurisdiction, and it may happen that different terminals accessing different Leaf nodes are assigned the same IPv6 address, and it cannot be guaranteed that the same terminal can be assigned the same IPv6 address before and after migrating from one Leaf node to another.
Aiming at the defects of the two deployment modes, the application provides a new IPv6 address allocation method on the basis of the deployment mode of the distributed deployment of the DHCPv6Server function, the distributed deployment of the DHCPv6Server function can enable the DHCPv6Server function to naturally support backup, and the IPv6 address allocation method provided by the application can realize that different terminals can be allocated to different IPv6 addresses and the same IPv6 address can be allocated before and after the same terminal is migrated.
The methods provided herein are described below.
Referring to fig. 4, fig. 4 is a flowchart of a method provided by the present application, which may be applied to Leaf nodes, such as Leaf1 and Leaf2 in fig. 1; the Leaf node enables the DHCPv6Server function. As shown in fig. 4, the process may include the following steps:
step 401: and the Leaf node receives the IPv6 address request message sent by the first terminal.
The IPv6 address Request message may be a DHCPv6 solicit message or a DHCPv6 Request message.
Step 402: and the Leaf node acquires the IPv6 address prefix configured on the VSI which receives the IPv6 address request message on the equipment.
In the application, a Leaf node may be configured with a plurality of VSIs, each VSI corresponds to a VXLAN network, and the VSIs are configured with a corresponding network segment, and the length of the Ipv6 address prefix corresponding to the network segment is indefinite, and is generally 64 bits, but in some cases, the length of the Ipv6 address prefix may also be more than 64 bits, such as 80 bits, 90 bits, and the like.
Step 403: the Leaf node generates a first IPv6 address according to the IPv6 address prefix configured on the VSI and the MAC (Medium Access Control) address of the first terminal included in the IPv6 address request message.
The generated first IPv6 address is uniquely determined by the IPv6 address prefix and the MAC address of the first terminal.
As an embodiment of the present application, considering that the IPv6 address has a length of 128 bits and the MAC address has a length of 48 bits, the Leaf node may generate the first IPv6 address by:
firstly, the length of the IPv6 address prefix configured on the VSI receiving the IPv6 address request message is determined.
In one case, if the length of the IPv6 address prefix configured on the VSI is greater than 80 bits, since the sum of the lengths of the IPv6 address prefixes and the sum of the lengths of the MAC addresses may be greater than the length of the IPv6 address, this case does not support generation of the IPv6 address of the terminal using the IPv6 address prefix configured on the VSI and the MAC address of the terminal. At this time, the Leaf node can allocate a free IPv6 address to the terminal from a reserved group of IPv6 addresses.
In another case, if the length of the IPv6 address prefix configured on the VSI is equal to 80 bits, the IPv6 address prefix and the MAC address of the first terminal may be spliced to obtain a 128-bit first IPv6 address.
For example, if the MAC address of a certain terminal is 9C:06:1B:70: D7:01, and the prefix of the IPv6 address configured on a certain VSI is 2017:: 80, then the two are spliced to obtain an IPv6 address: 2017, 9C, 06, 1B, 70, D7 and 01.
In another case, if the length of the IPv6 address prefix configured on the VSI is less than 80 bits, the IPv6 address prefix and the MAC address of the first terminal may be spliced and padded to obtain a 128-bit first IPv6 address.
There are various ways to splice and fill the IPv6 address prefix and the MAC address of the first terminal, which are briefly listed as two:
the first method is as follows: filling a set value in the MAC address of the first terminal, wherein the length of the set value is equal to the difference between 80 and the length of the IPv6 address prefix configured on the VSI; and then splicing the filled MAC address with the IPv6 address prefix to obtain a 128-bit first IPv6 address.
The second method comprises the following steps: filling a set value in the MAC address of the first terminal, wherein the length of the set value is equal to the difference between 80 and the length of the IPv6 address prefix configured on the VSI; and then, reversing the designated bits of the filled MAC address, and splicing the reversed MAC address with the IPv6 address prefix to obtain a 128-bit first IPv6 address.
Here, the implementation process of the second mode is explained by a specific example:
assuming that the prefix length of the IPv6 address configured on a VSI is 64, to obtain a 128-bit IPv6 address, a 16-bit set value needs to be filled in the MAC address.
The MAC address has six bytes (48 bits), the first three bytes (i.e., the first 24 bits) of which are codes assigned by the Registration Authority (RA) of the IEEE to different vendors, and may be referred to as an organization unique identifier; the last three bytes (i.e., the last 24 bits) of the MAC address are referred to as an extended identifier and can be used by the user. The MAC address can be expressed as follows:
ccccccUGccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxx
wherein, the 7 th bit of the first byte is called as U/L bit, which indicates whether the address is globally managed or locally managed; if the value is 0, the global management is performed, and if the value is 1, the local management is performed. Bit 8 of the first byte is called the I/G bit, indicating whether the address is a unicast address or a multicast address; if 0, it is a unicast address, and if 1, it is a multicast address.
First, a specific 16-bit value, such as 0xFFFE, may be inserted between the organization unique identifier and the extended identifier of the MAC address to form a 64-bit padded MAC address, as follows:
ccccccUGcccccccccccccccc 11111111 11111110 xxxxxxxxxxxxxxxxxxxxxxxx
then, the 7 th bit of the first byte of the padded MAC address is inverted to obtain an inverted MAC address, as follows:
ccccccLGcccccccccccccccc 11111111 11111110 xxxxxxxxxxxxxxxxxxxxxxxx
finally, adding 64-bit IPv6 address prefix in front of the reversed MAC address to form a complete IPv6 address.
As can be seen from step 403, the IPv6 address allocated by the Leaf node to the terminal is only related to the MAC address of the terminal and the IPv6 address prefix configured on the VSI accessed by the terminal (i.e., the IPv6 address prefix of the network segment accessed by the terminal), and since the MAC address of each terminal is unique, even if the present application adopts a deployment manner in which the DHCPv6Server function is deployed in a distributed manner, i.e., an address allocation manner in which each Leaf node independently allocates an IPv6 address to the terminal governed by the Leaf node, it can be ensured that terminals with different MAC addresses will be allocated to different IPv6 addresses without address collision. Furthermore, since the VXLAN network accessed by the terminal is generally configured in advance, even if the terminal repeatedly goes up and down or migrates from one Leaf node to another, the IPv6 address allocated to the terminal does not change and is always a fixed IPv6 address, on the premise that the MAC address of the terminal and the VXLAN network accessed by the terminal remain unchanged.
Optionally, if the VXLAN network accessed by the terminal changes, the terminal may still be assigned an IPv6 address according to the IPv6 address generation manner of step 403.
Step 404: and the Leaf node returns the generated first IPv6 address to the first terminal.
Specifically, the Leaf node may carry the generated first IPv6 address in the DHCPv6 Replay message and return the message to the first terminal.
After returning the generated first IPv6 address to the first terminal, the Leaf node may record a lease corresponding to the MAC address of the first terminal, the lease including the first IPv6 address assigned to the first terminal and a lease of the first IPv6 address. As an implementation manner, the Leaf node may maintain an address pool corresponding to the IPv6 address prefix obtained in step 402, may record a correspondence relationship among the IPv6 address prefix, the MAC address of the first terminal, and the IPv6 address generated according to the IPv6 address prefix and the MAC address of the first terminal in the address pool, record a corresponding lease for the IPv6 address in the address pool, configure a timer for managing the lease life cycle, and manage the lease of the first IPv6 address.
In this application, the Leaf node may further receive an IPv6 address renewal message sent by the second terminal, and the IPv6 address renewal message may include the MAC address of the second terminal and the second IPv6 address to be renewed. The second terminal may be a terminal originally managed by the Leaf node, or may be a terminal migrated from another Leaf node.
After receiving the IPv6 address renewal message, the Leaf node may search whether the device has a lease matching the MAC address of the second terminal and the second IPv6 address to be renewed. When the message exists, the Leaf node can respond to the second terminal with a successful renewal message; if the address does not exist, the Leaf node can acquire the IPv6 address prefix configured on the VSI of the equipment for receiving the IPv6 address continuation message, and generate a third IPv6 address according to the IPv6 address prefix and the MAC address of the second terminal; judging whether the generated third IPv6 address is consistent with the second IPv6 address to be renewed or not, and if so, responding to a successful renewal message to the second terminal; if not, responding to the second terminal with a failure message of agreement continuation. After receiving the renewal failure message, the second terminal may initiate an IPv6 address request message to the Leaf node, and the Leaf node follows steps 401-404 to re-assign an IPv6 address to the second terminal.
Certainly, under the condition that the generated third IPv6 address is inconsistent with the to-be-continued second IPv6 address, the Leaf node may also directly return the third IPv6 address to the second terminal, and does not need to wait for the second terminal to send an IPv6 address request message again.
As can be seen from the flow shown in fig. 4, the DHCPv6Server function is directly deployed on the Leaf node, and a 128-bit IPv6 address is generated by the IPv6 address prefix configured on the VSI and the MAC address of the terminal, so that the centralized DHCPv6Server is not required to be deployed, the defect that the centralized DHCPv6Server does not support backup is overcome, and different terminals are assigned different IPv6 addresses under the condition that a plurality of Leaf nodes independently assign IPv6 addresses, thereby avoiding address collision. When the terminal is migrated, as long as the MAC address of the terminal and the VXLAN network accessed by the terminal are kept unchanged before and after the migration, the IPv6 addresses distributed before and after the migration of the same terminal can be kept unchanged.
The application of the method provided by the present application to a campus network is described below with reference to fig. 1.
In fig. 1, Leaf1 and Leaf2 are two independent gateways, VSI1 and VSI2 are created on Leaf1 and Leaf2, VSI1 and VSI2 correspond to two independent VXLAN networks, and the two VXLAN networks are isolated in relation to each other and have different corresponding rights. Assume that the MAC address of teacher 1 is 20-10-94-00-00-2a, the MAC address of teacher 2 is 20-10-94-00-00-2b, the MAC address of student 1 is 00-10-94-00-00-3e, and the MAC address of student 2 is 00-10-94-00-00-3 f. Teacher 1 and teacher 2 access VXLAN network corresponding to VSI1, student 1 and student 2 access VXLAN network corresponding to VSI2, IPv6 address prefix configured on VSI1 is 2017::/64, and IPv6 address prefix configured on VSI2 is 2016::/64.
According to the method provided by the application, DHCPv6 Sever functions are deployed on Leaf1 and Leaf 2.
For Leaf1, teacher 1 IPv6 address request message may be received from VSI1, and student 1 IPv6 address request message may be received from VSI 2.
For teacher 1, Leaf1 can obtain IPv6 address prefix 2017:/64 configured on VSI 1; then, the MAC address 20-10-94-00-00-2a of teacher 1 is expanded to a 64-bit address, for example, a specific 16-bit value 0xFFFE is directly inserted between the organization unique identifier and the expanded identifier of the MAC address, and then the 7 th bit of the expanded 64-bit address is inverted to obtain an expanded and inverted 64-bit address: 22-10-94-FF-FE-00-00-2A. The IPv6 address prefix configured on the VSI1 is added in front of the 64-bit address, and the IPv6 address allocated to the teacher 1 is 2017, 2210:94FF, FF00: 2A.
Similarly, for student 1, the IPv6 addresses allocated to the student 1 by Leaf1 are 2016: 0210:94FF: FE00: 3E;
based on the same IPv6 address allocation mode, on a leaf2, IPv6 addresses allocated to a teacher 2 and a student 2 are 2017, 2210:94FF, FE00:2B and 2016, 0210:94FF, FE00: 3F;
when the teacher 1 migrates to the Leaf2 and continues to offer or request an IPv6 address from the Leaf2, after the Leaf2 receives a relevant message from the VSI1, the same address 2017 is allocated to the teacher 1 according to the IPv6 address prefix configured on the VSI1 and the MAC address of the teacher 1, wherein the address is 2210:94FF, FE00: 2A.
The methods provided herein are described above. The apparatus provided in the present application is described below.
Referring to fig. 5, a Leaf node device provided in the present application is shown. As shown in fig. 5, the Leaf node device may include the following elements:
a receiving unit 501, configured to receive an IPv6 address request message sent by a first terminal.
An obtaining unit 502, configured to obtain an IPv6 address prefix configured on the VSI that receives the IPv6 address request packet on the device.
An address generating unit 503, configured to generate a first IPv6 address according to the IPv6 address prefix configured on the VSI and the MAC address of the first terminal included in the IPv6 address request packet.
A sending unit 504, configured to return the generated first IPv6 address to the first terminal.
In one embodiment, the address generating unit 502 is configured to: if the length of the IPv6 address prefix configured on the VSI is equal to 80 bits, directly splicing the IPv6 address prefix and the MAC address of the first terminal to obtain a first IPv6 address; and if the length of the IPv6 address prefix configured on the VSI is less than 80 bits, splicing and filling the IPv6 address prefix and the MAC address of the first terminal to obtain a first IPv6 address.
In one embodiment, when the IPv6 address prefix and the MAC address of the first terminal are spliced and padded to obtain a first IPv6 address, the address generating unit 502 is configured to: filling a set value in the MAC address of the first terminal, wherein the length of the set value is equal to the difference between 80 and the length of the IPv6 address prefix; splicing the filled MAC address with the IPv6 address prefix to obtain a first IPv6 address; or, inverting the designated bit of the filled MAC address, and splicing the inverted MAC address with the IPv6 address prefix to obtain a first IPv6 address.
In one embodiment, the address generating unit 502 is further configured to: recording a lease corresponding to the MAC address of the first terminal, wherein the lease comprises a first IPv6 address assigned to the first terminal and a lease period of the first IPv6 address.
In one embodiment, the receiving unit 501 is further configured to: and receiving an IPv6 address renewal message sent by a second terminal, wherein the IPv6 address renewal message comprises the MAC address of the second terminal and a second IPv6 address to be renewed.
The apparatus may further include:
an address renewal unit, configured to find whether a lease matching the MAC address of the second terminal and the second IPv6 address to be renewed exists in the device; when the answer exists, responding to the second terminal to a successful agreement continuation message; if the address does not exist, acquiring an IPv6 address prefix configured on a VSI (virtual switch interface) of the equipment for receiving the IPv6 address continuation message, and generating a third IPv6 address according to the IPv6 address prefix and the MAC address of the second terminal; and judging whether the generated third IPv6 address is consistent with the second IPv6 address to be contracted, if so, responding to the second terminal to a successful contract-closing message, and if not, responding to the second terminal to a failed contract-closing message.
It should be noted that the division of the unit in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
Referring to fig. 6, fig. 6 is a schematic diagram of a hardware structure of a Leaf node device provided in the present application, including: a processor 601, a machine-readable storage medium 602 having machine-readable instructions stored thereon, and a bus 603. The processor 601 communicates with the machine-readable storage medium 602 via the bus 603, and by reading and executing machine-readable instructions in the machine-readable storage medium 602, the above-described IPv6 address assignment method may be performed.
Here, the machine-readable storage medium 602 may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., a compact disk, a DVD, etc.), or similar storage medium, or a combination thereof.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. An IPv6 address allocation method, applied to Leaf nodes, and comprising:
receiving an IPv6 address request message sent by a first terminal;
acquiring IPv6 address prefixes configured on a virtual switch interface VSI for receiving the IPv6 address request message on the equipment;
generating a first IPv6 address according to the IPv6 address prefix configured on the VSI and the Media Access Control (MAC) address of the first terminal contained in the IPv6 address request message;
and returning the generated first IPv6 address to the first terminal.
2. The method of claim 1, wherein the generating a first IPv6 address according to the IPv6 address prefix configured on the VSI and the MAC address of the first terminal carried in the IPv6 address request packet comprises:
if the length of the IPv6 address prefix configured on the VSI is equal to 80 bits, splicing the IPv6 address prefix and the MAC address of the first terminal to obtain a first IPv6 address;
and if the length of the IPv6 address prefix configured on the VSI is less than 80 bits, splicing and filling the IPv6 address prefix and the MAC address of the first terminal to obtain a first IPv6 address.
3. The method of claim 2, wherein the splicing and padding the IPv6 address prefix and the MAC address of the first terminal to obtain a first IPv6 address comprises:
filling a set value in the MAC address of the first terminal, wherein the length of the set value is equal to the difference between 80 and the length of the IPv6 address prefix;
splicing the filled MAC address with the IPv6 address prefix to obtain a first IPv6 address; or, inverting the designated bit of the filled MAC address, and splicing the inverted MAC address with the IPv6 address prefix to obtain a first IPv6 address.
4. The method of claim 1, wherein after returning the generated first IPv6 address to the first terminal, the method further comprises:
recording a lease corresponding to the MAC address of the first terminal, wherein the lease comprises a first IPv6 address assigned to the first terminal and a lease period of the first IPv6 address.
5. The method of claim 4, wherein the method further comprises:
receiving an IPv6 address renewal message sent by a second terminal, wherein the IPv6 address renewal message comprises the MAC address of the second terminal and a second IPv6 address to be renewed;
searching whether the device has a lease which is matched with the MAC address of the second terminal and the second IPv6 address to be renewed;
when the answer exists, responding to the second terminal to a successful agreement continuation message;
if the address does not exist, acquiring an IPv6 address prefix configured on a VSI (virtual switch interface) of the equipment for receiving the IPv6 address continuation message, and generating a third IPv6 address according to the IPv6 address prefix and the MAC address of the second terminal; and judging whether the generated third IPv6 address is consistent with the second IPv6 address to be contracted, if so, responding to the second terminal to a successful contract-closing message, and if not, responding to the second terminal to a failed contract-closing message.
6. A Leaf node device, comprising:
a receiving unit, configured to receive an IPv6 address request message sent by a first terminal;
an obtaining unit, configured to obtain an IPv6 address prefix configured on a virtual switch interface VSI that receives the IPv6 address request packet on the device;
an address generating unit, configured to generate a first IPv6 address according to an IPv6 address prefix configured on the VSI and the MAC address of the first terminal included in the IPv6 address request packet;
and the sending unit is used for returning the generated first IPv6 address to the first terminal.
7. A Leaf node device according to claim 6, wherein the address generation unit is to:
if the length of the IPv6 address prefix configured on the VSI is equal to 80 bits, directly splicing the IPv6 address prefix and the MAC address of the first terminal to obtain a first IPv6 address;
and if the length of the IPv6 address prefix configured on the VSI is less than 80 bits, splicing and filling the IPv6 address prefix and the MAC address of the first terminal to obtain a first IPv6 address.
8. The Leaf node apparatus of claim 7, wherein, when the IPv6 address prefix and the MAC address of the first terminal are spliced and padded to obtain a first IPv6 address, the address generation unit is configured to:
filling a set value in the MAC address of the first terminal, wherein the length of the set value is equal to the difference between 80 and the length of the IPv6 address prefix;
splicing the filled MAC address with the IPv6 address prefix to obtain a first IPv6 address; or, inverting the designated bit of the filled MAC address, and splicing the inverted MAC address with the IPv6 address prefix to obtain a first IPv6 address.
9. A Leaf node device according to claim 6, wherein the address generation unit is further configured to:
recording a lease corresponding to the MAC address of the first terminal, wherein the lease comprises a first IPv6 address assigned to the first terminal and a lease period of the first IPv6 address.
10. A Leaf node device according to claim 9,
the receiving unit is further configured to receive an IPv6 address renewal message sent by a second terminal, where the IPv6 address renewal message includes the MAC address of the second terminal and a second IPv6 address to be renewed;
the device further comprises:
an address renewal unit, configured to find whether a lease matching the MAC address of the second terminal and the second IPv6 address to be renewed exists in the device; when the answer exists, responding to the second terminal to a successful agreement continuation message; if the address does not exist, acquiring an IPv6 address prefix configured on a VSI (virtual switch interface) of the equipment for receiving the IPv6 address continuation message, and generating a third IPv6 address according to the IPv6 address prefix and the MAC address of the second terminal; and judging whether the generated third IPv6 address is consistent with the second IPv6 address to be contracted, if so, responding to the second terminal to a successful contract-closing message, and if not, responding to the second terminal to a failed contract-closing message.
CN201710770578.9A 2017-08-31 2017-08-31 IPv6 address allocation method and Leaf node equipment Active CN108632400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710770578.9A CN108632400B (en) 2017-08-31 2017-08-31 IPv6 address allocation method and Leaf node equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710770578.9A CN108632400B (en) 2017-08-31 2017-08-31 IPv6 address allocation method and Leaf node equipment

Publications (2)

Publication Number Publication Date
CN108632400A CN108632400A (en) 2018-10-09
CN108632400B true CN108632400B (en) 2021-07-23

Family

ID=63705803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710770578.9A Active CN108632400B (en) 2017-08-31 2017-08-31 IPv6 address allocation method and Leaf node equipment

Country Status (1)

Country Link
CN (1) CN108632400B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111107173B (en) * 2018-10-29 2023-04-07 中国移动通信集团浙江有限公司 IP address planning method and system of IP bearing network
CN113612870A (en) * 2021-09-07 2021-11-05 上海市共进通信技术有限公司 Method for distributing different IPv6 address prefixes based on LAN side multi-type terminal equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050018677A1 (en) * 2003-07-23 2005-01-27 Samsung Electronics Co., Ltd. Method and system for generating IP addresses of access terminals and transmitting messages for generation of IP addresses in an IP system
CN101572692A (en) * 2008-04-28 2009-11-04 华为技术有限公司 Method, system and equipment for IP address assignment
CN102244651B (en) * 2010-05-14 2014-04-16 杭州华三通信技术有限公司 Method for preventing attack of illegal neighbor discovery protocol message and access equipment
CN101873320B (en) * 2010-06-17 2014-02-12 杭州华三通信技术有限公司 Client information verification method based on DHCPv6 relay and device thereof
WO2011157141A2 (en) * 2011-05-31 2011-12-22 华为技术有限公司 Internet protocol version 6 address allocation method and apparatus
US8751614B2 (en) * 2011-10-11 2014-06-10 Telefonaktiebolaget L M Ericsson (Publ) Providing virtualized visibility through routers
CN105591907B (en) * 2015-07-28 2018-11-09 新华三技术有限公司 A kind of route obtaining method and device
CN105763671A (en) * 2016-04-27 2016-07-13 杭州华三通信技术有限公司 IP address distribution method and apparatus
CN107094110B (en) * 2017-04-19 2020-01-03 新华三技术有限公司 DHCP message forwarding method and device

Also Published As

Publication number Publication date
CN108632400A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
EP2654268B1 (en) Address allocation processing method and apparatus
US10027623B2 (en) Internet protocol address resolution
EP2267984B1 (en) Address configuring method, apparatus and system
JP3759129B2 (en) Apparatus and method for automatically assigning virtual address to duplicate address node
CN102984288A (en) Method and system for managing internet protocol version 6 (IPV6) address conflicts automatically
US20120023207A1 (en) Automatic assignment of hardware addresses within computer networks
CN111385374B (en) Method for network allocation, network device and computer-readable storage medium
KR101191721B1 (en) METHOD FOR GENERATING AND MANAGING CONNECTION IDENTIFIERS FOR SUPPORTING GROUP MULTICASTING IN IPv6-BASED WIRELESS NETWORK AND NETWORK INTERFACE OF ENABLING THE METHOD
US20030182445A1 (en) Method for automatically allocating address prefixes
CN111435912A (en) IPv6 stateless address automatic configuration method, network equipment and host
WO2014101891A1 (en) Method and device for configuring ip address
CN108632400B (en) IPv6 address allocation method and Leaf node equipment
CN109120741B (en) Duplicate address detection method and device and computer readable storage medium
CN108418907B (en) IP address allocation method and device
CN1875573B (en) Method, node and server for providing tunnel service capable of data communication between different types of networks
CN102025797A (en) Address prefix processing method, device, system and network equipment
CN107547674B (en) Address allocation method and device
CN108234203B (en) Configuration issuing method and device, configuration method and device and network system
CN109495598B (en) Domain name system parameter selection method and related device
CN107547684B (en) IPv6 address allocation method and device
CN116348852A (en) Managing Internet Protocol (IP) address assignments to tenants in a computing environment
CN109347742B (en) PBR-based multiple next hop load sharing method and device
CN108712522B (en) IP address allocation method and device
JP5703848B2 (en) Communication method, communication system, router and server
CN113347285B (en) Automatic allocation method, device and equipment for managing IP address

Legal Events

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