A negotiation message processing method, device and equipment and a storage medium

CN123020489APending Publication Date: 2026-10-30RUIJIE NETWORKS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510570238.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2026-10-30

Smart Images

  • Figure CN123020489A_ABST
    Figure CN123020489A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of communication, in particular to a negotiation message processing method and device, equipment and a storage medium. The method comprises the following steps: for a plurality of received negotiation messages, a forwarding unit distributes negotiation messages belonging to the same session to a first packet receiving queue; when the first packet receiving queue meets a packaging condition, the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first packet receiving queue; and the forwarding unit sends the aggregated negotiation message to a control unit.
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 negotiation message processing method, apparatus, device and storage medium. Background Technology

[0002] In communication equipment, the forwarding plane is responsible for the rapid forwarding and switching of data packets, while the control plane focuses on protocol processing, route calculation, and policy decisions. The forwarding plane typically handles ordinary forwarding messages, but negotiation messages need to be sent to the control plane for processing.

[0003] During implementation, negotiation messages are transmitted between the forwarding plane and the control plane through a pathway. Summary of the Invention

[0004] Exemplary embodiments of the present invention provide a negotiation message processing method, apparatus, device, and storage medium.

[0005] In a first aspect, embodiments of this application provide a negotiation message processing method, the method comprising:

[0006] For multiple received negotiation messages, the forwarding unit allocates the negotiation messages of the same session to the first receiving queue;

[0007] When the first receiving queue meets the packet packaging conditions, the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first receiving queue;

[0008] The forwarding unit sends the aggregation negotiation message to the control unit.

[0009] This application embodiment enhances the management capability for multiple sessions by pre-setting a packet sending queue in the forwarding unit and allocating negotiation messages belonging to one session to the first packet receiving queue for packaging. This facilitates the management of negotiation messages from multiple sessions in high-capacity scenarios. Furthermore, by managing packets in units of queues, compared to the traditional approach of directly transmitting each negotiation message, the transmission performance of the path can be effectively guaranteed.

[0010] In one possible implementation, the forwarding unit is configured with multiple receive queues, each receiving queue having a unique queue identifier; the forwarding unit allocates negotiation messages for the same session to the first receive queue, including:

[0011] For each of the plurality of negotiation messages, perform the following operations:

[0012] The forwarding unit determines the first receiving queue from the plurality of receiving queues based on the session identifier carried in the negotiation message; the session identifier is used to indicate the session to which the negotiation message belongs;

[0013] The forwarding unit allocates the negotiation message to the first receiving queue.

[0014] In the process of allocating the session identifier carried in the negotiation message in the embodiments of this application, since the session identifiers of the negotiation messages in a session are the same, the negotiation messages of the same session can be allocated to a first receiving queue.

[0015] One possible implementation is that the forwarding unit determines a first receive queue from the plurality of receive queues based on the session identifier carried in the negotiation message, including:

[0016] The forwarding unit determines the allocation identifier of the negotiation message based on the session identifier carried in the negotiation message;

[0017] The receiving queue whose queue identifier is the same as the allocation identifier among the plurality of receiving queues is determined as the first receiving queue.

[0018] In this embodiment, the allocation identifier of the negotiation message is determined based on the session identifier carried in the negotiation message, and the first receiving queue of the negotiation message is determined according to the allocation identifier of the negotiation message and the queue identifier of each receiving queue, so that negotiation messages of the same session are allocated to a first receiving queue.

[0019] One possible implementation is that the forwarding unit determines a first receive queue from the plurality of receive queues based on the session identifier carried in the negotiation message, including:

[0020] The forwarding unit queries the stored mapping relationship between session identifiers and packet receiving queues to see if it contains a first session identifier, wherein the first session identifier is the session identifier carried by the negotiation message.

[0021] If the first session identifier is included, the forwarding unit determines the receiving queue corresponding to the first session identifier as the first receiving queue based on the mapping relationship between the session identifier and the receiving queue;

[0022] If the first session identifier is not included, the forwarding unit determines the allocation identifier of the negotiation message based on the session identifier carried in the negotiation message; and determines the receiving queue whose queue identifier is the same as the allocation identifier among the plurality of receiving queues as the first receiving queue.

[0023] This application embodiment, by storing the mapping relationship between session identifiers and receive queues, can quickly determine the first receive queue by querying the mapping relationship after receiving the first session identifier. Furthermore, if the number of receive queues changes, negotiation messages from the same session can be assigned to a single first receive queue.

[0024] In one possible implementation, the forwarding unit determines the allocation identifier of the negotiation message based on the session identifier carried in the negotiation message, including:

[0025] The forwarding unit performs a modulo operation on the number of configured receive queues based on the session identifier of the negotiation message to obtain the allocation identifier of the negotiation message.

[0026] This application embodiment can conveniently and quickly obtain the allocation identifier of the negotiation message by performing a remainder operation on the number of the configured first receiving queue based on the session identifier of the negotiation message.

[0027] One possible implementation involves determining that the first receiving queue meets the packing conditions through at least one of the following methods:

[0028] The packet receiving time of the first packet receiving queue has reached the preset time.

[0029] The length of the negotiation messages contained in the first packet receiving queue is greater than or equal to a preset length.

[0030] This embodiment of the application determines that the first packet receiving queue meets the packetization condition based on the packet receiving time reaching a preset time, which can ensure the timeliness of messages. Determining that the first packet receiving queue meets the packetization condition based on the length of the negotiated messages contained in the first packet receiving queue being greater than or equal to a preset length can avoid network transmission performance degradation due to excessively long messages.

[0031] In one possible implementation, the negotiation message in the first receiving queue includes a message header and a data portion; the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first receiving queue, including:

[0032] The forwarding unit combines the data portions of each negotiated message in the first receiving queue to obtain aggregated data;

[0033] The forwarding unit determines the private header of the aggregation negotiation message based on the first queue identifier of the first receiving queue and the aggregation data;

[0034] The forwarding unit generates the aggregation negotiation message based on the message header, the private header of the aggregation negotiation message, and the aggregation data.

[0035] The embodiments of this application combine data portions to obtain aggregated data, which can reduce the amount of data transmitted in the message and reduce the transmission pressure on the path.

[0036] One possible implementation, wherein determining the private header of the aggregation negotiation message based on the first queue identifier of the first receiving queue and the aggregation data includes:

[0037] The forwarding unit determines the target thread identifier based on the first queue identifier of the first receiving queue, and the target thread identifier is used to indicate the target thread in the control unit that processes the aggregation negotiation message;

[0038] The forwarding unit determines aggregated data information based on the aggregated data, and the aggregated data information includes the number of packets in the aggregated data and / or the length of the packets in the aggregated data;

[0039] The private header of the aggregation negotiation message is determined based on the target thread identifier and the aggregation data information.

[0040] The private header of the aggregated message in this embodiment includes a target thread identifier and aggregated data information; wherein, the target thread identifier is determined according to the first queue identifier of the first receiving queue, and the target thread identifier is used to indicate the target thread in the control unit that processes the aggregated negotiation message, and the aggregated data information includes the number of messages in the aggregated data and / or the message length in the aggregated data.

[0041] In this embodiment of the application, when the control unit is configured with multiple threads, each thread is used to process the aggregation negotiation message sent by a packet receiving queue. Thus, the negotiation message of a session will be processed by one thread, enabling the thread to obtain all the processing results of the session without having to obtain them from other threads. This reduces the context switching process and improves the processing efficiency of the control unit.

[0042] In one possible implementation, the negotiation message includes a header and a data portion, the data portion including a session identifier for the negotiation message; after the received plurality of negotiation messages, the method further includes:

[0043] For each of the plurality of negotiation messages, the forwarding unit stores the message header of the negotiation message and the mapping relationship between the message header and the session identifier of the negotiation message;

[0044] After sending the aggregation negotiation message to the control unit, the method further includes:

