Communication method and apparatus

By generating a master forwarding table entry in the BRAS device and binding it to a sub-forwarding table entry, the network access problem caused by the random generation of interface identifiers in the stateless IPv6 address configuration was resolved, and normal communication of user equipment was realized.

CN117579599BActive Publication Date: 2026-06-05NEW H3C TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEW H3C TECH CO LTD
Filing Date
2023-12-14
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In the existing stateless IPv6 address configuration, the interface identifier generated by the user equipment is randomized, which causes a mismatch with the forwarding information within the BRAS device, preventing the user terminal from accessing the network normally.

Method used

The BRAS device receives the authentication response message from the AAA server, generates a main forwarding table entry and establishes a binding relationship with the sub-forwarding table entries. It creates the main forwarding table entry and multiple sub-forwarding table entries through a shared prefix method, ensuring that any IPv6 address generated by the user equipment through the IPv6 stateless address configuration can communicate normally.

Benefits of technology

It solves the problem of user terminals being unable to access the network normally, avoids network outages, and enables user equipment to communicate normally through IPv6 stateless address configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117579599B_ABST
    Figure CN117579599B_ABST
Patent Text Reader

Abstract

The application provides a communication method and device, which are applied to a BRAS device. The method comprises the following steps: receiving an authentication response message sent by an AAA server after authenticating a user device, wherein the authentication response message indicates that the user device is authenticated and the authentication response message comprises an IPv6 address prefix; generating a main forwarding table item according to the IPv6 address prefix, wherein the main forwarding table item comprises the IPv6 address prefix; receiving a first IP message sent by the user device, wherein the first IP message comprises an IPv6 address of the user device; if the IPv6 address belongs to the IPv6 address prefix, generating a sub forwarding table item and establishing a binding relationship between the main forwarding table item and the sub forwarding table item, wherein the sub forwarding table item comprises the IPv6 address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Technology

[0002] Currently, in typical IPv6 applications, user equipment can complete gateway learning and address deployment through the route discovery mechanism, i.e., stateless IPv6 address configuration. The specific process of stateless IPv6 address configuration is as follows:

[0003] In an IPoE-based network, the User Equipment (UE) generates and sends RS (Responding Status) messages to the BRAS (Browser Access Controller) device. The BRAS device initiates authentication with the AAA (Authorization Authority) server based on the RS messages. After successful authentication, the AAA server sends an authentication success message to the BRAS device, which includes the prefix. The BRAS device generates forwarding information for the UE and generates RA (Access Registry) messages, which include the prefix and corresponding gateway information. The BRAS device then sends the RA messages to the UE. After learning the prefix, the UE generates a global unicast address.

[0004] Subsequently, the user equipment uses the generated global unicast address to access the external network. At this point, the BRAS device already contains the user equipment's forwarding information, enabling it to forward the service traffic sent by the user equipment.

[0005] However, existing stateless IPv6 address configurations typically allow user devices to generate two types of IPv6 addresses: public addresses with fixed interface identifiers and temporary addresses with random interface identifiers. Furthermore, even if a user device generates a public address, its interface identifier may not be generated from the MAC address of its own interface, but rather from a random number. Subsequently, when a user device uses an IPv6 address with a randomly generated interface identifier to access an external network, the mismatch with the forwarding information within the BRAS device can prevent the user device from accessing the network normally. Summary of the Invention

[0006] In view of this, this application provides a communication method and apparatus to solve the problem that the interface identifiers included in the existing IPv6 addresses are generated randomly by the user terminal, which leads to the user terminal being unable to access the network normally due to the mismatch with the forwarding information existing in the BRAS device.

[0007] In a first aspect, this application provides a communication method applied to a BRAS device, the method comprising:

[0008] The system receives an authentication response message sent by the AAA server after authenticating the user equipment. The authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix.

[0009] A main forwarding table entry is generated based on the IPv6 address prefix, and the main forwarding table entry includes the IPv6 address prefix;

[0010] Receive a first IP packet sent by the user equipment, wherein the first IP packet includes the IPv6 address of the user equipment;

[0011] If the IPv6 address belongs to the IPv6 address prefix, a sub-forwarding table entry is generated, and a binding relationship is established between the main forwarding table entry and the sub-forwarding table entry. The sub-forwarding table entry includes the IPv6 address.

[0012] Secondly, this application provides a communication device applied to a BRAS device, the device comprising:

[0013] The receiving unit is configured to receive an authentication response message sent by the AAA server after authenticating the user equipment, wherein the authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix.

[0014] The generation unit is configured to generate a main forwarding table entry based on the IPv6 address prefix, wherein the main forwarding table entry includes the IPv6 address prefix;

