Here is some idea of how im works.

There is a central server.
All clients log into that main server
The server detects the new client and searches for othe clients that have that one for a buddy.
then the server sends a string message to all those clients with that buddy telling the client exe that he is logged on. Then the client of course shows he is online.
Same thing for sending a message. The message goes to the server. The server looks through all the logged on people looking for the connection pointing to the specifies buddy. Then sends it to that buddy.


As far as having a changing ip....even those p2p programs need a central server with a static ip. If you dont have a static ip, either

a) Get one.
b) goto http://www.dyndns.org and get a dynamic dns..then people can access your server with B2E.dyndns.org..or whatever.