[0045] The forwarding unit receives the aggregated response message sent by the control unit and splits the aggregated response message into multiple messages;

[0046] For each of the plurality of messages, the forwarding unit combines the message header corresponding to the second session identifier with the message based on the second session identifier carried in the message and the stored mapping relationship between message headers and session identifiers, to generate a target response message.

[0047] This application embodiment, by storing the message header of the negotiation message and the mapping relationship between the message header and the session identifier of the negotiation message, can generate a complete target response message corresponding to each message after receiving the aggregate response message sent by the control unit, by splitting the aggregate response message into multiple messages and determining the message header corresponding to each message based on the second session identifier carried by each message.

[0048] In one possible implementation, the forwarding plane is further configured with multiple packet sending queues; after the receiving control unit sends the aggregated response message and before splitting the aggregated response message into multiple messages, the method further includes:

[0049] The forwarding unit determines the first packet sending queue from the plurality of packet sending queues based on the target thread identifier carried in the aggregated response message, and assigns the aggregated response message to the first packet sending queue.

[0050] Based on the target thread identifier carried in the aggregated response message, the embodiments of this application determine the first packet sending queue, which can standardize the processing flow of the forwarding plane and quickly determine the packet sending queue in the forwarding plane that processes the aggregated response message.

[0051] In one possible implementation, each of the plurality of packet sending queues has a unique queue identifier; determining the first packet sending queue from the plurality of packet sending queues based on the target thread identifier carried in the aggregated response message includes:

[0052] The forwarding unit determines the packet queue corresponding to the target thread identifier as the first packet queue based on the stored mapping relationship between threads and packet sending queues; or

[0053] The forwarding unit identifies the packet sending queue whose queue identifier is the same as the target thread identifier among the plurality of packet sending queues as the first packet sending queue.

[0054] In this application embodiment, the first packet sending queue can be determined by the mapping relationship between threads and packet sending queues, or the first packet sending queue can be determined by the packet sending queue whose queue identifier is the same as the target thread identifier among multiple packet sending queues.

[0055] Secondly, an embodiment of this application provides a method for processing negotiation messages, the method comprising:

[0056] The control unit determines a target thread from among multiple threads configured in the control unit based on the aggregation negotiation message sent by the forwarding unit; and processes the aggregation negotiation message through the target thread to obtain multiple response messages; wherein the aggregation negotiation message carries a target thread identifier;

[0057] The control unit generates an aggregation response message based on the aggregation negotiation message and sends the aggregation response message to the forwarding unit.

[0058] One possible implementation, wherein determining the target thread among the plurality of threads configured in the control unit, includes:

[0059] The control unit identifies the thread whose thread identifier is the same as the target thread identifier among the plurality of threads as the target thread.

[0060] In one possible implementation, the control unit is configured with multiple packet receiving queues, each of which has a unique queue identifier;

[0061] Before the target thread processes the aggregation negotiation message, the method further includes:

[0062] Based on the target thread identifier carried in the aggregation negotiation message, the control unit determines a second packet receiving queue from the plurality of packet receiving queues configured in the control unit, and allocates the aggregation negotiation message to the second packet receiving queue;

[0063] The control unit obtains the aggregation negotiation message from the second packet receiving queue through the target thread.

[0064] One possible implementation, wherein determining the second packet receiving queue from the plurality of packet receiving queues configured in the control unit based on the target thread identifier carried in the aggregation negotiation message, includes:

[0065] The control unit determines the receiving queue corresponding to the target thread identifier as the second receiving queue based on the stored mapping relationship between threads and receiving queues; or

[0066] The control unit identifies the receiving queue whose queue identifier is the same as the target thread identifier among the plurality of receiving queues as the second receiving queue.

[0067] In one possible implementation, the control unit is configured with multiple packet sending queues, and the generation of an aggregated response message based on the multiple response messages includes:

[0068] The control unit determines a second packet sending queue from the plurality of packet sending queues based on the target thread identifier, and allocates the plurality of response messages to the second packet sending queue.

[0069] When the second packet queue meets the packaging conditions, the control unit combines the multiple response messages to generate aggregated response data; and generates an aggregated response message based on the aggregated response data and the target thread identifier.

[0070] In one possible implementation, the plurality of packet sending queues configured by the control unit each have a unique queue identifier; determining the second packet sending queue from the plurality of packet sending queues based on the target thread identifier includes:

[0071] The control unit determines the packet queue corresponding to the target thread as the second packet queue based on the mapping relationship between threads and packet queues; or

[0072] The control unit identifies the packet sending queue whose queue identifier is the same as the target thread identifier among the plurality of packet sending queues as the second packet sending queue.

[0073] One possible implementation, wherein generating the aggregate response message based on the aggregate response data and the target thread identifier includes:

[0074] The control unit determines the private header of the aggregate response message based on the aggregate response data and the target thread identifier;

[0075] The control unit generates the aggregate response message based on the private header of the aggregate response message and the aggregate response data.

[0076] One possible implementation, wherein determining the private header of the aggregate response message based on the aggregate response data and the target thread identifier includes:

[0077] The control unit determines the aggregation response data information based on the aggregation response data, and the aggregation response data information includes the number of messages in the aggregation response data and / or the message length in the aggregation response data;

[0078] The control unit determines the private header of the aggregate response message based on the target thread identifier and the aggregate response data information.

[0079] One possible implementation involves determining that the second packet queue meets the packaging conditions through at least one of the following methods:

[0080] The packet receiving time of the second packet sending queue has reached the preset time.

[0081] The length of the response messages contained in the second packet queue is greater than or equal to a preset length.

[0082] Thirdly, a negotiation message processing apparatus includes:

[0083] The allocation module is used to allocate negotiation messages of the same session to the first receive queue for multiple received negotiation messages;

[0084] The first generation module is used to generate an aggregated negotiation message based on the negotiation messages in the first receiving queue when the first receiving queue meets the packetization conditions.

[0085] The sending module is used to send the aggregation negotiation message to the control unit.

[0086] Fourthly, a negotiation message processing apparatus, comprising:

[0087] The determination module is used to determine a target thread among multiple threads configured in the control unit based on the aggregation negotiation message sent by the forwarding unit; and to process the aggregation negotiation message through the target thread to obtain multiple response messages; wherein the aggregation negotiation message carries a target thread identifier;

[0088] The second generation module is used to generate an aggregated response message based on the multiple response messages, and send the aggregated response message to the forwarding unit.

[0089] Fifthly, embodiments of this application also provide a computer-readable storage medium, including,

[0090] memory,

[0091] The memory is used to store a computer program that, when executed by a processor, causes the apparatus including the computer-readable storage medium to perform the method described in either the first or second aspect.

[0092] Sixthly, embodiments of this application provide an electronic device, including:

[0093] Memory, used to store computer programs;

[0094] When a processor executes a computer program stored in the memory, it implements the method described in either the first or second aspect.

[0095] In a seventh aspect, embodiments of this application provide a computer program product comprising a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of any of the methods described in the first or second aspect.

[0096] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The purposes and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not intended to limit this disclosure. Attached Figure Description

[0097] To more clearly illustrate the technical solutions in the embodiments of this application or the conventional technology, the drawings used in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0098] Figure 1 A schematic diagram illustrating an application scenario provided in an embodiment of this application;

[0099] Figure 2 A schematic diagram of a distributed device provided in an embodiment of this application;

[0100] Figure 3 A schematic diagram illustrating a higher education exit scenario provided in an embodiment of this application;

[0101] Figure 4 A flowchart illustrating a negotiation message processing method provided in this application embodiment;

[0102] Figure 5 A schematic diagram of a negotiation message provided for an embodiment of this application;

[0103] Figure 6 A schematic diagram of an aggregation negotiation message provided for an embodiment of this application;

[0104] Figure 7 A flowchart illustrating a negotiation message processing method provided in this application embodiment;

[0105] Figure 8 An illustration of processing negotiation messages provided in this application embodiment. Figure 1 ;