[0015] The receiving unit is further configured to receive a first IP packet sent by the user equipment, wherein the first IP packet includes the IPv6 address of the user equipment.

[0016] The generation unit is further configured to, if the IPv6 address belongs to the IPv6 address prefix, generate a sub-forwarding table entry, wherein the sub-forwarding table entry includes the IPv6 address;

[0017] A creation unit is used to establish the binding relationship between the main forwarding table entry and the sub-forwarding table entry.

[0018] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.

[0019] Therefore, using the communication method and apparatus provided in this application, the BRAS device receives an authentication response message sent by the AAA server after authenticating the user equipment. The authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix. Based on the IPv6 address prefix, the BRAS device generates a main forwarding table entry, which includes the IPv6 address prefix. The BRAS device receives a first IP packet sent by the user equipment, which includes the user equipment's IPv6 address. If the IPv6 address belongs to an IPv6 address prefix, the BRAS device generates a sub-forwarding table entry and establishes a binding relationship between the main forwarding table entry and the sub-forwarding table entry, which includes the IPv6 address.

[0020] Thus, when user equipment is configured with stateless IPv6 addresses, the BRAS device creates a main forwarding table entry and multiple sub-forwarding table entries locally by sharing a prefix. This ensures that any IPv6 address generated by the user equipment using the stateless IPv6 address configuration can communicate normally, avoiding network outages. Simultaneously, it also resolves the issue where existing IPv6 addresses, whose interface identifiers are randomly generated by the user terminal and do not match the forwarding information within the BRAS device, prevented the user terminal from accessing the network. Attached Figure Description

[0021] Figure 1 A flowchart illustrating the communication method provided in the embodiments of this application;

[0022] Figure 2 Signaling diagram of message interaction between user equipment and BRAS device provided in the embodiments of this application;

[0023] Figure 3 A structural diagram of a communication device provided in an embodiment of this application;

[0024] Figure 4 The network device hardware structure provided in the embodiments of this application. Detailed Implementation

[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0026] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the corresponding listed items.

[0027] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0028] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 1 , Figure 1 A flowchart illustrating a communication method provided in an embodiment of this application. This method is applied to a BRAS device, and the communication method provided in this application embodiment may include the following steps.

[0029] Step 110: Receive the authentication response message sent by the AAA server after authenticating the user equipment. The authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix.

[0030] Specifically, in a network using IPoE access, after receiving the IP packet from the user equipment, the BRAS device initiates authentication of the user equipment with the AAA server.

[0031] After successfully authenticating the user equipment, the AAA server grants the user equipment the corresponding access permissions. The AAA server generates and sends an authentication response message to the BRAS server, which includes the IPv6 address prefix.

[0032] After receiving the authentication response message, the BARS device obtains the IPv6 address prefix assigned to the user equipment by the AAA server.

[0033] Optionally, before performing step 110, the BRAS device may also perform the steps of receiving an IP packet sent by the user equipment and initiating authentication with the AAA server through the IP packet.

[0034] After a user equipment (UE) connects to the network, it generates and sends a second IP packet to the BRAS device. This second IP packet includes the UE's first MAC address. Upon receiving the second IP packet, the BRAS device retrieves the first MAC address from it. The BRAS device records the UE's first MAC address locally and generates an authentication request packet, which also includes the first MAC address.

[0035] The BRAS device sends an authentication request message to the AAA server. Upon receiving the authentication request message, the AAA server can authenticate the user equipment using the first MAC address. After successful authentication, the AAA server assigns an IPv6 address prefix to the user equipment.

[0036] The AAA server generates and sends an authentication response message to the BRAS device. It is understood that the authentication response message also includes authentication and authorization information issued by the AAA server to the user equipment, such as the network resources that the user equipment can access.

[0037] Optionally, after performing step 110, the BRAS device also performs the step of sending an IPv6 address prefix to the user equipment, so that the user terminal generates its own IPv6 address based on the IPv6 address prefix.

[0038] After obtaining the IPv6 address prefix, the BRAS device generates and sends a third IP packet to the user equipment (UE). This third IP packet includes the IPv6 address prefix. Upon receiving the third IP packet, the UE retrieves and learns the IPv6 address prefix from it. Using the IPv6 address prefix and its own generated interface ID, the UE generates an IPv6 address. This IPv6 address is a globally unicast address and can be a public address or a temporary address.

[0039] The process of user equipment generating interface IDs and IPv6 addresses is the same as the existing stateless IPv6 address configuration process, and will not be repeated here.

[0040] In this embodiment of the application, the second IP packet is specifically an RS packet, and the third IP packet is specifically an RA packet.

[0041] It is understandable that "second" and "third" are only used to represent different IP packet names, and other names can also be used to represent the above IP packets. For example, "first," "fourth," etc.

