A method and apparatus for implementing three-layer forwarding

CN117411825BActive Publication Date: 2026-08-07NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEW H3C TECH CO LTD
Filing Date
2023-09-20
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

但是,RPR扩展帧的字节大于RPR基本帧帧,占用的网络开销大,不利于RPR环网的带宽资源利用

Benefits of technology

[0011] The beneficial effect of this application is that by carrying Layer 3 IP packets through RPR basic frames, the RPR packet encapsulation overhead is reduced, RPR bandwidth is saved, and users have a better user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117411825B_ABST
    Figure CN117411825B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for realizing three-layer forwarding. The method comprises the following steps: determining a source MAC address of an Ethernet message forwarded by ring-up as a RPR VLAN gateway MAC address of a ring-up mapping table and a destination MAC address as a RPR MAC address; stripping the Ethernet head of the Ethernet message forwarded by ring-up; and encapsulating an inner IP message of the Ethernet message forwarded by ring-up as a RPR message with a RPR basic frame identifier; wherein the source RPR MAC address and the destination RPR MAC address of the RPR head of the RPR message are respectively the RPR MAC address of the device and the destination MAC address of the Ethernet message forwarded by ring-up; the VLAN identifier of the RPR head is the identifier of the RPR VLAN; and the RPR message is sent through an out port corresponding to the destination RPR MAC address of the RPR message in a RPR ring selection table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to communication technology, specifically a method and device for implementing three-layer forwarding. Background Technology

[0002] RPR (Resilient Packet Ring) is a new type of MAC (Media Access Control) protocol that uses RPR MAC layer frame encapsulation to achieve transparent transmission over RPR via Ethernet.

[0003] Within a single RPR ring, the direction in which an RPR node sends RPR data packets clockwise is ring 0, also known as the Outer Ring; the direction in which an RPR node sends RPR packets counterclockwise is ring 1, also known as the Inner Ring. RPR nodes send RPR data packets on ring 0 and receive them on ring 1 via eastward physical ports; conversely, they receive RPR data packets on ring 0 and send them on ring 1 via westward physical ports.

[0004] The east-west physical ports and west-facing physical ports of each RPR node form the RPR logical port. The RPR chip sends RPR packets to the RPR logical port for lower-loop forwarding, and the switching chip sends Ethernet packets to the RPR logical port for upper-loop forwarding. Within the RPR node, RPR packets are sent by the RPR chip to the switching chip through the internal physical Ethernet port for lower-loop forwarding; Ethernet packets are sent by the switching chip to the RPR chip through the internal port for upper-loop forwarding.

[0005] When an RPR node enables the MAC address of each VLAN to be set to the RPR node's RPR MAC address, and each RPR node confirms that the Ethernet packets forwarded on the ring require Layer 3 forwarding, it can remove the Ethernet header of the Ethernet packet and directly encapsulate it with an RPR header as the inner IP packet. This means the inner IP packet is encapsulated into an RPR base frame for forwarding. When an RPR node receives an RPR base frame, it removes the outer RPR header, uses the RPR MAC address (which serves as the gateway MAC address) as the source MAC address, and uses the MAC address corresponding to the destination IP address as the destination IP address. It then re-encapsulates the Ethernet header and sends the encapsulated Ethernet packet to the destination device.

[0006] However, if some RPR nodes on the ring network do not support setting the RPR MAC address of the RPR node to the gateway MAC address of each VLAN, then all RPR nodes in the network will be unable to forward Layer 3 IP packets using the standard RPR frame. Instead, they will need to first perform Layer 3 forwarding to re-encapsulate the Ethernet header into an inner IP packet, and then encapsulate the RPR header, i.e., encapsulate it into an RPR extended frame, and then send the RPR extended frame to the destination RPR node. However, the RPR extended frame is larger than the RPR base frame, consuming more network overhead and hindering the utilization of bandwidth resources in the RPR ring network. Summary of the Invention

[0007] The purpose of this application is to provide a method and device for implementing Layer 3 forwarding, so that when the RPR MAC address of the RPR node in the RPR ring network is different from the gateway MAC address of each VLAN, Layer 3 IP packets are forwarded through RPR basic frames in the RPR ring network.

