A method for supporting cross-network segment upgrade of PLC

By creating virtual network ports and private IP addresses on the PC and PLC devices and configuring EOIP tunnels, the high cost of cross-network segment upgrades and inconvenient operation and maintenance of PLC programs is solved, and low-cost cross-network segment upgrades are achieved.

CN115865560BActive Publication Date: 2025-07-22ZHEJIANG EXPRESSWAY INFO ENG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210065579.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-07
Publication Date
2025-07-22
Estimated Expiration
2042-06-07

AI Technical Summary

Technical Problem

In the prior art, remote upgrade of PLC programs in different network segments requires the addition of EOIP tunnel routers, resulting in high project costs and inconvenient operation and maintenance.

Method used

By creating virtual network ports and private IP addresses on the PC and PLC devices, and configuring EOIP tunnels, the PLC program upgrade is achieved in cross-network situations, avoiding the use of additional EOIP routers.

Benefits of technology

The upgrade of cross-net segment PLC programs has been achieved, reducing labor and maintenance costs, simplifying operational processes, and reducing hardware requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865560B_ABST
    Figure CN115865560B_ABST
Patent Text Reader

Abstract

The present invention proposes a method for establishing an EOIP tunnel between a PC-side configuration software and a PLC device to achieve remote upgrade, specifically a method for supporting cross-network segment upgrade of PLCs. After enabling the EOIP tunnel configuration, an EOIP tunnel can be built in the case of cross-network segments. The method in the present invention does not require the aid of an EOIP router, facilitating the cross-network segment upgrade of PLC programs and reducing labor costs and maintenance costs. The present invention combines EOIP technology with PLC remote upgrade, and IP packets are forwarded in the Ethernet, realizing the direct L2 forwarding of the PC-side virtual network interface and the PLC virtual network interface through the EOIP tunnel, eliminating the L3 forwarding between two routers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of programmable controllers, and particularly to a method for supporting cross-network segment upgrade of PLCs. Background Art

[0002] With the development and popularization of Ethernet, when developing and upgrading PLC (Programmable Logic Controller) programs, the Ethernet connection method is increasingly used between computer programming software and PLCs. Compared with traditional connection schemes such as USB, RS232, and RS485, the Ethernet connection method is more convenient and flexible.

[0003] Currently on the market, computer programming software and PLCs are both connected in the Ethernet direct connection or HUB mode, and the IP addresses need to be in the same network segment and cannot cross three-layer networks. In actual application scenarios, many devices are deployed in networks with different network segments. If it is necessary to upgrade the PLC within different network segments, it is very inconvenient. Currently, if it is necessary to remotely upgrade the program on the PLC across a three-layer network, routers or gateways supporting EOIP tunnels need to be added at both the computer and PLC ends. By configuring the EOIP tunnel, the PLC can be upgraded. EOIP (Ethernet over IP, Ethernet tunnel based on IP) tunnel is a layer 2 tunnel technology. The existing method for establishing an EOIP tunnel is to set two routers between the PC side and the PLC, create an EOIP tunnel on the routers, bind the WAN port to the tunnel, and configure the IP address of the peer WAN port as the remote IP of the tunnel. To solve the problem of remote PLC upgrade through this solution, 2 routers supporting EOIP need to be added. If an EOIP router is deployed on each PLC side, on the one hand, it greatly increases the project cost, and on the other hand, it also brings inconvenience to the operation and maintenance personnel. Summary of the Invention

[0004] The present invention is to overcome the above-mentioned drawbacks. The present invention provides a method for supporting cross-network segment upgrade of PLCs. By configuring the EOIP tunnel enabling on the configuration software and the PLC, an EOIP tunnel can be established in the case of cross-network segments, which is convenient for cross-network segment upgrade of PLC programs.

[0005] To achieve the above object, the present invention adopts the following technical solutions: A method for supporting cross-network segment upgrade of PLCs, including: when the PC side installs configuration programming software, a virtual TAP network interface is created, and a private IP address A is configured for communication protocol connection with the PLC device;

[0006] When the PLC device starts up the system, a virtual internal network interface is created, and a private IP address B is configured for communication protocol connection with the PC side;

[0007] The PC side and the external physical network port of the PLC device are respectively configured with a device management IP address C and D; the device management IP addresses C and D are across network segments;

[0008] When cross-network segment upgrading of the PLC program is required, the PC side and the PLC device create an EOIP tunnel connection through the device management IP addresses C and D;

[0009] Judge whether the destination IP of the PC side is the private IP address B of the PLC device. If so, add an EOIP header to the packet sent by the PC side and then encapsulate it into an IP packet in the device management network segment;

[0010] The IP packet enters the EOIP tunnel and is sent to the PLC device;

[0011] After receiving the EOIP tunnel packet, the PLC device strips the EOIP packet header and extracts the packet payload to obtain the original packet sent by the configuration programming software on the PC side;

[0012] The PLC device upgrades the program according to the original packet.

[0013] Preferably, before creating the EOIP tunnel, detect whether the source IP address of this group of packets is the same as the source IP address of the EOIP tunnel transmitting this tunnel packet, and only send the packets whose source IP address is different from the source IP address of the EOIP tunnel transmitting this tunnel packet.

