Packet forwarding method and device

By assigning unique Locators to gateway devices and APs in Layer 3 networks, SRv6 deployment is automated, enhancing traffic control and path optimization, and improving leased line utilization.

JP2024544781AActive Publication Date: 2024-12-04NEW H3C TECH CO LTD

Patent Information

Application Number
JP2024535546
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2024-12-04
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In Layer 3 networks, deploying SRv6 is challenging due to the inability to distribute different AP configurations and the large number of APs, which hinders automation and efficient traffic control.

Method used

Assigning unique Locators to gateway devices and APs connected to them, establishing SRv6 tunnels, and implementing packet forwarding methods that utilize these Locators for efficient packet transmission.

Benefits of technology

Enables automation of SRv6 deployment in Layer 3 networks, improving traffic control, scheduling, and optimizing paths while ensuring quality of service and enhancing leased line utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024544781000001_ABST
    Figure 2024544781000001_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a packet forwarding method and device. In the embodiment of the present invention, in order to fully utilize the advantages brought about by SRv6 in a layer 3 network, the introduction of SRv6 in a layer 3 network is automated by automatically assigning different locators to a gateway device and different APs connected to the gateway device. Furthermore, in the embodiment, an SRv6 tunnel is introduced between the gateway device and the AP based on the locators assigned to the gateway device and the AP, and packets are transmitted between the gateway device and the AP through the SRv6 tunnel, thereby realizing a packet forwarding method applicable to a layer 3 network in which SRv6 is introduced.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a network communication technology, and in particular to a packet forwarding method and device. [Background technology]

[0002] Segment Routing IPv6 (SRv6) is a realization of Segment Routing (SR) based on the IPv6 forwarding plane. In SRv6, Segment Routing Identifiers (SIDs) take the form of IPv6 addresses but do not correspond to the interface addresses of any device.

[0003] As shown in FIG. 1, a SID includes at least a locator, a function, and arguments.

[0004] Locator: The Locator is unique within the SR domain. In certain applications, the Locator may include a common prefix and a network node identifier (Node ID).

[0005] Function: Used to identify the operation command bound to the SID. In the SR domain, after a node receives a packet, it performs the associated operation based on the Function in the SID attached to the packet. In a specific application, the Function may include an operation command type and an operation command value to indicate the operation command.

[0006] Arguments: Defines information such as packet flow and services. Summary of the Invention

[0007] An embodiment of the present invention provides a packet forwarding method and device for realizing packet forwarding applied to a Layer 3 network in which SRv6 is introduced.

[0008] An embodiment of the present invention is a packet forwarding method applied to a gateway device in a Layer 3 network, in which an SRv6 tunnel exists between the gateway device and an access point AP connected to the gateway device, and different locators (Locators) are assigned to the gateway device and different APs connected to the gateway device, When receiving a first packet through the SRv6 tunnel, decapsulating an IPv6 encapsulation header for the first packet to obtain a second packet, and forwarding the second packet based on a destination IP address of the second packet, wherein the destination IP address in the IPv6 encapsulation header added to the first packet includes at least a Locator and a function assigned to the gateway device, and the destination MAC address of the second packet is a MAC address of a Layer 3 gateway interface associated with a VSI instance bound to the Function on the gateway device; and a step of, when receiving a third packet from a network side, performing IPv6 decapsulation on the third packet to obtain a fourth packet, and forwarding the fourth packet based on a destination IP address of the fourth packet, wherein the destination IPv6 address in the IPv6 encapsulation header added to the third packet includes at least a locator assigned to the gateway device.

[0009] An embodiment of the present invention further provides a packet forwarding method applied to an access point AP connected to a gateway device in a Layer 3 network, wherein an SRv6 tunnel exists between the gateway device and the AP, and the AP, the gateway device, and another AP connected to the gateway device are all assigned different locators; When a packet needs to be forwarded to the gateway device, adding an IPv6 encapsulation header to the packet and forwarding the packet through an SRv6 tunnel from this AP to the gateway device, where a destination IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the gateway device, and a source IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the AP; When a packet is received via an SRv6 tunnel from the AP to the gateway device, performing IPv6 decapsulation on the received packet and forwarding the packet based on the destination MAC address of the decapsulated packet.

[0010] An embodiment of the present invention is a packet forwarding device applied to a gateway device in a Layer 3 network, in which an SRv6 tunnel exists between the gateway device and an access point AP connected to the gateway device, and different locators (Locators) are assigned to the gateway device and different APs connected to the gateway device, A packet receiving unit for receiving a first packet through the SRv6 tunnel or receiving a third packet from a network side; When receiving a first packet through the SRv6 tunnel, decapsulate an IPv6 encapsulation header for the first packet to obtain a second packet, and forward the second packet based on a destination IP address of the second packet; a packet processing unit for, when receiving a third packet from a network side, performing IPv6 decapsulation on the third packet to obtain a fourth packet, and forwarding the fourth packet based on a destination IP address of the fourth packet; A packet forwarding device is provided, wherein a destination IP address in an IPv6 encapsulation header added to the first packet includes at least a Locator and a Function assigned to the gateway device, a destination MAC address of the second packet is a MAC address of a Layer 3 gateway interface associated with a VSI instance bound to the Function on the gateway device, and a destination IPv6 address in an IPv6 encapsulation header added to the third packet includes at least a Locator assigned to the gateway device.

[0011] An embodiment of the present invention is further a packet forwarding apparatus applied to an access point AP connected to a gateway device in a Layer 3 network, wherein an SRv6 tunnel exists between the gateway device and the AP, and different locators are assigned to the AP, the gateway device, and another AP connected to the gateway device; a receiving unit for receiving packets via an SRv6 tunnel from the AP to the gateway device; When a packet needs to be forwarded to the gateway device, add an IPv6 encapsulation header to the packet and forward the packet through an SRv6 tunnel from this AP to the gateway device; a forwarding unit for performing IPv6 decapsulation on the received packet when the packet is received via an SRv6 tunnel from the AP to the gateway device, and forwarding the packet based on a destination MAC address of the decapsulated packet; A packet forwarding device is provided, in which a destination IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the gateway device, and a source IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to this AP.

[0012] An embodiment of the present invention further provides a network device including a processor and a machine-readable storage medium having machine-executable instructions stored thereon that are executable by the processor, the processor being adapted to execute the machine-executable instructions to perform any of the methods described above.

[0013] As can be seen from the above technical solution, in an embodiment of the present invention, in order to fully utilize the advantages brought by SRv6 in a Layer 3 network, the implementation of SRv6 in a Layer 3 network is automated by automatically assigning different locators to a gateway device and different APs connected to the gateway device.

[0014] Furthermore, in this embodiment, an SRv6 tunnel is introduced between the gateway device and the AP based on the Locators assigned to the gateway device and the AP, and packets are transmitted between the gateway device and the AP via the SRv6 tunnel, thereby realizing a packet forwarding method applicable to a Layer 3 network in which SRv6 is introduced. [Brief description of the drawings]

