Modify

Opened 3 years ago

Last modified 3 years ago

#18590 new defect

MTU issue involving bridge or VLAN ?

Reported by: ambrosa Owned by: developers
Priority: high Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: Cc:

Description

Chaos Calmer trunk@43620
Device TP-LINK W8970 (arch. LANTIQ -> XRX200)

This issue is reported by many people (see this italian forum http://www.hwupgrade.it/forum/showthread.php?t=2643260&page=70 )

This issue is not present with original TP-LINK firmware, is not present with Barrier Braker, is not present using another modem-router in our setup (i.e. Asus DSL55)

Preface:
About 2 weeks ago I've bought a TP-LINK W8970 and I've installed OpenWrt without any problem. I've compiled myself some Chaos Calmer trunk versions. Latest installed in my W8970 is trunk@43620 (kernel 3.14)
I have very strange issue with interfaces MTU and it looks to be introduced with Chaos Calmer.

My network (like other people affected with the issue):
1) my data provider use ADSL with PPPoE protocol (wan has MTU=1492)
2) all other W8970 network interfaces have MTU=1500
3) in my internal LAN I have some servers: a small ARM http server (http://cubieboard.org) with Debian Wheezy, some Set-Top-Box (DVB-S2 satellite receiver) Linux based and others. All servers are connected "wired"
4) in my internal LAN I have some clients : some PC (wired), some notebook (wifi), some smartphone (wifi)
5) all internal servers and clients have default MTU=1500

This is my W8970 ifconfig output:

br-lan    Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:14  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:627265 errors:0 dropped:0 overruns:0 frame:0
          TX packets:920637 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:86104574 (82.1 MiB)  TX bytes:981600054 (936.1 MiB)

eth0      Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:14  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:522645 errors:0 dropped:1 overruns:0 frame:0
          TX packets:695165 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:91408915 (87.1 MiB)  TX bytes:738973973 (704.7 MiB)

eth0.1    Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:14  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:522614 errors:0 dropped:0 overruns:0 frame:0
          TX packets:695158 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:77818404 (74.2 MiB)  TX bytes:733262952 (699.2 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3251 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3251 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:264440 (258.2 KiB)  TX bytes:264440 (258.2 KiB)

nas0      Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:15  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:904195 errors:0 dropped:0 overruns:0 frame:0
          TX packets:662954 errors:2082 dropped:0 overruns:2082 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:933036803 (889.8 MiB)  TX bytes:94763776 (90.3 MiB)

pppoe-wan Link encap:Point-to-Point Protocol  
          inet addr:151.xx.xx.175  P-t-P:151.xx.xx.72  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:810196 errors:0 dropped:0 overruns:0 frame:0
          TX packets:568938 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:922230793 (879.5 MiB)  TX bytes:72797166 (69.4 MiB)

wlan0     Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:14  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:110950 errors:0 dropped:0 overruns:0 frame:0
          TX packets:205437 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11165927 (10.6 MiB)  TX bytes:232462453 (221.6 MiB)

Problem:
a) all communications between LAN (wifi or wired) <==> WAN are perfect
b) all communications between LAN wired <==> LAN wired are perfect
c) all communications between LAN wifi <==> LAN wired *FAIL* (tested with notebook-wifi and smartphone-wifi)
There are many TCP packets loss and after some debug we have discovered that internal LAN servers (wired) need to have MTU=1496 (or less) or Wifi devices need to have MTU=1496 (or less)
If I use default MTU=1500 in servers (wired) and/or wifi devices, many TCP packets 'disappear' during communication. As TCP fragmentation is not handled correctly.
WiFi interface dislike MTU=1500 and this is a nonsense: W8970 interfaces (wifi too) have MTU=1500 so all should be fine.

We have no idea why this happen and it's sound very strange for me.
4 bytes (1500-1496) are the overhead due to 802.1Q (VLAN): is the VLAN/bridge the problem origin ?

Thanks

Attachments (0)

Change History (5)

comment:1 Changed 3 years ago by ambrosa

My bridge setup:

root@openwrt:~# brctl show
bridge name	bridge id		STP enabled	interfaces
br-lan		7fff.e8de2795e014	no		eth0.1
							wlan0

After reading this nice tutorial http://www.microhowto.info/tutorials/802.1q.html



Effect on the MTU

The MTU (maximum transmission unit) of a network interface is the size of the largest block of data that can be sent as a single unit. The standard Ethernet MTU is 1500 bytes at the network layer or 1518 bytes at the link layer, the difference being due to the 14-byte header and 4-byte frame check sequence that enclose the payload of an Ethernet frame.

On a VLAN trunk the need for each frame to be tagged adds a further 4 bytes of link-layer framing. This can be accommodated either by increasing the link-layer MTU or by reducing the network-layer MTU:

To use the standard network-layer MTU of 1500 bytes, the equipment must support a link-layer MTU of at least 1522 bytes.
If the link-layer MTU were limited to the standard value of 1518 bytes then the network-layer MTU would need to be reduced to 1496 bytes to compensate.

