yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] bganley:
This fix allows the phone to listen to broadcast and multicast traffic while the screen is off. If the phone is filtering broadcast traffic, it will never hear and thus will not respond to broadcast ARP requests. As a result, the router will not be able to learn the MAC address of your phone which means it won't be able to forward traffic to the phone.

Using ping is merely an easy way to test this issue. Combine this with tcpdump or wireshark if you really want to see what is going on behind the scenes.

If notifications on your phone are working then that is likely because your router's ARP timers are sufficient to keep an ARP entry in the cache.

Also, just to clarify, this issue has no relation to your association to the AP. The issue is between the phone and the router (or your PC if you are testing with ping).

I agree that aggressive TCP Established timers will also cause this issue. From what I've been able to gather, Google uses a 15 minute keepalive on the Cloud to Device Messaging connection. As a result, the TCP Established timeout should be at least that amount. I would recommend using at least a value of 1200 seconds (20 minutes).
[Nexus 4 General] bganley:
Setting it to '1' instead of '0' will likely save battery - just depends on how much multicast traffic is on your network. A setting of '1' will also fix the issue just as well as '0'. The reason I recommended the '0' setting was primarily to mirror the behavior of the other android devices I tested.

Now, if you have any applications that rely on multicast that need to work while the screen is off, then you might need to set to '0' to allow multicast traffic. There aren't a lot of these. The only one I can think of off the top of my head is IPv6. Instead of using ARP, IPv6 uses ND which relies on multicast.
[Nexus 4 General] bganley:
What's strange is when I first started playing with this, sending myself an email was exactly how I was testing. And it worked great - every time.

These last few days, not so much. I have the same problem using email as a test. I've even had a few messages that I've sent myself that literally disappeared. They never even showed up in my sent mail. Strange stuff.
[Nexus 4 General] biffsmash:
Do any of the people suggesting changes to settings on people's rooters realise that we shouldn't have to make any changes to our routers to use our phones on wi-fi without the data dropping and disconnecting from google servers, when it should be GOOGLE fixing the issue, as every single other phone I have and have had, all connect to my router without any problems at all???

Cheers anyway.
[Nexus 4 General] floepie:
Yes.

But in the meanwhile...
[Nexus 4 General] defnz:
In the meantime people have a stop gap measure if/when google fix the issue.

Google fixing the issue isn't guaranteed, does this ring a bell?
[Nexus 4 General] floepie:
Perhaps someone could explain this a bit more in depth? I'm trying to wrap my head around why a router would need to send out an ARP request before the 15 minute timeout of the critical port 5228 connection, the one that maintains a constant connection to Google's servers. Aren't ARP requests sent in order to determine which device (MAC address) responds to a particular IP address in order to maintain a table of [MAC address - IP address] associations? Shouldn't this already have been established when the device requests an IP address from the router's DHCP server? And, why is it that simply reserving a static IP address for a particular MAC address at the router "solves" the issue by negating the need for these broadcast ARP requests? I mean, in one case, where you have a DHCP issued IP address, the IP address is typically associated or leased for an entire day (24 hours). So, I'm not sure why the ARP requests would have to be carried out so frequently, a request whose expiration is even shorter than the 15 minutes needed to maintain a constant connection.
[Nexus 4 General] _Tallis_:
I have reserved a static IP for my N4 and still had the issue before applying the fix. And even worse, I'm still not sure if it works because I still have a noticable delay in receiving Google notifications when the screen is shut off for a longer time and even had the blue-gray-blue wifi color change since.
[Nexus 4 General] floepie:
Then it sounds as if your TCP timeouts are too short, an entirely different matter altogether from what is being discussed. I had mine set way too short (2 minutes). Now, as long as the timeouts are set for at least 30 minutes so that the port 5228 connection doesn't get dropped, I get email alerts consistently the moment they arrive in the account, even faster than they arrive at the PC. And, yes, if your TCP timeouts are too short, either applying this fix OR setting a static IP address at the router won't help you much.
[Nexus 4 General] tadaha:
i flashed the 7 jan CM10.1 nightly yesterday, the problem seems to have been solved.

Been using it for a day, and all whatsapp notifications come in almost instantly when i'm on wifi and screen off for more than 15 minutes.
[Nexus 4 General] danielvc:
I checked the changelog and cannot find anything that would suggest a wifi fix.
[Nexus 4 General] tadaha:
I came from the 3rd Jan nightly which has the WiFi connectivity problem, I've looked thru the change log as well but can't seem to find anything that could have fixed the problem. But well, as long as it works, I'm happy.
[Nexus 4 General] bganley:
ARP has no relation to connection tracking nor is it tied to DHCP. Some router firmware seem to create a static ARP entry when you define a DHCP reservation. I wouldn't expect this to be the norm.

