Automotive Ethernet

Communication based on Ethernet and IP has been used in the automotive industry for many years, and today this communication technology is increasingly used for data transmission in the car.

motivation

History background

In recent decades, cars have been equipped with more and more features to make driving safer, more comfortable and more environmentally friendly. We are increasingly using electronic components to perform these functions, and at the same time, the need for these electronic components to exchange information is also increasing. Electronic components include electronic control units (ECUs) as well as increasingly powerful sensors and actuators that support autonomous driving.

increasing demand

In addition to traditional driving requirements, the requirements for automotive multimedia and infotainment systems are also becoming higher and higher. For example, there are currently a variety of different audio and video systems that cater to the entertainment needs of vehicle users and passengers. Many vehicles have the ability to connect to a smartphone or other internet-enabled device. Currently, the general trend of increased networking is further affecting these systems and will ultimately increase the requirements on the available bandwidth for in-car data transmission.

Ethernet

In recent decades, Ethernet has proven to be a flexible and scalable network technology in communication systems. One of the main advantages of Ethernet is its support for a variety of physical media, which makes it suitable for automotive applications. Since the physical medium is protocol-agnostic, other transmission technologies can be easily developed or adapted to meet the requirements of the automotive industry. Therefore, Ethernet will be used in future vehicle platforms for a long time.

standardization

IEEE (The Institute of Electrical and Electronics Engineers, American Institute of Electrical and Electronics Engineers)

Since 1980, the IEEE has been responsible for the maintenance and further development of Ethernet. Although various companies may offer proprietary Ethernet solutions and enhancements, in most cases these companies will hand over these solutions and enhancements to the IEEE to ensure that a wider range of application areas are covered and thus gain commercial success. success. Working Group 802 is responsible for Ethernet. Therefore, the numbers of all Ethernet-related standards begin with 802 (such as IEEE 802.1, IEEE 802.2, IEEE 802.3, etc.).

OPEN Alliance SIG

Automotive OEMs and suppliers have formed the OPEN Alliance SIG, which is committed to promoting the further development of Ethernet in the automotive industry. Several technical committees work to create specifications, as well as monitor market penetration and ensure the availability of components, test and analysis tools. OPEN Alliance SIG joins hands with IEEE to transform automotive Ethernet into a universal standard.

IEEE 100BASE-T1 (formerly OABR)

standard

OABR (Open Alliance BroadR-Reach) is a physical transmission technology originally developed by Broadcom and later standardized as IEEE 100BASE-T1 by OPEN Alliance SIG.

physical connection

Twisted pair cables carrying symmetrical differential voltages are used for physical connections. The sender encodes the bit stream to be sent into symbols represented by voltages. The receiver decodes the received symbol stream to obtain the bits contained in it.

image-20230329160324768

image-20230329160338136

Encoding and Decoding

The 4B3B, 3B2T and PAM3 methods are used for encoding and decoding and generating differential voltages. These methods are implemented by the IEEE 100BASE-T1 PHY, integrated in a specific module of the ECU. The PHY establishes the connection between the physical media and the Ethernet controller.

image-20230329160348867

Topology

Each cable connects only two nodes. Therefore, only point-to-point topologies are supported. Some devices can connect more than two nodes, usually switches. As a Layer 2 connectivity device, switches can connect multiple physical connections and forward packets independently between branches.

Full duplex

One of the features of this physical layer is that information can be transmitted bidirectionally using twisted pairs at a speed of 100 Mbit/s, that is, two interconnected nodes can send information simultaneously (full duplex). When acting as a sender, the node will apply its own differential voltage to the twisted pair; when acting as a receiver, the node will subtract its own applied voltage from the total voltage to obtain the voltage sent by the other node. This mechanism is an echo cancellation method and is also used in other Ethernet systems.

Synchronize

In order to calculate the differential voltage, both nodes must know the start time of the new voltage signal. This means that both nodes must synchronize the symbol streams. This problem can be solved using master and slave nodes: the master node generates a continuous symbol stream and the slave nodes synchronize with it. The microcontroller's underlying software configures the PHY as a master or slave node.

IEEE 100BASE-TX

