UDP Multicasting

User Datagram Protocol (UDP) is one of the two main transport protocols utilized in IP networks, and is used by applications to transmit messages (also known as datagrams or packets) between networked hosts.

UDP has better transmission rates compared to TCP. This is because UDP is a “best effort” protocol and does not implement some of the features offered by TCP. Unlike TCP, UDP does not guarantee reliability or ordering of packets. Avoiding the overhead of checking whether every packet arrives makes UDP faster and more efficient.

Multicasting is a technique developed to send packets from one host in the network to many other hosts. It differs from UDP broadcasting. With broadcasting, packets are sent to every possible receiver, while multicast packets can be sent to selected receivers. In multicasting, one packet is sent from a source and is replicated in the network to reach as many end-hosts as necessary. Multicasting is useful because it conserves bandwidth, which in many cases is the most expensive part of network operations. It does this by replicating packets as needed within the network, thereby not transmitting unnecessary packets. Multicasting uses UDP as its underlying transport protocol. Hence there is no acknowledgement of the success or failure of the transmission of any packet, and no retransmission, at the transport layer.

Multicast is based on the concept of a group. Every multicast requires a multicast group. An arbitrary group of receivers expresses an interest in receiving a particular data stream containing messages. Processes that are interested in receiving data flowing to a particular group must join the multicast group. The sender transmits to the group, and only members of the group can receive the multicast data. Multicast addresses are used to define the multicast group. The Internet Assigned Numbers Authority (IANA) controls the assignment of IP multicast addresses. It has assigned the Class D address space to be used for IP multicast. All IP multicast group addresses will fall in the range of 224.0.0.0 to 239.255.255.255.

In RAP, the publishers send messages over the network through the datastream channels using UDP multicasting. Each datastream channel can be configured to have a multicast address, an IP address of a local network interface and a local port. The subscribers can be configured to receive messages from one or more publishers by listening for messages on all of the publishers’ datastream channels. In order to ensure maximum performance, the publishers and subscribers should be set up on the same subnet. The multicast IP addresses reserved for “ad-hoc” usage fall in the range of 224.0.2.0 to 224.0.255.0. It is recommended that this range be used for the datastream multicast addresses. Since UDP is a “best effort” protocol, message reliability has been built into RAP by adding mechanisms in the subscribers for detecting transmission of lost messages over the network and requesting each lost message from the publisher over a TCP connection.


Created October 8, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com