ARP maintains its own cache with its own timers. These timers are not standardized and are different between different implementations. My router firmware uses the default Linux ARP timers which are very short so the problem is very noticeable for me without this patch. Other routers use different values which allow the ARP entry to stay cached for longer, causing the problem to be less apparent or even non existent.

If your router is Linux based, you can view the various ARP timers in use by looking at the files under /proc/sys/net/ipv4/neigh/. Or, if you have the "ip" command on your router, you can type "ip ntable".
[Nexus 4 General] antih3ro:
I'm on the same nightly and still have the problem. So I don't think that they fixed it.
[Nexus 4 General] thracemerin:
This actually made it considerably worse for me, I had almost no delay before flashing that zip, now it's 10mins-2hrs with screen off.
[Nexus 4 General] Kaanu74:
I tried, too. Wifi opt. on. But seems like no fix. Now i close the optimization. Trying like this.

Sent from my Nexus 4
[Nexus 4 General] PhilipL:
Hi

This issue is hard to pin down. My phone has been sat for a couple of hours doing nothing, I've just sent myself an email and it was 10 seconds behind a Nexus 7 in sounding a notification. Before I made these changes it was 10 to 15 minutes for notifications and Google Services would be seen to be disconnected on turning on the phone (grey signal indicators).

Have you got WMM enabled on the access point, perhaps in my case this has made the difference.

Regards

Phil
[Nexus 4 General] Kaanu74:
I closed my WMM power save mode. Maybe it's change something.

Sent from my Nexus 4

---------- Post added at 07:52 PM ---------- Previous post was at 07:52 PM ----------

Sent from my Nexus 4
[Nexus 4 General] thracemerin:
The main problem here imho is that there are a bunch of external factors relating to the network setup and infrastructure being used, so it may work well on one router with one setup and not at all on another, yes I agree that it should work the same on all, but given that there doesn't seem to be one 'magic bullet' fix it's likely a combination of problems both with the N4 and the external network components involved.
[Nexus 4 General] Genidroid:
Wakelock maybe?

Hi,

I have been having this same problem with the exception that is occurs on 3g/2g data aswell. What seems to be happening is the phone is going into a sort of sleep which causes it to lose wifi and 3g data connection, resulting in delayed notifications aswell as causing downloads to fail and inability to initiate things such as cerebrus when screen is off.

From what I have read, this issue occurs to many people on mobile data and not just wifi. It made sense to me that if the phone was in sleep that somehow it had to be related to android's system wakelocks not occurring.

Now please understand I have zero programming skills and know very little about android. So what I did was install an app called "safe charge", this app was written for the nexus 4 to prevent a sleep of death bug when the phone was plugged in by creating a wakelock for the phone to stay on it's lowest cpu thread and not going into deep sleep. This caused the issue from not happening and the battery life after 1 day isn't that bad considering the phone now actually works. The problem is that android wasn't designed to stay on it lowest cpu state when sleeping this is why there are wakelocks from what I understand. Is it not possible that perhaps this issue isn't related to the ARP handover but rather something within the android system itself?

Also perhaps my issue ( and many in this thread) isn't related to the OP's issue but rather something different and thats why 4.3 fixed the issue for many with the flags? Is it possible that someone with more knowledge in android could perhaps assit in assesing this matter (Catlogs or something).

Thx
[Nexus 4 General] user9300:
Android 4.3 - PSX 4.1, modem .84, ARP set to 1, and using PNF from market(5minutes).. no problems with notification delay.
[Nexus 4 General] Oops...:
Same here (identical settings, Cataclysm instead of stock ROM)
[Nexus 4 General] Xoib:
Same here but still need wifi optimization off for certain routers.
[Nexus 4 General] Lownita:
Any modification to mcastbcastfilter? And what's pnf? :)

Tapatalked from my Nexus 4
[Nexus 4 General] Blockberd:
Push Notification Fixer
[Nexus 4 General] user9300:
No mcastbcast filter changes.
[Nexus 4 General] Lownita:
Did you try leaving arp as it is and only using pnf? :)

Tapatalked from my Nexus 4
[Nexus 4 General] Emama:
I am on Vanir 4.3 (JSS15Q) and I get no delay if I turned off the wifi optimization..but the battery consumption of Android OS will be 3 times higher than the screen.

