Message processing method and device, electronic equipment and storage medium

By setting the default VLAN identifier to be different from the packet identifier in the aggregation and distribution device, and by removing or adding VLAN tags, the problem that the aggregation and distribution device cannot recognize multiple layers of VLAN tags is solved, and the original output of packets and load balancing are realized.

CN116389376BActive Publication Date: 2026-08-25HANGZHOU DPTECH INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310325662.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2026-08-25
Estimated Expiration
2043-03-27

AI Technical Summary

Technical Problem

When processing packets with multiple VLAN tags, aggregation and distribution devices cannot accurately identify network layer and transport layer fields, leading to load balancing failure.

Method used

By setting the default VLAN tag of the aggregation and distribution device to be different from the VLAN tag in the packet, the VLAN tag can be removed or added to keep the packet output as is and avoid enabling the QinQ function.

Benefits of technology

It enables packets carrying VLAN tags of layers 0 to 2 to be output as is after processing, and realizes flow-based load balancing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389376B_ABST
    Figure CN116389376B_ABST
Patent Text Reader

Abstract

The present disclosure provides a message processing method and device, electronic equipment and storage medium, and relates to the technical field of communication. The method comprises the following steps: determining whether a first message to be processed carries a first VLAN label, wherein the first VLAN label comprises a first VLAN identifier, and a default VLAN identifier is different from the first VLAN identifier; if the first message carries the first VLAN label, stripping the first VLAN label carried by the first message, writing the first VLAN identifier into a message header of the first message to obtain a second message; processing the second message according to a shunting rule to obtain a third message, wherein the third message carries a second VLAN label, the second VLAN label comprises a second VLAN identifier, and the second VLAN identifier is generated based on a VLAN identifier in the message header of the second message; and if the second VLAN identifier is different from the default VLAN identifier, forwarding the third message to a specified port. The present disclosure can enable a message carrying a 0-2 layer VLAN label to remain unchanged after processing, thereby realizing load sharing based on a flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and in particular to a message processing method, apparatus, electronic device and storage medium. Background Technology

[0002] When aggregation and distribution devices process packets, in order to prevent VLAN tags from being added or removed during the processing, which would prevent the packets from being forwarded as is, the relevant technologies enable the QinQ function on the ingress port of all packets, thereby protecting the original VLAN tags in the packets from being damaged.

[0003] However, when QinQ is enabled, a temporary VLAN tag is added to packets during processing. Since aggregation and distribution devices can only recognize a maximum of two VLAN tags, if the original packet already has two VLAN tags, adding another VLAN tag will prevent the aggregation and distribution devices from accurately identifying the network and transport layer fields in the packet, thus hindering accurate load balancing. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a message processing method, apparatus, electronic device, and storage medium.

[0005] According to a first aspect of the present disclosure, a message processing method is provided, applied to an aggregation and distribution device, the aggregation and distribution device having a default Virtual Local Area Network (VLAN) identifier, the method comprising:

[0006] Determine whether the first packet to be processed carries the first VLAN tag. The first VLAN tag includes the first VLAN identifier. The default VLAN identifier is different from the first VLAN identifier.

[0007] If the first message carries the first VLAN tag, then remove the first VLAN tag from the first message, write the first VLAN identifier into the header of the first message, and obtain the second message;

[0008] According to the traffic splitting rules, the second packet is processed to obtain the third packet. The third packet carries the second VLAN tag, which includes the second VLAN identifier. The second VLAN identifier is generated based on the VLAN identifier in the header of the second packet.

[0009] If the second VLAN ID is different from the default VLAN ID, the third packet will be forwarded to the specified port.

[0010] In some embodiments, the second message is processed according to the traffic splitting rules to obtain the third message, including:

[0011] Based on the traffic splitting rules, determine the processing method for the second message;

[0012] According to the processing method of the second message, the multicast group identifier corresponding to the processing method is written into the second message. The multicast group identifier is used to determine the specified port.

[0013] Based on the VLAN identifier in the header of the second message, a second VLAN tag is added to the second message containing the multicast group identifier in order to obtain the third message.

[0014] In some embodiments, depending on the processing method of the second message, a multicast group identifier corresponding to the processing method is written into the second message, including:

[0015] Determine the multicast group identifier corresponding to the processing method;

[0016] Write the multicast group identifier into the specified location in the Media Access Control MAC address of the second message.

[0017] In some embodiments, the method further includes:

