Automotive Ethernet for Autosar

foreword


        In recent years, in order to make cars safer, smarter, and more environmentally friendly, a series of advanced driver assistance functions have sprung up. Meeting these demands in the future will bring a severe test to the traditional electronic and electrical architecture, requiring more and more electronic components to participate in information interaction, resulting in more stringent requirements for network transmission rate, stability, load rate, etc. challenge.

        In addition, as people's demand for car multimedia and audio-visual systems is getting higher and higher, although there are various audio-video systems at present, with the acceleration of the car electrification process, mobile phones can control vehicles and interact with each other. As the scenarios continue to expand, it is conceivable that the demand for networking in the future will only continue to expand. Whether it is in-vehicle or out-of-vehicle networking demands, the importance of more network bandwidth is unanimously raised.

        To this end, automotive Ethernet came into being. First of all, one of the primary advantages of Ethernet is that it supports a variety of network media, so it can be used in the automotive field; at the same time, because the physical medium has nothing to do with the protocol, it can be adjusted and expanded in the automotive field to form a complete set of automotive Ethernet protocol, which will continue to develop and be used for a long time in the future.

        Today, let's explore the basics of the automotive Ethernet protocol. To make it easier for everyone to understand, the following is an outline of the topics of this article:


text


Development History of Automotive Ethernet


        Since 1980, IEEE, OPEN Aliance SIG, BMW, and Broadcom have played a key role in expanding the application of traditional Ethernet to the automotive field. The important milestone events are recorded as follows:

 

  •         In 1980, Ethernet 1.0 was successfully released;
  •         In 1985, the IEEE 802 group announced the 802.3 protocol and launched the 10M Ethernet technology based on CSMA/CD;
  •         In 2004, BMW considered adopting Broadcom's Ethernet technology and successfully mass-produced the Ethernet flashing technology on the BMW 7 Series in 2008. The key point is Broadcom's single-pair unshielded Ethernet full-duplex technology, and Guarantee all PASS of EMC test;
  •         In 2013, BroadR-reach technology was successfully mass-produced in the surround view system of BMW 5 series;
  •         In recent years, OPEN Aliance SIG, composed of well-known automakers and suppliers, has successively released TC8 (Automotive Ethernet ECU Test Specification) and TC10 (Automotive Ethernet Sleep and Wake Specification). Universal Standard.

Overall Architecture of Automotive Ethernet


        Due to the joint development and cooperation of the above-mentioned IEEE organization, OPEN Aliance SIG organization, AVNU organization, and AUTOSAR organization, the overall architecture of automotive Ethernet conforming to the OSI model has been standardized, as shown in Figure 1 below:

 

Figure 1 Overall Architecture of Automotive Ethernet OSI


        First, a brief introduction to AVNU, IEEE, AUTOSAR and OPEN Aliance SIG organizations in Figure 1 is given, so as to have a clearer understanding of the main contributions and main goals of each organization in the overall architecture of automotive Ethernet.

  • AVNU: Committed to promoting the application of AVB/TSN time-sensitive networks in the automotive field, making Ethernet a time-deterministic real-time network;
  • IEEE: Institute of Electrical and Electronics Engineers, in which the 802.3 working group is committed to promoting the formulation and improvement of Ethernet-related standards;
  • AUTOSAR: Automotive Open System Architecture Organization, which is committed to realizing the decoupling standard between automotive software and hardware, and also made relevant specifications for the automotive Ethernet software level;
  • OPEN Alliance SIG: a non-profit automotive industry and technology alliance aimed at encouraging large-scale use of Ethernet as a vehicle networking standard;

At the same time, it can be seen from the above figure that the "IT" is the traditional Ethernet technical protocol specification, while the " Automotive " is the automotive Ethernet technical protocol specification.

Obviously, except for the five modules of physical layer, UDP-NM, DOIP, SOME/IP, and SD , which are the specifications of the vehicle Ethernet technology protocol, the rest are all traditional Ethernet technologies.

physical layer


