Tuesday, August 28, 2007

TCP Fast retransmission and TCP Out-of-Order segment packets between backend and frontend with Airlink Powerline adapter resulting jittery pic

I have outlined my setup and problem here.

I see "TCP Fast retransmission (suspected)" and "TCP Out-of-Order segment" packets between backend and frontend with Airlink Powerline adapter resulting jittery picture

I have Airlink 101 85Mpbs adapter that interconnects my backend and frontend. When I'm watching recordings I get jittery picture which is really unusable to watch.

I have Airlink powerline 85mpbs adapter linking my backend and frontend as follows:

backend (NetGear FA311 Rev A PCI NIC) ----- Airlink powerline adapter ----- Airlink powerline adapter ----- Airlink 8port switch ( ASW108) --- 100M cat5e link ----- frontend (RealTek built-in NIC)

I suspects it has something to do with backend NIC card or some TCP kernel settings needs finetuning here. Replacing Airlink power line adapter with cat5 cable is fairly difficult to achieve due to locations of the computers.

Note my settings in /etc/rc.local on backend further below.

See also
Wireshark screen captures and debug output from mythfrontend when watching recorded shows from backend in this blog.


Airlink powerline adapter:


http://www.airlink101.com/products/apl8511_22.html

Frontend:

http://global.shuttle.com/Product/barebone/brb_OverView.asp?B_id=10
Shuttle SK41G
512MB RAM
CPU: AMD Athlon(tm) XP 1800+
Ubuntu 7.04

root@frontend:~$ /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:30:1B:AD:BA:1B
inet addr:192.168.2.12 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::230:1bff:fead:ba1b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:109082 errors:0 dropped:0 overruns:0 frame:0
TX packets:75685 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:111786558 (106.6 MiB) TX bytes:6703936 (6.3 MiB)
Interrupt:16 Base address:0x6000



NIC: builtin Realtek
eth0: RealTek RTL8139 at 0xe0846000, 00:30:1b:ad:ba:1b, IRQ 16

root@frontend:/etc/modutils$ mii-tool eth0 -v
eth0: negotiated 100baseTx-FD, link ok
product info: vendor 00:00:00, model 0 rev 0
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
root@frontend:/etc/modutils$

root@frontend:/etc/modutils$ uname -a
Linux frontend 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux
root@frontend:/etc/modutils$


root@frontend:/etc/modprobe.d$ lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8375 [KM266/KL266] Host Bridge
00:01.0 PCI bridge: VIA Technologies, Inc. VT8633 [Apollo Pro266 AGP]
00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:0c.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 46)
00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge
00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 50)
01:00.0 VGA compatible controller: nVidia Corporation NV44A [GeForce 6200] (rev a1)
root@frontend:/etc/modprobe.d$


root@frontend:/etc/modprobe.d$ modinfo 8139too
filename: /lib/modules/2.6.20-16-generic/kernel/drivers/net/8139too.ko
version: 0.9.28
license: GPL
description: RealTek RTL-8139 Fast Ethernet driver
author: Jeff Garzik
srcversion: 4E63F2AFC876A326ECFBFCB
alias: pci:v*d00008139sv000013D1sd0000AB06bc*sc*i*
alias: pci:v*d00008139sv00001186sd00001300bc*sc*i*
alias: pci:v*d00008139sv000010ECsd00008139bc*sc*i*
alias: pci:v000010ECd00008129sv*sd*bc*sc*i*
alias: pci:v0000021Bd00008139sv*sd*bc*sc*i*
alias: pci:v00001743d00008139sv*sd*bc*sc*i*
alias: pci:v0000126Cd00001211sv*sd*bc*sc*i*
alias: pci:v0000018Ad00000106sv*sd*bc*sc*i*
alias: pci:v000002ACd00001012sv*sd*bc*sc*i*
alias: pci:v00001432d00009130sv*sd*bc*sc*i*
alias: pci:v000011DBd00001234sv*sd*bc*sc*i*
alias: pci:v000014EAd0000AB07sv*sd*bc*sc*i*
alias: pci:v000014EAd0000AB06sv*sd*bc*sc*i*
alias: pci:v00001259d0000A11Esv*sd*bc*sc*i*
alias: pci:v00001259d0000A117sv*sd*bc*sc*i*
alias: pci:v000013D1d0000AB06sv*sd*bc*sc*i*
alias: pci:v00001186d00001340sv*sd*bc*sc*i*
alias: pci:v00001186d00001300sv*sd*bc*sc*i*
alias: pci:v00004033d00001360sv*sd*bc*sc*i*
alias: pci:v00001500d00001360sv*sd*bc*sc*i*
alias: pci:v00001113d00001211sv*sd*bc*sc*i*
alias: pci:v000010ECd00008138sv*sd*bc*sc*i*
alias: pci:v000010ECd00008139sv*sd*bc*sc*i*
depends: mii
vermagic: 2.6.20-16-generic SMP mod_unload 586
parm: debug:8139too bitmapped message enable number (int)
parm: multicast_filter_limit:8139too maximum number of filtered multicast addresses (int)
parm: media:8139too: Bits 4+9: force full duplex, bit 5: 100Mbps (array of int)
parm: full_duplex:8139too: Force full duplex for board(s) (1) (array of int)
root@frontend:/etc/modprobe.d$


root@frontend:/etc/modprobe.d$ modinfo 8139cp
filename: /lib/modules/2.6.20-16-generic/kernel/drivers/net/8139cp.ko
license: GPL
version: 1.3
description: RealTek RTL-8139C+ series 10/100 PCI Ethernet driver
author: Jeff Garzik
srcversion: D10594E426220467191716A
alias: pci:v00000357d0000000Asv*sd*bc*sc*i*
alias: pci:v000010ECd00008139sv*sd*bc*sc*i*
depends: mii
vermagic: 2.6.20-16-generic SMP mod_unload 586
parm: debug:8139cp: bitmapped message enable number (int)
parm: multicast_filter_limit:8139cp: maximum number of filtered multicast addresses (int)
root@frontend:/etc/modprobe.d$

Backend:

DIY server
Pentium 4 @ 3.00GHz
1GB RAM
FC6 with two Hauppauge cards.
NIC: Netgear FA311 Rev 1 (natsemi module)
mythtv-0.20.2-163.fc6
Kernel: 2.6.22.2-42.fc6 #1 SMP Wed Aug 15 12:34:26 EDT 2007 i686 i686 i386 GNU/Linux