[0106] Figure 9 An illustration of processing negotiation messages provided in this application embodiment. Figure 2 ;

[0107] Figure 10 A schematic diagram of an electronic device provided in an embodiment of this application;

[0108] Figure 11 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0109] Currently, the performance of both the communication path and the control unit is generally poor, insufficient to support high-capacity session negotiation scenarios. Therefore, a method is urgently needed to ensure communication performance between the forwarding unit and the control unit in high-capacity session scenarios. To address this issue, this application provides a negotiation message processing method. For multiple received negotiation messages, the forwarding unit allocates negotiation messages belonging to the same session to a first receiving queue. The forwarding unit is configured with multiple first receiving queues. When a first target receiving queue among the multiple first receiving queues meets the packetization condition, the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first target receiving queue. The forwarding unit then sends the aggregated negotiation message to the control unit.

[0110] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0111] Furthermore, in the description of the embodiments of this application, unless otherwise stated, "and" means "or", for example, A / B can mean A or B; "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.

[0112] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0113] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the term "connection" should be interpreted broadly. For example, it can refer to a direct connection, an indirect connection through an intermediate medium, or a connection within two devices. Those skilled in the art can understand the specific meaning of the above term in this application based on the specific circumstances.

[0114] To facilitate understanding of the negotiation message processing method, device, and storage medium provided in the embodiments of this application, some terms used in the embodiments of this application will be explained below so that those skilled in the art can understand them.

[0115] A network protocol is a set of rules, standards, or conventions established for data exchange in computer networks.

[0116] A Broadband Remote Access Server (BRAS) is a core device in a communication network, responsible for functions such as user broadband access, authentication and billing, and traffic management. It is a key node connecting user terminals and the backbone network. Its main function is to terminate user PPPoE connections, and it is typically deployed on the operator's side.

[0117] Broadband Remote Access Client (BRAC), in contrast to BRAS, refers to the terminal device or software on the user side in broadband access scenarios. It is responsible for initiating or acting as an agent for the user's PPPoE connection request and interacting with the BRAS.

[0118] Separation of forwarding and control: In communication equipment, the forwarding plane (data plane) is responsible for the rapid forwarding and switching of data packets, while the control plane focuses on protocol processing, routing calculation, and policy decisions. This separation is achieved through modular design, making resource allocation and function iteration more efficient.

[0119] Path: The path between the forwarding plane and the control plane is the command channel and protocol message channel used for command synchronization within network devices or across devices; the command channel is used for transmission such as policy issuance and state synchronization; the protocol message channel is used for the transmission of some messages that need to interact with the control plane (such as ARP requests and BGP updates).

[0120] Distributed Devices: Distributed multi-line-card routing devices are distributed network devices that support multiple line interface cards (line cards). They achieve high-performance, high-reliability data forwarding by distributing routing functions across multiple hardware modules (such as the main control board, line cards, and switching boards). Their core features include: Distributed Processing Architecture: The control plane and forwarding plane are separated. The main control board is responsible for global routing policies, while line cards independently execute local packet forwarding, reducing the performance bottleneck of centralized processing. Multi-line-card Redundancy Design: Supports multiple line cards working in parallel (e.g., 8 line card slots), ensuring service continuity through load balancing and primary / backup failover.

[0121] The EtherType field indicates the type of upper-layer protocol encapsulated in a frame. It is an important part of an Ethernet frame, typically located in bytes 13 and 14 of the Ethernet frame header. The value of the EtherType field helps network devices (such as switches and routers) identify how to process the data in the frame.

[0122] To make the objectives, technical solutions, and beneficial effects of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0123] The negotiation message processing method of this application is applied to an electronic device, which can be any one of a computer, network device, and server. This application does not limit this.

[0124] like Figure 1 The diagram shown illustrates an application scenario according to an embodiment of this application. Figure 1 The multiple electronic devices shown transmit messages via a network protocol. The negotiation message processing method of this application embodiment can be applied to at least one electronic device, thereby improving the electronic device's ability to process negotiation messages.

[0125] It should be noted that the negotiation message processing method in this application embodiment improves the transmission performance of negotiation messages between the forwarding plane and the control plane, and reduces the pressure on the control plane to process negotiation messages, thereby enhancing the electronic device's ability to process negotiation messages.

[0126] In implementation, the forwarding plane (data plane) is responsible for the rapid forwarding and switching of data packets, while the control plane focuses on protocol processing, route calculation, and policy decisions. This separation can be achieved through modular design.

[0127] In this embodiment, a forwarding unit is set in the forwarding plane, and a control unit is set in the control plane. The electronic device uses the forwarding unit and the control unit to process negotiation messages. The forwarding unit and the control unit can be deployed on the same electronic device or on different electronic devices, such as different electronic devices in a distributed system.

[0128] In one optional implementation, the forwarding unit and the control unit are deployed on an electronic device. After receiving a message sent by the peer device, the forwarding unit aggregates the negotiation messages of the same session received by the electronic device to obtain an aggregated negotiation message, and sends the aggregated negotiation message to the control unit. The control unit generates an aggregated response message based on the aggregated negotiation message and sends it to the forwarding unit. The forwarding unit then sends the aggregated response message to the peer device.

[0129] It should be noted that the peer device refers to other electronic devices that are having a conversation with this electronic device.

[0130] In another optional implementation, the forwarding unit and the control unit are deployed on different electronic devices. For example, the forwarding unit is deployed on the first electronic device, and the control unit is deployed on the second electronic device. After receiving a message from the peer device, the forwarding unit aggregates the received negotiation messages of the same session to obtain an aggregated negotiation message, which is then sent to the second electronic device. The control unit deployed on the second electronic device generates an aggregated response message based on the aggregated negotiation message and sends it to the first electronic device. The forwarding unit deployed on the first electronic device then sends the aggregated response message to the peer device.

[0131] Optionally, in this embodiment of the application, after the forwarding unit receives the negotiation message, if it determines that the negotiation message needs to be aggregated, then the negotiation message is aggregated.

[0132] For example, the forwarding unit performs a session lookup based on the session identifier of the negotiation message. If the lookup is successful, it determines that the negotiation message needs to be aggregated.

[0133] If the negotiation message does not need to be aggregated, a message type field can be added to the negotiation message, and the control unit can distinguish between aggregated negotiation messages and non-aggregated negotiation messages based on the message type field.

[0134] For example, if a message type field 0x11 is added between the message header and the data portion of the negotiation message to indicate that the negotiation message is a non-aggregation negotiation message, the control unit will determine that the received message is a non-aggregation negotiation message based on the message type field 0x11.

[0135] If the message header is an Ethernet header, the message type field 0x11 can be set in the first byte after the Ethernet header.

[0136] like Figure 2 The diagram shown illustrates a distributed device according to an embodiment of this application. The distributed device includes multiple line cards (LCs) and a master controller (CM). When the negotiation message processing method of this embodiment is applied to the distributed device, the forwarding unit can be deployed on the line cards, and the control unit can be deployed on the master controller.

[0137] The following is a brief introduction to the use of the negotiation message processing method in network protocols, using a specific application scenario as an example. This application scenario is only used to illustrate the use of the negotiation message processing method in network protocols and does not limit the application scenarios of the negotiation message processing method.

[0138] See Figure 3 As shown, Figure 3 The application scenario shown is a higher education exit scenario. This includes both the campus network side and the carrier side. The campus network side is equipped with servers, switches, and BRAC devices. The carrier side is equipped with BRAS devices. The negotiation message processing method of this application embodiment can be applied to at least one of the BRAC and BRAS devices.

[0139] The BRAC device is deployed at the egress end of the campus network and is used to uniformly convert the campus network's outgoing authentication to a Point-to-Point Protocol over Ethernet (PPPoE) method. The BRAS device is used to terminate the proxy PPPoE session negotiation request initiated by the BRAC device. The BRAC device can be an egress router. There can be multiple PPPoE tunnels between the egress router and each BRAS device.