[0018] Reserve the VLAN ID as the default VLAN ID so that the default VLAN ID is different from the first VLAN ID.

[0019] In some embodiments, the VLAN identifier is reserved as 4095.

[0020] In some embodiments, the method further includes:

[0021] If the first message does not carry the first VLAN tag, the default VLAN identifier is written into the header of the first message to obtain the second message.

[0022] In some embodiments, the method further includes:

[0023] If the second VLAN identifier is the same as the default VLAN identifier, then the second VLAN tag carried in the third packet is removed;

[0024] Forward the third packet, after removing the second VLAN tag, to the designated port.

[0025] According to a second aspect of the present disclosure, a message processing apparatus is provided, applied to an aggregation and distribution device, the aggregation and distribution device having a default VLAN identifier, the apparatus comprising:

[0026] The judgment module is used to determine whether the first packet to be processed carries the first VLAN tag. The first VLAN tag includes the first VLAN identifier. The default VLAN identifier is different from the first VLAN identifier.

[0027] The first processing module is configured to, if the first packet carries a first VLAN tag, remove the first VLAN tag carried in the first packet, write the first VLAN identifier into the packet header of the first packet, and obtain the second packet.

[0028] The second processing module is used to process the second packet according to the traffic splitting rules to obtain the third packet. The third packet carries the second VLAN tag, which includes the second VLAN identifier. The second VLAN identifier is generated based on the VLAN identifier in the header of the second packet.

[0029] The forwarding module is used to forward the third packet to the specified port if the second VLAN identifier is different from the default VLAN identifier.

[0030] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of the first aspect of the present disclosure by executing the executable instructions.

[0031] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method of the first aspect of the present disclosure.

[0032] The technical solutions provided in this disclosure can include the following beneficial effects:

[0033] The method provided in this disclosure can be applied to an aggregation and distribution device that has a default Virtual Local Area Network (VLAN) identifier. Specifically, it determines whether a first packet to be processed carries a first VLAN tag. If the first packet carries a first VLAN tag, the first VLAN tag is removed, and the first VLAN identifier is written into the header of the first packet to obtain a second packet. The first VLAN tag includes the first VLAN identifier, and the default VLAN identifier is different from the first VLAN identifier. Subsequently, according to the distribution rules, the second packet is processed to obtain a third packet. The third packet carries a second VLAN tag, which includes the second VLAN identifier, generated based on the VLAN identifier in the header of the second packet. If the second VLAN identifier is different from the default VLAN identifier, the third packet is forwarded to a designated port. This disclosure can process packets carrying VLAN tags of layers 0 to 2, ensuring that the packets are output as is after processing, thereby achieving flow-based load balancing.

[0034] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0035] Figure 1 This diagram illustrates an application scenario of the convergence and splitting device in an embodiment of this disclosure.

[0036] Figure 2 A schematic diagram of the Ethernet data frame format in an embodiment of this disclosure is shown.

[0037] Figure 3 This diagram illustrates a message processing method according to an embodiment of the present disclosure.

[0038] Figure 4 A schematic diagram of the structure of a message processing apparatus according to an embodiment of the present disclosure is shown.

[0039] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

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

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

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

[0043] To facilitate understanding, the following explanations are provided for several terms used in this disclosure:

[0044] Aggregation and splitting devices are a typical type of network equipment. For example... Figure 1As shown, the aggregation and distribution device 103 is usually connected to the network in bypass mode. After the Internet packets output by the switch 101 / router 102 of the Internet backbone are sent to the aggregation and distribution device 103, the aggregation and distribution device 103 performs preliminary analysis and processing according to the specified rules and forwards them to the specified backend business system 104 for further analysis.

[0045] Aggregation and distribution equipment often includes switching chips and programmable chips to enable packet splitting and forwarding. For example, in aggregation and distribution equipment that uses programmable chips for service processing, a switching chip typically uses an access control list (ACL) for packet routing: packets enter from the panel port connected to the switching chip, are redirected via the ACL, and then output from the internal port connected to the programmable chip. After processing, the service processing program on the programmable chip decides whether to discard the packet or output it from a designated port.

[0046] Furthermore, as a network analysis device, the aggregation and distribution equipment typically receives packets copied from the backbone network via optical splitters or mirroring functions. Therefore, the aggregation and distribution equipment must support outputting all bytes or the first N bytes (N being a positive integer) of the original packet to the backend service system intact. In other words, the headers of several layers of the packets entering and leaving the device must remain unchanged. Usually, only the MAC address is allowed to be modified (the MAC address is usually meaningless to the backend service system).

