Net::Write::Fast - create and inject packets fast
use Net::Write::Fast; # Sends multiple TCP SYNs to multiple IPv4 targets my $r = Net::Write::Fast::l4_send_tcp_syn_multi( "127.0.0.1", # IPv4 source [ '127.0.0.2', '127.0.0.3' ], # IPv4 targets [ 25, 80, 110 ], # TCP port targets 200, # Number of packet per second 3, # Number of try 0, # Use IPv6 0, # OPTIONAL: enable warnings flag ); # Sends multiple TCP SYNs to multiple IPv6 targets my $r = Net::Write::Fast::l4_send_tcp_syn_multi( "::1", # IPv6 source [ '::2', '::3' ], # IPv6 targets [ 25, 80, 110 ], # TCP port targets 200, # Number of packet per second 3, # Number of try 1, # Use IPv6 0, # OPTIONAL: enable warnings flag ); # Handle errors if ($r == 0) { print STDERR "ERROR: ",Net::Write::Fast::nwf_geterror(),"\n"; }
Sends network frames fast to the network.
If you got some ENOBUFS errors, you will have to tune your Operating System TCP/IP stack. For Linux, you can increase buffer size using the following commands:
# Should be enough to send at 200_000 pps (~ 10 MB of bandwidth)
sysctl -w net.core.wmem_max=109051904 # 100 MB
sysctl -w net.core.wmem_default=109051904 # 100 MB
Sends multiple TCP SYNs at layer 4 to multiple IP targets. Returns 0 in case of failure, and sets error buffer to an error message.
Get latest error message.
Returns a HASHREF with days, hours, minutes and seconds for estimated running time.
Returns as string by takink the HASHREF obtained from estimate_runtime().
Patrice <GomoR> Auffret
Copyright (c) 2011-2016, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.
To install Net::Write::Fast, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Write::Fast
CPAN shell
perl -MCPAN -e shell install Net::Write::Fast
For more information on module installation, please visit the detailed CPAN module installation guide.