Compared with traditional Ethernet, automotive Ethernet only needs to use one twisted pair, while traditional Ethernet requires multiple pairs and more wiring harnesses.

        At the same time, traditional Ethernet generally uses RJ45 connectors to connect, while automotive Ethernet does not specify a specific connector, and the connection method is more flexible and compact, which can greatly reduce the weight of the wiring harness. In addition, the physical layer of automotive Ethernet needs to meet the more stringent EMC requirements in the automotive environment. The transmission distance for unshielded twisted pair cables can reach 15m (shielded twisted pair cables can reach 40m).

        Although the automotive Ethernet only uses a single twisted pair for differential voltage transmission, the 100M/s Ethernet can achieve full-duplex communication through echo cancellation technology . The following table lists the current mainstream physical layer standards:

 

Table 1 Automotive Ethernet physical layer standards


As can be seen from the above table, the current mainstream automotive Ethernet protocols are mainly IEEE 100BASE-T1 and IEEE 1000BASE-T1, 100BASE-T1 can be used for routine use, and 1000BASE-T1 can be selected if higher bandwidth is required.

However, because of the higher rate, the conformance test of the physical layer of the vehicle Ethernet is more stringent.

Among them, all the functions of the physical layer of Ethernet are concentrated in a module called "PHY", which connects the Ethernet controller and the physical medium together, and connects through a standardized interface MII, while the PHY module and the underlying medium are connected through MDI The interface connection is shown as 100BSASE-T1, as shown in Figure 2 below:

insert image description here

 

Figure 2 Physical layer PHY interface structure diagram (source: Vector)


The definition of the module interface is shown in Figure 2 above. The specific content about the PHY module will not be expanded here, and a separate special topic will be provided later, so stay tuned!

data link layer


The data link layer can be subdivided into two levels : LLC (Logic Link Control) and MAC (Media Access Control) . The definitions and functions of these two levels are as follows:

  • LLC: Responsible for providing services to the upper layer, managing data link communication, link addressing definition, etc., has nothing to do with the physical medium used;
  • MAC: Responsible for the encapsulation of data frames, bus access methods, addressing methods, and error control. The existence of the MAC layer can completely isolate the upper layer software from the physical link used, ensuring the unity of the MAC layer;

Among them, the services and services of the LLC sublayer are defined in the IEEE 802.2 LAN protocol, and the main functions of the MAC layer are defined in IEEE 802.3, and adopt the CSMA/CD access control method. realized in.

Ethernet frame format

With the historical development of Ethernet, there are a total of 5 frame formats. Different Ethernet frames have different types and MTU values ​​(maximum transmission data length), and can exist on the same physical medium at the same time.

There are two main Ethernet frame formats widely used at present, namely Ethernet II frame format and IEEE802.3 frame format. Among them, the vehicle-mounted Ethernet mainly adopts the Ethernet II frame format.

  • Complete Ethernet II frame format

insert image description here


Figure 3 Ethernet II frame format

  • Complete IEEE802.3 frame format

 

insert image description here

 


Figure 4 IEEE 802.3 frame format


As can be seen from the comparison between Figure 3 and Figure 4 above, the "Type" position in the Ethernet II frame format is replaced by the " Length " in the 802.3 frame format. The specific meanings of the above different fields are shown in Table 2 below:

insert image description here

 

Table 2 Definition of Ethernet frame fields


In particular, we can further determine the type of the current frame by identifying the "type/length" field. If the value of this field is less than or equal to 0x5DC, then the frame is in IEEE 802.3 format; if the value of this field is greater than or equal to 0x600, then the frame is in Ethernet II frame format .

At the same time, it should be noted that the Ethernet II frame format does not have the concept of LLC sublayer, only the MAC layer handles data services and other content, while IEEE 802.3 can

MAC frame format

For the MAC frame format, it is a complete MAC frame starting from the "target physical address" and ending with "frame check". Figure 4 below shows the complete frame of MAC, including target physical address, source physical address, type/length, data and frame check CRC.

insert image description here

 

Figure 4 MAC complete frame format