[0047] A Virtual Local Area Network (VLAN) is a communication technology that logically divides a physical LAN into multiple broadcast domains. Hosts within a VLAN can communicate directly, while hosts in different VLANs cannot communicate directly, thus restricting broadcast messages to within a single VLAN.

[0048] To enable devices to distinguish between packets from different VLANs, a field identifying VLAN information needs to be added to the packet. The IEEE 802.1Q protocol specifies that a 4-byte VLAN tag should be added after the destination MAC address and source MAC address fields and before the protocol type field in the Ethernet data frame to identify VLAN information.

[0049] For example, such as Figure 2As shown, a VLAN tag consists of 4 bytes: a 2-byte Tag Protocol Identifier (TPID) indicating the data frame type (which can be set to 0x8100 to represent an IEEE 802.1Q VLAN data frame); and a 1-bit Canonical Format Indicator (CFI) indicating whether the MAC address is encapsulated in a standard format; and a 12-bit VLAN Identifier (VID) indicating the VLAN to which the data frame belongs. Data frames can only be transmitted within their respective VLANs.

[0050] As mentioned earlier, packets processed by aggregation and distribution equipment must remain unchanged except for their MAC addresses before and after processing. Related technologies configure the panel ports of the aggregation and distribution equipment as hybrid ports, allowing packets without VLAN tags or carrying any VLAN tags to enter. Then, QinQ is enabled on all inbound ports of the aggregation and distribution equipment, forcing an outer VLAN tag (VLAN value 1) to be added to the packets when they enter the switching chip. This forcibly added outer VLAN tag protects the packet's own VLAN tag from being corrupted.

[0051] However, aggregation and distribution devices can only recognize a maximum of two VLAN tags. Beyond two layers, they cannot be recognized, and the subsequent network and transport layer fields cannot be extracted. This prevents the internal aggregation port from correctly load-sharing such packets. Because enabling QinQ on the aggregation and distribution device port adds a VLAN tag to the packet, if the original packet already has two VLAN tags, adding another layer makes it impossible for the aggregation and distribution device to recognize the network and transport layer fields, thus hindering accurate load-sharing when sending packets through the internal aggregation port. Packets with double VLAN tags are quite common in networks, and related technologies cannot handle them properly.

[0052] In view of this, the embodiments of this disclosure make the default VLAN identifier of the aggregation and distribution device different from the VLAN identifier carried in the packet, so that the packet can maintain the original VLAN tag output without enabling the QinQ function during processing. This avoids the problem in related technologies where the aggregation and distribution device cannot recognize packets containing more than two layers of VLAN tags.

[0053] The following will describe the exemplary implementation method in detail with reference to the accompanying drawings and embodiments.

[0054] First, this disclosure provides a message processing method that can be executed by a convergence and splitting device.

[0055] Figure 3 This diagram illustrates a message processing method according to an embodiment of the present disclosure, such as... Figure 3 As shown in the embodiments of this disclosure, the message processing method includes the following steps.

[0056] S301, determine whether the first packet to be processed carries the first VLAN tag. The first VLAN tag includes the first VLAN identifier. The default VLAN identifier is different from the first VLAN identifier.

[0057] It should be noted that the first message can be a message sent from a network element in the backbone network to the aggregation and distribution device.

[0058] In some embodiments, since the source of the first message is uncontrollable, it may be sent by any network element in the backbone network. This disclosure embodiment can use a reserved VLAN identifier as the default VLAN identifier to ensure that the default VLAN identifier is different from the first VLAN identifier. It should be understood that a reserved VLAN is a VLAN reserved by the router or switch system to implement specific functions. Based on this nature, the VLAN identifier in the VLAN tag usually does not use a reserved VLAN. The reserved VLAN identifier can be set according to the communication protocol or manually set in the switch or router; this disclosure embodiment does not limit this.

[0059] For example, since 4095 is a common reserved VLAN identifier specified in the relevant communication protocol, the reserved VLAN identifier in this embodiment of the disclosure can be selected as 4095.

