sending packets from iperf packet generator in continuous mode - udp

Can we send packets from iperf generator in a continuous mode? Currently, I am sending packets in a burst mode by using command
iperf -c 10.0.0.2 -u -b 1m -t 1
where u is UDP packets 1m is bandwidth (1 Mbps) and t is a time which is 1 second.
but I want to send in continuous mode.

Time can be a floating-point value, and one special floating-point value is infinity:
iperf3 -c 10.0.0.2 -tinf
iperf -c 10.0.0.2 -tinf

For iperf 2.0.13 use iperf -c -b 1pps
CLIENT SPECIFIC OPTIONS
-b, --bandwidth n[kmgKMG] | npps
set target bandwidth to n bits/sec (default 1 Mbit/sec) or n packets per sec. This may be used with TCP or UDP. For variable loads use format mean,standard deviation
Bob

for iperf v3.0.11 : you can play with -w "windows size" value

Related

Unable to set correctly a firewall in mininet with sdn and opeflow ovs (UDP Version )

I'm experimenting with mininet in ubuntu 14 in order to create a basic firewall which blocks the udp packets from one host ( h1= 10.0.0.1 ) to another ( h4= 10.0.0.4 ).
Those hosts are in the same vlan and in different switchs (if that can be of any help). Also I would like to block it the udp packets which the destination port as 5001.
To do it so, i have launch two xterm in h1(in mininet) in order to check the ping is working correctly and also launch the packets to h4. xterm h1: "iperf -u -c10.0.0.4 -p 5001 -i 5 -b 200K -t 360".
In mininet I also have open a xterm h4 to set it up as a server listening in the port 5001. xterm h4: "iperf -s -u -p 5001 -i 5​".
When I guess the rule I have to introduce is this one "sh ovs-ofctl add-flow s1 udp_dst=5001,nw_proto=17,actions=drop"
But, it doesnt work due to the packets are still arriving. The ping works fine, but ( and here comes the main problem) the packet arrives at the server and it shouldn't.
Any help please?
Thank you very much
Here I leave you the screenshots of the network topology and also what I appear in the xterm windows.

iptables to allow only first udp packet and drop remaining all udp packets for next 10 seconds

How to make iptable to allow only first udp packet from a source and block subsequent packets from that source for next 10 seconds.
On a linux server receives first udp packet from the client, if response is delayed by 100 ms, client is keep on sending request packet for every 100ms until client receives response.
To avoid this, at server only first packet must be received and subsequent packets should be dropped.
I tried dropping first 4 packets and responding to only 5th packet using below iptables.
iptables -A INPUT -p udp -m recent --name attack --set
iptables -A INPUT -p udp -m recent --name attack --rcheck --seconds 10 --hitcount 4 -j ACCEPT
iptables -A INPUT -p udp -j DROP

iperf connects but does not report output

I am using iperf to test network bandwidth between two Ubuntu 16.04.2 hosts (10.0.0.1 and 10.0.0.51). I ran "iperf -s" on 10.0.0.51 and then ran "iperf -c 10.0.0.51 -T 10" on 10.0.0.1. I do see the connection establishment (i.e. local 10.0.0.51 port 5001 connected with 10.0.0.1 port 37680) on both the sides but I do not get the results. It just hangs. Any help is highly appreciated. Thanks
with iperf3, you can see the output in json format:
The command:
iperf3 -c <server-ip> -w 4000 -t 10 -i 2 -f MBytes -V -J --logfile test.log
Note: In this case make sure you can run iperf client and server same version i.e version 3 in both cases
Check for firewalls or packet filters, e.g. for linux use iptables -L to list them and iptables -F to delete them all. Also, what version of iperf? You might want to display interval reports (-i 1) and see what they are reporting.

How can two or more applications use PF_RING ZC cluster?

The following Picture indicates that many applications could use PF_RING clusters.
I have tested this by the following commands.
./zount -i eth0 -c 55 ---- ok
./zcount1 -i eth0 -c 99 ----- ok
Suppose i want to use pf_ring zc. As far as i know If you open a device using a PF_RING-aware driver in zero copy (e.g. pfcount -i zc:eth1) the device becomes unavailable to standard networking as it is accessed in zero-copy through kernel bypass, as happened with the predecessor DNA. Once the application accessing the device is closed, standard networking activities can take place again.
I have 2 questions:
Question 1- as long as the application connected to the NIC via ZC (e.g. pfcount -i zc:eth1), the NIC is inaccessible to other applications .in such a situations no one could use zero copy.
$pfcount2 -i zc:eth1 -------- error .
if i am wrong ,is it possible to use PF_RING ZC like PF_RING? the following pic show what i am trying to say.
Question 2: is it possible to use PFRing_zc as follow? if the answer is YES, how ? is there any API?
Thanks in Advance
cardigliano, a ntop member ,answered my question:
yes you can do both with zbalance:
zbalance_ipc -i zc:ethX -c 99 -m 0 -n
zbalance_ipc -i zc:ethX -c 99 -m 0 -n ,
Please take a look at zbalance_ipc -h for more options and at the zbalance_ipc output to see how to attach consumers to the cluster. There is also a
README.examples with a few examples.

How to test Berkley socket (BSD) API?

I'd like to test the correctness and the completeness of an implementation of the BSP API.
The test set has to be cross-compiled for an ARM sam7x.
I don't know if this would be of any interest to you, but here are two links to presentations from NYC BSD Conference 2008: Detecting TCP regressions with tcpdiff (FreeBSD) and An introduction to the Automated Testing Framework (ATF) for NetBSD. Both were pretty good.
There is a public domain Benchmarking tool for TCP and UDP performance measurement.
It has a some amount of control available. You might be able to use it for testing.
Remember, this is not testing the API, but the implementation performance, you will need more than this.
The PCATTCP tool includes several options that are controlled by parameters passed on the command line when the program is started. To see the available options, run the PCATTCP application with the "-h" option. Here is what you would see:
pcattcp -h
PCAUSA Test TCP Utility V2.01.01.08
Usage: pcattcp -t [-options] host [ < in ]
pcattcp -r [-options > out]
Common options:
-l ## length of bufs read from or written to network (default 8192)
-u use UDP instead of TCP
-p ## port number to send to or listen at (default 5001)
-s toggle sinkmode (enabled by default)
sinkmode enabled:
-t: source (transmit) fabricated pattern
-r: sink (discard) all received data
sinkmode disabled:
-t: reads data to be transmitted from stdin
-r: writes received data to stdout
-A align the start of buffers to this modulus (default 16384)
-O start buffers at this offset from the modulus (default 0)
-v verbose: print more statistics
-d set SO_DEBUG socket option
-b ## set socket buffer size (if supported)
-f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga
-c -t: send continuously
-r: accept multiple connections sequentially
-R concurrent TCP/UDP multithreaded receiver
.
Options specific to -t:
-n ## number of source bufs written to network (default 2048)
-D don't buffer TCP writes (sets TCP_NODELAY socket option)
-w ## milliseconds of delay before each write (default 0)
-L ## desired transmit data rate in bytes/second
Options specific to -r:
-B for -s, only output full blocks as specified by -l (for TAR)
-T "touch": access each byte as it's read