A wide area network connection method and system for FTP protocol
By deploying FTP bridging and intranet penetration systems on cloud servers and establishing cross-network FTP control and data connection tunnels, the problem of remote upgrade and operation and maintenance of power terminal equipment is solved, and efficient and secure remote file transfer is achieved.
Patent Information
- Application Number
- CN202411993949.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing technologies make it difficult to achieve remote upgrades and maintenance of power terminal equipment using the FTP protocol, and existing solutions may cause compatibility issues or security risks.
By deploying an FTP bridging system and an intranet penetration system, and using the intranet penetration client and server to establish control and data connection tunnels on the cloud server, cross-network file transfer between the FTP client and server can be achieved, avoiding the need to modify the existing FTP protocol.
It enables remote upgrades and maintenance of existing FTP equipment, improves efficiency, enhances the operational safety of power equipment, and avoids compatibility issues.
Smart Images

Figure CN119922180B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet communications, and in particular to a wide area network connection method and system for an FTP protocol. Background Art
[0002] The intranet penetration system primarily consists of an intranet penetration client and an intranet penetration server. Typically, the server is deployed on a cloud server with a public IP address, while the client is deployed on the machine hosting the intranet service to be penetrated. Because intranet services lack public IP addresses, they cannot be directly accessed by clients outside the LAN. However, clients can access the intranet penetration server. The intranet penetration system routes the client request to the appropriate intranet machine based on the requested port and other information, thus enabling communication.
[0003] FTP (File Transfer Protocol) is an application layer protocol for transferring files between a client and a server on a computer network. Unlike common application layer protocols (such as http) that only require one TCP connection, FTP requires two TCP connections to complete file transfer. One is called a control connection and the other is called a data connection. FTP supports active mode and passive mode. The active mode has greater limitations and is not within the scope of this invention. Passive mode means that the client requests the server to execute passive mode by sending a PASV instruction. The server will allocate a random port and respond to the port to the client. After receiving the data connection port, the client establishes a data connection to the server. It can be seen that in passive mode, both the control connection and the data connection are initiated by the client, and there will be no firewall issues. Therefore, passive mode is also a more commonly used mode for FTP.
[0004] FTP is still the primary method for configuration changes and firmware upgrades for many power terminal devices. For on-site maintenance of current FTP devices, the following methods are commonly used:
[0005] 1. Send the files to be updated to the on-site personnel, who then download the files to the on-site FTP device via the LAN. The problem with this method is that file transfer requires manual transfer, which is inefficient.
[0006] 2. Expand the device's FTP protocol to meet the requirements for intranet penetration. However, this method requires modifying the existing FTP server and client programs, and because customized elements are added, it may cause compatibility issues in the future.
[0007] 3. Replace the device's FTP protocol with the SFTP protocol. This method satisfies intranet penetration requirements and improves transmission security. However, existing FTP devices cannot use this method.
[0008] In summary, these tools and terminal devices using the FTP protocol are difficult to upgrade and maintain remotely. Summary of the Invention
[0009] The purpose of the present invention is to address the above-mentioned problems and shortcomings and provide a wide area network connection method and system for the FTP protocol, which realizes remote file transfer of the standard FTP protocol by building a bridging system, thereby being applicable to the current stock of FTP devices.
[0010] The technical solution of the present invention is achieved as follows:
[0011] The WAN connection method of the FTP protocol of the present invention is characterized by comprising the following steps:
[0012] Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP; deploy two intranet penetration clients and an FTP bridge client on the intranet machine; start the FTP bridge client and establish a connection with the FTP bridge server, and request the remote control port, remote data port and remote control mapping port from the FTP bridge server; after receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel; the FTP bridge server initiates an FTP control connection to the intranet penetration server to establish a control connection with the FTP server through intranet penetration; start the FTP client, the FTP client After startup, it initiates a connection to the control mapping port assigned by the FTP bridge server; the FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client; after modifying the IP address and data service port in the response message, it sends the modified message to the FTP client; the FTP bridge client starts the second intranet penetration client based on the data service port and the requested remote control port, establishes an FTP data connection tunnel, and realizes routing the data connection initiated by the FTP client to the FTP server.
[0013] In some embodiments, the steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting a remote control port and a remote data port from the FTP bridge server include the following steps: after starting the FTP bridge client, the FTP bridge client initiates a connection to the FTP bridge server; after the connection is successful, the FTP bridge client requests the remote control port, the remote data port, and the remote control mapping port from the FTP bridge server; the FTP bridge server determines whether there is an available remote port; if not, returns an end instruction to the FTP bridge client; if so, allocates a corresponding remote port response to the FTP bridge client.
[0014] In some embodiments, the FTP bridge server initiates a control connection to the intranet penetration server to establish a control connection with the FTP server through intranet penetration, including the following steps: the first intranet penetration client notifies the FTP bridge server after startup is completed; the FTP bridge server initiates an FTP control connection to the remote control port requested by the FTP bridge client; the intranet penetration system routes the FTP control connection to the FTP server, thereby establishing a control connection between the FTP bridge server and the FTP server.
[0015] In some embodiments, after the steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting the remote control port, remote data port and remote control mapping port from the FTP bridge server, the following steps are also included: after the FTP bridge server responds to the requested remote control mapping port, the FTP bridge client displays the remote control mapping port on the interface.
[0016] Furthermore, the FTP client is started, and after the FTP client is started, the step of initiating a connection to the control mapping port assigned by the FTP bridge server includes the following steps: the FTP bridge server starts to monitor the remote control mapping port after establishing a control connection with the FTP server; after the remote terminal obtains the remote control mapping port number, it uses the IP address of the cloud server and the remote control mapping port as configuration to start the FTP client; after the FTP client is started, it initiates a connection to the control mapping port assigned by the FTP bridge server; after the connection is successful, the FTP protocol control message interaction begins.
[0017] In certain embodiments, the FTP bridge server monitors interactive messages between the FTP client and the FTP server, intercepts passive mode response messages sent by the FTP server, records the data service port in the response message, and sends the data service port information to the FTP bridge client, including the following steps: the FTP bridge server continuously monitors interactive messages between the FTP client and the FTP server; each time a passive mode request message from the FTP client is monitored, determines whether it is "PASV"; if not, forwards the message and returns to continue monitoring; if so, intercepts the passive mode response message sent by the FTP server, extracts the IP address in the response message and the data service port randomly assigned by the FTP server; records the data service port in the response message, and sends the data service port information to the FTP bridge client.
[0018] In some embodiments, after modifying the IP address and data service port in the message, the step of sending the modified message to the FTP client includes the following steps: modifying the IP address in the response message to the public IP address of the cloud server; modifying the data service port number in the message to the remote data port allocated by the FTP bridge server to the FTP bridge client; and finally forwarding the modified message to the FTP client.
[0019] In certain embodiments, the FTP bridge client starts a second intranet penetration client based on the data service port and the requested remote control port, establishes an FTP data connection tunnel, and implements the step of routing the data connection initiated by the FTP client to the FTP server, including the following steps: after the FTP bridge client receives the data service port sent by the FTP bridge server, it starts a second intranet penetration client with the data service port and the requested remote control port to establish an FTP data connection tunnel; after the control message interaction is completed, the FTP client initiates a data connection to the remote data port of the cloud server based on the modified message content; the intranet penetration system routes the data connection initiated by the FTP client to the FTP server, and the FTP data connection is now established.
[0020] The present invention also provides a wide area network connection system of FTP protocol, which is characterized by comprising: an FTP client, which is arranged on a remote terminal; an FTP server, which is deployed on a power terminal device and is used to send a passive mode response message and allocate a data service port; an FTP bridge server, which is deployed on a cloud server with a public network IP and is used to bridge the FTP client and establish a control connection with the FTP server through an intranet penetration method; an FTP bridge client, which is deployed on an intranet machine and is used to initiate a connection to the FTP bridge server and request a remote control port, a remote data port and a remote control mapping port from the FTP bridge server; a first intranet penetration client , deployed on the intranet machine, started with the remote control port requested by the FTP bridge client as the configuration, and established an FTP control connection tunnel; the intranet penetration server is deployed on a cloud server with a public IP, and after the first intranet penetration client is started, the FTP bridge server initiates a control connection to the intranet penetration server; the second intranet penetration client is deployed on the intranet machine, started with the remote control port requested by the FTP bridge client and the data service port randomly generated in the passive mode response message of the FTP server as the configuration, and established an FTP data connection tunnel to route the data connection initiated by the FTP client to the FTP server.
[0021] In some embodiments, the FTP bridge server includes a port management module, a message interaction module, and an FTP control message monitoring module; the port management module is used to allocate an available remote control port, a remote control mapping port, and a remote data port to the FTP bridge client; the message interaction module is used to exchange information with the FTP client; the FTP message monitoring module is used to establish two connections with the FTP server and the FTP client respectively, and to monitor and exchange request and response messages in the two connections in an intermediary manner, and to intercept passive mode response messages and modify the IP address and data service port in the message before forwarding the modified response message to the FTP client; the FTP bridge client is divided into a port application module, a message transmission module, and an intranet penetration control module; the message interaction module is used to establish a connection with the FTP server; the port application module requests a remote port from the FTP server through the message interaction module; and the intranet penetration control module is used to start a first intranet penetration client and a second intranet penetration client.
[0022] The beneficial effects of the present invention are:
[0023] (1) The present invention deploys an FTP bridging system and cooperates with an intranet penetration system to realize cross-network file transfer between an FTP client and an FTP server through the FTP protocol; therefore, this method can realize remote upgrade and operation and maintenance operations, greatly improving efficiency.
[0024] (2) Through the wide area connection method of the present invention, the manufacturer no longer needs to disclose the login username and password of the FTP client of the equipment to the on-site operation and maintenance personnel, nor does it need to send the equipment firmware or configuration files to the on-site operation and maintenance personnel; the on-site operation and maintenance personnel only need to run the FTP bridge client, and the manufacturer's technicians can directly perform file operations on the on-site equipment with FTP server through the FTP client, thereby greatly improving the operational safety of the power equipment.
[0025] (3) The wide area connection method of the present invention does not require modification of the FTP protocol, so there is no compatibility issue. In addition, it can be combined with other tools and methods to perform remote operation and maintenance on existing FTP devices, and has strong applicability.
[0026] The present invention will be further described below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flow chart of a first embodiment of the WAN connection method using the FTP protocol of the present invention;
[0028] Figure 2 Flowchart of a second embodiment of the WAN connection method using the FTP protocol of the present invention;
[0029] Figure 3 Flowchart of a third embodiment of the WAN connection method using the FTP protocol of the present invention;
[0030] Figure 4 Flowchart of a fourth embodiment of the WAN connection method using the FTP protocol of the present invention;
[0031] Figure 5 Flowchart of a fifth embodiment of the WAN connection method using the FTP protocol of the present invention;
[0032] Figure 6 This is a structural block diagram of the WAN connection system of the FTP protocol of the present invention;
[0033] Figure 7 This is a block diagram of the connection structure between the FTP bridge client and the FTP bridge server of the present invention. DETAILED DESCRIPTION
[0034] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0035] The terms "first", "second", "third", etc. (if any) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described in the drawings. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products or apparatus.
[0036] In the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0037] In the absence of conflict, the embodiments of the present invention and the features thereof may be combined with each other.
[0038] The present invention deploys a set of FTP bridging system and a set of intranet penetration system, which can realize cross-network file transmission between FTP client and FTP server through FTP protocol. Figure 6 As shown, an FTP bridging system of the present invention includes an FTP bridging client and an FTP bridging server, while an intranet penetration system of the present invention includes two intranet penetration clients and an intranet penetration server.
[0039] The following describes the WAN connection method and system of the FTP protocol of the present invention in conjunction with the accompanying drawings. The description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0040] Example 1
[0041] like Figure 1 As shown, Figure 1 This is a flow chart of a first embodiment of a method for connecting to a wide area network using the FTP protocol of the present invention. The method for connecting to a wide area network using the FTP protocol includes:
[0042] S101. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP.
[0043] A public IP address is a unique identifier on the Internet that allows external networks to identify and communicate with the device. A cloud server with a public IP address is one that is assigned to the cloud server and uniquely identifies its location on the Internet. This allows external users to directly access the cloud server's intranet penetration server and FTP bridge server through this IP address.
[0044] S102. Deploy two intranet penetration clients and an FTP bridge client on the intranet machine.
[0045] It can be understood that the intranet machine can be the FTP service device itself, as long as the FTP service device itself has certain computing power and operating system support to meet the needs of running the intranet penetration client and FTP bridge client software; the intranet machine can also be a terminal device such as a computer or tablet, and the terminal device is connected to the FTP service device through a local area network or other means, and the intranet penetration client and FTP bridge client are installed on the terminal device.
[0046] The present invention deploys two intranet penetration clients, the first of which is responsible for establishing a control connection, and the second intranet penetration client for data connection. Since the control connection port is fixed (usually port 21), the configuration parameters of the intranet penetration client responsible for establishing the control connection can be determined in advance. However, since the data connection port is negotiated through the FTP protocol after the control connection is successfully established, it cannot be configured into parameters in advance. Only when the FTP bridge server detects the port negotiation message and notifies the FTP bridge client of information such as the data service port, can the FTP client generate an intranet penetration configuration file for the data connection and use this as a parameter to start the second intranet penetration client for remote data connection use.
[0047] S103: Start the FTP bridge client and establish a connection with the FTP bridge server, and request the FTP bridge server for a remote control port, a remote data port, and a remote control mapping port.
[0048] Understandably, the FTP bridge client can be activated by on-site personnel at the FTP server, or through unattended self-testing. However, in the power sector, power equipment is generally not allowed to connect to the internet, so manual activation is often required, such as by on-site personnel entering their username and password to access the FTP bridge client. After starting the FTP bridge client, it can connect to the cloud server's FTP bridge server.
[0049] When the FTP bridge client sends a port request to the FTP bridge server, the FTP bridge server will determine whether it has an available remote port. If not, it can let the FTP bridge client continue to wait until an available remote port is available and then respond to the FTP bridge client. It can also directly return an end instruction to the FTP bridge client, informing the FTP bridge client that there are no available remote ports and wait for the next request from the FTP bridge client. If so, it will allocate the corresponding number of remote ports and then respond to the FTP bridge client.
[0050] There are three ports requested by the FTP bridge client. The requested remote control port is the port used to start the first intranet penetration client, the requested remote data port is the port used to start the second intranet penetration client, and the requested remote control mapping port is the port used to start the FTP client.
[0051] S104: After receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel.
[0052] After receiving the port response from the FTP bridge server, the FTP bridge client saves these ports. The saving here is temporary so that the FTP bridge client can display these ports, making it easier for on-site personnel to obtain the port information and convey it to remote technicians, allowing remote technicians to log in to the on-site FTP device through the remote port.
[0053] Start the first intranet penetration client, so that the FTP bridge server can connect to the FTP server through the remote control port, that is, establish a control connection tunnel. Its essence is that the intranet penetration system makes a port mapping from the public network to the intranet.
[0054] S105. The FTP bridging server initiates an FTP control connection to the intranet penetration server to establish a control connection with the FTP server via the intranet penetration method.
[0055] The FTP bridge server can initiate an FTP control connection to the intranet penetration server either after a preset time interval has passed since the FTP bridge client started the first intranet penetration client, or after receiving a notification that the first intranet penetration client has completed startup. This ensures that the first intranet penetration client has been started and the FTP control connection tunnel has been successfully established, and avoids the program error of initiating an FTP control connection again after the first intranet penetration client fails to start.
[0056] The FTP server of the present invention no longer directly establishes a control connection with the FTP client, but instead connects to the intranet penetration system. After the FTP bridge server successfully initiates the FTP control connection to the intranet penetration server, an indirect control connection can be established between the FTP bridge server and the FTP server, that is, the control connection established between the FTP bridge server and the FTP server through the intranet penetration method.
[0057] S106: Start the FTP client. After starting, the FTP client initiates a connection to the control mapping port allocated by the FTP bridge server.
[0058] The FTP client is installed on a remote terminal—that is, on a manufacturer's technician's computer or tablet. This allows the manufacturer's technician to remotely control the on-site FTP server equipment and perform upgrades or maintenance on it. This design eliminates the need to disclose the device's FTP client login username and password to on-site personnel, ensuring the operational security of the power equipment.
[0059] The FTP client can be started by first having the on-site personnel inform the remote manufacturer's technician of the remote control mapping port number displayed on the interface of the FTP bridge client. The manufacturer's technician uses the IP address of the cloud server and the remote control mapping port as configuration, and then starts the FTP client, thereby enabling the manufacturer's technician to directly operate the files in the on-site FTP service equipment. Of course, the remote control mapping port number can also be encrypted and hidden (such as represented by an asterisk), and then the on-site personnel sends the remote control mapping port number to the remote manufacturer's technician. After receiving the encrypted remote control mapping port number and decrypting it, the manufacturer's technician's terminal device displays the number of the remote control mapping port number; it can also be prompted by an indicator button, that is, when the FTP bridge client receives the remote control mapping port response from the FTP bridge server, an indicator button will light up or flash as a prompt. The on-site personnel only needs to click the indicator button to send the remote control mapping port to the manufacturer's technician.
[0060] S107. The FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client.
[0061] There are many types of interactive messages between the FTP client and the FTP server, including control connection messages, data connection messages, and other messages during the interaction process (such as status messages, error messages, etc.). The control connection refers to the connection used to transmit control information (commands and responses) in the FTP session, which usually uses TCP port 21. Common control connection messages include USER, PASS, PORT, PASV, etc. In this embodiment, the FTP bridge server monitors the request messages from the FTP client, which are mainly control connection messages. When the FTP bridge server monitors the request message from the FTP client, it will determine whether it is "PASV", that is, whether it is a passive mode request. If so, the FTP bridge server intercepts the passive mode response message sent by the FTP server; if not, it returns to continue monitoring. If the message monitored by the FTP bridge server is a message other than a "passive mode response message", the FTP bridge server will act as an intermediary to forward these messages between the FTP client and the FTP server.
[0062] The reply message includes a data service port. This port is a randomly generated local data port, meaning the FTP server opens a random, non-privileged port (usually > 1024). Specifically, the FTP server randomly generates a number appended to its local IP address as the port number and appends it to the reply message. For example, if the FTP server's local IP address is 192.168.1.230, the passive mode request reply message would be: "227 Entering Passive Mode (192,168,1,230,169,71).\r\n." The "169,71" indicates that the FTP server has randomly assigned port 16971 as the data connection port.
[0063] S108: After modifying the IP address and data service port in the response message, the modified message is sent to the FTP client.
[0064] In addition to the data service port, the response message also contains the IP address of the FTP server.
[0065] The prior art is that after the FTP server opens the data service port, it sends the data service port number as part of the response message to the FTP client via a command link. The present invention, however, intercepts the response message through the FTP bridge server and obtains the IP address and the data service port. It then modifies the response message, changing the IP address to the public IP address of the cloud server and the data service port number to the remote data port assigned by the FTP bridge server to the FTP bridge client. Specifically, the FTP bridge server parses the basic structure of the response message and finds the IP address and data service port in the response message; modifies all IP addresses found in the response message to the public IP address of the cloud server, and modifies all data service port numbers found in the response message to remote data port numbers; generates a new FTP response message based on the modified fields; then verifies and ensures that the new response message contains the correct status code, message text, and the modified IP address and remote data port; and finally sends it to the FTP client.
[0066] S109. The FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and routes the data connection initiated by the FTP client to the FTP server.
[0067] To ensure that the modified new message can be used by the FTP bridge client and successfully start the second intranet penetration client, the FTP bridge server can perform self-verification on the new response message before sending it after modification, as described in the previous step, to ensure that these changes do not conflict with other network configurations or security policies and that the modified configuration does not introduce new problems. Alternatively, after receiving the response message, the FTP bridge client can verify whether it can correctly parse and identify the modified IP address and remote data port.
[0068] The routing here refers to the mapping between the server (public network) port and the aforementioned public IP + remote data port combination, which is established based on configuration parameters after the second intranet penetration client establishes a connection with the intranet penetration server. When the FTP client initiates a data connection, the data packet is forwarded to the designated intranet IP and port and then transmitted to the FTP server along the specified path. This, combined with the intranet penetration system, enables file transfers between the FTP client and FTP server over a wide area network connection using the FTP protocol.
[0069] The method of this embodiment deploys an FTP bridge server and FTP bridge client, combined with an intranet penetration system, to enable file transfer between the FTP client and the FTP server over a wide area network (WAN) using the FTP protocol. Because this method does not require modifications to the FTP server or FTP client, any tool or terminal device using the FTP protocol can use this method to achieve remote FTP connections. Therefore, it is applicable to existing FTP devices, eliminating the need for modification and avoiding compatibility issues. Furthermore, this method enables remote upgrades and maintenance operations, significantly improving efficiency.
[0070] Example 2
[0071] like Figure 2 As shown, Figure 2 1 is a flow chart of a second embodiment of the WAN connection method of the FTP protocol of the present invention. The WAN connection method of the FTP protocol includes:
[0072] S201. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP, and deploy an intranet penetration client and an FTP bridge client on an intranet machine.
[0073] S202: After the on-site personnel start the FTP bridge client, the FTP bridge client initiates a connection to the FTP bridge server.
[0074] The FTP bridge client of this embodiment is manually started by on-site personnel. After the FTP bridge client is started, the FTP bridge client automatically initiates a TCP / IP connection request to the FTP bridge server through the configured IP address and port. After receiving the connection request, the bridge server performs identity authentication and confirms the connection parameters. If the authentication passes and the parameters are correct, the FTP bridge server will accept the connection request and establish a TCP / IP connection. After the TCP / IP connection is established, the FTP bridge client and the FTP bridge server will negotiate to establish a virtual bridge.
[0075] S203: After the connection is successful, the FTP bridge client requests the remote control port, remote data port and remote control mapping port from the FTP bridge server.
[0076] The remote data port S204 and the FTP bridge server determine whether there is an available remote port.
[0077] In this embodiment, when the FTP bridge server has no available ports or insufficient available ports for the request, it returns an end instruction to the FTP bridge client. The end instruction here means that the FTP bridge server directly ends the request of the FTP bridge client. When returning the end instruction, a prompt message may be returned at the same time, such as: "Insufficient available ports, request terminated"; or "No available ports, request terminated"; or "Only XX available ports are left, request terminated".
[0078] If the available ports are sufficient, a corresponding number of remote ports are selected and a response is given to the FTP bridge client, and the process proceeds to the next step S205.
[0079] S205: After receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel.
[0080] S206: After the first intranet penetration client is started, the FTP bridge server initiates an FTP control connection to the remote control port requested by the FTP bridge client.
[0081] This embodiment implements a pre-notification mechanism, requiring the initiation of an FTP control connection only after receiving notification that the first intranet penetration client has completed startup. This prevents programming errors that might occur if the first intranet penetration client fails to start and then initiates an FTP control connection. This embodiment uses the remote control port requested by the FTP bridge client as the listening port to initiate the control connection request. After authentication is successful, the intranet penetration server accepts the control connection request and establishes an FTP control connection with the FTP bridge server.
[0082] S207: The intranet penetration system routes the FTP control connection to the FTP server, thereby establishing a control connection between the FTP bridge server and the FTP server.
[0083] After the first intranet penetration client establishes a connection with the intranet penetration server, this embodiment creates a mapping relationship between a server (public network) port and a public network IP + remote data port combination based on configuration parameters. When the FTP bridge server initiates an FTP control connection, the data packet is forwarded to the designated intranet IP and remote control port, and then transmitted to the FTP server along the designated path, thereby establishing a control connection between the FTP bridge server and the FTP server (via intranet penetration).
[0084] S208: Start the FTP client. After startup, the FTP client initiates a connection to the control mapping port assigned by the FTP bridge server. S209: The FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client.
[0085] S210: After modifying the IP address and the data service port in the response message, the modified message is sent to the FTP client.
[0086] S211. The FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and routes the data connection initiated by the FTP client to the FTP server.
[0087] This embodiment, building on the first embodiment, details the process by which an FTP bridge client requests a remote port from an FTP bridge server, providing feedback on failed port requests, making the entire method more intelligent. It also details the process by which an FTP client and FTP server establish a remote control connection using the FTP protocol. Similarly, this method enables remote upgrades and maintenance of existing FTP devices, significantly improving efficiency.
[0088] Example 3
[0089] like Figure 3 As shown, Figure 3 FIG3 is a flow chart of a third embodiment of a method for connecting to a wide area network using the FTP protocol of the present invention. The method for connecting to a wide area network using the FTP protocol includes:
[0090] S301. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP, and deploy an intranet penetration client and an FTP bridge client on an intranet machine.
[0091] S302: Start the FTP bridge client and establish a connection with the FTP bridge server, and request the FTP bridge server for a remote control port, a remote data port, and a remote control mapping port.
[0092] S303: After the FTP bridge client receives the request response, the FTP bridge client displays the remote control mapping port on the interface.
[0093] This embodiment adopts the method of directly displaying the remote control mapping port on the interface. The interface here refers to the display screen of the terminal device on which the FTP bridge client program is installed. On-site personnel can directly see the remote control mapping port number and then inform the remote manufacturer's technicians through telephone, chat tools, email, etc.
[0094] S304: The FTP bridge client starts the first intranet penetration client using the requested remote control port as configuration to establish an FTP control connection tunnel.
[0095] S305. After receiving the startup completion notification from the first intranet penetration client, the FTP bridge server initiates an FTP control connection to the intranet penetration server.
[0096] To prevent the FTP bridge server from initiating an FTP control connection before the first intranet penetration client is fully started, which may cause the control connection to fail, a notification step for the FTP bridge client is set. After the first intranet penetration client is fully started, the FTP bridge client will notify the FTP bridge server. The FTP bridge server will then execute the FTP control connection after receiving the notification.
[0097] If the first intranet penetration client fails to start, a display or sound prompt will be displayed on the FTP bridge client to inform the on-site personnel.
[0098] S306: After establishing a control connection with the FTP server, the FTP bridge server starts to monitor the remote control mapping port.
[0099] After the FTP bridge server establishes a control connection with the FTP server, the FTP bridge server will create a Socket object and bind the Socket object to the remote control mapping port by calling the bind() method; after binding the remote control mapping port, the FTP bridge server starts listening for connection requests from the FTP client by calling the listen() method. At this time, the FTP bridge server enters the listening state, waiting for the connection request from the FTP client.
[0100] S307: After obtaining the remote control mapping port number, the remote terminal starts the FTP client using the IP address of the cloud server and the remote control mapping port as configuration.
[0101] After receiving the remote control mapping port number from the on-site personnel, the manufacturer's technician opens the FTP client program on the manufacturer's terminal device, then enters the IP address of the cloud server and the remote control mapping port number in the program interface, and then clicks the connect button or executes the corresponding command to start the FTP client.
[0102] S308: After starting, the FTP client initiates a connection to the control mapping port allocated by the FTP bridge server.
[0103] After the FTP client is started, it will send a request to establish a connection to the FTP bridge server. When the FTP bridge server listens to the connection request from the FTP client, it accepts the connection by calling the accept() method. Once the connection is accepted, the FTP bridge server will return a new Socket object. The FTP bridge server will exchange data with the FTP client through the new Socket object, process the request sent by the FTP client, and return the corresponding response data.
[0104] S309: After the connection is successful, FTP protocol control message interaction begins.
[0105] There are many types of messages exchanged between the FTP client and the FTP server, including control connection messages, data connection messages, and other messages during the interaction process (such as status messages and error messages). In this embodiment, authentication message exchange is performed first, and message exchange begins after authentication is successful. During the message exchange process, the FTP client sends a command message to request the FTP server to perform a certain operation, such as downloading a file, uploading a file, or listing directory contents. The FTP server then sends a response message in response to the FTP client's command. The response message contains a status code indicating the result of the command execution, such as success, failure, or request for more information. Data transmission modes include active mode (PORT) and passive mode (PASV). After selecting the transmission mode and determining the port for data transmission, data transmission can begin between the FTP client and the FTP server. Data transmission is typically carried out through a separate data connection, which is temporarily established when data transmission is required and closed after the data transmission is completed.
[0106] S310: The FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client.
[0107] S311: After modifying the IP address and data service port in the response message, the modified message is sent to the FTP client.
[0108] S312. The FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and routes the data connection initiated by the FTP client to the FTP server.
[0109] This embodiment, based on the first embodiment, describes in detail the transmission method of the remote control mapping port and the startup process of the FTP client, thereby further optimizing the connection method of the present invention and reducing the possibility of program errors. Through the wide-area connection method of the present invention, the manufacturer no longer needs to disclose the login username and password of the device's FTP client to on-site operation and maintenance personnel, nor does it need to send the device firmware or configuration files to on-site operation and maintenance personnel. On-site operation and maintenance personnel only need to run the FTP bridge client, and the manufacturer's technicians can directly perform file operations on the on-site device with an FTP server through the FTP client, thereby greatly improving the operational safety of the power equipment. It also enables remote upgrades and operation and maintenance operations, greatly improving efficiency.
[0110] Example 4
[0111] like Figure 4 As shown, Figure 4 4 is a flow chart of a fourth embodiment of a method for connecting to a wide area network using the FTP protocol of the present invention. The method for connecting to a wide area network using the FTP protocol includes:
[0112] S401. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP, and deploy an intranet penetration client and an FTP bridge client on an intranet machine.
[0113] S402: Start the FTP bridge client and establish a connection with the FTP bridge server, and request the FTP bridge server for a remote control port and a remote data port.
[0114] S403: After receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel.
[0115] S404: The FTP bridging server initiates an FTP control connection to the intranet penetration server, bridging the control connection between the FTP client and the FTP server in an intranet penetration manner.
[0116] S405: The FTP bridge server continues to monitor the interaction messages between the FTP client and the FTP server.
[0117] An FTP bridge server, acting as a relay between the FTP client and server, can capture and parse messages on both the control and data connections. Alternatively, it can implement this functionality by programming a network sniffing program or using existing network monitoring tools. After capturing messages from the FTP client or server, the FTP bridge server parses and extracts relevant information, such as command type, file name, file size, and transfer mode. It then maintains, forwards, intercepts, or issues notifications based on the needs.
[0118] S406: Each time a request message from the FTP client is monitored, determine whether it is "PASV".
[0119] When the FTP bridge server monitors the exchange of messages between the FTP client and the FTP server, it will parse and extract the relevant information to determine whether the transmission mode is PASV mode. If the exchange message is a passive mode (PASV) request message with the format of "PASV\r\n", it will start intercepting the FTP server's response message, extract the IP address in the response message and the data service port randomly assigned by the FTP server. If the exchange message is other than a PASV request message, the FTP bridge server will act as an intermediary to forward these messages between the FTP client and the FTP server, and then return to continue monitoring.
[0120] S407: Record the data service port in the response message, and send the data service port information to the FTP bridge client.
[0121] After intercepting the response message, the FTP bridge server will parse the port number in the response message, record the data service port number randomly generated by the FTP server, and then send it to the FTP bridge client via the TCP / IP protocol. Of course, you can also manually record the data service port number parsed by the FTP bridge server and manually inform the FTP bridge client.
[0122] S408. Modify the IP address in the response message to the public IP address of the cloud server, and modify the data service port number in the response message to the remote data port allocated by the FTP bridge server to the FTP bridge client.
[0123] The FTP bridge server of this embodiment will parse the basic structure of the response message and find the IP address and data service port in the response message; modify the IP address found in the response message to the public IP address of the cloud server, and modify the data service port number found in the response message to the remote data port number; generate a new FTP response message based on the modified fields.
[0124] S409. Finally, the modified response message is forwarded to the FTP client.
[0125] After modifying the response message, the FTP bridge server of this embodiment will first verify to ensure that the new response message contains the correct status code, message text, and the modified public IP address and remote data port; after ensuring that these changes do not conflict with other network configurations or security policies, it will send it to the FTP client.
[0126] S410: The FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and routes the data connection initiated by the FTP client to the FTP server.
[0127] This embodiment, building on the first embodiment, details the process of monitoring and forwarding interactive messages by the FTP bridge server. This method converts the existing FTP passive mode to remote transmission mode. Because no modification is required to the FTP device, it is applicable to existing FTP devices. This method enables remote upgrades and maintenance of existing FTP devices, significantly improving efficiency.
[0128] Example 5
[0129] like Figure 5 As shown, Figure 5 4 is a flow chart of a fourth embodiment of a method for connecting to a wide area network using the FTP protocol of the present invention. The method for connecting to a wide area network using the FTP protocol includes:
[0130] S501: Start the FTP bridge client.
[0131] S502: After the FTP bridge client is started, the FTP bridge client initiates a connection to the FTP bridge server.
[0132] S503: After the connection is successful, the FTP bridge client requests the remote control port, remote data port and remote control mapping port from the FTP bridge server.
[0133] S504: The FTP bridge server determines whether there is an available remote port.
[0134] If not, return the end instruction to the FTP bridge client;
[0135] If so, go to step S505.
[0136] S505: Allocate three ports from the available port pool as a remote control port, a remote control mapping port, and a remote data port, and respond to the FTP bridge client.
[0137] S506: After receiving the request response, the FTP bridge client saves the three ports and displays the remote control mapping port on the interface.
[0138] S507: Generate a configuration file for the intranet penetration client according to the requested remote control port, then start the first intranet penetration client and establish an FTP control connection tunnel.
[0139] S508. After receiving the startup completion notification of the first intranet penetration client, the FTP bridge server initiates an FTP control connection to the intranet penetration server, establishes an FTC connection with the FTP server through the intranet penetration system, and starts monitoring the remote control mapping port.
[0140] S509: Start the FTP client using the IP address of the cloud server and the remote control mapping port displayed by the FTP bridge client as configuration.
[0141] S510: The FTP client establishes a control connection with the FTP bridge server according to the control mapping port displayed by the FTP bridge client, and starts FTP protocol message interaction.
[0142] S511: The FTP bridge server starts to continuously monitor the interaction messages between the FTP client and the FTP server.
[0143] S512: When the FTP bridge server monitors the request message from the FTP client, it determines whether it is "PASV".
[0144] If not, return to step S511;
[0145] If yes, proceed to the next step S513.
[0146] S513: The FTP bridge server intercepts the passive mode response message sent by the FTP server, and extracts the IP address and data service port in the response message.
[0147] S514: The FTP bridge server records the data service port in the response message, and sends the data service port information to the FTP bridge client.
[0148] S515. The FTP bridge client generates a new configuration file according to the data service port and the requested remote control port, and starts a second intranet penetration client to establish an FTP data connection tunnel.
[0149] S516. At the same time, the FTP bridge server modifies the IP address in the response message to the public IP address of the cloud server, and modifies the data service port number in the response message to the remote data port allocated by the FTP bridge server to the FTP bridge client, and then forwards the modified response message to the FTP client.
[0150] S517. The FTP client uses the public network address IP and remote data port of the server in accordance with the FTP protocol to establish a data connection with the FTP server through the traditional intranet system to perform file transfer interaction.
[0151] This embodiment details the working steps between each server and client, ultimately achieving file transfer between the FTP client and the FTP server over a wide area network using the FTP protocol. This method is applicable to existing FTP devices and can achieve remote upgrades and maintenance operations without the need for staff to visit the FTP device site, greatly improving efficiency and ensuring high transmission security.
[0152] Based on the same inventive concept, the present invention also proposes a wide area network connection system of FTP protocol, such as Figure 6 The figure shows a block diagram of the WAN connection system for the FTP protocol of the present invention. The WAN connection system for the FTP protocol includes an FTP client, an FTP server, an FTP bridge system consisting of an FTP bridge server and an FTP bridge client, and an intranet penetration system consisting of an intranet penetration client and an intranet penetration server, with two intranet penetration clients.
[0153] Among them, the FTP client is set on a remote terminal, which can be a computer, tablet or other device used by manufacturer technicians. The FTP client can be a common FTP client currently on the market, such as FileZilla, WinSCP, Cyberduck, Transmit, etc.
[0154] The FTP server, deployed on the power terminal device and corresponding to the FTP client, can be FileZilla Server, vsftpd, ProFTPD, Server-U, etc. Currently, vsftpd is the primary FTP server used on power terminals. In the wide area network connection method of the present invention, the FTP server is primarily used to send passive mode response messages and allocate a data service port. This data service port number is appended to the response message for easy access by the FTP bridge server.
[0155] The FTP bridge server is deployed on a cloud server with a public IP. The FTP bridge server mainly plays a bridging role, bridging the FTP client and establishing a control connection with the FTP server through intranet penetration.
[0156] The FTP bridge client is deployed on the intranet machine. It is used to initiate a connection to the FTP bridge server to ensure the normal operation of the FTP bridge system. After the connection is established, it requests a remote port from the FTP bridge server as needed. The intranet penetration client is started based on the requested remote port to establish an FTP control connection tunnel and an FTP data connection tunnel. Figure 7As shown, the FTP bridge server of this embodiment includes a port management module, a message interaction module, and an FTP control message monitoring module. The port management module is responsible for allocating available remote control ports, remote control mapping ports, and remote data ports to the FTP bridge client, and reclaiming the ports after the FTP bridge client goes offline. The message interaction module is responsible for exchanging information with the FTP client, including responding to client requests and pushing information to the client in real time. The FTP message monitoring module is the core module, responsible for establishing two connections with the FTP server and the FTP client, respectively, and monitoring and exchanging request and response messages in the two connections as an intermediary. When the request message from the FTP client is "PASV", it intercepts the response message from the FTP server and extracts the IP address and data service port in the message. The data service port is then pushed to the FTP bridge client via the message interaction module. The IP address in the message is then replaced with the public IP address of the cloud server, and the data service port is replaced with the remote data port. Finally, the modified response message is forwarded to the FTP client.
[0157] The FTP bridge client consists of a port request module, a message transmission module, and an intranet penetration control module. When the FTP bridge client starts, the message transmission module first establishes a connection with the FTP server. The port request module then requests a remote port from the FTP server through the message transmission module. Upon receiving the remote port number from the FTP server, the intranet penetration control module first launches the first intranet penetration client, which establishes an FTP control connection between the FTP bridge server and the FTP server. After the message transmission module receives the data port number pushed by the FTP server, the intranet penetration module launches the second intranet penetration client, which establishes a data connection between the FTP client and the FTP server.
[0158] The intranet penetration client includes two, both deployed on the intranet machine. The first intranet penetration client is started with the remote control port requested by the FTP bridge client as the configuration, and is used to establish an FTP control connection tunnel; the second intranet penetration client is started with the remote control port and data service port requested by the FTP bridge client as the configuration, and is used to establish an FTP data connection tunnel, thereby routing the data connection initiated by the FTP client to the FTP server.
[0159] The intranet penetration server is also deployed on a cloud server with a public IP. After the first intranet penetration client is started, the FTP bridge server initiates a control connection to the intranet penetration server, and then exchanges information with the first intranet penetration client through the intranet penetration server, thereby realizing the control connection between the FTP client and the FTP server through the intranet penetration system with the FTP bridge server as a bridge.
[0160] The FTP protocol's WAN connection system coordinates with the server and client, eliminating the need for the FTP client to establish a direct connection with the FTP server. Instead, the FTP client and the FTP server are bridged via an FTP bridge server, which intercepts and modifies the FTP server's passive mode response messages. This, combined with an intranet penetration system, enables file transfer between the FTP client and the FTP server over the FTP protocol's WAN. The specific FTP protocol WAN connection method is described in Examples 1 to 5 above and will not be further elaborated.
[0161] It is understandable that in the embodiments provided in the present application, the disclosed methods and systems may also be implemented in other ways. The embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functions, and operations that may be implemented by the methods and systems according to the various embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a portion of code, and the module, program segment, or a portion of code contains one or more executable instructions for implementing the specified logical functions. It should be further noted that in some alternative implementations, the functions marked in the boxes may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should be further noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, may be implemented using a dedicated hardware-based system that performs the specified functions or actions, or may be implemented using a combination of dedicated hardware and computer instructions.
[0162] The above are merely preferred embodiments of the present application and are not intended to limit the present application. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
[0163] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.
Claims
1. A wide area network connection method for FTP protocol, characterized in that: The steps include: Deploy the intranet penetration server and FTP bridge server on a cloud server with a public IP address. Deploy two intranet penetration clients and FTP bridge clients on the intranet machine; Start the FTP bridge client and establish a connection with the FTP bridge server, and request the remote control port, remote data port and remote control mapping port from the FTP bridge server; After receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel; The FTP bridge server initiates an FTP control connection to the intranet penetration server to establish a control connection with the FTP server via intranet penetration. Start the FTP client, and after starting, initiate a connection to the control mapping port assigned by the FTP bridge server; The FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client; After modifying the IP address and data service port in the response message, the modified message is sent to the FTP client; The FTP bridge client starts a second intranet penetration client based on the data service port and the requested remote control port, establishes an FTP data connection tunnel, and routes the data connection initiated by the FTP client to the FTP server.
2. The WAN connection method of the FTP protocol according to claim 1, wherein: The steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting the remote control port and the remote data port from the FTP bridge server include the following steps: After starting the FTP bridge client, the FTP bridge client initiates a connection to the FTP bridge server; After the connection is successful, the FTP bridge client requests the remote control port, remote data port, and remote control mapping port from the FTP bridge server; The FTP bridge server determines whether there is an available remote port; If not, return the end instruction to the FTP bridge client; If yes, the corresponding remote port is assigned to respond to the FTP bridge client.
3. The WAN connection method of the FTP protocol according to claim 1, wherein: The FTP bridging server initiates a control connection to the intranet penetration server to establish a control connection with the FTP server via the intranet penetration mode, including the following steps: After the first intranet penetration client is started, it notifies the FTP bridge server; The FTP bridge server initiates an FTP control connection to the remote control port requested by the FTP bridge client; The intranet penetration system routes the FTP control connection to the FTP server, thereby establishing a control connection between the FTP bridge server and the FTP server.
4. The WAN connection method of the FTP protocol according to claim 1, wherein: After the steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting the FTP bridge server for a remote control port, a remote data port, and a remote control mapping port, the following steps are also included: After the FTP bridge server responds to the requested remote control mapping port, the FTP bridge client displays the remote control mapping port on the interface.
5. The WAN connection method of the FTP protocol according to claim 4, characterized in that: The step of starting the FTP client and initiating a connection to the control mapping port allocated by the FTP bridge server after the FTP client is started includes the following steps: After the FTP bridge server establishes a control connection with the FTP server, it starts to listen to the remote control mapping port; After obtaining the remote control mapping port number, the remote terminal starts the FTP client using the cloud server's IP address and the remote control mapping port as configuration; After the FTP client is started, it initiates a connection to the control mapping port assigned by the FTP bridge server; After the connection is successful, FTP protocol control message interaction begins.
6. The WAN connection method of the FTP protocol according to claim 1, wherein: The step of the FTP bridge server monitoring interactive messages between the FTP client and the FTP server, intercepting a passive mode response message sent by the FTP server, recording a random data service port in the response message, and sending the random data service port information to the FTP bridge client comprises the following steps: The FTP bridge server continuously monitors the interactive messages between the FTP client and the FTP server; Every time a request message from an FTP client is monitored, determine whether it is "PASV"; If not, forward the message and return to continue monitoring; If yes, intercept the passive mode response message sent by the FTP server, extract the IP address in the response message and the data service port randomly assigned by the FTP server; Record the data service port in the response message and send the data service port information to the FTP bridge client.
7. The WAN connection method of the FTP protocol according to claim 1, characterized in that: After modifying the IP address and data service port in the response message, the step of sending the modified message to the FTP client comprises the following steps: Change the IP address in the reply message to the public IP address of the cloud server; Modify the data service port number in the response message to the remote data port assigned by the FTP bridge server to the FTP bridge client; Finally, the modified response message is forwarded to the FTP client.
8. The WAN connection method of the FTP protocol according to claim 1, wherein: The FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and implements the step of routing the data connection initiated by the FTP client to the FTP server, including the following steps: After receiving the data service port sent by the FTP bridge server, the FTP bridge client starts the second intranet penetration client with the data service port and the requested remote control port to establish an FTP data connection tunnel; After the control message exchange is completed, the FTP client initiates a data connection to the remote data port of the cloud server based on the modified message content; The intranet penetration system routes the data connection initiated by the FTP client to the FTP server, and the FTP data connection is now established.
9. A wide area network connection system of FTP protocol, characterized in that: include: FTP client, set up on the remote terminal; FTP server, deployed on the power terminal equipment, is used to send passive mode response messages and allocate random data service ports; FTP bridge server, deployed on a cloud server with a public IP, is used to bridge the FTP client and establish a control connection with the FTP server through intranet penetration; FTP bridge client, deployed on the intranet machine, is used to initiate a connection to the FTP bridge server and request the remote control port, remote data port, and remote control mapping port from the FTP bridge server; The first intranet penetration client is deployed on an intranet machine and is started with the remote control port requested by the FTP bridge client as the configuration to establish an FTP control connection tunnel; The intranet penetration server is deployed on a cloud server with a public IP. After the first intranet penetration client is started, the FTP bridge server initiates a control connection to the intranet penetration server. The second intranet penetration client is deployed on the intranet machine and is started with the remote control port requested by the FTP bridge client and the randomly generated data service port in the passive mode response message of the FTP server as the configuration. It establishes an FTP data connection tunnel and routes the data connection initiated by the FTP client to the FTP server.
10. The WAN connection system of the FTP protocol according to claim 9, characterized in that: The FTP bridge server includes a port management module, a message interaction module, and an FTP control message monitoring module; the port management module is used to allocate an available remote control port, a remote control mapping port, and a remote data port to the FTP bridge client; the message interaction module is used to exchange information with the FTP client; the FTP message monitoring module is used to establish two connections with the FTP server and the FTP client, respectively, and monitor and exchange request and response messages in the two connections in an intermediary manner, and is used to intercept passive mode response messages, modify the IP address and data service port in the message, and then forward the modified response message to the FTP client; The FTP bridging client is divided into a port application module, a message transmission module and an intranet penetration control module; the message transmission module is used to establish a connection with the FTP server; the port application module requests a remote port from the FTP server through the message transmission module; the intranet penetration control module is used to start the first intranet penetration client and the second intranet penetration client.
Citation Information
Patent Citations
Intranet penetration system
CN116436891A
Method for starting network traversal system, and message transceiving method and communication device
WO2024001753A1