Message forwarding method and device

文档序号:1492630 发布日期:2020-02-04 浏览:9次 中文

阅读说明:本技术 一种报文转发方法及装置 (Message forwarding method and device ) 是由 项学锋 于 2019-10-22 设计创作,主要内容包括:本发明提供一种报文转发方法及装置,该方法包括:当所述RPR处理芯片接收到第一RPR报文时,解除所述第一RPR报文的RPR封装,以得到第一以太报文;所述RPR处理芯片在所述第一以太报文中添加第一RPR标签,并将带有所述第一RPR标签的第一以太报文通过内部以太口发送给所述交换芯片;当所述交换芯片未记录与所述第一以太报文的源MAC地址匹配的第一MAC表项时,根据所述第一站点标识,确定与所述第一站点标识对应的第一虚拟端口,并剥除所述第一RPR标签;所述交换芯片生成所述第一MAC表项,并对剥除第一RPR标签的第一以太报文进行转发。应用本发明实施例可以简化RPR处理芯片的处理,节省RPR处理芯片的性能和资源。(The invention provides a message forwarding method and a device, wherein the method comprises the following steps: when the RPR processing chip receives a first RPR message, the RPR packaging of the first RPR message is removed to obtain a first Ethernet message; the RPR processing chip adds a first RPR label in the first Ethernet message and sends the first Ethernet message with the first RPR label to the switching chip through an internal Ethernet port; when the switching chip does not record a first MAC table item matched with the source MAC address of the first Ethernet message, determining a first virtual port corresponding to the first site identifier according to the first site identifier, and stripping the first RPR label; and the switching chip generates the first MAC table item and forwards the first Ethernet message with the first RPR label stripped. The embodiment of the invention can simplify the processing of the RPR processing chip and save the performance and resources of the RPR processing chip.)

1. A message forwarding method is applied to resilient packet switching (RPR) switching equipment, the RPR switching equipment comprises a switching chip and an RPR processing chip, the switching chip is connected with the RPR processing chip through an internal Ethernet port, and the method is characterized in that a virtual port is allocated on the internal Ethernet port of the switching chip to each other RPR switching equipment on an RPR ring except the RPR switching equipment, and the method comprises the following steps:

when the RPR processing chip receives a first RPR message, the RPR packaging of the first RPR message is removed to obtain a first Ethernet message;

the RPR processing chip adds a first RPR label in the first Ethernet message and sends the first Ethernet message with the first RPR label to the switching chip through an internal Ethernet port; wherein, the first RPR label includes a first site identifier, and the first site identifier is identifier information of a source RPR switching device of the first RPR packet;

when the switching chip does not record a first MAC table item matched with the source MAC address of the first Ethernet message, determining a first virtual port corresponding to the first site identifier according to the first site identifier, and stripping the first RPR label; wherein, the first MAC entry records a corresponding relationship between a source MAC address of the first ethernet packet and the first virtual port;

and the switching chip generates the first MAC table item and forwards the first Ethernet message with the first RPR label stripped.

2. The method according to claim 1, wherein the switch chip issues preset rules respectively matching with each virtual port, and for any virtual port, a matching item of the preset rule matching with the virtual port is that a message ingress port is an internal ethernet port, and an RPR tag carried in a message includes a station identifier corresponding to the virtual port, and an action item of the preset rule is to determine that a source port of the message is the virtual port and strip the RPR tag carried in the message;

the switching chip determines a first virtual port corresponding to the first site identifier according to the first site identifier, and strips the first RPR label, including:

the exchange chip inquires a matched first preset rule according to the first site identification;

and determining a first virtual port corresponding to the first site identifier according to the first preset rule, and stripping the first RPR label.

3. The method of claim 1, further comprising:

when the switching chip receives a second Ethernet message from a non-internal Ethernet port and determines that the second Ethernet message is a two-layer message, inquiring a recorded MAC table entry according to a target MAC address of the second Ethernet message;

if the switching chip inquires a matched second MAC table entry and an output port of the second MAC table entry is a second virtual port, adding a second RPR label to the second Ethernet message, and sending the second Ethernet message with the second RPR label to the RPR processing chip through the second virtual port of the internal Ethernet port; the second MAC entry records a corresponding relationship between a destination MAC address of the second ethernet packet and the second virtual port, where the second RPR tag includes a second site identifier, and the second site identifier is identification information of an RPR switching device corresponding to the second virtual port;

the RPR processing chip strips the second RPR label and carries out RPR packaging on the second Ethernet message according to the second site identification to obtain a second RPR message;

and the RPR processing chip forwards the second RPR message.

4. The method of claim 3, wherein when the switch chip queries the matching second MAC entry and the egress port of the second MAC entry is a second virtual port, the method further comprises:

and the switching chip controls forwarding of the second Ethernet message based on a service control strategy issued on the second virtual port.

5. The method according to claim 3, wherein after the switch chip queries the recorded MAC entry according to the destination MAC address of the second ethernet packet, the method further comprises:

if the switching chip does not inquire the matched MAC table item, adding a third RPR label to the second Ethernet message, and sending the second Ethernet message with the third RPR label to the RPR processing chip through a specified virtual port of an internal Ethernet port; the third RPR label includes a third site identifier, where the third site identifier is a site identifier corresponding to the designated virtual port, and the designated virtual port is a virtual port for sending a broadcast packet;

