Git Product home page Git Product logo

iperf2's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iperf2's Issues

Negative bits xfered because of int overflow when xfer > 2 Gbytes/sec.

diff --git a/src/ReportDefault.c b/src/ReportDefault.c
index 52f781a..d10f87f 100644
--- a/src/ReportDefault.c
+++ b/src/ReportDefault.c
@@ -70,7 +70,7 @@ extern "C" {
  */
 void reporter_printstats( Transfer_Info *stats ) {
     static char header_printed = 0;
-    int bytesxfered;
+    umax_size_t bytesxfered;
 
     byte_snprintf( buffer, sizeof(buffer)/2, (double) stats->TotalLen,
                    toupper( (int)stats->mFormat));

UDP Server Bound to a TAP interface fails to receive data

I need to have Iperf2 handle a simple IPv4 data stream on a single Linux workstation, where various TAP interfaces are present to represent virtual Ethernet interfaces. I have routing setup such that on the tx side, Iperf2 works well and targets in my case, the zeth0 TAP interface. The following command is used to transmit the data:

iperf -c 192.0.1.1 -u -i1 -b5M -l188 -p49169 -t5

I am unable to get Iperf2 on the listen side to see any of the data, which is written by an application to a virtual TAP interface as zeth1.

I have changed the source code such that when the following arguments are used, it attempts to bind the listen socket to the zeth1 interface. The address I will be using is not a real multicast.

-s -u -B0.0.0.0%zeth1 -p49169

I have tried both the ANY IP address, as well as a targeted one as 138.0.0.254, which is assigned to the outgoing TAP interface.

Wireshark traces on zeth1 show the presence of the data, with the destination port matching the assignment as 49169, a destination IP as 138.0.0.254, and a broadcast destination MAC address.

Within config.h, I have HAVE_THREAD_DEBUG defined so that the output provides additional information. A running log of the program is as follows.

I have breakpoints set for the various recvfrom() calls that never get triggered.

The custom code added result in the following text in the output:

Listen socket 3 successfully bound to interface 'zeth1'
Listen socket 3 bound to port 49169
Listen socket 3 bound to address 138.0.0.254

Are there any recommendations on what is happening and how to bind the listener to a particular virtual device? I would prefer to bind to both a destination device as well as a destination or source IP if possible.

00:35:49: Starting /home/robocom/Downloads/iperf-2.1.1-dev/src/iperf -s -u -B138.0.0.254%zeth1 -p49169 ...
THREAD(24633):[00:35:49.100752] Copy thread settings (malloc) from/to=0x55bf91f05eb0/0x55bf91f06400 report/sum/fullduplex (nil)/(nil)/(nil)
THREAD(24633):[00:35:49.100852] Thread_run_wrapper(0x55bf91f06400 mode=3) thread counts tot/trfc=1/0
THREAD(24634):[00:35:49.100872] Reporter thread started
THREAD(24635):[00:35:49.100919] Listener main loop port 49169 
THREAD(24634):[00:35:49.100942] Alloc common=0x7fefe4000d50
THREAD(24633):[00:35:49.100957] Thread_run_wrapper(0x55bf91f05eb0 mode=7) thread counts tot/trfc=2/0
THREAD(24634):[00:35:49.100977] Reporter await done
THREAD(24635):[00:35:49.100990] Alloc common=0x7fefdc0014f0
THREAD(24635):[00:35:49.101002] Init settings report 0x7fefdc001280
THREAD(24635):[00:35:49.101007] Jobq *POST* report 0x7fefdc001280 (settings)
THREAD(24634):[00:35:49.101016] Jobq *WAIT* exit  (nil)/0x7fefdc001280 cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:49.101031] Jobq *ROOT* 0x7fefdc001280 (last=(nil))
------------------------------------------------------------
Server listening on UDP port 49169
THREAD(24635):[00:35:49.101045] Copy thread settings (malloc) from/to=0x55bf91f05eb0/0x7fefdc001780 report/sum/fullduplex (nil)/(nil)/(nil)
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
THREAD(24635):[00:35:49.101057] Listener thread listening for UDP (sock=3)
THREAD(24634):[00:35:49.101066] Jobq *FREE* report 0x7fefdc001280 (settings)
THREAD(24634):[00:35:49.101074] Free common=0x7fefdc0014f0
THREAD(24634):[00:35:49.101080] Jobq *REMOVE* 0x7fefdc001280
Listen socket 3 successfully bound to interface 'zeth1'
Listen socket 3 bound to port 49169
Listen socket 3 bound to address 138.0.0.254
THREAD(24634):[00:35:50.101147] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:51.101236] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:52.101323] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:53.101412] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:54.101500] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:55.101595] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:56.101684] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:57.101774] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:58.101862] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:35:59.101948] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:36:00.102037] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:36:01.102121] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0
THREAD(24634):[00:36:02.102217] Jobq *WAIT* exit  (nil)/(nil) cond=0x55bf9187b9c0 threads=0


Routing table and ifconfig dumps are as follows:

zeth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1600
        inet 192.0.1.2  netmask 255.255.255.0  broadcast 192.0.1.255
        inet6 fe80::200:5eff:fe00:53ff  prefixlen 64  scopeid 0x20<link>
        ether 00:00:5e:00:53:ff  txqueuelen 1000  (Ethernet)
        RX packets 9  bytes 378 (378.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 174617  bytes 40153500 (40.1 MB)
        TX errors 0  dropped 2 overruns 0  carrier 0  collisions 0

zeth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 138.0.0.254  netmask 255.255.255.0  broadcast 138.0.0.255
        inet6 fe80::200:5eff:fe00:52ff  prefixlen 64  scopeid 0x20<link>
        ether 00:00:5e:00:52:ff  txqueuelen 1000  (Ethernet)
        RX packets 174530  bytes 40141900 (40.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 78  bytes 11222 (11.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         home            0.0.0.0         UG    600    0        0 wlp3s0
138.0.0.0       0.0.0.0         255.255.255.0   U     0      0        0 zeth1
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 wlp3s0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.0.1.0       0.0.0.0         255.255.255.0   U     0      0        0 zeth0
192.168.200.0   0.0.0.0         255.255.255.0   U     600    0        0 wlp3s0
200.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 zeth0


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.