[0008] To achieve the above objectives, this application provides a method for implementing Layer 3 forwarding. The method includes: determining that the source MAC address of the Ethernet packet forwarded on the ring is the RPR VLAN gateway MAC address in the ring mapping table and the destination MAC address is the RPR MAC address; stripping the Ethernet header of the Ethernet packet forwarded on the ring; encapsulating the first inner IP packet of the Ethernet packet forwarded on the ring into a first RPR packet with an RPR basic frame identifier; wherein the source RPR MAC address and destination RPR MAC address of the first RPR header of the first RPR packet are the local device's RPR MAC address and the destination MAC address of the Ethernet packet forwarded on the ring, respectively; the VLAN identifier of the first RPR header is the identifier of the RPR VLAN; and sending the packet through the output port corresponding to the destination RPR MAC address in the RPR ring selection table.

[0009] To achieve the above objectives, this application also provides a device for implementing Layer 3 forwarding, the device comprising:

[0010] The configuration module is used to set up the upper ring mapping table and the lower ring mapping table for the resilient packet ring processing unit. The upper ring mapping table records the MAC address of the RPR VLAN gateway; the lower ring mapping table records the MAC address of the RPR VLAN gateway mapped by the RPR VLAN. The resilient packet ring processing unit receives the Ethernet packets forwarded from the upper ring through the switching unit via an internal port; determines that the source MAC address of the Ethernet packets forwarded from the upper ring is the RPR VLAN gateway MAC address in the upper ring mapping table and the destination MAC address is the RPR MAC address of another RPR device; removes the Ethernet header of the Ethernet packets forwarded from the upper ring; encapsulates the first inner IP packet of the Ethernet packets forwarded from the upper ring into a first RPR packet with an RPR basic frame identifier; wherein, the source RPR MAC address and destination RPR MAC address of the first RPR header of the first RPR packet are the RPR MAC address of this device and the destination MAC address of the Ethernet packets forwarded from the upper ring, respectively; the VLAN identifier of the first RPR header is the identifier of the RPR VLAN; and sends it through the output port corresponding to the destination RPR MAC address of the first RPR packet in the RPR ring selection table.

[0011] The beneficial effect of this application is that by carrying Layer 3 IP packets through RPR basic frames, the RPR packet encapsulation overhead is reduced, RPR bandwidth is saved, and users have a better user experience. Attached Figure Description

[0012] Figure 1 A flowchart illustrating an embodiment of the method for implementing Layer 3 forwarding provided in this application;

[0013] Figure 2A-2B A schematic diagram illustrating the implementation of extended frame forwarding provided in this application;

[0014] Figure 3 This is a schematic diagram of a device embodiment for implementing Layer 3 forwarding provided in this application. Detailed Implementation

[0015] The following detailed description will be provided with reference to several examples illustrated in the accompanying figures. In this detailed description, numerous specific details are used to provide a comprehensive understanding of the present application. Known methods, steps, components, and circuits are not described in detail in the examples to avoid obscuring their meaning.

[0016] In the terminology used, the term "including" means including but not limited to; the term "containing" means including but not limited to; the terms "above," "within," and "below" include the number itself; the terms "greater than" and "less than" mean not including the number itself. The term "based on" means based on at least a portion of them.

[0017] Figure 1The flowchart of the implementation method for Layer 3 forwarding provided in this application includes the following steps:

[0018] Step 101: Determine that the source MAC address of the Ethernet packet forwarded on the ring is the RPR VLAN gateway MAC address in the ring mapping table and the destination MAC address is the RPR MAC address.

[0019] Step 102: Remove the Ethernet header from the Ethernet packets forwarded on the ring.

[0020] Step 103: Encapsulate the inner IP packet of the Ethernet packet forwarded on the ring into an RPR packet with an RPR basic frame identifier; wherein, the source RPR MAC address and destination RPR MAC address of the RPR header of the RPR packet are the RPR MAC address of this device and the destination MAC address of the Ethernet packet forwarded on the ring, respectively; the VLAN identifier of the RPR header is the identifier of the RPR VLAN.

[0021] Step 104: Send the RPR message through the output port corresponding to the destination RPR MAC address in the RPR ring selection table.

[0022] Figure 1 The beneficial effect of this embodiment is that by carrying Layer 3 IP packets through RPR basic frames, the RPR packet encapsulation overhead is reduced, RPR bandwidth is saved, and users have a better user experience.

[0023] Figure 2A-2B The diagram illustrating the implementation of extended frame forwarding provided in this application uses the example of packet forwarding between terminals T1 and T2 in different VLANs accessed by node A and node C.

