Reputation: 1420
I have a embedded device running Linux 2.6.33 that sends a large amount of multicast data, which is usually the only device of its kind on a LAN. However, in the rare case that there are two or more devices on the same network, I need a way for a client connection to differentiate between devices.
EDIT: A single client is only ever interested in traffic from a single device.
I could embed an identifier in each datagram, but that means clients use valuable time examining packets, which is probably more quickly implemented in a driver. Slow clients will definitely start to drop packets.
I could use a separate multicast IP address per device, or just differentiate the port each device sends to. This is already implemented.
I could use source-specific multicasting.
I don't know how efficiently the most common operating systems and drivers implement SSM, or whether using a different multicast group per-device is faster than relying on SSM.
As this is all implementation-dependent, I'd like advice from the field about options 2 and 3, and I'd like to know if just switching the multicast port is sufficient for differentiation of traffic.
Upvotes: 0
Views: 217
Reputation: 6270
To my mind there's not a big difference between all the three options. Here's why. Multicast traffic will hit the client host anyway. Now comes the sender differentiation part. Regardless of what way you choose it is a matter of comparing:
int
sThe bottom line is that performance-wise there's no big difference, since you are going to perform a single comparison of two primitive data types. That comparison would be implemented in a couple of processor instructions anyway so there's no big deal whether it is performed in kernel or user space.
I would choose the method that involves less burden to program. Regardless of what method you choose the performance would be pretty much the same.
Upvotes: 1