Uncover the mysterious veil of real-time Ethernet

When it comes to real-time Ethernet, most engineers are unfamiliar and what is real-time? Why is it real time? In fact, it is a veil, and today we will uncover it for you!

The Ethernet that most engineers usually touch is basically the TCP protocol. Because the Ethernet TCP protocol is more advanced than the UDP protocol, the reason is that data is not easily lost in the transmission process, but many real-time Ethernets in the industry are not based on the connected UDP protocol. Why? Let us first look at their differences.

1.1 1. Basic Features of TCP and UDP

1.1.1 1.1 TCP (Transmission Control Protocol)

TCP (Transmission Control Protocol) is a connection-oriented protocol, that is, a reliable connection must be established with the other party before sending and receiving data. A TCP connection must be established after three handshakes.

TCP connection three-way handshake process

1. Host A sends a data segment containing the flag bit of the synchronization sequence number to Host B, and requests Host B to establish a connection. Through this data segment, Host A tells Host B two things: I want to be with you. Communication; you can use which serial number as the starting data segment to respond to me. ;

2. After receiving the request from host A, host B responds to host A with a data segment with an acknowledgement (ACK) and synchronization sequence number (SYN) flag, and also tells host A two things: I have received you. Request, you can transfer the data; you need to use which serial number as the starting data segment to respond to me;

3. After receiving this data segment, Host A sends a confirmation response confirming that it has received the data segment of Host B: "I have received the reply, I am now starting to transfer the actual data;

This 3 handshake is complete, and Host A and Host B can transfer data. As shown in Figure 1.

Figure 1 TCP establishes a connection 3 handshake process

TCP disconnects the four-way handshake process

TCP establishes a connection for 3 handshakes, and disconnects 4 times;

1 . After the host A completes the data transmission, the control bit FIN is set to 1, and a request to stop the TCP connection is made;

2. Host B responds after receiving the FIN, confirms that the TCP connection in this direction will be closed, and sets ACK to 1;

3 . The B-side then proposes the closing request in the opposite direction, and sets FIN to 1;

4. Host A confirms the request from host B, sets ACK to 1, and ends the shutdown in both directions.

as shown in picture 2.

Figure 2 TCP handshake disconnected 4 handshake process

It can be seen from TCP's three-way handshake and four disconnections that TCP uses a connection-oriented communication method. In order to improve the reliability of data communication, a complex verification process is added in addition to the communication effective data, thereby increasing the network. The load and system overhead reduce the efficiency of communication. In the event of an abnormal disconnection during the communication process, it is necessary to disconnect the connection and release the resources before re-establishing the connection, which causes great time consuming. Therefore, TCP is generally used in communication occasions where real-time performance is not required, such as web browsing, mailbox data, file transfer, and the like.

1.1.1 1.2 UDP (User Data Protocol)

UDP is a non-connected protocol. Before the data is transmitted, the source and the terminal do not establish a connection. When it wants to transmit, it grabs the data from the application and throws it on the network as quickly as possible. On the sending end, the speed at which UDP transfers data is only limited by the speed at which the application generates data, the capabilities of the computer, and the bandwidth of the transmission; at the receiving end, UDP puts each message segment in a queue, and the application is queued each time. Read a message segment.

Since the transmission data does not establish a connection, there is no need to maintain the connection status, including the transmission and reception status, so that one server can transmit the same message to multiple clients at the same time, or can share a broadcast address and become UDP multicast. Function, similar to the CAN bus communication, the information sent to the multicast address will be received by all group members. As shown in Figure 3.

Figure 3 UDP two communication methods

The header of the UDP packet is very short, only 8 bytes, and the overhead of the 20-byte packet relative to TCP is small. The throughput is not regulated by the congestion control algorithm and is limited only by the rate at which the application software generates data, the transmission bandwidth, and the performance of the source and end hosts.

UDP uses the best effort to deliver, but the link layer of the sender does not guarantee reliable delivery, so the sending host does not need to maintain a complex link state table (there are many parameters). UDP is message oriented. The sender's UDP packet to the application is delivered to the IP layer after adding the header. Neither split nor merge.

UDP is generally used in industrial control situations with high real-time performance. For example, most real-time Ethernet networks now use UDP communication. IEC61375-3-4 in rail transit uses UDP as the communication for real-time process data, and TCP for parameter configuration and firmware upgrade.

1.1.3 1.3 Comparison of TCP and UDP

1.2 2 Comparison of schemes in real-time Ethernet projects

