Critical DSCP bug Affecting WiFi Download Speeds on Comcast

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3, 4, 5  Next
Author Message
Lightsword
DD-WRT User


Joined: 24 Feb 2010
Posts: 107

PostPosted: Tue Sep 10, 2013 8:16    Post subject: Critical DSCP bug Affecting WiFi Download Speeds on Comcast Reply with quote
There is a critical bug that is likely crippling thousands of routers and pretty much only comcast has this issue. It is an edge case interaction caused by bad DSCP information coming from Comcast and poor condition handling by the WMM driver on certain linksys/cisco eseries routers and possibly others as well. This issue can appear on both stock and modded routers. Comcasts network is misconfigured and has been for years and has likely caused many people to needlessly replace fully functional routers, IPv6 speeds always worked for me because DSCP was configured correctly for that but it is incorrect for IPv4. Since the only packets with this bad information are the ones that are being downloaded upload is not affected nearly as badly.

This is the fix I made and used on an e2000 and e3000 running shibby 112 although I suspect it would work on dd-wrt with minor modification:

put this in init scripts section:
insmod xt_DSCP.ko

and this in wan up scripts:
iptables -t mangle -A PREROUTING -i vlan2 -j DSCP —set-dscp 0

these may need to be modified slightly depending on configuration, replace vlan2 with your wan interface and xt_DSCP.ko with the version for your router if it is different.

This corrects the bad DSCP header information as soon as a packet hits the WAN interface on a router.

DSCP as received from Comcast's network is 0x08 this is the lowest priority possible which WMM interpretes as being unimportant to transmit quickly.

The scripts listed changes the DSCP on all packets to 0x00 which essentially means unclassified which WMM handles properly. This is how virtually every other ISP uses DSCP and is why the issues is specific to Comcast.

I have confirmed this issue on connections in both Chicago and Boulder, CO and it is likely to be present on Comcast's entire network.

Cisco appears to have at some point released new WMM drivers for stock firmware that largely resolve the issue on current stock firmware, otherwise implementing my temp fix as a GUI option would probably be a good idea for the affected routers. The ability to assign DSCP to all traffic on chosen interfaces also might be a good thing to add anyways.
Sponsor
gpzbc
DD-WRT Novice


Joined: 29 Mar 2009
Posts: 46
Location: Colorado, USA

PostPosted: Tue Sep 10, 2013 17:05    Post subject: Reply with quote
Thanks much!
_________________
the gpzbc
--
Asus RT-N16 running DD-WRT v24-sp2 (09/22/12) mega - build 20006
Linksys E2500 running Tomato Firmware 1.28.0000 MIPSR2-108 K26 USB Max
Trademark
DD-WRT Novice


Joined: 29 Aug 2013
Posts: 6

PostPosted: Tue Sep 10, 2013 23:06    Post subject: Re: Critical DSCP bug Affecting WiFi Download Speeds on Comc Reply with quote
Lightsword wrote:
these may need to be modified slightly depending on configuration, replace vlan2 with your wan interface and xt_DSCP.ko with the version for your router if it is different.


Would you be so kind as to explain how to get this information from your router/network? I have an E4200, E3000, and WRT54G-TM all running versions of Tomato with Wireshark on a MacBook Pro.

Any guidance would be much appreciated. Thanks!
Lightsword
DD-WRT User


Joined: 24 Feb 2010
Posts: 107

PostPosted: Tue Sep 10, 2013 23:45    Post subject: Re: Critical DSCP bug Affecting WiFi Download Speeds on Comc Reply with quote
Trademark wrote:
Lightsword wrote:
these may need to be modified slightly depending on configuration, replace vlan2 with your wan interface and xt_DSCP.ko with the version for your router if it is different.


Would you be so kind as to explain how to get this information from your router/network? I have an E4200, E3000, and WRT54G-TM all running versions of Tomato with Wireshark on a MacBook Pro.

Any guidance would be much appreciated. Thanks!


I mean, if you simply want to see if you are getting the bad DSCP just take a look at your downloaded ipv4 packets with wireshark, preferably directly connected to wan but you should see them even on wifi. If you want to try my fix just enter those 2 commands with "vlan2" changed to whatever your wan interface is, you may be able to use it without any modification even since I made the script for shibby tomato and it works on an e3000 and e2000 both without any changes. You only need to use the command on the router than is connected to the modem via the wan interface since it sets DSCP to default on all traffic. The first command only needs to be changed if you get an error when running it(it is probably only for k26 builds).
Trademark
DD-WRT Novice


