My question is quite simple. I've been digging around in the subject for quite a while now, but I can't really get a hang of how it works.

Scenario: I use Facebook on my phone to chat with some friend of mine.

The question is: How does network security in Android work? Is there any equivalent to a firewall on a computer? I want to know how the data is transported from the phone to the destination, which ports are used (if any), if not what is used instead. But also which protocols are used.

My intention with this question is to learn how my android phone communicate with other devices on Internet.

I don't mind getting redirected to a forum or site where I can read about these things. But as I mentioned before, I can't really find anything about it.

2 Answers 2

  • There is no real firewall in Android, but this doesn't mean you are totally unprotected from the outside. (There are some measurements from the underlying Linux Kernel.)
  • Every app chooses it's own ports and decides weather the connections are encrypted.
  • Android apps usually do not open any ports, hence the there is not that much of a need for a firewall
  • Incoming data is often handled and transmitted through Google Cloud Messaging. (Here I don't know how it works and the data is transferred)

I would recommend AFWall+ as equivalent to a packet filter on a desktop computer. Note that AFWall+ is just a GUI to generate iptables/Netfilter (Linux Kernel feature) rules. To apply those rules, AFWall+ requires root privileges on the device.

AFWall+ gives you the possibility to allow/deny certain applications to open outgoing connections over WLAN/mobile data (which can be enabled separately). Another nice feature of AFWall+ is to allow/deny applications to open connections to hosts in your local network.

To see what is going on you can use the application Network Log which can show you the incoming and outgoing connections on your device. This application also uses iptables and requires root privileges.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .