Multi-layer VLAN message processing method, device and equipment based on switch

By analyzing the structure of multi-layer VLAN messages in the switch, inserting fill fields, and skipping fill fields in the backplane card, the problem that existing switches cannot recognize multi-layer VLANs and different TPID messages is solved, and adapting to complex network environments and the accuracy and consistency of message processing are achieved.

CN119363690BActive Publication Date: 2025-03-28YUNHE ZHIWANG (SHANGHAI) TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411942741.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-28
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

When existing switches process packets with multi-layer VLANs, they cannot recognize multi-layer VLAN structures and packets with different TPIDs, resulting in the inability to accurately parse subsequent packet fields of VLANs, affecting the normal forwarding and processing of packets.

Method used

When receiving a message with a multi-layer VLAN, the number of VLAN layers and TPID is analyzed, and the fill field is inserted after the VLAN field, so that the number of VLAN layers is the preset number of layers. Identify and skip the fill field content in the backplane card to parse subsequent message fields, and match the input port value and IP quintile information according to the ACL rules to ensure the forwarding path of the message. Finally, the fill field is deleted in the target board to restore the original VLAN format of the packet.

Benefits of technology

It realizes flexible processing of packets of multi-layer VLAN and multiple TPIDs, expands the switch's VLAN recognition capabilities, improves the accuracy of packet resolution, maintains the consistency of packets, and adapts to traffic management requirements in complex network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363690B_ABST
    Figure CN119363690B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-layer VLAN message processing method, device and equipment based on a switch. When receiving a message with multiple layers of VLAN, the method analyzes the number of VLAN layers and the TPID of each layer in the message; in the line card, for messages with different numbers of VLAN layers, a padding field is inserted after the VLAN field thereof, so that the number of VLAN layers of the message is a preset number of layers; in the backplane card, the padding field is identified according to the configured rule and the padding field content is skipped to parse the message field subsequent to the padding field to obtain the input port value and IP five-tuple information, and the input port value and the IP five-tuple information are matched according to the configured ACL rule to ensure the forwarding path of the message; the message is sent to the target board card according to the forwarding path, and in the final processing stage of the message, the padding field is deleted according to the number of padding bytes marked in the padding field, and the message is restored to the original VLAN format. The present invention enables the switch to identify and process multi-layer VLAN messages with different TPIDs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network equipment, and in particular to a multi-layer VLAN message processing method, device and equipment based on a switch. Background Art

[0002] In the current network environment, rack-mounted data splitters (such as rack-mounted switches) are widely used for traffic management in data centers or enterprise networks. In actual applications, messages with different VLAN layers often appear, and these VLANs not only have different layers, but may also use different TPIDs (Tag Protocol Identifiers). Traditional switches usually only support a few types of TPIDs and only support the identification and processing capabilities of two layers of VLANs, which limits data traffic management in complex network environments.

[0003] When existing switches use access control list (ACL) rules to match messages with multiple layers of VLAN, they cannot identify the multiple layers of VLAN structure and messages with different TPIDs, which causes the switches to be unable to accurately parse the subsequent message fields of VLAN, thus affecting the normal forwarding and processing of messages. Therefore, expanding the processing capabilities of switches for multiple layers of VLAN and multiple TPIDs has become an urgent problem to be solved for data splitters. Summary of the invention

[0004] In view of the above problems, the purpose of the embodiments of the present invention is to provide a switch-based multi-layer VLAN message processing method, device and equipment to improve the above problems.

[0005] The embodiment of the present invention provides a switch-based multi-layer VLAN message processing method, which includes:

[0006] S101, when receiving a message with multiple VLAN layers, analyzing the number of VLAN layers and the TPID of each layer in the message;

[0007] S102, in the line card, for messages of different VLAN layers, inserting a padding field after the VLAN field thereof, so that the number of VLAN layers of the message is a preset number; wherein the padding field includes the outermost tracing VLAN field T-tag, which is used to carry the input port value of the message, and different padding values ​​are used in the padding field to mark the number of padding bytes inserted;

[0008] S103, in the backplane card, the padding field is identified according to the configured rule and the padding field content is skipped to parse the message field subsequent to the padding field to obtain the input port value and the IP five-tuple information, and the input port value and the IP five-tuple information are matched according to the configured ACL rule to ensure the forwarding path of the message;

[0009] S104, sending the message to the target board according to the forwarding path, in the final processing stage of the message of the target board, deleting the padding field according to the number of padding bytes marked in the padding field, and restoring the message to the original VLAN format.

[0010] Preferably, the VLAN format of the message includes a destination MAC address, a source MAC address, a VLAN tag, a message type, a payload, and a frame check sequence.