[0024] Figure 2A In this example, the VLAN of RPR ring network 200 is VLAN 2000. Node A has configured an upper-ring mapping table 210 to record the virtual MAC address MAC2001 of Node A in RPR ring network 200; the RPR VLAN virtual MAC address is used as the gateway MAC address for Layer 3 forwarding within the RPR VLAN. Node C has configured an upper-ring mapping table entry 310 to record the virtual MAC address MAC2003 of Node C in RPR VLAN 2000.

[0025] The static routing table of node A sets the next hop of the VLAN 3000 network segment route to the IP address 20.0.0.3 of the RPR logical port on node C; the static routing table of node C sets the next hop of the VLAN 1000 network segment to the IP address 20.0.0.1 of the RPR logical port on node A.

[0026] Node A's Ethernet chip generates a node ARP request packet 201. The outer Ethernet header contains a source MAC address of MAC2001 and a destination MAC address (the broadcast MAC address). The inner ARP packet contains a sender IP address of 20.0.0.1 and a sender MAC address of MAC2001. The target IP address is 20.0.0.3. Node A's Ethernet chip forwards the ARP request packet 201 to the RPR logical port via InternalPort A for loopback.

[0027] Node A's RPR chip receives ARP request message 201 and modifies both the source MAC address and the sender MAC address of ARP request message 201 to Node A's RPR MAC A; i.e., ARP request message 201'. Node A's RPR chip encapsulates an RPR header for ARP request message 201'; the source RPR MAC address is RPR MAC A, and the destination MAC address is the RPR broadcast MAC address, i.e., RPR message 202. Node A selects a physical port A1 in the RPR logical ports to send RPR message 202.

[0028] The RPR chip at node C receives RPR message 202 through physical port C1 of the RPR ring network; it learns the RPR MAC address table entry based on the source RPR MAC address RPR MAC A and the source MAC address of the APR request message 201'.

[0029] The RPR chip of node C removes the RPR header of RPR message 202 to obtain the inner ARP request message 201', and sends the ARP request message 201' to the Ethernet chip through Internal Port C to perform loopback.

[0030] When the Ethernet chip of node C receives the ARP request message 201', it learns ARP entry 321 in ARP entry 320 based on the sender's IP address 20.0.0.1 and sender's MAC address RPR MAC A, and the output port is the internal port InternalPort C of node C.

[0031] The Ethernet chip of node C generates an ARP response packet 203; in which the sending IP address is IP20.0.0.3 and the sending MAC address is MAC2003; the destination IP address is 20.0.0.1 and the destination MAC address is RPR MAC A; the source MAC address of the outer Ethernet header is MAC2003 and the destination MAC address is RPR MAC A, and it is sent to the RPR logical port for looping through the internal port C.

[0032] When node C’s RPR chip receives ARP response message 203, it finds the source MAC address 2003 in the upper ring mapping table entry 310 and modifies both the inner sender MAC address and the source MAC address in the Ethernet header to RPR MAC C (node ​​C’s RPR MAC address), which is the modified ARP response message 203'.

[0033] The RPR chip of node C encapsulates the outer RPR header of the ARP response message 203' according to the learned RPR MAC address table entries; the source RPR MAC address is RPR MAC C; the destination RPR MAC address is also RPR MAC A; that is, RPR message 204.

[0034] Node C sends an RPR message 204 to Node C based on the output port C1 of RPR MAC A in the RPR ring selection table (i.e., the physical port on the path to Node A on the RPR ring network topology that is closest to Node A / the physical port on the path with the same number of hops but with a higher priority).

[0035] Node A's RPR chip receives RPR message 204 through the RPR ring network; it learns MAC address entries based on the source RPR MAC address (RPR MAC C) and the RPR MAC C set to the source MAC address of APR message 203'. Node A's RPR chip removes the RPR header from RPR message 204 and sends an ARP request message 203' to the Ethernet chip's lower ring via its internal interface, Internal Port A.

[0036] The Ethernet chip of node A receives ARP response message 203' and learns ARP entry 221 based on the sender's IP address IP20.0.0.3 and the sender's MAC address RPR MAC C.

[0037] Nodes B and D can use the same method as Node A or Node C for their ARP entries, based on the above approach.

[0038] like Figure 2BAs shown, before terminal T1, belonging to VLAN 1000, sends an IP data packet to terminal T2, it determines that terminal T2's IP address, IP 30.0.0.3333, is not in the same network segment. Terminal T1 sends an ARP request packet (not shown in the figure) requesting the MAC address of the VLAN 1000 gateway. The sender IP address is 10.0.0.1111, the sender MAC address is MAC T1, and the target IP address is the gateway IP address of VLAN 1000.

