Packet forwarding device, and packet-forwarding priority setting circuit and method

The present disclosure discloses a packet-forwarding priority setting circuit comprising: a decision circuit configured to detect whether an application type of a packet stream is included in a table; a processing circuit configured to examine at least one preceding packet among the packets of the stream if no application type of the stream is found in the table, so as to determine the application type of the stream and store it in the table, and the processing circuit configured to determine the application type of the stream according to the table if the application type of the stream is found in the table; and a mapping circuit configured to distribute some or all of the packets of the stream to one of a plurality of queues according to the application type of the stream, in which the queues are associated with different priorities respectively.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present disclosure relates to packet-forwarding techniques, especially to a packet forwarding device and a packet-forwarding priority setting circuit and method.

2. Description of Related Art

Generally, quality of service (QoS) reflects the overall performance of a communication network, particularly the performance felt by the users of the communication network. QoS can be measured through one or more aspects such as error rate, bit rate, throughput, transmission delay, availability, and jitter.

QoS is a useful and important feature in Wi-Fi transmission. It can be an index for a system/device to make the best use of limited bandwidth and transmitting speed and give users better experience. Unfortunately, although Wi-Fi Multimedia (WMM) certification is brought up to promote the QoS feature, the fact that the priority of a packet stream is usually not classified makes the WMM certification useless in many cases. Therefore this industrial field still looks for a way to implement the QoS feature for those unclassified packet streams.

Currently one way to implement QoS is to manually assign a priority to a specific device in accordance with the IP or MAC address thereof. However, this way is not automatic or not adaptable, and is unworkable for unclassified packet streams. In other words, this kind of prior arts cannot provides universal QoS service for every packet stream.

SUMMARY OF THE INVENTION

In consideration of the problem of the prior art, an object of the present disclosure is to provide a packet forwarding device and a packet-forwarding priority setting circuit and method capable of making improvements over the prior art.

The present disclosure discloses a packet forwarding device. An embodiment of the packet forwarding device comprises a reception circuit, a decision circuit, a processing circuit, a mapping circuit and a transmission circuit. The reception circuit is configured to receive packets of a stream. The decision circuit is configured to detect whether an application type of the stream is included in a table. The processing circuit is configured to examine at least one preceding packet among the packets of the stream after the decision circuit finds that the application type of the stream is not included in the table, so as to determine the application type of the stream and then store the application type of the stream in the table; and the processing circuit is also configured to determine the application type of the stream according to the table after the decision circuit finds that the application type of the stream is included in the table. The mapping circuit is configured to distribute some or all of the packets of the stream to one of a plurality of queues according to the application type of the stream, in which the queues are associated with different priorities respectively. The transmission circuit is configured to output packets in the queues according to the priorities.

The present disclosure also discloses a packet-forwarding priority setting circuit. An embodiment of the packet-forwarding priority setting circuit comprises a decision circuit, a processing circuit and a mapping circuit. The decision circuit is configured to detect whether an application type of a stream is included in a table, in which the stream includes packets. The processing circuit is configured to examine at least one preceding packet among the packets of the stream after the decision circuit finds that the application type of the stream is not included in the table, so as to determine the application type of the stream and then store the application type of the stream in the table; and the processing circuit is also configured to determine the application type of the stream according to the table after the decision circuit finds that the application type of the stream is included in the table. The mapping circuit is configured to distribute some or all of the packets of the stream to one of a plurality of queues according to the application type of the stream, in which the queues are associated with different priorities respectively.

The present disclosure further discloses a packet-forwarding priority setting method. An embodiment of the method comprises the following steps: detecting whether an application type of a stream is included in a table, in which the stream includes packets; examining at least one preceding packet among the packets of the stream when finding that the application type of the stream is not included in the table, so as to determine the application type of the stream and then store the application type of the stream in the table; determining the application type of the stream according to the table when finding that the application type of the stream is included in the table; and distributing some or all of the packets of the stream to one of a plurality of queues according to the application type of the stream, in which the queues are associated with different priorities respectively.

These and other objectives of the present disclosure will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiments that are illustrated in the various figures and drawings.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The following description is written by referring to terms acknowledged in this invention filed. If any term is defined in the specification, such term should be explained accordingly.

Each embodiment in the following description includes one or more features; however, this doesn't mean that one carrying out the present invention should make use of all the features of one embodiment at the same time, or should carry out different embodiments separately. In other words, if an implementation derived from one or more of the embodiments is applicable, a person of ordinary skill in the art can selectively make use of some or all of the features in one embodiment or selectively make use of the combination of some or all features in several embodiments to have the implementation come true, so as to increase the flexibility of carrying out the present invention.

Please refer toFIG. 1which illustrates an embodiment of the packet forwarding device of the present disclosure. The packet forwarding device100ofFIG. 1is applicable to a network device operable to implement a function of quality of service (QoS). An example of such network device is a wireless router, a wireless gateway, a wireless access point, etc. According toFIG. 1, the packet forwarding device100comprises a reception circuit110, a decision circuit120, a processing circuit130, a mapping circuit140and a transmission circuit150, in which each of the reception circuit110and the transmission circuit150alone is known to those of ordinary skill in the art.