[0011] Preferably, the length of the padding field is determined according to the number of bytes required to be filled.

[0012] Preferably, the IP quintuple information includes source IP address, destination IP address, source port, destination port, and protocol.

[0013] Preferably, it also includes:

[0014] A layer of VLAN tag is added after the message padding field. The vid field of this layer of VLAN tag carries the port ID of the outgoing port.

[0015] Preferably, in step S103, it also includes:

[0016] If the ACL rule cannot be matched correctly or the packet format has problems, the packet is discarded.

[0017] The embodiment of the present invention further provides a switch-based multi-layer VLAN message processing device, which includes:

[0018] An analysis unit, configured to analyze the number of VLAN layers and the TPID of each layer in the message when receiving a message with multiple layers of VLAN;

[0019] A padding unit is used to insert a padding field after the VLAN field of a message with different VLAN layers in the line card, so that the number of VLAN layers of the message is a preset number of layers; wherein the padding field includes the outermost tracing VLAN field T-tag, which is used to carry the input port value of the message, and different padding values ​​are used in the padding field to mark the number of padding bytes inserted;

[0020] A matching unit is used to identify the padding field and skip the padding field content in the backplane card according to the configured rules, so as to parse the message fields subsequent to the padding field, obtain the input port value and the IP five-tuple information, and match the input port value and the IP five-tuple information according to the configured ACL rules to ensure the forwarding path of the message;

[0021] The deletion unit is used to send the message to the target board according to the forwarding path, and in the final processing stage of the message of the target board, delete the padding field according to the number of padding bytes marked in the padding field, and restore the message to the original VLAN format.

[0022] An embodiment of the present invention further provides a switch-based multi-layer VLAN message processing device, which includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the switch-based multi-layer VLAN message processing method as described above.

[0023] In summary, compared with the prior art, this embodiment has at least the following improvements:

[0024] 1. Extended VLAN identification capability: By identifying the multi-layer VLAN message structure and inserting a padding field after the VLAN field, the number of VLAN layers is completed to a fixed number. This makes it compatible with VLAN messages of different TPID types and realizes flexible VLAN layer expansion.

[0025] 2. Improve the accuracy of message parsing: The design of the padding field includes a marker for the number of inserted bytes, which makes it easier to identify and skip the field during subsequent message parsing, ensuring the accuracy of message parsing. Configure the switch's parser and ACL rules to skip the padding field so that the subsequent actual message fields can be accurately parsed and the message five-tuple information can be matched.

[0026] 3. Message consistency maintenance: When the line card outputs the message, according to the number of padding bytes marked in the padding field, the completed padding field is deleted and the format of the original message is restored, thereby ensuring the consistency of the message in network transmission. The restoration process ensures the integrity of the message, does not change the content structure of the message, and does not damage the original format of the message.

[0027] 4. Adapt to complex network environments: Without changing the switch hardware, its VLAN resolution capability can be expanded to support messages with different TPIDs and multi-layer VLANs, which is suitable for traffic management and diversion needs in complex environments such as data centers and enterprise networks. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1It is a flow chart of a multi-layer VLAN message processing method based on a switch provided in the first embodiment of the present invention.

[0030] Figure 2 This is a schematic diagram of adding a completion field.

[0031] Figure 3 It is a schematic diagram of the AVL matching and redirection process.

[0032] Figure 4 This is a schematic diagram of the message restoration process.

[0033] Figure 5 A schematic diagram of the structure of a switch-based multi-layer VLAN message processing device provided in the second embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] See also Figure 1 The first embodiment of the present invention provides a switch-based multi-layer VLAN message processing method, which can be executed by a switch-based multi-layer VLAN message processing device (hereinafter referred to as a processing device), and in particular, is executed by one or more processors in the processing device to implement the following steps:

[0036] S101, when a message with multiple layers of VLAN is received, the number of VLAN layers and the TPID of each layer in the message are analyzed.

[0037] In this embodiment, the switch may receive messages of different VLAN layers. The VLAN format of the message includes the destination MAC address (dmac), the source MAC address (smac), the VLAN tag (tag), the message type (type), the payload (payload) and the frame check sequence (FCS).

[0038] The message may contain multiple VLAN tags (including different TPIDs), and some tags may have unknown TPID types. Figure 2 In the figure, tag represents the known TPID carried by the message, and MPLSx represents the tunnel message with multiple layers of MPLS labels.

[0039] S102, in the line card, for messages of different VLAN layers, a padding field is inserted after the VLAN field thereof, so that the VLAN layer number of the message is a preset number of layers; wherein the padding field includes the outermost tracing VLAN field T-tag, which is used to carry the input port value of the message, and different padding values ​​are used in the padding field to mark the number of padding bytes inserted.

