Communication method and device

By obtaining and updating the hardware user table entry to include the user-configured IPv6 address after the terminal negotiates with the IPv6CP of the access device, the problem that the PPPoE access method cannot support the online launch of the static IPv6 address is solved, simplifying the deployment process and improving efficiency .

CN115037566BActive Publication Date: 2024-11-12NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210432765.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-24
Publication Date
2024-11-12
Estimated Expiration
2042-04-24

AI Technical Summary

Technical Problem

The existing PPPoE access method cannot support terminals to go online by configuring static IPv6 addresses, resulting in the original IPv6 address planning being unusable, and needs to be re-planned and deployed, and deployment is complicated when there are too many static IPv6 address terminals.

Method used

After IPv6CP negotiation between the terminal and the access device, the terminal attribute information is obtained and the reporting flag is created, the reporting flag and attribute information is sent to the hardware driver, the hardware user table entry is generated, the PPPoE data packet is received and forwarded, and the hardware user table entry is updated. to include the IPv6 address configured by the user.

Benefits of technology

The static IPv6 address of the terminal is launched, simplifying the deployment process and avoiding dependence on AAA servers. It is easier to deploy in a large number of static address scenarios, and administrators do not need to specify a fixed address for each terminal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115037566B_ABST
    Figure CN115037566B_ABST
Patent Text Reader

Abstract

The present application provides a communication method and device, the method comprising: after IPv6CP negotiation with a terminal is passed, acquiring attribute information of the terminal and creating a reporting flag; sending the reporting flag and the attribute information of the terminal to a hardware driver, so that the hardware driver generates a hardware user table entry, the reporting flag enables the hardware driver to report the PPPoE data message when it is determined that the IPv6 address of the terminal is not included in the matching hardware user table entry after receiving the PPPoE data message sent by the terminal; receiving a first PPPoE data message sent by the hardware driver, the first PPPoE data message including the IPv6 address of the terminal; when the IPv6 address of the terminal is not stored, sending the IPv6 address of the terminal to the hardware driver, so that the hardware driver updates the hardware user table entry with the IPv6 address of the terminal, and forwards a second PPPoE data message according to the updated hardware user table entry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication method and device. Background Art

[0002] At present, IP over Ethernet (IP over Ethernet, IPoE) access authentication supports terminals to go online by configuring static addresses. When the terminal switches from IPoE access authentication to PPP over Ethernet (Point to Point Protocol over Ethernet, PPPoE) access authentication, according to the existing PPP protocol regulations, during the NCP negotiation process, IPv6CP negotiation is first performed. After the Internet Protocol version 6 Control Protocol (IPv6CP) negotiation is passed, the terminal can apply for an IPv6 address through DHCPv6. After the terminal obtains the IPv6 address, it initiates access authentication.

[0003] From the above process, it can be seen that the existing Point-to-Point Protocol (PPP) can only negotiate the IPv6 interface identifier during IPv6 negotiation, and cannot support the negotiation of IPv6 addresses and IPv6 DNS server addresses.

[0004] As a result, PPPoE access authentication cannot support the terminal going online by configuring a static IPv6 address, resulting in the original planned fixed IPv6 address being unusable and the need to re-plan and deploy the IPv6 address. If the terminal with a static IPv6 address is to be supported to go online, an IPv6 address authorized by the user is required, and the management personnel are also required to add authentication configuration in the authentication, authorization, and accounting (AAA) server, which makes the deployment cumbersome, especially when there are a large number of terminals using static IPv6 addresses. Summary of the invention

[0005] In view of this, the present application provides a communication method and apparatus to solve the problem that the existing PPPoE access method cannot realize the online access of a terminal configured with a static IPv6 address.

[0006] In a first aspect, the present application provides a communication method, the method comprising:

[0007] When the IPv6CP negotiation with the terminal is successful, obtaining attribute information of the terminal and creating a reporting flag;

[0008] Sending the reporting flag and the attribute information of the terminal to a hardware driver, so that the hardware driver generates a hardware user entry, wherein the hardware user entry includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data message when it is determined that the IPv6 address of the terminal is not included in the matching hardware user entry after receiving the PPPoE data message sent by the terminal;