1.2.1 2.1 TCP scheme

In the TCP scheme used, due to problems such as network interference in the industrial field, the TCP connection cannot be reliably maintained during the communication process, and each time the TCP connection is disconnected and the reconnection is attempted, the above four times are experienced. The process of opening the handshake and 3 connection handshakes (if some abnormally disconnected TCPs also need to go through the process of timeout retransmission and keep-alive count), it is very possible to complete the above process in the case of poor network conditions. Exceeding the timeout limit of the system application layer, there will be frequent error problems, resulting in poor real-time performance.

1.2.2 2.2 UDP scheme

The UDP scheme is based on the characteristics of UDP introduced above. After an exception occurs, UDP can eliminate the cumbersome handshake process of TCP, quickly restore communication, and send valid data that needs to be sent in time, thus ensuring the response requirements of the system. .

Data integrity using the UDP scheme is guaranteed by the upper application protocol. Even if a frame of data is lost during the communication process, the sender can resend the lost data by using the retransmission mechanism before receiving the response from the other party. The Ethernet 100 Mbps rate guarantees a short transmission time, so it can be quickly guaranteed. The data arrives. It is not easy to exceed the timeout limit of the system application layer.

For example, in the real-time Ethernet communication protocol of rail transit, the 20548 port UDP multicast address is used as the real-time control of process data. As shown in Figure 4.

Figure 4 Real-time Ethernet in rail transit

Taking ECNN as an example, the host sends UDP multicast, and the contents of one packet are sent to all slaves, as shown in Figure 5. After receiving the slave, the response packet to the multicast address can be received not only by the host but also by the recording device (black box) in the network, which is convenient for analysis when the fault occurs.

Figure 5 Real-time Ethernet communication process of rail transit

1.3 Summary

In summary, combined with the actual situation, the use of UDP scheme is more in line with the actual needs of real-time Ethernet. The ZNE-100TA serial-to-Ethernet module developed by ZLG Zhiyuan Electronics has complete TCP, UDP, and UDP multicast functions, and up to 1.15Mbps serial port transmission speed, which can fully meet the communication requirements of most real-time Ethernet. Strict and complete physical layer testing can solve users' troubles in physical link layer design. As shown in Figure 6.


Figure 6 ZNE-100TA module physical layer test (partial)

AC Power Supplies

AC power supply is a kind of power supply that converts the input mains or DC input into a pure sine wave output after AC-DC-AC or DC-AC conversion. The ideal AC power supply is characterized by stable frequency, stable voltage, zero internal resistance and pure sine wave output voltage wave (without distortion). Mainly used for power grid simulation tests conducted by various electrical appliance manufacturers on electrical appliances according to the voltage/frequency requirements of different countries, various AC motors, AC transformers, aircraft & mechanical equipment and other electronic devices that require pure, regulated and frequency-stabilized output.

Our AC power supply mainly includes three types
1. AC Power Supplies converting the input mains AC by AC-DC-AC, output voltage and frequency are stable and adjustable with pure sine wave output waveform, so called: Variable Frequency AC Power Supplies.
2. AC Power Supplies converting the DC output of the battery and other DC equipment by DC-AC, giving an AC sinusoidal output with stable output voltage and frequency. so called: Inversion AC Power Supplies.
3. AC Power Supplies converting the input mains AC by AC-DC-AC, giving a variable voltage AC output at constant 400Hz output frequency ultra-high output frequency stability. so called: Intermediate Frequency AC Power Supplies.
4. According to the difference in the number of output phases, the AC Power Supplies can be divided into single-phase output AC power supplies and three-phase output AC power supplies.
Different from Variac and AC voltage regulators, our AC power supplies support the setting of output voltage and frequency and has superior high precision, high stability, and high efficiency stable frequency AC output, not only for AC power conversion but also for AC high precision test purpose.

Through the friendly operation panel, you can read the output data such as output voltage, output current, output power, power factor, etc., providing accurate data records for your test, and can add RS485 interfaces as standard, following the MODBUS-RTU international communication protocol, which can realize remote control and operating status monitoring of the power supplies.

Our AC Power Supplies have comprehensive protection functions, such as: over voltage, over current, over temperature and short circuit protections, which can protect the AC power supplies and DUT from damages.

AC Power Sources, AC Sources, AC - AC Power Supplies, DC - AC Power Supplies, AC Switching Power Supplies

Yangzhou IdealTek Electronics Co., Ltd. , https://www.idealtekpower.com