[0015] The drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification, serve to explain the principles of the invention. [Figure 1] 2 is a schematic diagram of a structure of a SID according to an embodiment of the present invention; [Diagram 2] FIG. 1 is a schematic diagram of networking of a campus network in which SRv6 is introduced according to an embodiment of the present invention; [Diagram 3] 2 is a flow chart of a method according to an embodiment of the present invention. [Figure 4] 4 is a flowchart of Locator allocation according to an embodiment of the present invention. [Diagram 5] 2 is a schematic diagram of a Locator structure according to an embodiment of the present invention. [Figure 6] 4 is a flowchart of another method according to an embodiment of the present invention. [Figure 7] FIG. 2 is a structural diagram of an apparatus according to an embodiment of the present invention; [Figure 8] FIG. 2 is a structural diagram of another device according to an embodiment of the present invention. [Figure 9] 1 is a structural diagram of an electronic device according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise noted. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. On the contrary, they are merely examples of apparatus and methods consistent with some aspects of the present invention.

[0017] The terms used in the present invention are merely for describing specific embodiments and are not intended to limit the present invention. The singular forms "a kind of," "the," and "the" used in the present invention are intended to include the plural forms unless the context clearly indicates otherwise.

[0018] SRv6 provides a flexible and efficient traffic control means for the network, and can better realize traffic scheduling and path optimization, guarantee the quality of important services, balance the quality distribution, and improve the utilization rate of dedicated lines. Currently, SRv6 may be introduced into layer three networks such as campus networks, and FIG. 2 illustrates a campus network in which SRv6 is introduced. In FIG. 2, the thick black line indicates the SRv6 path. When SRv6 is introduced into the campus network, traffic monitoring, scheduling, and the like are realized based on SRv6 between a gateway device (a gateway device may be a leaf node in a spine-leaf topology structure) and a wireless access point (AP: Access Point).

[0019] However, in a conventional layer 3 network environment, in order to simplify deployment, the same AP configuration is often distributed to a set of different APs based on an AP template (i.e., multiple different APs have the same configuration). However, when SRv6 is applied to a layer 3 network such as a campus network, it is necessary to assign different locators to different APs in order to easily distinguish between APs, so the same AP configuration cannot be distributed to a set of different APs based on an AP template. In addition to the inability to distribute the same AP configuration to a set of different APs based on an AP template, there are many APs in a layer 3 network, which is disadvantageous for the deployment of SRv6 in a layer 3 network and the automation of network deployment.

[0020] In order to solve the above technical problems, the embodiments of the present invention provide a packet forwarding method applied to a Layer 3 network in which SRv6 is introduced. In order to enable those skilled in the art to better understand the technical solution according to the embodiments of the present invention, and to make the above objectives, features and advantages of the embodiments of the present invention more obvious and understandable, the technical solution in the embodiments of the present invention will be described in more detail below with reference to the drawings.

[0021] Below, a method according to an embodiment of the present invention is first described from the perspective of a gateway device in a Layer 3 network.

[0022] Please refer to Fig. 3, which is a flowchart of a method according to an embodiment of the present invention. The method is applied to a gateway device in a Layer 3 network. Optionally, when applied to a Spine-Leaf network topology structure, the gateway device here can be a Leaf node.

[0023] In this embodiment, the gateway device and the different APs connected to the gateway device are all assigned different Locators. Optionally, in this embodiment, one network device may be designated as a Locator Manager, and the Locator Manager assigns different Locators to the gateway device and each AP connected to the gateway device.

[0024] For example, when a gateway device is designated as a Locator Manager, the gateway device functioning as a Locator Manager assigns different Locators to the gateway device and each AP connected to the gateway device (in this case, the AP can be called a Locator Client). Figure 4 shows an example of a method for assigning different Locators to the gateway device and each AP connected to the gateway device when the gateway device is a Locator Manager. Explanation is omitted here.

[0025] As another example, a non-gateway device such as an access controller (AC) may be designated as a Locator Manager, and the Locator Manager may assign different Locators to the gateway device and different APs connected to the gateway device (in this case, the gateway device and different APs connected to the gateway device may both be called Locator Clients). A specific allocation method is similar to the allocation shown in FIG. 4, and therefore a description thereof will be omitted here.

[0026] In this embodiment, the gateway device and the AP establish an SRv6 tunnel between the gateway device and the AP based on the assigned Locator (the SRv6 tunnel here may be, for example, an SRv6 PW, and is not particularly limited in this embodiment). Optionally, the SRv6 tunnel may be dynamically established or statically configured, and is not particularly limited in this embodiment.

[0027] Based on the above description, as shown in FIG. 3, the flow may include the following steps:

[0028] In step 301, when a first packet is received via the SRv6 tunnel, step 302 is executed, and when a third packet is received from the network side, step 303 is executed, where the destination IP address in the IPv6 encapsulation header added to the first packet includes at least a Locator and a Function assigned to the gateway device, and the destination IPv6 address in the IPv6 encapsulation header added to the third packet includes at least a Locator assigned to the gateway device.

[0029] In this embodiment, the first packet and the third packet are merely named for ease of explanation, and are not limiting.

[0030] For the SRv6 tunnel between the gateway device and the AP, in this embodiment, receiving the first packet through the SRv6 tunnel means that the gateway device receives the first packet forwarded by the AP through the SRv6 tunnel. When the gateway device receives the first packet forwarded by the AP through the SRv6 tunnel, it executes the following step 302.

[0031] In step 302, decapsulate the IPv6 encapsulation header for the first packet to obtain a second packet, and forward the second packet based on a destination IP address of the second packet, where the destination MAC address of the second packet is the MAC address of a Layer 3 gateway interface associated with a VSI instance bound to a Function on the gateway device.

[0032] This step 302 is performed under the assumption that the gateway device has received a first packet via the SRv6 tunnel.

[0033] Optionally, in this embodiment, a Local SID corresponding to a gateway device may be determined based on a Locator and a Function (including an operation command value (Opcode) and a Function type) assigned to the gateway device, and the Function in each Local SID is different. Table 1 shows two examples of Local SIDs corresponding to a gateway device (examples of Local SIDs will be described later). [Table 1]

[0034] In Table 1, end-dt2u is used to instruct the router to decapsulate and forward the packet based on the destination IP address of the packet if the decapsulated destination MAC address is the MAC address of the Layer 3 gateway interface associated with the VSI instance bound to the Function on the gateway device.

[0035] Based on each Local SID shown in Table 1, a corresponding FIB6 entry can be added to the FIB6 (IPv6 Forwarding Information Base) table. The FIB6 entry includes at least a corresponding Local SID, and based on this, as in step 302, when the gateway device receives a first packet through the SRv6 tunnel, the gateway device searches the FIB6 table based on the destination IP address added to the first packet, and if a corresponding FIB6 entry is found, the gateway device decapsulates the IPv6 encapsulation header for the first packet according to the instruction of end-dt2u in the Local SID in the FIB6 entry to obtain a second packet. If it is found that the destination MAC address of the second packet is the MAC address of the Layer 3 gateway interface associated with the VSI instance bound to the above Function on the gateway device, the gateway device forwards the second packet based on the destination IP address of the second packet. An example of a method for forwarding a second packet based on the destination IP address of the second packet will be described later, so a description thereof will be omitted here.

[0036] In step 303, perform IPv6 decapsulation on the third packet to obtain a fourth packet, and forward the fourth packet based on the destination IP address of the fourth packet.

[0037] This step 303 is executed on the premise that a third packet is received from the network side. When the gateway device receives the third packet, it executes a corresponding operation based on the Function included in the destination IPv6 address in the IPv6 encapsulation header added to the packet. If the Function instructs IPv6 decapsulation and searching the corresponding IP routing forwarding instance routing table, this step 303 performs IPv6 decapsulation on the third packet to obtain a fourth packet, searches the corresponding IP routing forwarding instance routing entry from the IP routing forwarding instance routing table based on the destination IP address of the fourth packet, and forwards the packet based on the IP routing forwarding instance routing entry. The details of forwarding the packet will be described later with an example, so the description will be omitted here.

[0038] In order to ensure that the gateway device performs a corresponding operation based on the Function included in the destination IPv6 address in the IPv6 encapsulation header added to the packet, optionally, in this embodiment, when the gateway device learns the IP address of a terminal connected to any AP, it determines a Function that matches the terminal IP address, and reports the Function and the terminal IP address to the network side, so that the destination IPv6 address in the IPv6 encapsulation header added to the packet subsequently sent from the network side to the terminal includes at least the above Function. Here, the Function is used to instruct IPv6 decapsulation and searching for an IP routing forwarding instance routing table that matches the terminal IP address. Here, if the terminal IP address is IPv4, the IP routing forwarding instance routing table is an IPv4 VPN routing table, and if the terminal IP address is IPv6, the IP routing forwarding instance routing table is an IPv6 VPN routing table.

[0039] Up to this point, the flow shown in Figure 3 has been completed.

[0040] As can be seen from the flow shown in FIG. 3, in this embodiment, in order to fully utilize the advantages brought about by SRv6 in a layer 3 network, different locators are automatically assigned to a gateway device and different APs connected to the gateway device, thereby realizing the automation of the introduction of SRv6 in a layer 3 network.

[0041] Furthermore, in this embodiment, an SRv6 tunnel is introduced between the gateway device and the AP based on the Locators assigned to the gateway device and the AP, and packets are transmitted between the gateway device and the AP via the SRv6 tunnel, thereby realizing a packet forwarding method applicable to a Layer 3 network in which SRv6 is introduced.

[0042] The flow shown in FIG. 4 will be explained below.

[0043] Please refer to Fig. 4, which is a flowchart of Locator allocation according to an embodiment of the present invention. In the flow shown in Fig. 4, the Locator Manager allocates different Locators to the gateway device and each AP connected to the gateway device.

[0044] In this embodiment, the Locator Manager manages a Locator resource pool (the Locator resource pool includes multiple Locators). For convenience of management and compatibility with the conventional Locator structure (the structure of Common prefix+Node ID), the Locator in this embodiment may be Common prefix+Manager ID+Node ID, specifically as shown in FIG. 5. The reason for setting the Locator in this manner is to ensure that Locators assigned by different Locator Managers do not overlap when multiple Locator Managers exist in the same network, and to ensure that each Locator is unique across the entire network.

[0045] In FIG. 5, the value and length of the common prefix may be specified in advance, for example, A0:B0:: / 40 (the value of the common prefix is ​​A0:B0::, and the length is 40 bits).

[0046] In FIG. 5, the value and length of the Manager ID may be specified in advance, for example, the value of the Manager ID is 1 and the length is 8 bits.

[0047] 5, the value of the Node ID is not pre-specified and may be selected from a Node ID resource pool. Optionally, in this embodiment, the Node ID resource pool may hold Node 0 (i.e., Node ID is 0). In other words, in combination with the above Common prefix and Manager ID, in this embodiment, A0:B0:01:00:: / 64 may be held and not pre-assigned.

[0048] Optionally, in this embodiment, when the gateway device functions as a Locator Manager, it may select the smallest non-zero Node ID from the Node ID resource pool when allocating a Locator to itself. Taking the selected Node ID as 1 as an example, in combination with the above Common prefix and Manager ID, in this embodiment, when the gateway device functions as a Locator Manager, the Locator it allocates to itself may be A0:B0:01:01:: / 64.

[0049] When the gateway device functions as a Locator Manager, it assigns a Locator to each AP as a Locator Client according to the flow shown in Fig. 4. Of course, when the gateway device does not function as a Locator Manager, the Locator Manager assigns a Locator to the gateway device as a Locator Client and each AP connected to the gateway device according to the flow shown in Fig. 4.

[0050] As shown in FIG. 4, the flow may include the following steps.

[0051] In step 401, a Locator allocation request sent by a Locator Client is received.

[0052] In this embodiment, after a Locator Client goes online (for example, after going online and being assigned an IPv6 address), the Locator Client transmits a Locator assignment request to the Locator Manager. Here, at least the IPv6 address, MAC address, and Locator Client identifier of the Locator Client may be added to the Locator assignment request.

[0053] In step 402, a corresponding Locator is allocated to a Locator Client based on the Locator allocation request.

[0054] Optionally, in this embodiment, there is a protocol connection between the Locator Manager and the Locator Client for Locator allocation, which may be a TCP (transmission control protocol) connection or a UDP (user datagram protocol) connection.

[0055] As an example, when the above protocol connection is a TCP connection, one available Node ID may be selected from available Node IDs in a Node ID resource pool, and one Locator may be constructed by combining the selected available Node ID with the above Common prefix and Manager ID, and the Locator may be added to a Locator allocation response and sent to the Locator Client via a TCP connection.

[0056] Optionally, there are various methods for selecting one available Node ID from the available Node IDs in the Node ID resource pool, such as directly selecting the smallest Node ID from the available Node IDs in the Node ID resource pool in sequence. Take directly selecting the smallest Node ID from the available Node IDs in the Node ID resource pool in sequence as an example. If Node 1 (i.e., Node ID is 1) has been selected before, combined with the above retention of Node 0, the available Node IDs in the current Node ID resource pool are Node 2 (i.e., Node ID is 2), Node 3 (i.e., Node ID is 3) ... Node k (i.e., Node ID is k), and Node 2 may be selected from the available Node IDs in the current Node ID resource pool. The selected one available Node ID is combined with the above Common prefix and Manager ID to form one Locator, i.e., A0:B0:01:02:: / 64.

