Recently, I have been going through several researches and topics at this forum but as a result I still have more questions than actual answers which is up to date. That's why I started this new topic.
What I wan't is to form basic understanding of unicasting, multicasting and broadcasting related to TCP vs UDP and how these are used. (Before someone says "there is no such thing as TCP multicast etc, read on..")
To narrow my questions to relevant area, lets assume to be developing online multiplayer game (with client-server model) to work over wide area networks (note: not LANs)
So my questions are below:
Q1: Unicast, multicast and broadcast in TCP and if so, how? if not, how to mimic?
Q2: Unicast, multicast and broadcast in UDP and if so, how? if not, how to mimic?
Q3: This is a bonus question, using TCP and UDP together, is this a myth? or does these conflict somehow and make things even slower?
My own guesses are here:
- There is no such thing as multicast and broadcast in TCP. TCP is point-to-point connection between server and client. This connection is unicast oriented. Server opens one connection per client and sends game state packet through it. If others needs this information, it needs to be send to those individually, this wastes bandwidth, but this is what we have to accept with TCP.
- Like being said, all communication is unicast oriented, point-to-point. e.g. To send single game state update from server to 3 players in game, it needs to send same game packet total of 3 times.
- Cant be done because of the nature of TCP. If TCP needs to act as a multicast: closest it can get is to use some criteria at server to group players (like again, 3 together) and send to those only. But still, it would need to send same game packet total of 3 times. But its the closest we can get with TCP.
- Not supported, again.. only way to mimic broadcast is to take all players at server (lets say 10) and send same packet 10 times over.
A2: (Not even close to sure what I am guessing here, but lets try with these):
- There is a unicast, multicast and broadcast in UDP.
- Possible as in TCP. Can send one packet to one client only.
- This is the topic of high concerns, there is like 10 - n researches pointing out facts about multicast, to clarify: IP multicast. There seems to be many applications utilizing multicast, as if its the only real way of data transfer in distributed simulations. However, this is where the interesting point comes in. IP multicast can reduce the traffic because of reaching 3 players with only one packet (this group is based on some IP and port). Sounds too perfect to be true, well it seems that www routers are not supporting this (I read somewhere that only few % of routers supports this), so IP multicasting is not an option either in MOGs ? Or, considering client-server model, does this support needs to be only from game server provider side? ... can it be easily enabled and clients dont need to do anything? And if not... considering all the games using UDP over internet, are those using unicast all the time to send game updates, I guess that broadcasting is not even an option.?
- Exists in UDP and can be used to broadcast to every connected client from server with just one packet. However not recommended to be used.. maybe in LANs or less critical apps?
- I have no guesses for this option, I have read that they conflict and slow things up, but I have also read that these can be used together.
Okey, well.. these were my best answers to my own knowledge atm, as can be seen I am most interested about the red text. Based on material what is out there: it seems almost that IP multicast and multicast is completely different things and there is no good support for ip multicast but still multicasting exists somehow for UDP? hmm.