[0009] Receiving a first PPPoE data message sent by the hardware driver, wherein the first PPPoE data message includes a source address, and the source address is an IPv6 address of the terminal configured by a user;

[0010] When it is determined that the IPv6 address of the terminal is not stored locally, the IPv6 address of the terminal is sent to the hardware driver, so that the hardware driver updates the hardware user table entry with the IPv6 address of the terminal, and when the hardware driver receives the second PPPoE data packet sent by the terminal again, the second PPPoE data packet is forwarded according to the updated hardware user table entry.

[0011] In a second aspect, the present application provides a communication device, the device comprising:

[0012] An acquiring unit, configured to acquire attribute information of the terminal and create a reporting flag after the IPv6CP negotiation with the terminal is successful;

[0013] a sending unit, configured to send the reporting flag and the attribute information of the terminal to a hardware driver, so that the hardware driver generates a hardware user entry, wherein the hardware user entry includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data message when it is determined that the IPv6 address of the terminal is not included in the matching hardware user entry after receiving the PPPoE data message sent by the terminal;

[0014] A receiving unit, configured to receive a first PPPoE data message sent by the hardware driver, wherein the first PPPoE data message includes a source address, and the source address is an IPv6 address of the terminal configured by a user;

[0015] The sending unit is further used to, when it is determined that the IPv6 address of the terminal is not stored locally, send the IPv6 address of the terminal to the hardware driver, so that the hardware driver updates the hardware user table entry using the IPv6 address of the terminal, and when the hardware driver receives the second PPPoE data packet sent by the terminal again, forward the second PPPoE data packet according to the updated hardware user table entry.

[0016] In a third aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.

[0017] Therefore, by applying the communication method and device provided by the present application, when the IPv6CP negotiation with the terminal is passed, the CPU obtains the attribute information of the terminal and creates a reporting flag; the CPU sends the reporting flag and the attribute information of the terminal to the hardware driver, so that the hardware driver generates a hardware user table item, the hardware user table item includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data message when it is determined that the matching hardware user table item does not include the IPv6 address of the terminal after receiving the PPPoE data message sent by the terminal; the CPU receives a first PPPoE data message sent by the hardware driver, the first PPPoE data message includes a source address, and the source address is the IPv6 address of the terminal configured by the user; the CPU sends the IPv6 address of the terminal to the hardware driver, so that the hardware driver updates the hardware user table item with the IPv6 address of the terminal, and when the hardware driver receives a second PPPoE data message sent by the terminal again, the second PPPoE data message is forwarded according to the updated hardware user table item.

[0018] In this way, the problem that the existing PPPoE access method cannot realize the online access of terminals configured with static IPv6 addresses is solved. For scenarios where static addresses are used in large quantities, the communication method and device provided by this application are simpler to deploy than the method of authorizing static addresses through AAA servers, and there is no need to specify a fixed address for each terminal; for scenarios where terminals switch access authentication methods, managers do not need to send static address configurations to AAA servers, and deployment is more convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A flow chart of a communication method provided in an embodiment of the present application;

[0020] Figure 2 The PPPoE access authentication method provided in the embodiment of the present application supports the signaling diagram of the terminal going online with a static IPv6 address;

[0021] Figure 3 A structural diagram of a communication device provided in an embodiment of the present application;

[0022] Figure 4 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION

[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0024] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.

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

[0026] The communication method provided in the embodiment of the present application is described in detail below. Figure 1 , Figure 1 Flow chart of the communication method provided by the embodiment of the present application. The method is applied to an access device, which may be a CPU of the access device. The access device may support PPPoE server functions, which may be a network device such as Bras and routers. The communication method provided by the embodiment of the present application may include the following steps.

[0027] Step 110: After the IPv6CP negotiation with the terminal is successful, the attribute information of the terminal is obtained and a reporting flag is created.

[0028] Specifically, the terminal pre-accesses the network. Before accessing the network, the access device will perform access authentication on the terminal. In the embodiment of the present application, the terminal supports PPPoE access authentication.

[0029] The terminal generates and sends a PPPoE discovery message to the access device, and after completing the interaction of four PPPoE messages (the above four messages are all protocol messages) with the access device, enters the PPP link control protocol (English: Link Control Protocol, abbreviated as: LCP) negotiation phase.

[0030] It is understandable that the access device includes hardware components such as ports and forwarding chips. When the port receives a PPPoE discovery message sent by a terminal, it is sent to the forwarding chip for processing. When the forwarding chip identifies the message as a protocol message, it sends the protocol message to the CPU for processing.

[0031] In the above process, after the terminal and the CPU complete the interaction of four PPPoE messages (the above four messages are all protocol messages), they enter the LCP negotiation phase of PPP.

[0032] In the LCP negotiation phase, the terminal generates and sends a third PPPoE data message to the access device (the PPPoE data message is referred to as the third PPPoE data message, and the above PPPoE data message may also be referred to as the first PPPoE data message and the second PPPoE data message). The third PPPoE data message includes a PPP LCP negotiation message (the above PPP LCP negotiation message is a protocol message).

[0033] Similarly, when the port receives the third PPPoE data message sent by the terminal, the port sends it to the forwarding chip for processing. When the forwarding chip recognizes that the message includes a protocol message, the third PPPoE data message is sent to the CPU for processing.

[0034] After receiving the third PPPoE data message, the CPU obtains the PPP LCP negotiation message from it and performs LCP negotiation with the terminal. When the LCP negotiation is successful, the link between the access device and the terminal has been established. The access device initiates authentication to the AAA server. The access device sends an authentication request to the AAA server. The AAA server authenticates the user name and password of the terminal. If the authentication is successful, the AAA server sends an authentication response to the access server to notify the access device that the terminal has passed the authentication.

[0035] After the terminal passes the authentication, it enters the PPP network control protocol (English: Network Control Protocol, referred to as: NCP) negotiation phase (that is, entering the PPP IPv6CP negotiation).

[0036] In the IPv6CP negotiation phase, the terminal generates and sends a fourth PPPoE data message to the access device (the PPPoE data message is referred to as the fourth PPPoE data message, and the above PPPoE data message may also be referred to as the first PPPoE data message, the second PPPoE data message, and the third PPPoE data message). The fourth PPPoE data message includes a PPP IPv6CP negotiation message (the above PPP IPv6CP negotiation message is a protocol message).

[0037] Similarly, when the port receives the fourth PPPoE data message sent by the terminal, the port sends it to the forwarding chip for processing. When the forwarding chip identifies that the message includes a protocol message, the fourth PPPoE data message is sent to the CPU for processing.

[0038] After receiving the fourth PPPoE data message, the CPU obtains the PPP IPv6CP negotiation message from it and performs IPv6CP negotiation with the terminal. When the IPc6CP negotiation is successful, the network layer of the link between the access device and the terminal is UP, and the link can carry IPv6 messages.

[0039] The CPU obtains the attribute information of the terminal and creates a reporting flag. The CPU can obtain and record the attribute information of the terminal by receiving a PPPoE Discovery message sent by the terminal during the discovery phase.

[0040] The attribute information of the terminal includes the MAC address of the terminal, the VLAN identifier of the VLAN to which the terminal belongs, and the session identifier of the session established with the terminal.

[0041] The reporting flag is a special identifier that can be implemented in the form of letters, character strings, etc., and is used to enable the hardware driver to report the PPPoE data message after receiving the PPPoE data message sent by the terminal and determining that the matching hardware user table does not include the IPv6 address of the terminal.

[0042] In the embodiment of the present application, after the IPv6CP negotiation is successful, the CPU does not obtain the IPv6 address of the terminal.

[0043] In the embodiments of the present application, the discovery phase, PPP LCP negotiation, and IPv6CP negotiation between the terminal and the access device can all be implemented by referring to the existing discovery and negotiation, and will not be repeated here.

[0044] Step 120: Send a reporting flag and the attribute information of the terminal to the hardware driver, so that the hardware driver generates a hardware user table entry, the hardware user table entry includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data packet after receiving the PPPoE data packet sent by the terminal and determining that the IPv6 address of the terminal is not included in the matching hardware user table entry.

[0045] Specifically, according to the description of step 110, after the CPU obtains the attribute information of the terminal and creates a reporting flag, it sends the reporting flag and the attribute information of the terminal to the hardware driver.

