Did you use teamviewer? (comic question i know... Who doesn\'t use it?)
Do you have any idea how does teamviewer make connection even if i am behind the router, firewall
The software is communicating with a central server, and has made an outbound connection. When you start TeamViewer, it will try to make a direct connection, but if both directions fail that (ie. firewall or NATting at both places), then it will fall back on communicating through a server.
This is basically the same approach most online games use. Changes at one end is sent to a central server, and is then relayed back to other connected computers.