UDPNM for Vehicle Ethernet Network Management

foreword

First of all, I would like to ask you a few questions, you know:

  • Do you know what the main role of the UdpNm module is?
  • Interaction relationship between UdpNm module and other AUTOSAR basic software modules;
  • How does the network management algorithm and state machine of the UdpNm module work?
  • How does the PNC function of the UdpNm module work?
  • What are the application scenarios of UdpNm?

Today, we will explore and answer these questions together. To make it easier for everyone to understand, the following is an outline of the topics of this article:

insert image description here


text

With the development of in-vehicle Ethernet technology, more and more car manufacturers and suppliers have begun to adopt communication systems based on the TCP/IP protocol stack to improve the performance and reliability of the vehicle's internal network. However, the TCP/IP protocol stack itself does not provide network management functions, that is, it cannot implement functions such as state synchronization between nodes, energy-saving control, and fault detection. In order to solve this problem, the AUTOSAR organization has developed a network management protocol based on the UDP protocol, namely UDP Network Management (UdpNm) .

As shown in Figure 1 below, the positional relationship of UdpNm in the entire AUTOSAR architecture is described:

insert image description here

Figure 1 The relationship between UdpNm and AUTOSAR architecture

It can be seen from the above figure that UdpNm is closely related to the SoAd module and the NM module of the vehicle Ethernet protocol stack, which will be explained one by one later. In addition, UdpNm has the following restrictions in the entire AUTOSAR architecture, as shown in Figure 2 below Show:

  • Only one NM Cluster is allowed to associate with one UdpNm entity in one network;
  • Only one network is allowed to be associated with one UdpNm entity in the same ECU;
  • UdpNm only applies to TCP/IP based systems;

insert image description here

Figure 2 UdpNm constraints

UdpNm application scenarios and features

UdpNm is a network management protocol independent of hardware and physical layer, it can work with the TCP/IP protocol stack to realize the network management function of the system based on TCP/IP. UdpNm mainly has the following characteristics:

  • UdpNm is based on a decentralized direct network management strategy, which means that each network node performs self-sufficient activities based only on UDP packets received or sent within the communication system. UdpNm does not require any central node or master node to coordinate or control other nodes.
  • UdpNm uses the UDP protocol as the transport layer, which makes UdpNm have lower overhead and delay, as well as higher fault tolerance and flexibility. UdpNm does not need to establish a connection or maintain a session state, nor does it need to acknowledge or retransmit data packets.
  • UdpNm supports the local network management function, that is, it can dynamically activate or suppress a Partial Network Cluster (PNC) according to the communication requirements and energy consumption of the nodes. This reduces unnecessary packet transmission, saving network bandwidth and power consumption.
  • UdpNm supports triggered transmission function, that is, it can actively send or receive user data according to the request of the application layer or other modules. This improves the timeliness and reliability of user data.

UdpNm is suitable for various TCP/IP-based automotive Ethernet systems, such as car networking systems, audio and video systems, navigation systems, etc. UdpNm can implement functions such as state synchronization, energy-saving control, and fault detection between nodes in these systems. Common application scenarios are as follows:

  • TCP/IP-based vehicle Ethernet system : UdpNm can work with TCP/IP protocol stack to realize cooperative sleep and wake-up of vehicle Ethernet nodes, improve network efficiency and save energy.
  • Distributed embedded system : UdpNm can be used in UDP-based communication systems, providing adaptation between the network management interface (Nm) and the TCP/IP protocol stack, and realizing status monitoring and control of network nodes.
  • Multimedia application : UdpNm can be used in network systems supporting multimedia data transmission, providing synchronization and coordination functions of network nodes, and realizing quality assurance and optimization of data streams.

How UdpNm works

Before officially introducing the working principle of UdpNm, everyone must have heard of the AUTOSAR CanNM module. This module has been introduced in detail in the previous article " CanNm of AUTOSAR Basics ", so it is necessary to make a comparison between the two. In order to let everyone have a basic understanding of the similarities and differences between the two.

The difference between UdpNm and CanNM

As shown in Figure 3 below, it clearly describes the difference and connection between UdpNm and CanNm:

insert image description here

Figure 3 The difference between UdpNm and CanNm

It can be seen that the entire network management algorithm of UdpNm is basically the same as CanNm, but the variable names of the control parameters are different, and they are essentially the same switching conditions .

Therefore, this article will not describe the network management state machine of UdpNm too much. If you need to know more about it, you can refer to Xiao T's previous article about CanNm "CanNm of AUTOSAR Basics " .

