Slightly OT:question on communication

E

El Durango

Hello all,

I will try to explain my situation as clearly as possible. I am
creating a program that will act as an autonomous client which will receive
and send data to other autonomous clients (peer to peer), so that there is
decentralized communication. I was thinking of initially having a new client
sending a Multicast message to a unique address/port for the group and
giving the other clients its comm info (address/port) and then receiving
direct communication from each of the clients through UDP sockets. Now here
is my question, I am assuming that each of these clients will require a
unique port to communicate through?
I am using my computer as the testbed so all the clients will have the
address of localhost.
Now how am I suppose to find a unique port for each client?
Until now I have only down the traditional Client/Server
communication, where the server had a universal port everyone talked to!
If anyone can clear my confusion I would appreciate it.
 
R

Roedy Green

I was thinking of initially having a new client
sending a Multicast message to a unique address/port for the group and
giving the other clients its comm info (address/port) and then receiving
direct communication from each of the clients through UDP sockets. Now here
is my question, I am assuming that each of these clients will require a
unique port to communicate through?

I have been puzzled how multicast could ever work in general.

Here are the puzzles.

1. how do you decide on a globally unique multicast address? Are
these assigned by IANA or is there something like DHCP to assign one?

2. Lets say I send a message to my ISP with a multicast address. How
does the ISP know where to forward it? It has to send it many places.
But how does it know which places have listeners waiting? Surely it
does not send the message to every machine on the planet.
 
R

Roedy Green

Now how am I suppose to find a unique port for each client?
Until now I have only down the traditional Client/Server
communication, where the server had a universal port everyone talked to!
If anyone can clear my confusion I would appreciate it.

Even in peer to peer systems, there needs to be some sort of registry,
perhaps duplicated and distributed to find the other peers. To get
started, you would need at least a server to give you the original
list of the IPs of clients.

Every peer could open a standard server receiving port, without
needing any sort of multicast.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top