Trying to find which file, or which line should I modified to get NO delay, but with less battery drain

UPDATE: I followed this and it does fix the delay!!

http://xdaforums.com/showpost.php?p=43940926&postcount=601
[Nexus 4 General] phositadc:
Can anybody confirm if the fix described in http://xdaforums.com/showpost.php?p=43940926&postcount=601 works for everybody (or at least most) or if it only works for some?

In other words, is it a conclusive fix, or are lots of people still having delayed wifi notifications?
[Nexus 4 General] Lownita:
This doesn't do anything for me, only turning off wifi optimization helps. Am on cm 10.2 and franco r182.
[Nexus 4 General] guv.:
It works for me. No other changes made, WiFi optimization is on.

Gesendet von meinem Nexus 4 mit Tapatalk 2
[Nexus 4 General] Dark Emotion:
Of course it doesn't do anything, CM10.2 already has these flags set to =1, so basicly you didn't change anything.
[Nexus 4 General] Lownita:
But not inside the.ini file. There they were set to 0. Turning off Wi-Fi optimization isn't a solution, I get 50% deep sleep then...

Tapatalked from my Nexus 4
[Nexus 4 General] Emama:
So did you try that and see?

Modifying those 2 values are much better in terms of battery than turning off WIFI optimization

although it is still draining 10-15% more than everything on stock overnight
[Nexus 4 General] ziddey:
Bleh, same boat.

I just tested enabling offload on the latest CM10.2 nightly and Franco r183 and am still seeing the DD:CC:BB:AA:FF:EE MAC mangling. In the past, I put up with disabling mcast/bcast filtering, but the wakes were brutal (really noisy network).

It's never really bugged me too much, especially since my SIP client seems to receive calls perfectly, but I'm a little intrigued now that arp offloading is supposedly working.

Will look into it more later.
[Nexus 4 General] ziddey:
Well this obviously isn't a proper solution, but it serves its purpose as a workaround.

Since AA:BB:CC:DD:EE:FF is mangled to DD:CC:BB:AA:FF:EE (big/little endian mixup?), we can come to the common denominator AA:BB:BB:AA:EE:EE (as an example).

By spoofing such an address, arp offloading will be able to function "properly"

Replacing the mac address in WCNSS_qcom_cfg.ini is self-explanatory. For WCNSS_qcom_wlan_nv.bin, you'll need to use a hex editor (0xA-0xF). Or use the following command:

printf "\xAA\xBB\xBB\xAA\xEE\xEE" | dd of=WCNSS_qcom_wlan_nv.bin bs=1 seek=10 count=6 conv=notrunc

The problem with arp offloading is that it can take a few requests before a reply is sent.
[Nexus 4 General] raz123:
If I understand you correctly, by spoofing with a specially-formatted mac address, the arp offloading issue is solved?

If so, are any other modifications needed, beyond WCNSS_qcom_cfg.ini and WCNSS_qcom_wlan_nv.bin?

How about hostArpOffload and gEnableActiveModeOffload?

Thanks
[Nexus 4 General] ziddey:
Of course hostArpOffload and gEnableActiveModeOffload need to be enabled to enable arp offloading....

The issue before was that offloading arp replies to the wifi module (instead of kernel) resulted in a mangled mac address. Short of fixing it so it doesn't mangle, you can use any A:B:B:A:C:C mac address, since the mangled result is obviously the same as the original.

What I'm finding interesting though is that it's said that arp offloading is "working" in jwr66v, only disabled by default. I can't attest to that, but when running a recent cm10.2 nightly with Franco kernel and 27-54 hybrid radio, offloading still mangles... Maybe I'll try the stock .84 radio sometime to rule that one way or the other.

Otherwise, you see what JBQ himself has to say about why it's disabled in jwr66v: http://code.google.com/p/android/issues/detail?id=58082#c1

It's too soon for me to tell how battery life is going to be impacted, but hopefully it'll still be better than if mcast/bcast filtering were enabled.
[Nexus 4 General] ziddey:
Just an update. Switched from 27-54 hybrid radio to 33-84, and it looks like arp offloadingf no longer mangles. From what I understand, 84 is no good for 5ghz, but seeing how I can't connect anyway, this'll do for now.
[Nexus 4 General] Salty Wagyu:
Just chiming in to say that changing gEnableActiveModeOffload and hostARPOffload in the wcnss_qcom_cfg.ini file to 1 has fixed the issues for me, having upgraded to stock Android 4.3 (JWR66Y) last week, with WiFi Optimization enabled and no third party apps (such as PNF) being used.