According to UdpNm's own characteristics, the working principle of UdpNm mainly revolves around the following three parts:

  • Network management algorithm : defines how UdpNm switches different network states according to received and/or transmitted UDP packets, and performs corresponding actions, defines how UdpNm determines when to send or receive UDP according to different network states and conditions Data packets, and explain the rules and procedures followed to send or receive UDP data packets. .
  • Message format : defines which fields and information are contained in the UDP data packet used by UdpNm, and explains the meaning and function of each field and information.
  • User data processing : defines how UdpNm performs corresponding data processing according to the application layer or other modules.

Network Management Algorithm

As shown in Figure 4 below, it is a UdpNm-based network management state machine, that is, the corresponding network management algorithm, which describes how to switch between various network states:

insert image description here

Figure 4 UdpNm network management state machine

Consistent with the CanNm network management state machine, the UdpNm module still divides the entire network management state into three main states: Bus Sleep Mode, Prepare Bus Sleep Mode, and Network Mode . Network Mode can be further divided into the following three sub-states:

  • Repeat Message State: the stage of repeatedly sending messages (in the stage of periodically sending NM messages);
  • Ready Sleep State: ready for sleep phase;
  • Normal Operation State: Actively request normal working phase (in the phase of periodically sending messages);

The switching conditions are not described in detail here, and are basically the same as CanNM, except that UdpNm is based on the TCP/IP system, and the function interface called and the configuration parameter name will be different. For example, the function interface called when the Ethernet NM message needs to be sent externally is SoAd_IfTransmit , receiving Ethernet NM messages is obtained through UdpNm_SoAdIfRxIndication .

message format

As shown in Figure 5 below, the message format of the UDP NM message is shown:

insert image description here

Figure 5 UdpNm message format

The key parameters are explained as follows:

  • Source Node Identifier: The default is Byte 0, determined by the parameter UDPNM_PDU_NID_POSITION, you can choose Byte 0, Byte1;
  • Control Bit Vector (CBV): The default is Byte 1, but it can also be determined by the parameter UDPNM_PDU_CBV_POSITION, you can choose Byte0, Byte1;
  • The length of the entire NM message should not exceed the MTU (Maximum Transmission Unit) of the underlying transport layer;

The CBV domain is also very critical to the control of the entire network management state machine, so it is necessary to further analyze the specific meaning of each bit:

insert image description here

Figure 6 UdpNm message format

As shown in Figure 7 below, the specific meanings of each bit in each CBV domain are explained:

insert image description here

Figure 7 Explanation of the meaning of each bit in the CBV domain

User data processing

As shown in Figure 5 above, except for Byte0 and Byte1, other data can be regarded as User data, and the User Data in the NM message can be set through the function interface UdpNm_SetUserData , or through the UdpNm_GetUserData interface.

UdpNm Partial Network Management Function (PNC)

The purpose of local network management is only one, which is to reduce unnecessary communication consumption and save energy. Therefore, it is necessary to understand the local network management function based on UdpNm. Partial Networking Cluster ( PNC for short ) first gives a basic description of the receiving and sending of NM messages:

  • If the configuration parameter UdpNmPnEnabled==FALSE , the UdpNm module will only receive normal NM messages, and will not perform PNC-related processing ;
  • If the configuration parameter UdpNmPnEnabled==TRUE and the PNI bit in the NM message is 0 , the UdpNm module will only receive normal NM messages and will not perform PNC-related processing;
  • If the configuration parameter UdpNmPnEnabled==TRUE and the PNI bit in the NM message is 1 , the UdpNm module will not only receive the normal NM message, but also perform processing related to the PNC;
  • If the configuration parameter UdpNmPnEnabled==TRUE, the UdpNm module will set the PNI bit position 1 in the sent NM message . For local network management, CBV is necessary;
  • If the configuration parameter UdpNmPnEnabled==FALSE, the UdpNm module will set the PNI bit to 0 in the sent NM message ;

PDU filtering algorithm

The NM PDU filtering algorithm uses three configuration parameters UdpNmPnInfoOffset, UdpNmPnInfoLength, and UdpNmPnFilterMaskByte to jointly determine whether there is a PNC request and what type of PNC request it is.

If UdpNmPnInfoOffset == 3 and UdpNmPnInfoLength == 2, it means that only Byte3 and Byte4 contain PNC information, each Bit represents a PNC network, if the corresponding Bit is 1, it means that the corresponding PNC network is requested, if If the corresponding bit is 0, it means that there is no corresponding PNC network being requested.

Through the parameter UdpNmPnFilterMaskByte, you can determine which bits in the PNC in Byte3 and Byte4 are related to this ECU. The bit in MaskByte corresponds to 1, which means that this ECU is related to this PNC, otherwise it is irrelevant, and then decide whether I need to do the corresponding PNC network. deal with.