[0039] Node A (switching chip) receives an ARP request packet 301 from terminal T1 through port E10. Based on the requesting IP address and MAC address of the ARP request packet 301, and the VLAN 1000 to which the receiving port of the ARP request packet 301 belongs, it records ARP entry 212 in ARP table 220; where IP 10.0.0.1111 corresponds to MAC T1 and port E10.

[0040] Node A sends an ARP response packet 302 to terminal T1 in VLAN 1000. The sender's IP address and MAC address are the gateway IP address and MAC address (MAC1001) of VLAN 1000, respectively. The destination IP address and MAC address are terminal T1's IP address (10.0.0.1111) and MAC address (MAC T1), respectively, with VLAN ID 1000. The access switch (not shown in the diagram) of terminal T1 receives the ARP response packet 302, finds the matching destination MAC address on the egress port, removes the VLAN 1000 tag, and forwards it to terminal T1 through egress port E10.

[0041] Terminal T1 receives ARP response message 302. After learning the ARP table entries based on the sender's IP address and MAC address, it forwards the Layer 3 IP packet destined for Terminal T2 to the gateway of VLAN 1000. Terminal T1 encapsulates the Layer 3 IP packet destined for Terminal T2 into an Ethernet header according to the ARP table entries; the destination MAC address and source MAC address are MAC 1001 and MAC T1, respectively; and then sends the encapsulated Ethernet datagram 303 to Node A.

[0042] The switching chip of node A receives Ethernet data packet 303 from terminal T1. Based on MAC1001, which is the destination MAC address, it finds the MAC address table entry with the three-layer attribute and determines to perform three-layer forwarding.

[0043] The switching chip of node A removes the Ethernet header, finds the destination IP address 30.0.0.3333 based on the static route, and finds the next hop of the network segment route 30.0.0.0 as 20.0.0.3. Based on the next hop of the network segment route 30.0.0.0 as 20.0.0.3, it looks up ARP entry 212 and encapsulates the Ethernet header for the IP datagram according to ARP entry 212. The source MAC address is the MAC address of VLAN 2000, MAC 2001, and the destination MAC address is RPR MAC C. The re-encapsulated Ethernet packet 303' after Layer 3 forwarding is sent to the ring of the RPR chip through the RPR logical port.

[0044] Node A's RPR chip receives the re-encapsulated Ethernet packet 303'. It looks up the source MAC address 2001 in the upper-ring mapping table 210, and confirms that the destination MAC address (RPR MAC C) of the Ethernet packet 303' is the site's MAC address. It then determines to perform RPR basic frame encapsulation. Node A's RPR chip removes the Ethernet header from the Ethernet packet 303', adds an RPR header with the RPR basic frame identifier to the IP datagram, sets the source RPR MAC address to RPR MAC A, sets the destination RPR MAC address to RPR MAC C, and sets the RPR VLAN to VLAN 2000. Figure 2B 304 shown.

[0045] The RPR chip of node A sends an RPR basic frame message 304 to node C based on the output port A1 of RPR MAC C in the RPR ring selection table (i.e., the physical port on the path to node C on the RPR ring network topology that is closest to node C / the physical port on the same path with the same number of hops but with a higher priority).

[0046] The RPR chip at node C receives RPR basic frame 304' on the RPR ring network through physical port C1. It looks up the local MAC address MAC 2003 corresponding to VLAN 2000 in the lower ring mapping table 330. It strips the RPR header of RPR basic frame 304, encapsulates the Ethernet header, sets the source MAC address to the source address RPR MAC A of the RPR basic frame, and sets the destination MAC address to the local MAC address MAC 2003 (the gateway MAC address of VLAN 2000 in the lower ring mapping table). In other words, RPR frame 304' is converted into Ethernet packet 305 and sent through Internal Port C. The Ethernet chip then performs lower ring processing on Ethernet packet 305.

[0047] Node C's Ethernet chip receives Ethernet packet 305. Based on the outer destination MAC address MAC 2003, it determines to perform Layer 3 forwarding, removes the Ethernet header of Ethernet packet 305, and looks up ARP entry 322 in ARP table 320 based on the destination IP address IP 30.0.0.3333 of the inner IP packet. It then encapsulates the source MAC address (MAC 3001) and destination MAC address (MAC T2) in the Ethernet packet header, sets the VLAN to VLAN 3000 (i.e., Ethernet packet 306), and sends Ethernet packet 306 through the ARP entry's output port E30. Terminal T2 receives Ethernet packet 306, removes the outer Ethernet header, parses the data carried in the IP packet, and finally, the IP packet from terminal T1 is sent to the destination terminal T2.

[0048] Figure 2B If ARP entry 322 in node C has been aged out and the Ethernet chip in node C has not found the ARP entry for IP 30.0.0.3333, then an ARP request packet is generated using the gateway IP address and MAC address of VLAN 3000 as the sending IP address and sending MAC address. After receiving the ARP response packet from terminal T2 and learning ARP entry 322, a Layer 3 forwarding is performed. The Ethernet header of Ethernet packet 305 is stripped, a new Ethernet header is encapsulated based on ARP entry 322, and then the packet is sent according to the outgoing port of ARP entry 322.

[0049] Node A also has a pre-defined lower-ring mapping table 230. The upper-ring mapping tables 210 and 310, and the lower-ring mapping tables 230 and 330 of nodes A and C are configured in the same way. IP packets sent from terminal T2 to terminal T1... Figure 2A and 2B The forwarding mechanism is the same. Node C finds the next-hop IP address of terminal T1's destination IP address 10.0.0.1111 as 20.0.0.1 based on the static route. The way node C sends ARP request packets and the way node A sends ARP response packets to node C are the same. Figure 2A This application will not elaborate further.

[0050] Although this application uses ARP request and ARP response messages of the ARP protocol in IPv4 networks as examples to illustrate the loop-up and loop-down processing of hardware address request / messages, this application can also be used for the ND protocol in IPv6 networks.

[0051] The beneficial effect of this application is that even if the RPR node cannot support setting the gateway MAC address of different VLANs to the RPR node's RPR MAC address, it can still carry Layer 3 IP packets through the RPR basic frame, reducing RPR packet encapsulation overhead, saving RPR bandwidth, and providing users with a better user experience.

[0052] Figure 3 This is a schematic diagram of an embodiment of a device for implementing Layer 3 forwarding provided in this application. The device 30 includes: a switching unit, a resilient packet ring processing unit, a CPU, and a memory. The switching unit can be implemented using a switching chip, and the resilient packet ring processing unit can be implemented using an FPGA chip. The processor executes a setup module by running processor-executable instructions in the memory.

[0053] The configuration module is used to set up the upper ring mapping table and the lower ring mapping table for the resilient packet ring processing unit. The upper ring mapping table records the MAC address of the RPR VLAN gateway; the lower ring mapping table records the MAC address of the RPR VLAN gateway mapped by the RPR VLAN. The resilient packet ring processing unit receives the Ethernet packets forwarded from the upper ring through the switching unit via an internal port; determines that the source MAC address of the Ethernet packets forwarded from the upper ring is the RPR VLAN gateway MAC address in the upper ring mapping table and the destination MAC address is the RPR MAC address of another RPR device; removes the Ethernet header of the Ethernet packets forwarded from the upper ring; encapsulates the first inner IP packet of the Ethernet packets forwarded from the upper ring into a first RPR packet with an RPR basic frame identifier; wherein, the source RPR MAC address and destination RPR MAC address of the first RPR header of the first RPR packet are the RPR MAC address of this device and the destination MAC address of the Ethernet packets forwarded from the upper ring, respectively; the VLAN identifier of the first RPR header is the identifier of the RPR VLAN; and sends it through the output port corresponding to the destination RPR MAC address of the first RPR packet in the RPR ring selection table.

[0054] The resilient packet ring processing unit is also used to receive a second RPR packet with an RPR base frame identifier through a physical port of the RPR logical port; look up the lower ring mapping table according to the RPR VLAN identifier in the second RPR header of the second RPR packet; find the RPR VLAN gateway MAC address corresponding to the RPR VLAN identifier in the lower ring mapping table; strip the second RPR header and encapsulate the second inner IP packet of the second RPR packet into an Ethernet packet for lower ring forwarding; wherein the source MAC address and destination MAC address of the Ethernet packet for lower ring forwarding are the source address RPR MAC address and the RPR VLAN gateway MAC address of the second RPR packet, respectively; send it to the switching unit through the internal port; the switching unit, according to the RPR header of the Ethernet packet as the destination MAC address of the Ethernet packet for lower ring forwarding, performs the following processing: The VLAN gateway MAC address is used to determine whether to perform Layer 3 forwarding. The Ethernet header of the Ethernet packet forwarded on the lower ring is removed, and the ARP table is looked up based on the destination IP address of the second inner IP packet. A new Ethernet header is encapsulated for the second inner IP packet. The VLAN identifier in the new Ethernet header is the local VLAN found in the ARP table entry. The source MAC address is the gateway MAC address of the local VLAN. The destination MAC address is the MAC address of the found ARP table entry. The packet is sent through the outgoing port of the found ARP table entry.