Joined: 29 Aug 2013
Posts: 6

PostPosted: Wed Sep 11, 2013 5:12    Post subject: Re: Critical DSCP bug Affecting WiFi Download Speeds on Comc Reply with quote
Lightsword wrote:
if you simply want to see if you are getting the bad DSCP just take a look at your downloaded ipv4 packets with wireshark, preferably directly connected to wan


This is exactly what I needed to know. Still learning to use wireshark. Very useful program! Thanks for the reply.
Trademark
DD-WRT Novice


Joined: 29 Aug 2013
Posts: 6

PostPosted: Wed Sep 11, 2013 6:51    Post subject: Reply with quote
After testing my set-up, the E3000 and E4200 both used vlan2 for WAN, but the WRT54G-TM was using vlan1. It also turns out that I needed to change the Init script for the WRT54G-TM to insmod ipt_DSCP for it to work. This is probably K24 vs K26. All of these are running a form Tomato firmware if it makes a difference.
clintiepoo
DD-WRT Novice


Joined: 09 Dec 2009
Posts: 4

PostPosted: Wed Sep 18, 2013 2:05    Post subject: Re: Critical DSCP bug Affecting WiFi Download Speeds on Comc Reply with quote
Lightsword wrote:

put this in init scripts section:
insmod xt_DSCP.ko

and this in wan up scripts:
iptables -t mangle -A PREROUTING -i vlan2 -j DSCP —set-dscp 0


I have this problem with Mediacom, but I think it's the same issue. Mediacom doesn't admit the problem, motorola doesn't either. I'm trying DDWRT to fix it, but I am getting nowhere.

I'm new to scripting - would you please step-by-step describe how to do this?
Lightsword
DD-WRT User


Joined: 24 Feb 2010
Posts: 107

PostPosted: Wed Sep 18, 2013 2:46    Post subject: Re: Critical DSCP bug Affecting WiFi Download Speeds on Comc Reply with quote
clintiepoo wrote:
Lightsword wrote:

put this in init scripts section:
insmod xt_DSCP.ko

and this in wan up scripts:
iptables -t mangle -A PREROUTING -i vlan2 -j DSCP —set-dscp 0


I have this problem with Mediacom, but I think it's the same issue. Mediacom doesn't admit the problem, motorola doesn't either. I'm trying DDWRT to fix it, but I am getting nowhere.

I'm new to scripting - would you please step-by-step describe how to do this?

Please use wireshark to determine if this is the problem, otherwise this will not help.
hurriphoonado
DD-WRT Novice


Joined: 19 Sep 2013
Posts: 1

PostPosted: Thu Sep 19, 2013 20:31    Post subject: Re: Critical DSCP bug Affecting WiFi Download Speeds on Comc Reply with quote
Lightsword wrote:

...
put this in init scripts section:
insmod xt_DSCP.ko

and this in wan up scripts:
iptables -t mangle -A PREROUTING -i vlan2 -j DSCP —set-dscp 0

these may need to be modified slightly depending on configuration, replace vlan2 with your wan interface and xt_DSCP.ko with the version for your router if it is different.
...


Lightsword - thank you so much for the info that I've lurked so far. Learning a lot.

I'm experiencing the same issues as most in this thread - bearing the brunt of Comcast's reign. I tried your init and WAN-up scripting suggestions, but I'm still pulling 0.2 / 5.5 on my wireless devices, 30.0/6.0+ on those wired. I'm on the e2500 flashed with Shibby's Tomato 1.28. I'm interested in two things:

1. Currently diving into Wireshark, but honestly don't know what I'm looking for to help diagnose any issues. Any specifics I can offer?