Initially after the wcnss_qcom_cfg.ini edits I still saw delayed notifications until I sent a second push message to be able to get a LED notification for both the first and second message - which was odd. But having done random pushbullets and google talk tests from the PC throughout the week all messages have so far been instant without fail.

Android OS usage in battery stats is higher than usual though, neither BetterBatteryStats or WakeLock detector shows anything on it, would assume its from the changes in wcnss_qcom_cfg.ini.

Hope that helps.
[Nexus 4 General] Xoib:
I can confirm what you said. Btw It was already the case during my JWR66V tests.
[Nexus 4 General] SidneyPacifico:
como faço para mudar o endereço MAC do android 4.2.2???

Boa noite.

Desculpa está postando em português, porém sou brasileiro e gostaria muito de saber como faço para mudar o endereço MAC do meu Xperia ZQ com Android 4.2.2?

Já tentei quase tudo e até o momento não obtive sucesso...

Agradeço ao tempo que me foi destinado...

Quaisquer coisa pode até enviar a resposta diretamente para meu Gmail: sidneypacificodesouza@gmail.com

Sou hiper fã das pessoas Do XDA, vocês são praticamente uns heróis...
[Nexus 4 General] crachel:
Please post a English translation in accordance with forum rules
[Nexus 4 General] SidneyPacifico:
How do I change the MAC address of android 4.2?

Good night.

Sorry posting is in Portuguese, but I'm Brazilian and I would love to know how do I change the MAC address of my Xperia ZQ with Android 4.2.2?

I've tried almost everything and so far no success ...

I appreciate the time that I was destined ...

Any thing can even send the reply directly to my Gmail: sidneypacificodesouza@gmail.com

I'm a fan of those hyper From XDA, you are practically a heroes ...
[Nexus 4 General] burdo:
I had delay notifications on 2g/3g and wifi as well.

I completely solved the problem by installing REGPON WIFI KEEP ALIVE in the play store (changing the two lines in /system/etc/wifi/WCNSS_qcom_cfg.ini worked too but by doing this I was not able to upgrade roms), and installing PUSH NOTIFICATION FIXER in the play store and trying the different intervals (I had to set it to 2 min on 3g and 5 min on wifi, but these varies with carriers and routers).

I keep Wifi optimization ON..

You get a significant battery life impact with wifi on because the Regpon app prevent the phone from going to deep sleep. Almost no impact on 2g/3g because regpon disables itself when wifi is not connected.

Hope it helps.
[Nexus 4 General] andy o:
FWIW, this has been fixed for me on the latest CM nightlies, presumably after the big CAF updates. Downside is that I don't think most custom kernels will work with it, but there's a hack (look it up on the CM Q&A thread). Personally, I haven't had trouble in more than a week, in 4 different networks, which I was having trouble with even after the 4.3 "fixes".
[Nexus 4 General] clefster:
According to the current AOSP source release, ARP offload is still disabled on the N4 for Android 4.4 KitKat:

https://android.googlesource.com/device/lge/mako/+/46fc0d8^!/#F0

OK ignore.. see below post.
[Nexus 4 General] blubb23:
The 4.4 version is this and there it seems to be enabled:

