SOME/IP
Initial Wait, Repetition and Main Phase
When a service instance becomes available, the server does not send its OfferService at one fixed pace. It first waits a little, then repeats the offer quickly with growing gaps, then settles into a slow, steady rhythm: three phases, each with its own timing.
Wait, repeat, settle
OfferService comes after a random wait. Values are an example.phase 1
Initial Wait Phase
The Initial Wait Phase (a random wait before the first message) lasts between INITIAL_DELAY_MIN and INITIAL_DELAY_MAX; then the first OfferService goes out. Many ECUs start together after power-up; the random wait spreads their messages out, and gives Sd time to collect several entries into one SD message.
phase 2
Repetition Phase
In the Repetition Phase (quick repeats with doubling gaps) the server offers again after REPETITIONS_BASE_DELAY (the first gap), then after twice that, four times that, and so on, REPETITIONS_MAX times (the number of repeats). Clients that start a bit later find the service instance very fast, without flooding the network.
phase 3
Main Phase
In the Main Phase (the steady last phase) the server offers every CYCLIC_OFFER_DELAY (the period) for as long as the service instance is available. With CYCLIC_OFFER_DELAY = 0, no more offers are sent in this phase.
With REPETITIONS_MAX = 0 the Repetition Phase is skipped: the first OfferService is followed directly by the Main Phase.
FindService during the phases
A client may send a FindService (the client's question "who offers this service?", lesson 13) while the server is in one of these phases.
| Phase | A FindService arrives |
|---|---|
| Initial Wait Phase | Ignored. The first OfferService is coming anyway. |
| Repetition Phase | Answered with an extra OfferService. The repetition counter and the running gap are not touched. |
| Main Phase | Answered with an OfferService, normally by unicast to the client that asked. |
An answer to a multicast FindService is sent after REQUEST_RESPONSE_DELAY (a random wait between a minimum and a maximum), so that a busy network is not flooded with simultaneous answers. Lesson 13 shows this delay from the client's side.
Going back to the start
If the service instance stops being available, the server sends a StopOfferService (unless it was still in the Initial Wait Phase) and leaves the phases. If the ECU loses its IP address, for example because the link went down, the phases also end; when the address comes back, the server starts again with the Initial Wait Phase.
Try it
Choose the settings and press "Start". The Phase lane shows the Initial Wait Phase in grey, the Repetition Phase in pink and the Main Phase in green. Use "Send FindService" during each phase to see the different reactions.
Things to notice. A FindService in the Initial Wait Phase gets no answer of its own; one in the Repetition Phase gets an extra OfferService, but the next regular offer stays where it was. With CYCLIC_OFFER_DELAY 0 the server falls silent after the repetitions; clients then rely on a long TTL and on FindService.
Check yourself optional
New terms in this lesson
| Term | Meaning |
|---|---|
| Initial Wait Phase | Random wait before the first OfferService |
INITIAL_DELAY_MIN, INITIAL_DELAY_MAX | Bounds of that random wait |
| Repetition Phase | Quick repeats of the offer, each gap twice the one before |
REPETITIONS_BASE_DELAY | The first gap of the Repetition Phase |
REPETITIONS_MAX | Number of repeats; 0 skips the phase |
| Main Phase | Steady offers for as long as the service instance is available |
CYCLIC_OFFER_DELAY | Period of the offers in the Main Phase; 0 means none |
REQUEST_RESPONSE_DELAY | Random wait (min, max) before answering a multicast FindService |
Source: SOME/IP-SD Protocol Specification, R20-11, sections 4.1.4.1, 4.1.4.2, 4.1.4.3 and 4.1.4.5; Service Discovery, R20-11, section 7.6 (where the protocol text is ambiguous about the first offer of the main phase, the course follows the module specification: one interval after the main phase starts).