[root@backend ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:A0:CC:73:AE:32
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1967 errors:0 dropped:0 overruns:0 frame:0
TX packets:3196 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:153176 (149.5 KiB) TX bytes:990182 (966.9 KiB)
Interrupt:18 Base address:0x8000

[root@backend ~]# modinfo natsemi
filename: /lib/modules/2.6.22.2-42.fc6/kernel/drivers/net/natsemi.ko
license: GPL
description: National Semiconductor DP8381x series PCI Ethernet driver
author: Donald Becker
srcversion: A336271924FA5A500F664C8
alias: pci:v0000100Bd00000020sv*sd*bc*sc*i*
alias: pci:v0000100Bd00000020sv000012D9sd0000000Cbc*sc*i*
depends:
vermagic: 2.6.22.2-42.fc6 SMP mod_unload 686 4KSTACKS
parm: mtu:DP8381x MTU (all boards) (int)
parm: debug:DP8381x default debug level (int)
parm: rx_copybreak:DP8381x copy breakpoint for copy-only-tiny-frames (int)
parm: dspcfg_workaround:DP8381x: control DspCfg workaround (int)
parm: options:DP8381x: Bits 0-3: media type, bit 17: full duplex (array of int)
parm: full_duplex:DP8381x full duplex setting(s) (1) (array of int)
[root@backend ~]#

[root@backend ~]# mii-tool eth0 -v
eth0: 100 Mbit, full duplex, link ok
product info: vendor 08:00:17, model 2 rev 1
basic mode: 100 Mbit, full duplex
basic status: link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
[root@backend ~]#



[root@backend ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/bin/mtd --daemon
#
# http://www-128.ibm.com/developerworks/linux/library/l-hw2.html
#
# #"open up" the PCI bus by allowing fairly long bursts for all devices, increasing performance
#setpci -v -d *:* latency_timer=b0

#maximize latency timers for network and audio, allowing them to transmit
#more data per burst, preventing buffer over/underrun conditions

#setpci -v -s 00:0f.0 latency_timer=ff
#setpci -v -s 00:0e.0 latency_timer=ff


#On the first line, the -d *:* option tells setpci to apply this setting to all PCI devices. The latency_timer=b0 option sets the timer to 176 ("b0" is hexadecimal for 176.). the -s options on the last two lines specify the PCI device that will be affected by PCI bus/slot and function, rather than by vendor and device ID. These are the first numbers listed for each device when you type lspci. The ff value specifies a latency timer setting of 256, which is rounded down to 248 by setpci. If you're experiencing a PCI latency timer-related issue, you'll need to experiment with lspci and setpci to find the optimal values for your system. If your hardware can handle it, larger latency timer values are best.
#

setpci -v -d *:* latency_timer=b0

setpci -v -s 00:11.5 latency_timer=ff

setpci -v -s 00:0b.0 latency_timer=ff

ethtool -s eth0 autoneg off speed 100 duplex full
#
# http://www.silicondust.com/forum/viewtopic.php?t=2317
#

#sysctl -w net.core.rmem_max=1048576
sysctl -w net.core.rmem_max=65535
sysctl -w net.core.wmem_max=65535

[root@backend ~]#

[root@backend tmp]# lspci
00:00.0 Host bridge: VIA Technologies, Inc. PT880 Host Bridge
00:00.1 Host bridge: VIA Technologies, Inc. PT880 Host Bridge
00:00.2 Host bridge: VIA Technologies, Inc. PT880 Host Bridge
00:00.3 Host bridge: VIA Technologies, Inc. PT880 Host Bridge
00:00.4 Host bridge: VIA Technologies, Inc. PT880 Host Bridge
00:00.7 Host bridge: VIA Technologies, Inc. PT880 Host Bridge
00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge
00:08.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
00:09.0 Multimedia video controller: Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder (rev 01)
00:0b.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller
00:0c.0 Multimedia video controller: Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder (rev 01)
00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)
00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)
00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South]
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)
01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5200] (rev a1)
[root@backend tmp]#

Occasionally I get this in /var/log/messages:

eth0: increased tx threshold, txcfg 0xd0f01004.
eth0: increased tx threshold, txcfg 0xd0f01006.
eth0: increased tx threshold, txcfg 0xd0f01008.
eth0: increased tx threshold, txcfg 0xd0f0100a.
eth0: increased tx threshold, txcfg 0xd0f0100c.
eth0: increased tx threshold, txcfg 0xd0f0100e.
eth0: increased tx threshold, txcfg 0xd0f01010.
eth0: increased tx threshold, txcfg 0xd0f01012.
eth0: increased tx threshold, txcfg 0xd0f01014.
eth0: increased tx threshold, txcfg 0xd0f01016.
eth0: increased tx threshold, txcfg 0xd0f01018.
eth0: increased tx threshold, txcfg 0xd0f0101a.
eth0: increased tx threshold, txcfg 0xd0f0101c.
eth0: increased tx threshold, txcfg 0xd0f0101e.
eth0: increased tx threshold, txcfg 0xd0f01020.
eth0: increased tx threshold, txcfg 0xd0f01022.
eth0: increased tx threshold, txcfg 0xd0f01024.


No comments: