SOME/IP in AUTOSAR Classic

SOME/IP

Unicast or multicast events

With few subscribers the server sends every event to each of them in a message of its own, by unicast. With many, it sends one message by multicast to a group address that all of them listen to. A configured number of subscribers decides when the server changes from one to the other.

Two ways to send events

Left, unicast: the radar ECU sends three separate Notification messages, one to each subscriber. Right, multicast: the radar ECU sends one Notification to a multicast address; the network hands it to all three subscribers that listen to that address. Unicast Radar ECU client 1 client 2 client 3 3 Notification messages leave the radar Multicast Radar ECU multicast address client 1 client 2 client 3 1 Notification leaves the radar
Figure 1. Count the orange arrows leaving the radar ECU: three on the left, one on the right. On the right the grey fan-out is done by the network, not by the radar.

unicast

One message per subscriber

Each subscriber gets its own NOTIFICATION, sent to the Endpoint option of its SubscribeEventgroup, over UDP or over its TCP connection.

multicast

One message for all

One NOTIFICATION goes to a multicast address over UDP. The SubscribeEventgroupAck carries a Multicast option with that address, and clients start listening to it straight away so they miss nothing. TCP cannot do this.

The multicast threshold

Each event handler (the server side of an eventgroup) has a multicast threshold (the number of subscribers from which the server sends the events of the eventgroup by multicast instead of by unicast).

Multicast thresholdBehaviour
0Always unicast; never multicast.
1Multicast from the first subscriber on; never unicast.
2 or moreUnicast while there are fewer subscribers than the threshold; multicast as soon as the threshold is reached; back to unicast when subscribers leave and the count drops below it.

Two things always go by unicast, whatever the threshold: the initial events for a new subscriber (they are only for that client) and all the eventgroup entries themselves (SubscribeEventgroup, Ack, Nack). A SubscribeEventgroup without a UDP Endpoint option is refused with a SubscribeEventgroupNack, unless the multicast threshold is 1 and the events therefore go only by multicast anyway.

Try it

Subscribe and unsubscribe clients, choose a multicast threshold, and send an event.

Radar ECU

Things to notice. With multicast threshold 3, the second subscriber still gets its own message by unicast, and the third switches everybody to multicast: one message instead of three. Remove one subscriber and it switches back. The initial events for a new subscriber always come by unicast, even while everybody else receives by multicast.

Check yourself optional

New terms in this lesson

TermMeaning
multicast thresholdNumber of subscribers from which the server sends the events of an eventgroup by multicast instead of by unicast; 0 means always unicast

Source: SOME/IP-SD Protocol Specification, R20-11, sections 4.1.2.4 (multicast option), 4.1.2.6, 4.1.3.1 and 4.1.6 (threshold, adaptive state machine); Service Discovery, R20-11, section 7.6.5 and the description of SdEventHandlerMulticastThreshold.