the RPR processing chip strips the third RPR label and carries out RPR packaging on the second Ethernet message according to the third site identification to obtain a third RPR message;

and the RPR processing chip broadcasts the third RPR message.

6. The method of claim 5, wherein traffic isolation is provided between virtual ports on an internal Ethernet port of the switch chip.

7. A message forwarding device is applied to resilient packet RPR switching equipment, and the device comprises: the RPR switching device comprises a switching chip and an RPR processing chip, wherein the switching chip is connected with the RPR processing chip through an internal Ethernet port, and the switching chip is characterized in that a virtual port is allocated on the internal Ethernet port of the switching chip for each RPR switching device on an RPR ring except the RPR switching device, wherein:

the RPR processing chip is used for removing the RPR package of the first RPR message when the first RPR message is received so as to obtain a first Ethernet message;

the RPR processing chip is further configured to add a first RPR tag to the first ethernet packet, and send the first ethernet packet with the first RPR tag to the switch chip through an internal ethernet port; wherein, the first RPR label includes a first site identifier, and the first site identifier is identifier information of a source RPR switching device of the first RPR packet;

the switching chip is configured to determine, according to the first site identifier, a first virtual port corresponding to the first site identifier when a first MAC entry matching a source MAC address of the first ethernet packet is not recorded, and strip the first RPR tag; wherein, the first MAC entry records a corresponding relationship between a source MAC address of the first ethernet packet and the first virtual port;

the switching chip is further configured to generate the first MAC entry and forward the first ethernet packet with the first RPR tag stripped.

8. The apparatus according to claim 7, wherein the switch chip issues preset rules respectively matching with each virtual port, and for any virtual port, a matching item of the preset rule matching with the virtual port is that a message ingress port is an internal ethernet port, and an RPR tag included in a message includes a station identifier corresponding to the virtual port, and an action item of the preset rule is to determine that a source port of the message is the virtual port and strip the RPR tag included in the message;

the switching chip is specifically configured to query a first preset rule for matching according to the first site identifier; and determining a first virtual port corresponding to the first site identifier according to the first preset rule, and stripping the first RPR label.

9. The apparatus of claim 7,

the switch chip is further configured to query a recorded MAC entry according to a destination MAC address of a second ethernet packet when the second ethernet packet is received from a non-internal ethernet port and it is determined that the second ethernet packet is a layer two packet;

the switch chip is further configured to add a second RPR tag to the second ethernet packet and send the second ethernet packet with the second RPR tag to the RPR processing chip through the second virtual port of the internal ethernet port if the matched second MAC entry is found out and the output port of the second MAC entry is the second virtual port; the second MAC entry records a corresponding relationship between a destination MAC address of the second ethernet packet and the second virtual port, where the second RPR tag includes a second site identifier, and the second site identifier is identification information of an RPR switching device corresponding to the second virtual port;

the RPR processing chip is further configured to strip the second RPR label, and perform RPR encapsulation on the second ethernet packet according to the second site identifier to obtain a second RPR packet;

the RPR processing chip is further configured to forward the second RPR packet.

10. The apparatus of claim 9,

and the switching chip is further configured to, when the matched second MAC entry is queried and the output port of the second MAC entry is a second virtual port, perform forwarding control on the second ethernet packet based on a service control policy issued on the second virtual port.

11. The apparatus of claim 9,

the switching chip is further configured to add a third RPR tag to the second ethernet packet if the matching MAC entry is not found, and send the second ethernet packet with the third RPR tag to the RPR processing chip through a specified virtual port of the internal ethernet port; the third RPR label includes a third site identifier, where the third site identifier is a site identifier corresponding to the designated virtual port, and the designated virtual port is a virtual port for sending a broadcast packet;

the RPR processing chip is further configured to strip the third RPR label, and perform RPR encapsulation on the second ethernet packet according to the third site identifier to obtain a third RPR packet;

the RPR processing chip is further configured to broadcast the third RPR packet.

12. The apparatus of claim 11, wherein traffic isolation is provided between each virtual port on the internal ethernet port of the switch chip.

Technical Field

The present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for forwarding a packet.

Background

RPR (Resilient Packet Ring) is a new MAC (Media access control) protocol, and can be operated in SONET (Synchronous Optical Network)/SDH (Synchronous Digital Hierarchy), DWDM (Dense wavelength division Multiplexing), and ethernet, thereby providing a flexible and efficient networking scheme for broadband IP metropolitan area Network operators.

At present, an ethernet switch (which may be referred to as an RPR switch) supporting an RPR function is mainly implemented by attaching an RPR processing chip (which may be an FPGA (Field Programmable Gate Array) or a dedicated RPR processing chip) under a switch chip, where the switch chip and the RPR processing chip are connected through an internal ethernet interface, and data forwarding includes two layers: basic ethernet forwarding for the switching chip and RPR forwarding for the RPR processing chip.

However, practice shows that, in the current implementation scheme of the RPR switch, for the same user MAC address, a corresponding entry needs to be maintained on each of the switch chip and the RPR processing chip: the corresponding relation between the user MAC address and the internal Ethernet port is recorded on the switching chip, and the corresponding relation between the user MAC address and the site (namely RPR switch) ID is recorded on the RPR processing chip, so that the waste of resources and performance is caused.

Disclosure of Invention

