WO2023184220A1 - 报文转发方法及装置 - Google Patents

报文转发方法及装置 Download PDF

Info

Publication number
WO2023184220A1
WO2023184220A1 PCT/CN2022/084010 CN2022084010W WO2023184220A1 WO 2023184220 A1 WO2023184220 A1 WO 2023184220A1 CN 2022084010 W CN2022084010 W CN 2022084010W WO 2023184220 A1 WO2023184220 A1 WO 2023184220A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
locator
gateway device
address
ipv6
Prior art date
Application number
PCT/CN2022/084010
Other languages
English (en)
French (fr)
Inventor
叶金荣
Original Assignee
新华三技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 新华三技术有限公司 filed Critical 新华三技术有限公司
Priority to PCT/CN2022/084010 priority Critical patent/WO2023184220A1/zh
Priority to CN202280000652.8A priority patent/CN116965146A/zh
Publication of WO2023184220A1 publication Critical patent/WO2023184220A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/12Setup of transport tunnels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming

Definitions

  • This application relates to network communication technology, and in particular to message forwarding methods and devices.
  • IPv6 segment routing (SRv6: Segment Routing IPv6) is based on the IPv6 forwarding plane to implement segment routing (SR: Segment Routing).
  • segment routing identifier (SID: Segment Identifier) takes the form of an IPv6 address, but it does not correspond to the interface address on any device.
  • SID at least includes location identifier (Locator), function (Function), and parameters (Arguments).
  • Locator is unique within the SR domain. In specific applications, Locator can include common prefix (common prefix) and network node identification (Node ID).
  • Function Used to identify the operation instruction bound to the SID. In the SR domain, when a node receives a message, it will perform relevant operations based on the Function in the SID carried in the message. In a specific application, Function may include: operation instruction type and operation instruction value used to represent the operation instruction.
  • the embodiments of this application provide a message forwarding method and device to implement message forwarding in a three-layer network where SRv6 is deployed.
  • the embodiment of the present application provides a message forwarding method, which is applied to the gateway device in the three-layer network.
  • the gateway device , and different APs connected to the gateway device are all assigned different location identifiers Locator; the method includes:
  • the destination IP address in the IPv6 encapsulation header carried by the first message at least includes the Locator and Function assigned by the gateway device.
  • the first message Decapsulate the IPv6 encapsulation header to obtain a second message.
  • the destination MAC address of the second message is the Layer 3 gateway interface MAC address associated with the VSI instance bound to the Function on the gateway device. According to the forward the second message to the destination IP address in the second message;
  • the destination IPv6 address in the IPv6 encapsulation header carried by the third message at least includes the Locator assigned by the gateway device, and IPv6 decapsulation is performed on the third message. , obtain the fourth message, and forward the fourth message according to the destination IP address of the fourth message.
  • the embodiment of the present application also provides another message forwarding method, which method is applied to the access point device AP connected to the gateway device in the three-layer network, and there is an SRv6 tunnel 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 Locator; the method includes:
  • the packet When a packet needs to be forwarded to the gateway device, the packet carries an IPv6 encapsulation header and is forwarded through the SRv6 tunnel from the AP to the gateway device; the destination IP address in the IPv6 encapsulation header at least includes the The Locator and Function assigned to the gateway device, and the source IP address in the IPv6 encapsulation header at least includes the Locator and Function assigned to the AP;
  • the received message is decapsulated by IPv6 and forwarded according to the destination MAC address of the decapsulated message.
  • Embodiments of the present application provide a message forwarding device, which is applied to a gateway device in the three-layer network. There is an SRv6 tunnel between the gateway device and the downstream access point device AP.
  • the gateway device , and different APs connected to the gateway device are all assigned different location identifiers Locator; the device includes:
  • a message receiving unit configured to receive the first message through the SRv6 tunnel, or receive the third message from the network side;
  • a message processing unit configured to receive a first message through the SRv6 tunnel, and the destination IP address in the IPv6 encapsulation header carried by the first message at least includes the Locator and Function assigned by the gateway device, Decapsulate the IPv6 encapsulation header of the first message to obtain a second message.
  • the destination MAC address of the second message is the Layer 3 associated with the VSI instance bound to the Function on the gateway device.
  • the gateway interface MAC address forwards the second message according to the destination IP address in the second message; and,
  • the destination IPv6 address in the IPv6 encapsulation header carried by the third message at least includes the Locator assigned by the gateway device, and IPv6 decapsulation is performed on the third message. , obtain the fourth message, and forward the fourth message according to the destination IP address of the fourth message.
  • the embodiment of the present application also provides a message forwarding device, which is applied to the access point device AP connected to the gateway device in the three-layer network.
  • a message forwarding device which is applied to the access point device AP connected to the gateway device in the three-layer network.
  • a receiving unit configured to receive messages through the SRv6 tunnel between the AP and the gateway device;
  • a forwarding unit used to forward a message to the gateway device when the message needs to carry an IPv6 encapsulation header and forward it through the SRv6 tunnel from the AP to the gateway device; the purpose in the IPv6 encapsulation header
  • the IP address at least includes the Locator and Function assigned by the gateway device, and the source IP address in the IPv6 encapsulation header at least includes the Locator and Function assigned by the AP;
  • the received message is decapsulated by IPv6 and forwarded according to the destination MAC address of the decapsulated message.
  • An embodiment of the present application also provides a network device, which includes: a processor and a machine-readable storage medium;
  • a machine-readable storage medium stores machine-executable instructions capable of being executed by the processor
  • the processor is configured to execute machine-executable instructions to implement any of the above methods.
  • an SRv6 tunnel is deployed between the gateway device and the AP based on the assigned locator between the gateway device and the AP, and packets are transmitted between the gateway device and the AP through the SRv6 tunnel, thereby realizing application deployment. Packet forwarding method in SRv6 Layer 3 network.
  • FIG. 1 is a schematic diagram of the SID structure provided by the embodiment of the present application.
  • Figure 2 is a schematic diagram of a campus network deploying SRv6 provided by the embodiment of this application;
  • Figure 3 is a method flow chart provided by an embodiment of the present application.
  • Figure 4 is a Locator allocation flow chart provided by the embodiment of this application.
  • Figure 5 is a schematic structural diagram of the Locator provided by the embodiment of the present application.
  • Figure 6 is another method flow chart provided by an embodiment of the present application.
  • Figure 7 is a device structure diagram provided by an embodiment of the present application.
  • Figure 8 is another device structure diagram provided by an embodiment of the present application.
  • Figure 9 is a structural diagram of an electronic device provided by an embodiment of the present application.
  • SRv6 provides a flexible and efficient traffic control method for the network, which can better realize traffic scheduling and path optimization, ensure the quality of key services, balance quality distribution, and improve dedicated line utilization.
  • SRv6 can be deployed on three-layer networks such as campus networks.
  • Figure 2 shows an example of a campus network where SRv6 is deployed.
  • the bold black line shows the SRv6 path.
  • traffic monitoring and control will be implemented based on SRv6 between the gateway device (which can be a Leaf node in a spine-leaf topology) and the wireless access point (AP: Access Point). Scheduling etc.
  • embodiments of the present application provide a packet forwarding method applied in a three-layer network where SRv6 is deployed.
  • FIG. 3 is a flow chart of a method provided by an embodiment of the present application. This method is applied to gateway devices in three-layer networks.
  • the gateway device when applied to a Spine-Leaf network topology, the gateway device here can be a Leaf node.
  • the gateway device and different APs connected to the gateway device are assigned different Locators.
  • a network device can be designated as a Locator management device (Manger), and the Locator Manger can allocate different Locators to the gateway device and each AP connected to the gateway device.
  • Locator management device Manger
  • the gateway device is designated as a Locator Manger
  • the gateway device as the Locator Manger will allocate 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 (Client)).
  • Figure 4 illustrates as an example how to allocate different Locators to this gateway device and each AP connected to the gateway device when the gateway device is a Locator Manger. I won’t go into details here.
  • Locator Manger For another example, specify a non-gateway device such as an access controller (AC: Access Controller) as a Locator Manger.
  • the Locator Manger can be a gateway device or different APs connected to the gateway device (in this case, the gateway device and the different APs connected to the gateway device are Can be called Locator Client) to allocate different Locators.
  • the gateway device and the different APs connected to the gateway device are Can be called Locator Client to allocate different Locators.
  • Locator Client the specific allocation method, it is similar to the allocation shown in Figure 4 and will not be described again here.
  • the gateway device and the AP will establish an SRv6 tunnel between the gateway device and the AP based on the assigned Locator (the SRv6 tunnel here may be, for example, SRv6PW, etc., which is not specifically limited in this embodiment).
  • the SRv6 tunnel here can be established dynamically or statically configured, which is not specifically limited in this embodiment.
  • the process may include the following steps:
  • Step 301 When the first message is received through the SRv6 tunnel, and the destination IP address in the IPv6 encapsulation header carried by the first message at least includes the Locator and Function assigned by the gateway device, step 302 is executed.
  • step 303 When the first message is received from the network side, The third message, and the destination IPv6 address in the IPv6 encapsulation header carried by the third message at least includes the Locator assigned by the gateway device, then step 303 is performed.
  • the first message and the third message are only named for convenience of description and are not used for limitation.
  • the gateway device when the first packet is received through the SRv6 tunnel, it means that the gateway device receives the first packet forwarded by the AP through the SRv6 tunnel.
  • the gateway device receives the first packet forwarded by the AP through the SRv6 tunnel, the following step 302 is performed.
  • Step 302 Decapsulate the IPv6 encapsulation header of the first message to obtain a second message.
  • the destination MAC address of the second message is the Layer 3 gateway interface MAC address associated with the VSI instance bound to the Function on the gateway device. Forward the second message according to the destination IP address in the second message.
  • This step 302 is performed on the premise that the gateway device receives the first message through the SRv6 tunnel.
  • the Local SID corresponding to the gateway device can be determined based on the Locator and Function (including the operation command value (Opcode) and Function type) assigned to the gateway device, and the Function in each Local SID is different.
  • Table 1 shows an example of the two Local SIDs corresponding to the gateway device (an example of Local SID will be described below):
  • end-dt2u is used to indicate decapsulation and when the decapsulated destination MAC address is the Layer 3 gateway interface MAC address associated with the VSI instance bound to Function on the gateway device, it is based on the destination IP in the message. address for packet forwarding.
  • the corresponding FIB6 entry can be added to the FIB6 (IPv6 Forwarding Information Base) table.
  • the FIB6 table entry at least contains its corresponding Local SID; based on this, as in step 302, when the gateway device receives the first message through the SRv6 tunnel, the gateway device will search the FIB6 table based on the destination IP address carried in the first message. If When the corresponding FIB6 entry is found, the IPv6 encapsulation header of the first message is decapsulated according to the instructions of end-dt2u in the Local SID in the FIB6 entry to obtain the second message.
  • the second message is forwarded based on the destination IP address in the second message.
  • An example will be given below to describe how to forward the second message based on the destination IP address in the second message, which will not be described again here.
  • Step 303 Perform IPv6 decapsulation on the third message to obtain a fourth message, and forward the fourth message according to the destination IP address of the fourth message.
  • This step 303 is executed on the premise of receiving the third message from the network side.
  • the gateway device When the gateway device receives the third message, it will perform corresponding operations based on the Function contained in the destination IPv6 address in the IPv6 encapsulation header carried by the message. If the Function instructs IPv6 decapsulation and search for the corresponding IP routing forwarding instance routing table, then this step 303 is applied. It will perform IPv6 decapsulation on the third message and obtain the fourth message. According to the fourth message The destination IP address finds the corresponding IP routing and forwarding instance routing table entry in the above-mentioned IP routing and forwarding instance routing table, and forwards the message based on the IP routing and forwarding instance routing table entry. The details of this message forwarding can be seen in the example description below, here No further details for now.
  • the gateway device In order to ensure that the gateway device performs corresponding operations based on the Function contained in the destination IPv6 address in the IPv6 encapsulation header carried by the message, optionally, in this embodiment, when the gateway device learns the IP of the terminal connected to any AP address, determine the Function that matches the terminal IP address, and report the Function and the terminal IP address to the network side, so that the destination IPv6 address in the IPv6 encapsulation header carried by subsequent messages sent from the network side to the terminal contains at least The above Function.
  • Function is used to instruct IPv6 decapsulation and find the IP routing forwarding instance routing table that matches the terminal IP address.
  • the terminal IP address is IPv4VPN routing table
  • the IP route forwarding instance routing table is an IPv6VPN routing table.
  • this embodiment realizes the automation of deploying SRv6 in the three-layer network by automatically allocating different locators to the gateway device and different APs connected to the gateway device, so as to fully deploy the SRv6 in the three-layer network. Take advantage of what SRv6 brings.
  • an SRv6 tunnel is deployed between the gateway device and the AP based on the assigned locator between the gateway device and the AP, and packets are transmitted between the gateway device and the AP through the SRv6 tunnel, thereby realizing application deployment. Packet forwarding method in SRv6 Layer 3 network.
  • FIG 4 is a flow chart of Locator allocation provided by an embodiment of the present application.
  • Locator Manger allocates different Locators to the gateway device and each AP connected to the gateway device.
  • Locator Manager manages the Locator resource pool (the Locator resource pool contains several Locators).
  • the Locator in this embodiment can be: Common prefix+Manager ID+Node ID, as shown in Figure 5. The reason why the locator is set up 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 repeated, and to ensure the uniqueness of each locator in the entire network.
  • the value and length of Common prefix can be specified in advance, such as: A0:B0::/40 (the value of Common prefix is A0:B0::, and the length is 40 bits).
  • the value and length of Manger ID can be specified in advance, for example: the value of Manger ID is 1 and the length is 8 bits.
  • Node ID can not be specified in advance, but selected from the Node ID resource pool.
  • Node 0 that is, Node ID is 0
  • A0:B0:01:00::/64 can be reserved and not pre-allocated.
  • the gateway device can serve as a Locator Manger.
  • the gateway device can first select a non-zero and smallest Node ID from the Node ID resource pool. Taking the selected Node ID as 1 as an example, combined with the above Common prefix and Manger ID, in this embodiment, when the gateway device serves as the Locator Manager, the Locator assigned to itself can be A0:B0:01:01::/64 .
  • the gateway device serves as the Locator Manager and allocates Locators to each AP as the Locator Client according to the process shown in Figure 4.
  • the Locator Manager will allocate Locators to the gateway device as the Locator Client and to each AP connected to the gateway device according to the process shown in Figure 4.
  • the process may include the following steps:
  • Step 401 Receive the Locator allocation request sent by the Locator Client.
  • the Locator Client when the Locator Client comes online (for example, after it goes online and is assigned an IPv6 address, etc.), it, as the Locator Client, will send a Locator allocation request to the Locator Manager.
  • the Locator allocation request can carry at least the IPv6 address, MAC address, and Locator Client identification of the Locator Client.
  • Step 402 Based on the Locator allocation request, allocate the corresponding Locator to the Locator Client.
  • a protocol connection for Locator allocation exists between the Locator Manager and the Locator Client.
  • the protocol connection may be a TCP connection or a UDP connection.
  • the above protocol link is a TCP connection
  • an available Node ID from the available Node IDs in the Node ID resource pool there are many ways to select an available Node ID from the available Node IDs in the Node ID resource pool. For example, directly select the smallest Node ID from the available Node IDs in the Node ID resource pool in order. Take the example of selecting the smallest Node ID directly from the available Node IDs in the Node ID resource pool in order. If Node1 has been selected before (that is, the Node ID is 1), combined with the above Node 0 reservation, as of the current Node ID resource pool The available Node IDs 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
  • the above protocol link is a UDP connection.
  • UDP does not require the establishment and maintenance of more complex TCP connections between Locator Manager and Locator Client, and Locator Manager will not cause excessive system (such as CPU, etc.) overhead by maintaining a large number of TCP connections.
  • the above protocol link is a UDP connection, it will not simply return a Locator allocation response to achieve Locator allocation like a TCP connection.
  • allocating the corresponding Locator to the AP as the Locator Client may include:
  • Step a1 return the Locator allocation response to the Locator Client through the UDP connection.
  • the Locator allocation response carries at least: the Locator allocated for the Locator Client.
  • Locator there are many ways to allocate Locator to Locator Client. For example, you can select an available Node ID from the available Node IDs in the Node ID resource pool, and combine the selected available Node ID with the above-mentioned Common prefix and Manger ID to form a waiting list.
  • the Locator assigned to the Locator Client is not limited to the Locator allocated for the Locator Client.
  • the Locator allocation response may further carry the IPv6 address, MAC address of the Locator Client, and the device ID of the Locator Manager.
  • Step a2 Receive the specified Locator allocation request returned by the Locator Client based on the Locator allocation response through the UDP connection.
  • the specified Locator allocation request carries at least the Locator carried in the Locator allocation response.
  • the reason why the specified Locator allocation request is sent here is to confirm whether the Locator carried in the Locator allocation response can be occupied.
  • the specified Locator allocation request may also carry the IPv6 address of the Locator Client, the MAC address, the Locator Client identification, and the device ID of the Locator Manager.
  • Step a3 return the Locator allocation confirmation message to the Locator Client through the UDP connection to confirm that the Locator is allocated to the Locator Client.
  • the Locator allocation confirmation message is used to confirm that the Locator Client can occupy the Locator carried in the specified Locator allocation request.
  • the Locator allocation confirmation message may also carry the IPv6 address, MAC address of the Locator Client, and the device ID of the Locator Manager.
  • Step a4 receive the Locator occupation request sent by the Locator Client through the UDP connection. If the Locator Client is allowed to continue to occupy the allocated Locator, return the Locator occupation confirmation message to the Locator Client through the UDP connection to confirm that the Locator Client continues to occupy the allocated Locator. Locator.
  • the Locator Client After the Locator Client is assigned a Locator, it will send a Locator occupancy request at period T (the Locator occupancy request is similar to the specified Locator allocation request mentioned above), which carries the Locator to which the Locator Client has been allocated to confirm whether it is available. Continue to occupy this Locator.
  • the Locator Manager After receiving the Locator occupation request sent by the Locator Client, the Locator Manager will generally allow the Locator Client to continue to occupy the allocated Locator, and will return a Locator occupation confirmation message to the Locator Client through the UDP connection to confirm that the Locator Client continues to occupy the allocated Locator. Locator. Of course, in some special cases, if the Locator Client is not allowed to continue to occupy the allocated Locator, the Locator will be released and the Locator Client will be triggered to re-request the Locator according to the process shown in Figure 4 above.
  • Step a5 if the Locator occupation request sent by the Locator Client is not received within the preset time period, the Locator allocated by the Locator Client is released.
  • the Locator Manager does not receive the Locator occupation request sent by the Locator Client within the above three periods T, it will consider that the Locator Client is offline and will release the Locator that the Locator Client has allocated (that is, the Node ID in the Locator at this time becomes available Node ID).
  • Table 2 shows an example of the Locator allocation table entry:
  • the Locator Manager generates a Locator route based on the Locator allocation table entry. Still taking Table 2 as an example, the corresponding Locator route is shown in Table 3:
  • Interface VLAN 4092 is the Layer 3 interface used on the Locator Manager to forward SRv6 services to the AP. It can be the Layer 3 interface above that receives the Locator allocation request.
  • the Locator Manager will deliver the Locator route to the above-mentioned gateway device, so that the gateway device can subsequently forward packets based on the Locator route. The following examples describe how to forward packets.
  • the Local SID can be generated based on the service virtual local area network (VLAN: Virtual Local Area Network) identification (ID).
  • VLAN Virtual Local Area Network
  • the Function operation command value (Opcode) in the above Local SID can be characterized by the service VLAN ID.
  • WLAN services corresponding to business VLANs 3502 and 3503 can be delivered to the gateway device as the Locator Manager.
  • the Local SID shown in Table 1 above can be transformed into the following Table 4:
  • the Function operation instruction value (Opcode) as the service VLAN ID
  • the Function operation instruction value represents the service VLAN ID on the one hand
  • the corresponding VLAN ID on the gateway device on the other hand.
  • Network operation instructions which can improve data plane forwarding and matching efficiency.
  • the above Local SID can also be implemented through configuration commands.
  • the configuration command corresponding to Table 4 can be:
  • the gateway device after the gateway device decapsulates the IPv6 header of the first message to obtain the second message, it can also perform source MAC learning to generate a MAC table entry.
  • Table 5 shows an example. MAC table entry:
  • the gateway device will also perform ARP or IPv6 ND learning.
  • the learned ARP or IPv6 ND table entries at least include:
  • MAC address MAC address of the AP that sends ARP messages or IPv6 ND messages
  • IP address The IP address of the AP that sends ARP messages or IPv6 ND messages.
  • forwarding the second message according to the destination IP address in the second message in step 302 may include the following steps b1 to b3:
  • Step b1 Decapsulate the Layer 2 header of the second message to obtain the fifth message.
  • the fifth message obtained after decapsulating the Layer 2 header of the second message is essentially a Layer 3 message, which has a destination IP address and a source IP address.
  • Step b2 Find the IP routing table entry that matches the destination IP address of the fifth message in the routing table of the IP routing forwarding instance associated with the Layer 3 gateway interface.
  • the found IP routing table entry includes the destination IP address of the fifth message.
  • the IP route forwarding instance routing table can be established based on the existing route learning method.
  • Step b3 if the outbound interface of the IP routing table entry is the SRv6 tunnel port from the gateway device to the first AP, forward the sixth message based on the obtained outbound interface in the first locator route that matches the locator of the first AP.
  • the first AP refers to any AP in general, and is only named for convenience of description and is not used for limitation.
  • the sixth message is obtained by adding at least an IPv6 encapsulation header to the fifth message.
  • a layer 2 header can be added to the fifth message first, and then the IPv6 encapsulation header can be added. Finally got the sixth message.
  • the Layer 2 header at least contains the destination MAC address and the source MAC address, where the destination MAC address is in the above ARP or The MAC address corresponding to the IP address of the first AP found in the IPv6 ND entry.
  • the source MAC address is the MAC address of the gateway device.
  • the destination IPv6 address in the IPv6 encapsulation header includes at least the Locator and Function assigned by the first AP, and the source IPv6 address in the IPv6 encapsulation header at least includes the Locator and Function assigned by the gateway device.
  • the Function in the destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header carried by the sixth message contain the same Function operation instruction value, and the Function operation instruction value is the first service VLAN ID.
  • the first service VLAN ID is the service VLAN ID to which the sixth message belongs, such as service VLAN 3502.
  • the above-mentioned first Locator route may refer to the above-mentioned Locator route, which will not be described again here.
  • the outbound interface in the first Locator route is the Layer 3 interface on the gateway device used to forward SRv6 services to the first AP.
  • step b1 to step b3 realize how the gateway device forwards the packet when it receives the packet through the SRv6 tunnel.
  • forwarding the fourth message according to the destination IP address of the fourth message in step 303 may include the following steps c1 to c3:
  • Step c1 Find the IP routing table entry that matches the destination IP address of the fourth message in the routing table of the IP routing forwarding instance.
  • Step c2 if the outbound interface of the IP routing table entry is the SRv6 tunnel port from the gateway device to the second AP, search the obtained locator route for the second locator route that matches the locator of the second AP, and use the second locator to The outgoing interface in the route forwards the seventh packet.
  • the second AP generally refers to any AP, which is only named for convenience of description and is not used for limitation.
  • the seventh message is obtained by adding at least an IPv6 encapsulation header to the fourth message.
  • a layer 2 header can be added to the fourth message first, and then an IPv6 encapsulation header can be added. Finally got the seventh message.
  • the Layer 2 header at least contains the destination MAC address and the source MAC address, where the destination MAC address is in the above ARP or The MAC address corresponding to the IP address of the second AP found in the IPv6 ND entry.
  • the source MAC address is the MAC address of the gateway device.
  • the destination IPv6 address in the IPv6 encapsulation header includes at least the Locator and Function assigned by the second AP, and the source IPv6 address in the IPv6 encapsulation header at least includes the Locator and Function assigned by the gateway device.
  • the Function in the destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header carried by the seventh message contains the same Function operation instruction value, and the Function operation instruction value is the 2.
  • the second service VLAN ID is the service VLAN ID to which the seventh message belongs, such as service VLAN 3502.
  • the above-mentioned second Locator route may refer to the above-mentioned Locator route, which will not be described again here.
  • the outbound interface in the second Locator route, as described above, is the Layer 3 interface on the gateway device used to forward SRv6 services to the second AP.
  • steps c1 to c2 how the gateway device forwards the packets when receiving the packets from the network side is realized.
  • FIG. 6 is a flow chart of another method provided by an embodiment of the present application.
  • This method is applied to APs connected to gateway devices in layer 3 networks.
  • the AP will automatically create a Layer 3 interface locally for SRv6 service interaction with the gateway device, such as Interface VLAN 4092.
  • the IPv6 address of the Layer 3 interface can be automatically configured.
  • the SRv6 tunnel port on the AP can be bound to the above-mentioned Layer 3 interface on the AP.
  • the process may include the following steps:
  • Step 601 When a packet needs to be forwarded to the gateway device, step 602 is executed. When a packet is received through the SRv6 tunnel between the AP and the gateway device, step 603 is executed.
  • Step 602 The packet carries an IPv6 encapsulation header and is forwarded through the SRv6 tunnel from the AP to the gateway device.
  • This step 602 is performed on the premise that the message needs to be forwarded to the gateway device.
  • the destination IP address in the IPv6 encapsulation header at least includes the Locator and Function assigned by the gateway device
  • the source IP address in the IPv6 encapsulation header at least includes the Locator and Function assigned by the AP.
  • 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 message belongs.
  • the destination IP address in the IPv6 encapsulation header may include:
  • Locator set as the Locator assigned to the gateway device
  • Function is set to the service VLAN ID to which the message belongs
  • Args carrying application identification (including business role type and application type, etc.).
  • the source IP address in the IPv6 encapsulation header can include:
  • Locator set to the Locator assigned to the AP
  • Function is set to the service VLAN ID to which the packet belongs.
  • the destination IPv6 address in the IPv6 encapsulation header and the Function in the source IPv6 address are the same, and both are the third service VLAN ID; the third service VLAN ID is the service VLAN ID to which the above message belongs.
  • Step 603 Perform IPv6 decapsulation on the received message and forward the message according to the destination MAC address of the decapsulated message.
  • This step 603 is performed on the premise that a message is received through the SRv6 tunnel between the AP and the gateway device. This step 603 is similar to the forwarding of the existing AP and will not be described again here.
  • the gateway device and AP deploy an SRv6 tunnel based on the assigned Locator, and the packets are transmitted between the gateway device and the AP through the SRv6 tunnel, realizing the reporting application in the three-layer network where SRv6 is deployed. Text forwarding method.
  • FIG. 7 is a device structure diagram provided by an embodiment of the present application.
  • the device is applied to the gateway device in the three-layer network.
  • the gateway device and the different APs connected to the gateway device are all connected.
  • Assign different location identifiers Locator; the device includes:
  • a message receiving unit configured to receive the first message through the SRv6 tunnel, or receive the third message from the network side;
  • a message processing unit configured to, when the first message is received through the SRv6 tunnel, the destination IP address in the IPv6 encapsulation header carried by the first message include at least the Locator and Function assigned by the gateway device. , decapsulate the IPv6 encapsulation header of the first message to obtain a second message.
  • the destination MAC address of the second message is the three associated VSI instances bound to the Function on the gateway device.
  • the layer gateway interface MAC address forwards the second message according to the destination IP address in the second message;
  • the destination IPv6 address in the IPv6 encapsulation header carried by the third message at least includes the Locator assigned by the gateway device, and IPv6 decapsulation is performed on the third message. , obtain the fourth message, and forward the fourth message according to the destination IP address of the fourth message.
  • the device when the gateway device serves as the Locator management device Manager, the device further includes:
  • An allocation unit is configured to receive a Locator allocation request sent by the AP; and allocate a corresponding Locator to the AP based on the Locator allocation request.
  • a User Datagram Protocol UDP connection for Locator allocation is created between the gateway device and the AP; the Locator allocation request is received through the UDP connection;
  • the allocation unit based on the Locator allocation request, allocates the corresponding Locator to the AP, including:
  • Locator allocation response Return a Locator allocation response to the AP through the UDP connection, where the Locator allocation response at least carries the Locator allocated to the AP;
  • the designated Locator allocation request returned by the AP based on the Locator allocation response through the UDP connection;
  • the designated Locator allocation request at least carries the Locator carried by the Locator allocation response;
  • a Locator allocation confirmation message is returned to the AP through the UDP connection to confirm that the Locator is allocated to the AP.
  • the allocation unit allocates the corresponding Locator to the AP, if it receives the Locator occupation request sent by the AP through the UDP connection, then when the AP is allowed to continue to occupy the allocated Locator, through the The UDP connection returns a Locator occupation confirmation message to the AP to confirm that the AP continues to occupy the allocated Locator; the Locator occupation request is used to instruct the AP to continue to occupy the allocated Locator; or ,
  • the Locator allocated by the AP is released.
  • the allocation unit further generates a Locator route pointing to the AP after allocating a locator to the AP; the next hop of the Locator route is the IPv6 address of the interface connected to the gateway device on the AP, and the outbound interface is the gateway.
  • the packet processing unit forwarding the second packet according to the destination IP address in the second packet includes:
  • the sixth report is forwarded 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 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 carried by the sixth message at least includes the first AP being The allocated Locator and Function, and the source IPv6 address in the IPv6 encapsulation header carried by the sixth message at least includes the Locator and Function allocated by the gateway device.
  • the Function at least includes: Function type and Function operation instruction value;
  • the Function in the destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header carried by the sixth message contain the same Function operation instruction value, and the Function operation instruction value is the first service VLAN ID;
  • the first service VLAN ID is the service VLAN ID to which the sixth message belongs.
  • the message processing unit forwarding the fourth message according to the destination IP address of the fourth message includes:
  • the second Locator route that matches the Locator of the second AP is searched for in the obtained Locator route, and the second Locator route is searched through the second Locator route.
  • the outbound interface in the Locator route forwards the seventh message;
  • the outbound interface in the second Locator route is the Layer 3 interface on the gateway device used to forward SRv6 services to the second AP;
  • the seventh packet The message is obtained by adding at least an IPv6 encapsulation header to the fourth message;
  • the destination IPv6 address in the IPv6 encapsulation header carried by the seventh message at least includes the Locator and Function assigned to the second AP, so
  • the source IPv6 address in the IPv6 encapsulation header carried by the seventh message at least includes the Locator and Function assigned by the gateway device.
  • the Function at least includes: Function type and Function operation instruction value;
  • the Function in the destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header carried by the seventh message contains the same Function operation instruction value, and the Function operation instruction value is the second service VLAN ID;
  • the second service VLAN ID is the service VLAN ID to which the seventh message belongs.
  • the device further includes:
  • the table entry learning unit (not shown in Figure 7) is used to determine the Function that matches the terminal IP address when learning the IP address of a terminal connected to any AP, and report the Function and the terminal IP address to the network. side, so that the destination IPv6 address in the IPv6 encapsulation header carried in the message sent from the network side to the terminal at least contains the Function; wherein the Function is used to instruct IPv6 decapsulation and search for the
  • the IP routing and forwarding instance routing table used to forward messages to the terminal matches the terminal IP address; wherein, when the terminal IP address is IPv4, the IP routing and forwarding instance routing table is an IPv4VPN routing table; when the terminal IP address is IPv4, the IP routing and forwarding instance routing table is an IPv4VPN routing table; When the terminal IP address is IPv6, the IP route forwarding instance routing table is an IPv6VPN routing table; and/or,
  • MAC learning is performed on the second message to obtain a MAC entry matching the source MAC address of the second message; at least one of the MAC entries Including: the source MAC address of the second message, VSI instance, and outbound interface information.
  • the VSI instance corresponds to the service VLAN ID to which the second message belongs.
  • Figure 8 is another device structure diagram provided by an embodiment of the present application.
  • the device is applied to the access point device AP connected to the gateway device in the three-layer network.
  • the AP, the gateway device and the gateway device are connected to Other APs are assigned different location identifiers Locator; the device includes:
  • a receiving unit configured to receive messages through the SRv6 tunnel between the AP and the gateway device;
  • a forwarding unit used to forward a message to the gateway device when the message needs to carry an IPv6 encapsulation header and forward it through the SRv6 tunnel from the AP to the gateway device; the purpose in the IPv6 encapsulation header
  • the IP address at least includes the Locator and Function assigned by the gateway device, and the source IP address in the IPv6 encapsulation header at least includes the Locator and Function assigned by the AP;
  • the received message is decapsulated by IPv6 and forwarded according to the destination MAC address of the decapsulated message.
  • the Function in the destination IPv6 address and the source IPv6 address in the IPv6 encapsulation header are the same, and both are the third service VLAN ID;
  • the third service VLAN ID is the service VLAN ID to which the message that needs to be forwarded to the gateway device belongs.
  • Figure 9 is a structural diagram of an electronic device provided by an embodiment of the present application.
  • the hardware structure may include: a processor and a machine-readable storage medium.
  • the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is configured to execute machine-executable instructions. instructions to implement any of the methods disclosed in the above examples of this application.
  • embodiments of the present application also provide a machine-readable storage medium.
  • Several computer instructions are stored on the machine-readable storage medium.
  • the present invention can be realized. Apply the methods disclosed in the examples above.
  • machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device, which can contain or store information, such as executable instructions, data, etc.
  • machine-readable storage media can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard drives), solid state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
  • a typical implementation device is a computer.
  • the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game controller desktop, tablet, wearable device, or a combination of any of these devices.
  • embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, embodiments of the present application may 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.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • these computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means,
  • the instruction device implements the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例提供了报文转发方法及装置。本申请实施例中,通过自动为网关设备、以及网关设备下连的不同AP分配不同的Locator,实现了在三层网络部署SRv6的自动化,以在三层网络中充分利用SRv6带来的优势。进一步地,在本实施例中,基于网关设备与AP被分配的Locator在网关设备与AP之间部署SRv6隧道,通过SRv6隧道在网关设备与AP之间进行报文传输,实现了应用于部署了SRv6的三层网络中的报文转发方法。

