I. Introduction to Automotive Ethernet Bus
1.1 Ethernet makes connection easier
Ethernet technology is used everywhere in our daily life. The daily computer and mobile Internet access are inseparable from Ethernet. The 5G Internet of Vehicles, V2X, and the intelligent applications of cars in the future are all inseparable from Ethernet technology.
1.2 The biggest advantage of automotive Ethernet: high bandwidth and high maturity
The popularity of automotive Ethernet mainly relies on two advantages of Ethernet: high bandwidth and high maturity. The bandwidth of automotive Ethernet is currently 100M or 1000M, and it can even reach 2.5G, 5G, and 10G bandwidth as technology develops.
At present, industrial Ethernet can reach 100G bandwidth. The application of industrial Ethernet to automotive Ethernet mainly solves the EMC problem in automobiles. There is no need for separate verification or technical problem research. It is equivalent to being directly applied, which is very beneficial to the development of automotive Ethernet. Therefore, the maturity of automotive Ethernet is relatively high, which is also an important reason for the widespread application of automotive Ethernet.
The development of automotive technology has significantly increased the demand for Ethernet:
1) With the emergence of high-computing-power, multi-functional, centralized intelligent ECUs, the flashing rate and iteration speed must be fast;
2) Advanced intelligent driving has put forward higher requirements for latency and bandwidth;
3) New energy battery replacement, wireless flexibility to meet the WIFI needs of battery replacement stations;
4) Intelligent car networking, ultimate cockpit enjoyment, consumer & automotive integration
Reduce costs and increase efficiency, use Ethernet AVB/TSN technology to achieve video transmission, and save the cost of LVDS dedicated wiring harnesses.
1.3 Common Ethernet Harness Classification
A pair of twisted wires
Two twisted pairs
OBD external communication usually uses four pins 3, 11, 12, and 13, plus a pin 8 for DOIP activation. Among them, 3, 11, 12, and 13 are used for data transmission. These four pins use two pairs of twisted pair cables, and these four wires are connected to four of the external network cables to achieve data transmission with the diagnostic instrument or PCG.
Four twisted pairs (wire sequence is divided into T568A and T568B)
The above picture shows a common network cable. The network cable uses four pairs of twisted pairs. Generally, a 100M network will use 1, 2, 3, and 6. The four pins of the OBD port must be matched one by one with the four wires in the network cable to communicate outside the vehicle.
II. Automotive Ethernet Protocol Analysis
2.1 Ethernet Classic OSI (Open System Interconnect) Seven-Layer Model, Published by ISO
The Ethernet classic OSI seven-layer model and its corresponding explanation are shown in the figure above. The TCP/IP five-layer model is also listed for comparison. In comparison, OSI and TCP/IP essentially describe the same thing, except that OSI breaks down the top application layer of TCP/IP into three layers and gives a detailed functional description, which is convenient for deepening understanding. However, in actual learning and implementation, the TCP/IP five-layer model is more often used.
OSI model protocol distribution
2.2 Ethernet frame structure
The Ethernet frame structure is shown in the figure above. The Ethernet message frame we can capture starts from the target MAC address to the IP datagram. The preceding preamble and frame start mark have been parsed before the packet is captured, and there is a frame spacing between frames.
Therefore, an Ethernet frame consists of a destination MAC address, a source MAC address, a frame type, and an IP datagram. The IP datagram has a specified length, ranging from 46 bytes to 1500 bytes. Therefore, Ethernet has a maximum frame and a minimum frame:
1) Ethernet maximum frame:
6+6+2+1500+4=1518 bytes
2) Ethernet minimum frame
6+6+2+46+4=64 bytes
2.3IP and subnet mask: Subnet mask cannot exist alone, it must be used in conjunction with IP address
1) The function of subnet mask: it divides an IP address into two parts: network address and host address.
2) For example, 192.168.1.1/24 or 192.168.1.1, 255.255.255.0, then the number of hosts is 2^8-2=254
Ethernet routing example:
Take PC accessing Baidu as an example. For PC, it doesn’t know or care about
Whether it is in Beijing or Shenzhen, it only needs to do routing according to its default gateway and know where to send the IP. It is like when we send a courier to Beijing, after the courier picks up the package from this area, he does not need to know the specific route to Beijing.
He only needs to send the object to the next gathering point, just like a relay. This is the concept of Ethernet communication. Therefore, when designing Ethernet communication, you need to consider to whom the information is sent.
Computer obtains network card IP information
2.4 Ethernet DOIP Protocol
The above picture shows a captured DOIP message. Please note that the frame in the picture does not include the preamble, frame start character, and CRC check part. These have been stripped off, especially the CRC check. If this frame can be captured, it means that the CRC check must have passed.
The entire DOIP message in the figure has a total of 69 bytes, which are:
14-byte data label layer, including 6 bytes of source MAC, 6 bytes of destination MAC, 2 bytes of frame type,
and then IPV4. Generally, the default is 20 bytes. In some cases, there will be some additional option fields, which may be more than 20 bytes. This situation is rarely used, so you can just understand it.
Next is TCP, which also defaults to 20 bytes, and in rare cases may have additional option bytes.
The DOIP protocol has an 8-byte header. Note that the header does not contain a logical address.
The above is the frame structure of the DOIP protocol
2.5 Ethernet SOMEIP Protocol
The SOMEIP protocol frame structure is shown in the figure above. SOMEIP is a protocol commonly used in SOA. The SOMEIP frame structure is similar to the DOIP frame structure. The front part is basically the same. The SOMEIP message header has 16 bytes, including Service ID, Method ID, length, etc.
Different SOMEIP requests or messages require different parsing of their payloads, because different OEMs have different payload definitions, and some additional plug-ins may be needed for parsing.
III. Application Scenarios of Automotive Ethernet
3.1 DoIP Application
DOIP protocol data format
The diagnostic instrument communicates with the gateway through DOIP, from the internal gateway to the internal, including four situations:
1) CAN ECU: The diagnostic instrument establishes a DOIP link with the gateway and performs ECU diagnosis through gateway protocol conversion;
2) Intelligent ECU: The diagnostic instrument establishes a DOIP link with the gateway and performs ECU diagnosis through the gateway protocol brick-mixing;
3) Smart ECU: Gateway agent: The diagnostic instrument establishes a DOIP link with the gateway, and the gateway establishes 1) a DOIP link with the smart ECU to perform ECU diagnosis;
4) Smart ECU: Gateway penetration: The diagnostic instrument establishes a DOIP link with the smart ECU to perform ECU diagnosis.
Example of DOIP application process
Example of DOIP application process
3.2 Application of Port Mirroring
Mirroring means copying a message from a specified source to a destination port. The specified source is called a mirror source, the destination port is called an observation port, and the copied message is called a mirror message.
Mirroring can copy a message without affecting the normal processing of the original message by the device, and send it to the monitoring device through the observation port to determine whether the services running on the network are normal.
Mirror port: the port through which the original message passes
Observation port: the port for connecting monitoring equipment, usually the OBD port on the vehicle
Principle: PC can be connected through OBD, and the port mirroring function can be turned on through diagnostic instructions to capture the communication message from ECU1 to ECU2 for analysis and problem solving.
IV. Project Experience of Automotive Ethernet
4.1 Considerations for the implementation of in-vehicle Ethernet
When designing a vehicle with in-vehicle Ethernet, it is necessary to know the physical characteristics of Ethernet communication to determine the selection direction of wiring harnesses and plug-ins:
1) Choose shielded or unshielded cable based on your needs (cost and length)
2) The selection of wiring harness requires reference impedance and S parameters, and is subject to TC2/9 specification constraints
3) The pull-off force has requirements on the supplier's production and crimping process
4) Performance testing can be performed with PHY to test latency and frame loss rate
4.2 Wireless WIFI Communication Optimization Optimization 1: Channel Management
Optimization 1: Channel Management
When everyone is sending signals or transmitting data at the same time, it means that there is mutual interference between the devices. For example, when everyone is surfing the Internet in the office at the same time, the same network sometimes works well and sometimes doesn't work well. This may sometimes cause a lot of interference.
In this case, channel management is required, that is, channels must be staggered. Generally, there are about 11 channels in China, from channel 1 to channel 11, and there must be 5 channels between channels to avoid interference.
Previous article:Minimizing Noise and Power Consumption in Automotive Audio Systems with SigmaDSP
Next article:What to consider when designing an automotive Ethernet firewall
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Silicon Labs EFM32PG22 Development Kit enables you to create whatever you want! Application in progress!
- Verilog state machine programming skills
- Review summary: Qinheng RISC-V core BLE 5.3 wireless MCU CH582
- MSP-EXP430F5529LP Development Board 002-GPIO Library Function
- Lederui specializes in Type-C interface and HOST solution for laptops/tablets
- Domestic FPGA Gaoyun GW1N-4 series development board evaluation - unboxing + hardware part 2
- Please help me take a look at this strange MICRO BIT board
- Free simulation software SimulIDE
- Many branches of MicroPython
- Choosing Machine Learning Processors at the Edge