The invention provides a message forwarding method and a message forwarding device, which are used for solving the problem of resource and performance waste caused by the fact that a switching chip and an RPR processing chip simultaneously maintain table entries of the same user MAC address.

According to a first aspect of the embodiments of the present invention, there is provided a packet forwarding method applied to an RPR switch device, where the RPR switch device includes a switch chip and an RPR processing chip, the switch chip and the RPR processing chip are connected through an internal ethernet port, and a virtual port is allocated on the internal ethernet port of the switch chip to each other RPR switch device on an RPR ring except the RPR switch device, where the method includes:

when the RPR processing chip receives a first RPR message, the RPR packaging of the first RPR message is removed to obtain a first Ethernet message;

the RPR processing chip adds a first RPR label in the first Ethernet message and sends the first Ethernet message with the first RPR label to the switching chip through an internal Ethernet port; wherein, the first RPR label includes a first site identifier, and the first site identifier is identifier information of a source RPR switching device of the first RPR packet;

when the switching chip does not record a first MAC table item matched with the source MAC address of the first Ethernet message, determining a first virtual port corresponding to the first site identifier according to the first site identifier, and stripping the first RPR label; wherein, the first MAC entry records a corresponding relationship between a source MAC address of the first ethernet packet and the first virtual port;

and the switching chip generates the first MAC table item and forwards the first Ethernet message with the first RPR label stripped.

According to a second aspect of the embodiments of the present invention, there is provided a packet forwarding apparatus, applied to an RPR switch device, the apparatus including: the switching chip is connected with the RPR processing chip through an internal Ethernet port, and a virtual port is allocated on the internal Ethernet port of the switching chip for each RPR switching device on the RPR ring except the RPR switching device, wherein:

the RPR processing chip is used for removing the RPR package of the first RPR message when the first RPR message is received so as to obtain a first Ethernet message;

the RPR processing chip is further configured to add a first RPR tag to the first ethernet packet, and send the first ethernet packet with the first RPR tag to the switch chip through an internal ethernet port; wherein, the first RPR label includes a first site identifier, and the first site identifier is identifier information of a source RPR switching device of the first RPR packet;

the switching chip is configured to determine, according to the first site identifier, a first virtual port corresponding to the first site identifier when a first MAC entry matching a source MAC address of the first ethernet packet is not recorded, and strip the first RPR tag; wherein, the first MAC entry records a corresponding relationship between a source MAC address of the first ethernet packet and the first virtual port;

the switching chip is further configured to generate the first MAC entry and forward the first ethernet packet with the first RPR tag stripped.

By applying the technical scheme disclosed by the invention, a virtual port is distributed on the internal Ethernet port of the switching chip for each RPR switching device except the RPR switching device on the RPR ring, and when the RPR processing chip receives the first RPR message, the RPR encapsulation of the first RPR message is removed to obtain the first Ethernet message; the RPR processing chip adds a first RPR label in the first Ethernet message and sends the first Ethernet message with the first RPR label to the switching chip through the internal Ethernet port; when the exchange chip does not record a first MAC table item matched with a source MAC address of the first Ethernet message, determining a first virtual port corresponding to a first site identifier according to the first site identifier, and stripping a first RPR label; the exchange chip generates a first MAC table item, forwards the first Ethernet message with the first RPR label stripped, and maintains the corresponding relation between the user MAC address and the RPR exchange equipment on the exchange chip, thereby simplifying the processing of the RPR processing chip and saving the performance and resources of the RPR processing chip.

Drawings

Fig. 1 is a schematic flowchart of a message forwarding method according to an embodiment of the present invention;

fig. 2 is a schematic structural diagram of a specific application scenario provided in the embodiment of the present invention;

fig. 3 is a schematic structural diagram of an RPR switch 210 according to an embodiment of the present invention;

fig. 4 is a schematic structural diagram of an RPR switch 250 provided by an embodiment of the present invention;

fig. 5 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention.

Detailed Description

In order to make the technical solutions in the embodiments of the present invention better understood and make the above objects, features and advantages of the embodiments of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in further detail below with reference to the accompanying drawings.

Referring to fig. 1, a schematic flow chart of a message forwarding method provided in an embodiment of the present invention is shown, where the message forwarding method may be applied to an RPR switching device, which may include, but is not limited to, a switch or a router supporting an RPR function, and the RPR switching device includes a switching chip and an RPR processing chip, and the switching chip and the RPR processing chip are connected through an internal ethernet port, as shown in fig. 1, the message forwarding method may include the following steps:

step 101, when the RPR processing chip receives the first RPR packet, the RPR encapsulation of the first RPR packet is removed to obtain the first ethernet packet.

In the embodiment of the present invention, the first RPR packet does not refer to a fixed RPR packet, but may refer to any RPR packet received by the RPR processing chip, and the following description of the embodiment of the present invention is not repeated.

In the embodiment of the present invention, when receiving the first RPR packet, the RPR processing chip does not learn the RPR MAC table entry any more, that is, the RPR processing chip does not record the corresponding relationship between the user MAC address and the station identifier any more, but removes the RPR encapsulation of the first RPR packet, and then sends the obtained ethernet packet (referred to as the first ethernet packet herein) to the switch chip.

Here, the station identifier is identification information of an RPR switch device on an RPR ring (one RPR switch device on an RPR ring may be referred to as one station).

