ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
266 stars 46 forks source link

hosts > 1024 #41

Closed gato-gto closed 2 years ago

gato-gto commented 2 years ago

Issue

hosts = ['172.20.20.1','172.20.20.2','172.20.20.3',...] # 1173 items in the list

result = await async_multiping(hosts, count=2, timeout=1, interval=0.4, privileged=False, payload_size=16)
for item in result:
    pass

Output

------------------------------------------------------------
  172.20.20.62
------------------------------------------------------------
  Packets sent:     2
  Packets received: 2
  Packet loss:      0.0%
  Round-trip times: 2.74 ms / 410.135 ms / 817.53 ms
  Jitter:           814.79 ms
------------------------------------------------------------
  172.20.20.80
------------------------------------------------------------
  Packets sent:     2
  Packets received: 2
  Packet loss:      0.0%
  Round-trip times: 1.934 ms / 2.99 ms / 4.046 ms
  Jitter:           2.113 ms
------------------------------------------------------------
  172.20.20.65
------------------------------------------------------------
  Packets sent:     0
  Packets received: 0
  Packet loss:      0.0%
  Round-trip times: 0.0 ms / 0.0 ms / 0.0 ms
  Jitter:           0.0 ms
------------------------------------------------------------
  172.20.20.81
------------------------------------------------------------
  Packets sent:     0
  Packets received: 0
  Packet loss:      0.0%
  Round-trip times: 0.0 ms / 0.0 ms / 0.0 ms
  Jitter:           0.0 ms
------------------------------------------------------------
  172.20.20.63
------------------------------------------------------------
  Packets sent:     0
  Packets received: 0
  Packet loss:      0.0%
  Round-trip times: 0.0 ms / 0.0 ms / 0.0 ms
  Jitter:           0.0 ms

If there are more than 1024 addresses, then in the answer I also get instances with standard (empty) data. Or are there options for how this can be handled?

gato-gto commented 2 years ago

Solved the problem, the ARP table was overwhelmed. net.ipv4.neigh.default.gcthresh1 thanks link to solution_