physical connection

For physical connections, IEEE 100BASE-TX typically requires two channels, each with two twisted pairs. Although some Ethernet networks can communicate using a single channel, in practice this rarely happens because these networks only support simplex or half-duplex.

image-20230329154956096

image-20230329154935134

encoding and decoding

Twisted pairs carry symmetrical differential voltages that are used to represent coded symbols. The sender encodes the symbols based on the required bit stream. The receiver decodes the symbol stream to recover the transmitted bits.

Unlike IEEE 100BASE-T1, IEEE 100BASE-TX encodes and decodes and generates differential voltages by using NRZI, 4B5B, and MLT-3 methods. These methods are implemented by the IEEE 100BASE-TX PHY, integrated in a specific module of the ECU. The PHY establishes the connection between the physical media and the Ethernet controller.

Cables and Connectors

Standard Cat5 or Cat5e cable is commonly used for IEEE 100BASE-TX. Of the eight available cables, four cables are required to connect the two channels. The EIA/TIA-568A and EIA/TIA-568B standards define the assignment of twisted pairs, as well as the pin assignments of commonly used RJ45 connectors and receptacles.

Topology

Each cable connects only two nodes. Therefore, only point-to-point topologies are supported. Some devices can connect more than two nodes, usually switches. As a Layer 2 connectivity device, switches can connect multiple physical connections and forward packets independently between branches.

Dual Simplex

If two channels are used to implement IEEE 100BASE-TX, information can be transmitted in both directions at a speed of 100 Mbit/s: one channel is used for transmission and the other channel is used for reception. If the PHY only supports fixed channel assignments, a crossover cable must be used to connect the two nodes. However, most new PHYs currently have an auto-negotiation mechanism that can automatically detect channel usage. Auto-negotiation eliminates the need for crossover cables

IEEE 1000BASE-T

physical connection

For physical connections, IEEE 1000BASE-T requires four lanes with two twisted pairs per lane. Twisted pairs carry symmetrical differential voltages that are used to represent coded symbols.

image-20230329155037064

image-20230329155051265

encoding and decoding

The sender encodes the symbols corresponding to the bit stream. The receiver decodes the symbol stream to recover the transmitted bits. Unlike IEEE 100BASE-T1 and IEEE 100BASE-TX, IEEE 1000BASE-T uses 8B1Q4, Trellis, Viterbi and PAM5 methods for encoding and decoding and generating differential voltages. These methods are implemented through the IEEE 1000BASE-T PHY module integrated in the ECU. The PHY establishes the connection between the physical media and the Ethernet controller.

Cables and Connectors

Standard Cat5e cable is commonly used for IEEE 1000BASE-T. Connecting four channels requires all eight available cables. The EIA/TIA-568A and EIA/TIA-568B standards define the assignment of twisted pairs, as well as the pin assignments of commonly used RJ45 connectors and receptacles.

Topology

Each cable is connected back to two nodes. Therefore, only point-to-point topologies are supported. Some devices can connect more than two nodes, usually switches. As a Layer 2 connectivity device, switches can be connected to multiple physical connections and can independently forward messages between spokes.

full duplex

Thanks to PAM5, two interconnected nodes can send and receive on four channels simultaneously (full duplex). When acting as a sender, the node applies its own differential voltage to the cable; when acting as a receiver, the node subtracts its own applied voltage from the total voltage to obtain the voltage sent by the other node. This mechanism is an echo cancellation method and is also used in other Ethernet systems.

Synchronize

In order to calculate the differential voltage, both nodes must know when a new symbol begins. This means that both nodes must synchronize the symbol streams. This problem can be solved using master and slave nodes. The master node generates a continuous symbol stream to which the slave nodes synchronize. Unlike IEEE 100BASE-T1, the master/slave nodes are not fixed, but negotiate using an auto-negotiation mechanism.

characteristic

basic skills

The second layer of Ethernet communication provides important basic functions for controlling data transmission, including a unified message structure, node addressing and bus access method. All basic functions are implemented in the Ethernet controller, which today is usually an integral part of the microcontroller.

data transmission

