以太网SOME/IP协议解读
-
在以CAN总线为主的车载网络中,通信过程是面向信号的(除了诊断通信之外),这是一种根据发送者需求实现的通信过程,当发送者发现信号的值变化了,或者发送周期到了,就会发送信息,而不考虑接收者是否有需求。
-
而SOME/IP则不同,它是在接收方有需求的时候才发送,这种方法的优点在于总线上不会出现过多不必要的数据,从而降低负载。
-
在车载网络中,某个ECU有时会需要调用实现在其他ECU上的个服务,这个时候它俩就分别扮演了client和server的角色,而SOME/IP就是实现这种远程服务调用的接口。




-
消息ID:服务ID和事件/方法ID的组合
-
Length:包含从请求ID到SOME/IP消息结束的长度(以字节为单位)
-
请求ID:允许提供者和订阅者区分同一方法、事件、getter或setter的多个并行使用
-
协议版本:包含SOME/IP协议版本的8位字段
-
接口版本:包含服务接口主要版本的8位字段
-
消息类型:用于区分消息类型
-
返回码:用于指示请求是否已成功处理。
-
REQUEST (期待响应的请求)
-
REQUEST_NO_RETURN(不期待响应的请求)
-
NOTIFICATION(事件通知)
-
RESPONSE(响应消息)
-
ERROR(报错消息)









状态
|
服务端行为
|
客户端行为
|
Down
|
Service不可用
|
服务未被应用请求,则停留在该状态;收到OfferService,启动TTL计时器,此时服务若被应用请求,进入Main;
|
Init
|
进入条件:
服务准备完毕;During:收到Find Service报文后服务端忽略此消息;退出条件:服务不可用进入Down ;INITIAL_DELAY,当定时器超时进入Repetition。 |
进入条件:
服务被请求后进入此阶段;During:等待INITIAL_DELAY时间;退出条件:如果收到OfferService,取消计时器,进入Main ;服务请求释放进入Down ;计时器超时发送第一个Find service,进入Repetition。 |
Repetition
|
作用:
让客户端快速找到有哪些Service,During:收到某客户端的FindService,会延迟一定时间后,发送单播OfferService给服务请求端;收到SubscribeEventgroup后,发送单播Ack/Nack,启动此订阅Entry的TTL计时器;如果收到StopSubscribeEventgroup,停止此订阅Entry的TTL计时器;退出条件:如果服务不可用,离开此阶段进入Down ,并发送StopOfferService通知所有客户端。 |
作用:
重复发送Find service;退出条件:收到Offer Service,停止发送计数和计时,立即进入Main触发发送SubscribeEventgroup;服务请求被释放,进入Down ,有订阅,则发送StopSubscribeEventgroup。 |
Main
|
作用:
周期性发OfferServie;During:收到某客户端的FindService,不影响发送计数,发送单播OfferService给服务请求端;收到SubscribeEventgroup后,发送单播Ack/Nack,启动此订阅Entry的TTL计时器;收到StopSubscribeEventgroup后,停止此订阅Entry的TTL计时器;退出条件:服务不可用,离开此阶段进入Down,并发送StopOfferService。 |
作用:
不周期发送Find Service,不必要负载;During:收到Offer Service,触发发送SubscribeEventgroup;收到StopOfferService,则停止所有计时器;退出条件:服务请求被释放,进入Down Phase;若有订阅,则发送StopSubscribeEventgroup。 |


-
请求/响应(R/R)通信







编辑推荐
最新资讯
-
测迅乌镇&盐城测试场:助力智能网联汽车标
2025-02-22 12:39
-
使用示波器对三相电机驱动器进行测量
2025-02-22 12:37
-
上汽集团大乘用车重磅招聘
2025-02-22 12:25
-
GB/T 44173-2024对开门预警DOW的要求
2025-02-22 12:25
-
声音工程:像用PS一样编辑声音
2025-02-21 17:04