[0046] Optionally, before this step, the embodiment of the present application also includes a process in which the CPU generates a software user table entry.

[0047] According to the attribute information of the terminal, the CPU generates a software user table entry, which includes an IP address field, a MAC address field, a VLAN ID field, and a session attribute field.

[0048] The CPU fills the value of the MAC address field with the MAC address of the terminal, fills the value of the VLAN ID field with the VLAN ID, and fills the value of the session attribute field with the session ID. The value of the IP address field is left blank.

[0049] After receiving the report flag and the terminal's attribute information, the hardware driver generates a hardware user entry, which includes an IP address field, a MAC address field, a VLAN ID field, and a session attribute field.

[0050] The hardware driver fills the value of the MAC address field with the MAC address of the terminal, fills the value of the VLAN ID field with the VLAN ID, and fills the value of the session attribute field with the session ID. The value of the IP address field is empty.

[0051] According to the reporting flag, after the hardware driver determines that it has received the PPPoE data packet sent by the terminal and the source address included in the PPPoE data packet is the configured static IPv6 address, since the IPv6 address of the terminal is not included in the hardware user table entry, the hardware driver cannot forward it according to the existing table lookup forwarding method. Therefore, the hardware driver reports the PPPoE data packet to the CPU for processing.

[0052] At this time, if the terminal has been configured with a static IPv6 address by the user, and uses the IPv6 address as the source address to access the gateway device or the external network, the terminal generates and sends a first PPPoE data message to the access device (the PPPoE data message is referred to as the first PPPoE data message, and the above PPPoE data message may also be referred to as the second PPPoE data message or the third PPPoE data message). The first PPPoE data message includes a PPP message, and the PPP message includes an IP message (specifically an IPv6 message). The IP message includes a source address, and the source address is the static IPv6 address configured by the user.

[0053] After receiving the first PPPoE data message, the hardware driver obtains the MAC address, VLAN ID, and session ID of the terminal, that is, obtains the attribute information of the terminal. According to the attribute information of the terminal obtained above, the hardware driver searches for a matching hardware user table entry. The hardware driver determines that the IPv6 address of the terminal is not stored in the hardware user table entry, and the hardware driver sends the first PPPoE data message to the CPU for processing by the CPU.

[0054] Step 130: Receive a first PPPoE data message sent by the hardware driver, wherein the first PPPoE data message includes a source address, and the source address is the IPv6 address of the terminal configured by the user.

[0055] Specifically, according to the description of step 120, after receiving the first PPPoE data message, the CPU strips off the outer Ethernet header, obtains the inner message (i.e., PPP message), and obtains the source address field from the IP message included in the PPP message. The CPU obtains the IPv6 address of the terminal from the source address field.

[0056] After the CPU obtains the IPv6 address of the terminal, it determines whether the IPv6 address of the terminal is stored in the software user entry. If it is determined that the IPv6 address of the terminal is not stored in the local software user entry, step 140 is executed.

[0057] Step 140: When it is determined that the IPv6 address of the terminal is not stored locally, the IPv6 address of the terminal is sent to the hardware driver, so that the hardware driver updates the hardware user table entry with the IPv6 address of the terminal, and when the hardware driver receives the second PPPoE data packet sent by the terminal again, the second PPPoE data packet is forwarded according to the updated hardware user table entry.

[0058] Specifically, according to the description of step 140, when it is determined that the IPv6 address of the terminal is not stored locally, the CPU sends the IPv6 address of the terminal to the hardware driver.

[0059] After receiving the IPv6 address of the terminal, the hardware driver updates the value of the IP address field in the hardware user entry to the IPv6 address of the terminal, and obtains an updated hardware user entry.

[0060] Subsequently, when the hardware driver receives the second PPPoE data message sent by the terminal again, the hardware driver directly forwards the second PPPoE data message to the gateway device or the external network according to the updated hardware user table entry. It can be understood that the second PPPoE data message includes a PPP message, and the PPP message includes an IP message. The IP message includes a source address, and the source address is a static IPv6 address configured by the user.

[0061] Optionally, before the CPU sends the IPv6 address of the terminal to the hardware driver, the embodiment of the present application also includes a process in which the CPU updates the software user table entry.