[0040] In this embodiment, the message first enters a line card, such as Line Card #1, and the switch in the line card uses user-defined ACL rules to traverse and identify the VLAN information carried by the message for preliminary processing. VLAN tags of different TPIDs and multi-layer VLAN structures are identified and parsed.

[0041] In this embodiment, the length of the padding field is determined according to the number of bytes that need to be filled. For messages that do not carry VLAN information, the padding field is directly added, while messages that carry multiple layers of VLAN tags will be filled with the padding field at the end to ensure that the number of VLAN layers in the message reaches a preset fixed number of layers (for example, 4 layers).

[0042] In this embodiment, the completion field also includes a mark of the number of padding bytes, such as Figure 2 As shown in pad-0~pad-2, these padding parts can be easily identified in subsequent processing.

[0043] In addition, to support the port + IP 5-tuple matching mode, the line card will also add an outermost label such as Figure 2 The VLAN field T-tag is used to carry the input port information of the message.

[0044] S103, in the backplane card, the padding field is identified according to the configured rules and the padding field content is skipped to parse the message fields subsequent to the padding field to obtain the input port value and the IP five-tuple information, and the input port value and the IP five-tuple information are matched according to the configured ACL rules to ensure the forwarding path of the message.

[0045] S104, sending the message to the target board according to the forwarding path, in the final processing stage of the message of the target board, deleting the padding field according to the number of padding bytes marked in the padding field, and restoring the message to the original VLAN format.

[0046] In this embodiment, if Figure 3As shown in the figure, after being processed by Line Card #1, the message is forwarded to the backplane card (Fabric Card), where the ACL (Access Control List) rule is used to match the customer's final goal. Among them, the ACL rule uses the port + IP 5-tuple information as the key, which is responsible for matching the message input port and the five-tuple information (such as source IP, destination IP, source port, destination port and protocol), and determines the forwarding path of the message.

[0047] In order to allow the egress line card to determine the actual egress port of the message, the backplane card will also add a layer of VLAN tag after the message filling field, such as Figure 2 As shown in the E-tag field, the vid field of the vlan tag at this layer will carry the port id of the outgoing port.

[0048] To avoid mismatching, the parser of the switching chip is configured to skip the padding field in the message and directly parse the actual message content to ensure the accuracy of the message during the ACL matching process.

[0049] After the Fabric Card matches the ACL rule of the message, it transmits the message to the target line card (such as LineCard #2 or Line Card #N).

[0050] In these target line cards, the message passes through the switch chip again for further processing. For example, the switch chip on Line Card #2 detects the padding fields and skips them based on the value of the padding byte count flag, thereby directly parsing the actual content of the message.

[0051] like Figure 4 As shown in the figure, when the message is in the final processing stage, the T-tag, padding field and E-tag are deleted, and the message is restored to the original format, such as the standard Ethernet frame format (4 layers or less VLAN tags, including the original TPID and VLAN structure). This ensures the consistency of message transmission in the network and does not cause incompatibility of message formats due to the existence of padding fields.

[0052] In addition, there is an exception handling mechanism on the Fabric Card, such as Figure 3 In some cases, if the ACL rule cannot be matched correctly or there is a problem with the message format, the message will be discarded to ensure data security and network traffic stability.

[0053] In summary, compared with the prior art, this embodiment has at least the following improvements:

[0054] 1. Extended VLAN identification capability: By identifying the multi-layer VLAN message structure and inserting a padding field after the VLAN field, the number of VLAN layers is completed to a fixed number. This makes it compatible with VLAN messages of different TPID types and realizes flexible VLAN layer expansion.

[0055] 2. Improve the accuracy of message parsing: The design of the padding field includes a marker for the number of inserted bytes, which makes it easier to identify and skip the field during subsequent message parsing, ensuring the accuracy of message parsing. Configure the switch's parser and ACL rules to skip the padding field so that the subsequent actual message fields can be accurately parsed and the message five-tuple information can be matched.

[0056] 3. Message consistency maintenance: When the line card outputs the message, according to the number of padding bytes marked in the padding field, the completed padding field is deleted and the format of the original message is restored, thereby ensuring the consistency of the message in network transmission. The restoration process ensures the integrity of the message, does not change the content structure of the message, and does not damage the original format of the message.

[0057] 4. Adapt to complex network environments: Without changing the switch hardware, its VLAN resolution capability can be expanded to support messages with different TPIDs and multi-layer VLANs, which is suitable for traffic management and diversion needs in complex environments such as data centers and enterprise networks.

[0058] See also Figure 5 The second embodiment of the present invention further provides a switch-based multi-layer VLAN message processing device, which includes:

[0059] The analyzing unit 210 is used to analyze the number of VLAN layers and the TPID of each layer in the message when receiving a message with multiple layers of VLAN;

[0060] A padding unit 220 is used to insert a padding field after the VLAN field of a message with different VLAN layers in the line card, so that the VLAN layer number of the message is a preset number of layers; wherein the padding field includes the outermost tracing VLAN field T-tag, which is used to carry the input port value of the message, and different padding values ​​are used in the padding field to mark the number of padding bytes inserted;

[0061] The matching unit 230 is used to identify the padding field and skip the padding field content in the backplane card according to the configured rules, so as to parse the message fields subsequent to the padding field to obtain the input port value and the IP five-tuple information, and match the input port value and the IP five-tuple information according to the configured ACL rules to ensure the forwarding path of the message;

[0062] The deletion unit 240 is used to send the message to the target board according to the forwarding path. In the final processing stage of the message of the target board, the padding field is deleted according to the number of padding bytes marked in the padding field to restore the message to the original VLAN format.

[0063] The third embodiment of the present invention further provides a switch-based multi-layer VLAN message processing device, which includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the switch-based multi-layer VLAN message processing method as described above.

[0064] The fourth embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement the switch-based multi-layer VLAN message processing method as described above.

[0065] In several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0066] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0067] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code. It should be noted that in this article, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.