[0057] As another embodiment, when the above protocol connection is a UDP connection, compared with TCP, UDP does not require establishing and maintaining a complicated TCP connection between the Locator Manager and the Locator Client, and the Locator Manager does not maintain a large number of TCP connections, resulting in an excessive overhead of the system (e.g., CPU, etc.). When the above protocol connection is a UDP connection, the Locator allocation is not realized by simply returning a Locator allocation response as in the case of a TCP connection. Optionally, in this embodiment, when the above protocol connection is a UDP connection, the step of allocating a corresponding Locator to an AP as a Locator Client based on a Locator allocation request in the above step 402 may include the following:

[0058] In step a1, a Locator allocation response is returned to the Locator Client via a UDP connection.

[0059] Here, at least the Locator assigned to the Locator Client is added to the Locator assignment response. There are various methods for assigning a Locator to a Locator Client. For example, one available Node ID may be selected from available Node IDs in a Node ID resource pool, and the selected available Node ID may be combined with the above-mentioned Common prefix and Manager ID to configure a Locator to be assigned to the Locator Client.

[0060] Optionally, in this embodiment, the Locator allocation response may further include the IPv6 address, MAC address, and device ID of the Locator Manager of the Locator Client.

[0061] In step a2, a designated Locator allocation request returned by the Locator Client based on the Locator allocation response is received via a UDP connection.

[0062] Optionally, in this embodiment, the designated Locator allocation request includes at least the Locator added to the Locator allocation response, where the reason for sending the designated Locator allocation request is to check whether the Locator added to the Locator allocation response can be occupied.

[0063] Optionally, in this embodiment, the designated Locator allocation request may further include the IPv6 address, MAC address, Locator Client identifier, and Locator Manager device ID of the Locator Client.

[0064] Step a3: to confirm that the Locator has been allocated to the Locator Client, a Locator allocation confirmation message is returned to the Locator Client via a UDP connection.

[0065] Optionally, in this embodiment, the Locator Allocation Confirmation message is used to confirm that the Locator Client can occupy the Locator added in the specified Locator Allocation Request.

[0066] Optionally, in this embodiment, the Locator allocation confirmation message may further include the IPv6 address, MAC address, and device ID of the Locator Manager of the Locator Client.

[0067] Up to this point, by the above steps a1 to a3, it is possible to realize how to assign a Locator to a Locator Client when the above protocol connection is a UDP connection.

[0068] In this embodiment, if the above protocol connection is a UDP connection, it is necessary to allocate a corresponding Locator to the Locator Client according to the characteristics of the UDP connection, and then manage the corresponding Locator allocated to the Locator Client in a timely manner. A specific management method is realized by the following steps a4 to a5.

[0069] In step a4, a Locator occupancy request sent by the Locator Client is received via a UDP connection, and if the Locator Client is permitted to continue occupying the allocated Locator, a Locator occupancy confirmation message is returned to the Locator Client via the UDP connection to confirm that the Locator Client will continue to occupy the allocated Locator.

[0070] In this embodiment, after a Locator is allocated, the Locator Client sends a Locator occupancy request (which is similar to the above-mentioned designated Locator allocation request) at a period T to confirm whether the allocated Locator is added to the Locator Client and the Locator can be continuously occupied.

[0071] When the Locator Manager receives a Locator occupancy request sent by the Locator Client, it usually allows the Locator Client to continue occupying the allocated Locator, so it will reply to the Locator Client via a UDP connection with a Locator occupancy confirmation message to confirm that the Locator Client will continue occupying the allocated Locator. Of course, in some special cases, if the Locator Manager does not allow the Locator Client to continue occupying the allocated Locator, it will release the Locator and trigger the Locator Client to request the Locator again according to the flow shown in Figure 4 above.

[0072] In step a5, if a Locator occupation request transmitted by the Locator Client is not received within a predetermined time, the Locator allocated to the Locator Client is released.

[0073] For example, if the Locator Manager does not receive a Locator occupancy request sent by the Locator Client within three of the above-mentioned periods T, it assumes that the Locator Client has gone offline and releases the Locator allocated to the Locator Client (i.e., at this time, the Node ID in the Locator becomes an available Node ID).

[0074] Up to this point, steps a4 and a5 have been implemented to realize how to timely manage the corresponding Locator assigned to the Locator Client after the corresponding Locator is assigned to the Locator Client.

[0075] Optionally, in this embodiment, after the Locator Manager allocates a Locator corresponding to the Locator Client, it records it by an entry. Table 2 shows an example of a Locator allocation entry. [Table 2]

[0076] Optionally, in this embodiment, the Locator Manager generates a Locator route based on the Locator allocation entry. Continuing with Table 2 as an example, the corresponding Locator route is shown in Table 3. [Table 3]

[0077] In Table 3, Interface VLAN 4092 is a layer 3 interface on the Locator Manager for forwarding SRv6 services to APs, and may be a layer 3 interface that receives the above Locator allocation request. Optionally, when a non-gateway device functions as a Locator Manager, the Locator Manager distributes the Locator route to the gateway device so that the gateway device can subsequently forward packets based on the Locator route. An example of a method for packet forwarding is described below.

[0078] Below, we will analyze and explain the Local SIDs shown in Table 1 above.

[0079] Optionally, in this embodiment, the Local SID may be generated based on a service Virtual Local Area Network (VLAN) identifier (ID). On this premise, the Function operation command value (Opcode) in the above Local SID may be represented by the service VLAN ID. For example, when a gateway device functioning as a Locator Manager delivers WLAN services corresponding to the service VLANs 3502 and 3503, the Local SID shown in Table 1 may be transformed as shown in Table 4 below. [Table 4]

[0080] As can be seen from Table 4, in this embodiment, by setting the Function operation command value (Opcode) to the service VLAN ID, it is possible to realize that the Function operation command value represents the service VLAN ID on the one hand, and represents the corresponding network operation command in the gateway device on the other hand, thereby improving the forwarding matching efficiency of the data plane.

[0081] The above Local SID may be realized by a configuration command. For example, the configuration command corresponding to Table 4 is: Segment routing IPv6 Locator Leaf1 ipv6-prefix 1 A0:B0:01:02::64 static 32 opcode 3502 end-dt2u VSI service-vlan-3502 opcode 3503 end-dt2u VSI service-vlan-3503 may be also possible.

[0082] In this embodiment, after the gateway device decapsulates the IPv6 encapsulation header of the first packet to obtain the second packet, it may perform source MAC learning to generate a MAC entry, and an example of the MAC entry is shown in Table 5. [Table 5]

[0083] Particularly, in this embodiment, if the above second packet is an ARP packet or an IPv6 ND packet, the gateway device further performs ARP or IPv6 ND learning, and the learned ARP or IPv6 ND entry includes at least a MAC address and an IP address. MAC address: The MAC address of the AP that sends the ARP packet or the IPv6 ND packet. IP address: The IP address of the AP that sends the ARP packet or the IPv6 ND packet.