Symbols and code rates are for the physical layer, and the second layer transmits Ethernet frames composed of bits. The bitstream is typically transmitted between the Ethernet PHY and the Ethernet controller via the Media Independent Interface (MII). MII is an IEEE standardized interface with multiple variants to meet different transmission speeds.

Bus access method

Before sending a message, the Ethernet controller first listens to the physical medium (carrier sensing) to determine whether another node in the network is sending a message, thereby preventing the message from being overwritten. If the medium is idle, the Ethernet controller starts data transfer.

Because multiple nodes may access the bus simultaneously over Ethernet (multiple access), a conflict may occur on a traditional bus network if two nodes start transmitting at the same time. For this case, the Ethernet controller has a collision detection function for canceling the transmission. To prevent a second conflict, the node must wait for a random time before starting to resend (the backoff process). Each sender must calculate the random time itself.

conflict detection

The complete bus access method is called carrier sense multiple access/collision detection (CSMA/CD), and the related algorithm is implemented in the Ethernet controller. For the physical layer of automotive Ethernet, collision detection plays a secondary role. IEEE 100BASE-T1, IEEE 100BASE-TX and IEEE 1000BASE-T all allow full-duplex data transmission. Therefore, no conflicts will occur on these physical media.

image-20230329155125161

addressing

Node addressing

Node addressing is used for directed delivery of messages in Ethernet. For this purpose, each node has at least one MAC address, which serves as a unique identifier in the local area network (LAN). Transmitted messages always contain source and destination addresses so that the communication node can be inferred.

image-20230329155201397

Unicast

Nodes use unicast addresses as their only means of addressing. The OEM can specify these addresses, or the supplier can choose from their own range of addresses. Regarding obtaining the address range, suppliers can apply or register with IEEE, and then obtain a globally unique address range.

Multicast and Broadcast

In order to deliver messages to multiple nodes, in addition to unicast messages, multicast addresses can also be used. By defining a group of nodes, members of the group can receive messages through a shared MAC address. Unlike broadcast addresses, which allow messages to be sent to all nodes, multicast addresses must be configured in the corresponding nodes.

VLAN (Virtual Local Area Network)

As an extension of classic addressing methods, VLAN addresses are often used in the automotive industry. These address virtual networks exist throughout the network and allow communication to be demarcated. In this way, different domains can be divided for different applications, and members within the domain can communicate with each other. Since an ECU can use or provide multiple applications, it may be a member of multiple domains, and thus may be a member of multiple VLAN networks.

image-20230329155212242

priority

In order to improve real-time behavior, VLAN also provides the option to define packet priorities to ensure that important data is routed through the switch first, thereby reducing delay time.

image-20230329155151519

Ethernet frame

Basic frame and tagged frame

IEEE specifications define different formats of Ethernet frames. The automotive industry often uses Ethernet II frames, which contain extended information that can mark VLANs. Therefore, Ethernet frames can be divided into basic MAC frames (excluding VLAN) and identification MAC frames (including VLAN).

MAC address

Ethernet II frames usually begin with a receiver/destination address, specifying which network nodes will receive the frame. Unlike the sender/source address which can only use a unicast address, the receiver/destination address can also use a multicast or broadcast address. For Ethernet frames, there can be only one sender, but there can be multiple receivers.

Ethernet type

Basic MAC frames and identification MAC frames are distinguished by the type field (Ethernet type). The type field usually identifies the packet contained in the payload data area and provides information about the protocol used in higher layers (such as IPv4). If the value of Ethertype is 0x8100, then the type field is moved back four bytes and a VLAN tag is inserted in its original position.

VLAN tag

VLAN tags consist of protocol identifier (TPID) and control information (TCI). The TPID contains the value of the raw type field, while the TCI consists of a priority (PCP), a drop qualification indicator or canonical format indicator (DEI or CFI), and a VLAN identifier (VID). Identifiers and priorities are mainly used in the automotive industry. Identifiers demarcate respective virtual networks for different application areas. Priority setting allows the switch to optimize running time by forwarding important information first.

payload

Following the field type is the payload data area contained in the Ethernet II frame. The minimum length of the payload is 46 bytes (without VLAN tag) or 42 bytes (with VLAN tag). In the automotive industry, payloads typically can contain up to 1500 bytes.