The reception circuit110ofFIG. 1is configured to receive packets of a stream (hereafter “packet stream”). In practice, the reception circuit110, e.g., a multiple-input multiple-output (MIMO) circuit, a single-input multiple-output circuit, a multiple-input single-output circuit or a single-input single-output circuit, is operable to receive different signal streams, and each of the signal streams includes packet signals that can be used to generate the above-mentioned packets of the packet stream. Generally a packet includes one or more header(s), and the information thereof usually includes address and port information such as source address information, source port information, destination address information and destination port information.

The decision circuit120ofFIG. 1is configured to detect whether an application type of the packet stream is included in a table162. A nonrestrictive example of the table162is illustrated in Table 1 below, and some reference information such as the Index, the Protocol and/or the title “Packet information” in Table 1 may be neglected when carrying out the present invention. The table162is established to include packet information (e.g., header information such as address and port information) of a plurality of streams, and the table162could be stored in a memory160of the packet forwarding device100as shown inFIG. 1, or the table162could be stored in a memory (e.g., a system memory of a host) outside the packet forwarding device100.

The processing circuit130ofFIG. 1is configured to examine at least one preceding packet among the packets of the packet stream after the decision circuit120finds that the application type of the packet stream is not included in the table162, so as to determine the application type of the packet stream and then store the application type of the packet stream in the table162; and the processing circuit130is also configured to determine the application type of the packet stream according to the table162after the decision circuit120finds that the application type of the packet stream is included in the table162. The said at least one preceding packet could be the first one or more packet(s) of the packets in the packet stream. The amount of the preceding packet(s) is decided by how many packets are necessary for the processing circuit130to finish the examination.

The mapping circuit140ofFIG. 1is configured to distribute some or all of the packets of the packet stream (e.g., all the packets of the packet stream, or all the packets of the packet stream except the at least one preceding packet) to one of a plurality of queues according to the application type of the packet stream, in which the queues are associated with different priorities respectively. For instance, the queues are a queue of VoIP (voice over internet protocol) packets, a queue of HDTV (high definition television) packets, a queue of file download packets, etc., in which the VoIP queue is associated with the highest priority while the file download queue is associated with the lowest priority. It should be noted that packets of different queues could be stored in different buffers (e.g., buffers in the transmission circuit150) respectively for output; however, this is not a limitation to the present invention.

The transmission circuit150ofFIG. 1is configured to output packets in the queues according to the priorities. Generally, the higher the priority, the more the chance of outputting the data in the corresponding queue.

In an exemplary implementation of the above-described embodiment, the packet forwarding device100is operable to receive and/or output the packets of the packet stream wirelessly; for instance, the packet forwarding device100may receive the packets wirelessly and transmit them through a cable, or receive the packets through the cable and transmit them wirelessly, and so on and so forth. In an exemplary implementation of the embodiment, the decision circuit120compares the header information (e.g., address and port information) of the at least one preceding packet with the packet information (e.g., address and port information) in the table to detect whether the application type of the packet stream is included in the table. In an exemplary implementation of the embodiment, the packet forwarding device100stores not only the application type of the packet stream but also the header information related to the packet stream in the table162; however, not all kinds of header information related to the packet stream are required to be included in the table162. In an exemplary implementation of the embodiment, the queues are respectively associated with Wi-Fi Multimedia's (WMM's) four Access Categories, i.e., four categories of voice, video, best effort and background. In an exemplary implementation of the embodiment, the processing circuit130examines the at least one preceding packet according to at least one of follows: at least one predetermined keyword; and at least one predetermined pattern. For example, if the processing circuit130examines the at least one preceding packet and thereby finds a pattern of FTP (File Transfer Protocol) such as “220[\x09-\x0d-˜]*\x0d\x0aUSER[\x09-\x0d-˜]*\x0d\x0a331” in the header and/or data of the at least one preceding packet, the processing circuit130will determine that the application type of the packet stream associated with the preceding packet is FTP file download. In an exemplary implementation of the embodiment, some or all of the decision circuit120, the processing circuit130and the mapping circuit140are integrated together.

