CIRCUITRY WITHIN ROUTER OR SWITCH AND CORRESPONDING FRAME PROCESSING METHOD
20210344605 · 2021-11-04
Inventors
- Chung-Keng Hung (HsinChu, TW)
- Yung-Kun Lin (HsinChu, TW)
- Chih-Ching Chen (Hsinchu, TW)
- Ta-Chin Tseng (HsinChu, TW)
Cpc classification
International classification
Abstract
The present invention provides a circuitry within a router or a switch, 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; 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.
Claims
1. A circuitry within a router or a switch, comprising: a priority decision circuitry, configured to determine a priority of a frame received from a port of the router or the switch; a per-stream filtering and policing circuitry, coupled to the priority decision circuitry, 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.
2. The circuitry of claim 1, wherein the per-stream filtering and policing circuitry classifies the frame into the first-type frame, the second-type frame or the second type-frame according to the current bandwidth of stream(s); and if the frame is determined as the second-type frame, the per-stream filtering and policing circuitry changes the priority of the frame.
3. The circuitry of claim 2, wherein if the current bandwidth of the stream(s) is lower than a first threshold, the per-stream filtering and policing circuitry determines the frame as the first-type frame; if the current bandwidth of the stream(s) is higher than the first threshold but lower than a second threshold, the per-stream filtering and policing circuitry determines the frame as the second-type frame; and if the current bandwidth of the stream(s) is higher than the second threshold, the per-stream filtering and policing circuitry determines the frame as the third-type frame.
4. The circuitry of claim 1, wherein the per-stream filtering and policing circuitry has a parameter configured to enable or disable a priority adjustment mechanism, and when the parameter is set to enable the priority adjustment mechanism, 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; and when the parameter is set to disable the priority adjustment mechanism, and if the frame is determined as the second-type frame, the per-stream filtering and policing circuitry directly forwards the frame without changing the priority to the priority to traffic mapping circuitry to enqueue the frame.
5. The circuitry of claim 1, wherein the per-stream filtering and policing circuitry comprises: a stream identification circuit, configured to maps the frames to a stream; a stream filter, couple to the stream identification circuit, configured to forward or discard the frame based on content of the frame; a stream gate, coupled to the stream filter, configured to receive the frame is the frame is not discarded by the stream filter, and to periodically forward the frame or block the frame; and a flow meter, configured to classify the frame into the first-type frame, the second-type frame or the second type-frame. wherein if the frame is determined as the first-type frame, the flow meter forwards the frame to the priority to traffic mapping circuitry to enqueue the frame; if the frame is determined as the third-type frame, the flow meter discards the frame; and if the frame is determined as the second-type frame, the flow meter changes the priority of the frame, and the flow meter forwards the frame with the changed priority to the priority to traffic mapping circuitry to enqueue the frame.
6. The circuitry of claim 5, wherein the stream gate sets an internal priority value for the frame; and if the frame is determined as the second-type frame, the flow meter changes the priority of the frame by changing the internal priority value, and the flow meter forwards the frame with the changed internal priority value to the priority to traffic mapping circuitry to enqueue the frame.
7. A frame processing method applied to a router or a switch, comprising: 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.
8. The frame processing method of claim 7, wherein the step of classifying the frame into the first-type frame, the second-type frame or the third-type frame comprises: classifying the frame into the first-type frame, the second-type frame or the second type-frame according to the current bandwidth of traffic; wherein if the frame is determined as the second-type frame, changing the priority of the frame.
9. The frame processing method of claim 8, wherein the step of classifying the frame into the first-type frame, the second-type frame or the second type-frame according to the current bandwidth of the stream(s) comprises: if the current bandwidth of the stream(s) is lower than a first threshold, determining the frame as the first-type frame; if the current bandwidth of the stream(s) is higher than the first threshold but lower than a second threshold, determining the frame as the second-type frame; and if the current bandwidth of the stream(s) is higher than the second threshold, determining the frame as the third-type frame.
10. The frame processing method of claim 7, further comprising: setting a parameter to enable or disable a priority adjustment mechanism; when the parameter is set to enable the priority adjustment mechanism, 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; and when the parameter is set to disable the priority adjustment mechanism, and if the frame is determined as the second-type frame, forwarding the frame without changing the priority to enqueue the frame.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0009]
[0010]
[0011]
[0012]
DETAILED DESCRIPTION
[0013]
[0014] 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.
[0015] After the priority of each frame is determined, the per stream filtering and policing circuitry 120 receives the frames and their priority information.
[0016] 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.
[0017]
[0018] 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.
[0019] 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.
[0020] In the embodiment shown in
[0021] 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.
[0022] 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.
[0023] 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.