[0060] Based on this, it can be ensured that the default VLAN identifier of the aggregation and distribution device in this embodiment is different from the VLAN identifier in the packet. Compared with related technologies, it is not necessary to enable the QinQ function to ensure that all bytes or the first N bytes of the original packet are output to the backend business system unchanged. In other words, the packet processed by this embodiment remains unchanged before and after processing.

[0061] S302, if the first message carries the first VLAN tag, then remove the first VLAN tag carried by the first message, write the first VLAN identifier into the message header of the first message, and obtain the second message.

[0062] It should be noted that, in this embodiment of the disclosure, the first VLAN identifier can be written into the header of the first packet first, and then the first VLAN tag carried by the first packet can be removed; alternatively, the first VLAN tag carried by the first packet can be removed first, and then the first VLAN identifier can be written into the header of the first packet. Of course, the two actions in S302 can also be performed simultaneously, and this embodiment of the disclosure does not limit the execution order.

[0063] In some embodiments, the packet header can be a HiGig header. To improve processing performance, the switching chips in aggregation and distribution devices process certain headers in the packets. For example, when Broadcom switching chips forward packets across chips, they add a HiGig header before the packet's data link layer header to carry information about the packet, such as the original ingress port, destination egress port, and operating mode. This HiGig header contains a VLAN field, indicating the outer VLAN of the packet.

[0064] In some embodiments, if the first message does not carry the first VLAN tag, the default VLAN identifier is written into the header of the first message to obtain the second message.

[0065] S303, according to the traffic splitting rules, the second packet is processed to obtain the third packet. The third packet carries the second VLAN tag. The second VLAN tag includes the second VLAN identifier, which is generated based on the VLAN identifier in the header of the second packet.

[0066] In some embodiments, the second VLAN identifier may be the same as the VLAN identifier in the header of the second packet. For example, if the VLAN identifier written in the header is the first VLAN identifier, then the second VLAN identifier is the same as the first VLAN identifier. If the VLAN identifier written in the header is the default VLAN identifier, then the second VLAN identifier is the same as the default VLAN identifier.

[0067] In some embodiments, S303 specifically includes: determining the processing method of the second packet according to the traffic splitting rules; writing a multicast group identifier corresponding to the processing method into the second packet according to the processing method of the second packet; and adding a second VLAN tag to the second packet in which the multicast group identifier is written according to the VLAN identifier in the packet header of the second packet, so as to obtain a third packet.

[0068] In some embodiments, depending on the processing method of the second message, the method of writing the multicast group identifier corresponding to the processing method into the second message may be: determining the multicast group identifier corresponding to the processing method; and writing the multicast group identifier into a specified position in the MAC address of the second message.

[0069] Specifically, the second message can be processed in either normal forwarding or copy forwarding.

[0070] For example, when the processing method for the second packet hit is replication forwarding, the programmable chip in the aggregation and distribution device can be used to fill the pre-assigned multicast group identifier (ID) into a specified position of the second packet's MAC address (e.g., the lower 12 bits of the source MAC of the second packet). When the processing method for the second packet hit is normal forwarding, the programmable chip in the aggregation and distribution device can be used to fill the specified position with an invalid multicast group identifier (e.g., 0).

[0071] In some embodiments, replication forwarding can be implemented using Layer 2 multicast replication technology. Utilizing the Layer 2 multicast group function of the switching chip on the aggregation and distribution device, all destination ports involved in packet forwarding can be added to the same multicast group. Furthermore, to ensure that packets are assigned to a specified multicast group during forwarding, an Access Control List (ACL) corresponding to the multicast group can be pre-configured in the switching chip.

[0072] It should be noted that ACL is a traffic access control technology that enables specific control over specific packets by setting a series of entries in the packet forwarding path that specify packet matching conditions and packet processing actions.

[0073] It should be noted that the multicast group identifier is used to determine the designated port in this embodiment of the disclosure, that is, the target port for message forwarding.

[0074] For example, when the multicast group identifier is a preset valid identifier, the packet can be forwarded to the multicast group corresponding to the multicast group identifier by matching the filled multicast group identifier through the ACL. Subsequently, the multicast function module of the switching chip can copy the packet to all ports within the multicast group to complete the packet copying and forwarding.

[0075] For example, when the multicast group identifier is invalid, the message will be forwarded to the default destination port in the message.

[0076] S304 If the second VLAN identifier is different from the default VLAN identifier, the third packet will be forwarded to the specified port.

[0077] It should be noted that when the aggregation and distribution device outputs a third packet, it will still check whether the third packet contains a second VLAN tag that needs to be removed. Specifically, the switching chip in the aggregation and distribution device can check the second VLAN tag. If the second VLAN identifier in the second VLAN tag is different from the default identifier, the second VLAN tag is not removed, and the third packet is directly forwarded to the designated port. If the second VLAN identifier in the second VLAN tag is the same as the default identifier, the second VLAN tag carried in the third packet is removed, and the third packet with the second VLAN tag removed is forwarded to the designated port.

[0078] The embodiments disclosed herein can process packets carrying VLAN tags of layers 0 to 2, so that the packets can still be output as is after processing, thereby realizing flow-based load balancing.

[0079] Based on the same inventive concept, this disclosure also provides a message processing apparatus, as shown in the following embodiments. Since the principle by which this apparatus solves the problem is similar to that of the method embodiments described above, the implementation of this apparatus embodiment can refer to the implementation of the method embodiments described above, and repeated details will not be elaborated further.

[0080] Figure 4 This diagram illustrates the structure of a message processing apparatus according to an embodiment of the present disclosure, such as... Figure 4 As shown, the message processing device 400 is applied to the aggregation and distribution equipment, which has a default VLAN identifier.

[0081] Specifically, the packet processing device 400 includes: a judgment module 401, a first processing module 402, a second processing module 403, and a forwarding module 404. The judgment module 401 is used to determine whether the first packet to be processed carries a first VLAN tag. The first VLAN tag includes a first VLAN identifier, and the default VLAN identifier is different from the first VLAN identifier. The first processing module 402 is used to, if the first packet carries a first VLAN tag, remove the first VLAN tag from the first packet and write the first VLAN identifier into the header of the first packet to obtain a second packet. The second processing module 403 is used to process the second packet according to the traffic splitting rules to obtain a third packet. The third packet carries a second VLAN tag, which includes a second VLAN identifier, generated based on the VLAN identifier in the header of the second packet. The forwarding module 404 is used to, if the second VLAN identifier is different from the default VLAN identifier, forward the third packet to a designated port.

[0082] In some embodiments, the second processing module 403 is further configured to: determine the processing method of the second packet according to the traffic splitting rules; write a multicast group identifier corresponding to the processing method into the second packet according to the processing method of the second packet, the multicast group identifier being used to determine the specified port; and add a second VLAN tag to the second packet in which the multicast group identifier is written according to the VLAN identifier in the packet header of the second packet, so as to obtain a third packet.

[0083] In some embodiments, the second processing module 403 is further configured to determine the multicast group identifier corresponding to the processing method and write the multicast group identifier into a specified position in the media access control MAC address of the second message.

[0084] In some embodiments, the message processing apparatus 400 further includes a third processing module (not shown in the figure). The third processing module is used to use a reserved VLAN identifier as a default VLAN identifier, so that the default VLAN identifier is different from the first VLAN identifier.

[0085] In some embodiments, the VLAN identifier is reserved as 4095.

[0086] In some embodiments, the first processing module 402 is further configured to, if the first message does not carry the first VLAN tag, write the default VLAN identifier into the header of the first message to obtain the second message.

[0087] In some embodiments, the forwarding module 404 is further configured to: if the second VLAN identifier is the same as the default VLAN identifier, remove the second VLAN tag carried in the third packet; and forward the third packet after removing the second VLAN tag to the designated port.

[0088] It should be noted that the message processing apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when used for message processing. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the apparatus can be divided into different functional modules to complete all or part of the functions described above. In addition, the message processing apparatus and message processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0089] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0090] The following reference Figure 5To describe an electronic device 500 according to such an embodiment of the present disclosure. Figure 5 The electronic device 500 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0091] like Figure 5 As shown, the electronic device 500 is manifested in the form of a general-purpose computing device. The components of the electronic device 500 may include, but are not limited to: at least one processing unit 510, at least one storage unit 520, and a bus 530 connecting different system components (including storage unit 520 and processing unit 510).

[0092] The storage unit stores program code, which can be executed by the processing unit 510, causing the processing unit 510 to perform the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of this disclosure.

[0093] In some embodiments, the processing unit 510 may perform the following steps of the above method embodiment: determine whether the first packet to be processed carries a first VLAN tag, the first VLAN tag including a first VLAN identifier, and the default VLAN identifier being different from the first VLAN identifier; if the first packet carries a first VLAN tag, then remove the first VLAN tag carried by the first packet, write the first VLAN identifier into the packet header of the first packet, and obtain a second packet; process the second packet according to the traffic splitting rule to obtain a third packet, the third packet carrying a second VLAN tag, the second VLAN tag including a second VLAN identifier, the second VLAN identifier being generated based on the VLAN identifier in the packet header of the second packet; if the second VLAN identifier is different from the default VLAN identifier, then forward the third packet to the specified port.

[0094] Storage unit 520 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 5201 and / or cache memory 5202, and may further include a read-only memory (ROM) 5203.

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

[0096] Bus 530 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0097] Electronic device 500 can also communicate with one or more external devices 540 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with the electronic device 500, and / or with any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 550. Furthermore, electronic device 500 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 560. Figure 5 As shown, network adapter 560 communicates with other modules of electronic device 500 via bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0098] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0099] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the methods described above is stored thereon. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0100] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0101] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.

[0102] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0103] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0104] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0105] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0106] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0107] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

Claims

1. A message processing method, characterized in that, Applied to a convergence and splitting device, the convergence and splitting device having a default Virtual Local Area Network (VLAN) identifier, the method includes: Determine whether the first packet to be processed carries a first VLAN tag, wherein the first VLAN tag includes a first VLAN identifier, and the default VLAN identifier is different from the first VLAN identifier; If the first message carries the first VLAN tag, then the first VLAN tag carried by the first message is removed, and the first VLAN identifier is written into the header of the first message to obtain the second message; According to the traffic splitting rules, the second packet is processed to obtain a third packet. The third packet carries a second VLAN tag, which includes a second VLAN identifier. The second VLAN identifier is generated based on the VLAN identifier in the header of the second packet. If the second VLAN identifier is different from the default VLAN identifier, the third packet is forwarded to the designated port; If the first message does not carry the first VLAN tag, then the default VLAN identifier is written into the header of the first message to obtain the second message; If the second VLAN identifier is the same as the default VLAN identifier, then the second VLAN tag carried in the third packet is removed, and the third packet after removing the second VLAN tag is forwarded to the designated port.

2. The method according to claim 1, characterized in that, The process of processing the second message according to the traffic splitting rules to obtain the third message includes: Based on the aforementioned traffic splitting rules, determine the processing method for the second message; According to the processing method of the second message, a multicast group identifier corresponding to the processing method is written into the second message, and the multicast group identifier is used to determine the specified port; Based on the VLAN identifier in the header of the second message, the second VLAN tag is added to the second message containing the multicast group identifier in order to obtain the third message.

3. The method according to claim 2, characterized in that, The step of writing a multicast group identifier corresponding to the processing method of the second message into the second message includes: Determine the multicast group identifier corresponding to the processing method; Write the multicast group identifier into a specified location in the Media Access Control (MAC) address of the second message.

4. The method according to claim 1, characterized in that, The method further includes: The reserved VLAN identifier is used as the default VLAN identifier, so that the default VLAN identifier is different from the first VLAN identifier.

5. The method according to claim 4, characterized in that, The reserved VLAN identifier is 4095.

6. A message processing apparatus, characterized in that, Applied to a convergence and splitting device, the convergence and splitting device having a default VLAN identifier, the device includes: The judgment module is used to determine whether the first packet to be processed carries a first VLAN tag, wherein the first VLAN tag includes a first VLAN identifier, and the default VLAN identifier is different from the first VLAN identifier; The first processing module is configured to, if the first packet carries the first VLAN tag, remove the first VLAN tag carried in the first packet, write the first VLAN identifier into the packet header of the first packet, and obtain the second packet. The second processing module is used to process the second packet according to the traffic splitting rules to obtain a third packet. The third packet carries a second VLAN tag, which includes a second VLAN identifier. The second VLAN identifier is generated based on the VLAN identifier in the header of the second packet. The forwarding module is configured to: forward the third packet to a designated port if the second VLAN identifier is different from the default VLAN identifier; write the default VLAN identifier into the header of the first packet to obtain a second packet if the first packet does not carry the first VLAN tag; and remove the second VLAN tag from the third packet and forward the third packet after removing the second VLAN tag to the designated port if the second VLAN identifier is the same as the default VLAN identifier.

7. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 5 by executing the executable instructions.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Message converging and shunting method and device and electronic equipment

    CN112968841A

  • Message processing method and device, equipment and storage medium

    CN113595931A