[0084] Based on the above entries, the step of forwarding the second packet based on the destination IP address of the second packet in step 302 above will now be described.

[0085] Optionally, in this embodiment, in the above step 302, forwarding the second packet based on the destination IP address of the second packet may include the following steps b1 to b3.

[0086] In step b1, the layer two header is decapsulated for the second packet to obtain a fifth packet.

[0087] Optionally, in this embodiment, the fifth packet obtained after decapsulating the layer 2 header for the second packet is substantially a layer 3 packet having a destination IP address and a source IP address.

[0088] In step b2, search for an IP routing entry that matches the destination IP address of the fifth packet from the IP routing forwarding instance routing table associated with the layer 3 gateway interface.

[0089] Optionally, the found IP routing entry includes the destination IP address of the fifth packet. The IP routing forwarding instance routing table may be established based on a conventional route learning method.

[0090] In step b3, if the outbound interface of the IP routing entry is an SRv6 tunnel port from the gateway device to the first AP, forward the sixth packet based on the outbound interface in the obtained first Locator route that matches the Locator of the first AP.

[0091] Here, the first AP refers to any AP, is named merely for ease of explanation, and is not intended to be limiting.

[0092] Optionally, in this embodiment, the sixth packet is obtained by adding at least an IPv6 encapsulation header to the fifth packet, for example, a Layer 2 header may be first added to the fifth packet and then an IPv6 encapsulation header may be added to obtain the sixth packet.

[0093] For example, assuming that the sixth packet has the newly added Layer 2 header and IPv6 encapsulation header, in one example, the Layer 2 header includes at least a destination MAC address and a source MAC address, where the destination MAC address is a MAC address corresponding to the IP address of the first AP found in the ARP or IPv6 ND entry, and the source MAC address is a MAC address of the gateway device.

[0094] In one example, the destination IPv6 address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the first AP, and the source IPv6 address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the gateway device.

[0095] Based on the above-mentioned Local SID, in this embodiment, the Function in the destination IPv6 address and the Function in the source IPv6 address in the IPv6 encapsulation header added to the sixth packet include the same Function operation command value, and the Function operation command value is the first Service VLAN ID, where the first Service VLAN ID is the Service VLAN ID to which the sixth packet belongs, for example, the Service VLAN 3502.

[0096] In addition, in this embodiment, the above-mentioned first Locator route can refer to the above-mentioned Locator route. The outbound interface in the first Locator route is a Layer 3 interface on the gateway device for forwarding the SRv6 service to the first AP, as described above.

[0097] Finally, steps b1 to b3 realize how the gateway device forwards a packet when the gateway device receives the packet via the SRv6 tunnel.

[0098] The following describes how the fourth packet is forwarded based on the destination IP address of the fourth packet in step 303 above.

[0099] Optionally, in this embodiment, the step of forwarding the fourth packet based on the destination IP address of the fourth packet in the above step 303 may include the following steps c1 to c3.

[0100] In step c1, the IP routing forwarding instance routing table is searched for an IP routing entry that matches the destination IP address of the fourth packet.

[0101] In step c2, if the outbound interface of the IP routing entry is an SRv6 tunnel port from the gateway device to the second AP, a second Locator route that matches the Locator of the second AP is searched for from the obtained Locator route, and the seventh packet is forwarded via the outbound interface in the second Locator route.

[0102] Here, the second AP refers to any AP, is named merely for ease of explanation, and is not intended to be limiting.

[0103] Optionally, in this embodiment, the seventh packet is obtained by adding at least an IPv6 encapsulation header to the fourth packet, for example, by first adding a Layer 2 header to the fourth packet and then adding an IPv6 encapsulation header to obtain the seventh packet.

[0104] For example, assuming that the seventh packet has the newly added Layer 2 header and IPv6 encapsulation header, in one example, the Layer 2 header includes at least a destination MAC address and a source MAC address, where the destination MAC address is a MAC address corresponding to the IP address of the second AP found in the ARP or IPv6 ND entry, and the source MAC address is the MAC address of the gateway device.

[0105] In one example, the destination IPv6 address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the second AP, and the source IPv6 address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the gateway device.

[0106] Based on the above-mentioned Local SID entry, in this embodiment, the Function in the destination IPv6 address and the Function in the source IPv6 address in the IPv6 encapsulation header added to the seventh packet include the same Function operation command value, which is the second Service VLAN ID, where the second Service VLAN ID is the Service VLAN ID to which the seventh packet belongs, for example, the service VLAN 3502.

[0107] In addition, in this embodiment, the above Locator route can be referred to for the above second Locator route. The outbound interface in the second Locator route is a Layer 3 interface on the gateway device for forwarding the SRv6 service to the second AP, as described above.

[0108] Finally, steps c1 and c2 realize how the gateway device transfers a packet when the gateway device receives the packet from the network side.

[0109] Above, the method according to the embodiment of the present invention is described from the perspective of a gateway device in a Layer 3 network, and below, the method according to the embodiment of the present invention is described from the perspective of an AP.

[0110] Please refer to FIG. 6, which is a flowchart of another method according to an embodiment of the present invention. The method is applied to an AP connected to a gateway device in a Layer 3 network. In this embodiment, the AP automatically creates a Layer 3 interface, such as Interface VLAN 4092, locally for exchanging SRv6 services with the gateway device. Here, the IPv6 address of the Layer 3 interface may be automatically configured. And based on the SRv6 tunnel between the gateway device and the AP, an SRv6 tunnel port on the AP may be bound to the Layer 3 interface on the AP.

[0111] As shown in FIG. 6, the flow may include the following steps.

[0112] In step 601, if it is necessary to forward a packet to the gateway device, step 602 is executed, and if a packet is received via the SRv6 tunnel from this AP to the gateway device, step 603 is executed.

[0113] In step 602, an IPv6 encapsulation header is added to the packet, and the packet is forwarded through an SRv6 tunnel from this AP to the gateway device.

[0114] This step 602 is performed under the assumption that the packet needs to be forwarded to a gateway device.

[0115] Optionally, the destination IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to this AP.

[0116] As an embodiment, in this step 602, as described above, the source IP address and the destination IP address in the IPv6 encapsulation header may be adaptively determined based on the Service VLAN ID to which the packet belongs.

[0117] For example, a destination IP address in an IPv6 encapsulation header may include a Locator, a Function, and Args. Locator: Set to the Locator assigned to the gateway device. Function: Set to the service VLAN ID to which the packet belongs. Args: An application identifier (including the role type and application type of the service) is added.

[0118] Similarly, the source IP address in the IPv6 encapsulating header may include a Locator and a Function. Locator: Set to the Locator assigned to the AP. Function: Set to the service VLAN ID to which the packet belongs.

[0119] That is, in this embodiment, the Function in the destination IPv6 address and the Function in the source IPv6 address in the IPv6 encapsulation header are the same, and both are the third Service VLAN ID, which is the Service VLAN ID to which the above packet belongs.