[0042] According to existing IPv6 protocol specifications, RS packets also include user name, VLAN tag, and other information, so that the authentication request packets generated by the BRAS device also include the above information and are transmitted to the AAA server. The AAA server authenticates the user device and assigns an IPv6 address prefix based on the first MAC address, user name, VLAN tag, and other information. The process of the user device sending RS packets, the BRAS device sending authentication request packets, the AAA server performing authentication, assigning IPv6 address prefixes, sending authentication response packets, and the BRAS device sending RA packets is the same as the existing stateless address configuration process for IPv6, and will not be repeated here.

[0043] Step 120: Generate a main forwarding table entry based on the IPv6 address prefix, wherein the main forwarding table entry includes the IPv6 address prefix;

[0044] Specifically, according to the description of step 110, after the BRAS device obtains the IPv6 address prefix, it generates a main forwarding table entry locally. This main forwarding table entry includes the IPv6 address prefix and can also be referred to as the user equipment's main forwarding table entry.

[0045] In this embodiment of the application, the master forwarding table entry can also be referred to as the master user or master user table entry.

[0046] Step 130: Receive a first IP packet sent by the user equipment, wherein the first IP packet includes the IPv6 address of the user equipment;

[0047] Specifically, as described in step 110, the user equipment generates an IPv6 address using the IPv6 address prefix and its own generated interface ID. The user equipment then performs DAD (Device Adaptive Testing) on ​​the generated IPv6 address.

[0048] If the DAD check on the IPv6 address passes, the user equipment generates and multicasts a first IP packet, which includes the user equipment's IPv6 address. This first IP packet informs other network devices in the multicast group that the IPv6 address is already in use by the user equipment.

[0049] After receiving the first IP packet, the BRAS device obtains the IPv6 address of the user equipment from it.

[0050] In this embodiment of the application, the first IP packet is specifically an NA packet.

[0051] Step 140: If the IPv6 address belongs to the IPv6 address prefix, then generate a sub-forwarding table entry and establish a binding relationship between the main forwarding table entry and the sub-forwarding table entry. The sub-forwarding table entry includes the IPv6 address.

[0052] Specifically, as described in step 130, after obtaining the IPv6 address of the user equipment, the BRAS device identifies the address prefix to which the IPv6 address belongs. The BRAS device can compare the IPv6 address with the IPv6 address prefix included in each established master forwarding table entry. If the IPv6 address belongs to an IPv6 address prefix included in the master forwarding table entry, the BRAS device determines that the IPv6 address is a sub-user of the IPv6 address prefix, and no further authentication is required. The sub-user inherits the authentication and authorization information of the master user, that is, the IPv6 address inherits the authentication and authorization information of the IPv6 address prefix.

[0053] The BRAS device generates a sub-forwarding table entry. This sub-forwarding table entry includes an IPv6 address; it can also be referred to as a sub-forwarding table entry for the user equipment. Because this IPv6 address inherits the authentication and authorization information of the primary user, it enables subsequent IPv6 packets from the sub-user to communicate normally.

[0054] BRAS establishes a binding relationship between the main forwarding table entry and the sub-forwarding table entry locally (using the IPv6 address prefix or IPv6 address as the key to establish the association between the two entries). For example, the service traffic of a sub-user is recorded in the main user's table, and when the main user goes offline, all sub-users bound to it are deleted, etc. Sub-forwarding table entries can be stored separately or under the main forwarding table entry.

[0055] In this embodiment of the application, the sub-forwarding table entry can also be referred to as a sub-user or sub-user table entry.

[0056] Therefore, using the communication method provided in this application, the BRAS device receives an authentication response message sent by the AAA server after authenticating the user equipment. This authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix. Based on the IPv6 address prefix, the BRAS device generates a main forwarding table entry, which includes the IPv6 address prefix. The BRAS device receives a first IP packet sent by the user equipment, which includes the user equipment's IPv6 address. If the IPv6 address belongs to an IPv6 address prefix, the BRAS device generates a sub-forwarding table entry and establishes a binding relationship between the main forwarding table entry and the sub-forwarding table entry, which includes the IPv6 address.

[0057] Thus, when user equipment is configured with stateless IPv6 addresses, the BRAS device creates a main forwarding table entry and multiple sub-forwarding table entries locally by sharing a prefix. This ensures that any IPv6 address generated by the user equipment using the stateless IPv6 address configuration can communicate normally, avoiding network outages. Simultaneously, it also resolves the issue where existing IPv6 addresses, whose interface identifiers are randomly generated by the user terminal and do not match the forwarding information within the BRAS device, prevented the user terminal from accessing the network.

