SOME/IP Introduction
SOME-IP by itself is not a library, and have no source code. It is merely a specification, developed and maintained by AUTOSAR. while its implementation is called vsomeip and released by COVESA.
CommonAPI C++ SOMEIP is a suite of toolchain and library that provides convenient way to perform SOME-IP using vsomeip. In other words, CommonAPI wraps vsomeip.
Overall Architecture of SOME/IP
Routing manager:
- Routing manager is the central component that processes all the SOME/IP messages received. Routing manager decides where does the message send to.
- For each device excuting SOMEIP apps, only a single app can communicate to external device – stub app.Remaning apps (- proxy apps) communicate to external through stub app.
Service Discovery:
- Service discovery implements SOMEIP-SD protocol to communicate remote SOMEIP service.
- Service Discovery is used to:
- Locate service instances,
- detect if service instances are running,
- handle Publish/Subscribe.
- Provider services will announce their existence to Service Discovery by sending OFFER message.
- Consumer services find other service in the network by sending FIND message.
Endpoint:
- Each application need implement a Endpoint to send/receive message over socket.
- 2 types of Endpoint:
- Local endpoint for internal communication.
- TCP/UDP endpoint for external communication.
Communication pattern
- Request/Response (Method):
- Request: message which calls a method on a server
- Response: message which returns the result of a method call.
- Fire&Forget (Method):
- Request: message which calls a method on a server
- No response is returned.
- Event:
- Server notifies previously subscribed clients when something happens
- A notification message is sent to the clients each time the event occurs even if the event is the same.
- Does not have a status, initial value or lifetime
- Field (Get/Set):
- Has a status with an inital value and a lifetime
- Get: method to read the current field value.
- Set: method to write the current field value.
- Response: message containing the current field value.
- Event: server notifies previosly subscribed clients only when field value changed.
Definition of terms
Terms | Definition |
---|---|
Service | a logical combination of zero or more methods, zero or more events, and zero or more fields |
Service Interface | the formal specification of the service including its methods, events, and fields |
Service Instance | software implementation of the service interface, which can exist more than once in the vehicle and more than once on an ECU |
Server (Provider) | The ECU offering a service instance shall be called server in the context of this service instance |
Client (Consumer) | The ECU using the service instance of a server shall be called client in the context of this service instance |
Service ID | A service shall be identified using the Service ID. Different services within the same vehicle shall have different Service IDs. |
Service-Instance-ID. (or instance ID) | A service instance shall be identified using the Service-Instance-ID |
Client ID | The ClientId identifies a client sending a call to a stub. It is used to identify the caller within a stub and is supposed to be added by the middleware |