[0120] In step 603, IPv6 decapsulation is performed on the received packet, and the packet is forwarded based on the destination MAC address of the decapsulated packet.

[0121] This step 603 is performed on the assumption that the packet is received via an SRv6 tunnel from this AP to the gateway device. This step 603 is similar to the forwarding of a conventional AP, so a description thereof will be omitted here.

[0122] Up to this point, the flow shown in Figure 6 has been completed.

[0123] According to the flow shown in FIG. 6, the gateway device and AP introduce an SRv6 tunnel based on the assigned Locator, and transmit packets between the gateway device and the AP via the SRv6 tunnel, thereby realizing a packet forwarding method applicable to a Layer 3 network in which SRv6 is introduced.

[0124] Having described above the method according to the embodiment of the present invention, the apparatus according to the embodiment of the present invention will now be described.

[0125] Please refer to Fig. 7, which is a structural diagram of an apparatus according to an embodiment of the present invention. The apparatus is applied to a gateway device in a Layer 3 network, there is an SRv6 tunnel between the gateway device and an access point AP connected to the gateway device, the gateway device and different APs connected to the gateway device are assigned different locators, and the apparatus: A packet receiving unit for receiving a first packet through the SRv6 tunnel or receiving a third packet from a network side; When receiving a first packet through the SRv6 tunnel, decapsulate an IPv6 encapsulation header for the first packet to obtain a second packet, and forward the second packet based on a destination IP address of the second packet; a packet processing unit for, when receiving a third packet from a network side, performing IPv6 decapsulation on the third packet to obtain a fourth packet, and forwarding the fourth packet based on a destination IP address of the fourth packet; The destination IP address in the IPv6 encapsulation header added to the first packet includes at least a Locator and a Function assigned to the gateway device, the destination MAC address of the second packet is a MAC address of a Layer 3 gateway interface associated with a VSI instance bound to the Function on the gateway device, and the destination IPv6 address in the IPv6 encapsulation header added to the third packet includes at least a Locator assigned to the gateway device.

[0126] Optionally, when the gateway device functions as a Locator Manager, the device further comprises: The apparatus further includes an allocation unit for receiving a Locator allocation request sent by an AP, and allocating a corresponding Locator to the AP based on the Locator allocation request.

[0127] Optionally, a User Datagram Protocol (UDP) connection for Locator allocation is established between the gateway device and the AP, and the Locator allocation request is received via the UDP connection; The allocation unit allocates a corresponding Locator to the AP based on the Locator allocation request, returning a Locator assignment response to the AP via the UDP connection, the Locator assigned to the AP being added; receiving a designated Locator assignment request returned by the AP based on the Locator assignment response via the UDP connection, in which at least the Locator added to the Locator assignment response is added to the designated Locator assignment request; and returning a Locator allocation confirmation message to the AP via the UDP connection to confirm allocation of the Locator to the AP.

[0128] Optionally, when the allocation unit receives a Locator occupancy request sent by the AP through the UDP connection after allocating the corresponding Locator to the AP, if the AP is allowed to continue occupying the allocated Locator, it returns a Locator occupancy confirmation message to the AP through the UDP connection to confirm that the AP continues to occupy the allocated Locator, or releases the allocated Locator for the AP if it does not receive a Locator occupancy request sent by the AP within a predetermined time. The Locator occupancy request is used to indicate that the AP continues to occupy the allocated Locator.

[0129] Optionally, the allocation unit further allocates a Locator to an AP connected to the gateway device, and then generates a Locator route to the AP, where a next hop of the Locator route is an IPv6 address of an interface connected to the gateway device on the AP, and an outbound interface is a Layer 3 interface on the gateway device for forwarding SRv6 services to the AP.

[0130] Optionally, the packet processing unit forwarding the second packet based on a destination IP address of the second packet comprises: decapsulating a Layer 2 header from the second packet to obtain a fifth packet; searching an IP routing entry that matches a destination IP address of the fifth packet from an IP routing forwarding instance routing table associated with the Layer 3 gateway interface; If the outbound interface of the IP routing entry is an SRv6 tunnel port from the gateway device to the first AP, forwarding the sixth packet based on the outbound interface in the obtained first Locator route that matches the Locator of the first AP; The outbound interface in the first Locator route is a Layer 3 interface on the gateway device for forwarding SRv6 services to the first AP; The sixth packet is obtained by adding at least an IPv6 encapsulation header to the fifth packet, a destination IPv6 address in the IPv6 encapsulation header added to the sixth packet includes at least a Locator and a Function assigned to the first AP, and a source IPv6 address in the IPv6 encapsulation header added to the sixth packet includes at least a Locator and a Function assigned to the gateway device.

[0131] Optionally, the Function includes at least a Function type and a Function operation instruction value; A Function in the destination IPv6 address and a Function in the source IPv6 address in the IPv6 encapsulation header added to the sixth packet include the same Function operation command value, and the Function operation command value is a first Service VLAN ID; The first service VLAN ID is the service VLAN ID to which the sixth packet belongs.

[0132] Optionally, the packet processing unit forwarding the fourth packet based on a destination IP address of the fourth packet comprises: Searching an IP routing entry in an IP routing forwarding instance routing table that matches a destination IP address of the fourth packet; If the outbound interface of the IP routing entry is an SRv6 tunnel port from the gateway device to the second AP, searching for a second Locator route that matches the Locator of the second AP from the obtained Locator route, and forwarding the seventh packet through the outbound interface in the second Locator route; The outbound interface in the second Locator route is a Layer 3 interface on the gateway device for forwarding SRv6 services to the second AP, the seventh packet is obtained by adding at least an IPv6 encapsulation header to the fourth packet, a destination IPv6 address in the IPv6 encapsulation header added to the seventh packet includes at least a Locator and a Function assigned to the second AP, and a source IPv6 address in the IPv6 encapsulation header added to the seventh packet includes at least a Locator and a Function assigned to the gateway device.

[0133] Optionally, the Function includes at least a Function type and a Function operation instruction value; The Function in the destination IPv6 address and the Function in the source IPv6 address in the IPv6 encapsulation header added to the seventh packet include the same Function operation command value, and the Function operation command value is a second Service VLAN ID; The second Service VLAN ID is the Service VLAN ID to which the seventh packet belongs.

[0134] Optionally, the apparatus further includes an entry learning unit (not shown in FIG. 7). The entry learning unit is When the IP address of a terminal connected to any AP is learned, a function that matches the terminal IP address is determined, and the function and the terminal IP address are reported to the network side so that the destination IPv6 address in the IPv6 encapsulation header added to a packet sent from the network side to the terminal includes at least the function, and the function is used to instruct IPv6 decapsulation and a search of an IP routing forwarding instance routing table that matches the terminal IP address for forwarding the packet to the terminal, and if the terminal IP address is IPv4, the IP routing forwarding instance routing table is an IPv4 VPN routing table, and if the terminal IP address is IPv6, the IP routing forwarding instance routing table is an IPv6 VPN routing table, and / or If there is no local MAC entry matching the source MAC address of the second packet, MAC learning is performed on the second packet to obtain a MAC entry matching the source MAC address of the second packet, the MAC entry including at least the source MAC address of the second packet, a VSI instance, and outbound interface information, and the VSI instance corresponds to the Service VLAN ID to which the second packet belongs.