CRC checksum

The CRC checksum is at the end of the Ethernet II frame. A standard algorithm is used to calculate the checksum, and this algorithm is implemented in the same way in the sender and receiver. The CRC checksum covers all fields of the Ethernet II frame, thus ensuring the integrity of the entire message.

Ethernet packet

In order to transmit an Ethernet II frame, the Ethernet controller inserts a preamble and a start frame delimiter (SFD) at the beginning. The old Ethernet standard uses this as an indicator of the start of transmission. So the Ethernet data packet includes: preamble, start frame delimiter and Ethernet II frame.

image-20230329155237672

image-20230329155248224

image-20230329155257992

characteristic

Advantage

Internet Protocol (IP) supports communications beyond the local area network. To this end, the underlying protocol responsible for actually transmitting data is abstracted, and the target node can be accessed in the same network or across multiple networks (such as UMTS, WLAN, etc.) without adjusting the transmitted data packets.

IP packet

IP packets enable standardized communication, with headers containing destination and source address information. The destination address can be a node address other than the local network. In theory, IP data packets can be addressed to any node around the world.

Router

In order to realize the interconnection of various local area networks, routers are used as connecting devices. A router is a node that belongs to multiple networks at the same time and therefore has multiple IP addresses.

In order to prevent IP data packets from still flowing on the Internet for a long time under error conditions, when the router forwards IP data packets between networks, it will change a parameter in the IP header (TTL (Time To Live) in the IPv4 message). time) and HL (Hop Limit) in the IPv6 packet to count down. When this parameter value is equal to zero, the next router drops the packet.

image-20230329155319093

image-20230329155328422

image-20230329155339942

IPv4 - version 4

Address and Classification

A 32-bit IPv4 address is represented byte-by-byte in dotted decimal notation (such as 192.168.10.1). Years ago, IPv4 address classifications were used to manage the Internet's public address structure. Although these classifications do not have much meaning today, they allow for a basic division of network addresses and host addresses, and thus the number of nodes in the network.

local address

IPv4 addresses have long been allocated. However, local or private addresses can still be used freely, for example in corporate or private networks. These addresses are not accessible over the public network, and routers do not forward local addresses to the Internet unchanged.

Subnet masks

The destination and source node addresses used in the IP data header consist of the high-order (left) network address and the low-order (right) host address. Subnet masks are often used to define where an IP address is divided, which can be expressed as a standalone address (255.255.255.0) or an IP address plus a suffix (192.168.10.1/24). The set bits on the left represent the network address (e.g., 24 bits on the left), while the unset bits on the right represent the host address (e.g., 8 bits on the right).

Multicast and Broadcast

If you want to send IP packets to multiple nodes, you can use a multicast address or a broadcast address. The multicast address must be configured or created through the IGMP protocol, while the broadcast address can be derived from the host address. The maximum value of the host address range always corresponds to the corresponding broadcast address (such as 192.168.10.255).

image-20230329155418712

image-20230329155426217

image-20230329155435244

image-20230329155455044

IPv6 - Version 6

background

IPv6 was mainly developed to solve the shortage of IPv4 addresses and optimize the routing process. Compared to IPv4, the number of fields in the IPv6 header is reduced from 12 to 8.

IPv6 address notation

IPv6 addresses are usually expressed in colon hexadecimal notation: two bytes in hexadecimal format are grouped into a group, and each group is separated by a colon. Four consecutive zeros are usually written as one zero or ignored entirely. Unlike IPv4, there are no broadcast addresses in IPv6. Broadcasting is a special type of multicast.

Example of IPv6 address:

  • 1080:0:0:0:8:800:200C:417A (unicast address)
  • FF01:0:0:0:0:0:0:101 (multicast address)
  • 0:0:0:0:0:0:0:1 (loopback address)

In an IPv6 address, a sequence block containing only 0s or multiple consecutive sequence blocks of all 0s can be expressed by double colon omission, but the omission expression replaced by a double colon can only appear once in an IPv6 address.

  • 1080::8:800:200C:417A (unicast address)
  • FF01::101 (multicast address)
  • ::1 (loopback address)

