Message forwarding method, electronic equipment and storage medium
By obtaining the VLAN tag value in the IP packet and mapping it to the segmented routing policy, the problem that the DSCP traffic drainage method cannot provide differentiated services, and differentiated services and customized bearer quality for multiple services are achieved.
Patent Information
- Application Number
- CN202310793675.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2024-12-31
AI Technical Summary
The existing differentiated service coding point (DSCP) traffic drainage method can only provide limited differentiated services, because its value range is only 0-63, which cannot meet the needs of providing differentiated services for multiple services.
By obtaining the target virtual LAN (VLAN) tag value in the IP packet, the target segment routing policy is obtained based on the preset VLAN tag value and the color tag mapping relationship and the color tag mapping relationship with the segment routing policy, and the target segment routing policy is obtained based on the This policy forwards messages, thereby realizing differentiated services for multiple services.
Through the VLAN tag drainage method, it can support 4094 VLANs, provide richer differentiated services, and meet the differentiation and customized quality of carrying capacity of multiple services.
Smart Images

Figure CN119232645A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a message forwarding method, electronic device, and storage medium. Background Art
[0002] Segment Routing (SR) is a tunnel technology based on source routing forwarding mode. The data plane of SR uses Multi-Protocol Label Switching (MPLS) or Internet Protocol version 6 (IPv6). SR based on IPv6 is called Internet Protocol version 6 Segment Routing (IPv6SR) or Segment Routing over IPv6 data plane (SRv6).
[0003] Differentiated Services Code Point (DSCP) diversion is to iterate the tunnel strategy according to the destination address of the route. Related technologies generally use DSCP diversion, but since the DSCP value range is only 0-63, the DSCP diversion method can only provide limited differentiated services. Summary of the invention
[0004] The embodiments of the present application provide a message forwarding method, an electronic device, and a storage medium, which can solve the problem of being unable to provide differentiated services for multiple businesses.
[0005] In order to solve the above technical problems, this application is implemented as follows:
[0006] In a first aspect, a method for forwarding a message is provided, comprising: obtaining a target virtual local area network (VLAN) tag value carried in an IP message to be sent; obtaining a target color tag corresponding to the target VLAN tag value based on a first mapping relationship between a preset VLAN tag value and a color tag; obtaining a target segment routing policy corresponding to the target color tag based on a second mapping relationship between a preset color tag and a segment routing policy; and forwarding the IP message based on the target segment routing policy.
[0007] In a second aspect, an electronic device is provided, the electronic device comprising a processor and a memory, the memory storing a program or instruction that can be run on the processor, and the program or instruction when executed by the processor implements the steps of the message forwarding method as described in the first aspect
[0008] According to a third aspect, a readable storage medium is provided, wherein the readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the message forwarding method described in the first aspect are implemented.
[0009] In the technical solution provided in the embodiment of the present application, a first mapping relationship between a VLAN tag value and a color tag and a second mapping relationship between a color tag (color) and a segment routing strategy are pre-set. When an IP message to be forwarded is obtained, a target color tag corresponding to the target VLAN tag value is obtained according to the target VLAN tag value carried in the IP message, and then a target segment routing strategy corresponding to the target color tag is obtained, and the IP message is forwarded based on the target segment routing strategy. Thus, traffic can be directed according to the VLAN tag. Since the VLAN tag is generally 12 bits, a maximum of 4094 VLANs can be supported. Therefore, by directing traffic through different vlan tag values (tags), it is possible to distinguish more services and provide differentiated services for more services.
[0010] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0012] Figure 1 A flow chart of a message forwarding method provided by an exemplary embodiment of the present application is shown;
[0013] Figure 2 A schematic diagram of a scenario of an exemplary embodiment of the present application is shown;
[0014] Figure 3 It is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0015] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0016] In the related technology, DSCP diversion is generally used to forward packets. For example, first, the endpoint is used to match the policy group. Then, according to the DSCP included in the IP packet, the policy corresponding to the DSCP is found from the policy group. Finally, the service packet is forwarded according to the found policy. Among them, a group of policies with the same endpoint but different color attributes can be added to the same policy group, and then the mapping relationship between the specified Color attribute and the DSCP is specified to achieve the IP packet being diverted to the specified policy according to the DSCP included in the IP packet. However, since the DSCP value range is only 0-63, the DSCP diversion method can only provide limited differentiated services.
[0017] In order to solve the above technical problems, Figure 1 The flowchart of a message forwarding method provided by an exemplary embodiment of the present application is shown. The method can be executed by a network device, and the network device can be a service provider edge (Provider Edge, PE) device, etc. Figure 1 As shown, the method mainly includes the following steps.
[0018] S110: Obtain a target VLAN tag value carried in the IP message to be sent.
[0019] In an embodiment of the present application, the network device may receive the IP message to be sent from a local user side port.
[0020] In addition, in the embodiment of the present application, the IP message to be sent may be a traffic message in a VPN.
[0021] In the technical solution provided in the embodiment of the present application, traffic is directed through VLAN tag value (vlan tag). In a specific application, a first mapping relationship between VLAN tag value and color tag and a second mapping relationship between color tag (color) and segment routing strategy can be pre-set, thereby forming a mapping relationship of vlan tag->color->segment routing strategy. Therefore, after obtaining the IP message to be sent, the target vlan tag value carried in the IP message is first obtained.
[0022] For example, a vlan mapping table may be pre-set to record the mapping relationship between vlan tags and Color tags (also referred to as attributes), and a policy mapping table may be set to record the mapping relationship between Color attributes and different policies.
[0023] For example, in Figure 2 In the application scenario shown, there are two SR / SRv6 Policies to node B. The color value of the first policy is 123, and the segment route is C->E->G->B; the color value of the other policy is 124, and the segment route is D->F->H->B; the next hop address prefabricated to the 10.1.1.0 / 24or 10:1:1:: / 64 network segment is 10.1.1.3or 10:1:1::3; the two prefabricated policies belong to the same policy group, and the destination address is 10.1.1.3or 10:1:1::3. In the VPN of node A, a mapping relationship between vlan tag and color can be formed, for example, vlan tag 10 corresponds to color value 123, vlantag 20 corresponds to color value 124, and a mapping relationship between color and SR / SRV6 Policy can be formed, that is, the color value corresponding to the first policy is 123, and the color value corresponding to the second policy is 124.
[0024] Since the value range of the VLAN tag is relatively large, for example, the length of the VLAN tag specified in IEEE802.1Q is 12 bits, and its value range is 0 to 4095. Therefore, more services can be distinguished through the mapping relationship between the VLAN tag and the Color tag.
[0025] Optionally, the above segment routing policy may be an SR routing policy or an SRv6 routing policy.
[0026] S120: Based on a preset first mapping relationship between a VLAN tag value and a color tag, obtain a target color tag corresponding to the target VLAN tag value.
[0027] In the embodiment of the present application, after the target VLAN tag value is obtained, the target color mark corresponding to the target VLAN tag value can be obtained according to the first mapping relationship.
[0028] For example, in Figure 2 In the scenario shown, assuming that the target VLAN tag value carried in the IP message to be sent by node A is vlan tag 10, the target color tag corresponding to the target VLAN tag value is obtained as 123 according to the first mapping relationship between the VLAN tag value and the color tag.
[0029] S130: Based on a second mapping relationship between a preset color mark and a segment routing strategy, obtain a target segment routing strategy corresponding to the target color mark.
[0030] For example, in Figure 2 In the scenario shown, the target segment routing policy corresponding to the target color marked 123 is the first policy, and its segment routing is C->E->G->B.
[0031] S140: forward the IP message based on the target segment routing policy.
[0032] In the embodiment of the present application, different segmented routing strategies correspond to different tunnels, and different tunnels correspond to different service quality requirements. Therefore, the SR / SRV6 Policy diversion method based on the vlan tag can differentiate the services through different vlan tags when the same VPN carries multiple services, so as to provide customized bearing quality according to the service type, so as to provide differentiated services for the carried services (such as online games, live video, enterprise cloud dedicated lines and other accelerated services).
[0033] In a specific application, based on the first mapping relationship and the second mapping relationship, the target segment routing policy may not be acquired. Therefore, in one implementation, the method may further include the following steps:
[0034] Step 1: determining a first address family corresponding to the IP packet when the target segment routing policy is not obtained based on the first mapping relationship and the second mapping relationship;
[0035] In the embodiment of the present application, optionally, the address family can be distinguished by VPN. Therefore, in step 1, the target VPN corresponding to the IP message can be determined first, and then the first address family corresponding to the target VPN can be obtained.
[0036] The target VPN corresponding to the IP message refers to the traffic data of the IP message entering the target VPN.
[0037] Optionally, based on the first mapping relationship and the second mapping relationship, failure to obtain the target segment routing policy includes but is not limited to the following three situations:
[0038] (1) The IP packet does not carry the target VLAN tag value;
[0039] (2) based on the first mapping relationship, the target color mark corresponding to the target VLAN tag value is not obtained;
[0040] (3) Based on the first mapping relationship, a target color mark corresponding to the target VLAN tag value is obtained, and based on the second mapping relationship, the target segment routing policy corresponding to the target color mark is not obtained.
[0041] Step 2: forward the IP message based on the first address family.
[0042] Through the above-mentioned implementation method, when the target segment routing strategy of the IP message to be sent is not obtained based on the first mapping relationship and the second mapping relationship, the IP message can be forwarded according to the first address family corresponding to the IP message, thereby avoiding the situation where the IP message forwarding fails due to the fact that the target segment routing strategy of the IP message to be sent is not obtained based on the first mapping relationship and the second mapping relationship.
[0043] In one implementation, forwarding the IP packet based on the first address family may include: forwarding the IP packet based on a default segment routing policy of the first address family when a default segment routing policy exists for the first address family.
[0044] In an embodiment of the present application, a mapping relationship between a default vlan tag and a default color mark can be set for each address family. Therefore, if the target segment routing policy is not obtained based on the first mapping relationship and the second mapping relationship, the default segment routing policy of the first address family can be obtained based on the default color mark corresponding to the default vlan tag of the first address family, and the IP packet is forwarded using the default segment routing policy.
[0045] For example, when the IP packet does not carry a VLAN tag value, if the first address family corresponding to the IP packet has a mapping relationship between a default VLAN tag and a default color, the IP packet is forwarded according to the default color corresponding to the default VLAN tag using the default segment routing policy corresponding to the default color.
[0046] In the above implementation, the mapping relationship between Color and VLAN tag can be specified for IPv4 and IPv6 address families respectively. However, for packets of the same address family, each VLAN tag value can only be associated with one Color value.
[0047] In one implementation, forwarding the IP message based on the first address family may include the following steps:
[0048] Step 1: when there is no default segment routing policy for the first address family and there is a segment routing policy corresponding to the VLAN tag value of the first address family in the policy group, obtain a first segment routing policy corresponding to the first VLAN tag value in the policy group, wherein the first VLAN tag value is the minimum VLAN tag value among all VLAN tag values of the first address family contained in the policy group, and the policy group includes the first mapping relationship and the second mapping relationship;
[0049] Step 2: forward the IP message based on the first segment routing strategy.
[0050] In the above implementation, when there is no default segment routing policy for the first address family and there is a segment routing policy corresponding to the VLAN tag value of the first address family in the policy group, the first segment routing policy for forwarding IP packets can be obtained according to the color corresponding to the minimum VLAN value in the first address family to ensure that the IP packet can be successfully forwarded.
[0051] In the above implementation, each address family can be configured with a first mapping relationship between a VLAN tag value and a color tag. When a message is not associated with an SR / SRV6 Policy, the routing policy corresponding to the default color tag can be obtained based on the first mapping relationship between the default VLAN tag value of the first address family corresponding to the message and the default color tag. If a mapping relationship between Color and vlan tag is configured in the first address family, and some vlan tags of the first address family are associated with the SR / SRV6 Policy, while other vlan tags are not associated with the SR / SRV6 Policy, then for the vlan tags that are not associated with the SR-TE Policy, the SR / SRV6 Policy corresponding to the minimum vlan tag under the first address family can be used for forwarding.
[0052] In one implementation, forwarding the IP packet based on the first address family includes: forwarding the IP packet based on the second address family when the policy group does not contain a segment routing policy corresponding to any VLAN tag value of the first address family, wherein the second address family is an address family other than the first address family. In this implementation, when all vlan tags in the first address family are not associated with the SR / SRV6 Policy (for example, the mapping relationship between the vlan tag and the Color corresponding to the first address family is not configured, or the corresponding relationship is configured but not successfully associated with the SR / SRV6 Policy), the IP packet is forwarded based on the second address family, thereby avoiding the situation where the packet forwarding fails due to the fact that all vlan tags in the first address family are not associated with the SR / SRV6 Policy.
[0053] In one implementation, forwarding the IP packet based on the second address family may include: forwarding the IP packet based on the default segment routing policy corresponding to the second address family when the second address family has a default segment routing policy. In this implementation, the default segment routing policy of the second address family may be obtained based on a default color tag corresponding to a default vlan tag of the second address family, and the IP packet may be forwarded using the default segment routing policy.
[0054] In one implementation, forwarding the IP message based on the first address family may include the following steps:
[0055] Step 1, when there is no default segment routing policy for the second address family and there is a segment routing policy corresponding to the VLAN tag value of the second address family in the policy group, obtaining a second segment routing policy corresponding to the second VLAN tag value in the policy group, wherein the second VLAN tag value is the minimum VLAN tag value among all VLAN tag values of the second address family contained in the policy group;
[0056] Step 2: forward the IP message based on the second segment routing strategy.
[0057] In the above implementation, when there is no default segment routing policy for the second address family and there is a segment routing policy corresponding to the VLAN tag value of the second address family in the policy group, the second segment routing policy for forwarding IP packets can be obtained according to the color corresponding to the minimum VLAN value in the second address family to ensure that the IP packet can be successfully forwarded.
[0058] Through the technical solution provided in the embodiment of the present application, the SR / SRV6Policy diversion method based on vlan tag can be implemented. Multiple services can be carried on the same VPN through different vlan tags to differentiate the services, so as to provide customized bearing quality according to the service type, and provide differentiated services for the carried services (such as online games, live video, enterprise cloud dedicated lines and other accelerated services).
[0059] Figure 3 The structural block diagram of an electronic device 300 shown in an exemplary embodiment of the present application is shown. The electronic device can implement the forwarding method of the above-mentioned message. The electronic device 300 includes a central processing unit (CPU) 301, a system memory 304 including a random access memory (RAM) 302 and a read-only memory (ROM) 303, and a system bus 305 connecting the system memory 304 and the central processing unit 301. The computer device 300 also includes a large-capacity storage device 306 for storing an operating system 309, a client 33 and other program modules 311.
[0060] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage medium is not limited to the above. The above-mentioned system memory 304 and mass storage device 306 can be collectively referred to as memory.
[0061] According to various embodiments of the present disclosure, the computer device 300 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 300 can be connected to the network 308 through the network interface unit 307 connected to the system bus 305, or the network interface unit 307 can be used to connect to other types of networks or remote computer systems (not shown).
[0062] The memory also includes at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is stored in the memory. The central processing unit 901 implements all or part of the steps in the message forwarding method shown in the above-mentioned embodiments by executing the at least one instruction, at least one program, code set or instruction set.
[0063] In an exemplary embodiment, a readable storage medium is also provided, in which at least one computer program is stored, and the computer program is loaded and executed by a processor to implement all or part of the steps in the above-mentioned message forwarding method. For example, the computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0064] In an exemplary embodiment, a computer program product is further provided. The computer program product includes at least one computer program. The computer program is loaded by a processor and executes all or part of the steps of the above-mentioned message forwarding method.
[0065] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
[0066] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A message forwarding method, characterized in that: include: Obtain the target virtual local area network VLAN tag value carried in the IP message to be sent; Based on a preset first mapping relationship between a VLAN tag value and a color tag, obtaining a target color tag corresponding to the target VLAN tag value; Based on a second mapping relationship between a preset color mark and a segment routing strategy, obtaining a target segment routing strategy corresponding to the target color mark; Based on the target segment routing policy, the IP message is forwarded.
2. The method according to claim 1, characterized in that The method further comprises: If the target segment routing policy is not obtained based on the first mapping relationship and the second mapping relationship, determining a first address family corresponding to the IP packet; Based on the first address family, the IP packet is forwarded.
3. The method according to claim 2, characterized in that The forwarding of the IP message based on the first address family includes: In a case where a default segment routing policy exists for the first address family, the IP packet is forwarded based on the default segment routing policy for the first address family.
4. The method according to claim 2, characterized in that: The forwarding of the IP message based on the first address family further includes: In a case where there is no default segment routing policy for the first address family and there is a segment routing policy corresponding to the VLAN tag value of the first address family in the policy group, obtaining a first segment routing policy corresponding to the first VLAN tag value in the policy group, wherein the first VLAN tag value is a minimum VLAN tag value among all VLAN tag values of the first address family included in the policy group, and the policy group includes the first mapping relationship and the second mapping relationship; Based on the first segment routing strategy, the IP message is forwarded.
5. The method according to claim 2, characterized in that: The forwarding of the IP message based on the first address family includes: When the policy group does not contain a segmented routing policy corresponding to any VLAN tag value of the first address family, the IP packet is forwarded based on a second address family, wherein the second address family is an address family other than the first address family, and the policy group includes the first mapping relationship and the second mapping relationship.
6. The method according to claim 5, characterized in that: The forwarding of the IP message based on the second address family includes: In a case where a default segment routing policy exists for the second address family, the IP packet is forwarded based on the default segment routing policy corresponding to the second address family.
7. The method according to claim 5, characterized in that The forwarding of the IP message based on the first address family includes: In a case where there is no default segment routing policy for the second address family and there is a segment routing policy corresponding to the VLAN tag value of the second address family in the policy group, obtaining a second segment routing policy corresponding to the second VLAN tag value in the policy group, wherein the second VLAN tag value is the minimum VLAN tag value among all VLAN tag values of the second address family contained in the policy group; Based on the second segment routing strategy, the IP message is forwarded.
8. The method according to any one of claims 2 to 7, characterized in that: The determining the first address family corresponding to the IP message includes: Determine a target virtual private network VPN corresponding to the IP message; Obtain a first address family corresponding to the target VPN.
9. The method according to any one of claims 2 to 7, characterized in that: The failure to obtain the target segment routing policy based on the first mapping relationship and the second mapping relationship includes one of the following: The IP message does not carry the target VLAN tag value; Based on the first mapping relationship, the target color mark corresponding to the target VLAN tag value is not obtained; Based on the first mapping relationship, the target color mark corresponding to the target VLAN tag value is obtained, and based on the second mapping relationship, the target segment routing policy corresponding to the target color mark is not obtained.
10. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the message forwarding method as described in any one of claims 1 to 9 are implemented.
11. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the message forwarding method according to any one of claims 1 to 9 are implemented.
