Message transmission method and device
By carrying the tag information of the transmission direction in the message, the tunnel port of the virtual switch will determine the target transmission path based on the tag information, which solves the problem that the prior art cannot support traffic identification and distribution of different tenants, and realizes the need for multiple instances in the same communication tunnel.
Patent Information
- Application Number
- CN202411997505.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In the edge cloud gateway scenario, the existing packet transmission method cannot support traffic identification and traffic distribution of different tenants, and cannot realize the requirement of multiple instances in the same communication tunnel.
By carrying the tag information of the transmission direction in the message, the tunnel port of the virtual switch will receive the message, and then determine the target transmission direction of the message based on the tag information, and determine the target transmission path among multiple transmission paths to realize traffic identification and distribution of different tenants.
It realizes that packets from different target clients are transmitted in different target transmission paths, supports traffic identification and distribution of different tenants, and meets the needs of implementing multiple instances in the same communication tunnel.
Smart Images

Figure CN119835217A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message transmission method and device. Background Art
[0002] In the edge cloud gateway scenario, the metropolitan area network and the cloud gateway can be connected through a communication tunnel (such as an SRv6 tunnel). The VPP (Vector Packet Processing) architecture can be used to enable different tenants to use corresponding business services. In the VPP architecture, the access vswitch and the business agent are connected through the memif port. The access vswitch receives the business message sent by the Leaf device in the metropolitan area network through the dpdk plug-in. Different tenants under the same A-Leaf need to use the same communication tunnel. However, the current message transmission method does not support traffic identification and traffic distribution of different tenants, and cannot solve the need to implement multiple instances in the same communication tunnel. Summary of the invention
[0003] An embodiment of the present application provides a message transmission method, including: receiving a first message at a tunnel port of a virtual switch, the tunnel port corresponding to at least one target tunnel, the target tunnel corresponding to multiple transmission paths, and the transmission paths connecting a target client and a service proxy module; determining a target transmission direction of the first message based on label information of the transmission direction carried by the first message; and determining a target transmission path in each of the transmission paths based on the target transmission direction.
[0004] In some embodiments, the target transmission direction includes an uplink direction from the target client to the service proxy module or a downlink direction from the service proxy module to the target client, and determining the target transmission path in each of the transmission paths based on the target transmission direction includes: when the target transmission direction is the uplink direction, determining the target transmission path from each of the transmission paths according to the virtual LAN label information and the destination IP address carried by the first message; when the target transmission direction is the downlink direction, determining the target transmission path from each of the transmission paths according to the destination IP address of the first message.
[0005] In some embodiments, the transmission path includes a first interface corresponding to the tunnel port and a second interface corresponding to the service export port of the virtual switch, and the target transmission path is determined from each of the transmission paths according to the virtual LAN label information and the destination IP address carried by the first message, including: determining the target first interface from each of the first interfaces according to the virtual LAN label information; determining the target second interface from each of the second interfaces according to the virtual LAN label information; determining the target transmission path according to a first segment path between the target first interface and the target second interface, and a second segment path between the target second interface and the destination IP address.
[0006] In some embodiments, determining the target transmission path from each of the transmission paths according to the destination IP address of the first message includes: determining a third path between the tunnel port and the destination IP address, and determining the target transmission path according to the third path.
[0007] In some embodiments, after determining the target transmission path in each of the transmission paths based on the target transmission direction, it also includes: when the target transmission direction is the uplink direction, transmitting the first message using the target transmission path; when the target transmission direction is the downlink direction, encapsulating the first message according to the routing strategy matched by the first message to obtain a second message; and transmitting the second message using the target transmission path.
[0008] In some embodiments, the transmitting the second message by using the target transmission path includes: transmitting the second message to the target client via a switch and a metropolitan area network in sequence by using the target transmission path.
[0009] In some embodiments, the target tunnel adopts a segmented routing method, and the tunnel port includes a loopback interface. The target transmission direction of the first message is determined according to the label information of the transmission direction carried by the first message, including: determining the label value in the label information by calling a first node processing function in the loopback interface; when the label value is a first value, determining the target transmission direction as the upstream direction, and setting the first value to a second value by calling the first node processing function; when the label value is the second value, determining the target transmission direction as the downstream direction.
[0010] In some embodiments, before determining the target transmission direction of the first message based on the label information of the transmission direction carried by the first message, it also includes: determining the target interface of the virtual switch, the first message enters the virtual switch through the target interface, and the target interface is the service access port connected to the metropolitan area network or the service export port connected to the service proxy module; when the target interface is the service access port, the label value is set to the first value in the loopback interface by calling the second node processing function.
[0011] In some embodiments, before setting the label value to the first value by calling the second node processing function in the loopback interface, it also includes: decapsulating the target message entering the service access port by calling the second node processing function to obtain the first message; and sending the first message to the tunnel port.
[0012] An embodiment of the present application also proposes a message transmission device, including: a receiving module, used to receive a first message using a tunnel port of a virtual switch, the tunnel port corresponds to at least one target tunnel, the target tunnel corresponds to multiple transmission paths, and the transmission paths connect a target client and a service proxy module; a first determination module, used to determine the target transmission direction of the first message based on the label information of the transmission direction carried by the first message; and a second determination module, used to determine the target transmission path in each of the transmission paths based on the target transmission direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0014] Figure 1 A message transmission method process of an embodiment of the present application Figure 1 ;
[0015] Figure 2 The process of determining the target transmission path of the embodiment of the present application Figure 1 ;
[0016] Figure 3 The process of determining the target transmission path of the embodiment of the present application Figure 2 ;
[0017] Figure 4 A message transmission method process of an embodiment of the present application Figure 2 ;
[0018] Figure 5 A flowchart of determining a target transmission direction of a first message according to an embodiment of the present application;
[0019] Figure 6 A message transmission method process of an embodiment of the present application Figure 3 ;
[0020] Figure 7 A message transmission method process of an embodiment of the present application Figure 4 ;
[0021] Figure 8 A schematic diagram of the principle of a message transmission method according to an embodiment of the present application;
[0022] Fig. 9 This is a structural block diagram of a message transmission device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0024] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0025] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0026] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0027] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0028] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0029] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0030] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0031] A message transmission method in an embodiment of the present application carries label information of the transmission direction in a first message. After receiving the first message at the tunnel port of the virtual switch, the target transmission direction of the first message is determined according to the label information. Then, based on the target transmission direction, the target transmission path is determined in multiple transmission paths corresponding to the tunnel port. In this way, messages of different target clients can be transmitted in different target transmission paths, thereby supporting traffic identification and traffic distribution of different tenants, thereby meeting the demand for implementing multiple instances in the same communication tunnel.
[0032] like Figure 1 As shown, the following steps are included:
[0033] Step S101: A tunnel port of a virtual switch receives a first message, wherein the tunnel port corresponds to at least one target tunnel, and the target tunnel corresponds to multiple transmission paths, and the transmission paths connect a target client and a service proxy module.
[0034] In this embodiment, the virtual switch may be a vswitch in the VPP architecture, the service proxy module may be a service agent in the VPP architecture, and the target client may correspond to a tenant using the target service. The target client may send a message to the service proxy module via the virtual switch to request the target service from the service proxy module, and the service proxy module may also send a message to the target client via the virtual switch to provide the target service to the target client. There may be multiple service proxy modules, each corresponding to a target service, and different target services may be, for example, gaming services, cloud storage services, cloud computing services, etc. The virtual switch operates in a Layer 2 data network and implements the Layer 2 (and part of the Layer 3) network functions of the physical switch through software.
[0035] A tunnel port is provided in the virtual switch, and a first message is received from the tunnel port. The tunnel port corresponds to at least one target tunnel, and the target tunnel corresponds to multiple transmission paths. Different transmission paths may correspond to different target clients, and each transmission path connects the target client and the service proxy module, so that the target client can send a message to the service proxy module through the transmission path corresponding to itself to request the target service from the service proxy module, or the target client can receive a message from the service proxy module through the transmission path corresponding to itself to obtain the target service from the service proxy module.
[0036] In some embodiments of the present application, the target tunnel may be an SRv6 tunnel that complies with the End.DX2 SID, so that the message transmission can be more efficient and accurate. Among them, the End.DX2 type SID (Segment Identifier) can be used to identify a specific Layer 2 business or service, and to guide the forwarding and processing of data packets.
[0037] Step S102: Determine the target transmission direction of the first message according to the label information of the transmission direction carried by the first message.
[0038] In this embodiment, the first message carries the label information of the transmission direction, and the target transmission direction of the first message can be determined according to the label information. Optionally, the label information can be composed of a 1-bit field or a multi-bit field.
[0039] Step S103: determining a target transmission path in each of the transmission paths based on the target transmission direction.
[0040] In this embodiment, after the target transmission direction is determined, the target transmission path is determined from among multiple transmission paths corresponding to the target tunnel according to the target transmission direction, and the first message may be subsequently transmitted using the target transmission path.
[0041] The message transmission method of the embodiment of the present application includes: receiving a first message at a tunnel port of a virtual switch, the tunnel port corresponds to at least one target tunnel, the target tunnel corresponds to multiple transmission paths, and the transmission paths connect the target client and the service proxy module; determining the target transmission direction of the first message according to the label information of the transmission direction carried by the first message; and determining the target transmission path in each transmission path based on the target transmission direction. In this way, messages of different target clients can be transmitted in different target transmission paths, realizing traffic identification and traffic distribution supporting different tenants, thereby meeting the need to realize multiple instances in the same communication tunnel.
[0042] In some embodiments of the present application, the target transmission direction includes an uplink direction from the target client to the service proxy module or a downlink direction from the service proxy module to the target client, and based on the target transmission direction, a target transmission path is determined in each of the transmission paths, such as Figure 2 As shown, the following steps are included:
[0043] Step S1031, when the target transmission direction is the uplink direction, determine the target transmission path from the transmission paths according to the virtual LAN label information and the destination IP address carried by the first message.
[0044] In this embodiment, the target transmission direction includes an uplink direction from the target client to the service proxy module, or a downlink direction from the service proxy module to the target client. The first message carries virtual LAN tag information, which is a VLAN Tag. Each target client corresponds to a type of virtual LAN tag information. Therefore, the first message belongs to a QinQ message. If the target transmission direction is an uplink direction, the virtual LAN tag information and the destination IP address carried by the first message are determined, and a transmission path corresponding to the virtual LAN tag information and the destination IP address is determined from each transmission path, and it is determined as the target transmission path.
[0045] Step S1032: when the target transmission direction is the downlink direction, determine the target transmission path from the transmission paths according to the destination IP address of the first message.
[0046] In this embodiment, if the target transmission direction is the downlink direction, the destination IP address is determined from the first message, and the transmission path corresponding to the destination IP address is determined from each transmission path and determined as the target transmission path.
[0047] By determining the target transmission path according to the virtual LAN label information and the destination IP address in the uplink case, and determining the target transmission path according to the destination IP address in the downlink case, efficient and accurate determination of the target transmission path is achieved.
[0048] In some embodiments of the present application, the transmission path includes a first interface corresponding to the tunnel port and a second interface corresponding to the service export port of the virtual switch, and the target transmission path is determined from each of the transmission paths according to the virtual LAN label information and the destination IP address carried by the first message, such as Figure 3 As shown, the following steps are included:
[0049] Step S10311: determine a target first interface from each of the first interfaces according to the virtual local area network label information.
[0050] In this embodiment, the virtual switch includes a service export port, the service export port is connected to the service proxy module, the transmission path includes a first interface and a second interface, the first interface is set at the tunnel port, and the second interface is set at the service export port. Each virtual local area network tag information corresponds to a first interface in a tunnel port, and the target first interface is determined from each first interface according to the virtual local area network tag information.
[0051] In some embodiments of the present application, the business export may adopt memif (Memory Abstraction Interface, storage abstract interface).
[0052] Step S10312: determine a target second interface from each of the second interfaces according to the virtual local area network label information.
[0053] In this embodiment, each virtual local area network label information corresponds to a second interface in a service export port, and a target second interface is determined from each second interface according to the virtual local area network label information.
[0054] Step S10313: determine the target transmission path according to the first path between the target first interface and the target second interface, and the second path between the target second interface and the destination IP address.
[0055] In this embodiment, when the target transmission direction is the upstream direction, the first path between the target first interface and the target second interface is determined, the second path between the target second interface and the destination IP address is determined, and the target transmission path is determined based on the first path and the second path.
[0056] In some embodiments of the present application, the first path is a bridge in a virtual switch, namely, Bridge-domain.
[0057] For example, if Figure 8 As shown, the tunnel port is loop10 in the access vswitch (i.e., virtual switch), the service export port is memif101 / 1, the virtual LAN label information of tenant 1 is external 4000 internal 640, and the virtual LAN label information of tenant 2 is external 4001 internal 641. After the first message sent by tenant 1 arrives at loop10, according to the virtual LAN label information of tenant 1, 4000.640 in loop10 is used as the target first interface, 4000.640 in memif101 / 1 is used as the target second interface, BD-11 is used as the first segment path, and the path from 4000.640 in memif101 / 1 to the destination IP address is used as the second segment path. Finally, the target transmission path is determined according to BD-11 and the second segment path.
[0058] After the first message sent by tenant 2 arrives at loop10, according to the virtual LAN label information of tenant 2, 4001.641 in loop10 is used as the target first interface, 4001.641 in memif101 / 1 is used as the target second interface, BD-12 is used as the first segment path, and the path from 4001.641 in memif101 / 1 to the destination IP address is used as the second segment path. Finally, the target transmission path is determined based on BD-12 and the second segment path.
[0059] The target first interface and the target second interface are determined through the virtual LAN label information, and the target transmission path is determined according to the first segment path between the target first interface and the target second interface, and the second segment path between the target second interface and the destination IP address, so that the target transmission path is matched with the virtual LAN label information, so that the target transmission path corresponds to the corresponding target client, thereby improving the accuracy of the target transmission path.
[0060] In some embodiments of the present application, determining the target transmission path from each of the transmission paths according to the destination IP address of the first message includes:
[0061] A third path between the tunnel port and the destination IP address is determined, and the target transmission path is determined according to the third path.
[0062] In this embodiment, when the target transmission direction is the downlink direction, the path between the tunnel port and the destination IP address is used as the third path segment, and the target transmission path is determined according to the third path segment, thereby achieving efficient determination of the target transmission path.
[0063] For example, if Figure 8 As shown, after the first message sent by the service agent (ie, the service agent module) arrives at loop10 in the access vswitch, the path between loop10 and the destination IP address is used as the third path, and the target transmission path is determined according to the third path.
[0064] In some embodiments of the present application, when the target transmission direction is a downstream direction, the first message arrives at the tunnel entrance via the fourth path, and the process of determining the fourth path includes: determining the target second interface from each second interface according to the virtual LAN label information, determining the target first interface from each first interface according to the virtual LAN label information, and determining the fourth path according to the target second interface and the target first interface, so that the fourth path matches the virtual LAN label information, thereby ensuring that the fourth path corresponds to the corresponding target client, and realizing more accurate transmission of downstream messages.
[0065] For example, if Figure 8As shown in the figure, the tunnel port is loop10 in the access vswitch, the service export port is memif101 / 1, the virtual LAN label information of tenant 1 is external 4000 internal 640, and the virtual LAN label information of tenant 2 is external 4001 internal 641. The first message sent by the service agent to tenant 1 first arrives at memif101 / 1. According to the virtual LAN label information of tenant 1, 4000.640 in memif101 / 1 is used as the target second interface, 4000.640 in loop10 is used as the target first interface, BD-11 is used as the fourth path, and the first message is transmitted downstream to loop10 via BD-11.
[0066] The first message sent by the service agent to tenant 2 first arrives at memif101 / 1. According to the virtual LAN label information of tenant 2, 4001.641 in memif101 / 1 is used as the target second interface, 4001.641 in loop10 is used as the target first interface, BD-12 is used as the fourth path, and the first message is transmitted downstream to loop10 via BD-12.
[0067] In some embodiments of the present application, after determining the target transmission path in each of the transmission paths based on the target transmission direction, as follows: Figure 4 As shown, the following steps are also included:
[0068] Step S104: when the target transmission direction is the uplink direction, transmit the first message using the target transmission path.
[0069] In this embodiment, after the target transmission path is determined, if the target transmission direction is an uplink direction, the first message is transmitted to the service proxy module using the target transmission path.
[0070] Step S105, when the target transmission direction is the downlink direction, encapsulate the first message according to the routing policy matched by the first message to obtain a second message; and transmit the second message using the target transmission path.
[0071] In this embodiment, after determining the target transmission path, if the target transmission direction is the downlink direction, the first message needs to be encapsulated and then transmitted. Specifically, the first message is encapsulated according to the routing strategy matched by the first message to obtain the second message, and then the second message is transmitted to the target client using the target transmission path.
[0072] After determining the target transmission path, the message is transmitted in different ways according to different transmission directions, thereby improving the accuracy of message transmission.
[0073] In some embodiments of the present application, the first message is encapsulated by calling a third node processing function to obtain a second message. The third node processing function may be sr-pl-rewrite-encaps-l2 in the VPP architecture.
[0074] In some embodiments of the present application, the transmitting the second message by using the target transmission path includes:
[0075] The target transmission path is used to transmit the second message to the target client via the switch and the metropolitan area network in sequence.
[0076] In this embodiment, there is a metropolitan area network and a switch between the target client and the virtual switch. After obtaining the second message, the second message is transmitted from the tunnel port to the switch, then reaches the metropolitan area network through the switch, and finally is transmitted to the target client through the metropolitan area network, thereby accurately transmitting the second message to the target client in the application scenario of the virtual switch and metropolitan area network.
[0077] For example, if Figure 8 As shown, after loop10 obtains the second message corresponding to tenant 1, the second message is transmitted to the XEG0 interface of the switch via the eht0 interface of the access vswitch, and then reaches the S-LEAF node of the metropolitan area network via the GE3 interface of the switch, and then reaches the A-LEAF node of the metropolitan area network from the S-LEAF node via the SPINE node of the metropolitan area network, and the second message is decapsulated at the A-LEAF node and transmitted to tenant 1. For the second message corresponding to tenant 2, its transmission process is similar to that of the second message corresponding to tenant 1, and will not be repeated here.
[0078] In some embodiments of the present application, the target tunnel adopts a segment routing mode, the tunnel port includes a loopback interface, and the target transmission direction of the first message is determined according to the label information of the transmission direction carried by the first message, such as Figure 5 As shown, the following steps are included:
[0079] Step S1021: determining a label value in the label information by calling a first node processing function in the loopback interface.
[0080] In this embodiment, the target tunnel adopts a segmented routing method, which can improve the efficiency and reliability of message transmission. The tunnel port includes a loopback interface (i.e., a loopback port). After the first message arrives at the loopback interface, the label value in the label information is determined by calling the first node processing function.
[0081] Step S1022: when the label value is a first value, determine that the target transmission direction is the uplink direction, and set the first value to a second value by calling the first node processing function.
[0082] In this embodiment, if the label value is the first value, it is determined that the target transmission direction is the uplink direction, and then the first value is set to the second value by calling the first node processing function.
[0083] Step S1023: when the label value is the second value, determine that the target transmission direction is the downlink direction.
[0084] In this embodiment, since the label value has been set from the first value to the second value in the uplink, and the label value will not change during the message transmission process, if the label value is the second value, it is determined that the target transmission direction is the downlink direction.
[0085] For example, if the first value is 1 and the second value is 0, then when the label value is 1, the target transmission direction is determined to be the uplink direction, and the label value is set to 0 by calling the first node processing function. When the label value is 0, the target transmission direction is determined to be the downlink direction. Alternatively, if the first value is 0 and the second value is 1, then when the label value is 0, the target transmission direction is determined to be the uplink direction, and the label value is set to 1 by calling the first node processing function. When the label value is 1, the target transmission direction is determined to be the downlink direction.
[0086] In some embodiments of the present application, the first node processing function may be loopback-input in the VPP architecture, and the label information may be VNET_BUFFER_F_SRV6.
[0087] By determining the label value in the label information in the loopback interface and changing the label value in the uplink case, the target transmission direction can be determined efficiently and accurately.
[0088] In some embodiments of the present application, before determining the target transmission direction of the first message according to the label information of the transmission direction carried by the first message, such as Figure 6 As shown, the following steps are also included:
[0089] Step S201, determining a target interface of the virtual switch, wherein the first message enters the virtual switch via the target interface, and the target interface is a service access port connected to a metropolitan area network or a service export port connected to the service proxy module.
[0090] In this embodiment, in the uplink case, the first message enters the virtual switch via the service access port connected to the metropolitan area network. In the downlink case, the first message enters the virtual switch via the service export port connected to the service proxy module. For example, as shown in Figure 8, the service access port is the eht0 interface of the vswitch, and the service export port is memif101 / 1.
[0091] Step S202: When the target interface is the service access point, the label value is set to the first value by calling a second node processing function in the loopback interface.
[0092] In this embodiment, when the target interface is a service access port, it means that the first message enters the virtual switch from the service access port, and the first message needs to be transmitted uplink to the service proxy module. In this case, by calling the second node processing function in the loopback interface, it can be determined that the target transmission direction is the uplink direction, and the label value is set to the first value, thereby ensuring that the target transmission direction is subsequently determined to be the uplink direction based on the label value being the first value, thereby accurately judging the target transmission direction.
[0093] In some embodiments of the present application, the second node processing function may be sr-localsid-d in the VPP architecture.
[0094] In some embodiments of the present application, before the label value is set to the first value by calling the third node processing function in the loopback interface, such as Figure 7 As shown, the following steps are also included:
[0095] Step S301: decapsulate the target message entering the service access port by calling the second node processing function to obtain the first message.
[0096] In this embodiment, when the target transmission direction is the uplink direction, the first message is obtained by decapsulating the target message. Specifically, the first message is obtained by calling the second node processing function to decapsulate the target message entering the service access port.
[0097] Step S302: Send the first message to the tunnel entrance.
[0098] In this embodiment, the first message is sent to the tunnel port, and the first message is transmitted after the target transmission direction and the target transmission path are determined.
[0099] The first message is obtained by decapsulating the target message, thereby ensuring accurate uplink transmission of the first message.
[0100] In order to further explain the technical idea of the present application, the technical solution of the present application is now described in combination with specific application scenarios.
[0101] The present application embodiment deals with a message transmission method, such as Figure 8As shown in the figure, the virtual switch is the access vswitch in the VPP architecture, the target clients include tenant 1 and tenant 2, the service proxy module is the service agent in the VPP architecture, and the target tunnel is the SRv6 tunnel that conforms to the End.DX2 SID. Loopback port loop10 is the tunnel port, eth0 is the service access port of the access vswitch, and memif101 / 1 is the service export port of the access vswitch. For the LAN side, tenant 1 and tenant 2 are identified and distinguished by qinq information (i.e., virtual LAN tag information). Each tenant corresponds to a bridge-domain on the LAN side (tenant 1 corresponds to BD-11, and tenant 2 corresponds to BD-12). The bridge-domain is connected to the qinq sub-interfaces (4000.640 and 4001.641) of loop10 and the qinq sub-interfaces (4000.640 and 4001.641) of memif101 / 1.
[0102] The following is the specific process of implementing multiple instances of SRv6 tunnels on the tenant LAN side:
[0103] (1) Uplink decapsulation direction:
[0104] VPP node processing flow:
[0105] dpdk-input→ethernet-input→ip6-input→ip6-lookup→sr-localsid-d→interface-output→loop10-output→loop10-tx→loopback-input→ethernet-input→l2-input→l2-learn→l2-fwd→l2-output→memif101 / 1-output.
[0106] dpdk-input: is the entry point for data packets, using the DPDK library for efficient packet capture and processing. DPDK provides a set of underlying libraries and drivers that allow high-speed, low-latency packet processing for network devices.
[0107] ethernet-input: This stage processes data packets at the Ethernet layer, including parsing the Ethernet frame header, checking, etc.
[0108] ip6-input: This stage specifically processes IPv6 packets, parses the IPv6 header, and performs necessary checks and preprocessing.
[0109] ip6-lookup: In an IPv6 network, this step involves a routing lookup to determine how the packet should be forwarded.
[0110] sr-localsid-d: Related to source routing or local SID (Service Identifier) processing.
[0111] interface-output: This stage is responsible for outputting the data packet to the specified network interface.
[0112] Loop10-output: indicates the output stage of interface loop10.
[0113] Loop10-tx: This is the transmission (TX) phase of the packet on loop10, preparing to send the packet to the physical or virtual link.
[0114] loopback-input: If the packet is sent to a loopback interface, it will be received here. Loopback interfaces are usually used for network testing or local communication.
[0115] ethernet-input: The data packet enters the Ethernet input stage again.
[0116] l2-input: This stage processes the input of the data link layer (Layer 2), involving MAC address learning, frame filtering, etc.
[0117] l2-learn: In this phase, the network device learns which port the source MAC address is associated with for subsequent frame forwarding.
[0118] l2-fwd: Data link layer forwarding stage, which determines the next hop of the data packet based on the learned MAC address information.
[0119] l2-output: The output stage of the data link layer, preparing to send the data packet to the next network device.
[0120] Memif101 / 1-output: Finally, the data packet is output through the memif101 / 1 interface.
[0121] A brief description of the relevant node implementation:
[0122] Call sr-localsid-d to decapsulate the target message received from eth0, obtain the first message, send the first message to loop10, call sr-localsid-d in loop10 to set the label information VNET_BUFFER_F_SRV6 in the first message to 1, then call loopback-input, according to VNET_BUFFER_F_SRV6 is 1, determine that the transmission direction of the first message is the upstream direction, and use loopback-input to set VNET_BUFFER_F_SRV6 to 0, specifying that the next node processing function is ethernet-input. Then call ethernet_input, according to the qinq information of the first message, forward the messages reported by different tenants to the corresponding loopback qinq sub-interface, forward them to the qinq sub-interface of memif101 / 1 through the L2 bridge, and then transmit them to the service agent through memif101 / 1.
[0123] Specifically, the qinq information of tenant 1 is 4000 external and 640 internal, and the qinq information of tenant 2 is 4001 external and 641 internal. After the first message sent by tenant 1 reaches loop10, according to the qinq information of tenant 1, 4000.640 in loop10 is used as the target first interface, and 4000.640 in memif101 / 1 is used as the target second interface, and the first message is transmitted to the service agent via BD-11. After the first message sent by tenant 2 reaches loop10, according to the qinq information of tenant 2, 4001.641 in loop10 is used as the target first interface, and 4001.641 in memif101 / 1 is used as the target second interface, and the first message is transmitted to the service agent via BD-12.
[0124] (2) Downstream encapsulation direction:
[0125] VPP node processing flow:
[0126] memif-input→ethernet-input→l2-input→l2-learn→l2-flood→l2-output→loop10-output→loop10-tx→loopback-l2input→sr-pl-rewrite-encaps-l2→ip6-lookup→ip6-load-balance→ip6-rewrite→eth1-output→eth1-tx. in,
[0127] memif-input: It is the entry point for packets to enter the processing pipeline from a memory interface (memif). Memory interfaces are usually used to pass packets between different network functions, virtual machines, or containers.
[0128] ethernet-input: This stage processes data packets at the Ethernet layer, including parsing the Ethernet frame header, checking, etc.
[0129] l2-input: This stage processes the input of the data link layer (Layer 2), involving MAC address learning, frame filtering, etc.
[0130] l2-learn: In this phase, the network device learns which port the source MAC address is associated with for subsequent frame forwarding.
[0131] l2-flood: If the destination MAC address of the packet is unknown or the network device decides to broadcast / multicast, it will be flooded to all relevant ports at this stage.
[0132] l2-output: The output stage of the data link layer, preparing to send the data packet to the next network device.
[0133] Loop10-output: refers to the output stage of loop10.
[0134] Loop10-tx: This is the transmission (TX) phase of the packet on the loop10 interface, preparing the packet to be sent to the physical or virtual link.
[0135] loopback-l2input: If the packet is sent to a loopback interface and needs to be processed again at the data link layer, it will be received at loopback-l2input.
[0136] sr-pl-rewrite-encaps-l2: This phase is related to Segment Routing (SR) and involves encapsulating or rewriting packets at the data link layer, such as adding SR tags, modifying MAC addresses, or performing other SR-related operations.
[0137] ip6-lookup: In an IPv6 network, this step involves a routing lookup to determine how the packet should be forwarded.
[0138] ip6-load-balance: This phase is used to load balance IPv6 packets across multiple available paths.
[0139] ip6-rewrite: In this phase, the header of the IPv6 packet is modified, such as changing the destination address, source address, or adding / removing extension headers.
[0140] eth1-output: This is the stage where the packet is ready to be output from the Ethernet interface named "eth1".
[0141] eth1-tx: This is the transmission (TX) phase of the packet on the “eth1” interface where the packet is sent to the physical link.
[0142] A brief description of the relevant node implementation:
[0143] The message sent by the service agent to the tenant side is forwarded to the access vswitch through memif101 / 1 between the service agent and the access vswitch. The memif101 / 1 on the access vswitch receives the message and forwards the message sent to different tenants to the corresponding qinq sub-interface of memif101 / 1 according to the qinq information of the message. Then, the message is transmitted as the first message to the qinq sub-interface of loop10 through L2 bridge-domain (the message sent to tenant 1 goes through BD-11, and the message sent to tenant 2 goes through BD-12). After the qinq sub-interface of loop10 receives the first message, loopback-l2input is called. According to the VNET_BUFFER_F_SRV6 of the message being 0, it is judged to be in the downstream direction and sent to sr-pl-rewrite-encaps-l2 Node processes and matches the first messages of different tenants to the corresponding segment routing policies by calling sr-pl-rewrite-encaps-l2. After SRv6 encapsulation of the first message, the second message is obtained, and then the second message is transmitted to the corresponding tenant through the switch and the metropolitan area network in sequence.
[0144] By applying the above technical solution, at the tunnel port of the SRv6 tunnel, the label value of the label information VNET_BUFFER_F_SRV6 carried by the message is used to identify the uplink and downlink of the message, so that the messages of different tenants are transmitted in different target transmission paths, thereby supporting traffic identification and traffic distribution for different tenants, and meeting the requirements of multiple instances of the SRv6 tunnel.
[0145] The present application also provides a message transmission device, such as Fig. 9As shown, it includes: a receiving module, used to receive a first message using a tunnel port of a virtual switch, the tunnel port corresponds to at least one target tunnel, the target tunnel corresponds to multiple transmission paths, and the transmission paths connect the target client and the business proxy module; a first determination module, used to determine the target transmission direction of the first message according to the label information of the transmission direction carried by the first message; a second determination module, used to determine the target transmission path in each of the transmission paths based on the target transmission direction.
[0146] The message transmission device of the embodiment of the present application receives a first message at the tunnel port of the virtual switch through a receiving module, the tunnel port corresponds to at least one target tunnel, the target tunnel corresponds to multiple transmission paths, and the transmission paths connect the target client and the service proxy module; the first determination module determines the target transmission direction of the first message according to the label information of the transmission direction carried by the first message; the second determination module determines the target transmission path in each transmission path based on the target transmission direction. In this way, messages of different target clients can be transmitted in different target transmission paths, realizing traffic identification and traffic distribution supporting different tenants, thereby meeting the requirements of realizing multiple instances in the same communication tunnel.
[0147] In a specific application scenario, the target transmission direction includes an uplink direction from the target client to the service proxy module or a downlink direction from the service proxy module to the target client. The second determination module is specifically used to: when the target transmission direction is the uplink direction, determine the target transmission path from each of the transmission paths according to the virtual LAN label information and the destination IP address carried by the first message; when the target transmission direction is the downlink direction, determine the target transmission path from each of the transmission paths according to the destination IP address of the first message.
[0148] In a specific application scenario, the transmission path includes a first interface corresponding to the tunnel port and a second interface corresponding to the service export port of the virtual switch, and the second determination module is also specifically used to: determine the target first interface from each of the first interfaces according to the virtual LAN label information; determine the target second interface from each of the second interfaces according to the virtual LAN label information; determine the target transmission path according to the first segment path between the target first interface and the target second interface, and the second segment path between the target second interface and the destination IP address.
[0149] In a specific application scenario, the second determination module is further specifically used to: determine a third path between the tunnel port and the destination IP address, and determine the target transmission path according to the third path.
[0150] In a specific application scenario, it also includes a transmission module, which is used to: when the target transmission direction is the uplink direction, transmit the first message using the target transmission path; when the target transmission direction is the downlink direction, encapsulate the first message according to the routing strategy matched by the first message to obtain a second message; and transmit the second message using the target transmission path.
[0151] In a specific application scenario, the transmission module is specifically used to: utilize the target transmission path to transmit the second message to the target client via the switch and the metropolitan area network in sequence.
[0152] In a specific application scenario, the target tunnel adopts a segmented routing method, the tunnel port includes a loopback interface, and a first determination module is specifically used to: determine the label value in the label information by calling a first node processing function in the loopback interface; when the label value is a first value, determine that the target transmission direction is the uplink direction, and set the first value to a second value by calling the first node processing function; when the label value is the second value, determine that the target transmission direction is the downlink direction.
[0153] In a specific application scenario, it also includes a setting module, which is used to: determine the target interface of the virtual switch, the first message enters the virtual switch through the target interface, and the target interface is a service access port connected to the metropolitan area network or a service export port connected to the service proxy module; when the target interface is the service access port, the label value is set to the first value in the loopback interface by calling the second node processing function.
[0154] In a specific application scenario, it also includes a decapsulation module, which is used to: decapsulate the target message entering the service access port by calling the second node processing function to obtain the first message; and send the first message to the tunnel port.
[0155] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0156] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.
Claims
1. A message transmission method, comprising: The tunnel port of the virtual switch receives the first message, the tunnel port corresponds to at least one target tunnel, the target tunnel corresponds to multiple transmission paths, and the transmission paths connect the target client and the service proxy module; Determining a target transmission direction of the first message according to the label information of the transmission direction carried by the first message; Based on the target transmission direction, a target transmission path is determined in each of the transmission paths.
2. The message transmission method according to claim 1, wherein the target transmission direction comprises an uplink direction from the target client to the service proxy module or a downlink direction from the service proxy module to the target client, and the determining the target transmission path in each of the transmission paths based on the target transmission direction comprises: In a case where the target transmission direction is the uplink direction, determining the target transmission path from each of the transmission paths according to the virtual local area network label information and the destination IP address carried by the first message; When the target transmission direction is the downlink direction, the target transmission path is determined from the transmission paths according to the destination IP address of the first message.
3. The message transmission method according to claim 2, wherein the transmission path includes a first interface corresponding to the tunnel port and a second interface corresponding to the service export port of the virtual switch, and the step of determining the target transmission path from each of the transmission paths according to the virtual LAN label information and the destination IP address carried by the first message comprises: Determine a target first interface from each of the first interfaces according to the virtual local area network label information; Determine a target second interface from each of the second interfaces according to the virtual local area network label information; The target transmission path is determined according to a first path segment between the target first interface and the target second interface, and a second path segment between the target second interface and the destination IP address.
4. The message transmission method according to claim 2, wherein determining the target transmission path from each of the transmission paths according to the destination IP address of the first message comprises: A third path between the tunnel port and the destination IP address is determined, and the target transmission path is determined according to the third path.
5. The message transmission method according to claim 2, after determining the target transmission path in each of the transmission paths based on the target transmission direction, further comprising: When the target transmission direction is the uplink direction, transmitting the first message by using the target transmission path; When the target transmission direction is the downlink direction, encapsulating the first message according to the routing policy matched by the first message to obtain a second message; The second message is transmitted using the target transmission path.
6. The message transmission method according to claim 5, wherein the transmitting the second message by using the target transmission path comprises: The target transmission path is used to transmit the second message to the target client via the switch and the metropolitan area network in sequence.
7. The message transmission method according to claim 2, wherein the target tunnel adopts a segment routing mode, the tunnel port includes a loopback interface, and the target transmission direction of the first message is determined according to the label information of the transmission direction carried by the first message, comprising: Determining a label value in the label information by calling a first node processing function in the loopback interface; In a case where the label value is a first value, determining that the target transmission direction is the uplink direction, and setting the first value to a second value by calling the first node processing function; When the label value is the second value, the target transmission direction is determined to be the downlink direction.
8. The message transmission method according to claim 7, before determining the target transmission direction of the first message according to the label information of the transmission direction carried by the first message, further comprising: Determine a target interface of the virtual switch, the first message enters the virtual switch through the target interface, and the target interface is a service access port connected to a metropolitan area network or a service export port connected to the service proxy module; In a case where the target interface is the service access point, the label value is set to the first value by calling a second node processing function in the loopback interface.
9. The message transmission method according to claim 8, before setting the label value to the first value by calling the second node processing function in the loopback interface, further comprising: Decapsulating the target message entering the service access port by calling the second node processing function to obtain the first message; Send the first message to the tunnel entrance.
10. A message transmission device, comprising: A receiving module, configured to receive a first message by using a tunnel port of a virtual switch, wherein the tunnel port corresponds to at least one target tunnel, and the target tunnel corresponds to multiple transmission paths, and the transmission paths connect a target client and a service proxy module; A first determination module, used to determine a target transmission direction of the first message according to the label information of the transmission direction carried by the first message; The second determining module is used to determine a target transmission path in each of the transmission paths based on the target transmission direction.
Citation Information
Patent Citations
Message forwarding method and device
CN108667709A
Message forwarding method and device
CN109587027A
Path detection method and device
CN112350938A
Message transmission method and device, equipment and storage medium
CN114024898A
Message processing method and device, equipment and medium
CN115022121A