Network security in Android 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.
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)