[0058] Optionally, in this embodiment of the application, before the BRAS device identifies the address prefix to which the IPv6 address belongs, a step of the BRAS device determining the MAC address is also included.

[0059] Specifically, when generating the master forwarding table entry, the BRAS device also stores the first MAC address in the master forwarding table entry. Of course, the master forwarding table entry can also store user names, VLAN tags, authentication and authorization information, etc.

[0060] The first IP packet received by the BRAS device also includes the second MAC address of the user terminal.

[0061] After obtaining the second MAC address from the first IP packet, the BRAS device first determines whether the second MAC address is the same as the first MAC address (that is, the BRAS can compare the second MAC address with the first MAC address included in each established master forwarding table entry); if the second MAC address is the same as the first MAC address, the BRAS device determines whether the IPv6 address belongs to the IPv6 address prefix.

[0062] If the IPv6 address belongs to an IPv6 address prefix, the BRAS device proceeds to step 140. If the IPv6 address does not belong to an IPv6 address prefix, the BRAS device discards the first IP packet.

[0063] If the second MAC address is different from the first MAC address, the BRAS device records the second MAC address locally and generates an authentication request message again to initiate authentication to the AAA server.

[0064] Optionally, in embodiments of this application, the method further includes a step in which the BRAS device periodically probes the IPv6 address prefixes included in the main forwarding table entries.

[0065] Specifically, the second IP packet received by the BRAS device also includes the link-local address of the user equipment.

[0066] The BRAS device generates and sends a fourth IP packet to the user equipment, which includes the link-local address. The user equipment is the device indicated by the link-local address.

[0067] The BRAS device waits and determines whether it has received a fifth IP packet from the user equipment. If it does, the BRAS device determines that the user equipment is still using a link-local address, maintains the main forwarding table entries, and preserves the binding relationship between the main and sub-forwarding table entries. If it does not receive a fifth IP packet from the user equipment, the BRAS device sends a fourth IP packet to the user equipment again, until a preset number of probes is exceeded without receiving a fifth IP packet. At this point, the BRAS device deletes the main and sub-forwarding table entries.

[0068] In this embodiment of the application, the fourth IP message is specifically an NS message, and the fifth IP message is specifically an NA message.

[0069] Optionally, in embodiments of this application, the method further includes a step of the BRAS device periodically probing the IPv6 addresses included in the sub-forwarding table entries.

[0070] Specifically, the BRAS device generates and sends a sixth IP packet to the user equipment, which includes an IPv6 address. The user equipment is the device indicated by the IPv6 address.

[0071] The BRAS device waits and determines whether it has received the seventh IP packet from the user equipment. If it does, the BRAS device confirms that the user equipment is still using an IPv6 address. The BRAS device maintains the sub-forwarding table entries and the binding relationship between them and the main forwarding table entries. If it does not receive the seventh IP packet from the user equipment, the BRAS device sends the sixth IP packet to the user equipment again until a preset number of probes is not received, at which point the BRAS device deletes the sub-forwarding table entries.

[0072] In this embodiment, the sixth IP packet is specifically an NS packet, and the seventh IP packet is specifically an NA packet. In this embodiment, both the user equipment's link-local address and the generated IPv6 address need to undergo periodic probing steps so that the BRAS can release the corresponding main forwarding table entries and sub-forwarding table entries in a timely manner.

[0073] To ensure reliable detection, the BRAS device needs to configure the detection interval and number of probes. For example, a probe can be performed every 120 seconds, with a total of 5 probes. If no IP packets are received from the user equipment for 5 consecutive probes, the BRAS device determines that the user equipment is no longer using the link-local address or IPv6 address, meaning that the link-local address and IPv6 address do not exist.

[0074] To prevent special user devices from generating or frequently changing IPv6 addresses, which would trigger the BRAS device to generate a large number of master and sub-forwarding table entries and consume hardware resources, causing the BRAS device to frequently deal with the generation, binding, detection, and deletion of master and sub-forwarding table entries and affecting other normal users, this embodiment of the application limits the number of sub-forwarding table entries. For example, the number of sub-forwarding table entries is set to a range of [2, 100]. Typically, the default number of sub-forwarding table entries is 10. The range and default number of sub-forwarding table entries can be set according to the current network topology.

[0075] The BRAS device can also control the time interval between the generation of multiple sub-forwarding entries. For example, the BRAS device can only create a new sub-forwarding entry after the time interval between the generation time of each sub-forwarding entry and the generation time of the previous sub-forwarding entry is greater than a preset time T. For example, the preset time T can be set to a time interval range of [1, 60], typically 2 minutes. The time interval range and specific time of the preset time T can also be set according to the current network topology.

