Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Manikandan Thiagarajan <tmani@prosimo.io>
To: wireguard@lists.zx2c4.com
Subject: Netstat bytes count doesn't match with Wireguard
Date: Tue, 14 Sep 2021 13:53:22 -0700	[thread overview]
Message-ID: <DBFC0427-180B-4757-A93A-0D9DECD959EE@prosimo.io> (raw)

Hi,

I use the Wireguard Go C API to integrate with my packet tunnel network extension to forward traffic to the WG tunnel on Mac OS. I also use the wgGetConfig() API to get tunnel status information.

During my testing, I noticed some differences between what the netstat -ib reports and what Wireguard reports as rx and tx bytes. Usually the Wireguard numbers are higher than netstat numbers.

Is it normal to see so much difference? Can you be able to provide me some information or point me to a doc on how Wireguard calculates the tx/rx bytes?


Netstat -ib output:
Name  Mtu   Network       Address            Ipkts Ierrs     Ibytes    Opkts Oerrs     Obytes  Coll
utun2 1420  <Link#23>                          130     0      42713      180     0      15245     0
utun2 1420  100.101.113.5 100.101.113.54       130     -      42713      180     -      15245     -

Wireguard output:
last_handshake_time_sec=1631646164
last_handshake_time_nsec=79839000
tx_bytes=21328
rx_bytes=47980
persistent_keepalive_interval=0
allowed_ip=155.2.135.28/32
allowed_ip=192.168.128.4/32

Thanks,
Mani

             reply	other threads:[~2021-09-14 20:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 20:53 Manikandan Thiagarajan [this message]
2021-09-15  7:31 ` Aaron Jones
2022-03-10  1:00 ` Wireguard Go C API Callbacks Manikandan Thiagarajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DBFC0427-180B-4757-A93A-0D9DECD959EE@prosimo.io \
    --to=tmani@prosimo.io \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).