In an exemplary implementation of the embodiment, the processing circuit130ofFIG. 1overwrites bits of type of service (ToS) of some or all of the packets in the packet stream (e.g., all the packets in the packet stream, or all the packets in the packet stream except the at least one preceding packet) after determining the application type of the packet stream. An embodiment of the processing circuit130operable to overwrite the ToS bits is shown inFIG. 3. The processing circuit130ofFIG. 3includes an examining unit310; an inspecting unit320, a comparing unit330and an overwriting unit340. The examining unit310is operable to examine the at least one preceding packet among the packets of the packet stream to determine the application type of the packet stream after the decision circuit120finds that the application type of the packet stream is not included in the table162, and then output the packets of the packet stream to the inspecting unit320. The examining unit310is also operable to output the packets of the packet stream to the inspecting unit320without executing examination after the decision circuit120finds that the application type of the packet stream is included in the table162. The inspecting unit320is operable to check whether the ToS bits of the packets in the packet stream are already labeled with a non-zero value, and output the packets to the comparing unit330if the ToS bits are labeled with a non-zero value or output the packets to the overwriting unit340if the ToS bits are not labeled with a non-zero value. The comparing unit330is operable to compare the priority of the ToS bits with the priority of the found application type of the packet stream, and then output the packets of the packet stream to the overwriting unit340when the priority of the ToS bits is lower than the priority of the found application type or output the packets of the packet stream to the mapping circuit140when the priority of the ToS bits is equal to or higher than the priority of the found application type. The overwriting unit340is operable to overwrite the ToS bits according to the priority of the application type of the packet stream, or according to a predetermined priority if the application type of the packet stream is not yet found. The overwriting unit340is also operable to leave the ToS bits unchanged if the application type of the packet stream is not yet found. It should be noted that once an application type is found by the examining unit310, the priority of such application type is decided by the examining unit310. It should also be noted that if the overwriting operation is not required, the inspecting unit320, the comparison unit330and the overwriting unit340could be optionally neglected. In addition, the mapping circuit140may distribute packets of the packet stream to one of a plurality of queues according to the application type of the packet stream, according to the ToS bits of these packets, or according to a prescribed rule before the application type is found and/or the ToS bits are set.

In addition to the above-described packet forwarding device, the present disclosure also discloses a packet-forwarding priority setting circuit for setting the priority of a stream. An embodiment of the packet-forwarding priority setting circuit is illustrated inFIG. 2. According toFIG. 2, the priority setting circuit200comprises a decision circuit210, a processing circuit220and a mapping circuit230. An exemplary implementation of the decision circuit210is the decision circuit120ofFIG. 1or the equivalent thereof, and the decision circuit210is configured to detect whether an application type of a stream is included in a table (e.g., the table162ofFIG. 1), in which the stream (hereafter “packet stream”) includes packets or is composed of packets. An exemplary implementation of the processing circuit220is the processing circuit130ofFIG. 1or the equivalent thereof; the processing circuit220is configured to examine at least one preceding packet among the packets of the packet stream if the decision circuit210finds that the application type of the packet stream is not included in the table, so as to determine the application type of the packet stream and then store the application type of the packet stream in the table; and the processing circuit220is also configured to determine the application type of the packet stream according to the table if the decision circuit210finds that the application type of the packet stream is included in the table. An exemplary implementation of the mapping circuit230is the mapping circuit140ofFIG. 1or the equivalent thereof, and the mapping circuit230is configured to distribute some or all of the packets of the packet stream (e.g., all the packets of the packet stream, or all the packets of the packet stream except the at least one preceding packet) to one of a plurality of queues according to the application type of the packet stream, in which the queues are associated with different priorities respectively.

Since those of ordinary skill in the art can appreciate the detail and modification of the packet-forwarding priority setting circuit200by referring to the disclosure of the packet forwarding device100, which means that the features of the packet forwarding device100can be applied to the packet-forwarding priority setting circuit200in a reasonable way, therefore repeated and redundant description is omitted provided that the written description and enablement requirements are still fulfilled.

The present disclosure further discloses a packet-forwarding priority setting method for setting the priority of a stream. An embodiment of the method is illustrated by the flow chart ofFIG. 4, and comprises the following steps:Step S410: detecting whether an application type of a stream is included in a table, in which the stream includes packets. This step can be carried out by the decision circuit120ofFIG. 1or the equivalent thereof.Step S420: examining at least one preceding packet among the packets of the stream when finding that the application type of the stream is not included in the table, so as to determine the application type of the stream and then store the application type of the stream in the table. This step can be carried out by the processing circuit130ofFIG. 1or the equivalent thereof.Step S430: determining the application type of the stream according to the table when finding that the application type of the stream is included in the table. This step can be carried out by the processing circuit130ofFIG. 1or the equivalent thereof.Step S440: distributing some or all of the packets of the stream (e.g., all the packets of the stream, or all the packets of the stream except the at least one preceding packet) to one of a plurality of queues according to the application type of the stream, in which the queues are associated with different priorities respectively. This step can be carried out by the mapping circuit140ofFIG. 1or the equivalent thereof.

Since those of ordinary skill in the art can appreciate the detail and modification of the packet-forwarding priority setting method by referring to the disclosure of the packet forwarding device100, which means that the features of the packet forwarding device100can be applied to the packet-forwarding priority setting method in a reasonable way, therefore repeated and redundant description is omitted provided that the written description and enablement requirements are still fulfilled.

In summary, the packet forwarding device, the packet-forwarding priority setting circuit and the packet-forwarding priority setting method of the present disclosure provides a way to implement the QoS feature for those unclassified packet streams, and can be realized in a simple, efficient and cost-effective manner. Furthermore, user experience can be enhanced through the invention of the present disclosure.

The aforementioned descriptions represent merely the preferred embodiments of the present disclosure, without any intention to limit the scope of the present disclosure thereto. Various equivalent changes, alterations, or modifications based on the claims of the present disclosure are all consequently viewed as being embraced by the scope of the present disclosure.