https://android.googlesource.com/device/lge/mako/+/android-4.4_r1/WCNSS_qcom_cfg.ini
[Nexus 4 General] Kaanu74:
So... I'm thinking about what's happend with kit-kat. Let's see.
[Nexus 4 General] fathocker:
4.4 kills the problem for me
[Nexus 4 General] gm.cinalli:
It also seems to me, I can ping the phone now and seems that the notifications arrive instantly.

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 General] meangreenie:
It don't work well for me on kit kat, it's got a whole lot worse :{

Are you guys using WiFi optimised mode? Is it entering sleep mode?

My problems in 4.4 using WiFi optimised setting.. In sleep mode (checked working)

1.. Whatsapp, very delayed notifications but they usually get through after a few minutes.

2.. BBM, notifications never come. When I turn the screen back on the icon has even disappeared from the status bar, so I have to manually start BBM to get them.

3.. Very slow WiFi connection download speed, @ 0.75 Mbps. This happens when leaving the phone in sleep mode for a long time and after initial boot. Turning off/on WiFi resolves this to normal speeds but it always returns to very slow again at some point.

Why am I the only one :(
[Nexus 4 General] gm.cinalli:
I'm on KitKat from only one day. But the only sure thing I can see is that I can ping my phone now. And in JB this was impossible. I use WiFi in optimized mode.

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 General] fathocker:
Same for me

Edit: 500 ping deep sleep, 60 screen on
[Nexus 4 General] Kaanu74:
I'm on 4.4 with Art. Sometimes works awesome, sometimes works ****ty. I have no idea it's fixed or still have.
[Nexus 4 General] philipepi:
i've noticed too when i'm on art my wifi got delayed notifications, but with daviak don't
[Nexus 4 General] meangreenie:
Fixed my bbm by rolling back to version .72.. But notifications in general are delayed by up to 5 minutes.

Wish I could work out why my WiFi keeps limiting my download speed on KitKat to 0.7Mbps.. That's 75kb/s which is ye olde ancient dial up speed.

Turning WiFi off and back on fixes it for only a while. And I'm on dalvik.
[Nexus 4 General] nowster:
Not really. The fastest dialup modems were nominally 56kbit/s but that was never achieved in practice. 48kbit/s was about the maximum most people got. That's the equivalent of 6kbyte/s.

700kbps (0.7Mbps) is much faster than dual channel ISDN or the original ADSL speeds (256kbps).
[Nexus 4 General] chennyboy2002:
has enabling the ARP offload issue on the N4 affected the battery life at all? Currently at university with a wifi network that caused delayed notifications due to lack of arp offload on my n4. However, had a friend who got a n5 who was experiencing significantly worse battery life than my n4. The n5 got notifications perfectly fine though. I'm wondering if maybe enabling ARP offload was causing the issue?
[Nexus 4 General] PoisonWolf:
Anyone else care to report on whether this wifi issue has been fixed on 4.4?
[Nexus 4 General] nikfam:
Wifi issues still present in kit kat

The most significant reason I expected kit kat release , was a possible fix for data connection(wifi and 3g). Speed was a major issue! I have downloaded an internet speed meter which actually points to no improvement at all for 3g and wifi - there is a great speed fluctuation top speed(700kb/s) then back to zero then again top speed (despite getting better signal at some points compared to previous version). In fact I think that the "wifi reconnect" issue became even worse!

It is a shame that google never paid attention to such an issue for this device
[Nexus 4 General] taodan:
There is a WLAN driver update in KKT16S. Read this changes for more details http://www.androidpolice.com/2013/11/20/developer-changelog-krt16o-to-krt16s-critical-bug-in-full-disk-encryption-explains-hotfix/
[Nexus 4 General] ziddey:
I'm not sure if krt16s actually has the new driver. The r1.2 (krt16s) kernel supposedly has the head at commit 4df7beb. The wlan commit is actually 3 commits beyond 4df7beb. Assuming the prebuilt kernel's comment is correct, the wlan driver is NOT updated.

For what it's worth, I built a kernel with the head at 4df7beb (no new driver) and am maxing out my wifi/connection-- 40 down, 20 up. 40 down is as good as it gets with 802.11n 65mbps.. This is with the pure .97 radio.

KRT16S has mcast/bcast filtering and arp offloading enabled.
[Nexus 4 General] thracemerin:
That should be easy to determine as the kernel string should show what the last commit was.

For what it's worth I'm seeing no significant improvement in speed between KRT16O and KRT16S in terms of speed, but both are a considerable improvement over any 4.3 build.
[Nexus 4 General] ziddey:
Well I'll be damned. Looks like I'm recompiling tomorrow. Thanks for the tip

Still can't connect to 5ghz :(
[Nexus 4 General] genevois26:
I still have the problem with the whatsapp notifications. I don't receive the notificacions with wifi and the phone in deepsleep...

I just see a new build in Android source, "android-cts-4.4_r1", it has new driver?

Sorry for my bad english!
[Nexus 4 General] Floydfire:
I Also noticed that Wi-Fi optimize drop the speed... I'm now with this feature disabled so for now seems to work...

Inviato dal mio Nexus 4 utilizzando Tapatalk
[Nexus 4 General] Kaanu74:
I was using Art and i'm come back to dalvik.

I'm rooted. In wifi.ini(system/etc/wifi) find this line using es file explorer or like this. (wcnss_qcom)

BcastMcastFilter:3 to 0

And

bmpsfilter:1 to 0

I didnt make a battery test yet but it drains battery quickly in my first look. But its gonna fix wifi. I tested and works well.