8

I got an assignment to implement unicast, multicast and broadcast in UDP or TCP in java, so I searched for it and I only got UDP implementation of multicast.

My question is following:
Is there multicast possible in TCP?

fat
  • 103
  • 3
lazarus
  • 183
  • 1
  • 1
  • 5

4 Answers4

16

In a word: NO

Multicast is a one-to-many system. TCP requires a one-to-one handshake to synchronize counters (sequence numbers) to ensure reliable transport. This cannot be done with many receivers as the sender has no way to know how many receivers there are and thus how many ACKs to expect, or what to do if one of the receivers disappears mid-transfer, etc.

Think of multicast as a speaker in a lecture hall. They don't know how many people are supposed to be there, nor care if some are late or leave. Nor do they know (or care) if everyone in the hall is hearing everything they say.

Ricky
  • 31,438
  • 2
  • 43
  • 84
6

No. Even though TCP is composed of two separate sender/receiver relationships, the communication needs to be one-to-one and bidirectional.

But there are protocols which implement reliable transport over multicast, but they often use an inverse tree (publisher becomes consumer, and vice-versa) for negative acknowledgements. They are very different from TCP.

Mark Rogaski
  • 331
  • 1
  • 4
  • It's also possible that I'm misunderstanding the problem. I'm describing TCP over multicast. If the problem is to implement tunneling of multicast over TCP, then it's both possible and common. – Mark Rogaski Jan 17 '15 at 19:08
-1

YES.

If "Multicast in TCP" means "TCP over Multicast IP", the answer is NO and I can undersign the excelent answer by Ricky Beam, 5 years ago.

If "Multicast in TCP" means a multicast service or application using TCP, it is possible. It would allow a single sender (caster) to send a data stream to multiple receivers using multiple TCP connections over unicast IP. This can be done at application level, in a new transport layer or even at TCP level by an element that can be called an "Multicaster TCP proxy". Neither of these solutions would require to change the TCP/IP stack implementation.

jonasmike
  • 1
  • 1
  • 4
    That ain't multicast in the network sense we use here. I'd call it one-to-many-unicast service. – Zac67 Jun 16 '20 at 12:20
  • That's multicast to unicast conversion. The multicast part will still be UDP. The server/service doing this can then turn it into whatever it wants. The oddball APs that do this aren't actually making anything unicast, just processing it as unicast to the individual stations that want the traffic. (basically doing what a wired switch does, but different because of the special way 802.11 handles broadcast) – Ricky Jul 27 '22 at 13:11
-2

well unlike all of the other answer you have already received (and probably will receive) :

YES (but nobody has done it before)

TCP is a stream-oriented protocol hence logical connections between request & response have to be established - in the case of multicast at least one important information is missing : the recipient address. Without that, quite a few algorithms (if not all) will stop working.

The solution seems to be horribly complex - one would need to incercept all (!) of the packets at the network layer on all sides (weird people call it "internet layer") hence create an entirely new protocol which actually just maps against a real one. Plus : your multicast traffic will not be routed beyond your local network border, literally all ISPs will refuse these packets.

Also : the multicast sender will have to deal with n answers to each of these transmissions - which will reduce the bandwidth gain significantly, in fact it will most definitely also increase processing time and probably overstress most NIC processing chips.

That might be a very cool experiment, though - you will need advanced programming skills and a LOT of knowledge about computer networks, operating systems and network standards :)

specializt
  • 97
  • 1
  • 1
    "network layer on all sides (weird people call it "internet layer")". The TCP/IP protocol Stack is not compliant with the OSI model. In the TCP/IP stack this layer is actually called the internet layer. – JFL Mar 13 '17 at 14:03
  • i ... think you might want to re-evaluate your informations. TCP operates on the transport layer and IP is on the network layer. There is no such thing like *"not compliant with the OSI layer model"* because the model describes the entire universe of computer network technology, even your statement itself doesnt make any sense - its like saying that cakes are not compliant with baked goods. https://en.wikipedia.org/wiki/OSI_model#Comparison_with_TCP.2FIP_model – specializt Mar 14 '17 at 09:09
  • 2
    TCP requires the creation of a *socket connection* before data can flow. That is absolutely impossible with broadcast or multicast. You'd actually need to "create an entirely new protocol" that is entirely unlike TCP. Just use IGMP. – Zac67 Mar 05 '19 at 18:12
  • 2
    TCP creates a connection between exactly two endpoints. You cannot create a TCP connection from an endpoint to multiple other endpoints. What you suggest will not work. – Ron Maupin Mar 05 '19 at 19:48
  • you have obviously not even read what i wrote. – specializt Mar 06 '19 at 08:51
  • @Zac67 : thank you for repeating my statement. – specializt Mar 06 '19 at 08:53
  • @specializt I wasn't actually supporting those statements. TCP can't be used with multicast as a fact. Your "entirely new protocol" isn't TCP and can't be like it, but we don't need to go into detail here. – Zac67 Mar 06 '19 at 08:57
  • You **repeated my words** exactly - whilst not being a supportive action per se you definitely agreed ... without knowing it, apparently. Might i siggest re-reading my answer? Apparently you missed a few key statements – specializt Mar 06 '19 at 09:00