Saturday, December 14, 2013

Slow Internet streaming - Bug in Router Firmware

My Wi-Fi has been puking on me for quite some time now. Streaming services were spending more time loading content, video conferencing was becoming painful, everything seemed generally slow. So, I tried some easy fixes like avoiding neighbor's wireless channels, juggling security combos, tweaking b/g/n modes and mounting the router on a Roomba for better coverage :) I even plugged in a brand new NetGear router - WNR3500LV2 - in search for a quick fix. But none of those steps made a material difference. My speeds were 0.5-1Mbps Downstream (D) & 10Mbps Upstream (U). Finally, I decided to take a closer look. What I found was quite interesting and the resultant fix boosted my Wi-Fi speed from 0.5D to 30D (60X!). Read on.

I have Comcast cable internet. My ethernet consistently gives me 60D/10U. I have my own routers behind the standard Comcast router which I use to power multiple networks (VLans) with custom configs. Please note that 
I do not use Wi-Fi on the standard Comcast router. And this issue affects Wi-Fi traffic only.

Now, my Wi-Fi traffic had downstream speed less than upstream. 
This was suspicious as it is usually the opposite. Upon investigation, I found that the Comcast downstream packets have incorrect DSCP settings. A quick Google search revealed that DSCP is a layer-3 QoS mechanism and is supposed to improve QoS for real-time data streaming applications such as VOIP using prioritization algorithms. The Comcast settings seem to have created a critical bug that is likely crippling thousands of routers across US. 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/netgear routers and possibly others as well. This issue can appear on both stock and modded routers. IPv6 traffic seems to work just fine. Since the only packets with this bad information are the ones that are being downloaded, upload traffic is not affected nearly as badly.

I think the simplest way to fix this problem is to use 
Wi-Fi from a Comcast approved router. Else, you are really limited by capabilities of your personal router's firmware. If it allows you to alter packets (most do not), then you are good. Else, you will have to update your router with an open source firmware. DD-WRT & TomatoUSB are two popular options. I already had DD-WRT but it didn't give me a clean way of modifying stuff. I didn't want to telnet into it - maintainability etc. So, I tried TomatoUSB and I was able to update the router configuration with the following scripts,

INIT
insmod xt_DSCP.ko

WANUP

iptables -t mangle -A PREROUTING -i vlan2 -j DSCP --set-dscp 0

And boom, the DSCP flag was disabled and my Wi-Fi speed jumped to 30Mbps! So, here is what you need if you experience similar issues,
  1. Test your Internet speed using the Speedtest.net apps. If downstream is lower than upstream, that's a big signal. You may use Wireshark to confirm the problem.
  2. Search for a suitable firmware for your router. DD-WRT & TomatoUSB are two popular options for home routers. Follow the instructions and load it. WARNING: You will void warranty and this step could brick your router.
  3. Modify the packets to disable DSCP. For example, you may use the above scripts. Note, your interface may be different from "vlan2". 










Tuesday, December 10, 2013

Mobile is the future of Digital Advertising

Business Intelligence recently published a detailed presentation on the future of digital. The trends are significantly in favor of smartphones. Rate of change is increasing and is likely to create tremendous opportunity. Here are some interesting bits,

1. We all know traditional advertising is declining and the new digital advertising is growing. Yes, those TV adds are dumb & useless. I am a proud cord-cutter. But the interesting bit is that within new digital, mobile is the only "media time" that is currently growing. This is important because, attention is key in monetizing on the Internet. Value of time > money, especially in places where money can be easily created.



2. YouTube is the king of Internet video. But the shift to mobile is changing the game. Opportunity is wide open. On the handset, users spend quite a lot of time on the Facebook app, which fueled the recent revenue growth. So, I think mobile social video is going to be key.



3. Paypal powers $20B on mobile. That adoption is quite surprising. I think this trend is going to follow the hockey stick curve. Technologies such as BLE, TouchID are accelerators. (I think NFC is dead though).



4. The following trend has a huge impact from a product standpoint. Lot of development work is needed to accommodate this change. Marketing campaigns have to change. BI engines have to become smarter. This is directly fueling the big data trends.



5. This trend is misleading. Domination of paid search ads are driven by 2 reasons. Google forced enhanced campaigns onto search marketers, which made things fuzzy. The other factor is that  mobile search campaigns are super-simple for existing search marketers. So, adoption is high. Contrarily, I think new CPA ad units & video advertising are going to dominate mobile spend in the long-run.


Source:-
Future of digital business: 2013




Saturday, December 7, 2013

Tesla is a Buy

Last week, Paul Walker got killed in a shocking car accident. I am a fan of the the “Fast and Furious” series, and admire Paul's work. His death is unbelievable. It was reported that the fire, which engulfed his Porsche, started within a minute after the crash. That reminded me of Elon Musk's arguments around the Tesla Model S fires.

Recently, Tesla stock (NASDAQ:TSLA) has taken a beating. It's crashed 40% within two months from an all time high of $194.50. Before the crash, Tesla was a darling of investors in 2013 rising all the way from low 30s. But in recent times, 3 Model S cars caught fire. Subsequently, the safety agencies opened an enquiry to examine whether the vehicle design, and specifically the advanced lithium-ion battery pack, are defective and the cause of the fires.

Elon Musk wrote a blog post in response. His core arguments highlighted the safety design features of Tesla.
  1. The Model S owner got warned by the onboard alert system. So, the owner was able to stop the car and depart the vehicle without injury. How cool is that!
  2. The fire in the battery was contained to a small section near the front by the "internal firewalls" built into the pack structure. At no point did the fire enter the passenger compartment.
  3. A typical gasoline car only has a thin metal sheet protecting the under body, leaving it vulnerable to destruction of the fuel supply lines or fuel tank, which causes a pool of gasoline to form and often burn the entire car to the ground. That is probably what happened to Paul's car.
I think the safety agencies are going to clear the car's design and maintain the 5 star crash rating it earned earlier this year. In fact, Germany recently did so. Further, as a precaution, Tesla recently sent an over-the-air software update to all the Model S cars to automatically raise the ground clearance. Talk about design! I think Tesla is going to be the Apple of Cars. None of the existing companies stand a chance. Buy the car. If the price is too high, buy the stock. And unlike me, if you did not miss making millions in bitcoins, you can buy Tesla using bitcoins too. Oh boy, the bitcoin story is for another post.



Disclaimer:- I don't own either and I am accepting gifts.


Friday, December 6, 2013

It's all about the code

In modern organizations, humans build tech products to address specific problems. People write software to express themselves & their proposed solutions. Sometimes they re-invent the hardware to create more capable software. Without the right software, hardware by itself has limited potential. IOS vs Android is a simple example of how two teams are proxy-fighting via software. Last week, Amazon unveiled the Delivery Drone. In response, Samy demoed a nice hack SkyJack - "SkyJack is a drone engineered to autonomously seek out, hack, and wirelessly take over other drones within wifi distance, creating an army of zombie drones under your control."



Humans are increasingly tripping each other with software. And with the connected software, the impact is significantly amplified. I believe it's just a matter of time when the code will trump humans.

It's all about the code.

References
http://samy.pl/skyjack