[0055] The switching unit is also used to: read the next-hop address for reaching other nodes in the RPR VLAN from the static routing table; generate a first ARP request packet requesting the mapped MAC address of the next-hop address; wherein the source MAC address is the RPR VLAN gateway MAC address; the destination MAC address is the broadcast MAC address; the sender IP address is the RPR VLAN gateway IP address; the sender MAC address is the RPR VLAN gateway MAC address; the destination IP address is the next-hop address; and forward the packet to the elastic packet ring processing unit via an internal port for ring forwarding; the elastic packet ring processing unit modifies the source MAC address and sender MAC address of the first ARP request packet to the local device's RPR MAC address; encapsulates the first ARP request packet with a third RPR header using the local device's RPR MAC address as the source RPR MAC address, the RPR broadcast MAC address as the destination MAC address, and the RPR broadcast MAC address as the destination RPR broadcast MAC address; and selects a physical port in the RPR VLAN bound RPR logical port to send the first ARP request packet with the third RPR header.

[0056] The resilient packet ring processing unit receives a second ARP request packet with a fourth RPR header through a physical port of the RPR logical port; it learns the RPR MAC address table entry based on the source RPR MAC address in the fourth RPR header and the source MAC address of the second ARP request packet; it removes the fourth RPR header and sends the packet to the switching unit through an internal port; the switching unit learns the second ARP table entry based on the sender's IP address and MAC address of the second ARP request packet and the RPR VLAN; the output port is an internal port.

[0057] The switching unit is also used to generate a first ARP response packet; wherein the sending IP address is the RPR VLAN gateway IP address; the sending MAC address is the RPR VLAN gateway MAC address; the destination IP address and the destination MAC address are the sending IP address and sending MAC address of the second ARP request packet; the source MAC address is the RPR VLAN gateway MAC address, and the destination MAC address is the source MAC address of the second ARP request packet; the packet is forwarded to the elastic packet ring processing unit through an internal port; the elastic packet ring processing unit looks up the RPR VLAN gateway MAC address as the source MAC address of the first ARP response packet in the ring mapping table; modifies the sending MAC address of the first ARP response packet and the source MAC address of the Ethernet header to the local device's RPR MAC address; looks up the RPR MAC address entry corresponding to the destination MAC address of the first ARP response packet in the RPR MAC address table; and encapsulates the first ARP response packet with a fifth RPR header; wherein the source RPR MAC address and destination RPR MAC address of the fifth RPR header are the local device's RPR MAC address and the found RPR MAC address, respectively. The RPR MAC address of other node devices in the MAC address table entry; sent through the output port corresponding to the destination RPR MAC address in the fifth RPR header of the RPR ring select table.

[0058] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for implementing layer 3 forwarding, characterized in that, The method includes: The source MAC address of the Ethernet packets forwarded on the ring is determined to be the RPR VLAN gateway MAC address in the ring mapping table, and the destination MAC address is the RPR MAC address; the ring mapping table records the RPR VLAN gateway MAC address; Remove the Ethernet header from the Ethernet packets forwarded by the upper ring; The first inner IP packet of the Ethernet packet forwarded on the ring is encapsulated into a first RPR packet with an RPR basic frame identifier; wherein, the source RPR MAC address and destination RPR MAC address of the first RPR header of the first RPR packet are the RPR MAC address of this device and the destination MAC address of the Ethernet packet forwarded on the ring, respectively; the VLAN identifier of the first RPR header is the identifier of the RPR VLAN; Send the first RPR message through the output port corresponding to the destination RPR MAC address in the RPR ring select table.