It should be noted that specific implementation of the RPR processing chip to release the RPR encapsulation of the RPR packet may refer to related implementation in the existing RPR protocol, which is not described in detail in the embodiment of the present invention.

102, adding a first RPR label in the first Ethernet message by the RPR processing chip, and sending the first Ethernet message with the first RPR label to the exchange chip through an internal Ethernet port; the first RPR label includes a first station identifier, and the first station identifier is identification information of a source RPR switching device of the first RPR packet.

In the embodiment of the present invention, because the RPR processing chip does not record the corresponding relationship between the user MAC address and the site ID, in order to identify the RPR switching device to which the destination MAC address of the packet belongs in the packet forwarding process, the ethernet packet exchanged between the RPR processing chip and the switching chip needs to carry the site identifier.

Correspondingly, when the RPR processing chip receives the first RPR packet, the RPR processing chip may further determine, according to the RPR encapsulation information (such as the RPR MAC header) of the first RPR packet, the site identifier of the RPR switching device (i.e., the source RPR switching device) to which the internal source MAC address (user MAC address) in the first RPR packet belongs.

The RPR processing chip may query a correspondence between the MAC address of the RPR switching device and the station identifier maintained by itself according to the MAC address of the source RPR switching device, and determine the station identifier of the source RPR switching device.

In this embodiment of the present invention, when the RPR processing chip determines a station identifier (referred to as a first station identifier) of a source RPR switching device of a first RPR packet, an RPR tag (referred to as a first RPR tag herein) for carrying the first station identifier may be added to the first ethernet packet, and the first ethernet packet with the first RPR tag is sent to the switching chip through an internal ethernet port.

Step 103, when the switching chip does not record the first MAC entry matching the source MAC address of the first ethernet packet, determining a first virtual port corresponding to the first site identifier according to the first site identifier, and stripping the first RPR tag, where the first MAC entry records a corresponding relationship between the source MAC address of the first ethernet packet and the first virtual port.

In the embodiment of the present invention, because the RPR processing chip no longer records the correspondence between the user MAC address and the station identifier, it is necessary to ensure that the switching chip can identify the station identifier of the RPR switching device to which the user MAC address belongs.

Accordingly, a Virtual Port (VP) function may be enabled on the switch chip and a Virtual Port may be allocated on the internal ethernet Port of the switch chip for each of the other RPR switching devices on the RPR ring except the RPR switching device.

For example, assuming that the RPR ring includes RPR switching devices a to D, virtual ports may be allocated to the RPR switching devices B to D on the internal ethernet ports of the switching chip of the RPR switching device a, respectively, for the RPR switching device a, such as that the RPR switching device B corresponds to VP B, the RPR switching device C corresponds to VP C, and the RPR switching device D corresponds to VP D.

For example, the correspondence relationship between the RPR switch device and the virtual port may be statically configured, or may be dynamically allocated by a CPU (central processing Unit) of the RPR switch device according to the collected RPR topology information.

It should be noted that each Virtual port on the internal ethernet port needs to add a service VLAN (Virtual Local Area Network) in which the internal ethernet port is located.

In the embodiment of the invention, when the switching chip learns the MAC address, for the user MAC address under other RPR switching equipment, the corresponding relation between the user MAC address and the internal Ethernet port is not recorded any more, but the corresponding relation between the user MAC address and the virtual port is recorded.

Accordingly, when the switch chip receives the first ethernet packet with the first RPR tag, the switch chip may determine whether a MAC entry (referred to herein as a first MAC entry) matching the source MAC address of the first ethernet packet is recorded.

If not, the switch chip may obtain a first site identifier included in the first RPR tag, determine a virtual port (referred to as a first virtual port herein) corresponding to the first site identifier according to the first site identifier, and strip the first RPR tag to obtain the first ethernet packet.

It should be noted that, in the embodiment of the present invention, if the switch chip records the first MAC entry matching the source MAC address of the first ethernet packet, the switch chip may strip the first RPR tag and forward the first ethernet packet with the first RPR tag stripped, without performing MAC address learning.

As a possible embodiment, a switching chip of the RPR switching device sends preset rules up and down respectively matched with each virtual port, for any virtual port, a matching item of the preset rule matched with the virtual port is that a message ingress port is an internal ethernet port, an RPR tag in a message includes a site identifier corresponding to the virtual port, and an action item of the preset rule is to determine that a source port of the message is the virtual port and strip the RPR tag in the message;

correspondingly, in step 103, the determining, by the switch chip, the first virtual port corresponding to the first site identifier according to the first site identifier, and stripping the first RPR tag may include:

the exchange chip inquires a matched first preset rule according to the first site identification;

and determining a first virtual port corresponding to the first site identifier according to a first preset rule, and stripping a first RPR label.

In this embodiment, in order to enable the switch chip to recognize the corresponding relationship between the site identifier and the virtual port, after the virtual port is allocated to each RPR device on the internal ethernet port of the switch chip, a preset rule matching each virtual port may be issued on the switch chip.

For example, for any virtual port, the format of the preset rule of the virtual port may be as shown in table 1:

TABLE 1

Figure BDA0002243245360000071

The VPi is a virtual port allocated to the RPR switch device whose station identifier is station ID i on the internal ethernet port of the switch chip.

In this embodiment, when the switch chip receives the first ethernet packet with the first RPR tag from the internal ethernet port, the switch chip may query a matching preset rule (referred to as a first preset rule herein) according to the first site identifier included in the first RPR tag, determine the first virtual port corresponding to the first site identifier according to an action item of the first preset rule, and strip the first RPR tag.

And step 104, the switching chip generates a first MAC table entry and forwards the first Ethernet message with the first RPR label stripped.

In the embodiment of the present invention, when the switch chip determines the first virtual port corresponding to the first site identifier, the switch chip may generate the first MAC entry recording the correspondence between the source MAC address of the first ethernet packet and the first virtual port, and forward the first ethernet packet with the first RPR label stripped.

The specific implementation of forwarding the ethernet packet by the switch chip may refer to related descriptions in the prior art, and details of the embodiment of the present invention are not described herein.

As a possible embodiment, the message forwarding method may further include:

when the switching chip receives a second Ethernet message from the non-internal Ethernet port and determines that the second Ethernet message is a two-layer message, inquiring the recorded MAC table entry according to the destination MAC address of the second Ethernet message;

if the switching chip inquires the matched second MAC table item, adding a second RPR label to the second Ethernet message, and sending the second Ethernet message with the second RPR label to the RPR processing chip through a second virtual port of the internal Ethernet port; the second RPR label comprises a second site identifier, and the second site identifier is identifier information of RPR switching equipment corresponding to the second virtual port;

the RPR processing chip strips the second RPR label and carries out RPR packaging on the second Ethernet message to obtain a second RPR message;

and the RPR processing chip forwards the second RPR message.

In this embodiment, the second ethernet packet does not refer to a fixed ethernet packet, but may refer to any ethernet packet received by the switch chip from a non-internal ethernet port, and the following description of the embodiment of the present invention is not repeated.

In this embodiment, when the switch chip receives the second ethernet packet from the non-internal ethernet port, it may be determined that the second packet is a layer two packet or a layer three packet.

For example, for the switch, it may be determined that the ethernet packet is a layer two packet or a layer three packet by determining whether a destination MAC address of the ethernet packet is a MAC address of a local layer three virtual interface (i.e., a MAC address of a virtual gateway). If the destination MAC address of the Ethernet message is the MAC address of the local three-layer virtual interface, determining that the Ethernet message is a three-layer message; otherwise, determining the Ethernet message as a two-layer message.

In this embodiment, when the switch chip determines that the second ethernet packet is a layer two packet, the MAC entry recorded in the switch chip may be queried according to the destination MAC address of the second ethernet packet to determine whether a matching MAC entry (referred to as a second MAC entry herein) exists.

When the switching chip queries the matched second MAC entry, it may be determined whether the egress port of the second MAC entry is a virtual port.

If the egress port of the second MAC entry is a virtual port (referred to as a second virtual port herein), the switch chip may determine, according to the second virtual port, a station identifier of the RPR switch device to which the destination MAC address belongs, that is, identification information (referred to as a second station identifier) of the RPR switch device corresponding to the second virtual port, add an RPR tag (referred to as a second RPR tag herein) including the second station identifier to the second ethernet packet, and send the second ethernet packet with the second RPR tag to the RPR processing chip through the internal ethernet port.

When the RPR processing chip receives the second ethernet packet with the second RPR tag, it may obtain the second station identifier included in the second RPR tag, and determine the MAC address of the RPR switching device corresponding to the second station identifier (i.e. the MAC address of the RPR switching device to which the destination MAC address of the second ethernet packet belongs) according to the correspondence between the station identifier of the RPR switching device recorded by the RPR processing chip and the MAC address.

The RPR processing chip may strip the second RPR label to obtain a second ethernet packet, perform RPR encapsulation on the second ethernet packet according to the MAC address of the RPR switching device corresponding to the second site identifier to obtain a second RPR packet, and forward the second RPR packet.

The RPR processing chip performs RPR encapsulation on the ethernet packet to obtain an RPR packet, and related implementation of forwarding the RPR packet may refer to related implementation in the existing RPR protocol, which is not described herein again in the embodiments of the present invention.

It should be noted that, in this embodiment of the present invention, if the switch chip queries the second MAC entry matched with the second ethernet packet, but an output port of the second MAC entry is not a virtual port, the switch chip may process according to the existing flow, which is not limited in this embodiment of the present invention.

In an example, when the switch chip queries the matched second MAC entry and an output port of the second MAC entry is a second virtual port, the method further includes:

and forwarding the second Ethernet message based on a service control strategy issued on the second virtual port.

In this example, since the switch chip can acquire the destination RPR switch device of the message that needs to be forwarded by the RPR, various flexible service Control policies can be configured by using a rich ACL (Access Control List) function on the switch chip, and applied to the service of the destination RPR switch device that is the designated RPR switch device.

Correspondingly, when the switch chip determines that the output port of the second ethernet packet is the second virtual port, the forwarding of the second ethernet packet may be controlled according to the service control policy issued on the second virtual port, for example, the service control policy issued on the second virtual port in the ACL entry manner.

For example, assuming that a specific service, such as a bit torrent (bit stream) service, that needs to be prohibited from the RPR switching device C on the switching chip of the RPR switching device a, and the virtual port corresponding to the RPR switching device C on the internal ethernet port of the switching chip of the RPR switching device a is VP C, an ACL entry may be issued for the VP C on the switching chip of the RPR switching device a, where the ACL entry may be as shown in table 2:

TABLE 2

Figure BDA0002243245360000101

When the switching chip of the RPR switching device a determines that the output port of the message is VP C, it may query the matched ACL entry according to the service type of the message, and if the service type of the message is bit torrent service, discard the message.

It can be seen that, in the embodiment of the present invention, since the switching chip in the RPR switching device can sense the RPR switching device to which the user MAC address belongs, a service control policy for the RPR switching device can be implemented.

In an example, after the querying, by the switch chip, the recorded MAC table entry according to the destination MAC address of the second ethernet packet, the method may further include:

if the switching chip does not inquire the matched MAC table item, adding a third RPR label to the second Ethernet message, and sending the second Ethernet message with the third RPR label to the RPR processing chip through the appointed virtual port of the internal Ethernet port; the third RPR label includes a third site identifier, where the third site identifier is a site identifier corresponding to a designated virtual port, and the designated virtual port is a virtual port for sending a broadcast packet;

the RPR processing chip strips a third RPR label and carries out RPR packaging on the second Ethernet message according to the third site identification to obtain a third RPR message;

and the RPR processing chip broadcasts the third RPR message.

In this embodiment, since a plurality of virtual ports are allocated to the internal ethernet port of the switch chip, and for a broadcast packet, if each virtual port performs broadcasting, a plurality of packets may be looped, so that for the plurality of packets, a virtual port (referred to as a designated virtual port or a broadcast VP) for forwarding the broadcast packet may be allocated to the internal ethernet port of the switch chip, and a site identifier (referred to as a third site identifier) corresponding to the designated virtual port is set.

When the switching chip does not query the MAC entry matching the destination MAC address of the second ethernet packet, the switching chip may add an RPR tag (referred to as a third RPR tag herein) including the third site identifier to the second ethernet packet, and send the second ethernet packet with the third RPR tag to the RPR processing chip through the designated virtual port of the internal ethernet port.

When the RPR processing chip receives the second ethernet packet with the third RPR tag, the RPR processing chip may obtain the third site identifier included in the third RPR tag, and determine that the packet is a broadcast packet, at this time, the RPR processing chip may strip the third RPR tag, perform broadcast RPR encapsulation on the second ethernet packet, obtain a third RPR packet, and broadcast the third RPR packet.

In one example, in order to avoid that the broadcast traffic after the lower ring passes through the VP upper ring again, traffic isolation is provided between the virtual ports on the internal ethernet port of the switch chip, that is, the traffic received through any virtual port of the internal ethernet port by the switch chip is rejected to be forwarded through the virtual port of the internal ethernet port.

Further, in the embodiment of the present invention, for the processing of the three-layer packet, the forwarding processing of the ARP request packet and the ARP response packet may refer to the forwarding processing flow of the two-layer packet in the foregoing, and for ARP entries of the user terminal under other RPR switching devices learned by the switching chip, the egress port does not point to the internal ethernet port, but points to the virtual port corresponding to the other RPR switching device; similarly, the output port pointed to by the next hop of the three-layer routing table entry is no longer an internal ethernet port, but is a corresponding virtual port.

Correspondingly, when the switching chip sends a three-layer message to the RPR processing chip, an RPR tag with a site identifier of the RPR switching device corresponding to the virtual port may also be added to the three-layer message according to an egress port (virtual port) determined by querying the three-layer forwarding table, so that the RPR processing chip determines the MAC address of the destination RPR switching device according to the site identifier in the RPR tag, and performs RPR encapsulation and forwarding.

In order to enable those skilled in the art to better understand the technical solution provided by the embodiment of the present invention, the technical solution provided by the embodiment of the present invention is described below with reference to a specific application scenario.

Referring to fig. 2, a schematic diagram of a specific application scenario provided by an embodiment of the present invention is shown in fig. 2, in the application scenario, an RPR ring includes an RPR switch 210, an RPR switch 220, an RPR switch 230, an RPR switch 240, and an RPR switch 250, a terminal 310 accesses the RPR ring through the RPR switch 250, a terminal 320 accesses the RPR ring through the RPR switch 210, and an internal ethernet port of a switch chip of each RPR switch is allocated with a virtual port corresponding to another RPR switch on the RPR ring and a broadcast virtual port.

Take RPR switch 210 and RPR switch 250, respectively, as an example.

Referring to fig. 3, the RPR switch 210 includes a switch chip 211 and an RPR processing chip 212, the switch chip 211 is connected to the RPR processing chip 212 through an internal ethernet port 2110, and virtual ports 2111 to 2114 are respectively allocated on the internal ethernet port 2110 of the switch chip 211 corresponding to the RPR switches 220 to 250: the virtual port 2111 corresponds to the RPR switch 220, the virtual port 2112 corresponds to the RPR switch 230, the virtual port 2113 corresponds to the RPR switch 240, and the virtual port 2114 corresponds to the RPR switch 250, and a broadcast virtual port (i.e., the above-described designated virtual port) 2100 is allocated.

The switching chip 211 issues VFP (VLAN Field Parser) rules (i.e., the preset rules) to each virtual port.

For example, for virtual port 2114, the VFP rule matching that virtual port 2114 may be as shown in table 3 (assuming the station identification of RPR switch 250 is E):

TABLE 3

Figure BDA0002243245360000121