[0076] It should be noted that, according to existing IPv6 related protocols regarding stateless address configuration, after receiving a third IP packet from the BRAS device, the user equipment can simultaneously generate a public address and a temporary address based on the IPv6 address prefix. Therefore, in this embodiment, the BRAS device does not control the time interval between the earliest two generated sub-forwarding table entries. Of course, the BRAS device can also set the number of sub-forwarding table entries without time interval control, for example, 2-10.

[0077] If there are a large number of user devices in the network, false probes may occur due to improper settings of the aforementioned detection parameters within the BRAS device or rate limiting and packet loss of ND packets (NS packets, NA packets), leading to the BRAS device mistakenly deleting the main and sub-forwarding table entries. In this case, the BRAS device also supports re-triggering the creation of main and sub-forwarding table entries through subsequent non-ND packets (i.e., IPv6 service packets) sent by the user devices. The process of the BRAS device creating main and sub-forwarding table entries through non-ND packets is the same as the process described above for creating main and sub-forwarding table entries through ND packets, and will not be repeated here.

[0078] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 2 , Figure 2 This document presents a signaling diagram illustrating message interaction between a user equipment and a BRAS device, as provided in an embodiment of this application. The process includes the steps shown below.

[0079] Step 210: The user equipment sends an RS message to the BRAS device.

[0080] Specifically, after the user equipment accesses the network, it generates and sends an RS message to the BRAS device. The RS message includes the MAC1 address of the user terminal.

[0081] Step 220: The BRAS device performs authentication and authorization processing.

[0082] Specifically, after receiving the RS message, the BRAS device obtains the MAC1 address from it. The BRAS device records the user terminal's MAC1 address locally and generates an authentication request message, which includes the MAC1 address.

[0083] The BRAS device sends an authentication request message to the AAA server. Upon receiving the authentication request message, the AAA server can authenticate the user equipment using its MAC1 address. After successful authentication, the AAA server assigns an IPv6 address prefix to the user equipment, namely 2014:: / 64.

[0084] The AAA server generates and sends an authentication response message to the BRAS device, which includes the IPv6 address prefix 2014:: / 64.

[0085] Step 230: The BRAS device generates the master forwarding table entry.

[0086] Specifically, after receiving the authentication response message, the BARS device obtains the IPv6 address prefix 2014:: / 64 assigned to the user equipment by the AAA server.

[0087] After the BRAS device obtains the IPv6 address prefix 2014:: / 64, it generates a main forwarding table entry locally, which includes the IPv6 address prefix 2014:: / 64.

[0088] It should be noted that the main forwarding table entry also includes the MAC1 address.

[0089] Step 240: The BRAS device sends an RA message to the user equipment.

[0090] Specifically, after the BRAS device obtains the IPv6 address prefix 2014:: / 64, it generates and sends an RA message to the user equipment. The RA message includes the IPv6 address prefix 2014:: / 64.

[0091] Step 250: The user equipment generates a public address and sends the first NA message.

[0092] Specifically, after receiving the RA message, the user equipment obtains and learns the IPv6 address prefix 2014:: / 64 from it. Using the IPv6 address prefix and its own generated interface ID (0x1234), it generates an IPv6 address. This IPv6 address is a globally unicast address and a public address, namely 2014::1234.

[0093] After the user equipment generates the IPv6 address 2014::1234, it performs DAD detection on the generated IPv6 address 2014::1234.

[0094] If the DAD test on the IPv6 address 2014::1234 passes, the user equipment generates and multicasts a first NA message, which includes the user equipment's IPv6 address 2014::1234.

[0095] Step 260: The BRAS device generates the first sub-forwarding table entry.

[0096] Specifically, after receiving the first NA message, the BRAS device obtains the IPv6 address 2014::1234 of the user equipment from it.

[0097] It should be noted that the first NA message also includes the MAC2 address of the user equipment.

[0098] After obtaining the MAC2 address from the first NA packet, the BRAS device first determines whether the MAC2 address is the same as the MAC1 address. If the MAC2 address is the same as the MAC1 address, the BRAS device then determines whether the IPv6 address 2014::1234 belongs to the IPv6 address prefix 2014:: / 64.

[0099] If IPv6 address 2014::1234 belongs to IPv6 address prefix 2014:: / 64, then the BRAS device determines that IPv6 address 2014::1234 is a sub-user of IPv6 address prefix 2014:: / 64, and no further authentication is required. The sub-user inherits the authentication and authorization information of the primary user, that is, IPv6 address 2014::1234 inherits the authentication and authorization information of IPv6 address prefix 2014:: / 64.

[0100] The BRAS device generates the first sub-forwarding table entry. This first sub-forwarding table entry includes the IPv6 address 2014::1234.

[0101] Step 270: The user equipment generates a temporary address and sends a second NA message.

