So by your logical to computers can only be directly connected via a LAN lol
No. Any two
clients can be "directly" connected. It's just that in this case, iMessage doesn't use that topology.
A direct connection is good in some regards, but terrible in others.
A port, a computer or a program connects to somewhere or something else on the Internet via a port. Port numbers and the user's IP address combine into the "who does what" information kept by every ISP
I'm not sure that you grasp what a port is used for.
It's more like a "door" that's used by a specific program to send/receive data while attached to a network. Your web browser will connect to the web server that hosts these forums over port 80. That port is used by virtually every web site on the internet, so the port number in itself is no use in establishing a connection.
The IP is the important part.
The IP is more like the number of an apartment building, while the port is the number to the door of the apartment.
The issue is never knowing what port you want to use, it's knowing the IP address of the computer you're trying to connect to.
An iPhone will have one IP from the carrier (e.g. AT&T) that may change at any time and another IP from each Wi-Fi network that it connects to.
That IP could change multiple times, all within the space of 30 seconds.
For a "direct" connection to work, the change in IP would have to be notified to each of your iMessage contacts on a continual basis and a new connection would need to be established between each one.
Doing that involves using battery power and consuming data - neither of which is desirable. That's not to mention that it's time consuming.
Most IM services and protocols (like AIM, MSN and XMPP) weren't really designed with the idea of rapidly changing IPs in mind.
Apple gets around this by virtually replicating their Apple Push Notification (APN) service, which maintains
ONE connection between the device and an Apple server, passing all data through that one connection. When the network configuration changes, it only has to be changed once (e.g. 3G > Wi-Fi).
The major downside to this is that if that one connection fails for whatever reason, you miss all of your notifications or messages.