[0140] Specifically, the servers deployed on the campus network side include the eportal server and the campus network authentication and accounting server. The BRAC device (such as the egress router device) works in conjunction with the campus network authentication and accounting server to trigger the egress PPPoE authentication when the user performs internal authentication within the campus network. After authentication is completed, the user's PPPoE tunnel is maintained on the egress router for data transmission and reception at the egress end.

[0141] It should be noted that traditional technologies are aimed at Figure 2 The application scenario shown illustrates that when a BRAS device acts as a PPPoE server in the network or a BRAC device acts as a PPPoE client, carrying a large number of sessions, the session capacity may reach over 100,000.

[0142] This application, in conjunction with the accompanying drawings and embodiments, provides a more detailed description of the negotiation message processing method provided in this application.

[0143] like Figure 4 The flowchart shown is a method for processing negotiation messages according to an embodiment of this application. The specific steps are as follows:

[0144] Step S401: For the multiple received negotiation messages, the forwarding unit allocates the negotiation messages of the same session to the first receiving queue.

[0145] It should be noted that after receiving multiple messages from other electronic devices, the forwarding unit determines for each message whether it is a negotiation message or a data message. Data messages are processed directly by the forwarding unit.

[0146] Optionally, for each of the multiple received messages, this embodiment of the application determines whether the message is a negotiation message or a data message based on the type field carried by the message. The type field is used to characterize whether the message is a negotiation message or a data message.

[0147] Each message consists of a header and a data portion. The header refers to the Layer 2 header, where Layer 2 is the second layer in the OSI seven-layer model. The data portion refers to the message content after removing the Layer 2 header.

[0148] like Figure 5 As shown, taking the PPPoE message format as an example, the message consists of an Ethernet header, a PPPoE header, and a PPP packet. In this embodiment, the message header refers to the Ethernet header, which includes the source MAC address, destination MAC address, and Ethernet type (TYPE). In this embodiment, the data portion of the message refers to the PPPoE header and the PPP packet, with the PPPoE header including a session identifier. The field used to represent the Ethernet type in the message is the type field.

[0149] It should be noted that the source MAC address represents the MAC address of the sending device, used to identify the origin of the negotiation message. The destination MAC address represents the MAC address of the receiving device, used to determine the destination of the negotiation message.

[0150] Figure 5 The "TYPE" field refers to the Ethernet type, indicating the type of the message, i.e., whether it is a negotiation message. For example, setting the type field to 0x8863 indicates that the message is a negotiation message. Or setting the type field to 0x8864 indicates that the message is a data message.

[0151] After the forwarding unit determines that it has received the negotiation message based on the above process, it allocates the received negotiation message to the first receiving queue.

[0152] In this embodiment, the forwarding unit is configured with one or more receive queues, including the first receive queue. If the forwarding unit is configured with multiple receive queues, each receive queue is assigned a different queue identifier. Each of the multiple receive queues configured on the forwarding unit has a unique queue identifier.

[0153] In one optional implementation, embodiments of this application may configure a packet receiving queue before the electronic device leaves the factory. The number of packet receiving queues is predetermined based on the capabilities of the electronic device. For example, the number of packet receiving queues may be determined based on the capacity of the electronic device.

[0154] For example, if it is determined in advance that four packet receiving queues are configured for the first electronic device based on its capacity, then four packet receiving queues are configured before the first electronic device leaves the factory.

[0155] In another optional implementation, the present application embodiment can also determine the maximum number of packet receiving queues that the user can configure for the electronic device. The user can flexibly set the number of packet receiving queues according to the usage scenario. For example, the electronic device is configured with 1 packet receiving queue at the factory. If the required capacity is higher, the number of packet receiving queues can be increased.

[0156] For each negotiation message among multiple negotiation messages, the forwarding unit allocates the negotiation message to the first receive queue through steps A1-A2:

[0157] Step A1: The forwarding unit determines the first receiving queue from multiple receiving queues based on the session identifier carried in the negotiation message.

[0158] In step A2, the forwarding unit allocates the negotiation message to the first receiving queue.

[0159] The session identifier is used to indicate the session to which the negotiation message belongs.

[0160] In one optional implementation, the first packet receiving queue can be determined through steps B1-B2:

[0161] Step B1: The forwarding unit determines the allocation identifier of the negotiation message based on the session identifier carried in the negotiation message.

[0162] Step B2: The receiving queue with the same queue identifier as the allocation identifier among the multiple receiving queues is identified as the first receiving queue.

[0163] In this implementation, the queue identifier of the first receiving queue is the same as the allocation identifier of the negotiation message.

[0164] For example, if the allocation identifier of the negotiation message is 2, then the receiving queue with queue identifier 2 among the multiple receiving queues will be the first receiving queue of the negotiation message.

[0165] In another optional implementation, the first receiving queue can be determined through steps C1-C3:

[0166] Step C1: The forwarding unit queries the stored mapping relationship between session identifiers and receiving queues to see if the first session identifier is included.

[0167] The first session identifier is the session identifier carried in the negotiation message.

[0168] Step C2: If a first session identifier is included, the forwarding unit determines the receiving queue corresponding to the first session identifier as the first receiving queue based on the mapping relationship between the session identifier and the receiving queue.

[0169] Step C3: If the first session identifier is not included, the forwarding unit determines the allocation identifier of the negotiation message based on the first session identifier; and determines the receiving queue with the same queue identifier and allocation identifier among the multiple receiving queues as the first receiving queue.

[0170] Optionally, in this embodiment of the application, after determining the first receiving queue through step C3, the mapping relationship between the first session identifier and the first receiving queue can also be stored. Then, upon receiving a negotiation message carrying the first session identifier, the first receiving queue corresponding to that negotiation message can be directly determined.

[0171] For steps B1 and C3, in this embodiment of the application, the forwarding unit performs a modulo operation on the number of configured receive queues based on the session identifier of the negotiation message to obtain the allocation identifier of the negotiation message.

[0172] The session identifier is used to indicate the session to which the negotiation message belongs. Messages within a session carry the same session identifier.

[0173] This application embodiment uses a hash algorithm to allocate negotiation messages from the same session to a single receive queue based on the session identifier carried in the negotiation message. Specifically, the forwarding unit performs a modulo operation on the configured number of receive queues according to the session identifier of the negotiation message to obtain the allocation identifier of the negotiation message.

[0174] In one alternative implementation, the number of configured receive queues is moduloed using the session identifier of the negotiation message.

[0175] Another alternative implementation involves processing the session identifier of the negotiation message using a hash algorithm, and then using the processed session identifier to perform a modulo operation on the number of configured receive queues.

[0176] For example, using the standard MD5 hash library algorithm, the session identifier (Session ID) of the negotiation message is processed using the standard MD5 hash library algorithm to obtain the processed session identifier md5_hash(Session ID), and then moduloed by the number of packets in the receiving queue. Alternatively, standard hash library algorithms such as the Secure Hash Algorithm (SHA) can also be used; this application does not impose any restrictions on this.

[0177] It should be noted that although the session identifiers of the negotiation messages in different sessions are different, the allocation identifier determined based on the session identifier may be the same, which may result in the negotiation messages of multiple sessions being allocated to a single packet receiving queue.

[0178] For example, taking a receive queue of 4 as an example. If the received negotiation messages include negotiation messages from session 1 and session 2, with session identifier 4 for session 1 and session identifier 8 for session 2, then the allocation identifier for the negotiation messages in session 1 is determined to be 0 based on the session identifier of session 1. Similarly, the allocation identifier for the negotiation messages in session 2 is determined to be 0 based on the session identifier of session 2. In the forwarding unit, both the negotiation messages from session 1 and session 2 are allocated to the first receive queue with queue identifier 0.

[0179] Upon receiving negotiation messages from Session 1 and Session 2, the negotiation messages from Session 1 and Session 2 are assigned to the first receive queue with queue identifier 0.