[0062] The CPU updates the value of the IP address field to the IPv6 address of the terminal, and obtains an updated software user table entry.

[0063] Therefore, by applying the communication method provided by the present application, when the IPv6CP negotiation with the terminal is passed, the CPU obtains the attribute information of the terminal and creates a reporting flag; the CPU sends the reporting flag and the attribute information of the terminal to the hardware driver, so that the hardware driver generates a hardware user table item, the hardware user table item includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data message when it is determined that the IPv6 address of the terminal is not included in the matching hardware user table item after receiving the PPPoE data message sent by the terminal; the CPU receives a first PPPoE data message sent by the hardware driver, the first PPPoE data message includes a source address, and the source address is the IPv6 address of the terminal configured by the user; the CPU sends the IPv6 address of the terminal to the hardware driver, so that the hardware driver updates the hardware user table item with the IPv6 address of the terminal, and when the hardware driver receives the second PPPoE data message sent by the terminal again, the second PPPoE data message is forwarded according to the updated hardware user table item.

[0064] In this way, the problem that the existing PPPoE access method cannot realize the online access of terminals configured with static IPv6 addresses is solved. For scenarios where static addresses are used in large quantities, the communication method and device provided by this application are simpler to deploy than the method of authorizing static addresses through AAA servers, and there is no need to specify a fixed address for each terminal; for scenarios where terminals switch access authentication methods, managers do not need to send static address configurations to AAA servers, and deployment is more convenient.

[0065] Below through Figure 2 The communication method provided in the embodiment of the present application is described in detail. Figure 2, Figure 2 The PPPoE access authentication method provided in the embodiment of the present application supports the signaling diagram for the terminal going online with a static IPv6 address.

[0066] exist Figure 2 In the example, the terminal pre-accesses the network. Before accessing the network, the access device will perform access authentication on the terminal. In the embodiment of the present application, the terminal supports PPPoE access authentication.

[0067] The terminal generates and sends a PPPoE Discovery message to the access device, and after completing the interaction of four PPPoE messages (the above four messages are all protocol messages) with the access device, enters the LCP negotiation phase of PPP.

[0068] In the LCP negotiation stage, the terminal generates and sends a first PPPoE data message to the access device. The first PPPoE data message includes a PPP LCP negotiation message (the PPP LCP negotiation message is a protocol message).

[0069] After receiving the first PPPoE data message, the CPU obtains the PPP LCP negotiation message from it and performs LCP negotiation with the terminal. When the LCP negotiation is successful, the link between the access device and the terminal has been established. The access device initiates authentication to the AAA server. The access device sends an authentication request to the AAA server. The AAA server authenticates the user name and password of the terminal. If the authentication is successful, the AAA server sends an authentication response to the access server to notify the access device that the terminal has passed the authentication.

[0070] After the terminal passes authentication, it enters the NCP negotiation phase of PPP (that is, it enters the IPv6CP negotiation phase of PPP).

[0071] In the IPv6CP negotiation phase, the terminal generates and sends a second PPPoE data message to the access device. The second PPPoE data message includes a PPP IPv6CP negotiation message (the PPP IPv6CP negotiation message is a protocol message).

[0072] After receiving the second PPPoE data message and obtaining the PPP IPv6CP negotiation message from it, the CPU performs IPv6CP negotiation with the terminal. When the IPc6CP negotiation is successful, the network layer of the link between the access device and the terminal is UP, and the link can carry IPv6 messages.

[0073] The CPU obtains the attribute information of the terminal and creates a reporting flag. The CPU can obtain and record the attribute information of the terminal by receiving a PPPoE Discovery message sent by the terminal during the discovery phase.

[0074] In the embodiments of the present application, the discovery phase, PPP LCP negotiation, and IPv6CP negotiation between the terminal and the access device can all be implemented by referring to the existing discovery and negotiation, and will not be repeated here.

[0075] It should be noted that after the IPv6CP negotiation is successful, the CPU does not obtain the IPv6 address of the terminal.

[0076] According to the attribute information of the terminal, the CPU generates a software user table entry, which includes an IP address field, a MAC address field, a VLAN ID field, and a session attribute field.

