memo
memo

Reputation: 3724

Multicasting big packet contain all info to multiple clients vs individual packets to targeted clients

I'm writing a C++ application MyMasterApp which sends information (OSC via UDP) to multiple clients (about 5-10), which are mobile devices (Android or iPhone) via wifi.

Each device is to receive unique information, of the same type. Probably about 100-200 bytes per device, and I'll be updating all devices at 30Hz.

I could send a unique data packet to each device, or I could create one big structure which contains each of the unique bits of data for each device, with the target id, multicast this to all devices, then each device only picks out the data it needs.

i.e.

vs

Before I attempt both approaches, are there any theoretical, or recorded practical advantages of one over the other (E.g. better performance, less collision, lost packets etc)? Or are the differences just negligible?

I have a related network performance question about the same project at Should I listen on different ports, or the same port?

Upvotes: 0

Views: 178

Answers (2)

user207421
user207421

Reputation: 311018

Even leaving future growth aside, your present worst cases of 200 bytes x 10 devices is already 2000 bytes, which is already too big to send via UDP. The practical maximum UDP datagram is generally held to be 576 bytes, or 534, numbers of that sort. So you don't have a choice. You must unicast.

Upvotes: 2

m2r0007
m2r0007

Reputation: 45

One of the major advantages of multicast is scalability so in the future if you tend to have more devices multicast will help. Better to look at multicast vs unicast performance for guidance

M. Ebrahimi, M. Daneshtalab, P. Liljeberg, and H. Tenhunen. Performance evaluation of unicast and multicast communication in three-dimensional mesh architectures. In Computer Architecture and Digital Systems (CADS), 2010 15th CSI International Symposium on, pages 161-162, sept. 2010.

Upvotes: 2

Related Questions