[0180] Step S402: When the first receiving queue meets the packetization conditions, the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first receiving queue.

[0181] Optionally, embodiments of this application determine that the first receiving queue meets the packaging conditions through at least one of the following methods:

[0182] Method 1: The packet receiving time of the first packet receiving queue reaches the preset time.

[0183] Among them, the package collection time is the duration of the current round of package collection phase.

[0184] It should be noted that the current round of packet receiving phase can start from the last time the packet conditions were met, or it can start from the first negotiation message received after the last time the packet conditions were met.

[0185] In this embodiment, the preset duration can be set to 10ms. This application does not limit the specific value.

[0186] Method 2: The length of the negotiation messages contained in the first packet receiving queue is greater than or equal to the preset length.

[0187] In this application embodiment, the preset length can be set to 1400 bytes. This application does not limit the specific value.

[0188] One possible implementation is that if the length of the negotiation message received by the first receiving queue within 10ms exceeds 1400 bytes, then the first receiving queue is determined to meet the packetization condition; if the receiving time reaches 10ms but the length of the received negotiation message does not reach 1400 bytes, then the first receiving queue is determined to meet the packetization condition.

[0189] Based on the above process, it is determined that the first receiving queue meets the packetization conditions. The following describes the process by which the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first receiving queue.

[0190] The negotiation message in the first packet receiving queue contains a message header and a data portion.

[0191] In this embodiment, the forwarding unit combines the data portions of each negotiation message in the first receiving queue to obtain aggregated data; the forwarding unit generates an aggregated negotiation message based on the aggregated data.

[0192] Optionally, in embodiments of this application, an aggregation negotiation message can be generated through steps D1-D3:

[0193] Step D1: The forwarding unit combines the data portions of each negotiation message in the first receiving queue to obtain aggregated data.

[0194] In step D2, the forwarding unit determines the private header of the aggregation negotiation message based on the first queue identifier of the first receiving queue and the aggregation data.

[0195] In this embodiment, the forwarding unit determines the target thread identifier based on the first queue identifier of the first receiving queue. The target thread identifier is used to indicate the target thread in the control unit that processes the aggregation negotiation message. The forwarding unit determines the aggregation data information based on the aggregation data. The aggregation data information includes the number of messages in the aggregation data and / or the length of the messages in the aggregation data. The private header of the aggregation negotiation message is determined based on the target thread identifier and the aggregation data information.

[0196] In one alternative implementation, the target thread identifier and aggregate data information can be combined to obtain the private header of the aggregation negotiation message.

[0197] In another optional implementation, the private header of the aggregation negotiation message may also include a message type field. The private header of the aggregation negotiation message is obtained by combining the message type field, the target thread identifier, and the aggregation data information.

[0198] For example, the message type field in the private header of an aggregation negotiation message can be set to 0xff to indicate an aggregation negotiation message.

[0199] It should be noted that in this embodiment, the message type field is used to distinguish between aggregation negotiation messages and non-aggregation negotiation messages. For example, a message type field of 0xff can represent an aggregation negotiation message, and a message type field of 0x11 can represent a non-aggregation negotiation message. This allows the control unit to determine whether a message is an aggregation negotiation message based on the message type field after receiving a message from the forwarding unit. This embodiment does not limit the specific value and can use enumerated values ​​for setting.

[0200] Step D3: The forwarding unit generates an aggregation negotiation message based on the message header, the private header of the aggregation negotiation message, and the aggregation data.

[0201] Optionally, the forwarding unit in this application embodiment can combine some or all of the information in the message header, the private header of the aggregation negotiation message, and the aggregation data to obtain the aggregation negotiation message.

[0202] For this aggregation negotiation message, the embodiments of this application can further compress the length of the sent message by stripping away the unnecessary message header and only packaging the data part during the negotiation process.

[0203] Optionally, the aggregation negotiation message may also include part or all of the message header of the negotiation message.

[0204] The message header can contain any one or any two of the following: source MAC address, destination MAC address, and Ethernet type. This application does not impose any restrictions on this.

[0205] For negotiation messages that may encounter negotiation bottlenecks, the method for generating aggregated negotiation messages provided in this application packages multiple negotiation messages, which can reduce the amount of data transmitted in the path and avoid path performance limitations. By saving path performance, other oscillations caused by insufficient path performance can be avoided in complex scenarios, such as oscillations in routing protocols.

[0206] It should be noted that, based on the above method, the aggregation negotiation message is imitated as a real message, and the format of the generated aggregation negotiation message can be agreed upon by the data plane and the control plane.

[0207] like Figure 6The diagram shown illustrates an aggregation negotiation message according to an embodiment of this application. Taking the generation of an aggregation negotiation message based on the above combinations of various situations as an example, the generated aggregation negotiation message includes a message header, a private header of the aggregation negotiation message, and aggregation data. The private header of the aggregation negotiation message includes a target thread identifier, the number of messages in the aggregation data, the message length in the aggregation data, and a message type field.

[0208] in, Figure 6 In this context, "DATA" represents aggregated data. "type" represents the message type field, located one byte after "TYPE". Figure 6 The message type field can be 0xff, which represents an aggregation negotiation message.

[0209] Additionally, if the message type field is 0x11, it represents a non-aggregation negotiation message.

[0210] It should be noted that the target thread identifier, the number of messages in the aggregated data, and the message length in the aggregated data can be content from the private protocol header. The target thread identifier ranges from 1 to 255 and occupies 1 byte. "count" indicates the number of messages, ranging from 1 to 255 and occupying 1 byte. "length" indicates the message length of the packaged messages, ranging from less than 1500 and occupying 2 bytes. Therefore, the private protocol header only needs to occupy 4 bytes in total.

[0211] In step S403, the forwarding unit sends the aggregation negotiation message to the control unit.

[0212] When conducting a PPPoE session, due to the characteristics of the protocol, the PPPoE / Point to Point Protocol (PPP) negotiation phase messages are almost always less than 100 bytes. When the receiving queue packages the messages, it can, on average, package 10 negotiation messages into an aggregated negotiation message and send it to the path, for example, according to demand.

[0213] In this embodiment of the application, the negotiation message includes a message header and a data portion, and the data portion includes the session identifier of the negotiation message.

[0214] For example, the PPPoE header in the data portion of each negotiation message contains the session identifier for that negotiation message.

[0215] Optionally, after receiving multiple negotiation messages, the forwarding unit in this embodiment further includes: for each negotiation message, the forwarding unit stores the message header of the negotiation message and the mapping relationship between the message header and the session identifier of the negotiation message.

[0216] After sending the aggregation negotiation message to the control unit, the method further includes: a forwarding unit receiving the aggregation response message sent by the control unit and splitting the aggregation response message into multiple messages; for each of the multiple messages, the forwarding unit combines the message header corresponding to the second session identifier with the message based on the second session identifier carried in the message and the mapping relationship between the stored message header and the session identifier to generate the target response message.

[0217] The second session identifier is the session identifier carried in the message.

[0218] Optionally, in this embodiment of the application, the forwarding plane is further configured with multiple packet sending queues; after receiving the aggregated response message sent by the control unit, and before splitting the aggregated response message into multiple messages, the forwarding unit further includes: determining the first packet sending queue among the multiple packet sending queues based on the target thread identifier carried in the aggregated response message, and allocating the aggregated response message to the first packet sending queue.

[0219] For example, if the aggregation negotiation message sent by the forwarding unit to the control unit is obtained by aggregating negotiation message 1 and negotiation message 2, then the aggregation response message generated by the control unit includes the response message corresponding to negotiation message 1 and the response message corresponding to negotiation message 2. After receiving the aggregation response message, the forwarding unit splits the aggregation response message into message 1 and message 2. Each message split from the aggregation response message corresponds to a negotiation message in the aggregation negotiation message.

[0220] For example, message 1 is the response message corresponding to negotiation message 1, and message 2 is the response message corresponding to negotiation message 2.