[0102] Specifically, after receiving the RA message sent by the BRAS device, the user equipment obtains and learns the IPv6 address prefix 2014:: / 64 from it. Using the IPv6 address prefix and its own generated interface ID (0x5678), it generates an IPv6 address. This IPv6 address is a global unicast address and is a temporary address, i.e., 2014::5678.

[0103] After the user equipment generates the IPv6 address 2014::5678, it performs DAD detection on the generated IPv6 address 2014::5678.

[0104] If the DAD test on the IPv6 address 2014::5678 passes, the user equipment generates and multicasts a second NA message, which includes the user equipment's IPv6 address 2014::5678.

[0105] Step 280: The BRAS device generates the second sub-forwarding table entry.

[0106] Specifically, after receiving the second NA message, the BRAS device obtains the user equipment's IPv6 address 2014::5678 from it.

[0107] It should be noted that the second NA message also includes the MAC2 address of the user equipment.

[0108] After obtaining the MAC2 address from the second NA packet, the BRAS device first determines whether the MAC2 address is the same as the MAC1 address. If the MAC2 address is the same as the MAC1 address, the BRAS device then determines whether the IPv6 address 2014::5678 belongs to the IPv6 address prefix 2014:: / 64.

[0109] If IPv6 address 2014::5678 belongs to IPv6 address prefix 2014:: / 64, the BRAS device determines that IPv6 address 2014::5678 is a sub-user of IPv6 address prefix 2014:: / 64, and no further authentication is required. The sub-user inherits the authentication and authorization information of the primary user, that is, IPv6 address 2014::5678 inherits the authentication and authorization information of IPv6 address prefix 2014:: / 64.

[0110] The BRAS device generates a second sub-forwarding table entry. This second sub-forwarding table entry includes the IPv6 address 2014::5678.

[0111] As can be seen from the foregoing embodiments, after each sub-forwarding table entry is generated, the BRAS device establishes a binding relationship between the main forwarding table entry and the sub-forwarding table entry locally. For example, the business traffic of sub-users is recorded in the main user's account, and when the main user goes offline, all sub-users bound to it are deleted, etc.

[0112] Based on the same inventive concept, embodiments of this application also provide a communication device corresponding to the communication method. See also Figure 3 , Figure 3 The communication device provided in this application embodiment is applied to a BRAS device, and the device includes:

[0113] The receiving unit 310 is configured to receive an authentication response message sent by the AAA server after authenticating the user equipment, wherein the authentication response message indicates that the user equipment has been successfully authenticated and the authentication response message includes an IPv6 address prefix.

[0114] The generation unit 320 is configured to generate a main forwarding table entry based on the IPv6 address prefix, wherein the main forwarding table entry includes the IPv6 address prefix;

[0115] The receiving unit 310 is further configured to receive a first IP packet sent by the user equipment, wherein the first IP packet includes the IPv6 address of the user equipment.

[0116] The generation unit 320 is further configured to generate a sub-forwarding table entry if the IPv6 address belongs to the IPv6 address prefix, the sub-forwarding table entry including the IPv6 address;

[0117] Creation unit 330 is used to establish the binding relationship between the main forwarding table entry and the sub-forwarding table entry.

[0118] Optionally, the receiving unit 310 is further configured to receive a second IP packet sent by the user equipment, the second IP packet including the first MAC address of the user terminal;

[0119] The apparatus further includes: a sending unit (not shown in the figure), configured to send an authentication request message to the AAA server, the authentication request message including the first MAC address, so that the AAA server can authenticate the user equipment and allocate the IPv6 address prefix through the first MAC address;

[0120] The sending unit (not shown in the figure) is further configured to send a third IP packet to the user equipment, the third IP packet including the IPv6 address prefix, so that the user equipment generates the IPv6 address based on the IPv6 address prefix and its own generated interface identifier.

[0121] Optionally, the main forwarding table entry further includes the first MAC address; the first IP packet further includes the second MAC address of the user terminal;

[0122] The device further includes:

[0123] The first judgment unit (not shown in the figure) is used to determine whether the second MAC address is the same as the first MAC address;

[0124] The second determination unit (not shown in the figure) is used to determine whether the IPv6 address belongs to the IPv6 address prefix if the second MAC address is the same as the first MAC address.

[0125] Optionally, the second IP packet further includes the link-local address of the user equipment, and the sending unit (not shown in the figure) is further configured to send a fourth IP packet to the user equipment, the fourth IP packet including the link-local address;

[0126] The apparatus further includes: a holding unit (not shown in the figure), configured to hold the main forwarding table entry and maintain the binding relationship between the main forwarding table entry and the sub-forwarding table entry if the receiving unit receives the fifth IP packet sent by the user equipment;