[0135] Up to this point, the description of the structure of the device shown in FIG. 7 has been completed.

[0136] Please refer to Figure 8, which is a structural diagram of another apparatus according to an embodiment of the present invention. The apparatus is applied to an access point AP connected to a gateway device in a Layer 3 network, an SRv6 tunnel exists between the gateway device and the AP, and the AP, the gateway device, and other APs connected to the gateway device are all assigned different locators, and the apparatus: a receiving unit for receiving packets via an SRv6 tunnel from the AP to the gateway device; When a packet needs to be forwarded to the gateway device, add an IPv6 encapsulation header to the packet and forward the packet through an SRv6 tunnel from this AP to the gateway device; a forwarding unit for performing IPv6 decapsulation on the received packet when the packet is received via an SRv6 tunnel from the AP to the gateway device, and forwarding the packet based on a destination MAC address of the decapsulated packet; The destination IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to this AP.

[0137] Optionally, a Function in the destination IPv6 address and a Function in the source IPv6 address in the IPv6 encapsulation header are the same, and both are a third Service VLAN ID; The third service VLAN ID is a service VLAN ID to which a packet that needs to be forwarded to a gateway device belongs.

[0138] Up to this point, the description of the structure of the device shown in FIG. 8 has been completed.

[0139] An embodiment of the present invention further provides a hardware structure of the apparatus shown in Fig. 7 or Fig. 8. Refer to Fig. 9, which is a structural diagram of an electronic device according to an embodiment of the present invention. As shown in Fig. 9, the hardware structure may include a processor and a machine-readable storage medium, in which machine-executable instructions executable by the processor are stored, and the processor is used to execute the machine-executable instructions to implement any of the methods disclosed in the above examples of the present invention.

[0140] Based on the same idea as the above method, an embodiment of the present invention further provides a machine-readable storage medium, in which some computer instructions are stored, and when the computer instructions are executed by a processor, the method disclosed in the above example of the present invention can be implemented.

[0141] Exemplarily, the machine-readable storage medium may be an electronic, magnetic, optical, or other physical storage device capable of storing or storing information such as executable instructions, data, etc. For example, the machine-readable storage medium may be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (e.g., a hard disk drive), a solid-state drive, any type of storage disk (e.g., an optical disk, a DVD, etc.), or a similar storage medium, or a combination thereof.

[0142] The system, device, module or unit described in the above embodiments may be specifically realized by a computer chip, an entity, or a product having some function. A typical realizing device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a mobile phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, a game console, a tablet, a wearable device, or any combination of these devices.

[0143] For the sake of convenience, the above-mentioned device will be described by dividing it into various units according to their functions. Of course, when implementing the present invention, the functions of each unit can be realized by the same or multiple pieces of software and / or hardware.

[0144] As will be appreciated by those skilled in the art, embodiments of the present invention may be provided as a method, a system, or a computer program product. Thus, the present invention may employ an embodiment consisting entirely of hardware, an embodiment consisting entirely of software, or an embodiment consisting of a combination of software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product embodied in one or more computer usable storage media (including, but not limited to, magnetic disk memories, CD-ROMs, optical memories, etc.) containing computer usable program code.

[0145] The present invention will be described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, may be realized by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, whereby the instructions executed by the processor of the computer or other programmable data processing device generate an apparatus for implementing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0146] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture that includes an instruction apparatus that implements the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0147] These computer program instructions may be loaded into a computer or other programmable data processing device such that a series of operational steps are executed on the computer or other programmable device to generate a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0148] The above is merely an embodiment of the present invention and is not used to limit the present invention. Those skilled in the art may make various modifications and changes to the present invention. Any modifications, equivalent replacements, improvements, etc. made without departing from the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A packet forwarding method applied to a gateway device in a Layer 3 network, comprising: an SRv6 tunnel between the gateway device and an access point AP connected to the gateway device; and a different locator (Locator) is assigned to the gateway device and a different AP connected to the gateway device; When receiving a first packet through the SRv6 tunnel, decapsulating an IPv6 encapsulation header for the first packet to obtain a second packet, and forwarding the second packet based on a destination IP address of the second packet, wherein the destination IP address in the IPv6 encapsulation header added to the first packet includes at least a Locator and a function assigned to the gateway device, and the destination MAC address of the second packet is a MAC address of a Layer 3 gateway interface associated with a VSI instance bound to the Function on the gateway device; when receiving a third packet from a network side, performing IPv6 decapsulation on the third packet to obtain a fourth packet, and forwarding the fourth packet based on a destination IP address of the fourth packet, wherein the destination IPv6 address in the IPv6 encapsulation header added to the third packet includes at least a Locator assigned to the gateway device; 2. A packet forwarding method comprising:

2. When the gateway device functions as a Locator Manager, receiving a Locator allocation request sent by an AP; and allocating a corresponding Locator to the AP based on the Locator allocation request, whereby the gateway device allocates the Locator of the AP.

2. The method of claim 1 .

3. A User Datagram Protocol (UDP) connection for Locator allocation is established between the gateway device and the AP, and the Locator allocation request is received via the UDP connection; The step of allocating a corresponding Locator to the AP based on the Locator allocation request includes: returning a Locator assignment response to the AP via the UDP connection, the Locator assigned to the AP being added; receiving a designated Locator assignment request returned by the AP based on the Locator assignment response via the UDP connection, the designated Locator assignment request including at least the Locator added to the Locator assignment response; and returning a Locator assignment confirmation message to the AP via the UDP connection to confirm assignment of the Locator to the AP.

3. The method of claim 2 .

4. After assigning the corresponding Locator to the AP, when receiving a Locator occupancy request sent by the AP via the UDP connection, if the AP is permitted to continue occupying the assigned Locator, returning a Locator occupancy confirmation message to the AP via the UDP connection to confirm that the AP continues to occupy the assigned Locator, the Locator occupancy request being used to request whether the AP continues to occupy the assigned Locator; and releasing the Locator allocated to the AP when a Locator occupancy request transmitted by the AP is not received within a predetermined time.

4. The method according to claim 3 .

5. The method further includes the step of: after the gateway device assigns a Locator to an AP connected to the gateway device as a Locator manager, generating a Locator route to the AP; The next hop of the Locator route is an IPv6 address of an interface connected to a gateway device on the AP, and the outbound interface is a Layer 3 interface on the gateway device for forwarding SRv6 services to the AP.

2. The method of claim 1 .

6. The step of forwarding the second packet based on a destination IP address of the second packet includes: decapsulating a Layer 2 header from the second packet to obtain a fifth packet; searching an IP routing entry that matches a destination IP address of the fifth packet from an IP routing forwarding instance routing table associated with the Layer 3 gateway interface; and if the outbound interface of the IP routing entry is an SRv6 tunnel port from the gateway device to the first AP, forwarding the sixth packet based on the obtained outbound interface in the first Locator route that matches the Locator of the first AP; an outbound interface in the first Locator route is a Layer 3 interface on the gateway device for forwarding SRv6 services to the first AP; The sixth packet is obtained by adding at least an IPv6 encapsulation header to the fifth packet, a destination IPv6 address in the IPv6 encapsulation header added to the sixth packet includes at least a Locator and a Function assigned to the first AP, and a source IPv6 address in the IPv6 encapsulation header added to the sixth packet includes at least a Locator and a Function assigned to the gateway device.

6. The method according to claim 1 or 5.

7. The function includes at least a function type and a function operation command value; A Function in the destination IPv6 address and a Function in the source IPv6 address in the IPv6 encapsulation header added to the sixth packet include the same Function operation command value, and the Function operation command value is a first Service VLAN ID; The first Service VLAN ID is a Service VLAN ID to which the sixth packet belongs; 7. The method of claim 6.

8. The step of forwarding the fourth packet based on a destination IP address of the fourth packet includes: searching an IP routing entry in an IP routing forwarding instance routing table that matches a destination IP address of the fourth packet; If the outbound interface of the IP routing entry is an SRv6 tunnel port from the gateway device to the second AP, searching for a second Locator route that matches the Locator of the second AP from the obtained Locator route, and forwarding the seventh packet through the outbound interface in the second Locator route; an outbound interface in the second Locator route is a Layer 3 interface on the gateway device for forwarding an SRv6 service to the second AP; the seventh packet is obtained by adding at least an IPv6 encapsulation header to the fourth packet, a destination IPv6 address in the IPv6 encapsulation header added to the seventh packet includes at least a Locator and a Function assigned to the second AP; and a source IPv6 address in the IPv6 encapsulation header added to the seventh packet includes at least a Locator and a Function assigned to the gateway device.

6. The method according to claim 1 or 5.

9. The function includes at least a function type and a function operation command value; The Function in the destination IPv6 address and the Function in the source IPv6 address in the IPv6 encapsulation header added to the seventh packet include the same Function operation command value, and the Function operation command value is a second Service VLAN ID; The second Service VLAN ID is a Service VLAN ID to which the seventh packet belongs; 9. The method of claim 8.

10. When the IP address of a terminal connected to any AP is learned, a function that matches the terminal IP address is determined, and the function and the terminal IP address are reported to the network side, so that a destination IPv6 address in an IPv6 encapsulation header added to a packet transmitted from the network side to the terminal includes at least the function; The function matching the terminal IP address is used to instruct IPv6 decapsulation and searching an IP routing forwarding instance routing table that matches the terminal IP address for forwarding packets to the terminal, and if the terminal IP address is IPv4, the IP routing forwarding instance routing table is an IPv4 VPN routing table, and if the terminal IP address is IPv6, the IP routing forwarding instance routing table is an IPv6 VPN routing table.

9. The method of claim 8.

11. If there is no local MAC entry that matches the source MAC address of the second packet, performing MAC learning on the second packet to obtain a MAC entry that matches the source MAC address of the second packet; The MAC entry includes at least a source MAC address, a VSI instance, and outbound interface information of the second packet, and the VSI instance corresponds to a Service VLAN ID to which the second packet belongs.

2. The method of claim 1 .

12. A packet forwarding method applied to an access point AP connected to a gateway device in a Layer 3 network, wherein an SRv6 tunnel exists between the gateway device and the AP, and different locators (Locators) are assigned to the AP, the gateway device, and another AP connected to the gateway device; When a packet needs to be forwarded to the gateway device, adding an IPv6 encapsulation header to the packet and forwarding the packet through an SRv6 tunnel from this AP to the gateway device, where a destination IP address in the IPv6 encapsulation header includes at least a Locator and a function assigned to the gateway device, and a source IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the AP; When a packet is received via an SRv6 tunnel from the AP to the gateway device, performing IPv6 decapsulation on the received packet and forwarding the packet based on a destination MAC address of the decapsulated packet.

2. A packet forwarding method comprising:

13. The Function in the destination IPv6 address and the Function in the source IPv6 address in the IPv6 encapsulation header are the same, and both are a third Service VLAN ID; The third Service VLAN ID is a Service VLAN ID to which a packet that needs to be forwarded to a gateway device belongs; 13. The method of claim 12.

14. A packet forwarding apparatus applied to a gateway device in a Layer 3 network, wherein an SRv6 tunnel exists between the gateway device and an access point AP connected to the gateway device, and a different locator "Locator" is assigned to each of the gateway device and each of the different APs connected to the gateway device, a packet receiving unit for receiving a first packet through the SRv6 tunnel or receiving a third packet from a network side; when receiving a first packet via the SRv6 tunnel, decapsulating an IPv6 encapsulation header for the first packet to obtain a second packet, and forwarding the second packet based on a destination IP address of the second packet; a packet processing unit for, when receiving a third packet from a network side, performing IPv6 decapsulation on the third packet to obtain a fourth packet, and forwarding the fourth packet based on a destination IP address of the fourth packet; a destination IP address in an IPv6 encapsulation header added to the first packet includes at least a Locator and a Function assigned to the gateway device, a destination MAC address of the second packet is a MAC address of a Layer 3 gateway interface associated with a VSI instance bound to the Function on the gateway device, and a destination IPv6 address in an IPv6 encapsulation header added to the third packet includes at least a Locator assigned to the gateway device; A packet forwarding device comprising:

15. A packet forwarding apparatus applied to an access point (AP) connected to a gateway device in a Layer 3 network, wherein an SRv6 tunnel exists between the gateway device and the AP, and different locators (Locators) are assigned to the AP, the gateway device, and another AP connected to the gateway device, a receiving unit for receiving packets via an SRv6 tunnel from the AP to the gateway device; When a packet needs to be forwarded to the gateway device, add an IPv6 encapsulation header to the packet and forward the packet through an SRv6 tunnel from this AP to the gateway device; a forwarding unit for, when receiving a packet through an SRv6 tunnel from the AP to the gateway device, performing IPv6 decapsulation on the received packet and forwarding the packet based on a destination MAC address of the decapsulated packet; The destination IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least a Locator and a Function assigned to this AP; A packet forwarding device comprising:

Citation Information

Patent Citations

  • Message forwarding method and device

    CN113207192A

  • Message forwarding method and device

    CN113301667A

  • Improved SID allocation

    WO2021158428A1

Cited By

  • Fine-grained identification method, device and equipment for satellite network traffic data

    CN120750828A