[0068] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0069] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0070] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0071] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.

[0072] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A multi-layer VLAN message processing method based on a switch, characterized in that: include: S101, when receiving a message with multiple layers of VLAN, analyzing the number of VLAN layers and the TPID of each layer in the message; S102, in the line card, for messages of different VLAN layers, inserting a padding field after the VLAN field thereof, so that the number of VLAN layers of the message is a preset number; wherein the padding field includes the outermost tracing VLAN field T-tag, which is used to carry the input port value of the message, and different padding values ​​are used in the padding field to mark the number of padding bytes inserted; S103, in the backplane card, the padding field is identified according to the configured rule and the padding field content is skipped to parse the message field subsequent to the padding field to obtain the input port value and the IP five-tuple information, and the input port value and the IP five-tuple information are matched according to the configured ACL rule to ensure the forwarding path of the message; S104, sending the message to the target board according to the forwarding path, in the final processing stage of the message of the target board, deleting the padding field according to the number of padding bytes marked in the padding field, and restoring the message to the original VLAN format.

2. The switch-based multi-layer VLAN message processing method according to claim 1, characterized in that: The VLAN format of the message includes a destination MAC address, a source MAC address, a VLAN tag, a message type, a valid load, and a frame check sequence.

3. The switch-based multi-layer VLAN message processing method according to claim 1, characterized in that: The length of the padding field is determined by the number of bytes that need to be filled.

4. The switch-based multi-layer VLAN message processing method according to claim 3, characterized in that: The IP five-tuple information includes source IP address, destination IP address, source port, destination port, and protocol.

5. The switch-based multi-layer VLAN message processing method according to claim 1, characterized in that: In step S103, it also includes: A layer of VLAN tag is added after the message padding field. The vid field of this layer of VLAN tag carries the port ID of the outgoing port.

6. The switch-based multi-layer VLAN message processing method according to claim 1, characterized in that: In step S103, it also includes: If the ACL rule cannot be correctly matched or the packet format has problems, the packet is discarded.

7. A multi-layer VLAN message processing device based on a switch, characterized in that: include: An analysis unit, configured to analyze the number of VLAN layers and the TPID of each layer in the message when receiving a message with multiple layers of VLAN; A padding unit is used to insert a padding field after the VLAN field of a message with different VLAN layers in the line card, so that the number of VLAN layers of the message is a preset number of layers; wherein the padding field includes the outermost tracing VLAN field T-tag, which is used to carry the input port value of the message, and different padding values ​​are used in the padding field to mark the number of padding bytes inserted; A matching unit is used to identify the padding field and skip the padding field content in the backplane card according to the configured rules, so as to parse the message fields subsequent to the padding field, obtain the input port value and the IP five-tuple information, and match the input port value and the IP five-tuple information according to the configured ACL rules to ensure the forwarding path of the message; The deletion unit is used to send the message to the target board according to the forwarding path, and in the final processing stage of the message of the target board, delete the padding field according to the number of padding bytes marked in the padding field, and restore the message to the original VLAN format.

8. A multi-layer VLAN message processing device based on a switch, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the switch-based multi-layer VLAN message processing method as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A method and system for OLT slicing of access network based on ONU granularity

    CN108989915A

  • Method for realizing unified analysis and processing of VLAN services

    CN110971499A

  • Message processing method and device, electronic equipment and storage medium

    CN116389376A