A message forwarding method and device
By reading the VLAN mapping information of the user-side data packets in the network device and generating software VLAN mapping table entries, the problem of occupancy of ACL table entries in the prior art is solved, and the mapping from the user-side to the network-side VLAN is realized without occupancy of ACL table entries, releasing the resources of the network device.
Patent Information
- Application Number
- CN202211038362.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-08-29
AI Technical Summary
The existing VLAN mapping technology requires occupancy of ACL table entries, and the retention fields of CLASS IDs are limited during the forwarding process of the switching chips of some network devices, resulting in insufficient resource savings.
By reading the VLAN mapping information of the user-side data packets, searching for the software VLAN mapping table entry. If it is not found, generate the software VLAN mapping table entry and set the next hop register index to realize the mapping from the user-side VLAN to the network-side VLAN without occupying the ACL table entry.
It realizes no ACL entry occupation of VLAN mapping from user side to network side, frees up the limited ACL entry resources of network device switching chips, and avoids resource waste.
Smart Images

Figure CN115484206B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to communication technology, in particular to virtual local area network mapping technology, and specifically to a message forwarding method and device. Background Art
[0002] In a forwarding network, in order to isolate different clients from each other, different user-side VLANs (Virtual Local Area Networks) are usually assigned to different clients. In order to save VLAN resources on the switch, VLAN mapping technology can be used to map different user-side VLANs to the same network-side VLAN on the switch.
[0003] In order to reduce the number of access control list (ACL) entries occupied by data packets between user sides, the existing VLAN mapping technology allocates a CLASS ID to the user side VLAN, the preset matching item is the CLASS ID and the action item is to modify the network side VLAN to the user side VLAN corresponding to the CLASS ID; and when learning the source MAC address of the arriving user side data packet, the corresponding CLASS ID is recorded in the learned MAC address table item. In this way, when the network side data packet arrives, the CLASS ID can be obtained based on the destination MAC address table item of the network side data packet, and then the network side VLAN of the network side data packet is modified to the corresponding user side VLAN according to the preset ACL table item matched by the CLASS ID.
[0004] Although the existing VLAN mapping technology greatly saves limited ACL entries, a certain number of ACL entries need to be preset based on the CLASS ID of the configured user-side VLAN; in addition, the switch chips of some network devices have limited reserved fields for CLASS ID during the forwarding process. Summary of the invention
[0005] The purpose of the present application is to provide a message forwarding method and device, which can realize VLAN mapping from the user side to the network side without occupying ACL table entries.
[0006] To achieve the above-mentioned purpose, the present application provides a message forwarding method, which includes reading VLAN mapping information of a user-side port where a user-side data message to be forwarded arrives; when a MAC address table entry matching the source MAC address of the user-side data message is not found, searching a software VLAN mapping information table based on the user-side VLAN of the VLAN mapping information; when a software VLAN mapping table entry matching the user-side VLAN is not found, applying for a next-hop register index, generating a software VLAN mapping table entry based on the user-side VLAN and the network-side VLAN of the VLAN mapping information, recording the next-hop register index in the generated software VLAN mapping table entry and setting the reference count of the next-hop register index to 1; setting a next-hop register pointed to by the next-hop index; wherein the action of the next-hop register is to modify the network-side VLAN to the user-side VLAN; learning the MAC address table entry according to the source MAC address of the user-side data message and recording the next-hop register index; modifying the user-side VLAN of the user-side data message to the network-side VLAN; and sending the modified user-side data message through the network-side egress port of the MAC table entry matching the destination MAC address of the user-side data message.
[0007] To achieve the above-mentioned purpose, the present application provides a message forwarding device, which includes: a receiving module, a forwarding module, a mapping module and a sending module. The receiving module receives the user-side data message arriving at the user-side port; the forwarding module reads the VLAN mapping information of the user-side port; when it is determined that the matching MAC address table entry of the source MAC address of the user-side data message is not found, the user-side data message with VLAN mapping information is sent to the mapping module; the mapping module parses the VLAN mapping information including the user-side VLAN and the network-side VLAN, and searches the software VLAN mapping information table based on the user-side VLAN; when it is determined that the software VLAN mapping table entry matching the user-side VLAN is not found, a next-hop register index is applied; a software VLAN mapping table entry of the user-side VLAN and the network-side VLAN that records the VLAN mapping information is generated, and the next-hop register index and the setting are recorded in the generated software VLAN mapping table entry. The reference count of the next hop register index is 1; the next hop register pointed to by the next hop index is set for the forwarding module; the user side data message with the outgoing VLAN as the network side VLAN and the next hop index is sent to the forwarding module; wherein the action of the next hop register is to modify the network side VLAN to the user side VLAN; the forwarding module learns the MAC address table entry according to the source MAC address of the user side data message; the next hop register index is recorded in the MAC address table entry; the user side VLAN of the user side data message is modified to the network side VLAN; the MAC address table entry matching the destination MAC address of the user side data message is searched; the sending module sends the modified user side data message through the network side outgoing port recorded by the matching MAC address table entry of the destination MAC address of the user side data message.
[0008] The beneficial effect of the present application is that it overcomes the limitation of the network device caused by the limited reserved fields that can be used for CLASS ID in the switching chip during the forwarding process, and does not need to occupy ACL table entries, further releasing the limited ACL table entry resources of the switching chip of the network device. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A schematic diagram of an embodiment of a message forwarding method provided by the present application;
[0010] Figure 2 This is a schematic diagram of an application scenario of the message forwarding method of this application;
[0011] Figure 3 A schematic diagram of an embodiment of a message forwarding device provided in this application. DETAILED DESCRIPTION
[0012] The present invention will be described in detail with multiple examples shown in multiple figures. In the following detailed description, multiple specific details are used to provide a comprehensive understanding of the present application. Known methods, steps, components and circuits are not described in detail in the examples to avoid making these examples difficult to understand.
[0013] Among the terms used, the term "include" means including but not limited to; the term "contain" means including but not limited to; the terms "above", "within" and "below" are inclusive of the number; the terms "greater than" and "less than" are exclusive of the number. The term "based on" means based on at least a part thereof.
[0014] Step 101, reading VLAN mapping information of the user-side port where the user-side data message to be forwarded arrives;
[0015] Step 102, determining that no matching MAC address table entry of the source MAC address of the user-side data message is found, searching the software VLAN mapping information table based on the user-side VLAN of the VLAN mapping information;
[0016] Step 103, determining that no matching software VLAN mapping entry for the user-side VLAN is found, and applying for a next hop register index;
[0017] Step 104, based on the user-side VLAN and the network-side VLAN of the VLAN mapping information, a software VLAN mapping entry is generated, a next-hop register index is recorded in the generated software VLAN mapping entry, and a reference count of the generated software VLAN mapping entry is set to 1;
[0018] Step 105, setting the next hop register action pointed to by the next hop index to modify the network side VLAN to the user side VLAN;
[0019] Step 106, learning the MAC address table entry according to the source MAC address of the user-side data message and recording the next-hop register index;
[0020] Step 107, modify the user-side VLAN of the user-side data message to the network-side VLAN; and send the modified user-side data message through the network-side egress port of the MAC table entry that matches the destination MAC address of the user-side data message.
[0021] It not only overcomes the limitation of network devices caused by the limited reserved fields that can be used for CLASS ID in the forwarding process of the switching chip, but also does not need to occupy ACL table entries, further releasing the limited ACL table entry resources of the switching chip of the network device.
[0022] Figure 2Schematic diagram of the application scenario of the message forwarding method of this application; the clients 21, 22, and 23 of the user-side network are respectively connected to the user-side ports P1, P2, and P3 of the network device; the ports P4 and P5 of the network device are respectively connected to the servers 24 and 25 of the network-side network.
[0023] User-side VLAN 100 is configured on user-side ports P1 and P3. The configured VLAN mapping information maps user-side VLAN 100 to network-side VLAN 10.
[0024] User-side VLAN 200 is configured on the user-side port P2, and the configured VLAN mapping information is to map user-side VLAN 200 to network-side VLAN 10;
[0025] Network-side VLAN 10 is configured on network-side ports P4 and P5.
[0026] In this application, the network device is based on data-driven VLAN mapping, that is, there is no need to set a preset ACL table item according to the VLAN mapping information of the user-side ports P1, P2, and P3. Usually, the ACL table item resources of the switching chip of the network device are several K; this application can release at least 4094 ACL table item resources by avoiding the preset one-to-one ACL table items for the user-side VLAN, so as to facilitate the network device to use the saved ACL table item resources for other business exchanges.
[0027] When the client 21 sends a user-side data message to the server 24, the user-side port P1 of the network device 20 receives the user-side data message sent by the client 21, and the switching chip of the network device 20 reads the VLAN mapping information of the user-side port P1, and searches the MAC address table of VLAN100 according to the source MAC address MAC21 of the user-side data message, but does not find a MAC address table entry matching MAC21; then the user-side data message with the VLAN mapping information of the user-side port P1 is sent to the CPU through the chip port of the CPU.
[0028] The CPU of the network device 20 parses the VLAN mapping information of the user-side port P1, including the user-side VLAN 100 and its mapped network-side VLAN 10. According to the fact that no matching software VLAN mapping entry is found in the software VLAN mapping table for the user-side VLAN 100, the CPU applies for the next hop register index Index1, generates a software VLAN mapping entry based on the user-side VLAN and the network-side VLAN in the VLAN mapping information, records Index1 in the generated software VLAN mapping entry, and sets the reference count of the generated software VLAN mapping entry to 1.
[0029] The CPU of network device 20 sets the next hop register pointed to by Index1 on its switch chip, and the action of the register is to modify the network side VLAN10 to the user side VLAN100. The CPU of network device 20 sends the user side data message with the outgoing VLAN as network side VLAN10 and index1 to the switch chip.
[0030] The forwarding chip of network device 20 learns the MAC address table entry in the MAC address table according to the source MAC address MAC21 of the user-side data message; records Index1 in the MAC address table entry; modifies the user-side VLAN100 of the user-side data message to the network-side VLAN10; finds the MAC address table entry matching the destination MAC address MAC24 in the MAC address table of VLAN10, and modifies it to send the user-side data message of the network-side VLAN10 through the network-side egress port P4 recorded by the MAC address table entry matching MAC24.
[0031] The software VLAN mapping table entries in the software VLAN mapping table recorded by the CPU of the network device 20 are shown in Table 1-1, and the MAC address table entries learned by the switching chip of the network device 20 are shown in Table 2-1.
[0032] CVLAN SVLAN Next-hop Index Count VLAN100 VLAN10 Index1 1
[0033] Table 1-1
[0034] MAC VLAN Next-hop Index Port MAC 24 VLAN10 P4 MAC 25 VLAN10 P5 MAC 21 VLAN100 Index1 P1
[0035] Table 2-1
[0036] When the client 22 sends a user-side data message to the server 24, the user-side port P2 of the network device 20 receives the user-side data message sent by the client 22, and the switching chip of the network device 20 reads the VLAN mapping information of the user-side port P2, and searches the MAC address table of VLAN200 according to the source MAC address MAC22 of the user-side data message. If no MAC address table entry matching MAC22 is found, the user-side data message with the VLAN mapping information of the user-side port P2 is sent to the CPU through the chip port of the CPU. Based on the same processing method, if the mapping table entry between VLAN200 and VLAN10 is not found in the software mapping table shown in Table 1-1, the network device 20 applies for the next hop register index Index2, creates a new software VLAN mapping table entry between the user-side VLAN200 and the network-side VLAN10, and records Index2 and its reference count as 1 in the software VLAN mapping table entry.
[0037] The CPU of the network device 20 sends the user-side data message with the outgoing VLAN being the network-side VLAN 10 and index 2 to the switching chip. The forwarding chip of the network device 20 learns the MAC address table entry of the MAC address MAC22 in the same way.
[0038] The software VLAN mapping table entries after the CPU of the network device 20 is updated are shown in Table 1-2, and the updated MAC address table entries of the network device 20 are shown in Table 2-2.
[0039] CVLAN SVLAN Next-hop Index Count VLAN100 VLAN10 Index1 1 VLAN200 VLAN10 Index2 1
[0040] Table 1-2
[0041] MAC VLAN Next-hop Index Port MAC 24 VLAN10 P4 MAC 25 VLAN10 P5 MAC 21 VLAN100 Index1 P1 MAC 22 VLAN200 Index2 P2
[0042] Table 2-2
[0043] When the client 23 sends a user-side data message to the server 25, the user-side port P3 of the network device 20 receives the user-side data message sent by the client 23, and the switching chip of the network device 20 reads the VLAN mapping information of the user-side port P3, and searches the MAC address table of VLAN100 according to the source MAC address MAC23 of the user-side data message, but does not find a MAC address table entry matching MAC23; then the user-side data message with the VLAN mapping information of the user-side port P3 is sent to the CPU through the chip port of the CPU.
[0044] The CPU of network device 20 parses the VLAN mapping information of user-side port P3, which includes user-side VLAN 100 and its mapped network-side VLAN 10. It searches for a matching software VLAN mapping entry in the software VLAN mapping table shown in Table 1-2 based on user-side VLAN 100 and increases the reference count of Index 1 in the software mapping entry by 1.
[0045] The CPU of the network device 20 sends the user-side data message with the outgoing VLAN being the network-side VLAN 10 and index 1 to the switching chip.
[0046] The forwarding chip of network device 20 learns the MAC address table entry in the MAC address table according to the source MAC address MAC23 of the user-side data message; records Index1 in the MAC address table entry; modifies the user-side VLAN100 of the user-side data message to the network-side VLAN10; finds the MAC address table entry matching the destination MAC address MAC25 in the MAC address table of VLAN10, and modifies it to send the user-side data message of the network-side VLAN10 through the network-side egress port P5 recorded by the MAC address table entry matching MAC25.
[0047] The software VLAN mapping table entries after the CPU of the network device 20 is updated are shown in Table 1-3, and the updated MAC address table entries of the network device 20 are shown in Table 2-3.
[0048]
[0049]
[0050] Table 1-3
[0051] MAC VLAN Next-hop Index Port MAC 24 VLAN10 P4 MAC 25 VLAN10 P5 MAC 21 VLAN100 Index1 P1 MAC 22 VLAN200 Index2 P2 MAC 23 VLAN100 Index1 P3
[0052] Table 2-3
[0053] When the server 24 sends a network-side data message to the client 21, the switching chip of the network device 20 determines the inbound port where the data message arrives, that is, the network-side port P4 is not configured with VLAN mapping information, and finds the MAC address table entry that matches the source MAC address MAC24; then the aging time is refreshed, the MAC address table entry that matches the destination MAC address MAC21 is found, and the outbound port is determined to be the user-side port P1. The next-hop register is read according to index1 recorded in the MAC address table entry, and the network-side VLAN10 of the data message is modified to 100 according to the action of the next-hop register pointed to by Index1, and the modified network-side data message is sent to the client 21 through the user-side port P1.
[0054] When the server 24 sends a network-side data packet to the client 22, the switching chip of the network device 20 processes the same mechanism, determining the output port P2 and index2 based on the MAC address table entry that matches the destination MAC address MAC22, reading the next-hop register according to index2, and modifying the network-side VLAN 10 of the data packet to 200 according to the action of the next-hop register pointed to by Index2, and sending the modified network-side data packet to the client 22 through the user-side port P2.
[0055] When clients 21 and 23 do not send data packets to network device 20 for a period of time, the switch chip of network device 20 determines that the MAC address table entry of MAC21 in Table 2-3 has reached the aging time, deletes it from the MAC address table, and notifies the CPU of Index 1 of the aged MAC address table entry through an inter-chip message. The CPU of network device 20 decrements the reference count 2 of Index 1 in Table 1-3 by 1, that is, the reference count of index 1 is rewritten to 1.
[0056] When the switch chip of network device 20 deletes the MAC address entry of MAC23 in Table 2-3 that reaches the aging time, the CPU is notified of Index 1 of the aged MAC address entry through an inter-chip message. The CPU of network device 20 decrements the reference count 1 of Index 1 in Table 1-3 by 1, that is, the reference count of Index 1 is rewritten to 0.
[0057] The CPU of the network device 20 determines that the reference count of the next hop register index index1 of the software mapping table entry of VLAN100 and VLAN10 in the software mapping table is 0, and then deletes the software mapping table entry; deletes the next hop register pointed to by index1 on the switching chip.
[0058] The switching chip of the network device 20 receives the network side data message. Because the network side port has no VLAN mapping information, even if the source MAC address of the network side data message is not found, it will not be sent to the CPU, but regular MAC address learning will be performed.
[0059] In the embodiment of the present application, no matter the mapping of the upstream user side VLAN to the network side VLAN network or the mapping of the downstream network side VLAN to the user side VLAN, no ACL table entry is occupied.
[0060] In network equipment, the resources of the next-hop register of the switching chip are usually around tens of K, which can fully guarantee the next-hop resources for VLAN network mapping and other three-layer forwarding. In addition, the setting of the next-hop register of this application is driven by the user-side data message, and there is no need to pre-occupy the hardware resources of the next-hop register of the switching chip or the software resources of the memory when there is no VLAN mapping demand.
[0061] It should be noted that, in the above embodiment, if the switching chip of the network device 20 does not find the MAC address table entry that matches the server 24 or 25, it first modifies the outgoing VLAN to the network side VLAN according to the CPU notification, learns the ARP table entry through the ARP table entry, and then sends it through the outgoing port of the ARP table entry. Alternatively, the switching chip of the network device 20 modifies the outgoing VLAN to the network side VLAN according to the CPU notification, and then broadcasts it in the network side VLAN.
[0062] Figure 3 Schematic diagram of a message forwarding device embodiment provided by the present application. The device 30 includes at least: a network interface, a switching chip 31, a CPU 32 and a memory 33. The switching chip 31 includes at least a receiving module 311, a forwarding module 312 and a sending module 313. The processor 32 executes the mapping module 331 by running the processor executable instructions in the memory 33, and the software mapping table maintained by the mapping module 331 is stored in the memory 33.
[0063] The receiving module 311 receives the first user-side data message arriving at the first user-side port; the forwarding module 312 reads the first VLAN mapping information of the first user-side port; when it is determined that the matching MAC address table entry of the source MAC address of the first user-side data message is not found, the first user-side data message with the first VLAN mapping information is sent to the mapping module 331; the mapping module 331 parses the first VLAN mapping information including the first user-side VLAN and the network-side VLAN, searches the software VLAN mapping information table based on the first user-side VLAN; determines that the software VLAN mapping table entry matching the first user-side VLAN is not found, and applies for the next hop register index; generates the software VLAN mapping table entry of the first user-side VLAN and the network-side VLAN recording the first VLAN mapping information, and records the next hop register index in the generated software VLAN mapping table entry. And set the reference count of the next hop register index to 1; set the next hop register pointed to by the next hop index for the forwarding module 312; send the first user side data message with the outgoing VLAN as the network side VLAN and the next hop index to the forwarding module 312; wherein the action of the next hop register is to modify the network side VLAN to the first user side VLAN; the forwarding module 312, learns the first MAC address table entry according to the source MAC address of the first user side data message; records the next hop register index in the first MAC address table entry; modifies the first user side VLAN of the first user side data message to the network side VLAN; searches for the MAC address table entry that matches the destination MAC address of the first user side data message; the sending module 313, sends the modified first user side data message through the network side out port recorded by the matching MAC address table entry of the destination MAC address of the first user side data message.
[0064] The receiving module 311 receives the second user-side data message arriving at the second user-side port; the forwarding module 312 reads the second VLAN mapping information of the second user-side port; determines that the matching MAC address table entry of the source MAC address of the second user-side data message is not found, and sends the second user-side data message with the second VLAN mapping information to the mapping module 331; the mapping module 331 parses the first user-side VLAN and the network-side VLAN included in the second VLAN mapping information; finds the software VLAN mapping table entry matching the first user-side VLAN in the software VLAN mapping information table, and sets the reference count of the next hop register recorded in the software VLAN mapping table entry to Add 1; send the second user side data message with the outgoing VLAN as the network side VLAN and the next hop index to the forwarding module 312; the forwarding module 312 learns the second MAC address table entry according to the source MAC address of the second user side data message; records the next hop register index in the second MAC address table entry; changes the first user side VLAN of the second user side data message to the network side VLAN; searches for the MAC address table entry that matches the destination MAC address of the second user side data message; the sending module 313 sends the modified second user side data message through the network side out port recorded by the MAC address table entry that matches the destination MAC address of the second user side data message.
[0065] The receiving unit 311 receives a network side data message arriving at any network side port; the forwarding module 312 finds a first MAC address table entry or a second MAC address table entry that matches the destination MAC address of the network side data message; reads the next hop register according to the next hop register index recorded in the first MAC address table entry or the second MAC address table entry, and modifies the network side VLAN of the network side data message to the first VLAN; the sending module 313 sends the modified network side data message through the first user side port of the first MAC address table entry or the second user side port of the second MAC address table entry.
[0066] The forwarding module 312 is used to delete the MAC address table entry that reaches the aging time; send the next hop register index of the deleted aged MAC address table entry to the mapping module 331; the mapping module 331 searches for the software VLAN mapping table entry that records the next hop register index in the aged MAC address table entry; and reduce the reference count of the next hop register index in the found software VLAN mapping table entry by 1.
[0067] The mapping module 331 deletes the software VLAN mapping table entry whose reference count of the recorded next hop register index is zero; and deletes the next hop register pointed to by the next hop register index.
[0068] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A message forwarding method, characterized in that: The method comprises: Reading first VLAN mapping information of a first user-side port at which a first user-side data message to be forwarded arrives; When no MAC address table entry matching the source MAC address of the first user-side data message is found, searching the software VLAN mapping information table based on the first user-side VLAN of the first VLAN mapping information; When no software VLAN mapping entry matching the first user-side VLAN is found, apply for a next-hop register index, generate a software VLAN mapping entry based on the first user-side VLAN and the network-side VLAN of the first VLAN mapping information, record the next-hop register index in the generated software VLAN mapping entry, and set a reference count of the next-hop register index to 1; Setting the next hop register pointed to by the next hop register index; wherein the action of the next hop register is to modify the network side VLAN to the first user side VLAN; Learning a first MAC address table entry according to the source MAC address of the first user-side data message and recording the next hop register index; The first user-side VLAN of the first user-side data message is modified to the network-side VLAN; and the modified first user-side data message is sent through the network-side egress port of the MAC table entry that matches the destination MAC address of the first user-side data message.
2. The method according to claim 1, characterized in that The method further comprises: Read the second VLAN mapping information of the second user side port at which the second user side data message to be forwarded arrives; When no MAC address table entry matching the source MAC address of the second user-side data message is found, searching the software VLAN mapping information table based on the first user-side VLAN of the second VLAN mapping information; adding 1 to the reference count of the next hop register index recorded in the software VLAN mapping table entry; Learning a second MAC address table entry according to the source MAC address of the second user-side data message and recording the next hop register index; The first user-side VLAN of the second user-side data message is modified to the network-side VLAN; and the modified second user-side data message is sent through the network-side egress port of the MAC address table entry that matches the destination MAC address of the second user-side data message.
3. The method according to claim 2, characterized in that The method further comprises: Finding that the destination MAC address of the network side data message to be forwarded matches the first MAC address table entry or the second MAC address table entry; Read the next hop register according to the next hop register index recorded in the first MAC address table entry or the second MAC address table entry, and modify the network side VLAN of the network side data message to the first VLAN; The modified network-side data message is sent through the first user-side port of the first MAC address table entry or the second user-side port of the second MAC address table entry.
4. The method according to claim 1, characterized in that: The method further comprises: Delete MAC address entries that have reached the aging time. Find the software VLAN mapping table entry that records the next hop register index in the aged MAC address table entry; The reference count of the next hop register index in the found software VLAN mapping table entry is reduced by 1.
5. The method according to claim 4, characterized in that The method further comprises: Delete the software VLAN mapping table entry indexed by the next hop register whose reference count is zero; The next hop register pointed to by the next hop register index is deleted.
6. A message forwarding device, characterized in that: The device comprises: A receiving module, receiving a first user-side data message arriving at a first user-side port; a forwarding module, which reads the first VLAN mapping information of the first user-side port; and when determining that no matching MAC address table entry of the source MAC address of the first user-side data message is found, sends the first user-side data message with the first VLAN mapping information to the mapping module; The mapping module parses the first VLAN mapping information including the first user-side VLAN and the network-side VLAN, searches the software VLAN mapping information table based on the first user-side VLAN; determines that no software VLAN mapping table entry matching the first user-side VLAN is found, and applies for a next-hop register index; generates a software VLAN mapping table entry recording the first VLAN mapping information of the first user-side VLAN and the network-side VLAN, records the next-hop register index in the generated software VLAN mapping table entry, and sets a reference count of the next-hop register index to 1; sets a next-hop register pointed to by the next-hop register index for the forwarding module; sends the first user-side data message with the outgoing VLAN as the network-side VLAN and the next-hop register index to the forwarding module; wherein the action of the next-hop register is to modify the network-side VLAN to the first user-side VLAN; The forwarding module learns a first MAC address table entry according to the source MAC address of the first user side data message; records the next hop register index in the first MAC address table entry; modifies the first user side VLAN of the first user side data message to the network side VLAN; and searches for a MAC address table entry that matches the destination MAC address of the first user side data message; The sending module sends the modified first user side data message through the network side egress port recorded by the matching MAC address table entry of the destination MAC address of the first user side data message.
7. The device according to claim 6, characterized in that The receiving module receives a second user-side data message arriving at the second user-side port; The forwarding module reads the second VLAN mapping information of the second user-side port; Determine that no matching MAC address table entry of the source MAC address of the second user side data message is found, and send the second user side data message with the second VLAN mapping information to the mapping module; The mapping module parses the first user-side VLAN and the network-side VLAN included in the second VLAN mapping information; Find the software VLAN mapping entry matching the first user-side VLAN in the software VLAN mapping information table, and add 1 to the reference count of the next hop register recorded in the software VLAN mapping entry; Sending the second user-side data message with the outgoing VLAN being the network-side VLAN and the next-hop register index to the forwarding module; The forwarding module learns a second MAC address table entry according to the source MAC address of the second user-side data message; and records the next hop register index in the second MAC address table entry; Modify the first user-side VLAN of the second user-side data message to the network-side VLAN; Searching for a MAC address table entry that matches the destination MAC address of the second user-side data message; The sending module sends the modified second user side data message through the network side egress port recorded by the MAC address table entry that matches the destination MAC address of the second user side data message.
8. The device according to claim 7, characterized in that The receiving module receives a network side data message arriving at any network side port; The forwarding module finds the first MAC address table entry or the second MAC address table entry that matches the destination MAC address of the network side data message; reads the next hop register according to the next hop register index recorded in the first MAC address table entry or the second MAC address table entry, and modifies the network side VLAN of the network side data message to the first VLAN; The sending module sends the modified network-side data message through the first user-side port of the first MAC address table entry or the second user-side port of the second MAC address table entry.
9. The device according to claim 6, characterized in that The forwarding module is used to delete the MAC address table entry that reaches the aging time; send the next hop register index of the deleted aged MAC address table entry to the mapping module; The mapping module searches for a software VLAN mapping entry that records the next hop register index in the aged MAC address entry; The reference count of the next hop register index in the found software VLAN mapping table entry is reduced by 1.
10. The device according to claim 6, characterized in that The mapping module deletes the software VLAN mapping table entry whose reference count of the recorded next hop register index is zero; and deletes the next hop register pointed to by the next hop register index.
Citation Information
Patent Citations
Mapping method and device of virtual LAN
CN101237378A
Message processing method based on DHCP RELAY protocol and relay device
CN111835879A