Referring to fig. 4, the RPR switch 250 includes a switch chip 251 and an RPR processing chip 252, the switch chip 251 is connected to the RPR processing chip 252 through an internal ethernet port 2510, and virtual ports 2511 to 2514 are respectively allocated on the internal ethernet port 2510 of the switch chip 251 corresponding to the RPR switches 210 to 240: RPR switch 210 corresponds to virtual port 2511, RPR switch 220 corresponds to virtual port 2512, RPR switch 230 corresponds to virtual port 2513, and RPR switch 240 corresponds to virtual port 2514, and broadcast virtual port 2500 is allocated.

The switching chip 251 issues VFP rules respectively associated with each virtual port.

The following describes the packet forwarding scheme provided in the embodiment of the present invention by taking an example of two-layer packet interaction between the terminal 310 and the terminal 320, and the specific implementation flow is as follows:

process 1, terminal 310 sends a message to terminal 320:

the switching chip 251 of the RPR switch 250 receives an ethernet message sent by the terminal 310 through a non-internal ethernet port, where a destination MAC address of the ethernet message is an MAC address of the terminal 320 (assumed to be the MAC320), and the switching chip 251 queries a MAC entry recorded by itself according to the destination MAC address of the ethernet message, where no matched MAC entry is queried.

At this time, the switch chip 251 determines that the ethernet packet needs to be broadcasted, matching the virtual port 2500. The switch chip 251 adds an RPR tag to the ethernet packet, where the RPR tag includes a station identifier (assumed to be 0xff) corresponding to the virtual port 2500, and sends the ethernet packet with the RPR tag to the RPR processing chip 252 through the virtual port 2500.

The RPR processing chip 252 receives the ethernet packet with the RPR tag, obtains the site identifier (i.e., 0xff) included in the RPR tag, and determines that the packet needs to be broadcasted, at this time, the RPR processing chip 252 strips the RPR tag of the packet, performs RPR encapsulation on the obtained ethernet packet, obtains the RPR packet, and broadcasts the RPR packet.

The RPR processing chips of other RPR switches in the RPR ring receive the RPR message, and on one hand, a next ring is copied; on the other hand, the broadcast on the ring is continued until the RPR processing chip 252 of the RPR switch 250 receives the RPR packet, and the RPR packet is discarded.

When receiving the RPR packet, the RPR processing chip 212 of the RPR switch 210 removes the RPR encapsulation of the RPR packet to obtain an ethernet packet, adds an RPR tag including a site identifier (i.e., E) of the source RPR switch (i.e., the RPR switch 250) to the ethernet packet, and sends the ethernet packet to the switching chip 211.

The switch chip 211 receives the ethernet packet with the RPR tag, obtains a site identifier (i.e., E) included in the RPR tag, queries the VFP rule according to the site identifier, determines that the source port of the packet is the virtual port 2114 according to the matched VFP rule (e.g., the VFP rule shown in table 3), and strips the RPR tag of the packet.

The switch chip 211 generates a MAC table entry recording a correspondence between a source MAC address (assumed to be MAC310) and the virtual port 2114 of the ethernet packet, and sends the ethernet packet to the terminal 320 according to a destination MAC address (MAC320) of the ethernet packet.

Process 2, terminal 320 sends a message to terminal 310:

the switch chip 211 receives an ethernet message sent by the terminal 320 through the non-internal ethernet port, where a destination MAC address of the ethernet message is an MAC address (i.e., MAC310) of the terminal 310, and the switch chip 211 queries a MAC entry recorded by itself according to the destination MAC address of the ethernet message, and queries a matched MAC entry, where an output port in the MAC entry is a virtual port 2114.

At this time, the switch chip 211 adds an RPR tag to the ethernet packet, where the RPR tag includes a station identifier (i.e., E) corresponding to the virtual port 2114, and sends the ethernet packet with the RPR tag to the RPR processing chip 212 through the virtual port 2114.

The RPR processing chip 212 receives the ethernet packet with the RPR tag, obtains the station identifier (i.e., E) included in the RPR tag, determines the MAC address corresponding to the station identifier (i.e., the MAC address of the RPR switch 250, which is assumed to be MAC250) according to the station identifier and the correspondence between the station identifier of the RPR switch recorded by itself and the MAC address, performs RPR encapsulation on the ethernet packet with the RPR tag removed according to the MAC address, and forwards the RPR packet to the RPR switch 250 in a unicast manner.

The RPR processing chip 252 of the RPR switch 250 receives the RPR packet, removes the RPR encapsulation of the RPR packet to obtain an ethernet packet, adds an RPR tag including the site identifier (assumed to be a) of the source RPR switch (i.e., the RPR switch 210) to the ethernet packet, and sends the ethernet packet to the switching chip 251.

The switch chip 251 receives the ethernet packet with the RPR tag, determines that the MAC entry corresponding to the source MAC address (i.e., MAC320) of the ethernet packet is recorded, and at this time, the switch chip 251 strips the RPR tag of the packet and sends the ethernet packet to the terminal 310 according to the destination MAC address (MAC310) of the ethernet packet.

As can be seen from the above description, in the technical solution provided in the embodiment of the present invention, a virtual port is allocated on the internal ethernet port of the switch chip to each other RPR switch device except the RPR switch device on the RPR ring, and when the RPR processing chip receives the first RPR packet, the RPR encapsulation of the first RPR packet is removed, so as to obtain the first ethernet packet; the RPR processing chip adds a first RPR label in the first Ethernet message and sends the first Ethernet message with the first RPR label to the switching chip through the internal Ethernet port; when the exchange chip does not record a first MAC table item matched with a source MAC address of the first Ethernet message, determining a first virtual port corresponding to a first site identifier according to the first site identifier, and stripping a first RPR label; the exchange chip generates a first MAC table item, forwards the first Ethernet message with the first RPR label stripped, and maintains the corresponding relation between the user MAC address and the RPR exchange equipment on the exchange chip, thereby simplifying the processing of the RPR processing chip and saving the performance and resources of the RPR processing chip.

Referring to fig. 5, a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention is provided, where the message forwarding apparatus may be applied to an RPR switching device, and as shown in fig. 5, the message forwarding apparatus may include: the switch chip 510 and the RPR processing chip 520 are connected through an internal ethernet port, and a virtual port is allocated on the internal ethernet port of the switch chip 510 for each other RPR switch device on the RPR ring except the RPR switch device, where:

the RPR processing chip 520 is configured to, when receiving the first RPR packet, remove the RPR encapsulation of the first RPR packet to obtain a first ethernet packet;

the RPR processing chip 520 is further configured to add a first RPR tag to the first ethernet packet, and send the first ethernet packet with the first RPR tag to the switching chip 510 through the internal ethernet port; the first RPR label comprises a first station identifier, wherein the first station identifier is the identifier information of the source RPR switching equipment of the first RPR message;

the switching chip 510 is configured to determine, according to a first site identifier, a first virtual port corresponding to the first site identifier when a first MAC entry matching a source MAC address of the first ethernet packet is not recorded, and strip a first RPR tag; the first MAC table entry records the corresponding relation between the source MAC address of the first Ethernet message and the first virtual port;

the switch chip 510 is further configured to generate a first MAC entry and forward the first ethernet packet with the first RPR label stripped.

In an optional embodiment, the switch chip 510 issues preset rules respectively matched with each virtual port, and for any virtual port, a matching item of the preset rule matched with the virtual port is that a message ingress port is an internal ethernet port, and an RPR tag in a message includes a site identifier corresponding to the virtual port, and an action item of the preset rule is to determine that a source port of the message is the virtual port, and strip the RPR tag in the message;

the switching chip 510 is specifically configured to query a first preset rule according to the first site identifier; and determining a first virtual port corresponding to the first site identifier according to a first preset rule, and stripping a first RPR label.

In an optional embodiment, the switch chip 510 is further configured to, when a second ethernet packet is received from the non-internal ethernet port and it is determined that the second ethernet packet is a layer two packet, query the MAC entry recorded according to the destination MAC address of the second ethernet packet;

the switch chip 510 is further configured to add a second RPR tag to the second ethernet packet and send the second ethernet packet with the second RPR tag to the RPR processing chip through the second virtual port of the internal ethernet port if the matched second MAC entry is found and the output port of the second MAC entry is the second virtual port; the second RPR label comprises a second site identifier, and the second site identifier is identifier information of RPR switching equipment corresponding to the second virtual port;

the RPR processing chip 520 is further configured to strip the second RPR label, and perform RPR encapsulation on the second ethernet packet according to the second site identifier to obtain a second RPR packet;

the RPR processing chip 520 is further configured to forward the second RPR packet.

In an optional embodiment, the switch chip 510 is further configured to, when the matched second MAC entry is queried and the output port of the second MAC entry is a second virtual port, perform forwarding control on the second ethernet packet based on a service control policy issued on the second virtual port.

In an optional embodiment, the switch chip 510 is further configured to add a third RPR tag to the second ethernet packet if the matching MAC entry is not queried, and send the second ethernet packet with the third RPR tag to the RPR processing chip through the specified virtual port of the internal ethernet port; the third RPR label includes a third site identifier, where the third site identifier is a site identifier corresponding to a designated virtual port, and the designated virtual port is a virtual port for sending a broadcast packet;

the RPR processing chip 520 is further configured to strip the third RPR label, and perform RPR encapsulation on the second ethernet packet according to the third site identifier to obtain a third RPR packet;

the RPR processing chip 520 is further configured to broadcast the third RPR packet.

In an alternative embodiment, traffic isolation is provided between virtual ports on the internal ethernet port of the switch chip 510.

The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.

For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.

As can be seen from the above embodiments, by allocating a virtual port to each of the other RPR switching devices on the RPR ring except the RPR switching device on the internal ethernet port of the switching chip, when the RPR processing chip receives the first RPR packet, the RPR encapsulation of the first RPR packet is removed to obtain the first ethernet packet; the RPR processing chip adds a first RPR label in the first Ethernet message and sends the first Ethernet message with the first RPR label to the switching chip through the internal Ethernet port; when the exchange chip does not record a first MAC table item matched with a source MAC address of the first Ethernet message, determining a first virtual port corresponding to a first site identifier according to the first site identifier, and stripping a first RPR label; the exchange chip generates a first MAC table item, forwards the first Ethernet message with the first RPR label stripped, and maintains the corresponding relation between the user MAC address and the RPR exchange equipment on the exchange chip, thereby simplifying the processing of the RPR processing chip and saving the performance and resources of the RPR processing chip.

Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种针对GMSK信号的单载波均衡方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!