In particular, as shown in Figure 4, the "VLAN Tag" field is optional. When there is no VLAN Flag, it is a Basic MAC frame. When this field exists, it is a VLAN MAC frame, that is, the MAC frame can be divided into basic MAC frames ( No VLAN) and tagged MAC frame (including VLAN).

The "Type" field can usually be of the following types, and the type list is maintained by the IEEE organization. Table 3 below lists the commonly used Ethernet Types in the automotive Ethernet field:

insert image description here

 

Table 3 Common types of automotive Ethernet


MAC addressing mode

As the fixed address of each Ethernet interface, the MAC address is generally fixed by the supplier and cannot be changed. The length of the address is 6Byte , such as 00-17-4F-08-78-88, where the first 3 bytes are the organization number, as shown in Figure 5 below, which shows the addressing mode and byte definition of the MAC address:

insert image description here


Figure 5 MAC addressing mode (source: Vector)


As shown in the figure above: the first 3 bytes are the unique identification number of the organization, which is assigned to the network card manufacturer by IEEE, where Byte5/Bit1 indicates whether the MAC address is a global address or a local address, and Byte5/Bit 0 is used to indicate that the frame is Multicast MAC address, unicast address or broadcast address;

 

  • 0: Unicast address (1 to 1), received by ordinary terminal equipment;
  • 1: Multicast address (1-to-many), only the switch will receive it, and ordinary terminal equipment will not receive it;
  • All 48 bits are 1: it is a broadcast address, and all devices will receive it;

MAC VLAN

As a technical means of segmenting broadcast domains, VLAN can effectively reduce unnecessary network overhead. It is called virtual local area network technology. There are many ways to divide the broadcast domain by this technology. Here we only briefly introduce the MAC-based dynamic VLAN technology, as shown in Figure 6 below:

insert image description here

 

Figure 6 MAC-based dynamic VLAN technology (source Vector)


As shown in the figure above, ECU1 and ECU2 are classified as belonging to the same VLAN1, while ECU2 and ECU4 are classified as belonging to the same VLAN2. You only need to configure the VLAN to which each ECU belongs in advance. The advantage of MAC-based VLAN is that even if the connection port or switch is changed, it can be automatically re-identified without repeated configuration. It is mainly used for DHCP or ARP protocols to send broadcast frames. Scenes.

As mentioned above, MAC frames can be divided into two types: basic MAC frames (without VLAN) and tagged MAC frames (including VLAN) . The minimum length is 46Byte without VLAN tag and 42Byte with VLAN tag, because VLAN Tag occupies 4 bytes, and the maximum data length is 1500Byte.

Figure 7 below shows the meaning of VLAN Tag:

insert image description here

 

Figure 7 VLAN Tag definition description (source: Vector)


As shown in Figure 7 above, VLAN Tag can be divided into the following three parts:

  • PRI(3Bit) : Frame priority, which is commonly referred to as 802.1p;
  • CFI(1Bit) : Specification identifier, 0 is the specification format, used for 802.3 or Ethernet II Ethernet frame;
  • VLAN ID : It is the identifier ID of VLAN;


Network layer


The network layer is the layer where the IP protocol is located. The IP protocol can be divided into IPV4 and IPV6. The commonly used one is mainly IPV4. The main function of the IP protocol is to forward packet data based on the IP address.

At the same time, IP is also a packet switching protocol, but IP does not have an automatic retransmission mechanism, even if the data does not reach the destination, it will not be retransmitted, so the IP protocol is an unreliable protocol.

The automotive Ethernet mainly uses the IPV4 protocol, and because this protocol also belongs to the traditional Ethernet category, so I will not elaborate on this module in too much detail.

IPV4 protocol header

insert image description here


Figure 8 IPV4 protocol header


It can be seen from the above that the IP header is 20Byte.

 

Each part of the protocol header is explained as follows:

insert image description here

 

Figure 9 IPV4 protocol header information table


IPV6 protocol header

insert image description here


Figure 10 IPV6 protocol header information table


It should be noted that the IPv6 datagram is four times that of IPv4, and the IPv6 datagram mainly consists of two parts: Header (header) and Payload (load). Among them, the size of IPv6 Header is twice that of IPv4. Each part of the protocol header is explained as follows:

 

