SOME/IP
Socket connections and routing groups
Inside SoAd every network partner gets a socket connection, and every route through it can be switched on and off by a routing group. Sd fills in the partners' addresses and switches the routing groups; that is how a SubscribeEventgroup turns into actual event flow.
Socket connections
A socket connection connects one local port of the ECU with one partner: its IP address and port, over UDP or TCP. Socket connections with the same local port and settings form a socket connection group (socket connections that share one local port and protocol), one socket connection per partner. A socket connection can start with a wildcard remote address (any address: the partner is not known yet) and get the real address later.
filled by Sd
From Endpoint options
When an OfferService or a SubscribeEventgroup brings an Endpoint option, Sd writes that address into a free socket connection of the right group that still has the wildcard remote address, or finds the socket connection that already has it.
filled on arrival
From the first message
A UDP socket connection with the wildcard remote address can also take the address of the first accepted message that arrives through it. This is how a server's socket connection learns which client is calling.
opened by Sd
Open and close
Sd asks SoAd to open the socket connections of a service instance when it starts using it, and to close them when it stops. A TCP socket connection on the client side opens the TCP connection.
Routing groups
A routing group works like a named switch attached to routes: a PDU route (the way of a PDU from PduR out to its socket connections) or a socket route, which takes a received message from a socket connection up to a module by its header ID. When all routing groups of a route are off, nothing flows on it. A routing group attached to a socket connection group has a separate on/off for each socket connection, so it can be on for one partner and off for another.
Which routing groups Sd uses
A triggering routing group (a routing group that makes SoAd send at once, fetching the data from the module above) is how a new subscriber gets its initial event without the server SWC writing the value again. The table lists all of them.
| Side | Routing group for | Turned on |
|---|---|---|
| Server | the methods of a service instance | when the instance starts its phases, so REQUESTs can arrive |
| Server | the events of an eventgroup, per socket connection | for each client that subscribes, by UDP or TCP |
| Server | the events of an eventgroup, by multicast | when the number of subscribers reaches the multicast threshold |
| Server | triggering routing group for initial events, per socket connection | used once per new subscriber: SoAd fetches the current value from the module above and sends it to that socket connection only |
| Client | the methods of a service instance | when the instance is AVAILABLE |
| Client | the events of an eventgroup (UDP, TCP) | when it subscribes |
| Client | the events of an eventgroup (multicast) | when the SubscribeEventgroupAck brings a Multicast option |
Responses find their way back
On the server, REQUESTs from several clients arrive through different socket connections of one socket connection group. The RTE keeps the PDU meta data of each REQUEST (extra data that travels with a PDU; here the socket connection ID) and hands it back with the RESPONSE, so SoAd sends the RESPONSE through that same socket connection to the right client.
Try it
You are inside the radar's SoAd. Let clients subscribe and stop, send BrakeEvent, and receive a REQUEST.
| Socket connection | Remote address | Routing group "Eventgroup 1" | Routing group "methods" |
|---|
Things to notice. Sending BrakeEvent before any SubscribeEventgroup produces no PDU at all: the routing group is off for every socket connection. The initial event goes out through the triggering routing group to the new subscriber's socket connection only. The REQUEST from the display ECU is answered through the socket connection it came in by.
Check yourself optional
New terms in this lesson
| Term | Meaning |
|---|---|
| socket connection group | Socket connections that share one local port and protocol (UDP or TCP), one per partner |
| wildcard remote address | A remote address of "any": the partner is not known yet; Sd or the first message fills it in |
| PDU route | The way of a PDU from PduR out to one or more socket connections |
| triggering routing group | A routing group that makes SoAd send at once, fetching the data from the module above; used for initial events |
| PDU meta data | Extra data that travels with a PDU, here the socket connection ID, so a RESPONSE goes back to the right client |
Source: Socket Adaptor, R20-11, sections 7.1, 7.2.1, 7.2.3, 7.6, 7.9 and 7.10; Service Discovery, R20-11, sections 7.2.4, 7.6.4 (fan out) and 7.7.5 (fan in); RTE, R20-11, section 4.3.2.6; System Template, R20-11, section 10.2.