Devices with explicit VLAN support are supposed to accommodate a link-layer MTU of at least 1522 bytes, but if you are using generic hardware then it may be necessary to accept a lower value. All devices on a given IP subnet must use the same network-layer MTU, so if you intend to deviate from the standard value of 1500 bytes then you will need to configure all affected machines


After reading above it looks that for some strage reason link layer packet size is not 'expanded' to 1522 bytes (as Barrier Braker does) and so we need to 'reduce' frame length (MTU from 1500 to 1496) at client side.
This works but it's a workaroud.

Any solution at router side ?

comment:2 Changed 3 years ago by ambrosa

Another simple solution on router side:

ifconfig wlan0 1504

and communications LAN wifi <==> LAN wired is now OK (with client MTU 1500)

But it looks as another workaround

comment:3 Changed 3 years ago by ambrosa

I've made a simple test suggested by Matteo (OpenWRT developer): I've removed the bridge and worked with eth0.1 and wlin0 and 2 different subnet.
The problem is solved ! No MTU issue !

So I can suppose that the issue is originated by the bridge code.

root@OpenWrt:/etc# ifconfig
eth0      Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:14  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24249 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27491 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3727070 (3.5 MiB)  TX bytes:15608364 (14.8 MiB)

eth0.1    Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:14  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:496 errors:0 dropped:0 overruns:0 frame:0
          TX packets:398 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:66256 (64.7 KiB)  TX bytes:46032 (44.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:368 errors:0 dropped:0 overruns:0 frame:0
          TX packets:368 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:27403 (26.7 KiB)  TX bytes:27403 (26.7 KiB)

nas0      Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:15  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:23573 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20637 errors:91 dropped:0 overruns:91 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:15961353 (15.2 MiB)  TX bytes:2764679 (2.6 MiB)

pppoe-wan Link encap:Point-to-Point Protocol  
          inet addr:151.xx.xx.165  P-t-P:151.xx.xx.72  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:157 errors:0 dropped:0 overruns:0 frame:0
          TX packets:223 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:30205 (29.4 KiB)  TX bytes:24876 (24.2 KiB)

wlan0     Link encap:Ethernet  HWaddr E8:DE:xx:xx:xx:14  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:168 errors:0 dropped:0 overruns:0 frame:0
          TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:19103 (18.6 KiB)  TX bytes:38086 (37.1 KiB)


========================

root@OpenWrt:/etc# swconfig dev eth0 show
Global attributes:
        enable_vlan: 0
Port 0:
        uvr: 0
        vsr: 0
        vinr: 0
        tvm: 0
        pvid: 1
        link: port:0 link:down
Port 1:
        uvr: 0
        vsr: 0
        vinr: 0
        tvm: 0
        pvid: 1
        link: port:1 link:down
Port 2:
        uvr: 0
        vsr: 0
        vinr: 0
        tvm: 0
        pvid: 1
        link: port:2 link:down
Port 3:
        uvr: 0
        vsr: 0
        vinr: 0
        tvm: 0
        pvid: 1
        link: port:3 link:down
Port 4:
        uvr: 0
        vsr: 0
        vinr: 0
        tvm: 0
        pvid: 1
        link: port:4 link:down
Port 5:
        uvr: 0
        vsr: 0
        vinr: 0
        tvm: 0
        pvid: 1
        link: port:5 link:up speed:1000baseT full-duplex auto
Port 6:
        uvr: 0
        vsr: 0
        vinr: 0
        tvm: 0
        pvid: 1
        link: port:6 link:up speed:1000baseT full-duplex auto
VLAN 1:
        vid: 1
        enable: 1
        ports: 0 2 4 5 6t 

=====================

comment:4 Changed 3 years ago by grzmrc

I can confirm the same issue on a tplink w8970 v1.2 trunk 43982

comment:5 Changed 3 years ago by anonymous

This issue happens applies also when doing software bridging on all switchports, (because the switch works as a Hub and forwards all packets to all ports, see /ticket/15511.html).

Test config on a tp-w8970 is:

config switch_vlan

option device 'switch0'
option vlan '1'
option ports '5 6t'

config switch_vlan

option device 'switch0'
option vlan '2'
option ports '0 6t'

config switch_vlan

option device 'switch0'
option vlan '3'
option ports '2 6t'

config switch_vlan

option device 'switch0'
option vlan '4'
option ports '4 6t'

config interface 'lan'

option force_link '1'
option type 'bridge'
option proto 'manual'
option ip6assign '64'
option ifname 'eth0.1 eth0.2 eth0.3 eth0.4'
option macaddr 'c0:1d:c0:ff:ee:23'
option auto '1'
option mtu 1496
option ipaddr '10.0.0.1'
option netmask '255.255.255.0'

If I set MTU 1496 everthing is fine. With an higher MTU i get packet loss.
Increasing the MTU on eth0.[1234] or eth0 does not work. It stays at max 1500.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.