The present invention relates to a per-stream filtering and policing mechanism of a switch or a router.
A switch has a priority decision circuit to determine priority of a frame based on information of the frame such as a priority code point (PCP) of a virtual local area network (VLAN) tag, a differentiated services code point (DSCP) of Internet Protocol (IP), port-based configuration etc., and the frame is enqueued based on the priority determined by the priority decision circuit. Then, the frame is selected for transmission based on the priority queue and corresponding algorithm.
IEEE 802.1 Qci standard defines a per-stream filtering and policing mechanism comprising frame filters, stream gates and flow meters, where the frame filter identifies the frame and assigns the stream gate and flow meter for the frame; then the stream gate assigns the frame priority based on common time information of the network; the flow meter classifies the frame as a green frame, a yellow frame or a red frame. Then, the flow meter takes action based on the color of the frame, where the green frame is forwarded to an output port, the red frame is discarded, and the flow meter can be configured to discard the yellow frame or mark a drop eligible indicator (DEI) field of the VLAN tag. In the standard, however, the frame priority is determined based on the time information only, and the flow meter has no flexibility in changing the frame priority. Therefore, if the data rate of the frame temporarily exceeds the committed bandwidth due to network factors or other factors, traffic of the other frame(s) having the same priority may be influenced, and the system will become complicated in frame processing.
It is therefore an objective of the present invention to provide a circuitry within a switch, which can change a priority of the frame based on the traffic bandwidth, to solve the above-mentioned problems.
According to one embodiment of the present invention, a circuitry within a router or a switch is disclosed, wherein the circuitry comprises a priority decision circuitry and a per-stream filtering and policing circuitry. The priority decision circuitry is configured to determine a priority of a frame received from a port of the router or the switch. The per-stream filtering and policing circuitry is configured to classify the frame into a first-type frame, a second-type frame or a third-type frame, wherein if the frame is determined as the first-type frame, the per-stream filtering and policing circuitry forwards the frame to a priority to traffic mapping circuitry to enqueue the frame; if the frame is determined as the third-type frame, the per-stream filtering and policing circuitry discards the frame; and if the frame is determined as the second-type frame, the per-stream filtering and policing circuitry changes the priority of the frame, and the per-stream filtering and policing circuitry forwards the frame with the changed priority to the priority to traffic mapping circuitry to enqueue the frame.
According to another embodiment of the present invention, a frame processing method applied to a router or a switch is disclosed. The frame processing method comprises the steps of: determining a priority of a frame received from a port of the router or the switch; classifying the frame into a first-type frame, a second-type frame or a third-type frame; if the frame is determined as the first-type frame, forwarding the frame to enqueue the frame; if the frame is determined as the third-type frame, discarding the frame; and if the frame is determined as the second-type frame, changing the priority of the frame, and forwarding the frame with the changed priority to enqueue the frame.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
In the operation of the switch 100, when at least a portion of the ports P0-PN receive frames from external electronic device(s), the priority decision circuitry 110 determines priority of each frame, the per stream filtering and policing circuitry 120 classifies the frames to determine if forwarding the frame(s) or discarding the frame(s), wherein the priority of the frame(s) may be modified according to the bandwidth of the stream/traffic. The priority to traffic mapping circuitry 130 forwards each frame to the corresponding destination port, wherein the transmission order of the frame is determined based on its own priority and/or the priority of the other frames. Specifically, the priority decision circuitry 110 determines the priority of each frame based on the internal information carried in a header of the frame, for example, the priority is determined based on a prior-based priority source, an inner-tag-based priority source, an outer-tag-based priority source, a hybrid-based priority source and a DSCP-based priority source. Because the priority arbitration within the priority decision circuitry 110 is well known by a person skilled in the art, the detailed description is omitted here.
After the priority of each frame is determined, the per stream filtering and policing circuitry 120 receives the frames and their priority information.
Because the present invention focuses on the operation of the flow meters 240_1-240_K, and the operations of the stream identification circuit 210, the stream filter 220 and the plurality of stream gates 230_1-230_K are well known by a person skilled in the art, the detailed descriptions about the stream identification circuit 210, the stream filter 220 and the plurality of stream gates 230_1-230_K are omitted here.
After the frame is classified in Step 304, if the frame is determined as the green frame, the flow enters Step 306; if the frame is determined as the red frame, the flow enters Step 308; and if the frame is determined as the yellow frame, the flow enters Step 310. In Step 306, the frame is sent to the priority to traffic mapping circuitry 130, and after the frame is enqueued based on the priority, the frame is sent to the destination port. In Step 308, the frame is discarded. In Step 310, it is determined is a parameter indicating that the yellow frame is discarded. In this embodiment, this parameter is a parameter ‘DropOnYellow’ in the IEEE 802.1 Qci standard, and the parameter can be set by a user for controlling the traffic of the switch 100. If the parameter is enabled, the flow enters Step 312; and if the parameter is disabled, the flow enters Step 314.
In Step 312, the frame is discarded. In Step 314, the DEI bit is set to indicate that the frame is not dropped or discarded in the presence of congestion. In Step 316, it is determined if a priority adjustment mechanism is enabled by setting a parameter, if yes, the flow enters Step 318; and if not, the flow enters Step 320. In Step 318, the flow meter 240_1 changes the priority of the yellow frame, for example, the flow meter 240_1 lowers the IPV of the yellow frame. In Step 320, the frame is enqueued based on the priority (or the changed priority), then the frame is sent to the destination port via the operation of the priority to traffic mapping circuitry 130.
In the embodiment shown in
In addition, if the Step 316 and Step 318 are not used, the first frames and the second frames are transmitted based on the original priority (i.e. the same priority same) even if the first stream has the network issue and the bandwidth instantly rises, and the traffics of the second stream will be influenced and the frame processing becomes complicated.
Briefly summarized, in the circuitry within the switch of the present invention, when the current bandwidth is higher than the committed bandwidth, the frames entering the flow meter is controlled to lower the priority so that the other frames can be transmitted smoothly at the original rate. Therefore, the system will not become complicated in frame processing while suffering the bandwidth congestion issue.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
This application claims the priority of U.S. Provisional Application No. 63/017,663, filed on Apr. 30, 2020, which is included herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
63017663 | Apr 2020 | US |