CN111225015A - Method and device for realizing remote FTP transmission - Google Patents

Method and device for realizing remote FTP transmission Download PDF

Info

Publication number
CN111225015A
CN111225015A CN201811438158.1A CN201811438158A CN111225015A CN 111225015 A CN111225015 A CN 111225015A CN 201811438158 A CN201811438158 A CN 201811438158A CN 111225015 A CN111225015 A CN 111225015A
Authority
CN
China
Prior art keywords
server
response
remote client
message
epsv
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811438158.1A
Other languages
Chinese (zh)
Other versions
CN111225015B (en
Inventor
李德崑
林坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201811438158.1A priority Critical patent/CN111225015B/en
Publication of CN111225015A publication Critical patent/CN111225015A/en
Application granted granted Critical
Publication of CN111225015B publication Critical patent/CN111225015B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to the field of communications, and in particular, to a method and an apparatus for implementing remote FTP transmission. The method is used for ensuring the smooth transmission of the FTP message, and comprises the following steps: and the NPHOST determines that the server currently adopts an EPSV mode based on the IPV6 according to the notification of the server, converts the PASV mode of the FTP message into the EPSV mode and sends the EPSV mode to the server when judging that the remote client currently adopts a passive PASV mode based on the IPV4 according to the control message, and further converts the EPSV response identifier into a PASV response identifier and sends a response message to the remote client. Therefore, the transmission process of the remote FTP can be realized, the smooth transmission of the FTP message between the remote client and the server is ensured, the remote client can be ensured to successfully access the server, the requirements of various complex network scenes are met, the maintenance processing process of the equipment is simplified, and the utilization rate of network resources is improved.

Description

Method and device for realizing remote FTP transmission
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for implementing remote FTP transmission.
Background
With the increasing commercial scale of Fifth Generation mobile communication (5G), remote maintenance of base stations as the preferred operation and maintenance method of operators faces the challenge of more diversified networking scenarios. As a crucial ring for File Transfer in remote maintenance of a base station, a remote File Transfer Protocol (FTP) is also used in a new stage based on Internet Protocol version6 (Internet Protocol version6, IPV6) in a more diversified network deployment environment.
The remote FTP is divided into an IPV6 remote FTP and an IPV4 remote FTP, and the remote FTP based on two Internet Protocols (IP) can both realize file transmission, and the main difference is that the IPV4 remote FTP supports a Passive (PASV) mode, the IPV6 remote FTP supports an Extensible Passive (EPSV) mode, and the EPSV mode is compatible with the IPV4 address. Mode requests during FTP interaction, whether IPV6 remote FTP or IPV4 remote FTP, are initiated by the remote client, so when IPV4 remote FTP is supported, a PASV mode request is initiated by the remote client, and when IPV6 remote FTP is supported, an EPSV mode request is initiated by the remote client.
However, in the evolution process from Fourth Generation mobile communication (4G) to 5G, the remote client under IPV6 only supports the IPV6 remote client, that is, the remote client under IPV6 cannot support communication with other remote clients of network protocols, for example, the remote client under IPV4 is not supported to communicate with remote clients of IPV4, and thus the remote operation and maintenance cannot be performed on some remote clients due to the fact that the remote clients cannot meet the requirements of various complex scenarios.
Therefore, it is necessary to design an implementation method of remote FTP transmission to solve the above problems.
Disclosure of Invention
The invention aims to provide a method and a device for realizing remote FTP transmission, which are used for effectively ensuring the smooth transmission of FTP messages between a remote client and a server.
A method for realizing remote FTP transmission comprises the following steps:
the network processor attachment protocol stack NPHOST determines that the server currently adopts an extensible passive EPSV mode based on an internet protocol version6 IPV6 according to the notification of the server;
the NPHOST judges the working state of the remote client according to a control message sent to the server by the remote client;
the NPHOST acquires an FTP message of a PASV mode sent by the remote client when determining that the remote client currently adopts a passive PASV mode based on an IPV4 version 4 of an Internet protocol based on the working state, converts the PASV mode of the FTP message into an EPSV mode, and sends the FTP message of the EPSV mode to the server;
and the NPHOST receives a response message returned by the server, and sends the response message carrying the PASV response identifier to the remote client after acquiring the EPSV response identifier carried by the response message and aiming at the FTP message and converting the EPSV response identifier into the PASV response identifier.
Optionally, before the NPHOST determines that the server currently adopts the EPSV mode based on IPV6 according to the notification from the server, the NPHOST further includes:
the NPHOST sends a user name request sent by a remote client to the server, triggers the server to verify the user name, and returns a request password response message to the remote client;
the NPHOST sends a password request sent by the remote client to the server, triggers the server to verify the password, and returns a user login response message to the remote client;
and the NPHOST sends a user login response message returned by the server to the remote client, triggers the remote client to enter an FTP message transmission format request process, sends the FTP message transmission format request sent by the remote client to the server, and triggers the server to set an FTP message transmission format.
Optionally, when the NPHOST receives the response message returned by the server, and acquires the EPSV response identifier carried in the response message and directed to the FTP packet, and after the EPSV response identifier is converted into a PASV response identifier, the NPHOST sends the response message carrying the PASV response identifier to the remote client, which specifically includes:
the NPHOST receives 229 response messages carrying EPSV response identifiers sent by the server, converts the EPSV response identifiers into PASV response identifiers, and then sends 227 response messages carrying the PASV response identifiers to the remote client.
Optionally, when the NPHOST receives the response message returned by the server, and acquires the EPSV response identifier carried in the response message and directed to the FTP packet, and after the EPSV response identifier is converted into a PASV response identifier, the NPHOST further sends the response message carrying the PASV response identifier to the remote client, where the NPHOST further includes:
the NPHOST acquires a response message sent to the remote client by the server, and triggers a data plane Transmission Control Protocol (TCP) handshake process between the remote client and the server.
Optionally, when the NPHOST receives the response message returned by the server, and acquires the EPSV response identifier carried in the response message and directed to the FTP packet, and after the EPSV response identifier is converted into a PASV response identifier, the NPHOST further sends the response message carrying the PASV response identifier to the remote client, where the NPHOST further includes:
and the NPHOST sends the FTP file path request of the remote client to the server, and sends the FTP message to the remote client after returning a file response message to the remote client.
Optionally, when the NPHOST receives the response message returned by the server, and acquires the EPSV response identifier carried in the response message and directed to the FTP packet, and after the EPSV response identifier is converted into a PASV response identifier, the NPHOST further sends the response message carrying the PASV response identifier to the remote client, where the NPHOST further includes:
and the NPHOST sends the quit request of the remote client to the server, sends an end response message returned by the server to the remote client and ends the FTP message transmission process.
An apparatus for implementing remote FTP transmission, optionally comprising:
a determining unit, configured to determine, according to a notification of a server, that the server currently employs an extensible passive EPSV mode based on IPV6 version6 of the internet protocol;
the judging unit is used for judging the working state of the remote client according to a control message sent to the server by the remote client;
the first processing unit is used for acquiring an FTP message of a PASV (passive PASV) mode sent by the remote client when the remote client currently adopts a passive PASV mode based on IPV4 version 4 of an Internet protocol based on the working state, converting the PASV mode of the FTP message into an EPSV mode, and sending the FTP message of the EPSV mode to the server;
and the second processing unit is used for receiving the response message returned by the server, and sending the response message carrying the PASV response identifier to the remote client after the EPSV response identifier carried by the response message and aiming at the FTP message is acquired and converted into the PASV response identifier.
Optionally, before determining that the server currently adopts the EPSV 6-based EPSV mode according to the notification from the server, the determining unit is further configured to:
sending a user name request sent by a remote client to the server, triggering the server to verify the user name, and returning a request password response message to the remote client;
sending a password request sent by the remote client to the server, triggering the server to verify the password, and returning a user login response message to the remote client;
and sending a user login response message returned by the server to the remote client, triggering the remote client to enter an FTP message transmission format request process, sending the FTP message transmission format request sent by the remote client to the server, and triggering the server to set an FTP message transmission format.
Optionally, when receiving a response message returned by the server and acquiring an EPSV response identifier carried in the response message and directed to the FTP packet, and after converting the EPSV response identifier into a PASV response identifier, the second processing unit is specifically configured to send the response message carrying the PASV response identifier to the remote client, where:
and receiving 229 response messages which are sent by the server and carry EPSV response identifiers, converting the EPSV response identifiers into PASV response identifiers, and sending 227 response messages which carry the PASV response identifiers to the remote client.
Optionally, when receiving a response message returned by the server, and acquiring an EPSV response identifier carried in the response message and directed to the FTP message, and after converting the EPSV response identifier into a PASV response identifier, after sending the response message carrying the PASV response identifier to the remote client, the second processing unit is further configured to:
and acquiring a response message sent to the remote client by the server, and triggering a data plane Transmission Control Protocol (TCP) handshake process between the remote client and the server.
Optionally, when receiving a response message returned by the server, and acquiring an EPSV response identifier carried in the response message and directed to the FTP message, and after converting the EPSV response identifier into a PASV response identifier, after sending the response message carrying the PASV response identifier to the remote client, the second processing unit is further configured to:
and sending the FTP file path request of the remote client to the server, and sending the FTP message to the remote client after returning a file response message to the remote client.
Optionally, when receiving a response message returned by the server, and acquiring an EPSV response identifier carried in the response message and directed to the FTP message, and after converting the EPSV response identifier into a PASV response identifier, after sending the response message carrying the PASV response identifier to the remote client, the second processing unit is further configured to:
and sending the exit request of the remote client to the server, sending an end response message returned by the server to the remote client, and ending the FTP message transmission process.
A storage medium, optionally storing a program for implementing a method for remote FTP transmission, the program, when executed by a processor, performing the steps of:
determining that the server currently adopts an extensible passive EPSV mode based on an IPV6 version6 of an Internet protocol according to the notification of the server;
judging the working state of a remote client according to a control message sent by the remote client to the server;
based on the working state, when determining that the remote client currently adopts a passive PASV mode based on IPV4 version 4 of the Internet protocol, acquiring an FTP message of the PASV mode sent by the remote client, converting the PASV mode of the FTP message into an EPSV mode, and sending the FTP message of the EPSV mode to the server;
and when a response message returned by the server is received and an EPSV response identifier carried by the response message and aiming at the FTP message is acquired, and after the EPSV response identifier is converted into a PASV response identifier, the response message carrying the PASV response identifier is sent to the remote client.
A communications apparatus, optionally, comprising one or more processors; and one or more computer-readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform the method of any of the above.
In summary, in the embodiment of the present invention, the NPHOST determines that the facility server currently uses the EPSV 6-based EPSV mode according to the notification from the server, and when determining that the remote client currently uses the passive PASV mode based on the IPV4 according to the control message, converts the PASV mode into the EPSV mode and sends the EPSV mode to the facility server, and further converts the EPSV response identifier into the PASV response identifier and sends the response message to the remote client. Therefore, the transmission flow of the remote FTP can be realized, even if the network protocols supported by the facility remote client and the facility server are inconsistent, the smooth transmission of the FTP message between the remote client and the server can be ensured, the remote client can be ensured to successfully access the server, the requirements of various complex network scenes are met, the maintenance processing flow of equipment is simplified, and the utilization rate of network resources is improved.
Drawings
FIG. 1 is a schematic diagram of the basic principle of remote FTP processing in the embodiment of the present invention;
FIG. 2 is a schematic diagram of an FTP message interaction flow in the embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a mode request flow of an FTP message according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the parsing and converting flow of an FTP message in the embodiment of the present invention;
fig. 5 is a schematic structural diagram of NPHOST function in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiment of the present invention, referring to fig. 1, in the process of performing remote FTP interaction, when remote FTP control plane data reaches an external S1 port of a base station, the remote FTP control plane data enters a B end point inside the base station from an a end point outside the base station, where the remote FTP control plane data enters an NPHOST inside the base station through a Network Processor (NP), and enters the B end point inside the base station after being processed by the NPHOST. In addition, when the remote FTP control plane data reaches the B endpoint inside the base station, the remote FTP control plane data reaches the NP through the B endpoint, then enters NPHOST inside the base station through the NP, enters the A endpoint outside the base station after being processed by the NPHOST. And the remote FTP data plane data is directly forwarded through NP without NPHOST processing.
In the process of remote maintenance of the base station, the remote FTP is connected to a target processor through a debugging (Console) tool, then uploading and downloading of FTP files are carried out, the running Console tool serves as a server, a maintained processor serves as a remote client, the base station confirms the unique remote client according to a processor number slotID and a slot number procID, NP and NPHOST are different modules located inside the base station, NP presents an Internet Protocol (IP) address interconnected between networks outside the base station, and NPHOST presents an IP address inside the base station.
Referring to fig. 2, in the embodiment of the present invention, a detailed flow for implementing remote FTP transmission is as follows:
step 200: the NPHOST sends a file Transmission request initiated by the remote client to the server, and triggers a Control plane Transmission Control Protocol (TCP) handshake flow between the remote client and the server.
Specifically, in the embodiment of the present invention, the FTP is implemented based on the TCP, after the remote client initiates a file transfer request, and before sending data to the server through the NPHOST, in order to improve reliable transmission of the data, a control plane TCP handshake flow needs to be completed with the server, where the control plane TCP handshake flow includes three handshakes.
Specifically, in the first handshake, the remote client sends a synchronization sequence number (SYN) packet (SYN j) to the server, enters a SYN _ send state, and waits for the server to confirm; in the second handshake, the server receives the SYN packet, and must acknowledge the SYN (ACK ═ j +1) of the remote client, and at the same time, it also sends a SYN packet (SYN ═ k), i.e., SYN + ACK packet, and at this time, the server enters the SYN _ RECV state; in the third handshake, the remote client receives the SYN + ACK packet of the server, and sends an acknowledgement packet ACK (ACK ═ k +1) to the server, and after the acknowledgement packet is sent, the remote client and the server enter an establishment complete (ESTABLISHED) state, and the three-way handshake is completed.
Step 201: the server returns a connection establishment response message to the remote client through the NPHOST.
Specifically, in the embodiment of the present invention, after the server and the remote client complete the TCP handshake procedure of the control plane, the NPHOST sends the connection establishment response message 220welcome to imt ftp server to the remote client, which indicates that the TCP connection is successful.
Step 202: the remote client sends the user name request to the server through NPHOST, and triggers the server to verify the user name.
Specifically, in the embodiment of the present invention, after receiving a connection establishment response message returned by the server, the remote client sends the USER name USER no _ tpf to the server through NPHOST, and triggers the server to verify the USER name.
Step 203: and when the server verifies that the user name is correct, a request password response message is returned to the remote client through the NPHOST, and the remote client is triggered to send a password request.
Specifically, in the embodiment of the present invention, when the server verifies that the USER name USER no _ tpf is correct, the server sends a request password response message of 331USER name okay, need password to the remote client through NPHOST, and triggers the remote client to send a password request.
Step 204: NPHOST sends a password request sent by a remote client to a server, and triggers a processor to verify the password.
Specifically, in the embodiment of the present invention, after receiving a request password response message returned by the server, the remote client sends the password PASS nb _ tpf to the server through NPHOST, and triggers the server to verify the password.
Step 205: and when the server verifies that the password is correct, a user login response message is returned to the remote client through the NPHOST, and the remote client is triggered to enter an FTP message transmission format request flow.
Specifically, in the embodiment of the present invention, when the server verifies that the password PASS nb _ tpf is correct, the server forwards the User login response message 230User logged in, and the processed message to the remote client through NPHOST, allowing the User name User no _ tpf with the password PASS nb _ tpf to log in the remote client, and triggering the remote client to enter a subsequent processing flow, for example, an FTP message transmission format request.
Step 206: the remote client sends the FTP message transmission format request to the server through NPHOST, and triggers the server to set the FTP message transmission format.
Specifically, in the embodiment of the present invention, after receiving a user login response message returned by the server, the remote client sends an FTP message transmission format request TYPE I to the server through NPHOST, and triggers the server to set the transmission format of the FTP message.
Step 207: after finishing the FTP message transmission format setting, the server informs the remote client to enter a mode request process through NPHOST.
Specifically, in the embodiment of the present invention, after receiving an FTP message transmission format request TYPE I sent by a remote client, a server sets a transmission format of the FTP message to TYPE I, and notifies the remote client to enter a mode request procedure through NPHOST, for example, may notify the remote client to enter the mode request procedure through 200TYPE set to I.
Step 208: NPHOST receives a PASV mode request sent by a remote client, converts the PASV mode request into an EPSV mode request and then sends the EPSV mode request to a server, and the server is triggered to verify the EPSV mode request.
Specifically, in the embodiment of the present invention, the mode switching is performed only when the remote client currently operates in the PASV mode and the server currently operates in the EPSV mode.
Step 209: after confirming that the EPSV mode can be supported, the server sends 229 a response message to NPHOST, and NPHOST converts 227 the response message to a 227 response message and sends the response message to the remote client.
For example, after the server confirms that the FTP message can be transferred in the EPSV Mode, it sends 229 an explicit Passive Mode OK to NPHOST, which converts 229 the response message into 227Passive Mode.
Step 210: after receiving 227 response messages sent by the server through NPHOST, the remote client performs a data plane TCP handshake flow between the NP and the server.
Specifically, in the embodiment of the present invention, FTP is implemented based on TCP, after a remote client receives 227Passive Mode sent by a server through NPHOST, and before sending data to the server through NP, in order to improve reliable transmission of data, the remote client and the server are required to complete a data plane TCP handshake flow, where the data plane TCP handshake flow includes three handshakes, which is not described herein again.
Step 211: and the remote client sends an FTP file path request to the server through the NPHOST and requests to acquire the FTP file.
For example, the remote client sends an FTP file path request RETR D: \ temp \ FTP test.tmp to the server through NPHOST, and requests to acquire the file with the file path.
Step 212: and the server returns a file response message to the remote client through the NPHOST and sends the FTP file to the remote client through the NP.
For example, after NPHOST sends a file response message RETR D: \ temp \ FTP test.tmp sent by the server to the remote client, a file response message 150Opening BINARY mode data connection for file transfer is sent to the remote client, which indicates that a BINARY mode data connection is established between the server and the remote client, and further, NP sends the FTP file comprising a plurality of data streams to the remote client.
Step 213: and after the NP sends the FTP file to the remote client, triggering a data plane TCP FIN handshake flow between the remote client and the server.
Specifically, in the embodiment of the present invention, the FTP is implemented based on the TCP, and after the server sends the FTP file to the remote client through the NP, in order to ensure that the data transmission is successfully completed, a data plane TCP FIN handshake flow needs to be completed between the remote client and the server, where the data plane TCP FIN handshake flow includes three handshakes, which is not described herein again.
Step 214: the server returns a file transmission completion response message to the remote client through the NPHOST.
For example, after the data plane TCP FIN handshake procedure is completed between the remote client and the server, the NPHOST receives a File Transfer complete response message 226File Transfer complete returned by the server, and sends the File Transfer complete response message to the remote client, which indicates that the server has transferred the FTP File to the remote client.
Step 215: the remote client sends the quit request to the server through NPHOST, and the flow is ended.
For example, after the remote client receives a file transfer completion response message returned by the server, NPHOST receives a QUIT request sent by the remote client and sends the QUIT request to the server.
Step 216: and the NPHOST sends the end response message returned by the server to the remote client, and the flow is ended.
For example, after the NPHOST sends the quit request sent by the remote client to the server, the NPHOST receives a finish response message 221Good Bye returned by the server, and sends 221Good Bye to the remote client, so that the F TP file transmission process is finished.
Referring now to FIG. 3, steps 207-209 are described in further detail.
Step 300: NPHOST determines that the server currently adopts an EPSV mode based on the IPV6 according to the notification of the server.
Specifically, in the embodiment of the present invention, after the server completes the FTP message transmission format setting, the NPHOST determines, according to the notification from the server, that the server currently uses the EPSV 6-based EPSV mode.
Step 301: and the NPHOST judges the working state of the remote client according to a control message sent to the server by the remote client.
Specifically, in the embodiment of the present invention, NPHOST may obtain a control packet in an FTP message sent by a remote client to the server, and determine the working state of the remote client according to the control packet, that is, determine whether the remote client is currently working in a PASV mode.
Step 302: and the NPHOST acquires the FTP message of the PASV mode sent by the remote client when determining that the remote client currently adopts the PASV mode based on the IPV4 based on the working state, converts the PASV mode of the FTP message into the EPSV mode, and sends the FTP message of the EPSV mode to the server.
Specifically, in the embodiment of the present invention, the mode switching is performed only when the remote client currently operates in the PASV mode and the server currently operates in the EPSV mode. And the NPHOST determines that the remote client currently adopts the PASV mode based on the IPV4 based on the working state of the remote client, converts the acquired FTP message of the PASV mode into the FTP message of the EPSV mode, sends the converted FTP message of the EPSV mode to the server, and triggers the server to verify the EPSV mode of the FTP message.
Step 303: and the NPHOST receives a response message returned by the server, and sends the response message carrying the PASV response identifier to the remote client after acquiring the EPSV response identifier carried by the response message and aiming at the FTP message and converting the EPSV response identifier into the PASV response identifier.
Specifically, in the embodiment of the present invention, after verifying the EPSV Mode of the FTP message and confirming that the FTP message is transmitted using the EPSV Mode, the server sends 229 an outgoing Passive Mode OK to the NPHOST, and the NPHOST converts the EPSV response identifier into a PASV response identifier, that is, the NPHOST converts the 229 outgoing Passive Mode OK into 227Passive Mode, and then sends the response message carrying the PASV response identifier to the remote client, that is, the NPHOST 227 sends the 227Passive Mod to the remote client.
Referring to fig. 4, a specific application scenario is taken as an example, and a case that the remote client currently uses IPV4 to transmit FTP messages and the server can support IPV4 or IPV6 is described in further detail below.
Step 400: NPHOST receives a notification sent by the server to the remote client.
Specifically, in the embodiment of the present invention, after completing setting the FTP message transmission format, the server sends the 200Type set I notification to the remote client through the NPHOST, and triggers the remote client to enter the mode request flow.
Step 401: NPHOST judges whether the server is an IPV6FTP server currently or not according to the notification of the server, if so, the step 402 is executed, and if not, the step 404 is executed.
Specifically, in the embodiment of the present invention, the NPHOST determines, according to the notification from the server, whether the server is the IPV6FTP server currently, that is, determines whether the server currently uses the EPSV mode based on IPV6 to transmit the FTP message, if the server currently uses the EPSV mode based on IPV6 to transmit the FTP message, step 402 is executed, otherwise step 404 is executed.
Step 402: NPHOST judges whether the FTP message is in PASV mode according to a control message sent to the server by the remote client, if so, the step 403 is executed, otherwise, the step 404 is executed.
Specifically, in the embodiment of the present invention, when the NPHOST determines that the server currently uses the EPSV 6-based EPSV mode to transmit the FTP message, the NPHOST may obtain a control message in the FTP message sent by the remote client to the server, and determine whether the FTP message is in the PASV mode according to the control message, that is, determine whether the remote client currently operates in the PASV mode, if the remote client currently operates in the PASV mode, execute step 403, otherwise, execute step 404.
Step 403: NPHOST converts the FTP message from PASV mode to EPSV mode and records the conversion mark.
Specifically, in the embodiment of the present invention, NPHOST determines that the remote client currently operates in the PASV mode, and when the server currently operates in the EPSV mode, the NPHOST converts the FTP message from the PASV mode to the EPSV mode according to the obtained FTP message of the PASV mode sent by the remote client, and sends the converted FTP message to the server, and records that the conversion flag of the mode is 1.
Step 404: NPHOST determines whether the response message is 227 data, if yes, step 405 is executed, otherwise, step 407 is executed. Specifically, in the embodiment of the present invention, NPHOST converts an FTP message sent by a remote client from a PASV mode to an EPSV mode, and sends the FTP message to a server, then obtains a response message returned by the server to the remote client, and determines whether the response message is 227 data, that is, determines whether a response identifier of the response message is a PASV response identifier.
Step 405: NPHOST judges whether the server is an IPV4FTP server currently, if yes, step 406 is executed, and if not, step 411 is executed.
Specifically, in the embodiment of the present invention, NPHOST determines whether the server is currently an IPV4FTP server, that is, determines whether the server currently uses a PASV mode based on IPV4 to transmit the response message, if the server currently uses a PASV mode based on IPV4 to transmit the response message, step 406 is executed, otherwise, step 411 is executed.
Step 406: NPHOST acquires the monitoring port number of the FTP data plane data of the server.
Specifically, in the embodiment of the present invention, when determining that the server currently uses the PASV mode based on IPV4 to transmit the response message, the NPHOST acquires the listening port number of the FTP data plane of the server, and sends 227 the data to the remote client according to the listening port number.
Step 407: NPHOST determines whether the response message is 229 data, if yes, step 408 is performed, otherwise, step 411 is performed.
Specifically, in the embodiment of the present invention, after the NPHOST sends the response message of the converted EPSV mode to the server, and when it is determined that the response message is not 227 data, further determination is made as to whether the response message is 229 data, that is, it is determined whether a response identifier of the response message is an EPSV response identifier.
Step 408: NPHOST acquires the monitoring port number of the FTP data plane data of the server.
Specifically, in this embodiment of the present invention, NPHOST determines that the response message is 229 data, that is, when determining that the response identifier of the response message is the EPSV response identifier, obtains the listening port number of the FTP data plane data of the server.
Step 409: NPHOST judges whether the server is an IPV6FTP server currently and whether a conversion mark exists, if so, step 410 is executed, and if not, step 411 is executed.
Specifically, in the embodiment of the present invention, NPHOST determines whether the server is currently an IPV6FTP server, that is, determines whether the server currently uses an EPSV mode based on IPV6 to transmit the response message, if the server currently uses an EPSV mode based on IPV6 to transmit the response message and has a data conversion flag 0, step 410 is executed, otherwise step 411 is executed.
Step 410: NPHOST modifies the response message and keeps the length of the response message unchanged. Specifically, in this embodiment of the present invention, the NPHOST determines that the server currently uses the EPSV Mode based on IPV6 to transmit the response message, and when the data conversion flag is 0, modifies the response message, that is, converts 229 data sent by the server into 227 data by converting the EPSV response identifier into a PASV response identifier, and keeps the length of the response message unchanged, for example, 229 data replied by the server is 229Extended Passive Mode OK. (| 51358|) \ r \ n, and 227 data after conversion is 227Passive Mode (1,1,1,1,200,158).00000\ r \ n, where the byte count of 229 data and 227 data is 39 bits, that is, the byte count remains unchanged during the conversion of the response message.
Step 411: NPHOST sends the response message returned by the server to the remote client.
That is, the NPHOST determines that the response message is 227 data, and when the monitor port number of the FTP data plane of the IPV4FTP server is acquired, or the monitor port number of the FTP data plane of the IPV6FTP server is acquired, converts 229 data sent by the server into 227 data, and sends 227 data to the remote client.
Based on the above embodiments, referring to fig. 5, in an embodiment of the present invention, NPHOST at least includes: a determination unit 101, a decision unit 102, a first processing unit 103 and a second processing unit 104, wherein,
a determining unit 101, configured to determine, according to a notification of a server, that the server currently employs an extensible passive EPSV mode based on IPV6 version6 of the internet protocol;
a determining unit 102, configured to determine a working state of a remote client according to a control packet sent by the remote client to the server;
the first processing unit 103 is configured to, based on the operating state, obtain an FTP message in the PASV mode sent by the remote client when it is determined that the remote client currently adopts a passive PASV mode based on the IPV4 th edition of internet protocol 4, convert the FTP message from the PASV mode to an EPSV mode, and send the FTP message in the EPSV mode to the server;
the second processing unit 104 is configured to receive the response message returned by the server, and send the response message carrying the PASV response identifier to the remote client when acquiring the EPSV response identifier, which is carried by the response message and is specific to the FTP message, and after converting the EPSV response identifier into the PASV response identifier.
Optionally, before determining that the server currently adopts the EPSV 6-based EPSV mode according to the notification of the server, the determining unit 101 is further configured to:
sending a user name request sent by a remote client to the server, triggering the server to verify the user name, and returning a request password response message to the remote client;
sending a password request sent by the remote client to the server, triggering the server to verify the password, and returning a user login response message to the remote client;
and sending a user login response message returned by the server to the remote client, triggering the remote client to enter an FTP message transmission format request process, sending the FTP message transmission format request sent by the remote client to the server, and triggering the server to set an FTP message transmission format.
Optionally, when receiving a response message returned by the server, and acquiring an EPSV response identifier carried in the response message and directed to the FTP packet, and after converting the EPSV response identifier into a PASV response identifier, the second processing unit 104 is specifically configured to send the response message carrying the PASV response identifier to the remote client:
and receiving 229 response messages which are sent by the server and carry EPSV response identifiers, converting the EPSV response identifiers into PASV response identifiers, and sending 227 response messages which carry the PASV response identifiers to the remote client.
Optionally, when receiving a response message returned by the server, and acquiring an EPSV response identifier carried in the response message and directed to the FTP message, and after converting the EPSV response identifier into a PASV response identifier, and after sending the response message carrying the PASV response identifier to the remote client, the second processing unit 104 is further configured to:
and acquiring a response message sent to the remote client by the server, and triggering a data plane Transmission Control Protocol (TCP) handshake process between the remote client and the server.
Optionally, when receiving a response message returned by the server, and acquiring an EPSV response identifier carried in the response message and directed to the FTP message, and after converting the EPSV response identifier into a PASV response identifier, and after sending the response message carrying the PASV response identifier to the remote client, the second processing unit 104 is further configured to:
and sending the FTP file path request of the remote client to the server, and sending the FTP message to the remote client after returning a file response message to the remote client.
Optionally, when receiving a response message returned by the server, and acquiring an EPSV response identifier carried in the response message and directed to the FTP message, and after converting the EPSV response identifier into a PASV response identifier, and after sending the response message carrying the PASV response identifier to the remote client, the second processing unit 104 is further configured to:
and sending the exit request of the remote client to the server, sending an end response message returned by the server to the remote client, and ending the FTP message transmission process.
Based on the same inventive concept, an embodiment of the present invention provides a storage medium storing a program for implementing a method for implementing remote FTP transmission, where the program, when executed by a processor, performs the following steps:
determining that the server currently adopts an extensible passive EPSV mode based on an IPV6 version6 of an Internet protocol according to the notification of the server;
judging the working state of a remote client according to a control message sent by the remote client to the server;
based on the working state, when determining that the remote client currently adopts a passive PASV mode based on IPV4 version 4 of the Internet protocol, acquiring an FTP message of the PASV mode sent by the remote client, converting the PASV mode of the FTP message into an EPSV mode, and sending the FTP message of the EPSV mode to the server;
and when a response message returned by the server is received and an EPSV response identifier carried by the response message and aiming at the FTP message is acquired, and after the EPSV response identifier is converted into a PASV response identifier, the response message carrying the PASV response identifier is sent to the remote client.
Based on the same inventive concept, the embodiment of the invention provides a communication device, which comprises one or more processors; and one or more computer-readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform the method of any of the above.
In summary, in the embodiment of the present invention, first, the NPHOST determines, according to the notification from the server, that the server currently uses the EPSV 6-based EPSV mode, and when determining, according to the control packet, that the remote client currently uses the IPV 4-based passive PASV mode, converts the PASV mode of the FTP packet into the EPSV mode, and sends the EPSV mode to the server, and then converts the EPSV response identifier into the PASV response identifier, and sends the response message carrying the PASV response identifier to the remote client. Therefore, NPHOST can carry out mode conversion on the FTP message, and sends the response message returned by the server to the remote client after conversion, thereby realizing the transmission flow of the remote FTP, ensuring the smooth transmission of the FTP message between the remote client and the server even if the network protocols supported by the remote client and the server are inconsistent, further ensuring that the remote client can successfully access the server, meeting the requirements for various complex network scenes, simplifying the maintenance processing flow of equipment and improving the utilization rate of network resources.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (14)

1. A method for implementing remote File Transfer Protocol (FTP) transmission is characterized by comprising the following steps:
the network processor attachment protocol stack NPHOST determines that the server currently adopts an extensible passive EPSV mode based on an internet protocol version6 IPV6 according to the notification of the server;
the NPHOST judges the working state of the remote client according to a control message sent to the server by the remote client;
the NPHOST acquires an FTP message of a PASV mode sent by the remote client when determining that the remote client currently adopts a passive PASV mode based on an IPV4 version 4 of an Internet protocol based on the working state, converts the PASV mode of the FTP message into an EPSV mode, and sends the FTP message of the EPSV mode to the server;
and the NPHOST receives a response message returned by the server, and sends the response message carrying the PASV response identifier to the remote client after acquiring the EPSV response identifier carried by the response message and aiming at the FTP message and converting the EPSV response identifier into the PASV response identifier.
2. The method of claim 1, wherein NPHOST determines from a notification by a server that the server is currently employing IPV 6-based EPSV mode before, further comprising:
the NPHOST sends a user name request sent by a remote client to the server, triggers the server to verify the user name, and returns a request password response message to the remote client;
the NPHOST sends a password request sent by the remote client to the server, triggers the server to verify the password, and returns a user login response message to the remote client;
and the NPHOST sends a user login response message returned by the server to the remote client, triggers the remote client to enter an FTP message transmission format request process, sends the FTP message transmission format request sent by the remote client to the server, and triggers the server to set an FTP message transmission format.
3. The method according to claim 1, wherein the NPHOST receives the response message returned by the server, and when acquiring the EPSV response identifier carried in the response message for the FTP message and after converting the EPSV response identifier into a PASV response identifier, sends the response message carrying the PASV response identifier to the remote client, specifically including:
the NPHOST receives 229 response messages carrying EPSV response identifiers sent by the server, converts the EPSV response identifiers into PASV response identifiers, and then sends 227 response messages carrying the PASV response identifiers to the remote client.
4. The method as claimed in claim 1 or 3, wherein the NPHOST, when receiving the response message returned by the server and acquiring the EPSV response identifier carried by the response message for the FTP message, and after converting the EPSV response identifier into a PASV response identifier, further after sending the response message carrying the PASV response identifier to the remote client, further comprises:
the NPHOST acquires a response message sent to the remote client by the server, and triggers a data plane Transmission Control Protocol (TCP) handshake process between the remote client and the server.
5. The method as claimed in claim 1 or 3, wherein the NPHOST, when receiving the response message returned by the server and acquiring the EPSV response identifier carried by the response message for the FTP message, and after converting the EPSV response identifier into a PASV response identifier, further after sending the response message carrying the PASV response identifier to the remote client, further comprises:
and the NPHOST sends the FTP file path request of the remote client to the server, and sends the FTP message to the remote client after returning a file response message to the remote client.
6. The method as claimed in claim 1 or 3, wherein the NPHOST, when receiving the response message returned by the server and acquiring the EPSV response identifier carried by the response message for the FTP message, and after converting the EPSV response identifier into a PASV response identifier, further after sending the response message carrying the PASV response identifier to the remote client, further comprises:
and the NPHOST sends the quit request of the remote client to the server, sends an end response message returned by the server to the remote client and ends the FTP message transmission process.
7. An apparatus for implementing a remote File Transfer Protocol (FTP) transmission, comprising:
a determining unit, configured to determine, according to a notification of a server, that the server currently employs an extensible passive EPSV mode based on IPV6 version6 of the internet protocol;
the judging unit is used for judging the working state of the remote client according to a control message sent to the server by the remote client;
the first processing unit is used for acquiring an FTP message of a PASV (passive PASV) mode sent by the remote client when the remote client currently adopts a passive PASV mode based on IPV4 version 4 of an Internet protocol based on the working state, converting the PASV mode of the FTP message into an EPSV mode, and sending the FTP message of the EPSV mode to the server;
and the second processing unit is used for receiving the response message returned by the server, and sending the response message carrying the PASV response identifier to the remote client after the EPSV response identifier carried by the response message and aiming at the FTP message is acquired and converted into the PASV response identifier.
8. The apparatus of claim 7, wherein before NPHOST determines from a notification by a server that the server is currently employing the EPSV mode based on the IPV6, the determining unit is further to:
sending a user name request sent by a remote client to the server, triggering the server to verify the user name, and returning a request password response message to the remote client;
sending a password request sent by the remote client to the server, triggering the server to verify the password, and returning a user login response message to the remote client;
and sending a user login response message returned by the server to the remote client, triggering the remote client to enter an FTP message transmission format request process, sending the FTP message transmission format request sent by the remote client to the server, and triggering the server to set an FTP message transmission format.
9. The apparatus of claim 7, wherein the NPHOST receives a response message returned by the server, and when acquiring an EPSV response identifier carried in the response message for the FTP packet and after converting the EPSV response identifier into a PASV response identifier, sends the response message carrying the PASV response identifier to the remote client, and the second processing unit is specifically configured to:
and receiving 229 response messages which are sent by the server and carry EPSV response identifiers, converting the EPSV response identifiers into PASV response identifiers, and sending 227 response messages which carry the PASV response identifiers to the remote client.
10. The apparatus according to claim 7 or 9, wherein when the NPHOST receives the response message returned by the server, and acquires the EPSV response identifier carried in the response message for the FTP message, and after the EPSV response identifier is converted into a PASV response identifier, and after the response message carrying the PASV response identifier is sent to the remote client, the second processing unit is further configured to:
and acquiring a response message sent to the remote client by the server, and triggering a data plane Transmission Control Protocol (TCP) handshake process between the remote client and the server.
11. The apparatus according to claim 7 or 9, wherein when the NPHOST receives the response message returned by the server, and acquires the EPSV response identifier carried in the response message for the FTP message, and after the EPSV response identifier is converted into a PASV response identifier, and after the response message carrying the PASV response identifier is sent to the remote client, the second processing unit is further configured to:
and sending the FTP file path request of the remote client to the server, and sending the FTP message to the remote client after returning a file response message to the remote client.
12. The apparatus according to claim 7 or 9, wherein when the NPHOST receives the response message returned by the server, and acquires the EPSV response identifier carried in the response message for the FTP message, and after the EPSV response identifier is converted into a PASV response identifier, and after the response message carrying the PASV response identifier is sent to the remote client, the second processing unit is further configured to:
and sending the exit request of the remote client to the server, sending an end response message returned by the server to the remote client, and ending the FTP message transmission process.
13. A storage medium storing a program for implementing a method for remote FTP transmission, the program, when executed by a processor, performing the steps of:
determining that the server currently adopts an extensible passive EPSV mode based on an IPV6 version6 of an Internet protocol according to the notification of the server;
judging the working state of a remote client according to a control message sent by the remote client to the server;
based on the working state, when determining that the remote client currently adopts a passive PASV mode based on IPV4 version 4 of the Internet protocol, acquiring an FTP message of the PASV mode sent by the remote client, converting the PASV mode of the FTP message into an EPSV mode, and sending the FTP message of the EPSV mode to the server;
and when a response message returned by the server is received and an EPSV response identifier carried by the response message and aiming at the FTP message is acquired, and after the EPSV response identifier is converted into a PASV response identifier, the response message carrying the PASV response identifier is sent to the remote client.
14. A communications apparatus comprising one or more processors; and one or more computer-readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the method of any of claims 1-6.
CN201811438158.1A 2018-11-27 2018-11-27 Method and device for realizing remote FTP transmission Active CN111225015B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811438158.1A CN111225015B (en) 2018-11-27 2018-11-27 Method and device for realizing remote FTP transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811438158.1A CN111225015B (en) 2018-11-27 2018-11-27 Method and device for realizing remote FTP transmission

Publications (2)

Publication Number Publication Date
CN111225015A true CN111225015A (en) 2020-06-02
CN111225015B CN111225015B (en) 2021-12-14

Family

ID=70829189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811438158.1A Active CN111225015B (en) 2018-11-27 2018-11-27 Method and device for realizing remote FTP transmission

Country Status (1)

Country Link
CN (1) CN111225015B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113315833A (en) * 2021-05-26 2021-08-27 北京天空卫士网络安全技术有限公司 File transfer mode processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7391768B1 (en) * 2003-05-13 2008-06-24 Cisco Technology, Inc. IPv4-IPv6 FTP application level gateway
US20080172457A1 (en) * 2005-08-31 2008-07-17 Huawei Technologies Co., Ltd. Method for testing the service performance of the file transfer protocol
CN101237401A (en) * 2008-02-26 2008-08-06 中兴通讯股份有限公司 Data connection establishing method and router
CN101325580A (en) * 2007-06-15 2008-12-17 上海亿人通信终端有限公司 Method for implementing FTP application-layer gateway based on NAT-PT
CN102148845A (en) * 2010-02-08 2011-08-10 中兴通讯股份有限公司 File transfer protocol (FTP) data transmission method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7391768B1 (en) * 2003-05-13 2008-06-24 Cisco Technology, Inc. IPv4-IPv6 FTP application level gateway
US20080172457A1 (en) * 2005-08-31 2008-07-17 Huawei Technologies Co., Ltd. Method for testing the service performance of the file transfer protocol
CN101325580A (en) * 2007-06-15 2008-12-17 上海亿人通信终端有限公司 Method for implementing FTP application-layer gateway based on NAT-PT
CN101237401A (en) * 2008-02-26 2008-08-06 中兴通讯股份有限公司 Data connection establishing method and router
CN102148845A (en) * 2010-02-08 2011-08-10 中兴通讯股份有限公司 File transfer protocol (FTP) data transmission method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113315833A (en) * 2021-05-26 2021-08-27 北京天空卫士网络安全技术有限公司 File transfer mode processing method and device
CN113315833B (en) * 2021-05-26 2022-09-13 北京天空卫士网络安全技术有限公司 File transfer mode processing method and device

Also Published As

Publication number Publication date
CN111225015B (en) 2021-12-14

Similar Documents

Publication Publication Date Title
EP3755024B1 (en) Message processing method, system, and user plane function device
CN110999257B (en) Delivery method selection for delivery of server notifications
US20160119287A1 (en) Optimized transport layer security
CN112165447B (en) WAF equipment-based network security monitoring method, system and electronic device
CN111434083B (en) Network management equipment and centralized authorization server for NETCONF
CN110830925A (en) Session management method and device for user group
KR20100084118A (en) Method for improving a tcp data transmission process in case the physical transmission medium is disconnected
CN111064742B (en) Method, device and related equipment for realizing intranet access based on network agent
EP2692115A1 (en) Sctp endpoint migration
US9917926B2 (en) Communication method and communication system
CN111225015B (en) Method and device for realizing remote FTP transmission
CN107104919B (en) Firewall equipment and processing method of Stream Control Transmission Protocol (SCTP) message
US20220286877A1 (en) Redundant session establishment method and apparatus, radio bearer establishment method and apparatus, and nodes, terminal, and medium
CN108574615B (en) Content transmission method, device and system based on multipath MPTCP
US9602493B2 (en) Implicit challenge authentication process
EP3896926A1 (en) Network device and packet processing method using same
KR101730405B1 (en) Method of managing network route and network entity enabling the method
CN111541732A (en) Method for avoiding invalid occupation of connection resources by clients in P2P network, computer readable storage medium and P2P network
CN112087745A (en) Network distribution method and device of household appliance, electronic device and storage medium
CN112469043B (en) Authentication method and device
JP2019103118A (en) Communication relay device, communication relay program, and communication relay method
US9198090B2 (en) Node and method for AoIP address change
CN111367477B (en) 3D printing device, connection method, data processing device, control method and medium
TW201815193A (en) Method for transmitting information, network device and terminal device
CN113875197B (en) Bidirectional forwarding detection authentication

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant