Message forwarding method and device, switching equipment, network system and storage medium
By setting multiple virtual subinterfaces in the switching device and matching the message identifier, the problem of tunnel messages being diverted to the same user's resident equipment is solved, and the user's service quality is improved.
Patent Information
- Application Number
- CN202411365463.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, when a user equipment accesses edge cloud from different physical locations, tunnel messages are difficult to divert to the same user's resident device, resulting in the user being unable to access the same cloud resources and unable to provide convenient services.
Set up multiple virtual subinterfaces in the switching device, and use these virtual subinterfaces to forward tunnel messages from different access layer devices. By extracting and matching the original message identifiers to determine the target virtual subinterface, the tunnel messages are transferred. Forward to the correct user's resident device.
It realizes flexible traffic diversion of tunnel messages, ensuring that user equipment can access the correct user station equipment, thereby improving user service quality.
Smart Images

Figure CN119135638A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to a message forwarding method, device, switching equipment, network system and storage medium. Background Art
[0002] With the continuous development of edge cloud technology, network service providers can set up customer premises equipment (CPE, Customer Premises Equipment, such as virtual customer premises equipment vCPE, Virtual Customer Premises Equipment) in the edge cloud, and use VLAN technology (Virtual Local Area Network, virtual LAN) and tunnel technology to connect user equipment to customer premises equipment, so that the local LAN of the user equipment can be connected to the cloud, ensuring that users can use cloud resources by using local LAN resources, and thus providing users with better cloud services. Since the same user may access its cloud resources from different physical locations, how to forward the tunnel messages sent by user devices that access the edge cloud from different physical locations to the same customer premises equipment for processing is the key to improving user service quality.
[0003] In the related art, affected by the network system architecture, tunnel messages sent by user devices accessing from different physical locations are usually difficult to be directed to the correct user premises equipment. For example, for user devices accessing the edge cloud through different access layer devices, their tunnel messages can only be sent to different user premises equipment, and cannot be directed to the same user premises equipment. This results in the same user accessing the edge cloud at different physical locations being unable to access the same user premises equipment, which in turn results in the user being unable to access the same cloud resources, and being unable to provide users with more convenient services. Summary of the invention
[0004] The purpose of the present invention is to provide a message forwarding method, device, switching equipment, network system and storage medium, which can set multiple virtual sub-interfaces in the switching equipment, and use these virtual sub-interfaces to forward and guide tunnel messages from different access layer devices, so that different tunnel messages can be flexibly guided to the correct user premises equipment.
[0005] To solve the above technical problems, the present invention provides a message forwarding method, which is applied to a switching device, wherein the switching device has multiple virtual sub-interfaces, and the virtual sub-interfaces are provided with forwarding message identifiers, and the forwarding message identifiers are used to determine the tunnel messages to be forwarded by the virtual sub-interfaces, and the method comprises:
[0006] Receive a tunnel message sent by a source device, and extract an original message identifier in the tunnel message; wherein the source device is an access layer device or other switching device;
[0007] Matching the original message identifier with each of the forwarded message identifiers to determine a target virtual sub-interface for forwarding the tunnel message;
[0008] Forwarding the tunnel message to a destination device connected to the target virtual sub-interface; wherein the destination device is other switching equipment or customer premises equipment;
[0009] The tunnel reply message sent by the destination device is received from the virtual sub-interface, and the tunnel reply message is forwarded to the source device.
[0010] Optionally, the original message identifier includes an original tunnel identifier and a source MAC address, and the forwarded message identifier is a forwarding tunnel identifier or a forwarding MAC address;
[0011] The matching of the original message identifier with each of the forwarded message identifiers to determine a target virtual sub-interface for forwarding the tunnel message includes:
[0012] If it is determined that the message forwarding identifier of each virtual sub-interface is the forwarding tunnel identifier, the original tunnel identifier is matched with each forwarding tunnel identifier to determine the target virtual sub-interface for forwarding the tunnel message;
[0013] If it is determined that the message forwarding identifier of each virtual sub-interface is the forwarding MAC address, the source MAC address is matched with each forwarding MAC address to determine the target virtual sub-interface for forwarding the tunnel message.
[0014] Optionally, the original tunnel identifier includes multiple layers of sub-tunnel identifiers arranged in order, and the forwarding tunnel identifier includes one or more layers of sub-forwarding tunnel identifiers arranged in order;
[0015] The matching of the original tunnel identifier with each of the forwarding tunnel identifiers to determine a target virtual sub-interface for forwarding the tunnel message includes:
[0016] Sequentially matching each sub-tunnel identifier in the original tunnel identifier with each sub-forwarding tunnel identifier in the forwarding tunnel identifier, and taking a forwarding tunnel identifier in which each sub-forwarding tunnel identifier is successfully matched as a candidate forwarding tunnel identifier;
[0017] The virtual sub-interface to which the candidate forwarding tunnel identifier with the largest number of layers belongs is set as the target virtual sub-interface.
[0018] Optionally, the virtual sub-interface is provided with a tunnel identifier conversion rule, and the tunnel identifier conversion rule records the correspondence between the original tunnel identifier and the replacement tunnel identifier;
[0019] The step of forwarding the tunnel message to a target device connected to the target virtual sub-interface includes:
[0020] According to the tunnel identifier conversion rule of the target virtual sub-interface, convert the original tunnel identifier in the tunnel message into a corresponding replacement tunnel identifier;
[0021] Forwarding the tunnel message after completing the tunnel identifier conversion to the target device connected to the target virtual sub-interface;
[0022] Correspondingly, forwarding the tunnel reply message to the source device includes:
[0023] According to the identifier conversion rule of the target virtual sub-interface, converting the replacement tunnel identifier in the tunnel reply message into the corresponding original tunnel identifier;
[0024] The tunnel reply message after completing the tunnel identifier conversion is forwarded to the source device.
[0025] Optionally, the replacement tunnel identifier includes one or more layers of sub-tunnel identifiers.
[0026] Optionally, forwarding the tunnel message to a target device connected to the target virtual sub-interface includes:
[0027] Forwarding the tunnel message to a tunnel bridged with the target virtual sub-interface, so as to forward the tunnel message to the target device through the tunnel;
[0028] Or, forwarding the tunnel message to a bridge domain connected to the target virtual sub-interface, so as to forward the tunnel message to the target device through the bridge domain.
[0029] Optionally, the virtual sub-interface is provided with a MAC address table;
[0030] After determining the target virtual sub-interface for forwarding the tunnel message, the method further includes:
[0031] In the MAC address table of the target virtual sub-interface, record the mapping relationship between the MAC address information of the tunnel message and the network port receiving the tunnel message;
[0032] Correspondingly, forwarding the tunnel reply message to the source device includes:
[0033] According to the MAC address information of the tunnel reply message, query the corresponding target network port in the MAC address table of the virtual sub-interface;
[0034] The tunnel reply message is forwarded to the source device through the target network port.
[0035] The present invention also provides a message forwarding device, which is applied to a switching device, wherein the switching device has a plurality of virtual sub-interfaces, and the virtual sub-interfaces are provided with forwarding message identifiers, and the forwarding message identifiers are used to determine the tunnel messages to be forwarded by the virtual sub-interfaces, and the device comprises:
[0036] A receiving module, used for receiving a tunnel message sent by a source device and extracting an original message identifier in the tunnel message; wherein the source device is an access layer device or other switching device;
[0037] A matching module, used for matching the original message identifier with each of the forwarded message identifiers to determine a target virtual sub-interface for forwarding the tunnel message;
[0038] A first forwarding module, configured to forward the tunnel message to a destination device connected to the target virtual sub-interface; wherein the destination device is other switching equipment or customer premises equipment;
[0039] The second forwarding module is used to receive the tunnel reply message sent by the destination device from the virtual sub-interface, and forward the tunnel reply message to the source device.
[0040] The present invention also provides a switching device, comprising:
[0041] Memory for storing computer programs;
[0042] A processor is used to implement the message forwarding method as described above when executing the computer program.
[0043] The present invention also provides a network system, comprising: a first switching device, a second switching device, a first access layer device, a second access layer device, a first customer premises equipment, and a second customer premises equipment, wherein the first switching device is connected to the first access layer device and the first customer premises equipment, the second switching device is connected to the second access layer device and the second customer premises equipment, a tunnel is provided between the first switching device and the second switching device, and the first switching device and the second switching device are both the switching devices described above;
[0044] The first switching device is configured to forward the tunnel message from the first access layer device to the second switching device or the first customer premises equipment, forward the tunnel message from the second switching device to the first customer premises equipment, forward the tunnel reply message from the first customer premises equipment to the second switching device or the first access layer device, and forward the tunnel reply message from the second switching device to the first access layer device;
[0045] The second switching device is used to forward the tunnel message from the second access layer device to the first switching device or the second customer premises equipment, forward the tunnel message from the first switching device to the second customer premises equipment, forward the tunnel reply message from the second customer premises equipment to the first switching device or the second access layer device, and forward the tunnel reply message from the first switching device to the second access layer device.
[0046] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the message forwarding method as described above is implemented.
[0047] The present invention also provides a computer program product, including a computer program or instructions, and when the computer program or instructions are executed by a processor, the message forwarding method as described above is implemented.
[0048] The present invention provides a message forwarding method, which is applied to a switching device, wherein the switching device has multiple virtual sub-interfaces, and the virtual sub-interfaces are provided with forwarding message identifiers, and the forwarding message identifiers are used to determine the tunnel message to be forwarded by the virtual sub-interface. The method comprises: receiving a tunnel message sent by a source device, and extracting an original message identifier in the tunnel message; wherein the source device is an access layer device or other switching device; matching the original message identifier with each of the forwarding message identifiers to determine a target virtual sub-interface to which the tunnel message is to be forwarded; forwarding the tunnel message to a destination device connected to the target virtual sub-interface; wherein the destination device is other switching devices or user premises equipment; receiving a tunnel reply message sent by the destination device from the virtual sub-interface, and forwarding the tunnel reply message to the source device.
[0049] It can be seen that in the present invention, a plurality of virtual sub-interfaces can be set in the switching device, and each virtual sub-interface is provided with a corresponding forwarding message identifier, and the forwarding message identifier is used to determine the tunnel message to be forwarded by the virtual sub-interface. On this basis, when the present switching device receives a tunnel message sent from an access layer device or other switching device, it can extract the original message identifier in the tunnel message, and match the original message identifier with each forwarding message identifier to determine the target virtual sub-interface to which the tunnel message needs to be forwarded. Subsequently, the present switching device can forward the tunnel message to other switching devices or user premises equipment connected to the target virtual sub-interface. In addition, the present switching device can also receive a tunnel reply message sent by the destination device from the virtual sub-interface, and forward the tunnel reply message to the source device to ensure that the tunnel reply message can be returned by the original route. In other words, the present invention can set a plurality of virtual sub-interfaces for tunnel message diversion in the switching device, and can flexibly divert tunnel messages with different original message identifiers to different destinations. Considering that other switching devices are also connected to other access layer devices and other customer premises equipment, the present invention can flexibly direct tunnel messages from different access layer devices with different original tunnel identifiers to the correct customer premises equipment, thereby improving the user service quality. The present invention also provides a message forwarding device, a switching device, a network system and a computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0051] Figure 1 A schematic diagram of a switching device provided by an embodiment of the present invention;
[0052] Figure 2 A flow chart of a message forwarding method provided by an embodiment of the present invention;
[0053] Figure 3 A structural block diagram of a network system provided by an embodiment of the present invention;
[0054] Figure 4 A schematic diagram of a first tunnel message diversion scenario provided by an embodiment of the present invention;
[0055] Figure 5 A schematic diagram of a second tunnel message diversion scenario provided by an embodiment of the present invention;
[0056] Figure 6 A schematic diagram of a third tunnel message diversion scenario provided by an embodiment of the present invention;
[0057] Figure 7 A structural block diagram of a message forwarding device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.
[0059] With the continuous development of edge cloud technology, network service providers can set up multiple customer premises equipment (CPE, Customer Premises Equipment, such as virtual customer premises equipment vCPE, Virtual Customer Premises Equipment) in the edge cloud, and use VLAN technology (Virtual Local Area Network, virtual local area network) and tunnel technology to connect user equipment to customer premises equipment, thereby connecting the local local area network of the user equipment to the cloud. For example, in a possible networking structure, optical network equipment and access layer equipment can be used to establish a tunnel between the user equipment and the customer premises equipment, and based on the tunnel, the user equipment and the customer premises equipment are pulled into the same virtual local area network. The above-mentioned optical network equipment may include an optical network unit (ONU, Optical Network Unit), an optical line terminal (OLT, Optical Line Terminal), etc.; the above-mentioned access layer equipment may be a leaf switch (Leaf device, such as A-Leaf device), etc. The optical network device can encapsulate the user message sent by the user device into a tunnel message, and send it to the customer premises equipment through the access layer device. The user premises equipment can parse the tunnel message to obtain the user message, and perform business processing on the user message to obtain a reply message, and then encapsulate the reply message into a tunnel reply message, and return the tunnel reply message to the optical network device through the access layer device. The optical network device can parse the tunnel reply message to obtain a reply message, and return the reply message to the user device. In this way, the local LAN of the user device can be pulled into the cloud without being noticed, ensuring that the user can use cloud resources by using local LAN resources.
[0060] It should be noted that different access layer devices can be connected to different user premises devices; user equipment at different physical locations can access different user premises devices through different optical network devices and different access layer devices, that is, user equipment at different physical locations access different user premises devices through different tunnels. However, due to the lack of a solution for flexible diversion of tunnel messages in the relevant technology, for user devices accessing the edge cloud from different physical locations, their tunnel messages can only be sent to different user premises devices through different access layer devices, and cannot be sent to the same user premises device, resulting in the same user accessing the edge cloud at different physical locations being unable to access the same user premises device, and further resulting in the user being unable to access the same cloud resources from different physical locations, and being unable to provide users with more convenient services. For example, two home users at different address locations cannot share cloud resources in the same user premises device, and merchants at different address locations cannot manage their stores through the same user premises device.
[0061] In view of this, in order to solve the technical problem of how to forward and divert tunnel messages, the present invention can provide a message forwarding method, which can set up a switching device and set up multiple virtual sub-interfaces in the switching device, and use these virtual sub-interfaces to forward and divert tunnel messages from different access layer devices, so that different tunnel messages can be flexibly diverted to the correct user premises equipment.
[0062] The following first introduces the switching device provided by the present invention. Figure 1 , Figure 1 A schematic diagram of a switching device provided by an embodiment of the present invention. In this schematic diagram, the switching device (located in the center of the schematic diagram) can be connected to access layer devices, user premises equipment and other switching devices (switching devices located in the upper and lower parts). In addition, a plurality of virtual sub-interfaces are provided in the switching device for forwarding and diverting tunnel messages, and the arrows indicate the data flow direction of the tunnel messages. The internal structure and device connection relationship of other switching devices are similar. In order to achieve flexible diversion and forwarding of tunnel messages, each virtual sub-interface in the switching device is provided with a designated forwarding message identifier, which is used to determine the tunnel message to be forwarded by the virtual sub-interface. When receiving a tunnel message, the switching device can extract the original message identifier in the tunnel message, and match the original message identifier with the forwarding message identifier, and then use the virtual sub-interface corresponding to the successfully matched forwarding message identifier as the target virtual sub-interface for forwarding the tunnel message. For example, in Figure 1In the example, tunnel messages from other switching devices can be directed to virtual sub-interface 1; tunnel messages from access layer devices can be directed to virtual sub-interface 2 or 3. In addition, each virtual sub-interface has a corresponding destination device, which is used to determine the diversion direction of the tunnel message. For example, the destination devices corresponding to virtual sub-interfaces 1 and 2 are customer premises equipment, so these two virtual sub-interfaces can forward tunnel messages to customer premises equipment; the destination device corresponding to virtual sub-interface 3 is other switching devices, so the virtual sub-interface can forward tunnel messages to other switching devices. In this way, tunnel messages from user devices can be transmitted to customer premises equipment through access layer devices and this switching device; they can also be transmitted to this switching device through other access layer devices and other switching devices, and then transmitted to customer premises equipment by this switching device; they can also be transmitted from access layer devices to this switching device, from this switching device to other switching devices, and then transmitted to other customer premises equipment by other switching devices. In this way, the present invention can flexibly forward and direct tunnel messages based on the virtual sub-interface, and can conveniently forward and direct tunnel messages from different access layer devices to the correct user premises equipment, thereby improving user service quality.
[0063] It should be noted that the embodiments of the present invention do not limit the number of virtual sub-interfaces, forwarding message identifiers, and corresponding target devices, which can all be set according to actual application requirements. In addition, the virtual sub-interface can be created based on a physical network port, and multiple virtual sub-interfaces can be created on the same physical network port. In addition, the switching device can also be connected to multiple devices of the same type, such as multiple other switching devices and multiple customer premises equipment, to meet different application requirements. In addition, the switching device can be either a physical device or a virtual machine device, which can be set according to actual requirements.
[0064] The message forwarding method provided by the present invention is introduced below. Figure 2 , Figure 2 A flow chart of a message forwarding method provided by an embodiment of the present invention. The method may include:
[0065] S101. Receive a tunnel message sent by a source device, and extract an original message identifier in the tunnel message; wherein the source device is an access layer device or other switching device.
[0066] In this step, the source device refers to a device directly connected to the switching device and transmitting the tunnel message, which can be an access layer device or other switching device. When receiving the tunnel message sent by the source device, the switching device can extract the original message identifier in the tunnel message and prepare to match it with the forwarding message identifier of each virtual sub-interface.
[0067] It should be noted that the present embodiment does not limit the specific original message identifier type, and can be set according to actual application requirements. It is worth noting that the above-mentioned original message identifier can uniquely identify the user device, and the tunnel message of each user device can be independently diverted. For example, the original message identifier can be the original tunnel identifier, or it can be the source MAC address, or it can be a combination of the original tunnel identifier and the source MAC address. Among them, the source MAC address is the MAC address of the user device. The present embodiment also does not limit the specific original tunnel identifier type, for example, it can be a QinQ identifier, a VxLAN identifier, etc.
[0068] S102: Match the original message identifier with each forwarded message identifier to determine the target virtual sub-interface for forwarding the tunnel message.
[0069] In this step, since each virtual sub-interface is provided with a forwarding message identifier, the original message identifier of the tunnel message can be matched with the forwarding message identifier to determine which target virtual sub-interface is used to forward the tunnel message.
[0070] It should be noted that the forwarding message identifiers corresponding to different virtual sub-interfaces have different values. In addition, the identifier type of the forwarding message identifier should be set based on the identifier type of the original message identifier. For example, the forwarding message identifier can be a tunnel identifier, a source MAC address, or a combination of a tunnel identifier and a source MAC address, which can be set according to actual application requirements. When matching, it is necessary to select a corresponding part in the original message identifier to match the forwarding message identifier according to the type of the forwarding message identifier. In this embodiment, in order to facilitate the matching process, the forwarding message identifier can be a forwarding tunnel identifier or a forwarding MAC address, wherein the forwarding tunnel identifier is used to determine the tunnel identifier carried by the tunnel message to be forwarded by the virtual sub-interface, and the forwarding MAC address is used to determine the source MAC address carried by the tunnel message to be forwarded by the virtual sub-interface. When matching, if it is determined that the forwarding message identifier is a forwarding tunnel identifier, the original tunnel identifier is used to match it; if it is determined that the forwarding message identifier is a forwarding MAC address, the source MAC address is used to match it.
[0071] Based on this, the original message identifier includes the original tunnel identifier and the source MAC address, and the forwarded message identifier is the forwarded tunnel identifier or the forwarded MAC address; the original message identifier is matched with each forwarded message identifier to determine the target virtual sub-interface for forwarding the tunnel message, which may include:
[0072] Step 11: If it is determined that the message forwarding identifier of each virtual sub-interface is a forwarding tunnel identifier, the original tunnel identifier is matched with each forwarding tunnel identifier to determine the target virtual sub-interface for forwarding the tunnel message;
[0073] Step 12: If it is determined that the message forwarding identifier of each virtual sub-interface is a forwarding MAC address, the source MAC address is matched with each forwarding MAC address to determine the target virtual sub-interface for forwarding the tunnel message.
[0074] Furthermore, the original tunnel identifier in this embodiment may include multiple layers of sub-tunnel identifiers arranged in order. For example, when the original tunnel identifier is a QinQ identifier, it may include two sub-tunnel identifiers, an SVLAN identifier (outer tag) and a CVLAN identifier (inner tag), and the order of arrangement is: SVLAN, CVLAN. At this time, in order to flexibly meet various forwarding and diversion requirements, the forwarding tunnel identifier corresponding to each virtual sub-interface may include one or more layers of sub-forwarding tunnel identifiers arranged in order; and the number of layers of sub-forwarding tunnel identifiers contained in the forwarding tunnel identifiers of different virtual sub-interfaces may be different. For example, the forwarding tunnel identifier may include only one SVLAN identifier, or it may include both an SVLAN identifier and a CVLAN identifier. At this time, the matching between the original tunnel identifier and each forwarding tunnel identifier may follow the principle from precision to fuzziness. Specifically, the sub-tunnel identifier in the original tunnel identifier and the sub-forwarding tunnel identifier in the forwarding tunnel identifier need to be matched in sequence, and the forwarding tunnel identifier in which each sub-forwarding tunnel identifier contained is successfully matched is used as a candidate forwarding tunnel identifier. Subsequently, the candidate forwarding tunnel identifier with the largest number of layers may be determined as the successfully matched target forwarding tunnel identifier, and the virtual sub-interface to which the target forwarding tunnel identifier belongs may be set as the target virtual sub-interface.
[0075] Based on this, the original tunnel identifier includes multiple layers of sub-tunnel identifiers arranged in order, and the forwarding tunnel identifier includes one or more layers of sub-forwarding tunnel identifiers arranged in order;
[0076] Matching the original tunnel identifier with each forwarding tunnel identifier to determine the target virtual sub-interface for forwarding the tunnel message may include:
[0077] Step 21: sequentially match each sub-tunnel identifier in the original tunnel identifier with each sub-forwarding tunnel identifier in the forwarding tunnel identifier, and use the forwarding tunnel identifier in which all sub-forwarding tunnel identifiers are successfully matched as a candidate forwarding tunnel identifier;
[0078] Step 22: Set the virtual sub-interface to which the candidate forwarding tunnel identifier with the largest number of layers belongs as the target virtual sub-interface.
[0079] For example, virtual sub-interface 1 matches packets with QinQ outer layer identifier 100, and virtual sub-interface 2 matches packets with QinQ identifier 100 / 200 (outer layer 100, inner layer 200). For these two virtual sub-interfaces, the matching principle is from precise to fuzzy: only packets with QinQ identifier 100 / 200 will match virtual sub-interface 2, and other packets with outer layer identifier 100 will only match virtual sub-interface 1.
[0080] S103: Forward the tunnel message to a destination device connected to the target virtual sub-interface; wherein the destination device is other switching devices or customer premises equipment.
[0081] In this step, after completing the target virtual sub-interface matching, the tunnel message can be forwarded to the destination device connected to the target virtual sub-interface, and the destination device can be other switching devices or user premises equipment. It should be pointed out that the virtual sub-interface can be directly bridged with the destination device, or bridged with the tunnel and connected to the destination device through the tunnel. In other words, the tunnel message can be forwarded to the bridging domain connected to the target virtual sub-interface to forward the tunnel message to the target device through the bridging domain; the tunnel message can also be forwarded to the tunnel bridged with the target virtual sub-interface to forward the tunnel message to the target device through the tunnel.
[0082] Based on this, forwarding the tunnel message to the target device connected to the target virtual sub-interface may include:
[0083] Step 31: forwarding the tunnel message to the tunnel bridged with the target virtual sub-interface, so as to forward the tunnel message to the target device through the tunnel;
[0084] Or, step 32: forwarding the tunnel message to a bridge domain connected to the target virtual sub-interface, so as to forward the tunnel message to the target device through the bridge domain.
[0085] S104: Receive a tunnel reply message sent by the destination device from the virtual sub-interface, and forward the tunnel reply message to the source device.
[0086] In this step, if a tunnel reply message returned from the destination device is received from the virtual sub-interface, it is necessary to return the tunnel reply message to the corresponding source device according to the source of the corresponding tunnel message to ensure normal communication between the user device and the customer premises equipment.
[0087] Based on the above embodiments, in the present invention, a plurality of virtual sub-interfaces can be set in the switching device, and each virtual sub-interface is provided with a corresponding forwarding message identifier, and the forwarding message identifier is used to determine the tunnel message to be forwarded by the virtual sub-interface. On this basis, when the present switching device receives a tunnel message sent from an access layer device or other switching device, it can extract the original message identifier in the tunnel message, and match the original message identifier with each forwarding message identifier to determine the target virtual sub-interface to which the tunnel message needs to be forwarded. Subsequently, the present switching device can forward the tunnel message to other switching devices or user premises equipment connected to the target virtual sub-interface. In addition, the present switching device can also receive a tunnel reply message sent by the destination device from the virtual sub-interface, and forward the tunnel reply message to the source device to ensure that the tunnel reply message can be returned by the original route. In other words, the present invention can set a plurality of virtual sub-interfaces for tunnel message diversion in the switching device, and can flexibly divert tunnel messages with different original message identifiers to different destinations. Considering that other switching devices are also connected to other access layer devices and other user premises devices, the present invention can flexibly direct tunnel messages from different access layer devices with different original tunnel identifiers to the correct user premises device, thereby improving user service quality.
[0088] Based on the above embodiments, in addition to forwarding tunnel messages, each virtual sub-interface can also replace the original tunnel identifier in the tunnel message to meet different application requirements. For example, if the user premises equipment can only process tunnel messages with specific tunnel identifiers, the switching device can use the virtual sub-interface to replace the identifiers of tunnel messages with different original tunnel identifiers to ensure that these tunnel messages all have the same specific tunnel identifier. The following is an introduction to the replacement method of the original tunnel identifier. Based on this, the virtual sub-interface is provided with a tunnel identifier conversion rule, which records the correspondence between the original tunnel identifier and the replacement tunnel identifier; forwarding the tunnel message to the target device connected to the target virtual sub-interface may include:
[0089] S201. According to the tunnel identifier conversion rule of the target virtual sub-interface, convert the original tunnel identifier in the tunnel message into a corresponding replacement tunnel identifier.
[0090] In this step, the tunnel identifier conversion rule is used to record the correspondence between the original tunnel identifier and the replacement tunnel identifier. After completing the matching of the target virtual sub-interface, the original tunnel identifier in the tunnel message can be converted into the corresponding replacement tunnel identifier according to the tunnel identifier conversion rule of the target virtual sub-interface. In order to flexibly meet various application requirements, the replacement tunnel identifier can also include one or more layers of sub-tunnel identifiers. In this way, this embodiment can realize flexible identifier conversion of a single-layer tunnel identifier to a single-layer tunnel identifier, a single-layer tunnel identifier to a multi-layer tunnel identifier, a multi-layer tunnel identifier to a single-layer tunnel identifier, and a multi-layer tunnel identifier to a multi-layer tunnel identifier.
[0091] S202: Forward the tunnel message after the tunnel identifier conversion is completed to the target device connected to the target virtual sub-interface.
[0092] Accordingly, forwarding the tunnel reply message to the source device may include:
[0093] S301. According to the identifier conversion rule of the target virtual sub-interface, convert the replacement tunnel identifier in the tunnel reply message into the corresponding original tunnel identifier.
[0094] In this step, when receiving the tunnel reply message, in order to facilitate the source device and the user device to process, the target virtual sub-interface needs to restore the tunnel identifier in the tunnel reply message to the original tunnel label.
[0095] S302: Forward the tunnel reply message after completing the tunnel identifier conversion to the source device.
[0096] Based on the above embodiment, in addition to replacing the tunnel identifier and forwarding the tunnel message, this embodiment can also migrate the MAC address learning function to the virtual sub-interface, and each virtual sub-interface can perform independent MAC address learning on the tunnel message it is responsible for. The following is an introduction to the process of MAC address learning of the virtual sub-interface. Based on this, the virtual sub-interface is provided with a MAC address table;
[0097] After determining the target virtual sub-interface for forwarding the tunnel message, the following steps may also be performed:
[0098] S401. Record, in the MAC address table of the target virtual sub-interface, a mapping relationship between the MAC address information of the tunnel message and the network port for receiving the tunnel message.
[0099] In this step, since each virtual sub-interface is provided with a MAC address table, when receiving a tunnel message, the virtual sub-interface can automatically record the mapping relationship between the MAC address information of the tunnel message and the network port receiving the tunnel message for message forwarding.
[0100] Accordingly, forwarding the tunnel reply message to the source device may include:
[0101] S501. According to the MAC address information of the tunnel reply message, query the corresponding target network port in the MAC address table of the virtual sub-interface.
[0102] S502: Forward the tunnel reply message to the source device through the target network port.
[0103] In this step, since the virtual sub-interface can automatically learn the MAC address, after receiving the tunnel reply message, it can automatically forward the tunnel reply message to the source device through the corresponding target network port according to the learned mapping relationship record.
[0104] Based on the above embodiments, a network system provided by the present invention is introduced below. Figure 3 , Figure 3 This is a structural block diagram of a network system provided by an embodiment of the present invention. The system may include:
[0105] a first switching device, a second switching device, a first access layer device, a second access layer device, a first customer premises equipment, and a second customer premises equipment, wherein the first switching device is connected to the first access layer device and the first customer premises equipment, and the second switching device is connected to the second access layer device and the second customer premises equipment, a tunnel is provided between the first switching device and the second switching device, and the first switching device and the second switching device are both the switching devices as described above;
[0106] The first switching device is used to forward the tunnel message from the first access layer device to the second switching device or the first customer premises equipment, forward the tunnel message from the second switching device to the first customer premises equipment, forward the tunnel reply message from the first customer premises equipment to the second switching device or the first access layer device, and forward the tunnel reply message from the second switching device to the first access layer device;
[0107] The second switching device is used to forward the tunnel message from the second access layer device to the first switching device or the second user premises device, forward the tunnel message from the first switching device to the second user premises device, forward the tunnel reply message from the second user premises device to the first switching device or the second access layer device, and forward the tunnel reply message from the first switching device to the second access layer device.
[0108] Based on the above method, it can be known that in this network system, multiple virtual sub-interfaces can be set in each switching device, and each virtual sub-interface is provided with a corresponding forwarding message identifier, which is used to determine the tunnel message to be forwarded by the virtual sub-interface. At this time, when each switching device receives a tunnel message sent from an access layer device or other switching device, it can extract the original message identifier in the tunnel message, and match the original message identifier with each forwarding message identifier to determine the target virtual sub-interface to forward the tunnel message, and then forward the tunnel message to other switching devices or user premises equipment connected to the target virtual sub-interface. In addition, each switching device can also receive the tunnel reply message sent by the destination device from the virtual sub-interface, and forward the tunnel reply message to the source device to ensure that the tunnel reply message can return to the original path. In other words, by setting multiple virtual sub-interfaces for tunnel message diversion in each switching device, the system can flexibly divert tunnel messages with different original message identifiers to different destinations, thereby improving the user service quality.
[0109] The following introduces various tunnel message diversion scenarios based on the specific network system structure. The OLT in the following example can be regarded as an access layer device.
[0110] Please refer to Figure 4 , Figure 4 A schematic diagram of the first tunnel message diversion scenario provided by an embodiment of the present invention. In this scenario, user device 1 accesses vSwitch1 (switching device) through ONU1 and OLT1, and user device 2 accesses vSwitch1 through ONU2 and OLT1, that is, user devices 1 and 2 are located in different physical locations. vSwitch1 is bridged with vCPE1 (customer premises equipment). In addition, ONU1 can add CVLAN tag 1001 to user tunnel messages, ONU2 can add CVLAN tag 2001 to user tunnel messages, and OLT1 can add SVLAN tag 201 to user tunnel messages. vCPE1 only processes tunnel messages with VLAN tag 1001. In addition, user devices 1 and 2 belong to the same user group, and both need to access vCPE1. The dotted line passing through user device 2, ONU2, OLT1, vSwitch1, and vCPE1 represents the message flow direction of user device 2.
[0111] For the tunnel message of user device 2, it flows into vSwitch1 after being added with the identifier 201 / 2001 by ONU2 and OLT1. The corresponding virtual sub-interface in vSwitch1 can convert the identifier of the tunnel message from 201 / 2001 to 1001, and transfer it to vCPE1 for processing. vCPE1 can return the processed tunnel reply message to vSwitch1. The corresponding virtual sub-interface in vSwitch1 can restore the identifier of the tunnel reply message from 1001 to 201 / 2001, and reply to user device 2 through OLT1 and ONU2.
[0112] Please refer to Figure 5 , Figure 5 A schematic diagram of the second tunnel message diversion scenario provided by an embodiment of the present invention. In this scenario, user devices 1 and 2 access vSwitch1 through ONU1 and OLT1, and user device 3 accesses vSwitch1 through ONU2 and OLT1, that is, user devices 1 and 2 are located in the same physical location, and user devices 1 and 2 and user device 3 are located in different physical locations. vSwitch1 is bridged with vCPE1 and vCPE2. In addition, ONU1 can add CVLAN tag 1001 to user tunnel messages, ONU2 can add CVLAN tag 2001 to user tunnel messages, and OLT1 can add SVLAN tag 201 to user tunnel messages. vCPE1 only processes tunnel messages with VLAN tag 1001, and vCPE2 only processes tunnel messages with VLAN tag 2001. In addition, user device 1 is a separate user group and needs to access vCPE1; user devices 2 and 3 belong to the same user group and need to access vCPE2. The dotted line passing through user equipment 1, ONU1, OLT1, vSwitch1, and vCPE1 and the dotted line passing through user equipment 2, ONU1, OLT1, vSwitch1, and vCPE2 represent the message flows of user equipment 1 and 2, respectively.
[0113] For the tunnel message of user device 1, it flows into vSwitch1 after being added with the identifier 201 / 1001 by ONU1 and OLT1. Virtual sub-interface 1 (not shown) in vSwitch1 matches the tunnel message with the source MAC address of user device 1, converts the identifier of the tunnel message from 201 / 1001 to 1001, and transfers it to vCPE1 for processing. vCPE1 can return the processed tunnel reply message to vSwitch1. Virtual sub-interface 1 in vSwitch1 restores the identifier of the tunnel reply message from 1001 to 201 / 1001, and replies to user device 1 through OLT1 and ONU1.
[0114] For the tunnel message of user device 2, it flows into vSwitch1 after being added with the identifier 201 / 1001 by ONU1 and OLT1. Virtual sub-interface 2 (not shown) in vSwitch1 matches the tunnel message with the source MAC address of user device 2, converts the identifier of the tunnel message from 201 / 1001 to 2001, and transfers it to vCPE2 for processing. vCPE2 can return the processed tunnel reply message to vSwitch1. Virtual sub-interface 2 in vSwitch1 restores the identifier of the tunnel reply message from 2001 to 201 / 1001, and replies to user device 2 through OLT1 and ONU1.
[0115] Please refer to Figure 6 , Figure 6 A schematic diagram of the third tunnel message diversion scenario provided by an embodiment of the present invention. In this scenario, user device 1 accesses vSwitch1 through ONU2 and OLT1, and user device 2 accesses vSwitch2 through ONU3 and OLT2, that is, user devices 1 and 2 are located in different physical locations. vSwitch1 is bridged with vCPE1, and vSwitch2 is bridged with vCPE2, and a tunnel is set between vSwitch1 and vSwitch2. In addition, ONU2 can add CVLAN tag 2001 to user tunnel messages, and OLT1 can add SVLAN tag 201 to user tunnel messages. ONU3 can add CVLAN tag 2002 to user tunnel messages, and OLT2 can add SVLAN tag 202 to user tunnel messages. vCPE1 only processes tunnel messages with VLAN tag 1001, and vCPE2 only processes tunnel messages with VLAN tag 2001. In addition, user devices 1 and 2 belong to the same user group and both need to access vCPE2. The dotted line passing through user equipment 1, ONU2, OLT1, vSwitch1, vSwitch2, and vCPE2 indicates the message flow direction of user equipment 1.
[0116] For the tunnel message of user device 1, it flows into vSwitch1 after being added with the identifier 201 / 2001 by ONU2 and OLT1. Virtual sub-interface 1 (not shown) in vSwitch1 matches the tunnel message identified as 201 / 2001 and forwards it to vSwitch2 through the tunnel. Virtual sub-interface 2 (not shown) in vSwitch2 matches the tunnel message identified as 201 / 2001, converts the identifier of the tunnel message from 201 / 2001 to 2002, and transfers it to vCPE2 for processing. vCPE2 can return the processed tunnel reply message to vSwitch2. Virtual sub-interface 2 in vSwitch2 restores the identifier of the tunnel reply message from 2002 to 201 / 2001, and returns it to vSwitch1 through the tunnel. vSwitch1 can reply the tunnel reply message to user device 1 through OLT1 and ONU2.
[0117] Based on the above embodiment, a message forwarding device provided by an embodiment of the present invention is introduced below. Figure 7 , Figure 7 A structural block diagram of a message forwarding device provided in an embodiment of the present invention, the device is applied to a switching device, the switching device has multiple virtual sub-interfaces, the virtual sub-interfaces are provided with forwarding message identifiers, and the forwarding message identifiers are used to determine the tunnel messages to be forwarded by the virtual sub-interfaces. The device may include:
[0118] The receiving module 701 is used to receive a tunnel message sent by a source device and extract an original message identifier in the tunnel message; wherein the source device is an access layer device or other switching device;
[0119] A matching module 702, used to match the original message identifier with each forwarded message identifier to determine a target virtual sub-interface for forwarding the tunnel message;
[0120] The first forwarding module 703 is used to forward the tunnel message to a destination device connected to the target virtual sub-interface; wherein the destination device is other switching devices or customer premises equipment;
[0121] The second forwarding module 704 is configured to receive a tunnel reply message sent by a destination device from the virtual sub-interface, and forward the tunnel reply message to a source device.
[0122] Optionally, the original message identifier includes an original tunnel identifier and a source MAC address, and the forwarded message identifier is a forwarding tunnel identifier or a forwarding MAC address;
[0123] The matching module 702 may include:
[0124] The first matching submodule is used for matching the original tunnel identifier with each forwarding tunnel identifier to determine the target virtual sub-interface for forwarding the tunnel message if the message forwarding identifier of each virtual sub-interface is determined to be a forwarding tunnel identifier;
[0125] The second matching submodule is used to match the source MAC address with each forwarding MAC address if it is determined that the message forwarding identifier of each virtual sub-interface is a forwarding MAC address, so as to determine a target virtual sub-interface for forwarding the tunnel message.
[0126] Optionally, the original tunnel identifier includes multiple layers of sub-tunnel identifiers arranged in order, and the forwarding tunnel identifier includes one or more layers of sub-forwarding tunnel identifiers arranged in order;
[0127] The first matching submodule may include:
[0128] a matching unit, configured to sequentially match each sub-tunnel identifier in the original tunnel identifier with each sub-forwarding tunnel identifier in the forwarding tunnel identifier, and use a forwarding tunnel identifier in which each sub-forwarding tunnel identifier is successfully matched as a candidate forwarding tunnel identifier;
[0129] The setting unit is used to set the virtual sub-interface to which the candidate forwarding tunnel identifier with the maximum number of layers belongs as the target virtual sub-interface.
[0130] Optionally, the virtual sub-interface is provided with a tunnel identifier conversion rule, and the tunnel identifier conversion rule records the correspondence between the original tunnel identifier and the replacement tunnel identifier;
[0131] The first forwarding module 703 may include:
[0132] A first label replacement submodule, configured to convert an original tunnel identifier in a tunnel message into a corresponding replacement tunnel identifier according to a tunnel identifier conversion rule of a target virtual subinterface;
[0133] A first forwarding submodule, used for forwarding the tunnel message after completing the tunnel identifier conversion to a target device connected to the target virtual sub-interface;
[0134] Accordingly, the second forwarding module 704 may include:
[0135] The second label replacement submodule is used to convert the replacement tunnel identifier in the tunnel reply message into the corresponding original tunnel identifier according to the identifier conversion rule of the target virtual sub-interface;
[0136] The second forwarding submodule is used to forward the tunnel reply message after the tunnel identifier conversion is completed to the source device.
[0137] Optionally, the first forwarding module 703 may include:
[0138] A tunnel forwarding submodule, used for forwarding the tunnel message to the tunnel bridged with the target virtual sub-interface, so as to forward the tunnel message to the target device through the tunnel;
[0139] Or, a bridge domain forwarding submodule is used to forward the tunnel message to the bridge domain connected to the target virtual sub-interface, so as to forward the tunnel message to the target device through the bridge domain.
[0140] Optionally, the virtual sub-interface is provided with a MAC address table;
[0141] The device may also include:
[0142] A recording module, used to record the mapping relationship between the MAC address information of the tunnel message and the network port receiving the tunnel message in the MAC address table of the target virtual sub-interface;
[0143] Accordingly, the second forwarding module 704 may include:
[0144] A query submodule, used to query the corresponding target network port in the MAC address table of the virtual sub-interface according to the MAC address information of the tunnel reply message;
[0145] The forwarding submodule is used to forward the tunnel reply message to the source device through the target network port.
[0146] An embodiment of the present invention further provides a switching device, which may include:
[0147] Memory for storing computer programs;
[0148] A processor is used to implement the message forwarding method as described above when executing a computer program.
[0149] Physical interface used for network data transmission with external devices.
[0150] Since the embodiments of the switching device part correspond to the embodiments of the message forwarding method part, the embodiments of the switching device part refer to the description of the embodiments of the message forwarding method part, which will not be repeated here.
[0151] An embodiment of the present invention further provides a computer program product, including a computer program or instructions, which implements the message forwarding method described in the above embodiment when executed by a processor.
[0152] Since the embodiments of the computer program product part correspond to the embodiments of the message forwarding method part, please refer to the description of the embodiments of the message forwarding method part for the embodiments of the computer program product part, and will not be repeated here.
[0153] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the message forwarding method described in the above embodiment is implemented.
[0154] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the message forwarding method part, the embodiments of the storage medium part refer to the description of the embodiments of the message forwarding method part, which will not be repeated here.
[0155] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0156] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0157] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0158] The message forwarding method, device, switching device, network system and storage medium provided by the present invention are introduced in detail above. Specific examples are used herein to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A message forwarding method, It is characterized in that Applied to a switching device, the switching device has a plurality of virtual sub-interfaces, the virtual sub-interfaces are provided with forwarding message identifiers, the forwarding message identifiers are used to determine tunnel messages to be forwarded by the virtual sub-interfaces, the method comprises: Receive a tunnel message sent by a source device, and extract an original message identifier in the tunnel message; wherein the source device is an access layer device or other switching device; Matching the original message identifier with each of the forwarded message identifiers to determine a target virtual sub-interface for forwarding the tunnel message; Forwarding the tunnel message to a destination device connected to the target virtual sub-interface; wherein the destination device is other switching equipment or customer premises equipment; The tunnel reply message sent by the destination device is received from the virtual sub-interface, and the tunnel reply message is forwarded to the source device.
2. The message forwarding method according to claim 1, It is characterized in that The original message identifier includes an original tunnel identifier and a source MAC address, and the forwarded message identifier is a forwarding tunnel identifier or a forwarding MAC address; The matching of the original message identifier with each of the forwarded message identifiers to determine a target virtual sub-interface for forwarding the tunnel message includes: If it is determined that the message forwarding identifier of each virtual sub-interface is the forwarding tunnel identifier, the original tunnel identifier is matched with each forwarding tunnel identifier to determine the target virtual sub-interface for forwarding the tunnel message; If it is determined that the message forwarding identifier of each virtual sub-interface is the forwarding MAC address, the source MAC address is matched with each forwarding MAC address to determine the target virtual sub-interface for forwarding the tunnel message.
3. The message forwarding method according to claim 2, It is characterized in that The original tunnel identifier includes multiple layers of sub-tunnel identifiers arranged in order, and the forwarding tunnel identifier includes one or more layers of sub-forwarding tunnel identifiers arranged in order; The matching of the original tunnel identifier with each of the forwarding tunnel identifiers to determine a target virtual sub-interface for forwarding the tunnel message includes: Sequentially matching each sub-tunnel identifier in the original tunnel identifier with each sub-forwarding tunnel identifier in the forwarding tunnel identifier, and taking a forwarding tunnel identifier in which each sub-forwarding tunnel identifier is successfully matched as a candidate forwarding tunnel identifier; The virtual sub-interface to which the candidate forwarding tunnel identifier with the largest number of layers belongs is set as the target virtual sub-interface.
4. The message forwarding method according to claim 2, It is characterized in that The virtual sub-interface is provided with a tunnel identifier conversion rule, and the tunnel identifier conversion rule records the correspondence between the original tunnel identifier and the replacement tunnel identifier; The step of forwarding the tunnel message to a target device connected to the target virtual sub-interface includes: According to the tunnel identifier conversion rule of the target virtual sub-interface, convert the original tunnel identifier in the tunnel message into a corresponding replacement tunnel identifier; Forwarding the tunnel message after completing the tunnel identifier conversion to the target device connected to the target virtual sub-interface; Correspondingly, forwarding the tunnel reply message to the source device includes: According to the identifier conversion rule of the target virtual sub-interface, converting the replacement tunnel identifier in the tunnel reply message into the corresponding original tunnel identifier; The tunnel reply message after completing the tunnel identifier conversion is forwarded to the source device.
5. The message forwarding method according to claim 4, It is characterized in that The replacement tunnel identifier includes one or more layers of sub-tunnel identifiers.
6. The message forwarding method according to claim 1, It is characterized in that The step of forwarding the tunnel message to a target device connected to the target virtual sub-interface includes: Forwarding the tunnel message to a tunnel bridged with the target virtual sub-interface, so as to forward the tunnel message to the target device through the tunnel; Or, forwarding the tunnel message to a bridge domain connected to the target virtual sub-interface, so as to forward the tunnel message to the target device through the bridge domain.
7. The message forwarding method according to any one of claims 1 to 6, It is characterized in that The virtual sub-interface is provided with a MAC address table; After determining the target virtual sub-interface for forwarding the tunnel message, the method further includes: In the MAC address table of the target virtual sub-interface, record the mapping relationship between the MAC address information of the tunnel message and the network port receiving the tunnel message; Correspondingly, forwarding the tunnel reply message to the source device includes: According to the MAC address information of the tunnel reply message, query the corresponding target network port in the MAC address table of the virtual sub-interface; The tunnel reply message is forwarded to the source device through the target network port.
8. A message forwarding device, It is characterized in that Applied to a switching device, the switching device has a plurality of virtual sub-interfaces, the virtual sub-interfaces are provided with forwarding message identifiers, the forwarding message identifiers are used to determine the tunnel messages to be forwarded by the virtual sub-interfaces, the device comprises: A receiving module, used for receiving a tunnel message sent by a source device and extracting an original message identifier in the tunnel message; wherein the source device is an access layer device or other switching device; A matching module, used for matching the original message identifier with each of the forwarded message identifiers to determine a target virtual sub-interface for forwarding the tunnel message; A first forwarding module, configured to forward the tunnel message to a destination device connected to the target virtual sub-interface; wherein the destination device is other switching equipment or customer premises equipment; The second forwarding module is used to receive the tunnel reply message sent by the destination device from the virtual sub-interface, and forward the tunnel reply message to the source device.
9. A switching device, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the message forwarding method as described in any one of claims 1 to 7 when executing the computer program.
10. A network system, It is characterized in that include: a first switching device, a second switching device, a first access layer device, a second access layer device, a first customer premises equipment, and a second customer premises equipment, wherein the first switching device is connected to the first access layer device and the first customer premises equipment, and the second switching device is connected to the second access layer device and the second customer premises equipment, a tunnel is provided between the first switching device and the second switching device, and the first switching device and the second switching device are both switching devices according to claim 8; The first switching device is configured to forward the tunnel message from the first access layer device to the second switching device or the first customer premises equipment, forward the tunnel message from the second switching device to the first customer premises equipment, forward the tunnel reply message from the first customer premises equipment to the second switching device or the first access layer device, and forward the tunnel reply message from the second switching device to the first access layer device; The second switching device is used to forward the tunnel message from the second access layer device to the first switching device or the second customer premises equipment, forward the tunnel message from the first switching device to the second customer premises equipment, forward the tunnel reply message from the second customer premises equipment to the first switching device or the second access layer device, and forward the tunnel reply message from the first switching device to the second access layer device.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the message forwarding method according to any one of claims 1 to 7 is implemented.
12. A computer program product comprising a computer program or instructions, It is characterized in that When the computer program or instruction is executed by a processor, the message forwarding method according to any one of claims 1 to 7 is implemented.