[0221] Each of the multiple packet sending queues configured on the forwarding unit has a unique queue identifier.

[0222] Optionally, embodiments of this application determine the first packet sending queue in any of the following ways:

[0223] In one optional implementation, the forwarding unit determines the packet queue corresponding to the target thread identifier as the first packet queue based on the stored mapping relationship between threads and packet queues.

[0224] In another optional implementation, the forwarding unit determines the first packet sending queue as the packet sending queue whose queue identifier is the same as the target thread identifier among multiple packet sending queues.

[0225] In this embodiment, the forwarding unit is deployed on the first electronic device and the control unit is deployed on the second electronic device; or, both the forwarding unit and the control unit are deployed on the third electronic device.

[0226] like Figure 7The flowchart shown is a method for processing negotiation messages according to an embodiment of this application. The specific steps are as follows:

[0227] In step S701, the control unit determines the target thread from among the multiple threads configured in the control unit based on the aggregation negotiation message sent by the forwarding unit; and processes the aggregation negotiation message through the target thread to obtain multiple response messages.

[0228] Among them, the aggregation negotiation message is generated by the forwarding unit based on the negotiation message in the first receiving queue, and the aggregation negotiation message carries the target thread identifier.

[0229] Optionally, after receiving the aggregation negotiation message, the control unit can deseal the received aggregation negotiation message and process the desealized aggregation negotiation message through the target thread.

[0230] In this embodiment, after the forwarding unit obtains the aggregation negotiation message based on the target thread identifier combination, the control unit, upon receiving the aggregation negotiation message, can obtain the target thread identifier carried in the aggregation negotiation message. The control unit then identifies the thread whose thread identifier is the same as the target thread identifier among multiple threads as the target thread.

[0231] In this embodiment of the application, the control unit is configured with multiple packet receiving queues, and each of the multiple packet receiving queues configured by the control unit has a unique queue identifier.

[0232] Optionally, in this embodiment of the application, before the target thread processes the aggregation negotiation message, the control unit further includes: determining a second receiving queue from multiple receiving queues configured by the control unit based on the target thread identifier carried in the aggregation negotiation message, and allocating the aggregation negotiation message to the second receiving queue; the control unit obtains the aggregation negotiation message from the second receiving queue through the target thread.

[0233] In this application embodiment, the second packet receiving queue can be determined through any of the following implementation methods:

[0234] In one optional implementation, the control unit determines the receiving queue corresponding to the target thread identifier as the second receiving queue based on the stored mapping relationship between threads and receiving queues.

[0235] In other words, the control unit determines the receiving queue corresponding to the target thread identifier based on the mapping relationship between the multiple threads configured on the control unit and the multiple receiving queues configured on the control unit, and designates the receiving queue as the second receiving queue.

[0236] In another optional implementation, the control unit identifies the receiving queue whose queue identifier is the same as the target thread identifier among multiple receiving queues as the second receiving queue.

[0237] Optionally, in this embodiment of the application, before the control unit processes the aggregation negotiation message through the target thread to obtain multiple response messages, it may further include: the control unit splits the aggregation data contained in the aggregation negotiation message into multiple data parts, and obtains multiple response messages based on the multiple data parts obtained from the splitting.

[0238] For example, if the aggregated data in the aggregation negotiation message sent by the forwarding unit is obtained by combining the data part of the received negotiation message 1 and the data part of the negotiation message 2, then the multiple data parts obtained by the control unit are the data part of negotiation message 1 and the data part of negotiation message 2.

[0239] In practice, the control unit of this application embodiment can adopt a polling processing mechanism. After receiving the aggregation negotiation message from the channel, it is first put into the second receiving queue in the control unit. After the processing time slice of the target thread is polled, the target thread takes out the aggregation negotiation message from the second receiving queue and performs state mechanism processing.

[0240] In one optional implementation, the number of packet receiving queues configured in the control unit is the same as the number of packet receiving queues configured in the forwarding unit, and the packet receiving queues in the control unit and the packet receiving queues in the forwarding unit have the same queue identifier, while the queue identifiers of each packet receiving queue in the control unit are different, and the queue identifiers of each packet receiving queue in the forwarding unit are different; then the control unit uses the packet receiving queue whose queue identifier is the same as the target thread identifier as the second packet receiving queue.

[0241] In this embodiment of the application, after receiving the aggregation negotiation message, the control unit can allocate the aggregation negotiation message to the second receiving queue, obtain the aggregation negotiation message in the second receiving queue through the target thread, and process the aggregation negotiation message to obtain multiple response messages.

[0242] It should be noted that the packet receiving queue is a caching mechanism of the control unit. After the processing time slice arrives, the processing thread of the control unit is activated, which enables the thread to process the aggregation negotiation messages in the packet receiving queue and generate response messages.

[0243] In step S702, the control unit generates an aggregated response message based on multiple response messages and sends the aggregated response message to the forwarding unit.

[0244] In this embodiment, the control unit is configured with multiple packet sending queues. Therefore, this embodiment can generate an aggregated response message through steps E1-E2:

[0245] In step E1, the control unit determines the second packet sending queue from multiple packet sending queues based on the target thread identifier, and assigns multiple response messages to the second packet sending queue.

[0246] Each of the multiple packet sending queues configured in the control unit has a unique queue identifier. Therefore, the second packet sending queue can be determined through any of the following implementation methods in this application embodiment:

[0247] In one optional implementation, the control unit determines the packet queue corresponding to the target thread as the second packet queue based on the mapping relationship between threads and packet queues.

[0248] In other words, the control unit determines the packet queue corresponding to the target thread identifier based on the mapping relationship between the multiple threads configured on the control unit and the multiple packet sending queues configured on the control unit, and designates the packet sending queue as the second packet sending queue.

[0249] In another optional implementation, the control unit identifies the packet sending queue whose queue identifier is the same as the target thread identifier among multiple packet sending queues as the second packet sending queue.

[0250] In step E2, when the second packet queue meets the packaging conditions, the control unit combines multiple response messages to generate aggregated response data; and generates an aggregated response message based on the aggregated response data and the target thread identifier.

[0251] Regarding step B2, embodiments of this application determine that the second packet sending queue meets the packaging conditions through at least one of the following methods:

[0252] Method 1: The packet receiving time of the second packet sending queue reaches the preset time.

[0253] Method 2: The length of the response message contained in the second packet sending queue is greater than or equal to the preset length.

[0254] The specific method and principle of step B2 can be found in the packaging conditions of the first receiving queue in step S402.

[0255] Optionally, the control unit determines the private header of the aggregate response message based on the aggregate response data and the target thread identifier; the control unit generates the aggregate response message based on the private header and aggregate response data.

[0256] Specifically, the control unit determines the aggregate response data information based on the aggregate response data, which includes the number of messages and / or the message length in the aggregate response data. The control unit determines the private header of the aggregate response message based on the target thread identifier and the aggregate response data information.

[0257] Optionally, the private header of the aggregated response message may also include a message type field.

[0258] In one alternative implementation, the control unit can combine the private header and aggregate response data of the aggregate response message to obtain the aggregate response message.

[0259] In another optional implementation, the aggregated response message may also include a message header. The control unit then combines the message header, the aggregated response message private header, and the aggregated response data to obtain the aggregated response message.

[0260] In one optional implementation, the number of multiple threads, multiple packet receiving queues, and multiple packet sending queues configured in the control unit are all the same, and one thread is mapped to one packet receiving queue and one thread is mapped to one packet sending queue.

[0261] For example, thread 1 with thread identifier 1 in the control unit has a mapping relationship with the second receiving queue 1 with queue identifier 1, and thread 1 also has a mapping relationship with the second sending queue 1 with queue identifier 1. Then thread 1 retrieves the aggregation negotiation message from the second receiving queue 1 and distributes the generated response message to the second sending queue 1.