EIRA Mechanism Logic

For ECUs that need to implement IPDU Group switching according to internal or external PNC requests, the EIRA feature is required, which can implement IPDU Group switching in the ComM module according to received PNC requests.

The full name of EIRA is internal or external request collection, which is used to collect internal and external PN requests of ECU.

If the parameter UdpNmPnEiraCalcEnabled == TRUE, whether it is an internal or external PN request, the PNC bit corresponding to the receiving or sending bus will be set;

For the EIRA mechanism logic, how many EIRA Reset Timers exist depends entirely on how many PNC networks exist, because the PDU Group switching corresponding to EIRA is a global operation for the ECU and has nothing to do with specific physical channels. If there are only 8 PNC networks, but corresponding to 6 physical channels, then there are only 8 PNC EIRA Reset Timers.

Things worth noting are as follows:

  • It is to avoid the internal PNC request from being sent to the bus in time to cause loss, so it is necessary to ensure that UdpNmPnResetTime must be greater than UdpNmMsgCycleTime, and UdpNmPnResetTime must be less than UdpNmTimeoutTime to prevent the PNC Reset Timer from failing when the NM state switches to the Prepare Bus Sleep stage;

  • If the parameter UdpNmPnEiraCalcEnabled == TRUE, the corresponding PNC request change will transfer the EIRA information to the COM module through UdpNm calling the function interface PduR_UdpNmRxIndication, and the COM will transfer it to the ComM module synchronously, and finally complete the switching of the IPDU Group;

  • If UdpNmPnEiraCalcEnabled == TRUE and UdpNmPnEraCalcEnabled == TRUE, the corresponding PNC information will be stored separately.

ERA Mechanism Logic

Compared with EIRA, ERA has fewer internal requests, because this mechanism is mainly used for external PNC requests, that is, for the collection of external PNC requests and the forwarding of PNCs of other channels, mainly for gateway nodes.

If there is a sub-gateway, it is particularly important to note that the received PNC Gateway request cannot be directly mapped and sent back, otherwise the main gateway and the sub-gateway will not be able to sleep. To solve this problem, AUTOSAR introduces the concepts of Active PNC Gateway and Passive PNC Gateway. For Passive PNC Gateway, it will not directly map and send the received corresponding PNC Gateway request.

If the parameter UdpNmPnEraCalcEnabled == TRUE, and the PNC bit in the received NM message is set, subsequent PNC network processing will be performed, such as forwarding to other physical channels, so each channel needs to manage the status of all PNC networks.

For the existence of 8 PNC networks and corresponding to 6 physical channels, there will be 48 ERA Reset Timers, because for the sub-gateways, the received PNC network requests cannot be mapped and sent back, so it is necessary to monitor each The source of the physical channel requested by the PNC.

Other noteworthy items are consistent with the EIRA mechanism.

UdpNm receiving and sending timing relationship

When the UdpNm module sends NM or receives NM, it needs to follow a certain timing relationship. Figure 8 and Figure 9 below clearly describe the timing relationship of the UdpNm module sending and receiving NM messages.

Send timing

As can be seen from Figure 8 below, each time the Message Cycle Timer times out, it will trigger a UdpNm NM message transmission in sequence. The sending interface is implemented by calling SoAd_IfTransmit, and the Message Cycle Timer counter and UDPNM_MSG_TIMEOUT_Timer counter will be reset at the same time .

After confirming that UdpNm is sent successfully, the SoAd module will notify the UdpNm module through the callback function interface UdpNm_SoAdIfTxConfirmation , and then the UdpNm module will reset the UDPNM_MSG_TIMEOUT_Timer counter .
insert image description here

Figure 8 UdpNm NM message sending sequence

Receive Timing

As shown in Figure 9 below, when receiving an NM message from the outside, the SoAd module implements the reception of the NM message through the callback function UdpNm_SoAdIfRxIndication , and also resets the UDPNM_MSG_TIMEOUT_Timer counter .
insert image description here

Figure 9 UdpNm NM message receiving sequence

UdpNm configuration parameter description

As shown in Figure 10 below, Xiao T summarizes the more important configuration parameters as follows for your reference:

insert image description here

Figure 10 UdpNm configuration parameter description

Commonly used function interface description

In order to facilitate your debugging in the software development process, Xiao T lists some of the more important functions of the UdpNm module as follows for your reference, as shown in Figure 11 below:

insert image description here

Figure 11 UdpNm module common function interface

For more exciting content, please pay attention to the official account "My View on ADAS and ECU"!

Guess you like

Origin blog.csdn.net/wto9109/article/details/131056616
Recommended