[0014] Preferably, the process of the IP packet entering the EOIP tunnel and being sent to the PLC device includes:

[0015] Step 101, ask whether the EOIP tunnel is needed to forward the IP packet. If forwarding is needed, proceed to the next stage. If not, return to the link layer for continued processing;

[0016] Step 102, query whether the EOIP tunnel can be enabled. If so, go to the next step. If not, return to the link layer for continued processing;

[0017] Step 103, ask whether it is a broadcast. If so, the IP packet enters the EOIP tunnel. If not, query whether the destination MAC address of the packet is the MAC address of the EOIP tunnel interface. If the address is correct, go to the next step. If not, return to the protocol stack for continued processing;

[0018] Step 104, the IP packet looks up the routing table in the EOIP tunnel with the remote IP of the tunnel as the destination IP. If the lookup is successful, copy the packet, reset the transport layer protocol of the IP packet header; after routing out, forward the IP packet; if the lookup fails, discard the IP packet.

[0019] Therefore, the present invention has the following beneficial effects: The present invention proposes a method for establishing an EOIP tunnel between a PC-side configuration software and a PLC device to achieve remote upgrade. After configuring the EOIP tunnel to be enabled, an EOIP tunnel can be built in the case of cross-network segments. The method in the present invention does not require an EOIP router, facilitating the cross-network segment upgrade of the PLC program. Different from the traditional solution, it reduces the labor cost and maintenance cost. The present invention combines the EOIP technology with the PLC remote upgrade. The IP packet is forwarded in the Ethernet, realizing the direct L2 forwarding of the PC-side virtual network interface and the PLC virtual network interface by the EOIP tunnel, eliminating the L3 forwarding between two routers. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, and do not constitute a limitation to the present invention. In the accompanying drawings:

[0021] Figure 1 It is a flowchart of the steps of a method for supporting cross-network segment upgrade of a PLC according to the invention.

[0022] Figure 2 It is a connection schematic diagram of establishing a tunnel for the PLC system of the present invention.

[0023] Figure 3 It is a flowchart of the steps for the message of the present invention to be sent to the PLC after entering the L2 tunnel.

[0024] Figure 4 It is an encapsulation message diagram of the L2 tunnel of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.

[0026] A method for supporting cross-network segment upgrade of a PLC, as Figure 1 shown, includes:

[0027] S1. When the PC installs the configuration programming software, it creates a virtual TAP network interface and configures a private IP address A for communication protocol connection with the PLC device. When the PLC device starts up, it creates a virtual internal network interface and configures a private IP address B for communication connection with the PC configuration programming software. The private IP address is used for the layer 2 protocol interaction between the computer configuration software and the PLC and the management of the manufacturer's private protocol. Exemplarily, taking the private IP address A as 192.168.20.2 and the private IP address B as 192.168.20.3 as an example.

[0028] S2. The external physical network interfaces of the PC and the PLC device are respectively configured with a device management IP address. Among them, the two device management IPs can be across network segments. Exemplarily, taking the device management IP of the PC as 10.1.1.1 and the device management IP of the PLC device as 20.1.1.1 as an example.

[0029] S3. When it is necessary to upgrade the PLC program across network segments, the PC and the PLC device create an EOIP tunnel connection through the device management IP, as Figure 2 shown.

[0030] Before creating the EOIP tunnel, it is detected whether the source IP address of the group of packets is the same as the source IP address of the EOIP tunnel transmitting the tunnel packets, and only the packets with the source IP address different from the source IP address of the EOIP tunnel transmitting the tunnel packets are sent. Specifically, when it is necessary to upgrade the PLC program across network segments and the computer PC programming software needs to establish a connection with the PLC, first create an EOIP tunnel connection through the two device management IPs 10.1.1.1 and 20.1.1.1.

[0031] After creating the EOIP tunnel, a corresponding routing entry is created.

[0032] S4. Judge whether the destination IP of the PC is the private IP address of the PLC device. If so, that is, when the destination IP of the computer PC is 192.168.20.3 on the PLC device, an EOIP header is added to the packets sent by the PC and then encapsulated into the IP packets of the device management network segment. The IP packets enter the EOIP tunnel and are sent to the PLC device.

[0033] The EOIP module mainly includes two aspects. One is the tunnel forwarding of the EOIP packets by the EOIP network device, and the other is the reception and processing of the EOIP packets by the EOIP receiving host. Among them:

[0034] The sending process includes: for the packet to be sent, it enters the EOIP tunnel for forwarding only when the destination MAC of the packet to be sent is not the port MAC within the local area network; for the Ethernet packet entering the EOIP tunnel, it is encapsulated according to RFC3378, and the destination IP after encapsulation is the tunnel far-end IP, and it is forwarded according to the route to find the corresponding exit.

[0035] The receiving process includes: the far-end side identifies EOIP according to the IP packet type, strips the outer IP header, finds the corresponding EOIP tunnel according to the source IP, and sends it from the interface corresponding to the tunnel.

