SOME/IP in AUTOSAR Classic

SOME/IP

Transmission: from the SWC to the wire

Follow one event, BrakeEvent, from the radar's SWC to the Ethernet wire. Each module puts its own header in front of what it got from above, like envelopes inside envelopes: SOME/IP header, then UDP and IP header, then the Ethernet frame.

The message grows on the way down

Layout of the message at each level. SWC: the BrakeEvent value. After the SOME/IP transformer: the SOME/IP header from Request ID to Return Code, plus the serialized payload. COM and PduR: one I-PDU with one UINT8_N signal, unchanged. After SoAd: the SoAd PDU header, which is the Message ID and Length, in front. After TcpIp: IP header and UDP header in front. On the wire: Ethernet header with VLAN tag in front and the frame check sequence at the end. SWC BrakeEvent valuedistance, speed RTE + SOME/IPtransformer SOME/IP headerRequest ID … Return Code payloadserialized data COM / PduR one I-PDU = one UINT8_N signalbytes unchanged SoAd SoAd PDU headerMessage ID · Length the I-PDU from PduR TcpIp IP headerUDP header one or more SOME/IP messages EthIf /Eth driver Ethernet headerMAC · VLAN tag IP packet: IP header, UDP header, SOME/IP messages FCScheck sum Grey boxes are what the module above handed down; coloured boxes are what this module adds.
Figure 1. Read from top to bottom: each line is the previous line with a header added on the left (and, on the wire, the frame check sequence at the end). Only the SOME/IP transformer touches the data itself; every module below treats it as bytes.

The modules, one by one

SWC

Writes a value

An ordinary write of a data element through the RTE. The SWC does not know it is SOME/IP.

RTE + SOME/IP transformer

Serializes

The RTE runs the transformer chain (the transformers it runs one after the other on the data; here only the SOME/IP transformer). The SOME/IP transformer serializes the value into the payload and writes the SOME/IP header from Request ID to Return Code. The output is one byte array.

COM or LdCom

Carries

In COM the byte array is one signal of type UINT8_N or UINT8_DYN (a byte array of fixed or dynamic length), the only signal in its I-PDU. LdCom hands the byte array on as the I-PDU itself. Either one passes the I-PDU on when it is to be sent.

PduR

Routes

PduR passes the I-PDU by its PDU ID to SoAd, or first to SOME/IP TP if it needs segmentation.

SoAd

Addresses

SoAd finds the socket connections (each one a local socket plus one remote IP address and port) this I-PDU goes out through: those whose routing group (a set of PDU routes that Sd enables and disables as a whole) is enabled. For an event that is one per subscriber, or one multicast address. SoAd puts the SoAd PDU header (header ID and length in front of each PDU; for SOME/IP it is the Message ID and Length of the SOME/IP header) in front and hands the message to TcpIp once per socket connection.

TcpIp

Adds UDP and IP header

TcpIp adds the UDP header (ports) and the IP header (IP addresses), finds the receiver's MAC address (the hardware address of its Ethernet controller) by ARP, and asks EthIf for a transmit buffer.

EthIf + Eth driver

Sends the Ethernet frame

EthIf picks the controller and adds the VLAN tag (four bytes that put the frame into a virtual LAN) if one is used. The Eth driver writes the Ethernet header and the hardware sends the frame with its frame check sequence (FCS, a check sum).

Confirmations travel back up: once the message is sent, SoAd calls the TxConfirmation (the callback that tells the module above that a PDU has been sent) of PduR, and PduR calls that of COM or LdCom. For UDP, SoAd gives this confirmation in its next main function (the cyclic function of a module that the scheduler calls at a fixed period).

Things to notice. The SOME/IP header is written by two modules: from Request ID on by the SOME/IP transformer near the top, the Message ID and Length by SoAd far below (lesson 20). Between them, COM and PduR pass the bytes on without looking inside. If two clients are subscribed and the events go by unicast, the same I-PDU leaves SoAd twice, through two socket connections.

Check yourself optional

New terms in this lesson

TermMeaning
socket connectionIn SoAd: one local socket plus one remote IP address and port
SoAd PDU headerHeader ID and length that SoAd puts in front of a PDU; for SOME/IP the Message ID and Length
UINT8_NCOM signal type for a byte array of fixed length (UINT8_DYN: dynamic length)
TxConfirmationCallback to the module above: the PDU has been sent
main functionThe cyclic function of a module, called at a fixed period
MAC addressHardware address of an Ethernet controller, found by ARP (IPv4) or NDP (IPv6)
VLAN tagFour bytes in the Ethernet frame (IEEE 802.1Q) that put it into a virtual LAN

Source: R20-11 specifications of RTE (4.10), SOME/IP Transformer (7.2.3), Socket Adaptor (7.2, 7.3), TCP/IP (7.7), Ethernet Interface and Ethernet Driver.