[0077] The CPU fills the value of the MAC address field with the MAC address of the terminal, fills the value of the VLAN ID field with the VLAN ID, and fills the value of the session attribute field with the session ID. The value of the IP address field is left blank.

[0078] After the CPU obtains the attribute information of the terminal and creates a reporting flag, it sends the reporting flag and the attribute information of the terminal to the hardware driver.

[0079] After receiving the report flag and the terminal's attribute information, the hardware driver generates a hardware user entry, which includes an IP address field, a MAC address field, a VLAN ID field, and a session attribute field.

[0080] The hardware driver fills the value of the MAC address field with the MAC address of the terminal, fills the value of the VLAN ID field with the VLAN ID, and fills the value of the session attribute field with the session ID. The value of the IP address field is empty.

[0081] According to the reporting flag, after the hardware driver determines that the PPPoE data message sent by the terminal is received and the source address included in the PPPoE data message is the configured static IPv6 address, since the IPv6 address of the terminal is not included in the hardware user table entry, the hardware driver cannot forward it according to the existing table lookup forwarding method. Therefore, the hardware driver reports the inner layer message included in the PPPoE data message to the CPU for processing.

[0082] At this time, if the terminal has been configured with a static IPv6 address by the user, and uses the IPv6 address as the source address to access the gateway device or the external network, the terminal generates and sends a third PPPoE data message to the access device. The third PPPoE data message includes a PPP message, and the PPP message includes an IP message. The IP message includes a source address, and the source address is the static IPv6 address configured by the user.

[0083] After receiving the third PPPoE data message, the hardware driver obtains the MAC address, VLAN ID, and session ID of the terminal, that is, obtains the attribute information of the terminal. According to the attribute information of the terminal obtained above, the hardware driver searches for a matching hardware user table entry. The hardware driver determines that the IPv6 address of the terminal is not stored in the hardware user table entry, and the hardware driver sends the third PPPoE data message to the CPU for processing by the CPU.

[0084] After receiving the first PPPoE data message, the CPU strips off the outer Ethernet header, obtains the inner message (ie, PPP message), and obtains the source address field from the IP message included in the PPP message. The CPU obtains the IPv6 address of the terminal from the source address field.

[0085] After the CPU obtains the IPv6 address of the terminal, it determines whether the IPv6 address of the terminal is stored in the software user entry. If it is determined that the IPv6 address of the terminal is not stored in the local software user entry, the CPU updates the value of the IP address field to the IPv6 address of the terminal to obtain an updated software user entry. At the same time, the CPU also sends the IPv6 address of the terminal to the hardware driver.

[0086] After receiving the IPv6 address of the terminal, the hardware driver updates the value of the IP address field in the hardware user entry to the IPv6 address of the terminal, and obtains an updated hardware user entry.

[0087] Subsequently, when the hardware driver receives the fourth PPPoE data message sent by the terminal again, the hardware driver directly forwards the fourth PPPoE data message to the gateway device or the external network according to the updated hardware user table entry. It can be understood that the fourth PPPoE data message includes a PPP message, and the PPP message includes an IP message. The IP message includes a source address, and the source address is a static IPv6 address configured by the user.

[0088] Based on the same inventive concept, the embodiment of the present application also provides a communication device corresponding to the communication method.

[0089] See also Figure 3 , Figure 3 A communication device provided in an embodiment of the present application includes:

[0090] The acquiring unit 310 is configured to acquire attribute information of the terminal and create a reporting flag after the IPv6CP negotiation with the terminal is successful;

[0091] A sending unit 320, configured to send the reporting flag and the attribute information of the terminal to the hardware driver, so that the hardware driver generates a hardware user entry, wherein the hardware user entry includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data message when it is determined that the IPv6 address of the terminal is not included in the matching hardware user entry after receiving the PPPoE data message sent by the terminal;

[0092] A receiving unit 330, configured to receive a first PPPoE data message sent by the hardware driver, wherein the first PPPoE data message includes a source address, and the source address is an IPv6 address of the terminal configured by a user;

[0093] The sending unit 320 is also used to, when it is determined that the IPv6 address of the terminal is not stored locally, send the IPv6 address of the terminal to the hardware driver, so that the hardware driver updates the hardware user table entry using the IPv6 address of the terminal, and when the hardware driver receives the second PPPoE data packet sent by the terminal again, forward the second PPPoE data packet according to the updated hardware user table entry.