Description

报文转发方法及装置 技术领域
本申请涉及网络通信技术,特别涉及报文转发方法及装置。
背景技术
IPv6分段路由(SRv6:Segment Routing IPv6)是基于IPv6转发平面实现分段路由(SR:Segment Routing)。在SRv6中,分段路由标识(SID:Segment Identifier)采用IPv6地址形式,但其不与任何设备上的接口地址对应。
如图1所示,SID至少包括位置标识(Locator)、功能(Function)、参数(Arguments)。
Locator:Locator在SR域内唯一。在具体应用中,Locator可以包括公共前缀(common prefix)和网络节点标识(Node ID)。
Function:用于标识与SID绑定的操作指令。SR域内,当节点收到报文后,会根据报文携带的SID中的Function执行相关操作。在具体应用中,Function可包括:操作指令类型和用于表示操作指令的操作指令值。
Arguments:定义报文的流和服务等信息。
发明内容
本申请实施例提供了报文转发方法及装置,以实现应用于部署了SRv6的三层网络中的报文转发。
本申请实施例提供了一种报文转发方法,该方法应用于所述三层网络中的网关设备,所述网关设备与下连的接入点设备AP之间存在SRv6隧道,所述网关设备、以及所述网关设备下连的不同AP均被分配不同的位置标识Locator;该方法包括:
当通过所述SRv6隧道接收到第一报文,所述第一报文携带的IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,对所述第一报文进行IPv6封装头解封装,得到第二报文,所述第二报文的目的MAC地址为所述网关设备上与所述Function绑定的VSI实例所关联的三层网关接口MAC地址,依据所述第二报文中的目的IP地址转发所述第二报文;
当接收到来自网络侧的第三报文,所述第三报文携带的IPv6封装头中的目的IPv6地址至少包括所述网关设备被分配的Locator,对所述第三报文进行IPv6解封装,得到第四报文,依据所述第四报文的目的IP地址转发所述第四报文。
本申请实施例还提供了另一种报文转发方法,该方法应用于所述三层网络中网关设备下连的接入点设备AP,所述网关设备与所述AP之间存在SRv6隧道,所述AP、所述网关设备以及所述网关设备下连的其他AP均被分配不同的位置标识Locator;该方法包括:
当需要向所述网关设备转发报文时,在该报文携带IPv6封装头并通过从本AP至所述网关设备之间的SRv6隧道转发;所述IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,所述IPv6封装头中的源IP地址至少包括本AP被分配的Locator、Function;
当通过从本AP至所述网关设备之间的SRv6隧道接收报文时,对接收的报文进行IPv6解封装并依据解封装后的报文的目的MAC地址转发报文。
本申请实施例提供了一种报文转发装置,该装置应用于所述三层网络中的网关设备,所述网关设备与下连的接入点设备AP之间存在SRv6隧道,所述网关设备、以及所述网关设备下连的不同AP均被分配不同的位置标识Locator;该装置包括:
报文接收单元,用于通过所述SRv6隧道接收到第一报文,或者接收到来自网络侧的第三报文;
报文处理单元,用于当通过所述SRv6隧道接收到第一报文,所述第一报文携带的IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,对所述第一报文进行IPv6封装头解封装,得到第二报文,所述第二报文的目的MAC地址为所述网关设备上与所述Function绑定的VSI实例所关联的三层网关接口MAC地址,依据所述第二报文中的目的IP地址转发所述第二报文;以及,
当接收到来自网络侧的第三报文,所述第三报文携带的IPv6封装头中的目的IPv6地址至少包括所述网关设备被分配的Locator,对所述第三报文进行IPv6解封装,得到第四报文,依据所述第四报文的目的IP地址转发所述第四报文。
本申请实施例还提供了一种报文转发装置,该装置应用于所述三层网络中网关设备下连的接入点设备AP,所述网关设备与所述AP之间存在SRv6隧道,所述AP、所述网关设备以及所述网关设备下连的其他AP均被分配不同的位置标识Locator;该方法包括:
接收单元,用于通过从本AP至所述网关设备之间的SRv6隧道接收报文;
转发单元,用于当需要向所述网关设备转发报文时,在该报文携带IPv6封装头并通过从本AP至所述网关设备之间的SRv6隧道转发;所述IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,所述IPv6封装头中的源IP地址至少包括本AP被分配的Locator、Function;以及,
当通过从本AP至所述网关设备之间的SRv6隧道接收报文时,对接收的报文进行IPv6解封装并依据解封装后的报文的目的MAC地址转发报文。
本申请实施例还提供了一种网络设备,该网络设备包括:处理器和机器可读存储介质;
机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;
所述处理器用于执行机器可执行指令,以实现如上任一方法。
由以上技术方案可以看出,本申请实施例中,通过自动为网关设备、以及网关设备下连的不同AP分配不同的Locator,实现了在三层网络部署SRv6的自动化,以在三层网络中充分利用SRv6带来的优势。
进一步地,在本实施例中,基于网关设备与AP被分配的Locator在网关设备与AP之间部署SRv6隧道,通过SRv6隧道在网关设备与AP之间进行报文传输,实现了应用于部署了SRv6的三层网络中的报文转发方法。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1为本申请实施例提供的SID结构示意图;
图2为本申请实施例提供的部署SRv6的园区网络的组网示意图;
图3为本申请实施例提供的方法流程图;
图4为本申请实施例提供的Locator分配流程图;
图5为本申请实施例提供的Locator结构示意图;
图6为本申请实施例提供的另一方法流程图;
图7为本申请实施例提供的装置结构图;
图8为本申请实施例提供的另一装置结构图;
图9为本申请实施例提供的电子设备结构图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是本申请的一些方面相一致的装置和方法的例子。
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
SRv6为网络提供了一种灵活高效的流量控制手段,能够更好地实现流量调度和路径优化,保障关键业务质量、均衡质量分布、提高专线利用率。目前,可将SRv6部署于三层网络比如园区网络等,图2举例示出部署了SRv6的园区网络。在图2中,加粗的黑线条示出SRv6路径。当在园区网络部署SRv6,则网关设备(其可为脊(Spine)-叶子(Leaf)拓扑结构下的Leaf节点)与无线接入点(AP:Access Point)之间会基于SRv6实现流量监管和调度等。
但是,在常规的三层网络环境下,为简化部署,常会基于AP模板为一批不同AP下发相同AP配置(也即多个不同AP具有相同配置)。但是,当SRv6应用三层网络比如园区网络等时,为方便区分AP,需要为不同AP分配不同Locator,这就导致无法再基于AP模板为一批不同AP下发相同AP配置。而无法基于AP模板为一批不同AP下发相同AP配置,再结合三层网络中AP的数量比较大,则会不利于在三层网络部署SRv6,也不利于网络部署自动化。
为了解决上述技术问题,本申请实施例提供了应用于部署了SRv6的三层网络中的报文转发方法。为了使本领域技术人员更好地理解本申请实施例提供的技术方案,并使本申请实施例的上述目的、特征和优点能够更加明显易懂,下面结合附图对本申请实施例中技术方案作进一步详细的说明。
下面先站在三层网络中的网关设备的角度描述本申请实施例提供的方法:
参见图3,图3为本申请实施例提供的方法流程图。该方法应用于三层网络中的网关设备。可选地,应用于Spine-Leaf网络拓扑结构下,这里的网关设备可为Leaf节点。
在本实施例中,网关设备、以及网关设备下连的不同AP均被分配不同的Locator。可选地,本实施例中,可通过指定一个网络设备作为Locator管理设备(Manger),由该Locator Manger为网关设备、以及网关设备下连的各AP分配不同Locator。
比如,指定网关设备为Locator Manger,则作为Locator Manger的网关设备会为本网关设备、以及网关设备下连的各AP(此时AP可称为Locator客户端(Client))分配不同Locator。图4举例描述网关设备为Locator Manger时如何为本网关设备、以及网关设备下连的各AP分配不同Locator。这里暂不赘述。
再比如,指定非网关设备比如接入控制器(AC:Access Controller)为Locator Manger,Locator Manger可为网关设备、网关设备下连的不同AP(此时网关设备、网关设备下连的不同AP均可称为Locator Client)分配不同Locator。至于具体分配方式,其类似图4所示的分配,这里不再赘述。
在本实施例中,网关设备与AP会基于被分配的Locator在网关设备与AP之间建立SRv6隧道(这里的SRv6隧道比如可为SRv6PW等,本实施例并不具体限定)。可选地,这里的SRv6隧道可通过动态建立,也可通过静态配置,本实施例并不具体限定。
基于如上描述,则如图3所示,该流程可包括以下步骤:
步骤301,当通过SRv6隧道接收到第一报文,第一报文携带的IPv6封装头中的目的IP地址至少包括网关设备被分配的Locator、Function,则执行步骤302,当接收到来自网络侧的第三报文,第三报文携带的IPv6封装头中的目的IPv6地址至少包括网关设备被分配的Locator,则执行步骤303。
需要说明的是,在本实施例中,第一报文、第三报文只是为便于描述而进行的命名,并非用于限定。
如上描述的网关设备与AP之间的SRv6隧道,在本实施例中,当通过SRv6隧道接收到第一报文,则意味着网关设备是通过SRv6隧道接收经由AP转发的第一报文。当网关设备是通过SRv6隧道接收经由AP转发的第一报文,则执行如下步骤302。
步骤302,对第一报文进行IPv6封装头解封装,得到第二报文,第二报文的目的MAC地址为网关设备上与Function绑定的VSI实例所关联的三层网关接口MAC地址,依据第二报文中的目的IP地址转发第二报文。
本步骤302是在网关设备通过SRv6隧道接收到第一报文的前提下执行的。
可选地,在本实施例中,可基于网关设备被分配的Locator以及Function(包括操作指令值(Opcode)、Function类型)确定网关设备对应的Local SID,每一Local SID中的Function不同。表1举例示出网关设备对应的两个Local SID(下文会举例描述Local SID):
(网关设备Locator) Function操作指令值(Opcode) Function类型
A0:B0:01:02::/64 Opcode1 end-dt2u
A0:B0:01:02::/64 Opcode2 end-dt2u
表1
在表1中,end-dt2u用于指示解封装并在解封装后的目的MAC地址为网关设备上与Function绑定的VSI实例所关联的三层网关接口MAC地址时根据报文中的目的IP地址进行报文转发。
基于表1所示的每一Local SID,则可在FIB6(IPv6Forwarding Information Base)表中添加对应的FIB6表项。FIB6表项至少包含其对应的Local SID;基于此,如步骤302,当网关设备通过SRv6隧道接收到第一报文时,网关设备会基于第一报文携带的目的IP地址查找FIB6表,如果查找到对应的FIB6表项,则依据FIB6表项中Local SID内的end-dt2u的指示,对第一报文进行IPv6封装头解封装,得到第二报文。若发现第二报文的目的MAC地址为网关设备上与上述Function绑定的VSI实例所关联的三层网关接口MAC地址,则依据第二报文中的目的IP地址转发第二报文。下文会举例描述如何依据第二报文中的目的IP地址转发第二报文,这里暂不赘述。
步骤303,对第三报文进行IPv6解封装,得到第四报文,依据第四报文的目的IP地址转发第四报文。
本步骤303是在接收到来自网络侧的第三报文的前提下执行的。当网关设备接收到第三报文,其会依据报文携带的IPv6封装头中目的IPv6地址所包含的Function执行对应的操作。假若该Function指示IPv6解封装、以及查找对应的IP路由转发实例路由表,则应用于本步骤303,其会对第三报文进行IPv6解封装,得到第四报文,依据第四报文的目的IP地址在上述IP路由转发实例路由表中查找到对应的IP路由转发实例路由表项,基于该IP路由转发实例路由表项进行报文转发,该报文转发具体可见下文的举例描述,这里暂不赘述。
为保证网关设备依据报文携带的IPv6封装头中目的IPv6地址所包含的Function执行对应的操作,则可选地,在本实施例中,当网关设备学习到任一AP下挂的终端的IP地址时,确定与终端IP地址匹配的Function,将该Function、终端IP地址上报至网络侧,以使后续从网络侧发向该终端的报文所携带的IPv6封装头中的目的IPv6地址至少包含上述Function。其中,Function用于指示IPv6解封装、以及查找终端IP地址匹配的IP路由转发实例路由表。这里,当终端IP地址为IPv4时,IP路由转发实例路由表为IPv4VPN路由表;当终端IP地址为IPv6时,IP路由转发实例路由表为IPv6VPN路由表。
至此,完成图3所示流程。
通过图3所示流程可以看出,本实施例通过自动为网关设备、以及网关设备下连的不同AP分配不同的Locator,实现了在三层网络部署SRv6的自动化,以在三层网络中充分利用SRv6带来的优势。
进一步地,在本实施例中,基于网关设备与AP被分配的Locator在网关设备与AP之间部署SRv6隧道,通过SRv6隧道在网关设备与AP之间进行报文传输,实现了应用于部署了SRv6的三层网络中的报文转发方法。
下面对图4所示流程进行描述:
参见图4,图4为本申请实施例提供的Locator分配流程图。在图4所示的流程中,Locator Manger为网关设备、以及网关设备下连的各AP分配不同Locator。
在本实施例中,Locator Manager管理Locator资源池(Locator资源池包含若干个Locator)。为了管理上的方便,并兼容现有的Locator结构(Common prefix+Node ID的组成结构),本实施例中的Locator可为:Common prefix+Manager ID+Node ID,具体如图5所示。之所以这样设置Locator,是为了保证同一个组网内存在多个Locator manager时不同Locator manager分配的Locator不重复,保证每一Locator在整个组网内的唯一性。
在图5中,Common prefix的值和长度,可被预先指定,比如:A0:B0::/40(Common prefix的值为A0:B0::,长度为40比特)。
在图5中,Manger ID的值和长度,可被预先指定,比如:Manger ID的值为1,长度为8比特。
在图5中,Node ID的值可不被预先指定,而是从Node ID资源池中选择。可选地,本实施例中,Node ID资源池中,Node 0(即Node ID为0)可保留。换言之,结合上述的Common prefix、Manger ID,则本实施例中,A0:B0:01:00::/64可保留,不预分配。
可选地,本实施例中,网关设备可作为Locator Manger,其在为自身分配Locator时,可先从Node ID资源池中选择非0且最小的Node ID。以选择的Node ID为1为例,再结合上述的Common prefix、Manger ID,则本实施例中,网关设备作为Locator Manager时为自身分配的Locator可为A0:B0:01:01::/64。
网关设备作为Locator Manager,其会按照如图4所示的流程为作为Locator Client的各AP分配Locator。当然,假若网关设备不作为Locator Manager,则Locator Manager会按照如图4所示的流程为作为Locator Client的网关设备、以及网关设备下连的各AP分配Locator。
如图4所示,该流程可包括以下步骤:
步骤401,接收Locator Client发送的Locator分配请求。
在本实施例中,当Locator Client上线后(比如在上线且被分配IPv6地址后等),其作为Locator Client会向Locator Manager发送Locator分配请求。这里,Locator分配请求可至少携带Locator Client的IPv6地址、MAC地址、Locator Client标识。
步骤402,基于Locator分配请求,为Locator Client分配对应的Locator。
可选地,在本实施例中,Locator Manager与Locator Client之间存在用于Locator分配的协议连接,该协议连接可以是TCP连接,也可以是UDP连接。
作为一个实施例,当上述协议链接是TCP连接,则可从Node ID资源池的可用Node ID中选择一个可用Node ID,将该选择的一个可用Node ID与上述的Common prefix、Manger ID一起组成一个Locator,将该Locator携带在Locator分配应答中并通过TCP连接发给Locator Client。
可选地,上述从Node ID资源池的可用Node ID中选择一个可用Node ID有很多方式,比如,按照顺序直接从Node ID资源池的可用Node ID中选择最小的Node ID。以按照顺序直接从Node ID资源池的可用Node ID中选择最小的Node ID为例,假若之前已经选择Node1(即Node ID为1),再结合上述的Node 0保留,则截至当前Node ID资源池的可用Node ID为Node 2(即Node ID为2)、Node 3(即Node ID为3)……Node k(即Node ID为k),可从当前Node ID资源池的可用Node ID中选择Node 2。将该选择的一个可用Node ID与上述的Common prefix、Manger ID一起组成一个Locator即A0:B0:01:02::/64。
作为另一个实施例,当上述协议链接是UDP连接。相比TCP,UDP不要求Locator Manager与Locator Client之间建立和维持较为复杂的TCP连接,Locator Manager也不会因为维持大量TCP连接而导致系统(比如CPU等)开销太大。当上述协议链接是UDP连接时,其不会像TCP连接那样简单返回Locator分配应答就可实现Locator分配。可选地,在本实施例中,上述协议链接是UDP连接时,上述步骤402中基于Locator分配请求,为作为Locator Client的AP分配对应的Locator可包括:
步骤a1,通过UDP连接向Locator Client返回Locator分配应答。
这里,Locator分配应答至少携带:为Locator Client分配的Locator。这里,为Locator Client分配Locator的方式有很多,比如,可从Node ID资源池的可用Node ID中选择一个可用Node ID,将该选择的一个可用Node ID与上述的Common prefix、Manger ID一起组成待分配给Locator Client的Locator。
可选的,在本实施例中,Locator分配应答还可进一步携带Locator Client的IPv6地址、MAC地址、以及Locator Manager的设备ID。
步骤a2,通过UDP连接接收Locator Client基于Locator分配应答返回的指定Locator分配请求。
可选地,在本实施例中,指定Locator分配请求至少携带Locator分配应答所携带的Locator。这里之所以发送指定Locator分配请求,是为了确认是否可以占用Locator分配应答所携带的Locator。
可选地,在本实施例中,指定Locator分配请求还可携带Locator Client的IPv6地址、MAC地址、Locator Client标识、Locator Manager的设备ID。
步骤a3,通过UDP连接向Locator Client返回Locator分配确认消息,以确认为Locator Client分配Locator。
可选地,在本实施例中,Locator分配确认消息是用于确认Locator Client可以占用指定Locator分配请求携带的Locator。
可选地,在本实施例中,Locator分配确认消息还可携带Locator Client的IPv6地址、MAC地址、Locator Manager的设备ID。
至此,通过上述步骤a1至步骤a3即可实现上述协议链接是UDP连接时如何为Locator Client分配Locator。
需要说明的是,在本实施例中,在上述协议连接是UDP连接时,基于UDP连接的特性,在为Locator Client分配对应的Locator之后,还需要及时管理Locator Client被分配对应的Locator。具体管理方式通过如下步骤a4至步骤a5实现:
步骤a4,通过UDP连接接收Locator Client发送的Locator占用请求,若允许Locator Client继续占用已被分配的Locator,则通过UDP连接向Locator Client返回Locator占用确认消息,以确认Locator Client继续占用已被分配的Locator。
在本实施例中,Locator Client在被分配Locator后,会以周期T发送Locator占用请求(该Locator占用请求类似上述的指定Locator分配请求),其携带Locator Client已被分配的Locator,以确认是否可继续占用该Locator。
Locator Manager在接收到Locator Client发送的Locator占用请求,一般会允许Locator Client继续占用已被分配的Locator,则会通过UDP连接向Locator Client返回Locator占用确认消息,以确认Locator Client继续占用已被分配的Locator。当然,在一些特殊情况下,若不允许Locator Client继续占用已被分配的Locator,则会释放掉该Locator,并触发Locator Client按照上述图4所示流程重新请求Locator。
步骤a5,若在预设时间段内未收到Locator Client发送的Locator占用请求,则释放Locator Client已被分配的Locator。
比如,Locator Manager若在上述3个周期T内都没有收到Locator Client发送的Locator占用请求,则认为Locator Client下线,会释放Locator Client已被分配的Locator(即此时该Locator中的Node ID变为可用Node ID)。
至此,通过步骤a4至步骤a5实现了在为Locator Client分配对应的Locator之后如何及时管理Locator Client被分配对应的Locator。
可选地,在本实施例中,Locator Manager在为Locator Client分配对应的Locator后,会通过表项记录,表2举例示出了Locator分配表项:
Figure PCTCN2022084010-appb-000001
表2
可选地,在本实施例中,Locator Manager会基于Locator分配表项生成Locator路由。仍以表2为例,则对应的Locator路由如表3所示:
Figure PCTCN2022084010-appb-000002
Figure PCTCN2022084010-appb-000003
表3
在表3中,Interface VLAN 4092为Locator Manager上用于向AP进行SRv6业务转发的三层接口,其可为上述收到Locator分配请求的三层接口。可选地,当非网关设备作为Locator Manager时,Locator Manager会将Locator路由下发至上述网关设备,以使网关设备后续基于Locator路由进行报文转发。下文会举例描述如何进行报文转发。
下面对上述表1所示的Local SID进行分析描述:
可选地,在本实施例中,Local SID可根据业务虚拟局域网(VLAN:Virtual Local Area Network)标识(ID)生成。在此前提下,上述Local SID中的Function操作指令值(Opcode)可通过业务VLAN ID表征。比如,可针对作为Locator Manager的网关设备下发业务VLAN 3502和3503对应的WLAN业务,则上述表1所示的Local SID可变形为如下表4:
Figure PCTCN2022084010-appb-000004
表4
通过表4可以看出,在本实施例中,通过将Function操作指令值(Opcode)设置为业务VLAN ID,可以实现Function操作指令值一方面表征业务VLAN ID,另一方面表征网关设备上对应的网络操作指令,这可提升数据平面转发匹配效率。
需要说明的是,上述的Local SID也可通过配置命令实现。比如,表4对应的配置命令可为:
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
另外,需要说明的是,在本实施例中,网关设备在对第一报文进行IPv6头解封装得到第二报文后,其还可以进行源MAC学习生成MAC表项,表5举例示出MAC表项:
MAC address 业务VLAN ID 出接口
A11B-EBA3-0206 service-vlan-3502 到AP1的SRv6隧道
9E1A-2BA5-0108 service-vlan-3502 到AP2的SRv6隧道
表5
特别地,在本实施例中,上述第二报文如果是ARP报文或IPv6 ND报文,网关设备还会进行ARP或IPv6 ND学习,学习到的ARP或IPv6 ND表项至少包括:
MAC地址:发送ARP报文或IPv6 ND报文的AP的MAC地址;
IP地址:发送ARP报文或IPv6 ND报文的AP的IP地址。
基于如上各表项,下面对上述步骤302中依据第二报文中的目的IP地址转发所述第二报文进行描述:
可选地,在本实施例中,上述步骤302中依据第二报文中的目的IP地址转发第二报文可包括如下步骤b1至步骤b3:
步骤b1,对第二报文进行二层头解封装,得到第五报文。
可选地,本实施例中,在第二报文进行二层头解封装后得到的第五报文实质是个三层报文,其有目的IP地址、源IP地址。
步骤b2,在三层网关接口相关联的IP路由转发实例路由表中查找到第五报文的目的IP地址匹配的IP路由表项。
可选地,查找到的IP路由表项包含第五报文的目的IP地址。IP路由转发实例路由表可根据现有路由学习的方式建立。
步骤b3,若IP路由表项的出接口为从网关设备至第一AP的SRv6隧道口,则基于已获得的与第一AP的Locator匹配的第一Locator路由中的出接口转发第六报文。
这里,第一AP是泛指任一AP,其只是为便于描述而进行的命名,并非用于限定。
可选地,在本实施例中,第六报文是通过在第五报文上至少增加IPv6封装头得到的,比如可以先在第五报文上增加二层头,再增加IPv6封装头,最终得到第六报文。
以第六报文携带了上述新增加的二层头、IPv6封装头为例,则在一个例子中,二层头至少包含目的MAC地址和源MAC地址,其中,目的MAC地址是在上述ARP或IPv6 ND表项中查找到的与第一AP的IP地址对应的MAC地址,源MAC地址为网关设备的MAC地址。
在一个例子中,IPv6封装头中的目的IPv6地址至少包括第一AP被分配的Locator、Function,IPv6封装头中的源IPv6地址至少包括网关设备被分配的Locator、Function。
基于上述描述的Local SID,在本实施例中,第六报文携带的IPv6封装头中目的IPv6地址和源IPv6地址中的Function包含相同的Function操作指令值,该Function操作指令值为第一业务VLAN ID。这里,第一业务VLAN ID为第六报文所属的业务VLAN ID,比如业务VLAN 3502。
另外,在本实施例中,上述第一Locator路由可参见上述的Locator路由,这里不再赘述。第一Locator路由中的出接口,如上描述,其为网关设备上用于向第一AP进行SRv6业务转发的三层接口。
最终,通过步骤b1至步骤b3实现了网关设备在通过SRv6隧道接收到报文时如何对报文进行转发。
下面对上述步骤303中如何依据第四报文的目的IP地址转发第四报文进行描述:
可选地,在本实施例中,上述步骤303中依据第四报文的目的IP地址转发第四报文可包括如下步骤c1至步骤c3:
步骤c1,在IP路由转发实例路由表中查找到第四报文的目的IP地址匹配的IP路由表项。
步骤c2,若IP路由表项的出接口为从网关设备至第二AP的SRv6隧道口,则在已获得的Locator路由中查找与第二AP的Locator匹配的第二Locator路由,通过第二Locator路由中的出接口转发第七报文。
这里,第二AP是泛指任一AP,其只是为便于描述而进行的命名,并非用于限定。
可选地,在本实施例中,第七报文是通过在第四报文上至少增加IPv6封装头得到的,比如可以先在第四报文上增加二层头,再增加IPv6封装头,最终得到第七报文。
以第七报文携带了上述新增加的二层头、IPv6封装头为例,则在一个例子中,二层头至少包含目的MAC地址和源MAC地址,其中,目的MAC地址是在上述ARP或IPv6 ND表项中查找到的与第二AP的IP地址对应的MAC地址,源MAC地址为网关设备的MAC地址。
在一个例子中,IPv6封装头中的目的IPv6地址至少包括第二AP被分配的Locator、Function,IPv6封装头中的源IPv6地址至少包括网关设备被分配的Locator、Function。
基于上述描述的Local SID表项,在本实施例中,第七报文携带的IPv6封装头中目的IPv6地址和源IPv6地址中的Function包含相同的Function操作指令值,该Function操作指令值为第二业务VLAN ID。这里,第二业务VLAN ID为第七报文所属的业务VLAN ID,比如业务VLAN 3502。
另外,在本实施例中,上述第二Locator路由可参见上述的Locator路由,这里不再赘述。第二Locator路由中的出接口,如上描述,其为网关设备上用于向第二AP进行SRv6业务转发的三层接口。
最终,通过步骤c1至步骤c2实现了网关设备在接收到来自网络侧的报文时如何对报文进行转发。
以上是站在三层网络中的网关设备的角度描述本申请实施例提供的方法,下面站在AP的角度描述本申请实施例提供的方法。
参见图6,图6为本申请实施例提供的另一方法流程图。该方法应用于三层网络中网关设备下连的AP。在本实施例中,AP会在本地自动创建用于与网关设备进行SRv6业务交互的三层接口,比如Interface VLAN 4092。这里,三层接口的IPv6地址可自动配置。另外,基于如上描述的网关设备与AP之间的SRv6隧道,在AP上的SRv6隧道口可与AP上的上述三层接口绑定。
如图6所示,该流程可包括以下步骤:
步骤601,当需要向网关设备转发报文时,执行步骤602,当通过从本AP至网关设备之间的SRv6隧道接收到报文时,执行步骤603。
步骤602,在该报文携带IPv6封装头并通过从本AP至网关设备之间的SRv6隧道转发。
本步骤602是在需要向网关设备转发报文的前提下执行的。
可选地,IPv6封装头中的目的IP地址至少包括网关设备被分配的Locator、Function,IPv6封装头中的源IP地址至少包括本AP被分配的Locator、Function。
作为一个实施例,在本步骤602中,如上描述,IPv6封装头中的源IP地址和目的IP地址可根据报文所属的业务VLAN ID自适应确定。
比如,IPv6封装头中目的IP地址可包括:
Locator,设置为网关设备被分配的Locator;
Function,被设置为报文所属的业务VLAN ID;
Args,携带应用标识(包括业务的角色类型和应用类型等)。
同样,IPv6封装头中源IP地址可包括:
Locator,设置为AP被分配的Locator;
Function,被设置为报文所属的业务VLAN ID。
也即,在本实施例中,IPv6封装头中目的IPv6地址和源IPv6地址中的Function相同,均为第三业务VLAN ID;第三业务VLAN ID为上述报文所属的业务VLAN ID。
步骤603,对接收的报文进行IPv6解封装并依据解封装后的报文的目的MAC地址转发报文。
本步骤603是在通过从本AP至网关设备之间的SRv6隧道接收到报文的前提下执行的。本步骤603类似现有AP的转发,这里不再赘述。
至此,完成图6所示流程。
通过图6所示流程实现了网关设备与AP基于被分配的Locator部署SRv6隧道,通过SRv6隧道在网关设备与AP之间进行报文传输,实现了应用于部署了SRv6的三层网络中的报文转发方法。
以上对本申请实施例提供的方法进行了描述。下面对本申请实施例提供的装置进行描述:
参见图7,图7为本申请实施例提供的装置结构图。该装置应用于所述三层网络中的网关设备,所述网关设备与下连的接入点设备AP之间存在SRv6隧道,所述网关设备、以及所述网关设备下连的不同AP均被分配不同的位置标识Locator;该装置包括:
报文接收单元,用于通过所述SRv6隧道接收到第一报文,或者接收到来自网络侧的第三报文;
报文处理单元,用于当通过所述SRv6隧道接收到第一报文时,所述第一报文携带的IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,对所述第一报文进行IPv6封装头解封装,得到第二报文,所述第二报文的目的MAC地址为所述网关设备上与所述Function绑定的VSI实例所关联的三层网关接口MAC地址,依据所述第二报文中的目的IP地址转发所述第二报文;以及,
当接收到来自网络侧的第三报文,所述第三报文携带的IPv6封装头中的目的IPv6地址至少包括所述网关设备被分配的Locator,对所述第三报文进行IPv6解封装,得到第四报文,依据所述第四报文的目的IP地址转发所述第四报文。
可选地,所述网关设备作为Locator管理设备Manager时,该装置还包括:
分配单元,用于接收AP发送的Locator分配请求;基于所述Locator分配请求,为所述AP分配对应的Locator。
可选地,所述网关设备与所述AP之间创建了用于Locator分配的用户数据报协议UDP连接;所述Locator分配请求是通过所述UDP连接接收;
所述分配单元基于所述Locator分配请求,为所述AP分配对应的Locator包括:
通过所述UDP连接向所述AP返回Locator分配应答,所述Locator分配应答至少携带为所述AP分配的Locator;
通过所述UDP连接接收所述AP基于所述Locator分配应答返回的指定Locator分配请求;所述指定Locator分配请求至少携带所述Locator分配应答所携带的Locator;
通过所述UDP连接向所述AP返回Locator分配确认消息,以确认为所述AP分配所述Locator。
可选地,所述分配单元在为AP分配对应的Locator之后,若通过所述UDP连接接收到所述AP发送的Locator占用请求,则当允许所述AP继续占用已被分配的Locator,通过所述UDP连接向所述AP返回Locator占用确认消息,以确认所述AP继续占用已被分配的所述Locator;所述Locator占用请求用于指示所述AP继续占用已被分配的所述Locator;或者,
当在预设时间段内未收到所述AP发送的Locator占用请求,则释放所述AP已被分配的所述Locator。
可选地,分配单元进一步在为下连的AP分配locator后,生成一条指向该AP的Locator路由;Locator路由的下一跳为该AP上连接网关设备的接口IPv6地址,出接口为所述网关 设备上用于向该AP进行SRv6业务转发的三层接口。
可选地,所述报文处理单元依据所述第二报文中的目的IP地址转发所述第二报文包括:
对所述第二报文进行二层头解封装,得到第五报文;
在所述三层网关接口相关联的IP路由转发实例路由表中查找到所述第五报文的目的IP地址匹配的IP路由表项;
若所述IP路由表项的出接口为从所述网关设备至第一AP的SRv6隧道口,则基于已获得的与第一AP的Locator匹配的第一Locator路由中的出接口转发第六报文;所述第一Locator路由中的所述出接口为所述网关设备上用于向所述第一AP进行SRv6业务转发的三层接口;
其中,所述第六报文是通过在所述第五报文上至少增加IPv6封装头得到的;所述第六报文携带的IPv6封装头中的目的IPv6地址至少包括所述第一AP被分配的Locator、Function,所述第六报文携带的IPv6封装头中的源IPv6地址至少包括所述网关设备被分配的Locator、Function。
可选地,所述Function至少包括:Function类型和Function操作指令值;
所述第六报文携带的IPv6封装头中目的IPv6地址和源IPv6地址中的Function包含相同的Function操作指令值,该Function操作指令值为第一业务VLAN ID;
所述第一业务VLAN ID为所述第六报文所属的业务VLAN ID。
可选地,所述报文处理单元依据所述第四报文的目的IP地址转发所述第四报文包括:
在IP路由转发实例路由表中查找到所述第四报文的目的IP地址匹配的IP路由表项;
若所述IP路由表项的出接口为从所述网关设备至第二AP的SRv6隧道口,则在已获得的Locator路由中查找与第二AP的Locator匹配的第二Locator路由,通过第二Locator路由中的出接口转发第七报文;所述第二Locator路由中的出接口为所述网关设备上用于向所述第二AP进行SRv6业务转发的三层接口;所述第七报文是通过在所述第四报文上至少增加IPv6封装头得到的;所述第七报文携带的IPv6封装头中的目的IPv6地址至少包括所述第二AP被分配的Locator、Function,所述第七报文携带的IPv6封装头中的源IPv6地址至少包括所述网关设备被分配的Locator、Function。
可选地,所述Function至少包括:Function类型和Function操作指令值;
所述第七报文携带的IPv6封装头中目的IPv6地址和源IPv6地址中的Function包含相同的Function操作指令值,该Function操作指令值为第二业务VLAN ID;
所述第二业务VLAN ID为所述第七报文所属的业务VLAN ID。
可选地,该装置进一步包括:
表项学习单元(图7未示出),用于当学习到任一AP下挂的终端的IP地址时,确定与终端IP地址匹配的Function,将该Function、所述终端IP地址上报至网络侧,以使从所述网络侧发向所述终端的报文所携带的IPv6封装头中的目的IPv6地址至少包含所述Function;其中,所述Function用于指示IPv6解封装、以及查找所述终端IP地址匹配的用于向所述终端转发报文的IP路由转发实例路由表;其中,当所述终端IP地址为IPv4时,所述IP路由转发实例路由表为IPv4VPN路由表;当所述终端IP地址为IPv6时,所述IP路由转发实例路由表为IPv6VPN路由表;和/或,
当本地不存在第二报文的源MAC地址匹配的MAC表项时,对第二报文进行MAC学习,得到第二报文的源MAC地址匹配的MAC表项;所述MAC表项中至少包括:第二报文的源MAC地址、VSI实例、出接口信息,所述VSI实例对应所述第二报文所属的业务VLAN  ID。
至此,完成图7所示装置的结构描述。
参见图8,图8为本申请实施例提供的另一装置结构图。该装置应用于所述三层网络中网关设备下连的接入点设备AP,所述网关设备与所述AP之间存在SRv6隧道,所述AP、所述网关设备以及所述网关设备下连的其他AP均被分配不同的位置标识Locator;该装置包括:
接收单元,用于通过从本AP至所述网关设备之间的SRv6隧道接收报文;
转发单元,用于当需要向所述网关设备转发报文时,在该报文携带IPv6封装头并通过从本AP至所述网关设备之间的SRv6隧道转发;所述IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,所述IPv6封装头中的源IP地址至少包括本AP被分配的Locator、Function;以及,
当通过从本AP至所述网关设备之间的SRv6隧道接收报文时,对接收的报文进行IPv6解封装并依据解封装后的报文的目的MAC地址转发报文。
可选地,所述IPv6封装头中目的IPv6地址和源IPv6地址中的Function相同,均为第三业务VLAN ID;
所述第三业务VLAN ID为需要向网关设备转发的报文所属的业务VLAN ID。
至此,完成图8所示装置的结构描述。
本申请实施例还提供了图7或图8所示装置的硬件结构。参见图9,图9为本申请实施例提供的电子设备结构图。如图9所示,该硬件结构可包括:处理器和机器可读存储介质,机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现本申请上述示例公开的任一方法。
基于与上述方法同样的申请构思,本申请实施例还提供一种机器可读存储介质,所述机器可读存储介质上存储有若干计算机指令,所述计算机指令被处理器执行时,能够实现本申请上述示例公开的方法。
示例性的,上述机器可读存储介质可以是任何电子、磁性、光学或其它物理存储装置,可以包含或存储信息,如可执行指令、数据,等等。例如,机器可读存储介质可以是:RAM(Radom Access Memory,随机存取存储器)、易失存储器、非易失性存储器、闪存、存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、DVD等),或者类似的存储介质,或者它们的组合。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和 /或方框图来描述的。应理解可以由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其它可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其它可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
而且,这些计算机程序指令也可以存储在能引导计算机或其它可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或者多个流程和/或方框图一个方框或者多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其它可编程数据处理设备上,使得在计算机或者其它可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其它可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (15)

  1. 一种报文转发方法,其特征在于,该方法应用于所述三层网络中的网关设备,所述网关设备与下连的接入点设备AP之间存在SRv6隧道,所述网关设备、以及所述网关设备下连的不同AP均被分配不同的位置标识Locator;该方法包括:
    当通过所述SRv6隧道接收到第一报文,所述第一报文携带的IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,对所述第一报文进行IPv6封装头解封装,得到第二报文,所述第二报文的目的MAC地址为所述网关设备上与所述Function绑定的VSI实例所关联的三层网关接口MAC地址,依据所述第二报文的目的IP地址转发所述第二报文;
    当接收到来自网络侧的第三报文,所述第三报文携带的IPv6封装头中的目的IPv6地址至少包括所述网关设备被分配的Locator,对所述第三报文进行IPv6解封装,得到第四报文,依据所述第四报文的目的IP地址转发所述第四报文。
  2. 根据权利要求1所述的方法,其特征在于,所述网关设备作为Locator管理设备Manager时,所述AP的Locator由所述网关设备通过以下步骤分配:
    接收AP发送的Locator分配请求;
    基于所述Locator分配请求,为所述AP分配对应的Locator。
  3. 根据权利要求2所述的方法,其特征在于,所述网关设备与所述AP之间创建了用于Locator分配的用户数据报协议UDP连接;所述Locator分配请求是通过所述UDP连接接收;
    所述基于所述Locator分配请求,为所述AP分配对应的Locator包括:
    通过所述UDP连接向所述AP返回Locator分配应答,所述Locator分配应答至少携带为所述AP分配的Locator;
    通过所述UDP连接接收所述AP基于所述Locator分配应答返回的指定Locator分配请求;所述指定Locator分配请求至少携带所述Locator分配应答所携带的Locator;
    通过所述UDP连接向所述AP返回Locator分配确认消息,以确认为所述AP分配所述Locator。
  4. 根据权利要求3所述的方法,其特征在于,在为AP分配对应的Locator之后,该方法进一步包括:
    当通过所述UDP连接接收到所述AP发送的Locator占用请求时,若允许所述AP继续占用已被分配的Locator,则通过所述UDP连接向所述AP返回Locator占用确认消息,以确认所述AP继续占用已被分配的所述Locator;所述Locator占用请求用于所述AP请求是否继续占用已被分配的Locator;
    当在预设时间段内未收到所述AP发送的Locator占用请求,则释放所述AP已被分配的Locator。
  5. 根据权利要求1所述的方法,其特征在于,该方法进一步包括:
    所述网关设备作为Locator管理设备Manager,在为下连的AP分配locator后,生成一条指向该AP的Locator路由;所述Locator路由的下一跳为该AP上连接网关设备的接口IPv6地址,出接口为所述网关设备上用于向该AP进行SRv6业务转发的三层接口。
  6. 根据权利要求1或5所述的方法,其特征在于,所述依据所述第二报文中的目的IP地址转发所述第二报文包括:
    对所述第二报文进行二层头解封装,得到第五报文;
    在所述三层网关接口相关联的IP路由转发实例路由表中查找到所述第五报文的目的IP地址匹配的IP路由表项;
    若所述IP路由表项的出接口为从所述网关设备至第一AP的SRv6隧道口,则基于已获得的与第一AP的Locator匹配的第一Locator路由中的出接口转发第六报文;所述 第一Locator路由中的出接口为所述网关设备上用于向所述第一AP进行SRv6业务转发的三层接口;
    其中,所述第六报文是通过在所述第五报文上至少增加IPv6封装头得到的;所述第六报文携带的IPv6封装头中的目的IPv6地址至少包括所述第一AP被分配的Locator、Function,所述第六报文携带的IPv6封装头中的源IPv6地址至少包括所述网关设备被分配的Locator、Function。
  7. 根据权利要求6所述的方法,其特征在于,所述Function至少包括:Function类型和Function操作指令值;
    所述第六报文携带的IPv6封装头中目的IPv6地址和源IPv6地址中的Function包含相同的Function操作指令值,该Function操作指令值为第一业务VLAN ID;
    所述第一业务VLAN ID为所述第六报文所属的业务VLAN ID。
  8. 根据权利要求1或5所述的方法,其特征在于,所述依据所述第四报文的目的IP地址转发所述第四报文包括:
    在IP路由转发实例路由表中查找到所述第四报文的目的IP地址匹配的IP路由表项;
    若所述IP路由表项的出接口为从所述网关设备至第二AP的SRv6隧道口,则在已获得的Locator路由中查找与第二AP的Locator匹配的第二Locator路由,通过第二Locator路由中的出接口转发第七报文;所述第二Locator路由中的出接口为所述网关设备上用于向所述第二AP进行SRv6业务转发的三层接口;所述第七报文是通过在所述第四报文上至少增加IPv6封装头得到的;所述第七报文携带的IPv6封装头中的目的IPv6地址至少包括所述第二AP被分配的Locator、Function,所述第七报文携带的IPv6封装头中的源IPv6地址至少包括所述网关设备被分配的Locator、Function。
  9. 根据权利要求8所述的方法,其特征在于,所述Function至少包括:Function类型和Function操作指令值;
    所述第七报文携带的IPv6封装头中目的IPv6地址和源IPv6地址中的Function包含相同的Function操作指令值,该Function操作指令值为第二业务VLAN ID;
    所述第二业务VLAN ID为所述第七报文所属的业务VLAN ID。
  10. 根据权利要求8所述的方法,其特征在于,该方法进一步包括:
    当学习到任一AP下挂的终端的IP地址时,确定与终端IP地址匹配的Function,将该Function、所述终端IP地址上报至网络侧,以使从所述网络侧发向所述终端的报文所携带的IPv6封装头中的目的IPv6地址至少包含所述Function;
    其中,所述与终端IP地址匹配的Function用于指示IPv6解封装、以及查找所述终端IP地址匹配的用于向所述终端转发报文的IP路由转发实例路由表;其中,当所述终端IP地址为IPv4时,所述IP路由转发实例路由表为IPv4 VPN路由表;当所述终端IP地址为IPv6时,所述IP路由转发实例路由表为IPv6 VPN路由表。
  11. 根据权利要求1所述的方法,其特征在于,该方法进一步包括:
    当本地不存在第二报文的源MAC地址匹配的MAC表项时,对第二报文进行MAC学习,得到第二报文的源MAC地址匹配的MAC表项;所述MAC表项中至少包括:第二报文的源MAC地址、VSI实例、出接口信息,所述VSI实例对应所述第二报文所属的业务VLAN ID。
  12. 一种报文转发方法,其特征在于,该方法应用于所述三层网络中网关设备下连的接入点设备AP,所述网关设备与所述AP之间存在SRv6隧道,所述AP、所述网关设备以及所述网关设备下连的其他AP均被分配不同的位置标识Locator;该方法包括:
    当需要向所述网关设备转发报文时,在该报文携带IPv6封装头并通过从本AP至所述网关设备之间的SRv6隧道转发;所述IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,所述IPv6封装头中的源IP地址至少包括本AP被分配的Locator、Function;
    当通过从本AP至所述网关设备之间的SRv6隧道接收报文时,对接收的报文进行IPv6解封装并依据解封装后的报文的目的MAC地址转发报文。
  13. 根据权利要求12所述的方法,其特征在于,所述IPv6封装头中目的IPv6地址和源IPv6地址中的Function相同,均为第三业务VLAN ID;
    所述第三业务VLAN ID为需要向网关设备转发的报文所属的业务VLAN ID。
  14. 一种报文转发装置,其特征在于,该装置应用于所述三层网络中的网关设备,所述网关设备与下连的接入点设备AP之间存在SRv6隧道,所述网关设备、以及所述网关设备下连的不同AP均被分配不同的位置标识Locator;该装置包括:
    报文接收单元,用于通过所述SRv6隧道接收到第一报文,或者接收到来自网络侧的第三报文;
    报文处理单元,用于当通过所述SRv6隧道接收到第一报文,所述第一报文携带的IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,对所述第一报文进行IPv6封装头解封装,得到第二报文,所述第二报文的目的MAC地址为所述网关设备上与所述Function绑定的VSI实例所关联的三层网关接口MAC地址,依据所述第二报文中的目的IP地址转发所述第二报文;以及,
    当接收到来自网络侧的第三报文,所述第三报文携带的IPv6封装头中的目的IPv6地址至少包括所述网关设备被分配的Locator,对所述第三报文进行IPv6解封装,得到第四报文,依据所述第四报文的目的IP地址转发所述第四报文。
  15. 一种报文转发装置,其特征在于,该装置应用于所述三层网络中网关设备下连的接入点设备AP,所述网关设备与所述AP之间存在SRv6隧道,所述AP、所述网关设备以及所述网关设备下连的其他AP均被分配不同的位置标识Locator;该方法包括:
    接收单元,用于通过从本AP至所述网关设备之间的SRv6隧道接收报文;
    转发单元,用于当需要向所述网关设备转发报文时,在该报文携带IPv6封装头并通过从本AP至所述网关设备之间的SRv6隧道转发;所述IPv6封装头中的目的IP地址至少包括所述网关设备被分配的Locator、功能Function,所述IPv6封装头中的源IP地址至少包括本AP被分配的Locator、Function;以及,
    当通过从本AP至所述网关设备之间的SRv6隧道接收报文时,对接收的报文进行IPv6解封装并依据解封装后的报文的目的MAC地址转发报文。
PCT/CN2022/084010 2022-03-30 2022-03-30 报文转发方法及装置 WO2023184220A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/084010 WO2023184220A1 (zh) 2022-03-30 2022-03-30 报文转发方法及装置
CN202280000652.8A CN116965146A (zh) 2022-03-30 2022-03-30 报文转发方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/084010 WO2023184220A1 (zh) 2022-03-30 2022-03-30 报文转发方法及装置

Publications (1)

Publication Number Publication Date
WO2023184220A1 true WO2023184220A1 (zh) 2023-10-05

Family

ID=88198435

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084010 WO2023184220A1 (zh) 2022-03-30 2022-03-30 报文转发方法及装置

Country Status (2)

Country Link
CN (1) CN116965146A (zh)
WO (1) WO2023184220A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110891022A (zh) * 2019-11-20 2020-03-17 Ut斯达康通讯有限公司 基于SRv6的虚拟子网标识符发布方法和装置
CN112422435A (zh) * 2020-11-13 2021-02-26 新华三技术有限公司合肥分公司 报文转发控制方法、装置和电子设备
CN113207192A (zh) * 2021-03-29 2021-08-03 新华三信息安全技术有限公司 一种报文转发方法及装置
CN113301667A (zh) * 2021-03-31 2021-08-24 新华三信息安全技术有限公司 一种报文转发方法及装置
CN113438161A (zh) * 2020-03-23 2021-09-24 华为技术有限公司 一种生成段标识sid的方法和网络设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110891022A (zh) * 2019-11-20 2020-03-17 Ut斯达康通讯有限公司 基于SRv6的虚拟子网标识符发布方法和装置
CN113438161A (zh) * 2020-03-23 2021-09-24 华为技术有限公司 一种生成段标识sid的方法和网络设备
CN112422435A (zh) * 2020-11-13 2021-02-26 新华三技术有限公司合肥分公司 报文转发控制方法、装置和电子设备
CN113207192A (zh) * 2021-03-29 2021-08-03 新华三信息安全技术有限公司 一种报文转发方法及装置
CN113301667A (zh) * 2021-03-31 2021-08-24 新华三信息安全技术有限公司 一种报文转发方法及装置

Also Published As

Publication number Publication date
CN116965146A (zh) 2023-10-27

Similar Documents

Publication Publication Date Title
CN106789667B (zh) 一种数据转发方法、相关设备及系统
CN107733799B (zh) 一种报文传输方法和装置
CN112087386B (zh) 一种报文处理的方法、设备和系统
CN108600074B (zh) 组播数据报文的转发方法及装置
JP2017536765A (ja) モバイル環境におけるフローベースのアドレス指定のためのシステム及び方法
JP6722816B2 (ja) パケット転送
EP2907266A1 (en) Ip multicast service leave process for mpls-based virtual private cloud networking
WO2014057402A1 (en) Ip multicast service join process for mpls-based virtual private cloud networking
WO2019137355A1 (zh) 传输数据的方法、设备和网络系统
WO2017124709A1 (zh) 流量工程隧道建立方法和装置
US9438557B2 (en) Adaptive dynamic host configuration protocol assignment with virtual local area network pool
CN110430076B (zh) 一种路由管理方法及装置
CN113207192A (zh) 一种报文转发方法及装置
CN104702476A (zh) 分布式网关、基于分布式网关的报文处理方法及装置
CN106209616B (zh) 一种泛洪抑制方法及装置
US11012412B2 (en) Method and system for network traffic steering towards a service device
CN103731349A (zh) 一种以太网虚拟化互联邻居间报文转发方法和边缘设备
WO2018019216A1 (zh) Ap接入控制
WO2018161795A1 (zh) 一种路由优先级配置方法、设备以及控制器
CN107547404A (zh) 流表生成方法及装置以及报文转发方法及装置
US10476786B2 (en) Method and system using a scalable label scheme for aliasing in a multihomed Ethernet virtual private network (EVPN) network
CN109936490A (zh) 基于VXLAN和OpenFlow的虚拟家庭网络共享方法及系统
WO2023184220A1 (zh) 报文转发方法及装置
CN108881024B (zh) 一种组播流量转发方法及装置
CN104471538A (zh) 一种数据流处理方法、设备和系统

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202280000652.8

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22934073

Country of ref document: EP

Kind code of ref document: A1