[0127] The sending unit (not shown in the figure) is further configured to, if the receiving unit does not receive the fifth IP packet sent by the user equipment, send the fourth IP packet to the user equipment again until the fifth IP packet is not received after a preset number of probes, and then delete the main forwarding table entry and the sub-forwarding table entry.

[0128] Optionally, the sending unit (not shown in the figure) is further configured to send a sixth IP packet to the user equipment, the sixth IP packet including the IPv6 address;

[0129] The holding unit (not shown in the figure) is further configured to, if the receiving unit receives the seventh IP packet sent by the user equipment, hold the sub-forwarding table entry and maintain the binding relationship between the sub-forwarding table entry and the main forwarding table entry;

[0130] The sending unit (not shown in the figure) is further configured to, if the receiving unit does not receive the seventh IP packet sent by the user equipment, send the sixth IP packet to the user equipment again until the seventh IP packet is not received after a preset number of probes, and then delete the sub-forwarding table entry.

[0131] Therefore, using the communication apparatus provided in this application, the BRAS device receives an authentication response message sent by the AAA server after authenticating the user equipment. This authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix. Based on the IPv6 address prefix, the BRAS device generates a main forwarding table entry, which also includes the IPv6 address prefix. The BRAS device receives a first IP packet sent by the user equipment, which includes the user equipment's IPv6 address. If the IPv6 address belongs to an IPv6 address prefix, the BRAS device generates a sub-forwarding table entry and establishes a binding relationship between the main forwarding table entry and the sub-forwarding table entry, which includes the IPv6 address.

[0132] Thus, when user equipment is configured with stateless IPv6 addresses, the BRAS device creates a main forwarding table entry and multiple sub-forwarding table entries locally by sharing a prefix. This ensures that any IPv6 address generated by the user equipment using the stateless IPv6 address configuration can communicate normally, avoiding network outages. Simultaneously, it also resolves the issue where existing IPv6 addresses, whose interface identifiers are randomly generated by the user terminal and do not match the forwarding information within the BRAS device, prevented the user terminal from accessing the network.

[0133] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 4 As shown, the system includes a processor 410, a transceiver 420, and a machine-readable storage medium 430. The machine-readable storage medium 430 stores machine-executable instructions that can be executed by the processor 410. The processor 410 is prompted by the machine-executable instructions to execute the communication method provided in the embodiments of this application. (The foregoing...) Figure 3 The communication device shown can be used as follows: Figure 4 The hardware structure of the network device shown is implemented.

[0134] The aforementioned computer-readable storage medium 430 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 430 may also be at least one storage device located remotely from the aforementioned processor 410.

[0135] The processor 410 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0136] In this embodiment of the application, the processor 410 reads the machine-executable instructions stored in the machine-readable storage medium 430, and is prompted by the machine-executable instructions to enable the processor 410 itself and the transceiver 420 to execute the communication method described in the foregoing embodiment of the application.

[0137] In addition, this application provides a machine-readable storage medium 430 that stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions cause the processor 410 itself and the transceiver 420 to execute the communication method described in the aforementioned application.

[0138] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0139] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0140] For the embodiments of communication devices and machine-readable storage media, since the methods involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.

[0141] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A communication method, characterized in that, Applied to BRAS devices, the method includes: The system receives an authentication response message sent by the AAA server after authenticating the user equipment. The authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix. A main forwarding table entry is generated based on the IPv6 address prefix, and the main forwarding table entry includes the IPv6 address prefix; Receive a first IP packet sent by the user equipment, wherein the first IP packet includes the IPv6 address of the user equipment; If the IPv6 address belongs to the IPv6 address prefix, a sub-forwarding table entry is generated, and a binding relationship is established between the main forwarding table entry and the sub-forwarding table entry. The sub-forwarding table entry includes the IPv6 address.

2. The method according to claim 1, characterized in that, Before receiving the authentication response message sent by the AAA server after authenticating the user equipment, the method further includes: Receive a second IP packet sent by the user equipment, the second IP packet including the first MAC address of the user terminal; Send an authentication request message to the AAA server, the authentication request message including the first MAC address, so that the AAA server can authenticate the user equipment and assign the IPv6 address prefix using the first MAC address; Before generating the main forwarding table entry corresponding to the user equipment based on the IPv6 address prefix, the method further includes: A third IP packet is sent to the user equipment, the third IP packet including the IPv6 address prefix, so that the user equipment generates the IPv6 address based on the IPv6 address prefix and its own generated interface identifier.

3. The method according to claim 2, characterized in that, The master forwarding table entry also includes the first MAC address; the first IP packet also includes the second MAC address of the user terminal; Before creating a sub-forwarding table entry corresponding to the user equipment if the IPv6 address belongs to the IPv6 address prefix, the method further includes: Determine whether the second MAC address is the same as the first MAC address; If the second MAC address is the same as the first MAC address, then determine whether the IPv6 address belongs to the IPv6 address prefix; If the second MAC address is different from the first MAC address, the second MAC address is recorded locally, and an authentication request message is generated again to initiate authentication to the AAA server.

4. The method according to claim 2, characterized in that, The second IP packet also includes the link-local address of the user equipment, and the method further includes: Send a fourth IP packet to the user equipment, the fourth IP packet including the link-local address; If a fifth IP packet is received from the user equipment, the main forwarding table entry is maintained, and the binding relationship between the main forwarding table entry and the sub-forwarding table entry is maintained; If the fifth IP packet sent by the user equipment is not received, the fourth IP packet is sent to the user equipment again until the fifth IP packet is not received after a preset number of probes, and then the main forwarding table entry and the sub-forwarding table entry are deleted.

5. The method according to claim 1, characterized in that, The method further includes: Send a sixth IP packet to the user equipment, the sixth IP packet including the IPv6 address; If a seventh IP packet is received from the user equipment, the sub-forwarding table entry is maintained, and the binding relationship between the sub-forwarding table entry and the main forwarding table entry is maintained; If the seventh IP packet sent by the user equipment is not received, the sixth IP packet is sent to the user equipment again until the seventh IP packet is not received after a preset number of probes, and then the sub-forwarding table entry is deleted.

6. A communication device, characterized in that, Applied to BRAS devices, the device includes: The receiving unit is configured to receive an authentication response message sent by the AAA server after authenticating the user equipment, wherein the authentication response message indicates that the user equipment has been successfully authenticated and includes an IPv6 address prefix. The generation unit is configured to generate a main forwarding table entry based on the IPv6 address prefix, wherein the main forwarding table entry includes the IPv6 address prefix; The receiving unit is further configured to receive a first IP packet sent by the user equipment, wherein the first IP packet includes the IPv6 address of the user equipment. The generation unit is further configured to, if the IPv6 address belongs to the IPv6 address prefix, generate a sub-forwarding table entry, wherein the sub-forwarding table entry includes the IPv6 address; A creation unit is used to establish the binding relationship between the main forwarding table entry and the sub-forwarding table entry.

7. The apparatus according to claim 6, characterized in that, The receiving unit is further configured to receive a second IP packet sent by the user equipment, the second IP packet including the first MAC address of the user terminal; The apparatus further includes: a sending unit, configured to send an authentication request message to the AAA server, the authentication request message including the first MAC address, so that the AAA server can authenticate the user equipment and allocate the IPv6 address prefix through the first MAC address; The sending unit is further configured to send a third IP packet to the user equipment, the third IP packet including the IPv6 address prefix, so that the user equipment generates the IPv6 address based on the IPv6 address prefix and its own generated interface identifier.

8. The apparatus according to claim 7, characterized in that, The master forwarding table entry also includes the first MAC address; the first IP packet also includes the second MAC address of the user terminal; The device further includes: The first judgment unit is used to determine whether the second MAC address is the same as the first MAC address; The second determination unit is used to determine whether the IPv6 address belongs to the IPv6 address prefix if the second MAC address is the same as the first MAC address; if the second MAC address is different from the first MAC address, the second MAC address is recorded locally, and an authentication request message is generated again to initiate authentication to the AAA server.

9. The apparatus according to claim 7, characterized in that, The second IP packet also includes the link-local address of the user equipment, and the sending unit is further configured to send a fourth IP packet to the user equipment, the fourth IP packet including the link-local address; The apparatus further includes: a holding unit, configured to hold the main forwarding table entry and maintain the binding relationship between the main forwarding table entry and the sub-forwarding table entry if the receiving unit receives a fifth IP packet sent by the user equipment; The sending unit is further configured to, if the receiving unit does not receive the fifth IP packet sent by the user equipment, send the fourth IP packet to the user equipment again until the fifth IP packet is not received after a preset number of probes, and then delete the main forwarding table entry and the sub-forwarding table entry.

10. The apparatus according to claim 9, characterized in that, The sending unit is further configured to send a sixth IP packet to the user equipment, the sixth IP packet including the IPv6 address; The holding unit is further configured to, if the receiving unit receives the seventh IP packet sent by the user equipment, hold the sub-forwarding table entry and maintain the binding relationship between the sub-forwarding table entry and the main forwarding table entry; The sending unit is further configured to, if the receiving unit does not receive the seventh IP packet sent by the user equipment, send the sixth IP packet to the user equipment again until the seventh IP packet is not received after a preset number of probes, and then delete the sub-forwarding table entry.