Interesting firewall or hardware issue - Linux and iptables
Interesting firewall or hardware issue - Linux and iptables
Author
Discussion

TonyRPH

Original Poster:

13,546 posts

198 months

Wednesday 3rd November 2021
quotequote all
I have a really odd issue with my firewall here at home. I believe this is a hardware issue.

Uploads from Linux boxes on the LAN are slow, but from Windows boxes they are fine.

If I run a Linux VM on a Windows host, the upload speeds from that Linux box are fine.

Uploads via a site to site VPN are fine both on Linux and Windows.

Download speeds are fine on all boxes.

Fiddling with different MTU sizes does not improve the upload speeds.

However - swapping out the firewall hardware fixes things.

I have many years of experience with this stuff, but I've not encountered anything like this.

The only thing I can think of, is a problem with the Linux Realtek drivers on the firewall.

xeny

5,501 posts

108 months

Wednesday 3rd November 2021
quotequote all
What protocol are you using for the upload?

It's not some peculiar IP v4 vs IP v6 issue is it?

TonyRPH

Original Poster:

13,546 posts

198 months

Wednesday 3rd November 2021
quotequote all
xeny said:
What protocol are you using for the upload?

It's not some peculiar IP v4 vs IP v6 issue is it?
The entire network (internet connection included) is ipv4, with ipv6 disabled (on Linux by using "ipv6.disable=1" on the kernel command line).


e-honda

9,548 posts

176 months

Wednesday 3rd November 2021
quotequote all
I'm guessing your downloads are tcp
I would look at trying a udp speed test, particularly if you vpn is udp and unaffected.

There is a broad array of tcp kernel parameters that default to behaviour that is different enough to windows for there to be significant performance differences under the right circumstances.
My best guess would be tcp_congestion_control

xeny

5,501 posts

108 months

Wednesday 3rd November 2021
quotequote all
Have you tried Linux VMs both with NAT'd and bridged connections? Wondering if NAT is good and bridged will exhibit the problem.

TonyRPH

Original Poster:

13,546 posts

198 months

Wednesday 3rd November 2021
quotequote all
e-honda said:
I'm guessing your downloads are tcp
I would look at trying a udp speed test, particularly if you vpn is udp and unaffected.

There is a broad array of tcp kernel parameters that default to behaviour that is different enough to windows for there to be significant performance differences under the right circumstances.
My best guess would be tcp_congestion_control
I've been through more TCP parameters than I care to remember - even restoring to defaults.

The thing is - on other hardware the problem goes away...

It's also just uploads that are affected - downloads are absolutely fine.

This is a really, really strange issue - the only thing I can think of, is that the Realtek NIC drivers are doing something odd (and given the reputation of the Realtek NIC hardware on Linux this wouldn't surprise me). Sadly, the NICs are on board so swapping them out is not an option (it's a small form factor machine).

xeny said:
Have you tried Linux VMs both with NAT'd and bridged connections? Wondering if NAT is good and bridged will exhibit the problem.
That's an interesting idea - I'll try the bridged connection in a VM tomorrow.

I've reached the stage where I'm happy to swap out the hardware - but curiosity is getting the better of me and I want to know what it is...

duff-man

634 posts

236 months

Thursday 4th November 2021
quotequote all
Anything show in a packet capture?

outnumbered

4,878 posts

264 months

Thursday 4th November 2021
quotequote all
This is where you need to get tcpdump/wireshark out, and look at the TCP streams in detail. Presumably there will be some difference in the handshake parameters. As an example, if SACK isn’t used, that can make a big difference to recovery from lost packets. Window sizing is another etc.

TonyRPH

Original Poster:

13,546 posts

198 months

Thursday 4th November 2021
quotequote all
duff-man said:
Anything show in a packet capture?
outnumbered said:
This is where you need to get tcpdump/wireshark out, and look at the TCP streams in detail. Presumably there will be some difference in the handshake parameters. As an example, if SACK isn’t used, that can make a big difference to recovery from lost packets. Window sizing is another etc.
Replying to you both at once...

I've not tried packet capture, and I'm not sure if I want to put that much effort into it!

@outnumbered makes a couple of interesting points. I suspect my (in depth) knowledge of networking is not quite good enough to investigate down to this level.

eltawater

3,533 posts

209 months

Thursday 4th November 2021
quotequote all
Have you considered bunging a cheap usb Wifi dongle onto one of the linux boxes to eliminate the onboard nic / cabling from the equation?

And when you swapped out the firewall hardware and all is fine, what is the "firewall hardware" ?

TonyRPH

Original Poster:

13,546 posts

198 months

Thursday 4th November 2021
quotequote all
eltawater said:
Have you considered bunging a cheap usb Wifi dongle onto one of the linux boxes to eliminate the onboard nic / cabling from the equation?
I have a USB to Ethernet dongle which I could try, along with a Wireless dongle.

eltawater said:
And when you swapped out the firewall hardware and all is fine, what is the "firewall hardware" ?
Linux distro is vanilla Debian, current version is 10.11, running kernel: Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux

The hardware that works:

Intel Celeron N2940 Quad-core Small Computer with Windows/Linux, 4x Intel Gigabit Ethernet for Network Firewall Gateway Router, 4G RAM 64G SSD/USB 3.0/2.4G WiFi/HDMI/VGA

The hardware that DOESN'T work:

The current firewall hardware is a FUJITSU D2963-S2 (2GB RAM)

cpu:
AMD Athlon(tm) Neo X2 Dual Core Processor L325, 1500 MHz
AMD Athlon(tm) Neo X2 Dual Core Processor L325, 1500 MHz
network:
enp2s0 Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
enp3s0 Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller

bridge:
AMD K8 [Athlon64/Opteron] Miscellaneous Control
AMD K8 [Athlon64/Opteron] Address Map
ATI RS690/RS740 PCI to PCI Bridge (Internal gfx)
ATI SB600 PCI to LPC Bridge
ATI RS690 PCI to PCI Bridge (PCI Express Port 3)
ATI RS690 Host Bridge
AMD K8 [Athlon64/Opteron] DRAM Controller
ATI RS690 PCI to PCI Bridge (PCI Express Port 2)
AMD K8 [Athlon64/Opteron] HyperTransport Technology Configuration
ATI SBx00 PCI to PCI Bridge




TonyRPH

Original Poster:

13,546 posts

198 months

Friday 26th November 2021
quotequote all
I have an update on this.

My connection was previously: Linux firewall --> Cisco 887 router --> VDSL.

The Cisco failed the other day, and I went back to using the BT Modem and the Linux PPP stack on my firewall.

And now suddenly I have full speed uploads via SFTP.

All rather bewlidering!


outnumbered

4,878 posts

264 months

Friday 26th November 2021
quotequote all
TonyRPH said:
I have an update on this.

My connection was previously: Linux firewall --> Cisco 887 router --> VDSL.

The Cisco failed the other day, and I went back to using the BT Modem and the Linux PPP stack on my firewall.

And now suddenly I have full speed uploads via SFTP.

All rather bewlidering!
Might explain everything, but it's very dependent on the configuration of the Cisco device. There are any number of features in IOS that could be messing with TCP in one way or another.

TonyRPH

Original Poster:

13,546 posts

198 months

Friday 26th November 2021
quotequote all
outnumbered said:
Might explain everything, but it's very dependent on the configuration of the Cisco device. There are any number of features in IOS that could be messing with TCP in one way or another.
The Cisco config is here on Pastebin


outnumbered

4,878 posts

264 months

Friday 26th November 2021
quotequote all
TonyRPH said:
The Cisco config is here on Pastebin
OK, so that's a bare minimum config with nothing turned on. In that case, I still have no idea.

Richyvrlimited

1,889 posts

193 months

Friday 26th November 2021
quotequote all
it's lost now if you'ver unplugged it but seeing the interface stats on the CISCO router would be interesting (sho int fa0 )

I suspect it'd have a large number of input drops due to small buffers.