views:

137

answers:

3

I my company we use small application called IPMsg a messenger kind of tool to pass messages and file to other fellows in company, even it allows to multicast the message.

And also it list the Username, hostname and IP addresses of users.

How it could do that? There is no server present for message routing and when checked through netstat command in CMD. it did not show any details like what protocol and port it is using to communicate.

There is source code also available on the same site which is in VC++. I didn't understand a line of code... (I'm a C# guy)

can anyone brief me how it could that?

+3  A: 

One simple way would be to let the application listen on a certain network port, and when you start your instance of it, it tries to connect to that port on each computer on the same network. If that other computer has that port open, and answers correctly, then you have found another instance of the application.

Thomas Padron-McCarthy
In the case of an instant messenger that doesn't have a server, it *has* tolisten on a port to accept the incoming messages
Rowland Shaw
+3  A: 

IPMsg probably multicasts a request for all clients to report their user and host details.

A similar mechanism is used when Windows Explorer attempts to find other machines on a network. A good description of this type of multicasting discovery is described here.

Alan
A: 

IPMsg is a daemon which listens to incoming connections on a specific port which is the connection port. You can find out which port it used by using Wireshark.

Start wireshark, start listening on the interface where you have connected to LAN and then start sending any message, wireshark will show you the message on the screen with the port number also.

The application is a peer-to-peer software and doesn't require a central server software to route messages. it only has a small daemon which accepts incoming connections. This is the way Jabber Instant messaging protocol also works.


As you said it lists username, hostname and ip address of users, do you mean it pings the network and finds it? If yes, then it is actually possible to find the IP addresses of computers on the Local Network which requires you to know the subnet on which you are connected.

You can use ARP/ICMP Ping to know the hosts present on your network provided you enter the correct subnet information


Multicasting a message is also nothing special. It is a feature provided with all Networking Stacks.

If you want mutlicasting in .NET, it is allowed. Check this page on Code Project which gives a nice example

Manish Sinha