[0262] In this embodiment of the application, the forwarding unit can be configured with one or more packet sending queues. After the control unit sends the aggregated response message to the forwarding unit, the forwarding unit deseals the aggregated response message through the second packet sending queue, generates multiple messages based on the aggregated response message, and sends the multiple messages to the peer device.

[0263] like Figure 8 As shown, this application embodiment illustrates a method for processing negotiation messages. Figure 1 Taking the sending of an aggregation negotiation message from the forwarding unit to the control unit as an example, if the devices are using the PPPoE protocol, Figure 8 In this context, "INGRESS" indicates the processing point for PPPoE packets within the forwarding unit, used for packet reception processing. The forwarding unit then allocates multiple received negotiation packets to the first packet reception queue (e.g., ...). Figure 8 In the packet receiving queue 1) configured on the forwarding unit, when the first packet receiving queue meets the packet packaging condition, the generated aggregation negotiation message is sent to the control unit through the path between the forwarding unit and the control unit. Figure 8 The "decapsulated message" in the text refers to the PPPoE message processing point of the control unit. The control unit decapsulates the received aggregation negotiation message and distributes the multiple decapsulated negotiation messages to the second receiving queue (e.g., ...). Figure 8 In the packet receiving queue 1 configured on the central control unit.

[0264] In traditional technologies, a single session may contain 20 negotiation messages, and the protocol has a contextual time relationship, with each negotiation phase depending on the result of the previous phase. If these 20 negotiation messages are processed by different threads, the current thread must query other threads for the results of the previous processing phase. This context switching and cross-thread querying is very performance-intensive. Therefore, this application requires that the target thread identifier of the negotiation messages within the same session be the same, ensuring that the negotiation process of a session is ultimately processed within a single thread in the control unit. This method avoids thread jumps and additional interactions, improving negotiation efficiency.

[0265] The method for generating aggregation negotiation messages based on this application reduces the path requirements while maintaining the same concurrent creation performance, significantly improving the concurrent creation rate in high-capacity scenarios. For example, if the packetization algorithm packages an average of 10 messages at a time, the path requirements can be reduced by 10 times.

[0266] like Figure 9 As shown, this application embodiment illustrates a method for processing negotiation messages. Figure 2 Taking the sending of an aggregated response message from the control unit to the forwarding unit as an example, if the devices are using the PPPoE protocol, Figure 9 In this context, "OUTGRESS" indicates the processing point for PPPoE packets in the forwarding unit. The second receive queue in the control unit (e.g., Figure 8 After receiving the allocated aggregation negotiation message, the receiving queue 1 configured on the control unit is processed by the target thread (e.g., the target thread that has a mapping relationship with the second receiving queue) Figure 9 Thread 1) configured on the control unit retrieves the aggregation negotiation message from the second receive queue, generates a response message, and sends the generated response message to the second send queue (e.g., Figure 9 The packet sending queue 1 is configured on the control unit. If the second packet sending queue meets the packetization condition, the second packet sending queue generates an aggregated response message based on the response message in this queue, and sends it to the forwarding unit through the path. After the forwarding unit decapsulates the aggregated response message, the first packet sending queue generates multiple target response messages based on the aggregated response message, and sends the multiple target response messages to the peer device.

[0267] like Figure 8 and Figure 9 As shown, in one optional implementation, the number of receiving queues and sending queues configured in the forwarding unit, as well as the number of sending queues, receiving queues, and threads configured in the control unit, can all be set to the same value. This application does not impose any limitations on this.

[0268] Based on the same inventive concept as the above method embodiments, this application also provides a negotiation message processing apparatus, the apparatus comprising:

[0269] The allocation module is used to allocate negotiation messages of the same session to the first receive queue for multiple received negotiation messages;

[0270] The first generation module is used to generate an aggregated negotiation message based on the negotiation messages in the first receiving queue when the first receiving queue meets the packetization conditions.

[0271] The sending module is used to send the aggregation negotiation message to the control unit.

[0272] Based on the same inventive concept as the above method embodiments, this application also provides a negotiation message processing apparatus, the apparatus comprising:

[0273] The determination module is used to determine a target thread among multiple threads configured in the control unit based on the aggregation negotiation message sent by the forwarding unit; and to process the aggregation negotiation message through the target thread to obtain multiple response messages; wherein the aggregation negotiation message carries a target thread identifier;

[0274] The second generation module is used to generate an aggregated response message based on the multiple response messages, and send the aggregated response message to the forwarding unit.

[0275] Based on the same inventive concept as the above method embodiments, this application also provides an electronic device. The principle of the electronic device in solving the problem is similar to that of the method in the above embodiments. Therefore, the implementation of the electronic device can refer to the implementation of the above method, and the repeated parts will not be described again.

[0276] See Figure 10 As shown, the electronic device 100 may include at least a processor 101 and a memory 102. The memory 102 stores program code, which, when executed by the processor 101, causes the processor 101 to perform the steps of the model training method described in the above embodiments of this application.

[0277] The following reference Figure 10 To describe an electronic device 110 according to this embodiment of the present application. Figure 11 The electronic device 110 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0278] like Figure 11The electronic device 110 is manifested in the form of a general electronic device. The components of the electronic device 110 may include, but are not limited to: at least one processing unit 111, at least one storage unit 112, and a bus 113 connecting different system components (including storage unit 112 and processing unit 111).

[0279] Bus 113 represents one or more of several bus structures, including a memory bus or memory controller, peripheral bus, processor, or local bus using any of the various bus structures.

[0280] Storage unit 112 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1121 and / or cache memory 1122, and may further include read-only memory (ROM) 1123.

[0281] Storage unit 112 may also include a program / utility 1111 having a set (at least one) of program modules 1124, such program modules 1124 including but not limited to: operating system, one or more application programs, other program modules and program data, each of these examples or some combination thereof may include an implementation of a network environment.

[0282] Electronic device 110 can also communicate with one or more external devices 114 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable objects to interact with electronic device 110, and / or with any device that enables electronic device 110 to communicate with one or more other electronic devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 115. Furthermore, electronic device 110 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 116. As shown, network adapter 116 communicates with other modules used in electronic device 110 via bus 113. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 110, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0283] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0284] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0285] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0286] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0287] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for processing negotiation messages, characterized in that, The method includes: For multiple received negotiation messages, the forwarding unit allocates the negotiation messages of the same session to the first receiving queue; When the first receiving queue meets the packet packaging conditions, the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first receiving queue; The forwarding unit sends the aggregation negotiation message to the control unit.

2. The method as described in claim 1, characterized in that, The forwarding unit is configured with multiple packet receiving queues, each with a unique queue identifier; the forwarding unit allocates negotiation messages for the same session to the first packet receiving queue, including: For each of the plurality of negotiation messages, perform the following operations: The forwarding unit determines the first receiving queue from the plurality of receiving queues based on the session identifier carried in the negotiation message; the session identifier is used to indicate the session to which the negotiation message belongs; The forwarding unit allocates the negotiation message to the first receiving queue.

3. The method as described in claim 2, characterized in that, The forwarding unit determines a first receive queue from the plurality of receive queues based on the session identifier carried in the negotiation message, including: The forwarding unit determines the allocation identifier of the negotiation message based on the session identifier carried in the negotiation message; The receiving queue whose queue identifier is the same as the allocation identifier among the plurality of receiving queues is determined as the first receiving queue.

4. The method as described in claim 2, characterized in that, The forwarding unit determines a first receive queue from the plurality of receive queues based on the session identifier carried in the negotiation message, including: The forwarding unit queries the stored mapping relationship between session identifiers and packet receiving queues to see if it contains a first session identifier, wherein the first session identifier is the session identifier carried by the negotiation message. If the first session identifier is included, the forwarding unit determines the receiving queue corresponding to the first session identifier as the first receiving queue based on the mapping relationship between the session identifier and the receiving queue; If the first session identifier is not included, the forwarding unit determines the allocation identifier of the negotiation message based on the first session identifier; and determines the receiving queue whose queue identifier is the same as the allocation identifier among the plurality of receiving queues as the first receiving queue.

