Community discussions

MikroTik App
 
User avatar
Znevna
Forum Guru
Forum Guru
Topic Author
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

WireGuard: peer traffic counter 32bit

Wed May 31, 2023 6:32 pm

Hello, I never saw over 4GiB on wireguard per peer traffic counters, is it only me?
Support obviously can't reproduce this on their devices.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18958
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 8:11 pm

never checked, maybe your device is aware you cannot count any higher than 4 ?

I wonder if there is some magic reset threshold............
 
User avatar
Znevna
Forum Guru
Forum Guru
Topic Author
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 8:42 pm

One month ago:
wg-int.png
wg-peer.png
Now:
wg-int-now.PNG
wg-peer-now.PNG
Impossibru.
The interface only has this one peer, as you can see in both cases, now and one month ago RX counters match, as they are under 4GiB. But the peer TX counter rolled over a few times since then.
I love the "can't reproduce" replies, I've asked for a screenshot with a peer recording over 4 GiB, let's see what they cook up.
You do not have the required permissions to view the files attached to this post.
 
holvoetn
Forum Guru
Forum Guru
Posts: 5318
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 10:00 pm

You are quite correct, I see the same thing.
I have a daily copy job of roughly 8Gb which gets pulled over to my laptop using wireguard on my router.
I never see the counters moving over 4Gb.
So for me it's quite easy to demonstrate the problem.
2023-05-31_20-56-54.jpg
2023-05-31_20-58-05.jpg

I seem to recall this has been reported already before ... have to look for the correct post.
EDIT: found it, 7.6RC thread:
viewtopic.php?p=961250&hilit=wireguard+4Gb#p961250
You do not have the required permissions to view the files attached to this post.
 
User avatar
Znevna
Forum Guru
Forum Guru
Topic Author
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 10:02 pm

Well, surely it's easy to reproduce, setup two peers and push over 4GiB of data over them, but if they can't replicate the issue....
Ah, the old "bug reports lost in release topics" issue :P
 
holvoetn
Forum Guru
Forum Guru
Posts: 5318
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 10:06 pm

Did you create a support ticket for it ?
Otherwise I will and point them to this thread.
 
User avatar
Znevna
Forum Guru
Forum Guru
Topic Author
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 10:10 pm

Reference: SUP-114497
Summary: WireGuard: Peers Rx/Tx counters stored as 32bit

Maybe it's platform dependent? I've only tested arm64 (rb5009).
 
holvoetn
Forum Guru
Forum Guru
Posts: 5318
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 10:13 pm

Maybe it's platform dependent? I've only tested arm64 (rb5009).
Nah. I got my RB5009 since february of this year and I see in that 7.6RC thread I discussed it in oct 2022.
At that time my main router was Hex.
So it's not only arm64.
 
User avatar
Znevna
Forum Guru
Forum Guru
Topic Author
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: WireGuard: peer traffic counter 32bit

Wed May 31, 2023 11:40 pm

Screenshot_20230531_233317_MikroTik.jpg
It was mentioned in that topic that it even goes negative in the Android App, welp.. t's true.. rofl
Surely they can't reproduce this either I presume..
You do not have the required permissions to view the files attached to this post.
 
User avatar
Znevna
Forum Guru
Forum Guru
Topic Author
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: WireGuard: peer traffic counter 32bit

Thu Jun 01, 2023 9:40 pm

Wait... why is the MikroTik Android App using different units here? MB vs MiB? ....
[admin@MikroTik] > :put [/interface/wireguard/peers/get [find where interface=wg-rw-01] value-name=rx ]
995382692
WinBox / WebFig shows 949.3 MiB
The MikroTik App shows 995.4 MB
We're not selling storage devices, MikroTik .....
 
blacksnow
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Wed Feb 15, 2023 4:46 pm

Re: WireGuard: peer traffic counter 32bit

Thu Jun 01, 2023 9:56 pm

This is very easy to recreate.

1) Open webfig to the peer section so you can see the counters.
2) Push more than 4GiB of traffic, I push 5 just to be sure. (While on the page the counters will move past 4GiB without issue, but the counter history cannot save more than 4GiB)
3) Navigate away from the page to lets say the Interfaces page.
4) Go back to the wireguard/peers page and you will see the counters have reset.

Tested with CCR2216 on 7.10rc1.
 
User avatar
Znevna
Forum Guru
Forum Guru
Topic Author
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: WireGuard: peer traffic counter 32bit

Thu Jun 01, 2023 10:06 pm

Oh, so if you're watching in real time the counter doesn't reset?
Probably that's what they mean that they can't recreate this ... they've never closed/reopened that page/menu/window?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18958
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: WireGuard: peer traffic counter 32bit

Tue Jun 06, 2023 3:56 pm

If I can only figure out how to do this for my cell phone usage ;-)
 
holvoetn
Forum Guru
Forum Guru
Posts: 5318
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: WireGuard: peer traffic counter 32bit

Tue Jun 06, 2023 4:21 pm

This is very easy to recreate.

1) Open webfig to the peer section so you can see the counters.
2) Push more than 4GiB of traffic, I push 5 just to be sure. (While on the page the counters will move past 4GiB without issue, but the counter history cannot save more than 4GiB)
3) Navigate away from the page to lets say the Interfaces page.
4) Go back to the wireguard/peers page and you will see the counters have reset.

Tested with CCR2216 on 7.10rc1.
Happens in Winbox too.
Counters move up to 4Gb = 4096 Mb and then restart at 0.
You don't even have to move away from that window.

Who is online

Users browsing this forum: No registered users and 26 guests