IPv4 address within IPv6 address

Mixed notation can embed an IPv4 address into an IPv6 address, i.e. a mixture of hexadecimal and decimal values, for example:

  • ::13.1.68.3
  • ::FFFF:129.144.52.38

subnet mask

In an IPv6 address, unless otherwise defined by the subnet mask, generally the first 64 bits of the address are designated as the network address and the last 64 bits are the host address. Because the address space is large enough, IPv6 rarely uses subnet masks.

image-20230329155521865

ARP, NDP, ICMP, IGMP, DHCP

Additional Agreement

To assist and support the execution of tasks, a series of additional protocols run in the background. For example, the automotive industry currently uses the following additional protocols:

DHCP (Dynamic Host Configuration Protocol, dynamic host configuration protocol)

The DHCP protocol can automatically assign IP addresses to one or more nodes. New IP nodes can be automatically integrated into existing networks without manual configuration.

ICMP (Internet Control Message Protocol, Internet Control Message Protocol)

The ICMP protocol is used for control tasks and is part of every IP implementation. A typical application example is ICMP echo request (PING). This command is used to check IP communication between two computers. The requesting node sends a PING message to the target node. If an ICMP echo reply (PONG) is later received, it means that the target node is available.

ARP (Address Resolution Protocol, Address Resolution Protocol)

The ARP protocol is used to determine the correlation between IP and MAC addresses. If an IP node wants to communicate with a target whose IP address is known but not its MAC address, it can request its MAC address. The sending node sends an ARP request containing the target IP to the network broadcast for this purpose. After receiving the ARP response, the MAC address can be saved in the ARP cache for subsequent use.

NDPNeighbor Discovery Protocol, neighbor discovery protocol)

When using IPv6, Neighbor Discovery Protocol (based on ICMPv6) will replace the ARP protocol. The NDP protocol is used for the following purposes:

  • Router Discovery: Identify existing routers in the network
  • Prefix Discovery: Determine the IPv6 address prefixes of local and remote nodes
  • Automatic configuration of IPv6 addresses of network nodes without using DHCP protocol (link-local address generation)
  • Parameter discovery: Set various parameters, such as hop limit

IGMP (Internet Group Management Protocol, Internet Group Management Protocol)

IPv4 systems use IGMP to deliver multicast group membership information to multicast routers.

All hosts that need to receive IP multicast must support this protocol.

image-20230329155552482

image-20230329155601732

image-20230329155611146

image-20230329155620218

image-20230329155631629

characteristic

transport layer

There are two transmission protocols in layer 4 of the 7-layer OSI (Open System Interconnection) model: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). The TCP protocol is a connection-oriented transmission, while the UDP protocol is a connectionless transmission. Both protocols divide the data that needs to be transmitted into smaller parts: called segments in the TCP protocol and datagrams in the UDP protocol.

Because transport protocols support connection-oriented or connectionless transport, they are suitable for different purposes. Depending on the requirements for security and transmission speed, TCP or UDP can be used alone, or a combination of both protocols.

addressing

In order to reach the target node, the data is transmitted through the IP protocol of the third layer. Addressed ports are used to connect specific applications or functions of the upper layer. If the port is open, data can be exchanged through related functions or applications.

image-20230329155707141

image-20230329155716518

UDP protocol: User Datagram Protocol

no connection

The UDP protocol is a connectionless transmission protocol that supports simple datagram transmission. Unlike the TCP protocol, the UDP protocol does not have a mechanism to ensure data transmission. The sender receives no notification that a datagram has been lost or interfered with, and there is no mechanism to allow the datagram to be resent or requested again. However, these functions can be easily implemented in higher layer protocols if needed.

advantage

The advantage of the UDP protocol is that transmission changes are smaller. Unlike the TCP protocol, the sender does not have to wait for feedback from the receiver. Therefore, there is no additional waiting time that could delay the delivery of the datagram.

Another advantage is the ability to send datagrams as multicast or broadcast. This means that UDP datagrams can be sent to multiple nodes or all nodes in the network. Therefore, UDP protocol transmission can reduce the bus load rate in situations where information must be sent to multiple receivers simultaneously.