5. The method as described in claim 3 or 4, characterized in that, The forwarding unit determines the allocation identifier of the negotiation message based on the session identifier carried in the negotiation message, including: The forwarding unit performs a modulo operation on the number of configured receive queues based on the session identifier of the negotiation message to obtain the allocation identifier of the negotiation message.

6. The method as described in claim 1, characterized in that, The first receiving queue is determined to meet the packing conditions by at least one of the following methods: The packet receiving time of the first packet receiving queue has reached the preset time. The length of the negotiation messages contained in the first packet receiving queue is greater than or equal to a preset length.

7. The method as described in claim 1, characterized in that, The negotiation messages in the first receiving queue include a message header and a data portion; the forwarding unit generates an aggregated negotiation message based on the negotiation messages in the first receiving queue, including: The forwarding unit combines the data portions of each negotiated message in the first receiving queue to obtain aggregated data; The forwarding unit determines the private header of the aggregation negotiation message based on the first queue identifier of the first receiving queue and the aggregation data; The forwarding unit generates the aggregation negotiation message based on the message header, the private header of the aggregation negotiation message, and the aggregation data.

8. The method as described in claim 7, characterized in that, The step of determining the private header of the aggregation negotiation message based on the first queue identifier of the first receiving queue and the aggregation data includes: The forwarding unit determines the target thread identifier based on the first queue identifier of the first receiving queue, and the target thread identifier is used to indicate the target thread in the control unit that processes the aggregation negotiation message; The forwarding unit determines aggregated data information based on the aggregated data, and the aggregated data information includes the number of packets in the aggregated data and / or the length of the packets in the aggregated data; The private header of the aggregation negotiation message is determined based on the target thread identifier and the aggregation data information.

9. The method as described in claim 1, characterized in that, The negotiation message includes a header and a data portion, the data portion including the session identifier of the negotiation message; Following the received multiple negotiation messages, the method further includes: For each of the plurality of negotiation messages, the forwarding unit stores the message header of the negotiation message and the mapping relationship between the message header and the session identifier of the negotiation message; After sending the aggregation negotiation message to the control unit, the method further includes: The forwarding unit receives the aggregated response message sent by the control unit and splits the aggregated response message into multiple messages; For each of the plurality of messages, the forwarding unit combines the message header corresponding to the second session identifier with the message based on the second session identifier carried in the message and the stored mapping relationship between message headers and session identifiers, to generate a target response message.

10. The method as described in claim 9, characterized in that, The forwarding plane is further configured with multiple packet sending queues; after the aggregated response message sent by the receiving control unit and before the aggregated response message is split into multiple messages, the following is also included: The forwarding unit determines the first packet sending queue from the plurality of packet sending queues based on the target thread identifier carried in the aggregated response message, and assigns the aggregated response message to the first packet sending queue.

11. The method as described in claim 10, characterized in that, Each of the plurality of packet sending queues has a unique queue identifier; determining the first packet sending queue from the plurality of packet sending queues based on the target thread identifier carried in the aggregated response message includes: The forwarding unit determines the packet queue corresponding to the target thread identifier as the first packet queue based on the stored mapping relationship between threads and packet sending queues; or The forwarding unit identifies the packet sending queue whose queue identifier is the same as the target thread identifier among the plurality of packet sending queues as the first packet sending queue.

12. A method for processing negotiation messages, characterized in that, The method includes: The control unit determines a target thread from among multiple threads configured in the control unit based on the aggregation negotiation message sent by the forwarding unit; and processes the aggregation negotiation message through the target thread to obtain multiple response messages; wherein the aggregation negotiation message carries a target thread identifier; An aggregated response message is generated based on the multiple response messages, and the aggregated response message is sent to the forwarding unit.

13. The method as described in claim 12, characterized in that, Determining the target thread among the multiple threads configured in the control unit includes: The control unit identifies the thread whose thread identifier is the same as the target thread identifier among the plurality of threads as the target thread.

14. The method as described in claim 12, characterized in that, The control unit is configured with multiple packet receiving queues, and each of the multiple packet receiving queues has a unique queue identifier; Before the target thread processes the aggregation negotiation message, the method further includes: Based on the target thread identifier carried in the aggregation negotiation message, the control unit determines a second packet receiving queue from the plurality of packet receiving queues configured in the control unit, and allocates the aggregation negotiation message to the second packet receiving queue; The control unit obtains the aggregation negotiation message from the second packet receiving queue through the target thread.

15. The method as described in claim 14, characterized in that, The step of determining the second packet receiving queue from the plurality of packet receiving queues configured in the control unit based on the target thread identifier carried in the aggregation negotiation message includes: The control unit determines the receiving queue corresponding to the target thread identifier as the second receiving queue based on the stored mapping relationship between threads and receiving queues; or The control unit identifies the receiving queue whose queue identifier is the same as the target thread identifier among the plurality of receiving queues as the second receiving queue.

16. The method as described in claim 12, characterized in that, The control unit is configured with multiple packet sending queues, and the generation of an aggregated response message based on the multiple response messages includes: The control unit determines a second packet sending queue from the plurality of packet sending queues based on the target thread identifier, and allocates the plurality of response messages to the second packet sending queue. When the second packet queue meets the packaging conditions, the control unit combines the multiple response messages to generate aggregated response data; and generates an aggregated response message based on the aggregated response data and the target thread identifier.

17. The method as described in claim 16, characterized in that, The plurality of packet sending queues configured by the control unit each have a unique queue identifier; determining the second packet sending queue from the plurality of packet sending queues based on the target thread identifier includes: The control unit determines the packet queue corresponding to the target thread as the second packet queue based on the mapping relationship between threads and packet queues; or The control unit identifies the packet sending queue whose queue identifier is the same as the target thread identifier among the plurality of packet sending queues as the second packet sending queue.

18. The method as described in claim 16, characterized in that, The generation of the aggregated response message based on the aggregated response data and the target thread identifier includes: The control unit determines the private header of the aggregate response message based on the aggregate response data and the target thread identifier; The control unit generates the aggregate response message based on the private header of the aggregate response message and the aggregate response data.

19. The method as described in claim 18, characterized in that, The step of determining the private header of the aggregate response message based on the aggregate response data and the target thread identifier includes: The control unit determines the aggregation response data information based on the aggregation response data, and the aggregation response data information includes the number of messages in the aggregation response data and / or the message length in the aggregation response data; The control unit determines the private header of the aggregate response message based on the target thread identifier and the aggregate response data information.

20. The method as described in claim 16, characterized in that, The second packet sending queue is determined to meet the packaging conditions by at least one of the following methods: The packet receiving time of the second packet sending queue has reached the preset time. The length of the response messages contained in the second packet queue is greater than or equal to a preset length.

21. A negotiation message processing apparatus, characterized in that, The device includes: The allocation module is used to allocate negotiation messages of the same session to the first receive queue for multiple received negotiation messages; The first generation module is used to generate an aggregated negotiation message based on the negotiation messages in the first receiving queue when the first receiving queue meets the packetization conditions. The sending module is used to send the aggregation negotiation message to the control unit.

22. A negotiation message processing apparatus, characterized in that, The device includes: The determination module is used to determine a target thread among multiple threads configured in the control unit based on the aggregation negotiation message sent by the forwarding unit; and to process the aggregation negotiation message through the target thread to obtain multiple response messages; wherein the aggregation negotiation message carries a target thread identifier; The second generation module is used to generate an aggregated response message based on the multiple response messages and send the aggregated response message to the forwarding unit.

23. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of any of claims 1-11 or any of claims 12-20.

24. A computer-readable storage medium, characterized in that, include, memory, The memory is used to store a computer program that, when executed by a processor, causes the apparatus including the computer-readable storage medium to perform the steps of any of the methods claimed in claims 1-11 or 12-20.