[0094] Optionally, the hardware user table entry includes an IP address field, a MAC address field, a VLAN ID field, and a session attribute field;

[0095] The attribute information of the terminal includes the MAC address of the terminal, the VLAN identifier of the VLAN to which the terminal belongs, and the session identifier of the session established with the terminal;

[0096] The value of the IP address field is empty, the value of the MAC address field is the MAC address of the terminal, the value of the VLAN ID field is the VLAN ID, and the value of the session attribute field is the session ID.

[0097] Optionally, the device further comprises: a generating unit (not shown in the figure), configured to generate a software user entry according to the attribute information of the terminal, wherein the software user entry comprises the attribute information of the terminal;

[0098] The software user table entry includes an IP address field, a MAC address field, a VLAN identification field, and a session attribute field;

[0099] The value of the IP address field is empty, the value of the MAC address field is the MAC address of the terminal, the value of the VLAN ID field is the VLAN ID, and the value of the session attribute field is the session ID.

[0100] Optionally, the device further includes: an updating unit (not shown in the figure), configured to update the value of the IP address field to the IPv6 address of the terminal, to obtain the updated software user entry.

[0101] Optionally, the value of the IP field included in the updated hardware user table entry is the IPv6 address of the terminal.

[0102] Therefore, by applying the communication device provided by the present application, when the IPv6CP negotiation with the terminal is passed, the CPU obtains the attribute information of the terminal and creates a reporting flag; the CPU sends the reporting flag and the attribute information of the terminal to the hardware driver, so that the hardware driver generates a hardware user table item, the hardware user table item includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to receive a PPPoE data message sent by the terminal, and when it is determined that the matching hardware user table item does not include the IPv6 address of the terminal, the inner message included in the PPPoE data message is reported; the CPU receives an inner message sent by the hardware driver and carried by the first PPPoE data message, the inner message includes a source address, and the source address is the IPv6 address of the terminal configured by the user; the CPU sends the IPv6 address of the terminal to the hardware driver, so that the hardware driver updates the hardware user table item with the IPv6 address of the terminal, and when the hardware driver receives a second PPPoE data message sent by the terminal again, the second PPPoE data message is forwarded according to the updated hardware user table item.

[0103] In this way, the problem that the existing PPPoE access method cannot realize the online access of terminals configured with static IPv6 addresses is solved. For scenarios where static addresses are used in large quantities, the communication method and device provided by this application are simpler to deploy than the method of authorizing static addresses through AAA servers, and there is no need to specify a fixed address for each terminal; for scenarios where terminals switch access authentication methods, managers do not need to send static address configurations to AAA servers, and deployment is more convenient.

[0104] Based on the same inventive concept, the embodiment of the present application also provides a network device, such as Figure 4 As shown, it 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, and the processor 410 is prompted by the machine-executable instructions to execute the communication method provided in the embodiment of the present application. Figure 3 The communication device shown can be used as Figure 4 The network device hardware structure shown is implemented.

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

[0106] The processor 410 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may 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 gates or transistor logic devices, or discrete hardware components.

[0107] In the embodiment of the present application, the processor 410 reads the machine executable instructions stored in the machine readable storage medium 430, and the machine executable instructions enable the processor 410 itself and the transceiver 420 to execute the communication method described in the aforementioned embodiment of the present application.

[0108] In addition, an embodiment of the present application provides a machine-readable storage medium 430, which stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions prompt the processor 410 itself and the calling transceiver 420 to execute the communication method described in the aforementioned embodiment of the present application.