UDP packet

UDP datagrams are encapsulated in IP packets and sent over IP. In this case, the header of the IP packet indicates that the data contained is a UDP datagram. Because a UDP datagram can contain more data (65,535 bytes) than an IP packet (1,480 bytes), packetization can be used to split the UDP datagram into multiple IP packets.

Subcontract

When a UDP datagram is packetized, each corresponding IP packet contains two identifiers: one to identify the UDP datagram, and another to identify the location of the packetized data within the entire UDP datagram. The receiver can reassemble all packetized data into UDP datagrams. If the IP packet is lost, the receiver will not be able to reassemble the UDP datagram. Since the data is not requested again after the error, all IP packets of incomplete UDP datagrams are discarded by the receiver.

image-20230329155737634

image-20230329155750057

TCP protocol: Transmission Control Protocol

connection oriented

Unlike the UDP protocol, the TCP protocol is a connection-oriented transmission. This means that a connection must be established between the two nodes before actual data transfer. The IP address and port number are used to identify the two nodes respectively.

establish connection

The TCP protocol uses a three-way handshake (three steps) to establish a connection. The node intending to establish a connection first transmits a segment containing the SYN (Synchronize Sequence Number, synchronization sequence number) identifier. The SYN flag indicates that the sender wants to establish a connection with the receiver.

In addition to the SYN flag, the first segment also includes a separate sequence number, window field, and other optional parameters. The sequence number consists of a random number, ISN (Initial Sequence Number, initial sequence number) and a continuous number. Consecutive numbers indicate the position of the currently sent byte in the entire data stream. The receiver orders all segments based on consecutive numbers and reassembles the data stream.

The window field provides information about the node's available memory, ensuring that the sender does not send more data to the receiver than its available memory allows. Because communication is bidirectional, both nodes can communicate their available memory information to the other.

In the second step, the original receiver will send a SYN ACK, including the SYN identifier and the ACK identifier, thereby informing the original sender that it has received the request to establish a connection and makes a positive confirmation. The original recipient also sends its own sequence number. Now that both nodes know each other's information, all future segments used for exchange can be associated to the corresponding sender.

The third (and final) step in establishing a connection is for the original sender to send a confirmation message to notify the other node that the connection has been successfully established. Afterwards, data can be exchanged between the two nodes.

data transmission

Because the TCP protocol requires the establishment of a connection between two nodes, it cannot send broadcast or multicast messages to the network without a specific recipient. Reliable data transmission is only possible through connections, and various mechanisms ensure that the data reaches the recipient and is not corrupted.

CRC checksums are used to protect segment data from corruption during transmission. The sequence numbers mentioned above ensure that the order of segments is known (not affected by arrival order) even if segments sent first arrive at the receiver later.

The ACK number is used to confirm to the sender that each segment has been received, provided no errors were detected. The receiver acknowledges by sending a segment containing an ACK identifier, which indicates that the segment has a valid ACK number. Each segment also contains updated information about the memory available in the window field so that the sender understands how much data can currently be sent to the receiver.

If the sender does not receive a positive acknowledgment within the stipulated time period, the segment is sent again, as this means that the segment failed or did not reach the receiver. This period is determined by a retransmission timer, exists in each segment, and counts down individually. After receiving the positive acknowledgment, the sender will clear the timer corresponding to the segment.

connection release

After all data has been exchanged and positively acknowledged, the connection is closed. To do this, the node sends a segment containing the FIN flag, indicating that the connection has been terminated. The receiver of the FIN segment must respond with an acknowledgment, leaving the connection in a semi-closed state. If the receiver also wants to terminate the connection, it sends a segment containing the FIN flag to the original sender. If confirmed, the connection is terminated and no more data is transmitted.

image-20230329155811185

image-20230329155820865

image-20230329155831978

image-20230329155844460

SOME/IP protocol

background

A new data transmission concept is entering the automotive field through SOME/IP (Scalable service-Oriented Middleware over IP). Classic bus systems (CAN, LIN, FlexRay) use signal-oriented data transmission, while the SOME/IP protocol allows the introduction of service-oriented information transmission. But it should be noted that the SOME/IP protocol is not limited to describing communication. To be precise, SOME/IP is a middleware that affects ECU software components. Therefore, there is a separate software path in AUTOSAR that connects to the application.

Transfer on demand

For signal-oriented data transmission, the sender sends information when needed (such as when data is updated or changed), regardless of whether the receiver in the network currently needs the data. Service-oriented data transfer is different. The sender will only send data when at least one receiver in the network needs the data. The advantage of this transmission method is that the network and all connected nodes are not affected by unnecessary data (causing an increase in load). Therefore, service-oriented data transfer requires that the server be told which recipients are waiting for its data.

Subscription content

Clients can choose to subscribe to service content on the server. If an event occurs, the client will receive updated data from the server. SOME/IP-SD is used for subscriptions to service content. If the client wants to subscribe to content on the server, it sends a message for subscribing to the event group to the server. If the content can be subscribed, the server will send a response to the client with a positive confirmation indicating that the subscription is active. If the subscription content is inaccessible, the server rejects the subscription by sending a negative acknowledgment.

Multiple clients can subscribe to the same service content at the same time. The method used by the server to send data to the client depends on whether the service is sending via UDP or TCP. When using the UDP protocol, if an event occurs, the server can send data to all subscribed clients via unicast, multicast, or broadcast. If content is provided through the TCP protocol, each client must first establish a connection with the server and then send data separately.

Event and field notifications

The content sent by the server based on valid subscriptions comes in two forms: event notifications and field notifications, both of which are event-driven. Event notifications correspond to a form and contain properties that represent snapshots that have no relation to previous events, whereas field notifications contain values ​​related to previous content, thus enabling access to historical values. Therefore, fields can be extended to include getter and setter methods, allowing clients to read and write what they need. This way, the client can read only or read and write the server's content even without a subscription.

method

Another way to exchange data is to call methods. The client triggers the startup of functions on the relevant server by executing remote procedure calls (RPC). The client can call this function by sending a request to the network, and the client's request can also include function-related parameter data. After the server executes the function, it will reply a return value to the client. Typically a client calls a method to indicate that the client wishes to use the generated data. But the client may also call a method on the server that does not return any value. In this case, the client part of the operation is complete when the method is actually called.

service discovery

In order to let the client know what services are currently available, SOME/IP-SD provides two mechanisms for dynamically discovering services: through the "service provision" mechanism, the server can publish all the services it provides to the network; through the "find service" mechanism , the client can request available services.

image-20230329155911377

image-20230329155925224

image-20230329155934343

image-20230329155945480

image-20230329155955092

AVB (Audio Video Bridging, audio and video bridge)/TSN (Time-Sensitive Networking, time-sensitive network)

background

In 2012, IEEE renamed the "Audio-Video Bridge Working Group" to the "Time-Sensitive Networking Working Group". Existing protocol standards continue to be expanded and more functionality added. AVB/TSN supports low-latency and high-quality transmission of streaming data (such as camera data). Since data is not transmitted across network boundaries, at least in cars, IP, TCP and UDP protocols can be dispensed with, and the AVB/TSN protocol is directly based on Ethernet.

The standard on which the AVB/TSN protocol is based can be used over IP, but due to the above mentioned and dynamic response issues, AVB/TSN pursues faster operation inside the car (i.e. skipping IP and directly based on Ethernet). Therefore, dynamic bandwidth reservation protocols using flow reservation protocols are generally not used in automobiles.

components

In AVB/TSN, the data source is called Talker and the data receiver is called Listener. The switch that connects Talker and Listener is called Bridge. Technically speaking, this description is not accurate. In addition to Talker and Listener, the switch must also support the AVB/TSN function, because the switch must be able to support a special MAC multicast address and support the "time-sensitive network forwarding and queuing" function. And change the PTP message.

streaming data

Audio Video Transport Protocol (AVTP) transports data in its payload area, usually video, audio, or control data. If streaming data (audio/video) is transmitted, the AVTP header always contains time information pointing to a moment in the future. Additionally, AVTP uses VLAN-tagged Ethernet frames so that switches can prioritize data. Another quality requirement imposed by AVB/TSN is low latency jitter, with the delay between Talker and Listener being less than 2ms.