insert image description here

 

Figure 11 IPV6 protocol information table


transport layer


The protocol of the transport layer is TCP/UDP . These two protocols are independent of each other, and can also exist at the same time, depending on the specific usage scenario requirements. As a standard protocol of traditional Ethernet, TCP/UDP will not be expanded too much here, and the characteristics and differences between TCP and UDP will be introduced as a whole.

  • TCP protocol
  •         TCP protocol header
  • insert image description here

 

Figure 12 TCP protocol header


The following figure 13 shows the field explanation of the TCP protocol header:

insert image description here

 

Figure 13 TCP protocol header information table

  • TCP connection establishment process

TCP is a connection-oriented and reliable network communication. Therefore, to establish a communication connection between the communicating parties, Ethernet communication must go through what we often call a "three-way handshake". Figure 14 below shows the TCP "three-way handshake" connection process.

insert image description here

 

Figure 14 TCP "three-way handshake" process

  • TCP disconnection process

If the two parties already connected by TCP need to disconnect, they need to “wave four times”** to complete the process”, as shown in Figure 15 below:

insert image description here

 

Figure 15 TCP "Four Waves" process

  • TCP Protocol Features

From the above TCP connection establishment and disconnection process, it is not difficult to conclude that TCP is a connection-oriented and reliable transport layer protocol. The specific summary has the following characteristics:

  • Connection-oriented;
  • Only supports unicast transmission, point-to-point mode, does not support multicast or broadcast mode;
  • Oriented to byte stream;
  • reliable transmission;
  • Provide congestion control;
  • Full-duplex communication;

UDP protocol

The full name of UDP is the User Datagram Protocol. It is used to process data packets in the same way as the TCP protocol in the network. It is a connectionless protocol. At the same time, UDP has the disadvantages of not providing data packet grouping, assembling and sorting of data packets, that is to say, after the message is sent, it is impossible to know whether it has arrived safely and completely.

  • UDP protocol header

The following figure shows the composition of the UDP protocol header:

insert image description here

 

Figure 16 UDP protocol header


As shown in the figure above, the UDP header is 8Byte .

The specific meaning of each field is shown in the table below:

insert image description here

 

Figure 17 UDP protocol field information table

  • Features of UDP protocol

Compared with the TCP protocol, UDP has the following characteristics:

  • It is connectionless, that is, it can communicate directly without establishing a connection;
  • There are unicast, multicast and broadcast functions;
  • UDP is packet-oriented, and UDP packets will not be split or reassembled after passing through the IP layer;
  • Unreliability: Since there is no mechanism such as TCP congestion control and automatic retransmission of errors, the five treasures of the sent message will guarantee whether the receiver will receive it, because there are many uncertainties in the network itself;

The difference between TCP and UDP

As shown in the figure below, it clearly explains the difference between TCP and UDP, which provides a criterion for us to choose which transport layer protocol to choose.

insert image description here


Figure 18 UDP and TCP difference relationship table

  • TCP provides connection-oriented and reliable services to the upper layer, and UDP provides connectionless and unreliable services to the upper layer;
  • Although UDP is not as accurate as TCP transmission, it can also make a difference in many places with high real-time requirements;
  • If the data accuracy is high and the speed can be relatively slow, TCP can be used.

application layer


In the field of automotive Ethernet, the current mainstream application protocols mainly include UDP-NM, DOIP, Some/IP, SD , and ICMP, ARP, DHCP and other protocols supported by traditional Ethernet .

In this article, I will not expand on these protocols in detail, because each protocol has a lot of content, and I will explain and share these application layer protocols in the future, so please pay more attention.

As shown in Figure 19 below, I enumerate the basic characteristics and application scenarios of these application protocols for automotive Ethernet to give you an overall understanding.

insert image description here

 

Figure 19 Overview of Automotive Ethernet Application Layer Protocols

Supongo que te gusta

Origin blog.csdn.net/qq_42700289/article/details/131216505
Recomendado
Clasificación