[0109] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0110] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0111] As for the communication device and machine-readable storage medium embodiments, since the method contents involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0112] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A communication method, characterized in that: The method comprises: When the IPv6CP negotiation with the terminal is successful, obtaining attribute information of the terminal and creating a reporting flag; Sending the reporting flag and the attribute information of the terminal to a hardware driver, so that the hardware driver generates a hardware user entry, wherein the hardware user entry includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data message when it is determined that the IPv6 address of the terminal is not included in the matching hardware user entry after receiving the PPPoE data message sent by the terminal; Receiving a first PPPoE data message sent by the hardware driver, wherein the first PPPoE data message includes a source address, and the source address is an IPv6 address of the terminal configured by a user; When it is determined that the IPv6 address of the terminal is not stored locally, the IPv6 address of the terminal is sent to the hardware driver, so that the hardware driver updates the hardware user table entry with the IPv6 address of the terminal, and when the hardware driver receives the second PPPoE data packet sent by the terminal again, the second PPPoE data packet is forwarded according to the updated hardware user table entry.

2. The method according to claim 1, characterized in that: The hardware user table entry includes an IP address field, a MAC address field, a VLAN identification field, and a session attribute field; The attribute information of the terminal includes the MAC address of the terminal, the VLAN identifier of the VLAN to which the terminal belongs, and the session identifier of the session established with the terminal; The value of the IP address field is empty, the value of the MAC address field is the MAC address of the terminal, the value of the VLAN ID field is the VLAN ID, and the value of the session attribute field is the session ID.

3. The method according to claim 2, characterized in that Before sending the reporting flag and the attribute information of the terminal to the hardware driver, the method further includes: Generate a software user entry according to the attribute information of the terminal, wherein the software user entry includes the attribute information of the terminal; The software user table entry includes an IP address field, a MAC address field, a VLAN identification field, and a session attribute field; The value of the IP address field is empty, the value of the MAC address field is the MAC address of the terminal, the value of the VLAN ID field is the VLAN ID, and the value of the session attribute field is the session ID.

4. The method according to claim 3, characterized in that After sending the IPv6 address of the terminal to the hardware driver, the method further includes: The value of the IP address field is updated to the IPv6 address of the terminal to obtain the updated software user table entry.

5. The method according to claim 2, characterized in that: The value of the IP field included in the updated hardware user table entry is the IPv6 address of the terminal.

6. A communication device, characterized in that: The device comprises: An acquiring unit, configured to acquire attribute information of the terminal and create a reporting flag after the IPv6CP negotiation with the terminal is successful; a sending unit, configured to send the reporting flag and the attribute information of the terminal to a hardware driver, so that the hardware driver generates a hardware user entry, wherein the hardware user entry includes the attribute information of the terminal, and the reporting flag is used to enable the hardware driver to report the PPPoE data message when it is determined that the IPv6 address of the terminal is not included in the matching hardware user entry after receiving the PPPoE data message sent by the terminal; A receiving unit, configured to receive a first PPPoE data message sent by the hardware driver, wherein the first PPPoE data message includes a source address, and the source address is an IPv6 address of the terminal configured by a user; The sending unit is further used to, when it is determined that the IPv6 address of the terminal is not stored locally, send the IPv6 address of the terminal to the hardware driver, so that the hardware driver updates the hardware user table entry using the IPv6 address of the terminal, and when the hardware driver receives the second PPPoE data packet sent by the terminal again, forward the second PPPoE data packet according to the updated hardware user table entry.

7. The device according to claim 6, characterized in that The hardware user table entry includes an IP address field, a MAC address field, a VLAN identification field, and a session attribute field; The attribute information of the terminal includes the MAC address of the terminal, the VLAN identifier of the VLAN to which the terminal belongs, and the session identifier of the session established with the terminal; The value of the IP address field is empty, the value of the MAC address field is the MAC address of the terminal, the value of the VLAN ID field is the VLAN ID, and the value of the session attribute field is the session ID.

8. The device according to claim 7, characterized in that The device also includes: A generating unit, configured to generate a software user entry according to the attribute information of the terminal, wherein the software user entry includes the attribute information of the terminal; The software user table entry includes an IP address field, a MAC address field, a VLAN identification field, and a session attribute field; The value of the IP address field is empty, the value of the MAC address field is the MAC address of the terminal, the value of the VLAN ID field is the VLAN ID, and the value of the session attribute field is the session ID.

9. The device according to claim 8, characterized in that The device also includes: An updating unit is used to update the value of the IP address field to the IPv6 address of the terminal to obtain the updated software user table entry.

10. The device according to claim 7, characterized in that The value of the IP field included in the updated hardware user table entry is the IPv6 address of the terminal.