When the frame carrying the future time point reaches the Listener, AVTP delivers the frame to the application layer (such as Speaker). In order for this point in time (Presentation time) to occur simultaneously in all receiving nodes, a highly precise synchronization of the nodes is required. The Precision Time Protocol (PTP) is responsible for this work. Currently, most of the simplified versions of the PTP protocol, namely the gPTP protocol, are used.

image-20230329160026578

image-20230329160035373

image-20230329160044955

DoIP (Diagnostic Communication over IP, IP-based diagnostic communication protocol)

background

Ethernet has been used in diagnostics for many years, especially in ECU flashing. This application is very attractive to car manufacturers and parts suppliers because it greatly reduces production and after-sales flashing times.

ISO 13400

ISO 13400 clearly defines IP-based diagnostics. As long as the transmission of IP packets is supported, it makes no difference which physical layer is used. For example, in addition to Ethernet, DoIP can also be implemented based on WLAN and UMTS.

Transfer Protocol

DoIP based on ISO13400 is not a diagnostic protocol, but an extended transmission protocol. This means that although DoIP defines the transmission of diagnostic packets, diagnostic services are still specified and described by diagnostic protocols (such as KWP2000 protocol and UDS protocol).

need

The DoIP protocol requires the support of UDP and TCP. UDP is used for the transmission of status or configuration information, and TCP transmits actual diagnostic data packets through a fixed communication channel. TCP ensures high reliability of data transmission and automatically fragments large data packets. Therefore, the diagnostic tester, the ECU with DoIP diagnostic function (DoIP node), and the diagnostic gateway (DoIP gateway or DoIP edge node) all need to support the TCP/UDP protocol.

diagnostic instrument

In the same way as for diagnostics on conventional bus systems, the diagnostic tool can send diagnostic requests. The tester can take the form of an external device, such as an aftermarket diagnostic or an on-board tester. The ECU processes the diagnostic request and returns the corresponding diagnostic response to the tester. This requires that the bottom layer of each ECU supports the DoIP protocol.

diagnostic gateway

In order to avoid implementing DoIP at the bottom of each ECU, the DoIP protocol allows the use of diagnostic gateways. In principle, all ECUs connected to conventional bus systems in the vehicle are available. The gateway acts as a middleman, forwarding the tester's request to the internal network for reception and processing by the ECU. When a response from the ECU is received, the gateway routes the response back to the tester.

logical address

The diagnostic gateway requires two pieces of information to forward diagnostic requests and responses. First, the gateway requires a logical address to uniquely identify the ECU in the vehicle to be diagnosed. Secondly, the gateway must know which messages on the bus or network will be used to send diagnostic requests and receive diagnostic responses. These two aspects of information must be accurately provided to the ECU so that it can be accessed through the gateway.

diagnostic process

During the diagnostic process, the diagnostic gateway first receives a request from the tester. The request contains a diagnostic data packet, which carries the required diagnostic service and the logical address information of the ECU to be diagnosed. The gateway then extracts the relevant content from the diagnostic packet and packages it into a message that can be sent on the bus or network. For example, if the ECU is to be addressed via the CAN bus, the gateway needs to send a message with the corresponding diagnostic request identifier (such as 0x600) to the bus and then wait for a response from the ECU. After receiving a response from the bus or network (such as a CAN message with identifier 0x700), the gateway will return the response of the original diagnostic service to the tester. The gateway adds the ECU's logical address to the response returned to the tester so that the tester can distinguish and distribute the response. In this way, the tester can send requests to multiple ECUs located on different bus systems and networks without waiting for responses in the order in which the requests were sent.

image-20230329160102840

image-20230329160111897

image-20230329160120544

This article is compiled from the introduction of Automotive Ethernet on VECTOR’s official website. The original link is as follows:

Ethernet_C: Automotive Ethernet learning module (vector.com)

Guess you like

Origin blog.csdn.net/qgccdd061313/article/details/129857303