Getting started with car Ethernet in one article, vomiting blood and finishing! Do not look sorry!

foreword

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

In addition, with the increasing demand for car multimedia and audio-visual systems, although there are various audio and video systems, mobile phones can control vehicles and interact with each other with the acceleration of automobile electrification. With the continuous expansion of the scenarios, it is conceivable that the demand for networking will only continue to expand in the future. The networking requirements both inside and outside the car all raise the importance of more network bandwidth.

To this end, in-vehicle 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 The protocol will continue to develop and be used for a long time in the future.

Today, let's explore the basics of the in-vehicle Ethernet protocol . For ease of understanding, here is an outline of the topic of this article:
insert image description here


text

The development history of in-vehicle Ethernet

Since 1980, IEEE, OPEN Alliance SIG, BMW, Broadcom, etc. have played a key role in the application expansion of traditional Ethernet to the automotive field. The important milestones 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 using Broadcom's Ethernet technology and successfully mass-produced Ethernet flashing technology on 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, the OPEN Alliance SIG , which is composed of well-known automobile manufacturers and suppliers, has successively released TC8 (vehicle Ethernet ECU test specification) and TC10 (vehicle Ethernet sleep -wake specification). common standard.

Vehicle Ethernet Overall Architecture

Due to the common development and cooperation of the above-mentioned IEEE organization, OPEN Alliance SIG organization, AVNU organization, and AUTOSAR organization, the overall architecture of the vehicle Ethernet conforming to the OSI model is standardized, as shown in Figure 1 below:

insert image description here

Figure 1 Overall architecture of vehicle Ethernet OSI

First of all, a brief introduction is given to the AVNU, IEEE, AUTOSAR and OPEN Aliance SIG organizations in Figure 1, so that we can clearly understand the main contributions and main goals of each organization in the overall architecture of the vehicle 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, of which the 802.3 working group is committed to promoting the formulation and improvement of Ethernet-related standards;
  • AUTOSAR: The automotive open system architecture organization, dedicated to realizing the decoupling standard between automotive software and hardware, and also making relevant specifications for the automotive Ethernet software level;
  • OPEN Alliance SIG: a non-profit automotive industry and technology alliance that aims to encourage the large-scale use of Ethernet as a standard for the Internet of Vehicles;

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

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

physical layer

Compared with traditional Ethernet, in-vehicle Ethernet only needs to use one pair of twisted-pair cables, while traditional Ethernet requires multiple pairs and more wiring harnesses.

At the same time, traditional Ethernet is generally connected using RJ45 connectors, 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 vehicle Ethernet physical layer needs to meet the more stringent EMC requirements in the vehicle environment, and the transmission distance for unshielded twisted pair cables can reach 15m (shielded twisted pair cables can reach 40m).

Although in-vehicle Ethernet only uses twisted-pair cables with single-pair differential voltage transmission, 100M/s Ethernet can realize full-duplex communication through echo cancellation technology . The following is a list of the current mainstream physical layer standards in tabular form:

insert image description here

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. For routine use, 100BASE-T1 can be used. If higher bandwidth is required, 1000BASE-T1 can be selected.

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

The functions of all physical layers of Ethernet are all concentrated in a module called " PHY ", which connects the Ethernet controller and the physical medium, and is connected through a standardized interface MII , while the PHY module and the underlying medium are connected through MDI Interface connection, as shown in 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 of the PHY module will not be expanded here. It will be explained separately in the future, so stay tuned!

data link layer

The data link layer can be subdivided into two layers, 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 upper layers, managing data link communications, link addressing definitions, etc., regardless of the physical medium used;
  • MAC: Responsible for data frame encapsulation, bus access mode, addressing mode and error control, etc. 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;

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 the CSMA/CD access control method is adopted. The general MAC layer protocol is commonly known as "network card". 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 widely used Ethernet frame formats, namely Ethernet II frame format and IEEE802.3 frame format. Among them, the vehicle Ethernet mainly adopts the Ethernet II frame format.

  • Full 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 judge the type of the current frame by judging the "type/length" field. If the field value is less than or equal to 0x5DC, then the frame is in IEEE 802.3 format; if the field value is greater than or equal to 0x600, 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, etc., while IEEE 802.3 can

MAC frame format

For the MAC frame format, it starts from "target physical address" and ends with "frame check" as a complete MAC frame. As shown in Figure 4 below, the complete frame of the MAC includes the destination 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, a MAC frame can be divided into basic MAC frames ( No VLAN) and tagged MAC frames (including VLAN).

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

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 address length is 6Bytes , such as 00-17-4F-08-78-88, of which the first 3 bytes are the organization number, as shown in Figure 5 below for 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 common terminal equipment;
  • 1: Multicast address (1-to-many), only the switch will receive it, and ordinary terminal devices will not receive it;
  • 48 bits are all 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 . There are many methods for dividing 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. It is only necessary 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 repeating the configuration. It is mainly used for DHCP or ARP protocol to send broadcast frames. Scenes.

As mentioned above, MAC frames can be divided into 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.

As shown in Figure 7 below, the meaning of VLAN Tag is explained:

insert image description here

Figure 7 Definition of VLAN Tag (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 frames;
  • VLAN ID: is the identifier ID of the 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 most commonly used is IPV4. The main function of the IP protocol is to forward packet data based on IP addresses.

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.

In-vehicle Ethernet mainly uses the IPV4 protocol, and since this protocol also belongs to the category of traditional Ethernet, it will not elaborate on this module.

  • 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 .

The various parts of the protocol header are 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 4 times that of IPv4, and the IPv6 datagram is mainly composed of two parts: Header (header) and Payload (load). Among them, the size of IPv6 Header is twice that of IPv4. The various parts of the protocol header are explained as follows:

insert image description here

Figure 11 IPV6 protocol information table

transport layer

The protocol of the transport layer is TCP/UDP . The two protocols are independent of each other, and can also exist at the same time, depending on the specific usage scenario requirements. As the 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

    Figure 13 below shows the field interpretation 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, in order to establish a communication connection between the two parties, the Ethernet communication must be opened after the " three-way handshake " that we often call. Figure 14 below shows the TCP's "three-way handshake" connection process.

insert image description here

Figure 14 TCP "three-way handshake" process
  • TCP disconnection process

    If the two parties that have been connected by TCP need to be disconnected, 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
  • Features of the TCP protocol

    From the above-mentioned process of establishing a connection and disconnecting a connection with TCP, it is not difficult to conclude that TCP is a reliable connection-oriented 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 Data Packet Protocol. It is used to process data packets in the same network as the TCP protocol. It is a connectionless protocol. At the same time, UDP has the disadvantage of not providing packet grouping, assembly and sorting of packets, that is to say, after a packet is sent, it is impossible to know whether it arrives 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 following table:

insert image description here

Figure 17 UDP protocol field information table
  • UDP protocol features

    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 undergo any splitting or reassembly through the IP layer;
    • Unreliability: Since there is no mechanism such as TCP congestion control and automatic retransmission of errors, it will cause the five treasures of sent messages to ensure that the recipient receives them, because there are many uncertainties in the network itself;
  • Difference between TCP and UDP

    As shown in the figure below, the difference between TCP and UDP is clearly explained, which allows us to choose which transport layer protocol to provide a criterion for judgment.
    insert image description here

    Figure 18 Difference between UDP and TCP
    • TCP provides connection-oriented reliable services to upper layers, and UDP provides connectionless unreliable services to upper layers;

    • 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 selected.

application layer

In the field of in-vehicle Ethernet, the current mainstream application protocols involved mainly include UDP-NM, DOIP, Some/IP, SD and traditional Ethernet protocols such as ICMP, ARP, and DHCP .

In this article, I will not specifically expand on these protocols, because each protocol has a lot of content, and I will specifically 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 function scenarios of these application protocols of automotive Ethernet to give you an overall understanding.

insert image description here

Figure 19 Overview of Automotive Ethernet Application Layer Protocols

If you want to get the relevant information of " Vehicle Ethernet" in this article , and more exciting information, please scan the code and follow the public account " My Views on ADAS and ECU ", and reply to the keyword " Ethernet Introduction" in the background of the public account to get it!
insert image description here

Guess you like

Origin blog.csdn.net/wto9109/article/details/120211745