c2dm works fine over cell data network, flaky on my wireless network

155 views
Skip to first unread message

Jon Perlow

unread,
Oct 29, 2010, 4:50:00 PM10/29/10
to androi...@googlegroups.com
Hi,

I wrote an app that uses c2dm. It seems to work perfectly when my Nexus 1 is on the AT&T edge network. When my phone is on my home wireless network, c2dm messages are either delayed by multiple minutes or lost all together. Has anybody run into this issue? What is the best way to debug it? If there is a documentation on how c2dm messages are delivered (like are they UDP and what ports do they use?), I can try running wireshark to gather more info. I am also wondering if some firewall rule on my router is breaking it and I am worried whether this might be common and will also affect users of the app or if it's something unusual about my wireless network setup. Thanks.

-Jon

Augusto Ferrarini

unread,
Oct 29, 2010, 5:04:52 PM10/29/10
to androi...@googlegroups.com

Yes, I'm also running into this issue sometimes (on nexus One). I don't think this is a firewall issue since I have no rules here.


- Augusto

Costin Manolache

unread,
Oct 29, 2010, 5:19:20 PM10/29/10
to androi...@googlegroups.com
Is your phone awake - or does it go to sleep ? 

If later - see the recent thread "C2DM Doesnt wake a phone in deep sleep... how should it work?",
thanks Chris D for including the links to the 2 related bugs,



The connection is TCP - you can use Wireshark to see if packets are received.
What kind of router and do you have any special settings ? 

Costin

Jon Perlow

unread,
Oct 29, 2010, 9:56:44 PM10/29/10
to androi...@googlegroups.com
Thanks Costin and Debajit for your help.

It appears to have been a configuration issue on my router. I am running DD-WRT on a Linksys E3000 and for some reason the TCP timeout was set really low. It's supposed to be at the default of 3600 seconds but mine was at 2 minutes. Changing that seems to have fixed the problem. 

I hope such misconfigurations aren't common. Just wondering -- is there anything that c2dm stack could have done to handle that case? I assume you're trying to minimize impact on battery life but would sending a single "keep alive" packet every minute or so be that costly?

Thanks again.

-Jon

Costin Manolache

unread,
Oct 30, 2010, 12:21:37 AM10/30/10
to androi...@googlegroups.com
On Fri, Oct 29, 2010 at 6:56 PM, Jon Perlow <per...@gmail.com> wrote:
Thanks Costin and Debajit for your help.

It appears to have been a configuration issue on my router. I am running DD-WRT on a Linksys E3000 and for some reason the TCP timeout was set really low. It's supposed to be at the default of 3600 seconds but mine was at 2 minutes. Changing that seems to have fixed the problem. 

I hope such misconfigurations aren't common. Just wondering -- is there anything that c2dm stack could have done to handle that case? I assume you're trying to minimize impact on battery life but would sending a single "keep alive" packet every minute or so be that costly?


I don't think 2 minutes is common - but keep alive is quite expensive - keep in mind that it needs to wake up all the chips from low power mode.

The more common problem seems to be routers that interact badly with the chipset in sleep mode. I can't repro - I guess my router is good - if people experience this kind of problems please include the router type.

Costin

debajit

unread,
Oct 30, 2010, 1:57:44 AM10/30/10
to androi...@googlegroups.com
hey Jon,

glad you got things working! yes, a keepalive that frequently would
be somewhat costly.

check out slide 7 in the c2dm talk we gave at Google IO:
http://dl.google.com/googleio/2010/android-push-applications-android.pdf
(found on http://www.google.com/events/io/2010/sessions/push-applications-android.html)
for some background and numbers.

thanks, debajit

Jon Perlow

unread,
Oct 30, 2010, 2:14:49 AM10/30/10
to androi...@googlegroups.com
Okay thanks for your help and the info!

Cristian Zomparelli

unread,
Feb 18, 2013, 5:29:42 PM2/18/13
to androi...@googlegroups.com, per...@gmail.com
Reply all
Reply to author
Forward
0 new messages