Packet forwarding method and apparatus
Patent Information
- Application Number
- CN202280000652.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-03-30
AI Technical Summary
[0021]本申请实施例还提供了一种网络设备,其特征在于,该网络设备包括:处理器和机器可读存储介质;
Smart Images

Figure CN116965146B_ABST
Abstract
Description
Technical Field
[0001] This application relates to network communication technology, and in particular to message forwarding methods and apparatus. Background Technology
[0002] IPv6 Segment Routing (SRv6) is a method of implementing segment routing (SR) based on the IPv6 forwarding plane. In SRv6, the segment identifier (SID) uses an IPv6 address, but it does not correspond to an interface address on any device. For example... Figure 1 As shown, a SID includes at least a Locator, a Function, and Arguments.
[0003] Locator: The Locator is unique within the SR domain. In specific applications, the Locator may include a common prefix and a network node identifier (Node ID).
[0004] Function: Used to identify the operation command bound to the SID. Within the SR domain, when a node receives a message, it will execute the relevant operation based on the Function in the SID carried in the message. In specific applications, Function may include: operation command type and operation command value representing the operation command.
[0005] Arguments: Defines information such as message flow and services. Summary of the Invention
[0006] This application provides a packet forwarding method and apparatus to enable packet forwarding in a Layer 3 network deployed with SRv6.
[0007] This application provides a packet forwarding method applied to a gateway device in a Layer 3 network. An SRv6 tunnel exists between the gateway device and a connected access point (AP). The gateway device and different APs connected to it are assigned different location identifiers (Locators). The method includes:
[0008] When a first packet is received through the SRv6 tunnel, the destination IP address in the IPv6 encapsulation header of the first packet includes at least the Locator and Function assigned to the gateway device. The IPv6 encapsulation header of the first packet is decapsulated to obtain a second packet. 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 Function on the gateway device. The second packet is forwarded according to the destination IP address in the second packet.
[0009] When a third packet is received from the network side, and the destination IPv6 address in the IPv6 encapsulation header of the third packet includes at least the Locator assigned to the gateway device, the third packet is decapsulated in IPv6 to obtain a fourth packet, and the fourth packet is forwarded according to the destination IP address of the fourth packet.
[0010] This application embodiment also provides another packet forwarding method, which is applied to access point devices (APs) connected to a gateway device in the Layer 3 network. An SRv6 tunnel exists between the gateway device and the AP. The APs, the gateway device, and other APs connected to the gateway device are all assigned different location identifiers (Locators). The method includes:
[0011] When it is necessary to forward a message to the gateway device, the message carries an IPv6 encapsulation header and is forwarded through an SRv6 tunnel from this AP to the gateway device; the destination IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to this AP.
[0012] When receiving packets through the SRv6 tunnel between this AP and the gateway device, the received packets are decapsulated using IPv6 and forwarded according to the destination MAC address of the decapsulated packets.
[0013] This application provides a packet forwarding device applied to a gateway device in a Layer 3 network. An SRv6 tunnel exists between the gateway device and a downstream access point (AP). The gateway device and different APs connected to it are assigned different location identifiers (Locators). The device includes:
[0014] The message receiving unit is used to receive a first message through the SRv6 tunnel, or to receive a third message from the network side.
[0015] The message processing unit is configured to, upon receiving a first message through the SRv6 tunnel, wherein the destination IP address in the IPv6 encapsulation header of the first message includes at least the Locator and Function assigned to the gateway device, decapsulate the IPv6 encapsulation header of the first message to obtain a second message, wherein the destination MAC address of the second message is the MAC address of the Layer 3 gateway interface associated with the VSI instance bound to the Function on the gateway device, and forward the second message according to the destination IP address in the second message; and,
[0016] When a third packet is received from the network side, and the destination IPv6 address in the IPv6 encapsulation header of the third packet includes at least the Locator assigned to the gateway device, the third packet is decapsulated in IPv6 to obtain a fourth packet, and the fourth packet is forwarded according to the destination IP address of the fourth packet.
[0017] This application embodiment also provides a message forwarding device, which is applied to an access point device (AP) connected to a gateway device in the Layer 3 network. An SRv6 tunnel exists between the gateway device and the AP. The AP, the gateway device, and other APs connected to the gateway device are all assigned different location identifiers (Locators). The method includes:
[0018] The receiving unit is configured to receive messages through an SRv6 tunnel between this AP and the gateway device;
[0019] A forwarding unit, configured to, when it is necessary to forward a packet to the gateway device, carry an IPv6 encapsulation header in the packet and forward it through an SRv6 tunnel from this AP to the gateway device; the destination IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to this AP; and,
[0020] When receiving packets through the SRv6 tunnel between this AP and the gateway device, the received packets are decapsulated using IPv6 and forwarded according to the destination MAC address of the decapsulated packets.
[0021] This application also provides a network device, characterized in that the network device includes: a processor and a machine-readable storage medium;
[0022] The machine-readable storage medium stores machine-executable instructions that can be executed by the processor;
[0023] The processor is used to execute machine-executable instructions to implement any of the methods described above.
[0024] As can be seen from the above technical solutions, in this embodiment of the application, by automatically assigning different Locators to the gateway device and the different APs connected to the gateway device, the deployment of SRv6 in the Layer 3 network is automated, so as to make full use of the advantages brought by SRv6 in the Layer 3 network.
[0025] Furthermore, in this embodiment, an SRv6 tunnel is deployed between the gateway device and the AP based on the Locator assigned to the gateway device and the AP. Packet transmission is carried out between the gateway device and the AP through the SRv6 tunnel, thus realizing a packet forwarding method applied to a Layer 3 network with SRv6 deployed. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0027] Figure 1 This is a schematic diagram of the SID structure provided in an embodiment of this application;
[0028] Figure 2 A network topology diagram of a campus network deploying SRv6 provided for an embodiment of this application;
[0029] Figure 3 A flowchart illustrating the method provided in this application embodiment;
[0030] Figure 4 A flowchart of the Locator allocation process provided in this application embodiment;
[0031] Figure 5 A schematic diagram of the Locator structure provided in the embodiments of this application;
[0032] Figure 6 Another method flowchart provided for embodiments of this application;
[0033] Figure 7 This is a structural diagram of the device provided in the embodiments of this application;
[0034] Figure 8 Another device structure diagram provided for an embodiment of this application;
[0035] Figure 9 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0036] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0037] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application are also intended to include the plural forms unless the context clearly indicates otherwise.
[0038] SRv6 provides a flexible and efficient traffic control mechanism for networks, enabling better traffic scheduling and path optimization, ensuring the quality of critical services, balancing quality distribution, and improving leased line utilization. Currently, SRv6 can be deployed in Layer 3 networks such as campus networks. Figure 2 An example is shown of a campus network where SRv6 has been deployed. In Figure 2 In the diagram, the bold black line indicates the SRv6 path. When SRv6 is deployed in a campus network, gateway devices (which can be leaf nodes in a spine-leaf topology) and wireless access points (APs) will use SRv6 to perform traffic policing and scheduling.
[0039] However, in a typical Layer 3 network environment, to simplify deployment, the same AP configuration is often issued to a group of different APs based on AP templates (i.e., multiple different APs have the same configuration). But when SRv6 is applied to Layer 3 networks such as campus networks, different locators need to be assigned to different APs for easier differentiation. This makes it impossible to issue the same AP configuration to a group of different APs based on AP templates. The inability to issue the same AP configuration to a group of different APs based on AP templates, combined with the large number of APs in a Layer 3 network, hinders the deployment of SRv6 in Layer 3 networks and impedes network deployment automation.
[0040] To address the aforementioned technical problems, embodiments of this application provide a packet forwarding method applicable to a Layer 3 network deployed with SRv6. To enable those skilled in the art to better understand the technical solutions provided in these embodiments, and to make the aforementioned objectives, features, and advantages of these embodiments more apparent, the technical solutions in these embodiments are further described in detail below with reference to the accompanying drawings.
[0041] The method provided in this application embodiment will be described below from the perspective of a gateway device in a Layer 3 network:
[0042] See Figure 3 , Figure 3 This is a flowchart illustrating a method provided in an embodiment of this application. The method is applied to a gateway device in a Layer 3 network. Optionally, it is applied to a Spine-Leaf network topology, where the gateway device can be a Leaf node.
[0043] In this embodiment, the gateway device and the different APs connected to the gateway device are all assigned different Locators. Optionally, in this embodiment, a network device can be designated as the Locator Manager, and the Locator Manager can assign different Locators to the gateway device and each AP connected to the gateway device.
[0044] For example, if a gateway device is designated as a Locator Manager, then the gateway device acting as the Locator Manager will assign different Locators to itself and to each AP (which can be called a Locator Client) connected to the gateway device. Figure 4 This section provides an example of how to assign different Locators to the gateway device and each AP connected to it when the gateway device is the Locator Manager. Details will not be elaborated here.
[0045] For example, a non-gateway device, such as an Access Controller (AC), can be designated as the Locator Manager. The Locator Manager can assign different Locators to the gateway device and different Access Points (APs) connected to the gateway device (in this case, the gateway device and different APs connected to the gateway device can all be called Locator Clients). The specific assignment method is similar. Figure 4 The allocation shown will not be elaborated upon here.
[0046] 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 can be, for example, an SRv6 PW, etc., which is not specifically limited in this embodiment). Optionally, the SRv6 tunnel can be established dynamically or statically configured, which is not specifically limited in this embodiment.
[0047] Based on the above description, then as Figure 3 As shown, the process may include the following steps:
[0048] Step 301: When a first packet is received through the SRv6 tunnel, and the destination IP address in the IPv6 encapsulation header of the first packet includes at least the Locator and Function assigned to the gateway device, then proceed to step 302. When a third packet is received from the network side, and the destination IPv6 address in the IPv6 encapsulation header of the third packet includes at least the Locator assigned to the gateway device, then proceed to step 303.
[0049] It should be noted that in this embodiment, the first message and the third message are only named for ease of description and are not intended to limit the scope of the application.
[0050] As described above, in this embodiment, when the first packet is received through the SRv6 tunnel between the gateway device and the AP, it means that the gateway device is receiving 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, step 302 is executed as follows.
[0051] Step 302: Decapsulate the first packet using the IPv6 encapsulation header to obtain the second packet. 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 Function on the gateway device. Forward the second packet based on the destination IP address in the second packet.
[0052] Step 302 is performed on the premise that the gateway device receives the first message through the SRv6 tunnel.
[0053] Optionally, in this embodiment, the Local SID corresponding to the gateway device can be determined based on the Locator and Function (including the operation instruction value (Opcode) and Function type) assigned to the gateway device, and the Function is different in each Local SID. Table 1 shows two Local SIDs corresponding to the gateway device (Local SIDs will be described in examples below):
[0054]
[0055] Table 1
[0056] In Table 1, end-dt2u is used to indicate that when the packet is decapsulated and the destination MAC address after decapsulation is the MAC address of the Layer 3 gateway interface associated with the VSI instance bound to the Function on the gateway device, the packet will be forwarded based on the destination IP address in the packet.
[0057] Based on each Local SID shown in Table 1, a corresponding FIB6 entry can be added to the FIB6 (IPv6 Forwarding InformationBase) table. Each FIB6 entry must contain at least its corresponding Local SID. Therefore, as in step 302, when the gateway device receives the first packet through the SRv6 tunnel, it searches the FIB6 table based on the destination IP address carried in the first packet. If a corresponding FIB6 entry is found, the gateway device decapsulates the first packet using the IPv6 encapsulation header according to the end-dt2u instruction within the Local SID in the FIB6 entry, obtaining the second packet. If the destination MAC address of the second packet is found to be the MAC address of the Layer 3 gateway interface associated with the VSI instance bound to the aforementioned Function on the gateway device, the second packet is forwarded based on the destination IP address in the second packet. The following section will provide an example of how to forward the second packet based on its destination IP address; details will not be elaborated here.
[0058] Step 303: Decapsulate the third packet using IPv6 to obtain the fourth packet, and forward the fourth packet according to its destination IP address.
[0059] Step 303 is performed upon receiving a third packet from the network side. When the gateway device receives the third packet, it performs the corresponding operation based on the Function contained in the destination IPv6 address in the IPv6 encapsulation header carried by the packet. If the Function indicates IPv6 decapsulation and looking up the corresponding IP routing instance routing table, it is applied to step 303. It decapsulates the third packet to obtain a fourth packet, looks up the corresponding IP routing instance routing table entry based on the destination IP address of the fourth packet, and forwards the packet based on that entry. The specific details of this packet forwarding are described in the examples below and will not be repeated here.
[0060] To ensure that the gateway device performs the corresponding operation based on the Function contained in the destination IPv6 address in the IPv6 encapsulation header carried in the packet, optionally in this embodiment, when the gateway device learns the IP address of a terminal connected to any AP, it determines the Function that matches the terminal's IP address and reports the Function and the terminal's IP address to the network side. This ensures that the destination IPv6 address in the IPv6 encapsulation header of subsequent packets sent from the network side to the terminal at least contains the aforementioned Function. The Function is used to instruct IPv6 decapsulation and to look up the IP routing instance routing table that matches the terminal's IP address. Here, when the terminal's IP address is IPv4, the IP routing instance routing table is an IPv4 VPN routing table; when the terminal's IP address is IPv6, the IP routing instance routing table is an IPv6 VPN routing table.
[0061] This concludes the process. Figure 3 The process is shown below.
[0062] pass Figure 3 As can be seen from the process shown, this embodiment automates the deployment of SRv6 in a Layer 3 network by automatically assigning different Locators to the gateway device and the different APs connected to the gateway device, so as to fully utilize the advantages brought by SRv6 in the Layer 3 network.
[0063] Furthermore, in this embodiment, an SRv6 tunnel is deployed between the gateway device and the AP based on the Locator assigned to the gateway device and the AP. Packet transmission is carried out between the gateway device and the AP through the SRv6 tunnel, thus realizing a packet forwarding method applied to a Layer 3 network with SRv6 deployed.
[0064] The following is about Figure 4 The process is described as follows:
[0065] See Figure 4 , Figure 4 This is a flowchart illustrating the Locator allocation process provided in an embodiment of this application. Figure 4 In the process shown, the Locator Manager assigns different Locators to the gateway device and each AP connected to the gateway device.
[0066] In this embodiment, the Locator Manager manages the Locator resource pool (the Locator resource pool contains several Locators). For ease of management and compatibility with existing Locator structures (comprising a Common prefix + Node ID), the Locator in this embodiment can be: Common prefix + Manager ID + Node ID, specifically as follows: Figure 5 As shown. The reason for setting the Locator in this way is to ensure that when there are multiple Locator managers in the same network, the Locators assigned by different Locator managers are not duplicated, thus ensuring the uniqueness of each Locator in the entire network.
[0067] exist Figure 5 In this context, the value and length of the Common prefix can be specified in advance, for example: A0:B0:: / 40 (the value of the Common prefix is A0:B0::, and the length is 40 bits).
[0068] exist Figure 5 In this context, the value and length of the Manager ID can be specified in advance. For example, the value of the Manager ID is 1 and the length is 8 bits.
[0069] exist Figure 5 In this implementation, the Node ID value may not be pre-specified, but rather selected from the Node ID resource pool. Optionally, in this embodiment, Node 0 (i.e., Node ID 0) may be reserved in the Node ID resource pool. In other words, combining the Commonprefix and Manager ID mentioned above, in this embodiment, A0:B0:01:00:: / 64 may be reserved and not pre-allocated.
[0070] Optionally, in this embodiment, the gateway device can act as a Locator Manager. When assigning a Locator to itself, it can first select the smallest non-zero Node ID from the Node ID resource pool. Taking the selected Node ID as 1 as an example, and combining it with the Common prefix and Manager ID mentioned above, in this embodiment, the Locator assigned to itself by the gateway device as the Locator Manager can be A0:B0:01:01:: / 64.
[0071] The gateway device acts as the Locator Manager, and it will follow the instructions as follows: Figure 4 The illustrated process involves assigning a Locator to each AP acting as a LocatorClient. Of course, if the gateway device does not act as a Locator Manager, the LocatorManager will proceed as follows: Figure 4 The process shown is that the gateway device, which acts as the Locator Client, and each AP connected to the gateway device are assigned a Locator.
[0072] like Figure 4 As shown, the process may include the following steps:
[0073] Step 401: Receive the Locator allocation request sent by the Locator Client.
[0074] In this embodiment, once the Locator Client comes online (e.g., after it comes online and is assigned an IPv6 address), it sends a Locator allocation request to the Locator Manager. This Locator allocation request may include at least the Locator Client's IPv6 address, MAC address, and Locator Client identifier.
[0075] Step 402: Based on the Locator allocation request, allocate the corresponding Locator to the Locator Client.
[0076] Optionally, in this embodiment, there is a protocol connection between the Locator Manager and the Locator Client for Locator allocation. This protocol connection can be a TCP connection or a UDP connection.
[0077] As an example, when the above protocol link is a TCP connection, an available Node ID can be selected from the available Node IDs in the Node ID resource pool. The selected available Node ID, together with the Common prefix and Manager ID mentioned above, forms a Locator. The Locator is carried in the Locator allocation response and sent to the Locator Client through the TCP connection.
[0078] Optionally, there are many ways to select an available Node ID from the available Node IDs in the Node ID resource pool. For example, you can directly select the smallest Node ID from the available Node IDs in the Node ID resource pool in sequence. Taking the example of directly selecting the smallest Node ID from the available Node IDs in the Node ID resource pool in sequence, if Node 1 (i.e., Node ID 1) has already been selected, and considering that Node 0 is reserved, the available Node IDs in the current Node ID resource pool are Node 2 (i.e., Node ID 2), Node 3 (i.e., Node ID 3)...Node k (i.e., Node ID k). Node 2 can be selected from the available Node IDs in the current Node ID resource pool. This selected available Node ID, together with the Common prefix and Manager ID mentioned above, forms a Locator, i.e., A0:B0:01:02:: / 64.
[0079] As another embodiment, when the above-mentioned protocol link is a UDP connection. Compared to TCP, UDP does not require the establishment and maintenance of a complex TCP connection between the LocatorManager and the Locator Client, and the Locator Manager will not incur excessive system (e.g., CPU) overhead due to maintaining a large number of TCP connections. When the above-mentioned protocol link is a UDP connection, it cannot simply return a Locator allocation response to achieve Locator allocation as it does with a TCP connection. Optionally, in this embodiment, when the above-mentioned protocol link is a UDP connection, the step 402 above, based on the Locator allocation request, to allocate the corresponding Locator for the AP acting as the LocatorClient, may include:
[0080] Step a1: Return the Locator allocation response to the Locator Client via a UDP connection.
[0081] Here, the Locator allocation response carries at least the Locator allocated to the Locator Client. There are many ways to allocate a Locator to the Locator Client. For example, an available Node ID can be selected from the available Node IDs in the Node ID resource pool, and this selected available Node ID can be combined with the Common prefix and Manager ID mentioned above to form the Locator to be allocated to the Locator Client.
[0082] Optionally, in this embodiment, the Locator allocation response may further carry the IPv6 address and MAC address of the Locator Client, as well as the device ID of the Locator Manager.
[0083] Step a2: Receive the specified Locator allocation request returned by the Locator Client based on the Locator allocation response via a UDP connection.
[0084] Optionally, in this embodiment, the specified Locator allocation request carries at least the Locator carried in the Locator allocation response. The reason for sending the specified Locator allocation request is to confirm whether the Locator carried in the Locator allocation response can be used.
[0085] Optionally, in this embodiment, the specified Locator allocation request may also carry the IPv6 address, MAC address, Locator Client identifier, and Locator Manager device ID of the Locator Client.
[0086] Step a3: Return a Locator allocation confirmation message to the Locator Client via a UDP connection to confirm the allocation of a Locator to the Locator Client.
[0087] Optionally, in this embodiment, the Locator allocation confirmation message is used to confirm that the Locator Client can occupy the Locator carried in the specified Locator allocation request.
[0088] Optionally, in this embodiment, the Locator allocation confirmation message may also carry the IPv6 address and MAC address of the Locator Client, and the device ID of the Locator Manager.
[0089] Thus, by following steps a1 to a3 above, we can determine how to allocate a Locator to the Locator Client when the protocol connection is a UDP connection.
[0090] It should be noted that, in this embodiment, when the above-mentioned protocol connection is a UDP connection, based on the characteristics of UDP connections, after assigning a corresponding Locator to the Locator Client, it is also necessary to manage the Locator Client being assigned a corresponding Locator in a timely manner. The specific management method is implemented through the following steps a4 to a5:
[0091] Step a4: Receive the Locator occupancy request sent by the Locator Client via UDP connection. If the Locator Client is allowed to continue occupying the allocated Locator, return a Locator occupancy confirmation message to the Locator Client via UDP connection to confirm that the Locator Client continues to occupy the allocated Locator.
[0092] In this embodiment, after being assigned a Locator, the Locator Client will send a Locator occupancy request periodically at time T (this Locator occupancy request is similar to the specified Locator allocation request mentioned above). It carries the Locator that the Locator Client has been assigned to, in order to confirm whether it can continue to occupy the Locator.
[0093] When the Locator Manager receives a Locator occupancy request from the Locator Client, it generally allows the Locator Client to continue occupying the assigned Locator. The Locator Manager then sends a Locator occupancy confirmation message to the Locator Client via a UDP connection to confirm the client's continued occupancy of the assigned Locator. However, in some special cases, if the Locator Client is not allowed to continue occupying the assigned Locator, the Locator Manager will release the Locator and trigger the Locator Client to proceed as described above. Figure 4 The process shown re-requests the Locator.
[0094] Step a5: If no Locator occupancy request is received from the Locator Client within the preset time period, the Locator already assigned to the Locator Client is released.
[0095] For example, if the Locator Manager does not receive a Locator occupancy request from the Locator Client within the above 3 periods T, it considers the Locator Client to be offline and will release the Locator that the Locator Client has been assigned (that is, at this time the Node ID in the Locator becomes an available Node ID).
[0096] Thus, steps a4 to a5 have demonstrated how to manage the timely allocation of a corresponding Locator to a Locator Client after assigning it to a Locator Client.
[0097] Optionally, in this embodiment, after the Locator Manager assigns a corresponding Locator to the Locator Client, it records this information in a table. Table 2 illustrates an example of a Locator assignment table entry:
[0098]
[0099]
[0100] Table 2
[0101] Optionally, in this embodiment, the Locator Manager generates Locator routes based on Locator allocation entries. Taking Table 2 as an example, the corresponding Locator routes are shown in Table 3:
[0102]
[0103] Table 3
[0104] In Table 3, Interface VLAN 4092 is the Layer 3 interface on the Locator Manager used for SRv6 service forwarding to the AP. It can be the Layer 3 interface that receives the Locator allocation request. Optionally, when a non-gateway device acts as the Locator Manager, the Locator Manager will distribute the Locator route to the aforementioned gateway device, enabling the gateway device to subsequently forward packets based on the Locator route. The following section provides an example of how packet forwarding is performed.
[0105] The following is an analysis and description of the Local SIDs shown in Table 1 above:
[0106] Optionally, in this embodiment, the Local SID can be generated based on the service Virtual Local Area Network (VLAN) identifier (ID). Under this premise, the Function operation command value (Opcode) in the aforementioned Local SID can be represented by the service VLAN ID. For example, WLAN services corresponding to service VLANs 3502 and 3503 can be issued to the gateway device acting as the Locator Manager. Then, the Local SIDs shown in Table 1 above can be transformed into the following Table 4:
[0107]
[0108] Table 4
[0109] As can be seen from Table 4, in this embodiment, by setting the Function operation command value (Opcode) to the service VLAN ID, the Function operation command value can represent both the service VLAN ID and the corresponding network operation command on the gateway device, which can improve the data plane forwarding matching efficiency.
[0110] It should be noted that the Local SID mentioned above can also be configured via commands. For example, the configuration command corresponding to Table 4 can be:
[0111] Segment routing IPv6
[0112] Locator Leaf1 ipv6-prefix 1A0:B0:01:02::64static 32
[0113] opcode 3502end-dt2u VSI service-vlan-3502
[0114] opcode 3503end-dt2u VSI service-vlan-3503
[0115] Additionally, it should be noted that in this embodiment, after the gateway device decapsulates the IPv6 header of the first packet to obtain the second packet, it can also perform source MAC address learning to generate MAC entries. Table 5 illustrates examples of MAC entries:
[0116] A11B-EBA3-0206 service-vlan-3502 SRv6 tunnel to AP1 9E1A-2BA5-0108 service-vlan-3502 SRv6 tunnel to AP2
[0117] Table 5
[0118] Specifically, in this embodiment, if the second message is an ARP message or an IPv6 ND message, the gateway device will also perform ARP or IPv6 ND learning, and the learned ARP or IPv6 ND entries will include at least:
[0119] MAC address: The MAC address of the AP that sends ARP packets or IPv6 ND packets;
[0120] IP address: The IP address of the AP that sends ARP or IPv6 ND packets.
[0121] Based on the above entries, the following describes the forwarding of the second packet according to the destination IP address in the second packet in step 302:
[0122] Optionally, in this embodiment, forwarding the second packet based on the destination IP address in the second packet in step 302 may include the following steps b1 to b3:
[0123] Step b1: Decapsulate the second message using the Layer 2 header to obtain the fifth message.
[0124] Optionally, in this embodiment, the fifth message obtained after decapsulating the second message with a Layer 2 header is actually a Layer 3 message, which has a destination IP address and a source IP address.
[0125] Step b2: Find the IP routing table entry that matches the destination IP address of the fifth packet in the IP routing forwarding instance routing table associated with the Layer 3 gateway interface.
[0126] Optionally, the found IP routing table entry contains the destination IP address of the fifth packet. The IP routing forwarding instance routing table can be built based on existing route learning methods.
[0127] Step b3: If the outgoing interface of the IP routing table entry is the SRv6 tunnel from the gateway device to the first AP, then forward the sixth packet based on the outgoing interface in the first Locator route that matches the first AP's Locator.
[0128] Here, "first AP" is a general term for any AP; it is a name used for ease of description and is not intended to be limiting.
[0129] Optionally, in this embodiment, the sixth message is obtained by adding at least an IPv6 encapsulation header to the fifth message. For example, a second-level header can be added to the fifth message first, and then an IPv6 encapsulation header can be added to obtain the sixth message.
[0130] Taking the sixth message carrying the newly added Layer 2 header and IPv6 encapsulation header as an example, in one example, the Layer 2 header contains at least the destination MAC address and the source MAC address. The destination MAC address is the MAC address corresponding to the IP address of the first AP, which is found in the ARP or IPv6 ND table entry, and the source MAC address is the MAC address of the gateway device.
[0131] In one example, the destination IPv6 address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the first AP, and the source IPv6 address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device.
[0132] Based on the Local SID described above, in this embodiment, the Function in the destination IPv6 address and the source IPv6 address of the IPv6 encapsulation header carried by the sixth packet contains the same Function operation instruction value, which is the first service VLAN ID. Here, the first service VLAN ID is the service VLAN ID to which the sixth packet belongs, such as service VLAN 3502.
[0133] In addition, in this embodiment, the first Locator route mentioned above can be referred to as the Locator route described above, and will not be repeated here. The outgoing interface in the first Locator route, as described above, is a Layer 3 interface on the gateway device used for forwarding SRv6 services to the first AP.
[0134] Finally, steps b1 to b3 demonstrate how the gateway device forwards packets when it receives them through the SRv6 tunnel.
[0135] The following describes how the fourth packet is forwarded based on its destination IP address in step 303 above:
[0136] Optionally, in this embodiment, forwarding the fourth packet based on the destination IP address of the fourth packet in step 303 above may include the following steps c1 to c3:
[0137] Step c1: Find the IP routing table entry that matches the destination IP address of the fourth packet in the IP routing forwarding instance routing table.
[0138] Step c2: If the outgoing interface of the IP routing table entry is the SRv6 tunnel from the gateway device to the second AP, then search for the second Locator route that matches the second AP's Locator in the obtained Locator routes, and forward the seventh packet through the outgoing interface in the second Locator route.
[0139] Here, "second AP" is used to refer to any AP in general; it is a name given for ease of description and is not intended to be limiting.
[0140] Optionally, in this embodiment, the seventh message is obtained by adding at least an IPv6 encapsulation header to the fourth message. For example, a Layer 2 header can be added to the fourth message first, and then an IPv6 encapsulation header can be added to obtain the seventh message.
[0141] Taking the seventh message carrying the newly added Layer 2 header and IPv6 encapsulation header as an example, in one example, the Layer 2 header contains at least the destination MAC address and the source MAC address. The destination MAC address is the MAC address corresponding to the IP address of the second AP, which is found in the ARP or IPv6 ND table entry, and the source MAC address is the MAC address of the gateway device.
[0142] In one example, the destination IPv6 address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the second AP, and the source IPv6 address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device.
[0143] Based on the Local SID entry described above, in this embodiment, the Function in the destination IPv6 address and the source IPv6 address of the IPv6 encapsulation header carried by the seventh packet contains the same Function operation instruction value, which is the second service VLAN ID. Here, the second service VLAN ID is the service VLAN ID to which the seventh packet belongs, such as service VLAN 3502.
[0144] In addition, in this embodiment, the second Locator route mentioned above can be referred to as the Locator route described above, and will not be repeated here. The outgoing interface in the second Locator route, as described above, is a Layer 3 interface on the gateway device used for forwarding SRv6 services to the second AP.
[0145] Ultimately, steps c1 to c2 demonstrate how the gateway device forwards packets when it receives them from the network side.
[0146] The above describes the method provided in this application embodiment from the perspective of a gateway device in a Layer 3 network. The following describes the method provided in this application embodiment from the perspective of an access point (AP).
[0147] See Figure 6 , Figure 6 This is another method flowchart provided for an embodiment of this application. The method is applied to an Access Point (AP) connected to a gateway device in a Layer 3 network. In this embodiment, the AP automatically creates a Layer 3 interface locally for SRv6 service interaction with the gateway device, such as Interface VLAN 4092. Here, the IPv6 address of the Layer 3 interface can be automatically configured. Furthermore, based on the SRv6 tunnel between the gateway device and the AP as described above, the SRv6 tunnel port on the AP can be bound to the aforementioned Layer 3 interface on the AP.
[0148] like Figure 6 As shown, the process may include the following steps:
[0149] Step 601: When it is necessary to forward a message to the gateway device, execute step 602. When a message is received through the SRv6 tunnel between this AP and the gateway device, execute step 603.
[0150] Step 602: The message carries an IPv6 encapsulation header and is forwarded through an SRv6 tunnel from this AP to the gateway device.
[0151] Step 602 is performed when it is necessary to forward packets to the gateway device.
[0152] Optionally, the destination IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to this AP.
[0153] As an example, in step 602, as described above, the source IP address and destination IP address in the IPv6 encapsulation header can be adaptively determined based on the service VLAN ID to which the packet belongs.
[0154] For example, the destination IP address in the IPv6 encapsulation header may include:
[0155] Locator, set as the Locator assigned to the gateway device;
[0156] The Function is set to the VLAN ID of the service to which the message belongs;
[0157] Args carries application identifiers (including the role type and application type of the business).
[0158] Similarly, the source IP address in the IPv6 encapsulation header may include:
[0159] Locator, set to the Locator assigned to the AP;
[0160] The Function is set to the VLAN ID of the service to which the message belongs.
[0161] That is, in this embodiment, the Function in the destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header is the same, which is the third service VLAN ID; the third service VLAN ID is the service VLAN ID to which the above-mentioned packet belongs.
[0162] Step 603: Decapsulate the received packet using IPv6 and forward the packet according to the destination MAC address of the decapsulated packet.
[0163] Step 603 is performed after a packet has been received through the SRv6 tunnel between this AP and the gateway device. Step 603 is similar to the forwarding process of existing APs and will not be described in detail here.
[0164] This concludes the process. Figure 6 The process is shown below.
[0165] pass Figure 6 The process shown implements the deployment of an SRv6 tunnel between the gateway device and the AP based on the assigned Locator, and performs packet transmission between the gateway device and the AP through the SRv6 tunnel, realizing a packet forwarding method applied to a Layer 3 network with SRv6 deployed.
[0166] The methods provided in the embodiments of this application have been described above. The apparatus provided in the embodiments of this application is described below:
[0167] See Figure 7 , Figure 7 This is a structural diagram of a device provided in an embodiment of this application. The device is applied to a gateway device in the Layer 3 network. An SRv6 tunnel exists between the gateway device and the connected access point (AP). The gateway device and the different APs connected to it are each assigned a different location identifier (Locator). The device includes:
[0168] The message receiving unit is used to receive a first message through the SRv6 tunnel, or to receive a third message from the network side.
[0169] The message processing unit is configured to, when receiving a first message through the SRv6 tunnel, decapsulate the first message by performing IPv6 encapsulation on the first message to obtain a second message, wherein the destination IP address in the IPv6 encapsulation header of the first message includes at least the Locator and Function assigned to the gateway device, and the destination MAC address of the second message is the MAC address of the Layer 3 gateway interface associated with the VSI instance bound to the Function on the gateway device; and forward the second message according to the destination IP address in the second message; and,
[0170] When a third packet is received from the network side, and the destination IPv6 address in the IPv6 encapsulation header of the third packet includes at least the Locator assigned to the gateway device, the third packet is decapsulated in IPv6 to obtain a fourth packet, and the fourth packet is forwarded according to the destination IP address of the fourth packet.
[0171] Optionally, when the gateway device acts as a Locator management device Manager, the apparatus further includes:
[0172] The allocation unit is used to receive a Locator allocation request sent by the AP; and to allocate a corresponding Locator to the AP based on the Locator allocation request.
[0173] Optionally, a User Datagram Protocol (UDP) connection for Locator allocation is established between the gateway device and the AP; the Locator allocation request is received through the UDP connection.
[0174] The allocation unit allocates a corresponding Locator to the AP based on the Locator allocation request, including:
[0175] The UDP connection is used to return a Locator allocation response to the AP, and the Locator allocation response carries at least the Locator allocated to the AP;
[0176] The specified Locator allocation request is received by the AP through the UDP connection based on the Locator allocation response; the specified Locator allocation request carries at least the Locator carried in the Locator allocation response.
[0177] The UDP connection is used to return a Locator allocation confirmation message to the AP to confirm the allocation of the Locator to the AP.
[0178] Optionally, after allocating a corresponding Locator to the AP, if the allocation unit receives a Locator occupancy request from the AP via the UDP connection, it allows the AP to continue occupying the allocated Locator and returns a Locator occupancy confirmation message to the AP via the UDP connection to confirm that the AP continues to occupy the allocated Locator; the Locator occupancy request is used to instruct the AP to continue occupying the allocated Locator; or,
[0179] If no Locator occupancy request is received from the AP within a preset time period, the Locator already allocated to the AP is released.
[0180] Optionally, after allocating a locator for the downstream AP, the allocation unit further generates a locator route pointing to the AP; the next hop of the locator route is the IPv6 address of the interface connecting the gateway device on the AP, and the outgoing interface is the Layer 3 interface on the gateway device used for forwarding SRv6 services to the AP.
[0181] Optionally, the message processing unit forwards the second message based on the destination IP address in the second message, including:
[0182] The second message is decapsulated using a Layer 2 header to obtain the fifth message;
[0183] The IP routing table entry matching the destination IP address of the fifth packet is found in the IP routing table associated with the Layer 3 gateway interface;
[0184] If the outgoing interface of the IP routing table entry is the SRv6 tunnel from the gateway device to the first AP, then the sixth packet is forwarded based on the outgoing interface in the first Locator route that matches the first AP's Locator; the outgoing interface in the first Locator route is the Layer 3 interface on the gateway device used for forwarding SRv6 services to the first AP.
[0185] The sixth message is obtained by adding at least an IPv6 encapsulation header to the fifth message; the destination IPv6 address in the IPv6 encapsulation header of the sixth message includes at least the Locator and Function assigned to the first AP, and the source IPv6 address in the IPv6 encapsulation header of the sixth message includes at least the Locator and Function assigned to the gateway device.
[0186] Optionally, the Function includes at least: a Function type and a Function operation instruction value;
[0187] The sixth message carries an IPv6 encapsulation header in which the destination IPv6 address and the source IPv6 address contain the same Function operation instruction value, which is the first service VLAN ID.
[0188] The first service VLAN ID is the service VLAN ID to which the sixth message belongs.
[0189] Optionally, the message processing unit forwards the fourth message based on the destination IP address of the fourth message, including:
[0190] The IP routing table entry matching the destination IP address of the fourth packet is found in the IP routing forwarding instance routing table;
[0191] If the outgoing interface of the IP routing table entry is an SRv6 tunnel from the gateway device to the second AP, then the second Locator route matching the second AP's Locator is searched in the obtained Locator routes, and the seventh packet is forwarded through the outgoing interface in the second Locator route; the outgoing interface in the second Locator route is a Layer 3 interface on the gateway device used 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; the destination IPv6 address in the IPv6 encapsulation header carried by the seventh packet includes at least the Locator and Function assigned to the second AP, and the source IPv6 address in the IPv6 encapsulation header carried by the seventh packet includes at least the Locator and Function assigned to the gateway device.
[0192] Optionally, the Function includes at least: a Function type and a Function operation instruction value;
[0193] The destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header carried by the seventh message contain the same Function operation instruction value, which is the second service VLAN ID;
[0194] The second service VLAN ID is the service VLAN ID to which the seventh message belongs.
[0195] Optionally, the device further includes:
[0196] Table Item Learning Unit ( Figure 7 (Not shown), used to determine a Function matching the IP address of a terminal connected to any AP when the IP address of such a terminal is learned, and to report the Function and the terminal IP address to the network side, so that the destination IPv6 address in the IPv6 encapsulation header of packets sent from the network side to the terminal at least contains the Function; wherein, the Function is used to instruct IPv6 decapsulation and to look up the IP routing instance routing table matching the terminal IP address for forwarding packets to the terminal; wherein, when the terminal IP address is IPv4, the IP routing instance routing table is an IPv4 VPN routing table; when the terminal IP address is IPv6, the IP routing instance routing table is an IPv6 VPN routing table; and / or,
[0197] When there is no MAC entry in the local MAC table 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 includes at least: the source MAC address of the second packet, the VSI instance, and the outgoing interface information, wherein the VSI instance corresponds to the service VLAN ID to which the second packet belongs.
[0198] This concludes the process. Figure 7 Structural description of the device shown.
[0199] See Figure 8 , Figure 8 This is another device structure diagram provided in an embodiment of this application. The device is applied to an access point (AP) device connected to a gateway device in the Layer 3 network. An SRv6 tunnel exists between the gateway device and the AP. The AP, the gateway device, and other APs connected to the gateway device are all assigned different location identifiers (Locators). The device includes:
[0200] The receiving unit is configured to receive messages through an SRv6 tunnel between this AP and the gateway device;
[0201] A forwarding unit, configured to, when it is necessary to forward a packet to the gateway device, carry an IPv6 encapsulation header in the packet and forward it through an SRv6 tunnel from this AP to the gateway device; the destination IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to this AP; and,
[0202] When receiving packets through the SRv6 tunnel between this AP and the gateway device, the received packets are decapsulated using IPv6 and forwarded according to the destination MAC address of the decapsulated packets.
[0203] Optionally, the destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header have the same Function, which is the third service VLAN ID;
[0204] The third service VLAN ID is the service VLAN ID to which the message to be forwarded to the gateway device belongs.
[0205] This concludes the process. Figure 8 Structural description of the device shown.
[0206] This application also provides embodiments that... Figure 7 or Figure 8 The hardware structure of the device shown. See also Figure 9 , Figure 9 This is a structural diagram of an electronic device provided in an embodiment of this application. Figure 9 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement any of the methods disclosed in the above examples of this application.
[0207] Based on the same application concept as the above method, this application embodiment also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.
[0208] For example, the aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For instance, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0209] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0210] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0211] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0212] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0213] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium 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 storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0214] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0215] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A message forwarding method, characterized in that, This method is applied to gateway devices in a Layer 3 network. An SRv6 tunnel exists between the gateway device and the connected access point (AP) devices. The gateway device and the different APs connected to it are assigned different location identifiers (Locators). When the gateway device acts as a Locator Manager, the AP's Locator is assigned by the gateway device through the following steps: receiving a Locator assignment request from the AP; and assigning a corresponding Locator to the AP based on the Locator assignment request. The method includes: When a first packet is received through the SRv6 tunnel, the destination IP address in the IPv6 encapsulation header of the first packet includes at least the Locator and Function assigned to the gateway device. The IPv6 encapsulation header of the first packet is decapsulated to obtain a second packet. 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 Function on the gateway device. The second packet is forwarded according to the destination IP address of the second packet. When a third packet is received from the network side, and the destination IPv6 address in the IPv6 encapsulation header of the third packet includes at least the Locator assigned to the gateway device, the third packet is decapsulated in IPv6 to obtain a fourth packet, and the fourth packet is forwarded according to the destination IP address of the fourth packet.
2. The method according to claim 1, characterized in that, The gateway device establishes a User Datagram Protocol (UDP) connection with the AP for Locator allocation; the Locator allocation request is received through the UDP connection. The process of allocating a corresponding Locator to the AP based on the Locator allocation request includes: The UDP connection is used to return a Locator allocation response to the AP, and the Locator allocation response carries at least the Locator allocated to the AP; The specified Locator allocation request is received by the AP through the UDP connection based on the Locator allocation response; the specified Locator allocation request carries at least the Locator carried in the Locator allocation response. The UDP connection is used to return a Locator allocation confirmation message to the AP to confirm the allocation of the Locator to the AP.
3. The method according to claim 2, characterized in that, After assigning a corresponding Locator to the AP, the method further includes: When a Locator occupancy request is received from the AP via the UDP connection, if the AP is allowed to continue occupying the already allocated Locator, a Locator occupancy confirmation message is returned to the AP via the UDP connection to confirm that the AP continues to occupy the already allocated Locator; the Locator occupancy request is used by the AP to request whether to continue occupying the already allocated Locator. If no Locator occupancy request is received from the AP within a preset time period, the Locator already allocated to the AP will be released.
4. The method according to claim 1, characterized in that, The method further includes: The gateway device acts as the Locator Management device (Manager). After assigning a locator to the downstream AP, it generates a Locator route pointing to that AP. The next hop of the Locator route is the IPv6 address of the interface on the AP that connects to the gateway device, and the outgoing interface is the Layer 3 interface on the gateway device used for forwarding SRv6 services to the AP.
5. The method according to claim 1 or 4, characterized in that, The forwarding of the second packet based on the destination IP address in the second packet includes: The second message is decapsulated using a Layer 2 header to obtain the fifth message; The IP routing table entry matching the destination IP address of the fifth packet is found in the IP routing table associated with the Layer 3 gateway interface; If the outgoing interface of the IP routing table entry is the SRv6 tunnel from the gateway device to the first AP, then the sixth packet is forwarded based on the outgoing interface in the first Locator route that matches the first AP's Locator; the outgoing interface in the first Locator route is the Layer 3 interface on the gateway device used for forwarding SRv6 services to the first AP. The sixth message is obtained by adding at least an IPv6 encapsulation header to the fifth message; the destination IPv6 address in the IPv6 encapsulation header of the sixth message includes at least the Locator and Function assigned to the first AP, and the source IPv6 address in the IPv6 encapsulation header of the sixth message includes at least the Locator and Function assigned to the gateway device.
6. The method according to claim 5, characterized in that, The Function includes at least: a Function type and a Function operation instruction value; The sixth message carries an IPv6 encapsulation header in which the destination IPv6 address and the source IPv6 address contain the same Function operation instruction value, which is the first service VLAN ID. The first service VLAN ID is the service VLAN ID to which the sixth message belongs.
7. The method according to claim 1 or 4, characterized in that, The forwarding of the fourth message based on the destination IP address of the fourth message includes: The IP routing table entry matching the destination IP address of the fourth packet is found in the IP routing forwarding instance routing table; If the outgoing interface of the IP routing table entry is an SRv6 tunnel from the gateway device to the second AP, then the second Locator route matching the second AP's Locator is searched in the obtained Locator routes, and the seventh packet is forwarded through the outgoing interface in the second Locator route; the outgoing interface in the second Locator route is a Layer 3 interface on the gateway device used 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; the destination IPv6 address in the IPv6 encapsulation header carried by the seventh packet includes at least the Locator and Function assigned to the second AP, and the source IPv6 address in the IPv6 encapsulation header carried by the seventh packet includes at least the Locator and Function assigned to the gateway device.
8. The method according to claim 7, characterized in that, The Function includes at least: a Function type and a Function operation instruction value; The destination IPv6 address and source IPv6 address in the IPv6 encapsulation header carried by the seventh message contain the same Function operation instruction value, which is the second service VLAN ID; The second service VLAN ID is the service VLAN ID to which the seventh message belongs.
9. The method according to claim 7, characterized in that, The method further includes: When the IP address of a terminal connected to any AP is learned, a Function that matches the terminal's IP address is determined, and the Function and the terminal's IP address are reported to the network side so that the destination IPv6 address in the IPv6 encapsulation header of the message sent from the network side to the terminal at least contains the Function. The Function matching the terminal IP address is used to instruct IPv6 decapsulation and to look up the IP routing instance routing table matching the terminal IP address for forwarding packets to the terminal; wherein, when the terminal IP address is IPv4, the IP routing instance routing table is an IPv4 VPN routing table; when the terminal IP address is IPv6, the IP routing instance routing table is an IPv6 VPN routing table.
10. The method according to claim 1, characterized in that, The method further includes: When there is no MAC entry in the local MAC table 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 includes at least: the source MAC address of the second packet, the VSI instance, and the outgoing interface information, wherein the VSI instance corresponds to the service VLAN ID to which the second packet belongs.
11. A message forwarding method, characterized in that, This method is applied to access point devices (APs) connected to a gateway device in a Layer 3 network. An SRv6 tunnel exists between the gateway device and the AP. The AP, the gateway device, and other APs connected to the gateway device are all assigned different location identifiers (Locators). Wherein, if the gateway device acts as a Locator Management Device (Manager), the AP's Locator is assigned by the gateway device through the following steps: receiving a Locator assignment request from the AP; and assigning a corresponding Locator to the AP based on the Locator assignment request. The method includes: When it is necessary to forward a message to the gateway device, the message carries an IPv6 encapsulation header and is forwarded through an SRv6 tunnel from this AP to the gateway device; the destination IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to this AP. When receiving packets through the SRv6 tunnel between this AP and the gateway device, the received packets are decapsulated using IPv6 and forwarded according to the destination MAC address of the decapsulated packets.
12. The method according to claim 11, characterized in that, The destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header have the same Function, which is the third service VLAN ID. The third service VLAN ID is the service VLAN ID to which the message to be forwarded to the gateway device belongs.
13. A message forwarding device, characterized in that, This device is applied to a gateway device in a Layer 3 network. An SRv6 tunnel exists between the gateway device and the connected access point (AP) devices. The gateway device and different APs connected to it are assigned different location identifiers (Locators). When the gateway device acts as a Locator Manager, the Locator for each AP is assigned by the gateway device through the following steps: receiving a Locator assignment request from an AP; and assigning a corresponding Locator to the AP based on the Locator assignment request. The device includes: The message receiving unit is used to receive a first message through the SRv6 tunnel, or to receive a third message from the network side. The message processing unit is configured to, upon receiving a first message through the SRv6 tunnel, wherein the destination IP address in the IPv6 encapsulation header of the first message includes at least the Locator and Function assigned to the gateway device, decapsulate the IPv6 encapsulation header of the first message to obtain a second message, wherein the destination MAC address of the second message is the MAC address of the Layer 3 gateway interface associated with the VSI instance bound to the Function on the gateway device, and forward the second message according to the destination IP address in the second message; and, When a third packet is received from the network side, and the destination IPv6 address in the IPv6 encapsulation header of the third packet includes at least the Locator assigned to the gateway device, the third packet is decapsulated in IPv6 to obtain a fourth packet, and the fourth packet is forwarded according to the destination IP address of the fourth packet.
14. A message forwarding device, characterized in that, This device is applied to access point devices (APs) connected to a gateway device in a Layer 3 network. An SRv6 tunnel exists between the gateway device and the AP. Each AP, the gateway device, and other APs connected to the gateway device are assigned a different location identifier (Locator). When the gateway device acts as a Locator Manager, the AP's Locator is assigned by the gateway device through the following steps: receiving a Locator assignment request from the AP; and assigning a corresponding Locator to the AP based on the Locator assignment request. The device includes: The receiving unit is configured to receive messages through an SRv6 tunnel between this AP and the gateway device; A forwarding unit, configured to, when it is necessary to forward a packet to the gateway device, carry an IPv6 encapsulation header in the packet and forward it through an SRv6 tunnel from this AP to the gateway device; the destination IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header includes at least the Locator and Function assigned to this AP; and, When receiving packets through the SRv6 tunnel between this AP and the gateway device, the received packets are decapsulated using IPv6 and forwarded according to the destination MAC address of the decapsulated packets.
Citation Information
Patent Citations
Message forwarding method and device
CN113207192A
Message forwarding method and device
CN113301667A