Patent ID: 8451729

Claim:
A packet forwarding method, applied in an embedded device, the embedded device comprising a wide area network (WAN) port, a plurality of local area network (LAN) ports, and a packet forwarding module for forwarding packets from the LAN ports to the WAN port, wherein the packet forwarding method comprises: detecting whether any packets are being dropped in the WAN port; if the packets are being dropped in the WAN port, turning on a bandwidth classification mechanism, and classifying packets from the LAN ports into different types; if no packets are being dropped in the WAN port, determining whether the bandwidth classification mechanism turns on; if the bandwidth classification mechanism turns off, forwarding the packets to the WAN port; if the bandwidth classification mechanism turns on, determining whether any abuse packets are being dropped by the bandwidth classification mechanism; if no abuse packets are being dropped by the bandwidth classification mechanism, turning off the bandwidth classification mechanism; if the abuse packets are being dropped by the bandwidth classification mechanism, staying on the bandwidth classification mechanism; determining a mount of traffic for each type of packet in a fixed time period; comparing whether the traffic of each type of packet exceeds a predefined threshold, wherein the predefined threshold is variable according to a current used bandwidth of the embedded device; regarding the packets within the predefined threshold as normal packets, and forwarding the normal packets to the WAN port; and regarding the packets exceeding the predefined threshold as abuse packets, and dropping the abuse packets.