2. The method according to claim 1, characterized in that, The method also includes Receive the second RPR message with the RPR base frame identifier; The preset loopback mapping table is looked up based on the RPR VLAN identifier in the second RPR header of the second RPR message; The lower ring mapping table records the RPR VLAN gateway MAC address mapped to the RPR VLAN; The RPR VLAN gateway MAC address corresponding to the RPR VLAN identifier is found in the lower ring mapping table; The second RPR header is removed, and the second inner IP packet of the second RPR message is encapsulated into an Ethernet packet for loop forwarding; wherein the source MAC address and destination MAC address of the Ethernet packet for loop forwarding are the source address RPR MAC address of the second RPR message and the RPR VLAN gateway MAC address, respectively. Based on the RPR VLAN gateway MAC address, which serves as the destination MAC address of the Ethernet packet being forwarded in the lower loop, determine whether to perform Layer 3 forwarding; Strip the Ethernet header of the Ethernet packet forwarded by the lower ring, and look up the ARP table based on the destination IP address of the second inner IP packet; The second inner IP packet is encapsulated with a new Ethernet header; wherein the VLAN identifier of the new Ethernet header is the local VLAN found in the ARP table entry; the source MAC address is the gateway MAC address of the local VLAN; the destination MAC address is the MAC address of the found ARP table entry; and it is sent through the outgoing port of the found ARP table entry.

3. The method according to claim 1, characterized in that, The method further includes: Read the next-hop address from the static routing table to reach other nodes in the RPR VLAN; Generate a first ARP request packet requesting the mapped MAC address of the next-hop address; wherein, the source MAC address is the MAC address of the RPR VLAN gateway; the destination MAC address is the broadcast MAC address; the sending IP address is the IP address of the RPR VLAN gateway; the sending MAC address is the MAC address of the RPR VLAN gateway; and the destination IP address is the next-hop address; Modify the source MAC address and sender MAC address of the first ARP request packet to the RPR MAC address of this device; The first ARP request message is encapsulated with a third RPR header, using the source RPR MAC address and the destination RPR broadcast MAC address of the device as the RPR MAC address and the destination RPR broadcast MAC address. Select a physical port in the RPR VLAN bound RPR logical port to send a first ARP request message with a third RPR header.

4. The method according to claim 1, characterized in that, The method further includes: A second ARP request message with a fourth RPR header is received through one of the physical ports of the RPR logical port. Learn the RPR MAC address table entries based on the source RPR MAC address in the fourth RPR header and the source MAC address of the second ARP request message; Remove the fourth RPR header, and learn the second ARP entry based on the sender's IP address and MAC address of the second ARP request message and the RPR VLAN; wherein the outgoing port is the internal port for loop forwarding.

5. The method according to claim 4, characterized in that, The method further includes: Generate a first ARP response packet; wherein the sending IP address is the IP address of the RPR VLAN gateway; the sending MAC address is the MAC address of the RPR VLAN gateway; the destination IP address and destination MAC address are the sending IP address and sending MAC address of the second ARP request packet; the source MAC address is the MAC address of the RPR VLAN gateway, and the destination MAC address is the source MAC address of the second ARP request packet; and the packet is forwarded to the loop via the internal port. The RPR VLAN gateway MAC address, which is the source MAC address of the first ARP response packet, is found in the upper ring mapping table; Modify the MAC address of the sender of the first ARP response message and the source MAC address of the Ethernet header to the RPR MAC address of this device; The RPR MAC address entry corresponding to the destination MAC address of the first ARP response packet is found in the RPR MAC address table. The first ARP response message is encapsulated with a fifth RPR header; wherein the source RPR MAC address and destination RPR MAC address of the fifth RPR header are the RPR MAC address of this device and the RPR MAC address of other node devices found in the RPR MAC address table, respectively. Send via the output port corresponding to the destination RPR MAC address in the fifth RPR header described in the RPR ring selection table.

6. A device for implementing Layer 3 forwarding, characterized in that, The device includes: The configuration module is used to configure the upper ring mapping table and the lower ring mapping table for the Resilient Packet Ring Processing Unit; the upper ring mapping table records the MAC address of the RPR VLAN gateway; the lower ring mapping table records the MAC address of the RPR VLAN gateway mapped by the RPR VLAN. The resilient packet ring processing unit receives Ethernet packets forwarded from the switching unit via an internal port; determines that the source MAC address of the forwarded Ethernet packets is the RPR VLAN gateway MAC address in the up-ring mapping table and the destination MAC address is the RPR MAC address of another RPR device; removes the Ethernet header of the forwarded Ethernet packets; encapsulates the first inner IP packet of the forwarded Ethernet packets into a first RPR packet with an RPR basic frame identifier; wherein the source RPR MAC address and destination RPR MAC address of the first RPR header of the first RPR packet are the RPR MAC address of this device and the destination MAC address of the forwarded Ethernet packets, respectively; the VLAN identifier of the first RPR header is the identifier of the RPR VLAN; and sends the packet through the output port corresponding to the destination RPR MAC address of the first RPR packet in the RPR ring selection table.

