0

My application uses multicast capability of UDP.

In short I am using java and wish to transmit all data using a single multicast address and port. Although the multicast listeners will be logically divided into subgroups which can change in runtime and may not wish to process data that comes from outside of their group.

To make this happen I have made the code so that all the running instances of application will join the same multicast group and port but will carefully observe the packet's sender to determine if it belongs to their sub-group.

Warning minimum packet size for my application is 30000-60000 bytes!!!!!

Will reading every packet using MulticastSocket.receive(DatagramPacket) and determining if its the required packet cause too much overhead (even buffer overflow).

Would it generate massive traffic leading to congestion in the network because every packet is sent to everyone ?

Allahjane
  • 1,920
  • 3
  • 24
  • 42
  • 1
    With such large packets you are far more likely to exceed the buffer sizes of you network devices/adapters. Many have only a few MB per connection and with other traffic on the system, you are likely to overflow the buffer quite often. I suggest you write your application to handle a reasonably high drop out rate. – Peter Lawrey Aug 24 '13 at 07:43
  • The other option would be to split these packets into smaller packets, transmit them, and them reassemble them at the receiver! – Manoj Pandey Aug 24 '13 at 07:50

2 Answers2

1

Every packet is not sent to everyone since multicast (e.g. PIM) would build a multicast tree that would place receivers and senders optimally. So, the network that would copy the packet as and when needed. Multicast packets are broadcasted (technically more accurate, flooded at Layer2) at the final hop. IGMP assists multicast at the last hop and makes sure that if there is no receiver joining in the last hop, then no such flooding is done.

"and may not wish to process data that comes from outside of their group." The receive call would return the next received datagram and so there is little one can do to avoid processing packets that are not meant for the subgroup classification. Can't your application use different multiple groups?

Manoj Pandey
  • 4,528
  • 1
  • 17
  • 18
0

Every packet may be sent to everyone, but each one will only appear on the network once.

However unless this application is running entirely in a LAN that is entirely under your control including all routers, it is already wildly infeasible. The generally accepted maximum UDP datagram size is 534 once you go through a router you don't control.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • Well I may be able to reduce the packet size and yes its all in the private WLAN, but my main concern is will it cause congestion because practically the same data will be copied and sent by router to each device that has joined the group. so if there are 100 devices in the lan then won't it cause congestion? – Allahjane Aug 24 '13 at 07:16
  • No, because each packet only appears on each subnet once, and not at all unless there are multicast listeners in it or beyond it. That's the whole point of multicast. – user207421 Aug 24 '13 at 07:52