Limiting the number of subnet hosts learned by a network device in a given time period
Some disclosed examples involve receiving, by an application-specific integrated circuit (ASIC) of a network device, an indication that a maximum number of learned Internet Protocol (IP) hosts for a subnet has been reached for a given time interval. A “learned IP host” is an IP host for which a corresponding MAC address is known. Some disclosed examples involve receiving, by the ASIC and in a time interval during which the maximum number of learned IP hosts for the subnet has been reached, a packet having a destination IP address for an unlearned host on the subnet for which the corresponding MAC address is not known. Some disclosed examples involve dropping, by the ASIC, the received packet without involving the CPU of the device.
1 . A network device comprising:
a central processing unit (CPU);
an interface system including one or more network interfaces configured for sending and receiving packets from other devices via a network; and
one or more application-specific integrated circuits (ASICs) configured for packet forwarding, each of the one or more ASICs configured to:
receive an indication that a maximum number of learned Internet Protocol (IP) hosts for a subnet that includes the network device has been reached, a learned IP host being an IP host for which a corresponding media access control (MAC) address is known;
receive, via the interface system and in a time interval during which the maximum number of learned IP hosts for the subnet has been reached, a packet having a destination IP address for an unlearned host on the subnet for which a corresponding MAC address is not known, wherein the MAC address corresponding to the destination IP address for the unlearned host is not known based on an Address Resolution Protocol (ARP) cache lacking a binding of the destination IP address and the corresponding MAC address for the unlearned host; and
drop the received packet.
2 . The network device of claim 1 , wherein the indication is received from the CPU.
3 . The network device of claim 1 , wherein the maximum number of learned IP hosts is specific to an IP version.
4 . The network device of claim 3 , wherein the IP version is IP version 4 or IP version 6.
5 . The network device of claim 1 , wherein each of the one or more ASICs is configured to drop the received packet without sending the received packet to the CPU.
6 . The network device of claim 1 , wherein each of the one or more ASICs is configured to drop the received packet without sending information regarding the received packet to the CPU.
7 . The network device of claim 1 , wherein each of the one or more ASICs is further configured to:
receive an indication that one or more IP hosts have been unlearned for the subnet;
receive, via the interface system, an additional packet having the destination IP address for the unlearned host on the subnet for which the corresponding MAC address is not known; and
forward the additional packet to the CPU.
8 . A method, comprising:
receiving, by an application-specific integrated circuit (ASIC), an indication that a maximum number of learned Internet Protocol (IP) hosts for a subnet has been reached, a learned IP host being an IP host for which a corresponding media access control (MAC) address is known;
receiving, by the ASIC and in a time interval during which the maximum number of learned IP hosts for the subnet has been reached, a packet having a destination IP address for an unlearned host on the subnet for which a corresponding MAC address is not known, wherein the MAC address corresponding to the destination IP address for the unlearned host is not known based on an Address Resolution Protocol (ARP) cache lacking a binding of the destination IP address and the corresponding MAC address for the unlearned host, the ARP cache having bindings of destination IP addresses and corresponding MAC addresses updated based on ARP responses; and
dropping, by the ASIC, the received packet.
9 . The method of claim 8 , wherein the indication is received from a CPU of an apparatus included in the subnet and wherein the apparatus includes the ASIC.
10 . The method of claim 9 , further comprising dropping, by the ASIC, the received packet without sending the received packet to the CPU.
11 . The method of claim 9 , further comprising dropping, by the ASIC, the received packet without sending information regarding the received packet to the CPU.
12 . The method of claim 9 , further comprising:
receiving, by the ASIC, an indication that one or more IP hosts have been unlearned for the subnet;
receiving, by the ASIC, an additional packet having the destination IP address for the unlearned host on the subnet for which the corresponding MAC address is not known; and
forwarding, by the ASIC, the additional packet to the CPU.
13 . The method of claim 8 , wherein the maximum number of learned IP hosts is specific to an IP version.
14 . The method of claim 13 , wherein the IP version is IP version 4 or IP version 6.
15 . One or more non-transitory computer-readable media having instructions for performing a method encoded thereon, the method comprising:
receiving, by an application-specific integrated circuit (ASIC), an indication that a maximum number of learned Internet Protocol (IP) hosts for a subnet has been reached, a learned IP host being an IP host for which a corresponding media access control (MAC) address is known;
receiving, by the ASIC and in a time interval during which the maximum number of learned IP hosts for the subnet has been reached, a packet having a destination IP address for an unlearned host on the subnet for which a corresponding MAC address is not known, wherein the MAC address corresponding to the destination IP address for the unlearned host is not known based on an Address Resolution Protocol (ARP) cache lacking a binding of the destination IP address and the corresponding MAC address for the unlearned host, the binding having been deleted from the ARP cache pursuant to a time-out process; and
dropping, by the ASIC, the received packet.
16 . The one or more non-transitory computer-readable media of claim 15 , wherein the indication is received from a CPU of an apparatus included in the subnet and wherein the apparatus includes the ASIC.
17 . The one or more non-transitory computer-readable media of claim 16 , wherein the method further comprises dropping, by the ASIC, the received packet without sending the received packet to the CPU.
18 . The one or more non-transitory computer-readable media of claim 16 , wherein the method further comprises dropping, by the ASIC, the received packet without sending information regarding the received packet to the CPU.
19 . The one or more non-transitory computer-readable media of claim 15 , wherein the method further comprises:
receiving, by the ASIC, an indication that one or more learned IP hosts have been unlearned for the subnet;
receiving, by the ASIC, an additional packet having the destination IP address for the unlearned host on the subnet for which the corresponding MAC address is not known; and
forwarding, by the ASIC, the additional packet to the CPU.
20 . The one or more non-transitory computer-readable media of claim 15 , wherein the maximum number of learned IP hosts is specific to an IP version.