[0036] The process of the IP packet entering the EOIP tunnel and being sent to the PLC device, as Figure 3 shown, includes:

[0037] Step 101, inquire whether the EOIP tunnel is needed to forward the IP packet. If forwarding is needed, proceed to the next stage. If not, return to the link layer for further processing;

[0038] Step 102, query whether the EOIP tunnel can be enabled. If so, go to the next step. If not, return to the link layer for further processing;

[0039] Step 103, inquire whether it is a broadcast. If so, the IP packet enters the EOIP tunnel. If not, query whether the destination MAC address of the packet is the EOIP tunnel interface MAC address. If the address is correct, go to the next step. If not, return to the protocol stack for further processing;

[0040] Step 104, in the EOIP tunnel, the IP packet searches the routing table with the tunnel far-end IP as the destination IP. If the search is successful, copy the packet, reset the transport layer protocol of the IP packet header; after exiting the route, forward the IP packet; if the search fails, discard the IP packet.

[0041] S5, in the EOIP tunnel, the IP packet searches the routing table with the tunnel far-end IP as the destination IP. If the search is successful, copy the packet, reset the transport layer protocol of the IP packet header; after exiting the route, forward the IP packet; if the search fails, discard the IP packet.

[0042] S6. After receiving the EOIP tunnel packet, the PLC device strips the EOIP packet header and extracts the packet payload to obtain the original packet sent by the PC-side configuration programming software. Among them, the original packet is the program content required for PLC upgrade. The EOIP protocol is registered into the kernel during initialization, and the processing function of this protocol is EOIP_rcv. For EOIP network devices, the function of its EOIP_rcv is still forwarding. Typically, it forwards the keepalive packets at both ends of the tunnel. Only the EOIP_rcv of the receiving host of the EOIP tunnel will actually receive the payload in the EOIP packet.

[0043] S7. The PLC device upgrades the program according to the original packet.

[0044] Such as Figure 4 This is the encapsulated packet diagram of the EOIP tunnel of the present invention. The EOIP tunnel packet header uses the EOIP header, the source MAC is the MAC of the PC side, the destination MAC uses the MAC of the PLC or the broadcast MAC in step 105, and the DATA is the payload of the EOIP packet type.

[0045] For the PLC system implemented by the above method, in terms of cross-ethernet upgrade, a two-layer ethernet tunnel between the computer programming software and the PLC can be quickly built through the configuration of the EOIP tunnel, and it is no longer restricted by the three-layer network. The implementation cost of the solution is low, and no hardware devices such as routers are required, which has good promotion and application value.

[0046] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these changes and modifications.

Claims

1. A method for supporting cross-network segment upgrade of PLCs, characterized in that, Used to achieve remote upgrade of PLC across three-layer networks, including: When the PC installs configuration programming software, a virtual TAP network interface is created and a private IP address A is configured for communication protocol connection with the PLC device; When the PLC device starts up, a virtual internal network interface is created and a private IP address B is configured for communication protocol connection with the PC; A device management IP address C and D are respectively configured for the external physical network interfaces of the PC and the PLC device; the device management IP addresses C and D are across network segments; When it is necessary to upgrade the PLC program across network segments, the PC and the PLC device create an EOIP tunnel connection through the device management IP addresses C and D; Judge whether the destination IP of the PC is the private IP address B of the PLC device. If so, an EOIP header is added to the message sent by the PC and then encapsulated into an IP packet in the device management network segment; The IP packet enters the EOIP tunnel and is sent to the PLC device; After receiving the EOIP tunnel packet, the PLC device strips the EOIP packet header and extracts the packet payload to obtain the original packet sent by the PC configuration programming software; The PLC device upgrades the program according to the original packet.

2. The method for supporting cross-network segment upgrade of a PLC according to claim 1, wherein Before creating the EOIP tunnel, detect whether the source IP address of this group of packets is the same as the source IP address of the EOIP tunnel transmitting this tunnel packet, and only send the packets whose source IP address is different from the source IP address of the EOIP tunnel transmitting this tunnel packet.

3. A method for supporting cross-network segment upgrade of a PLC according to claim 1, characterized in that, The process of the IP packet entering the EOIP tunnel and being sent to the PLC device includes: Step 101, inquire whether the EOIP tunnel is needed to forward the IP packet. If forwarding is needed, proceed to the next stage. If not, return to the link layer for further processing; Step 102, check whether the EOIP tunnel can be enabled. If so, go to the next step. If not, return to the link layer for further processing; Step 103, inquire whether it is a broadcast. If so, the IP packet enters the EOIP tunnel. If not, check whether the destination MAC address of the packet is the MAC address of the EOIP tunnel interface. If the address is correct, go to the next step. If not, return to the protocol stack for further processing; Step 104, in the EOIP tunnel, the IP packet searches the routing table with the remote IP of the tunnel as the destination IP. If the search is successful, the packet is copied and the transport layer protocol of the IP packet header is reset; after exiting the route, the IP packet is forwarded; if the search fails, the IP packet is discarded.

Citation Information

Patent Citations

  • User message processing method and device

    CN103475560A

  • Two-layer forwarding method of PLC across 5G network

    CN113055271A