2. Additional advice on how I might get my rates up to bearable levels (I'd even be happy with ~10g down right now...)

Appreciate the efforts so far, and thanks in advance for any additional!
Lightsword
DD-WRT User


Joined: 24 Feb 2010
Posts: 107

PostPosted: Thu Sep 19, 2013 21:11    Post subject: Re: Critical DSCP bug Affecting WiFi Download Speeds on Comc Reply with quote
hurriphoonado wrote:
Lightsword wrote:

...
put this in init scripts section:
insmod xt_DSCP.ko

and this in wan up scripts:
iptables -t mangle -A PREROUTING -i vlan2 -j DSCP —set-dscp 0

these may need to be modified slightly depending on configuration, replace vlan2 with your wan interface and xt_DSCP.ko with the version for your router if it is different.
...


Lightsword - thank you so much for the info that I've lurked so far. Learning a lot.

I'm experiencing the same issues as most in this thread - bearing the brunt of Comcast's reign. I tried your init and WAN-up scripting suggestions, but I'm still pulling 0.2 / 5.5 on my wireless devices, 30.0/6.0+ on those wired. I'm on the e2500 flashed with Shibby's Tomato 1.28. I'm interested in two things:

1. Currently diving into Wireshark, but honestly don't know what I'm looking for to help diagnose any issues. Any specifics I can offer?

2. Additional advice on how I might get my rates up to bearable levels (I'd even be happy with ~10g down right now...)

Appreciate the efforts so far, and thanks in advance for any additional!


FYI that script only works if your wan port is called"vlan2" try this wanup script instead:
Code:
iptables -t mangle -A PREROUTING -i `nvram get wan_iface` -j DSCP --set-dscp 0
Pundit
DD-WRT Novice


Joined: 30 Oct 2013
Posts: 6

PostPosted: Wed Oct 30, 2013 17:44    Post subject: Reply with quote
I think I may be suffering this issue as well, except I am not using my E1500 as a WAN gateway, but rather as a wireless AP with the following architecture:

Cable Modem -> Wireless-G gateway -> Wireless-N AP

All connections above are wired.

Reasons I think this is why I am suffering this issue:

* Recently got Comcast service
* Download speeds on N are abysmal, uploads are normal
* Download speeds on G are normal

My question here is if my N does not have an active WAN port as it is running as an AP, can I still use the rule to mangle the packets? If so, which interface should it be applied to? I tried using br0 with no obvious effect.
Lightsword
DD-WRT User


Joined: 24 Feb 2010
Posts: 107

PostPosted: Wed Oct 30, 2013 17:51    Post subject: Reply with quote
Pundit wrote:
I think I may be suffering this issue as well, except I am not using my E1500 as a WAN gateway, but rather as a wireless AP with the following architecture:

Cable Modem -> Wireless-G gateway -> Wireless-N AP

All connections above are wired.

Reasons I think this is why I am suffering this issue:

* Recently got Comcast service
* Download speeds on N are abysmal, uploads are normal
* Download speeds on G are normal

My question here is if my N does not have an active WAN port as it is running as an AP, can I still use the rule to mangle the packets? If so, which interface should it be applied to? I tried using br0 with no obvious effect.

Yes, it is likely you have the issue, you should have you wan gateway(the wireless G router) clear DSCP values with my iptables script, so any device behind it should then only receive the packets with fixed DSCP headers. Unless you have a device that is clearing DSCP values(such as something running my iptables script) this issue can affect all access points on the network as DSCP is normally never changed by consumer grade networking hardware.
Pundit
DD-WRT Novice


Joined: 30 Oct 2013
Posts: 6

PostPosted: Wed Oct 30, 2013 18:04    Post subject: Reply with quote
Thanks for the response. I guess my next step is to flash dd-wrt onto the G device (it's a WRT54G2 currently still running the stock firmware).
Lightsword
DD-WRT User


Joined: 24 Feb 2010
Posts: 107

PostPosted: Wed Oct 30, 2013 18:20    Post subject: Reply with quote
Pundit wrote:
Thanks for the response. I guess my next step is to flash dd-wrt onto the G device (it's a WRT54G2 currently still running the stock firmware).

While flashing dd-wrt would generally be recommended in any case you could still clear DSCP on the N router without having to make a change on the G router. As long as the bad packets don't hit the wireless interface on the N router you should not see an issue. You can apply the script to whatever interface is connected to your G router. So if the cable coming from the G router goes into the WAN interface on the N router you would apply the script to that. If the cable goes into the LAN interface you would apply it to that then, you can use ifconfig over telnet to get the name of the interface, you would then change "vlan2" to whatever interface you want to use. Make sure to test the scripts from ssh/telnet before putting them in scripts. The insmod command may need to be changed depending on the name of the kernel module(I think it may be a different name for older routers), you will get an error over telnet indicating it failed to load if that is the case.
Pundit
DD-WRT Novice


Joined: 30 Oct 2013
Posts: 6

PostPosted: Wed Oct 30, 2013 18:26    Post subject: Reply with quote
Awesome feedback thanks! I'll take a look tonight.
Goto page 1, 2, 3, 4, 5  Next Display posts from previous:    Page 1 of 5
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum