Chatting Application
-
Monday, May 21, 2012 10:01 AMI plan to make simple p2p Chatting Application.
But I confuse at designing level of the application.
Peer uses fix port number assumes 5678.
may peers are from countries.
So peer doesn’t know the other peer’s IP Address.
Both peers are in NAT (Network address translation) Networks.
When packet leave private network Source IP will replaced by Public IP.
How peers can communicate if they don’t know destination IP Address?- Moved by Helen Zhao Wednesday, May 23, 2012 5:34 AM (From:Visual C++ General)
All Replies
-
Monday, May 21, 2012 11:55 AM
Now you know why there's no such thing as a simple p2p chatting application :)
You cannot route packets using the destination's internal IP from the outside of a NAT. You have to use the external (public) IP and let the destination's NAT do the necessary address translation (and possibly port translation).
Fundamentally, this is identical to what you'd do if the destination was directly connected without NAT.
Answering policy: see profile.
- Edited by David Boyce UK Monday, May 21, 2012 11:57 AM
-
Monday, May 21, 2012 12:40 PMI don’t understand two things
(1) Then how torrent Clients can communicate with each other.
(2) How virus send recorded keystrokes to the hacker.
If virus knows hacker’s public IP to send keystrokes list, it is possible to get the location on map from where hacker receive packets from all his viruses
How hackers get keystrokes yet they don’t catch? -
Monday, May 21, 2012 1:52 PM
Vijayverma123 wrote:
I plan to make simple p2p Chatting Application.
But I confuse at designing level of the application.
Peer uses fix port number assumes 5678.
may peers are from countries.
So peer doesn�??t know the other peer�??s IP Address.
Both peers are in NAT (Network address translation) Networks.
When packet leave private network Source IP will replaced by Public IP.
How peers can communicate if they don�??t know destination IP Address?Most P2P applications I'm familiar with involve a central server. When coming online, clients register themselves with the server, which keeps track of their IP addresses (and sends notifications to other clients that might be interested in updating their "buddy list"). The server may or may not participate in the actual chat (protocols differ in this regard), but at least it acts to introduce clients to each other.
You might want to study XMPP protocol:
http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol
Igor Tandetnik
-
Monday, May 21, 2012 2:02 PM
Vijayverma123 wrote:
I don�??t understand two things
(1) Then how torrent Clients can communicate with each other.Clients register themselves with a central server called a "tracker" (specified in the .torrent file), and obtain the identity of other clients (peers) willing to share pieces of the same torrent.
(2) How virus send recorded keystrokes to the hacker.
If virus knows hacker�??s public IP to send keystrokes list, it is possible to get the location on map from where hacker receive
packets from all his viruses How hackers get keystrokes yet they don�??t catch?It's not as simple as a single central server, but yes, there are central servers involved, and in fact a few botnets have been disabled by the authorities taking over their command-and-control servers. See
http://en.wikipedia.org/wiki/Botnet#Organization
http://en.wikipedia.org/wiki/Mariposa_botnet#Dismantling
Igor Tandetnik
- Marked As Answer by Vijayverma123 Wednesday, May 30, 2012 5:14 AM
-
Monday, May 21, 2012 2:04 PM
I don’t understand two things
(1) Then how torrent Clients can communicate with each other.You may find the article at http://www.brynosaurus.com/pub/net/p2pnat/ helpful.
Answering policy: see profile.
- Marked As Answer by Vijayverma123 Wednesday, May 30, 2012 5:14 AM
-
Wednesday, May 23, 2012 5:33 AM
Hi Vijayverma123,
According to your description, I'd like to move this thread to Peer-to-Peer Networking for Windows Desktop Forum for more efficient responses.
Thanks for your understanding.
Best regards,Helen Zhao [MSFT]
MSDN Community Support | Feedback to us