7. The device according to claim 6, characterized in that, The elastic packet ring processing unit is also configured to receive a second RPR message with an RPR base frame identifier through a physical port of the RPR logical port; and look up the lower ring mapping table according to the RPR VLAN identifier in the second RPR header of the second RPR message; The RPR VLAN gateway MAC address corresponding to the RPR VLAN identifier is found in the lower-ring mapping table; the second RPR header is stripped, and the second inner IP packet of the second RPR packet is encapsulated into an Ethernet packet for lower-ring forwarding; wherein the source MAC address and destination MAC address of the Ethernet packet for lower-ring forwarding are the source address RPR MAC address of the second RPR packet and the RPR VLAN gateway MAC address, respectively; and it is sent to the switching unit through the internal port; The switching unit determines to perform Layer 3 forwarding based on the RPR VLAN gateway MAC address, which serves as the destination MAC address of the Ethernet packet forwarded in the lower loop; it removes the Ethernet header from the Ethernet packet forwarded in the lower loop, and looks up the ARP table based on the destination IP address of the second inner IP packet; it encapsulates a new Ethernet header for the second inner IP packet; wherein the VLAN identifier of the new Ethernet header is the local VLAN found in the ARP table entry; the source MAC address is the gateway MAC address of the local VLAN; the destination MAC address is the MAC address of the found ARP table entry; and it sends the packet through the egress port of the found ARP table entry.

8. The device according to claim 6, characterized in that, The switching unit is further configured to: read the next-hop address for reaching other nodes in the RPR VLAN from the static routing table; generate a first ARP request packet requesting the mapped MAC address of the next-hop address; wherein the source MAC address is the RPR VLAN gateway MAC address; the destination MAC address is the broadcast MAC address; the sending IP address is the RPR VLAN gateway IP address; the sending MAC address is the RPR VLAN gateway MAC address; the destination IP address is the next-hop address; and send the packet to the elastic packet ring processing unit for ring forwarding through the internal port. The elastic packet ring processing unit modifies the source MAC address and sender MAC address of the first ARP request packet to the local device's RPR MAC address; it encapsulates the first ARP request packet with a third RPR header using the local device's RPR MAC address as the source RPR MAC address and the RPR broadcast MAC address as the destination RPR broadcast MAC address; and it selects a physical port in the RPR VLAN-bound RPR logical port to send the first ARP request packet with the third RPR header.

9. The device according to claim 6, characterized in that, The elastic packet ring processing unit receives a second ARP request message with a fourth RPR header through a physical port of the RPR logical port; and learns RPR MAC address entries based on the source RPR MAC address in the fourth RPR header and the source MAC address of the second ARP request message. The fourth RPR header is removed and sent to the switching unit through the internal port; The switching unit learns a second ARP entry based on the sender's IP address and MAC address of the second ARP request message and the RPR VLAN; The output port is the internal port.

10. The device according to claim 9, characterized in that, The switching unit is further configured to generate a first ARP response message; wherein the sending IP address is the IP address of the RPR VLAN gateway; the sending MAC address is the MAC address of the RPR VLAN gateway; the destination IP address and the destination MAC address are the sending IP address and the sending MAC address of the second ARP request message; the source MAC address is the MAC address of the RPR VLAN gateway, and the destination MAC address is the source MAC address of the second ARP request message; and the message is sent to the elastic packet ring processing unit for ring forwarding through the internal port. The elastic packet ring processing unit finds the RPR VLAN gateway MAC address, which serves as the source MAC address of the first ARP response packet, in the upper ring mapping table; modifies both the sending MAC address of the first ARP response packet and the source MAC address of the Ethernet header to the local device's RPR MAC address; finds the RPR MAC address entry corresponding to the destination MAC address of the first ARP response packet in the RPR MAC address table; encapsulates the first ARP response packet with a fifth RPR header; wherein the source RPR MAC address and destination RPR MAC address of the fifth RPR header are the local device's RPR MAC address and the RPR MAC address of another node device in the found RPR MAC address entry, respectively; and sends the packet through the output port corresponding to the destination RPR MAC address of the fifth RPR header in the RPR ring selection table.

Citation Information

Patent Citations

  • Data forwarding method and device

    CN103841023A

  • Message forwarding method and VXLAN gateway

    CN108183919A