CN102148845A - File transfer protocol (FTP) data transmission method and system - Google Patents

File transfer protocol (FTP) data transmission method and system Download PDF

Info

Publication number
CN102148845A
CN102148845A CN2010101121664A CN201010112166A CN102148845A CN 102148845 A CN102148845 A CN 102148845A CN 2010101121664 A CN2010101121664 A CN 2010101121664A CN 201010112166 A CN201010112166 A CN 201010112166A CN 102148845 A CN102148845 A CN 102148845A
Authority
CN
China
Prior art keywords
ftp
ftp server
address
client
server
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
CN2010101121664A
Other languages
Chinese (zh)
Other versions
CN102148845B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201010112166.4A priority Critical patent/CN102148845B/en
Publication of CN102148845A publication Critical patent/CN102148845A/en
Application granted granted Critical
Publication of CN102148845B publication Critical patent/CN102148845B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a file transfer protocol (FTP) data transmission method and an FTP data transmission system. If a data session creation mode is an active mode, an FTP client transmits own Internet protocol (IP) address and a temporary port number to an FTP server in a control session by a PORT command or an EPRT command for the data session creation of the FTP server. If the data creation mode is a passive mode, the FTP server transmits own IP address and the temporary port number to the FTP client in the control session by a PASV command or an EPSV command transmitted by the FTP client for the data session creation of the FTP client. By the method and the system, the communication of the FTP client and the FTP server between an Internet protocol Version 6 (IPv6) network and an IPv4 network can be realized under the condition of not adding an application layer gateway.

Description

A kind of method and system of realizing the FTP transfer of data
Technical field
The present invention relates to the File Transfer Protocol data conversion technique of IPv6 network, be meant a kind of method and system of the FTP of realization transfer of data especially to the IPv4 network.
Background technology
IVI is a kind of protocol translation technology, can solve the network layer translation of internet protocol version 6 (IPv6, InternetProtocol Version 6) network and internet protocol version 4 (IPv4, Internet Protocol Version 4) network packet.The main thought of IVI map addresses algorithm is: take out a part of address and be mapped in the global IPv 6 address space (IPG6) from global ip v4 address space (IPG4).
In IPG4, each operator takes out a part of IPv4 address, is used to use in the IVI transition, and this part address that is removed is called IVI4 (i) address, and this part address can not be distributed to the actual physical main frame and use.Along with the carrying out of IVI transition, the scope of IVI4 (i) is extended gradually, and when all IPv4 addresses were not used by physical host, the IVI transition was finished.Each IVI4 (i) map addresses is the address bunch among the IPG6, be expressed as IVI6 (i), address in this part space can be by (the ISP of each ISP, Internet Service Provider) distributing to the user uses, wherein, the map addresses rule is to take to insert in the IPv6 address way of IPv4 address, this address transition can be called the stateless address conversion, concrete, the structure of the IPv6 address of the IVI form that obtains after the map addresses is: the 0-31 position be ISP/32 IPv6 prefix, the 32-39 position is set to FF, represent that this is an IVI mapping address, the address format of the global I PG4 that the 40-71 bit representation inserts, be mapped as IPv6/64 as IPv4/24, and IPv4/32 is mapped as IPv6/72.
If adopt the IVI transition scheme, then can give the subscriber's main station of pure IPv6 network the address assignment among the IVI6 (i), like this, the client that is positioned at the IPv6 network sends to IVI equipment to the packet that uses IVI6 (i) address earlier, be translated as the packet that uses IVI4 (i) address by IVI equipment, and then send to the server that is positioned at the IPv4 network, thereby make IPv6 client and the existing IPv4 server can mutual communication.
At present, the IVI technology can be to HTML (Hypertext Markup Language) (HTTP, Hyper Text TransferProtocol), safety shell protocol (SSH, Secure Shell) etc. data are done the stateless address conversion, and for file transfer protocol (FTP) (FTP, File Transfer Protocol) packet is not supported, it is just passable to increase extra ALG (ALG) on IVI equipment, but ALG can greatly increase the performance cost of IVI equipment.In addition, the uncertain ftp server of ftp client whether with the situation that self is positioned at network (IPv6 network or IPv4 network) with a kind of IP agreement under, do not have a kind of means can support the intercommunication of ftp client and ftp server at present yet.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of method of the FTP of realization transfer of data, can not increase under the situation of ALG the intercommunication of ftp client and ftp server between realization IPv6 network and the IPv4 network at IVI equipment.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention provides a kind of method of the FTP of realization transfer of data, this method comprises:
Determine the pattern of setting up of the data session between file transfer protocol (FTP) (FTP) client and the ftp server;
Described when setting up pattern and being aggressive mode, described ftp client number by PORT order or EPRT order, sends to described ftp server with its own IP address and transient port in the control session; Described ftp server is destination address, is destination interface with the transient port with the IP address of described ftp client, sets up data session;
Described when setting up pattern and being Passive Mode, PASV order or EPSV order that described ftp server sends according to described ftp client number send to described ftp client with its own IP address and transient port in the control session; Described ftp client is destination address, is destination interface with the transient port with the IP address of described ftp server, sets up data session.
Further, determine setting up before the pattern of described data session, this method further comprises: set up the control session between described ftp client and the ftp server.
Further, described ftp client is positioned at the IPv6 network, and described ftp server is positioned at IPv6 or IPv4 network, and described when setting up pattern and being aggressive mode, and described ftp server is set up data session, is specially:
After described ftp client is the IPv4 address with self IPv6 address transition, number order by PORT together with transient port, send to ftp server in control in the session, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client directly with self the IPv6 address and transient port number by the EPRT order, in the control session, send to ftp server, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session; Perhaps,
Described ftp client directly with self the IPv6 address and transient port number by the EPRT order, in the control session, send to ftp server, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client be behind the IPv4 address with self IPv6 address transition and transient port number together by the PORT order, in the control session, send to ftp server, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session.
Further, described ftp client is positioned at the IPv4 network, when described ftp server is positioned at IPv6 or IPv4 network, and described when setting up pattern and being aggressive mode, described ftp server is set up data session, is specially:
After described ftp client is the IPv6 address with self IPv4 address transition, number order by EPRT together with transient port, send to ftp server in control in the session, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client will be directly self the IPv4 address and transient port number by the PORT order, in the control session, send to ftp server, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session; Perhaps,
Described ftp client will be directly self the IPv4 address and transient port number by the PORT order, in the control session, send to ftp server, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client be behind the IPv6 address with self IPv4 address transition and transient port number together by the EPRT order, in the control session, send to ftp server, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session.
Further, described ftp client is positioned at the IPv6 network, and when described ftp server is positioned at IPv6 or IPv4 network and described when setting up pattern and being Passive Mode, described ftp client is set up data session, is specially:
Described ftp client sends the PASV order to ftp server, receiving correct PASV that ftp server returns when replying, the IPv4 address transition that therefrom extracts ftp server is the IPv6 address, and according to IPv6 address after the conversion and transient port number, sets up data session; Otherwise ftp client sends the EPSV order by the control session to ftp server, is receiving correct EPSV that ftp server returns when replying, and therefrom extracts the IPv6 address of ftp server and transient port number, sets up data session; Perhaps,
Described ftp client sends the EPSV order by the control session to ftp server, is receiving correct EPSV that ftp server returns when replying, and therefrom extracts the IPv6 address of ftp server and transient port number, sets up data session; Otherwise, ftp client sends the PASV order to ftp server, is receiving correct PASV that ftp server returns when replying, and the IPv4 address transition that therefrom extracts ftp server is the IPv6 address, and, set up data session according to IPv6 address after the conversion and transient port number.
Further, described ftp client is positioned at the IPv4 network, and when described ftp server is positioned at IPv6 or IPv4 network and described when setting up pattern and being Passive Mode, described ftp client is set up data session, is specially:
Described ftp client sends the EPSV order by the control session to ftp server, receiving correct EPSV that ftp server returns when replying, the IPv6 address transition that therefrom extracts ftp server is the IPv4 address, and, set up data session according to IPv4 address after the conversion and transient port number; Otherwise ftp client sends the PASV order by the control session to ftp server, is receiving correct PASV that ftp server returns when replying, and therefrom extracts the IPv4 address of ftp server and transient port number, sets up data session; Perhaps,
Described ftp client sends the PASV order by the control session to ftp server, is receiving correct PASV that ftp server returns when replying, and therefrom extracts the IPv4 address of ftp server and transient port number, sets up data session; Otherwise ftp client sends the EPSV order by the control session to ftp server, receiving correct EPSV that ftp server returns when replying, the IPv6 address transition that therefrom extracts ftp server is the IPv4 address, and, set up data session according to IPv4 address after the conversion and transient port number.
The present invention also provides a kind of system of the FTP of realization transfer of data, and this system comprises: ftp client and ftp server, wherein:
Described ftp client is used for when the pattern of setting up of data session is aggressive mode, and its own IP address and transient port number by PORT order or EPRT order, are sent to described ftp server in the control session; Also be used for when the pattern of setting up of data session is Passive Mode, send PASV order or EPSV order, and the IP address of returning according to ftp server and transient port number are set up data session to described ftp server;
Described ftp server is used for when the pattern of setting up of data session is aggressive mode, is destination address, is destination interface with the transient port with the IP address of the ftp client that receives, sets up data session; Also be used for when the pattern of setting up of data session is Passive Mode, the PASV order or the EPSV order that send according to ftp client number send to described ftp client with its own IP address and transient port in described control session.
Described ftp server also is used for when the pattern of setting up of data session is Passive Mode, replys or correct EPSV replys by correct PASV, and its own IP address and transient port number are sent to described ftp client in described control session.
In sum, the present invention realizes the scheme of FTP transfer of data, at first set up the control session between ftp client and the ftp server, then based on the control session, by PORT order, ERPT order, PASV order or EPSV order, the address of required ftp client or ftp server and transient port number send to a side (ftp client or ftp server) who initiates data session when setting up data session, finish the foundation of data session thus.
Based on method of the present invention, after data session is set up, if ftp server and ftp client are positioned at the network of different IP agreement, then ftp client sends to IVI equipment (not comprising ALG) with the FTP packet by data session, after directly the FTP packet being carried out protocol conversion by IVI equipment, send to ftp server, thereby make the ftp server that is positioned at the different IP protocol network and the ftp client can mutual communication; If ftp server and ftp client are positioned at the network of same IP agreement, then both can directly carry out the transmission of FTP packet by data session, do not need the equipment through IVI.So, the present invention not only can not increase under the situation of ALG at IVI equipment, the intercommunication of ftp client and ftp server between realization IPv6 network and the IPv4 network, but also provide a kind of mechanism, the uncertain ftp server of ftp client whether with situation about self being positioned at a kind of network of IP agreement under, also can support the intercommunication of ftp client and ftp server.
Description of drawings
Fig. 1 realizes the method flow diagram of FTP transfer of data for the present invention;
Fig. 2 realizes the method flow diagram of FTP transfer of data one embodiment for the present invention;
Fig. 3 realizes the method flow diagram of FTP transfer of data two embodiment for the present invention;
Fig. 4 realizes the system configuration schematic diagram of FTP transfer of data for the present invention.
Embodiment
The technical solution of the present invention is further elaborated below in conjunction with the drawings and specific embodiments.
Figure 1 shows that the present invention realizes the method flow diagram of FTP transfer of data, may further comprise the steps:
Step 101 is set up the control session between ftp client and the ftp server.
Step 102 is determined the pattern of setting up of the data session between ftp client and the ftp server, and is concrete when being aggressive mode, execution in step 103; During for Passive Mode, execution in step 105.
Step 103, ftp client number by PORT order or EPRT order, sends to ftp server with its own IP address and transient port in the control session.
Step 104, ftp server is destination address, is destination interface with the transient port with the IP address of ftp client, sets up data session.
Step 105, PASV order or EPSV order that ftp server sends according to ftp client number send to ftp client with its own IP address and transient port in the control session.
Step 106, ftp client is destination address, is destination interface with the transient port with the IP address of ftp server, sets up data session.
Below by specific embodiment technical scheme of the present invention is described, Figure 2 shows that ftp client is positioned at the IPv6 network, uncertain ftp server is positioned under the situation of IPv4 or IPv6 network, realize the flow process of FTP transfer of data, may further comprise the steps:
Step 201, the user provides the address and the port numbers of ftp server to ftp client.
At first the user need provide the address and the port numbers of ftp server to ftp client, is used for the foundation of control session between ftp client and the ftp server.
Step 202, ftp client are determined the form of the address of the ftp server that the user provides.
Wherein, the address of ftp server can be the form of domain name, also can be the form of IP address (IPv4 address or IPv6 address); Port numbers can be the form of numeral.If the address of the ftp server that is provided is the form of domain name, execution in step 203; When the address of the ftp server that is provided is the form of IPv4 address, execution in step 205; When the address of the ftp server that is provided is the form of IPv6 address, execution in step 206.
Step 203, when the user provides the address of ftp server with the form of domain name, ftp client sends the domain name mapping request to IVI domain name acting server, and request is resolved this domain name, to obtain the address of the ftp server corresponding with the IP agreement of self place network.Here, because ftp client is positioned at the IPv6 network, therefore, ftp client can ask to obtain the address of the ftp server of IPv6 address format.
Step 204, IVI domain name acting server is resolved this domain name, and the address that obtains ftp server is the IPv6 address of IVI form, and returns to ftp client, and execution in step 206 then.
IVI domain name acting server is resolved domain name according to the IP agreement of ftp client place network, and address, this embodiment of obtaining ftp server are the IPv6 address.
Step 205, when the user provides the address of ftp server with the form of IPv4 address, because ftp client is positioned at the IPv6 network, therefore the ftp client IPv6 address that is the IVI form with this IPv4 address transition, specifically adopt the way of in the IPv6 address, inserting the IPv4 address, repeat no more, execution in step 206 then herein.
For above-mentioned two kinds of situations, because ftp client is positioned at the IPv6 network, so ftp client need just can be carried out follow-up operation according to the IPv6 address of ftp server.
When the user provides the address of ftp server with the form of IPv6 address, direct execution in step 206.
Step 206, the foundation of the control session between ftp client initiation and the ftp server.
The port numbers of the ftp server that the address (IPv6 address) of the ftp server that ftp client provides with the user is destination address, provide with the user is the destination slogan, initiate and ftp server between the foundation of control session, be used for the follow-up transmission of control signaling when setting up data session.
After it is pointed out that control session foundation is finished, as required, ftp client need be resolved user's operation, sends the FTP order to ftp server.Wherein, user operation, as the user land ftp server, input user name, password etc.; After these users are operated parsing, obtain corresponding FTP order, and send to ftp server by the control session, after ftp server was replied, the user logined success.
Step 207, when needs were set up data session between ftp client and the ftp server, at first judging needed to adopt which kind of to set up pattern.
Concrete, the pattern of setting up of data session has two kinds: aggressive mode and Passive Mode, and wherein, aggressive mode refers to be set up by the data session of ftp server initiation; Passive Mode refers to be set up by the data session of ftp client initiation.The foundation of data session is used for the transmission of FTP data, promptly realizes the intercommunication of ftp client and ftp server that the pattern of foundation can be provided with as required by the user, and can revise at any time.
When the pattern of foundation is aggressive mode, execution in step 208~213.Here, ftp client is positioned at the IPv6 network, and ftp server is positioned at the IPv6 network or the IPv4 network is uncertain, in this embodiment, acquiescence ftp server and ftp client be positioned at the different IP agreement network, be that ftp server is positioned at the IPv4 network, this moment execution in step 208.
Step 208, ftp client is the IPv4 address with the IPv6 address transition of self, and the way of IPv4 address is taken out in concrete employing from the IPv6 address, and it is embodied as prior art, repeats no more.
Step 209, ftp client be a parameter with the port numbers of the IPv4 address of changing back self and self some transient port of choosing arbitrarily (be called for short transient port number), generates a PORT and orders, and sends to ftp server by controlling session.
Herein, ftp client acquiescence ftp server is arranged in the IPv4 network, and therefore needing elder generation is the IPv4 address with the IPv6 address transition of self, sends to ftp server then, uses when initiating setting up of data session for it.
PORT order only is applicable to that destination device is present in the situation of IPv4 network, therefore, when ftp client acquiescence ftp server is positioned at the IPv4 network, the IPv6 address transition of self need be the IPv4 address after, send to ftp server by the PORT order.
Step 210, ftp client judge whether to receive that correct PORT replys, if not, and execution in step 211; If, execution in step 213.
After receiving PORT order,, then can carry out correct PORT and reply, be OK as reply content if ftp server is positioned at the IPv4 network really; Otherwise carrying out wrong PORT replys, is error as reply content.
When ftp server is positioned at the IPv4 network, can from PORT order, extracts the transient port number and the IPv4 address of ftp client, and return correct PORT by the control session to ftp client and reply.
Step 211, ftp client be parameter with the port numbers of the IPv6 address of self and self some transient port of choosing arbitrarily number (be called for short transient port number) directly, generate an EPRT and order, and send to ftp server by controlling session.
When ftp client receives wrong PORT answer, can determine that ftp server is not at the IPv4 network, in this case, ftp client can think that ftp server and self are positioned at network with a kind of IP agreement, are the IPv6 network, do not need to carry out the conversion of address this moment, and ftp client can be directly number be ordered the IPv6 address of self and transient port and sent to ftp server by EPRT.
The EPRT order is applicable to that source device and destination device are located on the situation of IPv6 network or IPv4 network.Therefore, in this embodiment, when ftp client determined that ftp server also is positioned at the IPv6 network, directly the IPv6 address with self sent to ftp server by the EPRT order.Carry a networkpart field in the EPRT order, the value of this field is 1 o'clock, and expression source device (ftp client) is positioned at the IPv4 network; Value is to represent that source device (ftp client) was positioned at the IPv6 network at 2 o'clock.
Step 212, ftp client judge whether to receive that correct EPRT replys, if, execution in step 213; Otherwise this flow process finishes.
After receiving EPRT order,,, then can carry out correct EPRT and reply, be OK as reply content if ftp server also is positioned at the IPv6 network according to IPv6 address of wherein carrying or networkpart field; Otherwise carrying out wrong EPRT replys, is error as reply content.
When ftp server is positioned at the IPv6 network, from EPRT order, extracts the transient port number and the IPv6 address of ftp client, and return correct EPRT by the control session to ftp client and reply.
If ftp client receives wrong EPRT and replys, then can determine ftp server not at the IPv6 network, this flow process finishes.
Step 213 is waited for the foundation of ftp server initiation data session.
Accept step 210, reply, illustrate that ftp server is positioned at the IPv4 network if ftp client receives correct PORT; At this moment, ftp client wait ftp server is initiatively initiated data session and is set up, be destination address, be destination interface with the IPv4 address of ftp client with the transient port of ftp client, this shows, when ftp client and ftp server were positioned at the network of different IP agreement, this flow process can realize the transmission of FTP data;
Accept step 212, if ftp client receives correct EPRT and replys, illustrate that ftp server is positioned at the IPv6 network, at this moment, ftp client waits for that ftp server initiatively initiates data session and set up, and is destination address, is destination interface with the transient port of ftp client with the IPv6 address of ftp client, this shows, when ftp client and ftp server were positioned at identical network, this flow process also can realize the transmission of FTP data.
It is to be noted, during aggressive mode, among this embodiment ftp client also can give tacit consent to ftp server and self be positioned at network with a kind of IP agreement, be that ftp server is positioned at the IPv6 network, then ftp client sends the EPRT order, is first execution in step 211~212 to ftp server earlier, when ftp client receives correct EPRT answer, wait for the foundation of ftp server initiation data session; When ftp client receives wrong EPRT answer, ftp client can determine that ftp server is positioned at the IPv4 network, send the PORT order, be execution in step 208~210 to ftp server then, when ftp client receives correct PORT answer, wait for the foundation of ftp server initiation data session; Otherwise flow process finishes.
Accept step 207, when the pattern of setting up of data session is Passive Mode, execution in step 214~220.Here, ftp client is positioned at the IPv6 network, and ftp server is positioned at the IPv6 network or the IPv4 network is uncertain, in this embodiment, acquiescence ftp server and ftp client be positioned at the different IP agreement network, be that ftp server is positioned at the IPv4 network, this moment execution in step 214.
Step 214, ftp client sends the PASV order by the control session to ftp server, the address and the port numbers of request ftp server.
Herein, ftp client acquiescence ftp server is positioned at the IPv4 network, therefore sends the PASV order to ftp server.
The PASV order only is applicable to that destination device is present in the situation of IPv4 network, therefore, when ftp client acquiescence ftp server is positioned at the IPv4 network, sends a PASV order to ftp server.
Step 215, ftp client judge whether to receive correct PASV and reply, if not, and execution in step 216; If, execution in step 219.
After receiving the PASV order,, then can carry out correct PASV and reply if ftp server is positioned at the IPv4 network really; Otherwise carrying out wrong PASV replys, is error as reply content.
When ftp server carries out correct PASV answer, with the IPv4 address of self and a transient port choosing arbitrarily number is parameter, be carried in the PASV answer and and send to ftp client, use when initiating setting up of data session for ftp client by the control session.
Step 216, ftp client sends the EPSV order to ftp server.
If ftp client receives wrong PASV and replys, can determine that ftp server is not at the IPv4 network, in this case, ftp client can think that ftp server and self are positioned at network with a kind of IP agreement, are the IPv6 network, at this moment, ftp client sends the EPSV order by the control session to ftp server, asks the address and the port numbers of ftp server again.
The EPSV order is applicable to that source device and destination device are located on the situation of IPv6 network or IPv4 network.Therefore, in this embodiment, when ftp client determines that ftp server also is positioned at the IPv6 network, send the EPSV order to ftp server.Carry a networkpart field in the EPRT order, the value of this field is 1 o'clock, and expression source device (ftp client) is positioned at the IPv4 network; Value is to represent that source device (ftp client) was positioned at the IPv6 network at 2 o'clock.
Step 217, ftp client judge whether to receive correct EPSV and reply, and if not, this flow process finishes; If, execution in step 218.
After receiving the EPSV order,,, then can carry out correct EPSV and reply if ftp server also is positioned at the IPv6 network according to the networkprt field; Otherwise carrying out wrong EPSV replys, is error as reply content.
Ftp server carries out correct EPSV when replying, and number is parameter with the IPv6 address of this machine and a transient port choosing arbitrarily, be carried at EPSV reply in and send to ftp client by the control session, use during for the setting up of its initiation data session.
It is pointed out that existing EPSV reply in only carrying port numbers, and the present invention replys existing EPSV and expands, and makes it not only can carry port numbers, can also carry the IP address.
When ftp client receives wrong EPSV answer, can determine ftp server not at the IPv6 network, this flow process finishes.
Step 218, ftp client are extracted the IPv6 address of ftp server and transient port number from correct EPSV replys, execution in step 220 then.
If ftp client receives correct EPSV and replys, illustrate that ftp server is positioned at the IPv6 network, at this moment, and the IPv6 address of ftp client extraction ftp server from correct EPSV replys and transient port number, execution in step 220 then.
Step 219, ftp client are extracted the IPv4 address of ftp server and transient port number from correct PASV replys, be the IPv6 address with the IPv4 address transition of ftp server, and execution in step 220 then.
Accept step 215, if ftp client receives correct PASV and replys, illustrate that ftp server is positioned at the IPv4 network, at this moment, ftp client extracts the IPv4 address of ftp server and transient port number from correct PASV replys, and be the IPv6 address with the IPv4 address transition of ftp server, execution in step 220 then.
Step 220, ftp client is initiated the foundation of data session.
Accept step 218, ftp server is positioned at the IPv6 network, and then ftp client is a destination address with the IPv6 address of ftp server, is destination interface with the transient port of ftp server, initiates the foundation of data session; This shows that when ftp client and ftp server were positioned at identical network, this flow process can realize the transmission of FTP data;
Accept step 219, ftp server is positioned at the IPv4 network, then ftp client is a destination address with the IPv6 address of changing the back ftp server, transient port with ftp server is a destination interface, initiate the foundation of data session, this shows that when ftp client and ftp server were positioned at the network of different IP agreement, this flow process can realize the transmission of FTP data.
It is to be noted, during Passive Mode, among this embodiment ftp client also can give tacit consent to ftp server and self be positioned at network with a kind of IP agreement, be that ftp server is positioned at the network for IPv6, then ftp client sends the EPSV order, is first execution in step 216~218 to ftp server earlier, when ftp client receives correct EPSV answer, initiate the foundation of data session; When ftp client receives wrong EPSV answer, ftp client can determine that ftp server is positioned at the IPv4 network, send the PASV order, be execution in step 214 → 215 → 219 to ftp server then, when ftp client receives correct PASV answer, initiate the foundation of data session; Otherwise flow process finishes.
After data session is set up, if ftp server is positioned at the IPv4 network, ftp client is positioned at the IPv6 network, then ftp client sends to IVI equipment (not comprising ALG) to the FTP packet that uses IVI6 (i) address (being the address of IPv6 form) by data session earlier, directly be translated as the packet that uses IVI4 (i) address (being the address of IPv4 form) by IVI equipment, and then send to the ftp server that is positioned at the IPv4 network, thereby make the ftp server of the ftp client of IPv6 network and IPv4 network can mutual communication by data session; If ftp server and ftp client are located on the IPv6 network, then both can not need the equipment through IVI directly by data session communication.
Be positioned at the situation that IPv4 network, uncertain ftp server are positioned at IPv4 or IPv6 network for ftp client, the flow process that realizes the FTP transfer of data comprises as shown in Figure 3:
Step 301~307 are roughly the same with the realization of step 201~207, repeat no more herein.Different is that ftp client finally need obtain the ftp server address of IPv4 form among this embodiment.
When the pattern of foundation is aggressive mode, execution in step 308~313.In this embodiment, acquiescence ftp server and ftp client be positioned at the different IP agreement network, be that ftp server is positioned at the IPv6 network, this moment execution in step 308.
Step 308~309, ftp client is the IPv6 address with the IPv4 address transition of self, and number is parameter with the transient port of this IPv6 address and self, generates an EPRT order, sends to ftp server by controlling session.
Step 310, ftp client judge whether to receive that correct EPRT replys, if not, and execution in step 311; If, execution in step 313.
After receiving the EPRT order, according to wherein IPv6 address or networkpart (among this embodiment, though ftp client is positioned at the IPv4 network, but when sending the EPRT order, the value that need networkpart be set to the IPv6 correspondence), if ftp server is positioned at the IPv6 network really, then can carries out correct EPRT and reply; Otherwise carrying out wrong EPRT replys.
When ftp server is positioned at the IPv6 network, can from EPRT order, extracts the transient port number and the IPv6 address (being used to initiate the foundation of data session) of ftp client, and return correct EPRT by the control session to ftp client and reply.
Step 311, ftp client receive wrong EPRT when replying, and ftp client number is a parameter with self IPv4 address and transient port directly, generates a PORT order, sends to ftp server by controlling session.
Step 312, ftp client judge whether to receive that correct PORT replys, if, execution in step 313; If ftp client receives wrong PORT and replys, then can determine ftp server not at the IPv4 network, this flow process finishes.
After receiving the PORT order,, then can carry out correct PORT and reply if ftp server is positioned at the IPv4 network; Otherwise carrying out wrong PORT replys.
When ftp server is positioned at the IPv4 network, from PORT order, extracts the transient port number and the IPv4 address (being used to initiate the foundation of data session) of ftp client, and return correct PORT by the control session to ftp client and reply.
Step 313 is waited for the foundation of ftp server initiation data session.
Accept step 310, reply, illustrate that ftp server is positioned at the IPv6 network if ftp client receives correct EPRT; At this moment, ftp client wait ftp server is initiatively initiated data session and is set up, be destination address, be destination interface with the IPv6 address of ftp client with the transient port of ftp client, this shows, when ftp client and ftp server were positioned at the network of different IP agreement, this flow process can realize the transmission of FTP data;
Accept step 312, if ftp client receives correct PORT and replys, illustrate that ftp server is positioned at the IPv4 network, at this moment, ftp client waits for that ftp server initiatively initiates data session and set up, and is destination address, is destination interface with the transient port of ftp client with the IPv4 address of ftp client, this shows, when ftp client and ftp server were positioned at identical network, this flow process also can realize the transmission of FTP data.
When it is pointed out that aggressive mode, ftp client also can be given tacit consent to ftp server and is positioned at the IPv4 network among this embodiment, and then ftp client sends the PORT order to ftp server earlier; When ftp client received wrong PORT answer, ftp client sent the EPRT order to ftp server again.
Accept step 307, when the pattern of setting up of data session is Passive Mode, execution in step 314~320.Acquiescence ftp server and ftp client be positioned at the different IP agreement network, be that ftp server is positioned at the IPv6 network, this moment execution in step 314.
Step 314, ftp client sends the EPSV order by the control session to ftp server, the address and the port numbers of request ftp server.
Step 315, ftp client judge whether to receive correct EPSV and reply, if not, and execution in step 316; If, execution in step 319.
After receiving the EPSV order, according to the networkpart field (among this embodiment, though ftp client is positioned at the IPv4 network, but when sending the EPRT order, the value that need networkpart be set to the IPv6 correspondence), if ftp server is positioned at the IPv6 network really, then can carries out correct EPSV and reply; Otherwise carrying out wrong EPSV replys.
Ftp server carries out correct EPSV when replying, and number is parameter with self IPv6 address and transient port, be carried at EPSV reply in and send to ftp client, use when initiating setting up of data session by the control session for ftp client.
Step 316 is replied if ftp client receives wrong EPSV, and ftp client sends the PASV order to ftp server.
Step 317, ftp client judge whether to receive correct PASV and reply, and if not, this flow process finishes; If, execution in step 318.
After receiving the PASV order,, then can carry out correct PASV and reply if ftp server is positioned at the IPv4 network; Otherwise carrying out wrong PASV replys.
Ftp server carries out correct PASV when replying, and number is parameter with the IPv4 address of this machine and transient port, be carried at PASV reply in and send to ftp client, use when initiating setting up of data session by the control session for it.
Step 318, ftp client are extracted the IPv4 address of ftp server and transient port number from correct PASV replys, execution in step 320 then.
Step 319, ftp client are extracted the IPv6 address of ftp server and transient port number from correct EPSV replys, be the IPv4 address with the IPv6 address transition of ftp server, and execution in step 320 then.
Step 320, ftp client is initiated the foundation of data session.
Accept step 318, ftp server is positioned at the IPv4 network, and then ftp client is a destination address with the IPv4 address of ftp server, is destination interface with the transient port of ftp server, initiates the foundation of data session; This shows that when ftp client and ftp server were positioned at identical network, this flow process can realize the transmission of FTP data;
Accept step 319, ftp server is positioned at the IPv6 network, then ftp client is a destination address with the IPv4 address of changing the back ftp server, transient port with ftp server is a destination interface, initiate the foundation of data session, this shows that when ftp client and ftp server were positioned at the network of different IP agreement, this flow process can realize the transmission of FTP data.
When it is pointed out that Passive Mode, ftp client also can be given tacit consent to ftp server and is positioned at the IPv4 network among this embodiment, and then ftp client sends the PASV order to ftp server earlier; When ftp client received wrong PASV answer, ftp client can determine that ftp server is positioned at the IPv6 network, sent the EPSV order to ftp server then.
In sum, the uncertain ftp server of ftp client whether with the situation that self is positioned at network (IPv6 network or IPv4 network) with a kind of IP agreement under, the present invention also can support the intercommunication of ftp client and ftp server; Simultaneously, when ftp client and ftp server are positioned at the network of different IP agreement, need not increase the intercommunication that ALG just can realize ftp client and ftp server at IVI equipment.
In order to realize said method, the invention provides a kind of system of the FTP of realization transfer of data, as shown in Figure 3, this system comprises: ftp client 10 and ftp server 20, wherein:
Ftp client 10 is used for when the pattern of setting up of data session is aggressive mode, and its own IP address and transient port number by by PORT order or EPRT order, are sent to ftp server 20 in the control session; Also be used for when the pattern of setting up of data session is Passive Mode, send PASV order or EPSV order to ftp server 20, and the address of returning according to ftp server 20 and transient port number, data session set up;
Ftp server 20 is used for when the pattern of setting up of data session is aggressive mode, is destination address, is destination interface with the transient port with the address of the ftp client 10 that receives, sets up data session; Also be used for when the pattern of setting up of data session is Passive Mode, the PASV order or the EPSV order that send according to ftp client 10 number send to ftp client 10 with self address and transient port in the control session.
Ftp server 20 also is used for when the pattern of setting up of data session is Passive Mode, replys or correct EPSV replys by correct PASV, and its own IP address and transient port number are sent to ftp client 10 in the control session.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.

Claims (8)

1. a method that realizes the FTP transfer of data is characterized in that, this method comprises:
Determine the pattern of setting up of the data session between file transfer protocol (FTP) (FTP) client and the ftp server;
Described when setting up pattern and being aggressive mode, described ftp client number by PORT order or EPRT order, sends to described ftp server with its own IP address and transient port in the control session; Described ftp server is destination address, is destination interface with the transient port with the IP address of described ftp client, sets up data session;
Described when setting up pattern and being Passive Mode, PASV order or EPSV order that described ftp server sends according to described ftp client number send to described ftp client with its own IP address and transient port in the control session; Described ftp client is destination address, is destination interface with the transient port with the IP address of described ftp server, sets up data session.
2. according to the method for the described realization of claim 1 FTP transfer of data, it is characterized in that determine the pattern of setting up of described data session, before, this method further comprises: set up the control session between described ftp client and the ftp server.
3. according to the method for claim 1 or 2 described realization FTP transfer of data, it is characterized in that,
Described ftp client is positioned at the IPv6 network, and described ftp server is positioned at IPv6 or IPv4 network, and described when setting up pattern and being aggressive mode, and described ftp server is set up data session, is specially:
After described ftp client is the IPv4 address with self IPv6 address transition, number order by PORT together with transient port, send to ftp server in control in the session, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client directly with self the IPv6 address and transient port number by the EPRT order, in the control session, send to ftp server, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session; Perhaps,
Described ftp client directly with self the IPv6 address and transient port number by the EPRT order, in the control session, send to ftp server, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client be behind the IPv4 address with self IPv6 address transition and transient port number together by the PORT order, in the control session, send to ftp server, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session.
4. according to the method for claim 1 or 2 described realization FTP transfer of data, it is characterized in that,
Described ftp client is positioned at the IPv4 network, when described ftp server is positioned at IPv6 or IPv4 network, and described when setting up pattern and being aggressive mode, described ftp server is set up data session, is specially:
After described ftp client is the IPv6 address with self IPv4 address transition, number order by EPRT together with transient port, send to ftp server in control in the session, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client will be directly self the IPv4 address and transient port number by the PORT order, in the control session, send to ftp server, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session; Perhaps,
Described ftp client will be directly self the IPv4 address and transient port number by the PORT order, in the control session, send to ftp server, and receiving correct PORT that ftp server returns when replying, wait for that ftp server sets up data session; Otherwise, ftp client be behind the IPv6 address with self IPv4 address transition and transient port number together by the EPRT order, in the control session, send to ftp server, and receiving correct EPRT that ftp server returns when replying, wait for that ftp server sets up data session.
5. according to the method for claim 1 or 2 described realization FTP transfer of data, it is characterized in that,
Described ftp client is positioned at the IPv6 network, and when described ftp server is positioned at IPv6 or IPv4 network and described when setting up pattern and being Passive Mode, described ftp client is set up data session, is specially:
Described ftp client sends the PASV order to ftp server, receiving correct PASV that ftp server returns when replying, the IPv4 address transition that therefrom extracts ftp server is the IPv6 address, and according to IPv6 address after the conversion and transient port number, sets up data session; Otherwise ftp client sends the EPSV order by the control session to ftp server, is receiving correct EPSV that ftp server returns when replying, and therefrom extracts the IPv6 address of ftp server and transient port number, sets up data session; Perhaps,
Described ftp client sends the EPSV order by the control session to ftp server, is receiving correct EPSV that ftp server returns when replying, and therefrom extracts the IPv6 address of ftp server and transient port number, sets up data session; Otherwise, ftp client sends the PASV order to ftp server, is receiving correct PASV that ftp server returns when replying, and the IPv4 address transition that therefrom extracts ftp server is the IPv6 address, and, set up data session according to IPv6 address after the conversion and transient port number.
6. according to the method for claim 1 or 2 described realization FTP transfer of data, it is characterized in that,
Described ftp client is positioned at the IPv4 network, and when described ftp server is positioned at IPv6 or IPv4 network and described when setting up pattern and being Passive Mode, described ftp client is set up data session, is specially:
Described ftp client sends the EPSV order by the control session to ftp server, receiving correct EPSV that ftp server returns when replying, the IPv6 address transition that therefrom extracts ftp server is the IPv4 address, and, set up data session according to IPv4 address after the conversion and transient port number; Otherwise ftp client sends the PASV order by the control session to ftp server, is receiving correct PASV that ftp server returns when replying, and therefrom extracts the IPv4 address of ftp server and transient port number, sets up data session; Perhaps,
Described ftp client sends the PASV order by the control session to ftp server, is receiving correct PASV that ftp server returns when replying, and therefrom extracts the IPv4 address of ftp server and transient port number, sets up data session; Otherwise ftp client sends the EPSV order by the control session to ftp server, receiving correct EPSV that ftp server returns when replying, the IPv6 address transition that therefrom extracts ftp server is the IPv4 address, and, set up data session according to IPv4 address after the conversion and transient port number.
7. a system that realizes the FTP transfer of data is characterized in that, this system comprises: ftp client and ftp server, wherein:
Described ftp client is used for when the pattern of setting up of data session is aggressive mode, and its own IP address and transient port number by PORT order or EPRT order, are sent to described ftp server in the control session; Also be used for when the pattern of setting up of data session is Passive Mode, send PASV order or EPSV order, and the IP address of returning according to ftp server and transient port number are set up data session to described ftp server;
Described ftp server is used for when the pattern of setting up of data session is aggressive mode, is destination address, is destination interface with the transient port with the IP address of the ftp client that receives, sets up data session; Also be used for when the pattern of setting up of data session is Passive Mode, the PASV order or the EPSV order that send according to ftp client number send to described ftp client with its own IP address and transient port in described control session.
8. according to the system of the described realization of claim 7 FTP transfer of data, it is characterized in that,
Described ftp server also is used for when the pattern of setting up of data session is Passive Mode, replys or correct EPSV replys by correct PASV, and its own IP address and transient port number are sent to described ftp client in described control session.
CN201010112166.4A 2010-02-08 2010-02-08 File transfer protocol (FTP) data transmission method and system Expired - Fee Related CN102148845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010112166.4A CN102148845B (en) 2010-02-08 2010-02-08 File transfer protocol (FTP) data transmission method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010112166.4A CN102148845B (en) 2010-02-08 2010-02-08 File transfer protocol (FTP) data transmission method and system

Publications (2)

Publication Number Publication Date
CN102148845A true CN102148845A (en) 2011-08-10
CN102148845B CN102148845B (en) 2015-06-10

Family

ID=44422838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010112166.4A Expired - Fee Related CN102148845B (en) 2010-02-08 2010-02-08 File transfer protocol (FTP) data transmission method and system

Country Status (1)

Country Link
CN (1) CN102148845B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420858A (en) * 2011-11-22 2012-04-18 杭州华三通信技术有限公司 FTP (File Transfer Protocol) mode configuration method, data transmission method and device
CN103001939A (en) * 2012-07-30 2013-03-27 深圳市共进电子股份有限公司 FTP (file transfer protocol) server, FTP server processing method and FTP transmission system
EP2773081A1 (en) 2013-02-28 2014-09-03 Siemens Aktiengesellschaft Communication device for an industrial communication network and a method for providing data, in particular files, in an industrial communication network using file transfer protocol
US9426206B2 (en) 2012-03-30 2016-08-23 Hangzhou H3C Technologies Co., Ltd. FTP data transmission in stack system
CN106603717A (en) * 2016-12-31 2017-04-26 深圳市智联宝生态科技有限公司 FTP extending method and FTP extending system supporting single data port and NAT traversal
CN106850862A (en) * 2017-03-31 2017-06-13 青岛海信移动通信技术股份有限公司 Method and device from transmitting terminal to receiving terminal migrating data
CN106899635A (en) * 2015-12-18 2017-06-27 中国移动通信集团四川有限公司 FTP data link realizes the method and device of fixed communication port
CN110545329A (en) * 2019-09-27 2019-12-06 杭州海潮信息科技有限公司 Method for improving FTP file transmission speed
CN111225015A (en) * 2018-11-27 2020-06-02 大唐移动通信设备有限公司 Method and device for realizing remote FTP transmission
CN111245831A (en) * 2020-01-10 2020-06-05 北京力控华康科技有限公司 FTP data transmission method and device, and information interaction system of server and client

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009662A (en) * 2007-01-31 2007-08-01 杭州华为三康技术有限公司 Message processing method, system and device based on the load balance technology
CN101325580A (en) * 2007-06-15 2008-12-17 上海亿人通信终端有限公司 Method for implementing FTP application-layer gateway based on NAT-PT

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009662A (en) * 2007-01-31 2007-08-01 杭州华为三康技术有限公司 Message processing method, system and device based on the load balance technology
CN101325580A (en) * 2007-06-15 2008-12-17 上海亿人通信终端有限公司 Method for implementing FTP application-layer gateway based on NAT-PT

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420858B (en) * 2011-11-22 2014-12-24 杭州华三通信技术有限公司 FTP (File Transfer Protocol) mode configuration method, data transmission method and device
CN102420858A (en) * 2011-11-22 2012-04-18 杭州华三通信技术有限公司 FTP (File Transfer Protocol) mode configuration method, data transmission method and device
US9426206B2 (en) 2012-03-30 2016-08-23 Hangzhou H3C Technologies Co., Ltd. FTP data transmission in stack system
CN103001939A (en) * 2012-07-30 2013-03-27 深圳市共进电子股份有限公司 FTP (file transfer protocol) server, FTP server processing method and FTP transmission system
EP2773081A1 (en) 2013-02-28 2014-09-03 Siemens Aktiengesellschaft Communication device for an industrial communication network and a method for providing data, in particular files, in an industrial communication network using file transfer protocol
CN106899635B (en) * 2015-12-18 2021-03-09 中国移动通信集团四川有限公司 Method and device for realizing fixed communication port of file transfer protocol data link
CN106899635A (en) * 2015-12-18 2017-06-27 中国移动通信集团四川有限公司 FTP data link realizes the method and device of fixed communication port
CN106603717A (en) * 2016-12-31 2017-04-26 深圳市智联宝生态科技有限公司 FTP extending method and FTP extending system supporting single data port and NAT traversal
CN106850862A (en) * 2017-03-31 2017-06-13 青岛海信移动通信技术股份有限公司 Method and device from transmitting terminal to receiving terminal migrating data
CN111225015A (en) * 2018-11-27 2020-06-02 大唐移动通信设备有限公司 Method and device for realizing remote FTP transmission
CN111225015B (en) * 2018-11-27 2021-12-14 大唐移动通信设备有限公司 Method and device for realizing remote FTP transmission
CN110545329A (en) * 2019-09-27 2019-12-06 杭州海潮信息科技有限公司 Method for improving FTP file transmission speed
CN110545329B (en) * 2019-09-27 2022-04-29 杭州海潮信息科技有限公司 Method for improving FTP file transmission speed
CN111245831A (en) * 2020-01-10 2020-06-05 北京力控华康科技有限公司 FTP data transmission method and device, and information interaction system of server and client
CN111245831B (en) * 2020-01-10 2022-05-03 北京力控华康科技有限公司 FTP data transmission method and device, and information interaction system of server and client

Also Published As

Publication number Publication date
CN102148845B (en) 2015-06-10

Similar Documents

Publication Publication Date Title
CN102148845A (en) File transfer protocol (FTP) data transmission method and system
CN101141420B (en) Method and system for performing data communication between private network and public network
CN104270379B (en) HTTPS agency retransmission methods and device based on transmission control protocol
CN101946493B (en) Method and system for providing connectivity between clients connected to the internet
CN102640449B (en) For the system and method for web application communication
CN101136929B (en) Internet small computer system interface data transmission method and apparatus
CN102958197B (en) Method for establishing X2 service signaling connection, base station and CSG (cell site gateway)
CN103236964B (en) Based on DS-Lite implementation method and the CPE access device thereof of Linux
JP2008199348A (en) Relay apparatus, relay program, and communication system
CN102438015A (en) System and method for node access of internet of things
CN100471163C (en) Method for supporting IPv4 applied program utilizing intermain machine tunnel in IPV6
CN101325580A (en) Method for implementing FTP application-layer gateway based on NAT-PT
CN103338213A (en) Method, system and access gateway for intercommunication between local equipment and IMS (IP Multimedia Subsystem) network
JP2017506862A (en) IPv6 address processing method, apparatus, and DHCPv6 relay device
CN102970387A (en) Domain name resolution method, device and system
JP6386166B2 (en) Translation method and apparatus between IPv4 and IPv6
US10171418B2 (en) Method and apparatus for accessing demilitarized zone host on local area network
CN108494751B (en) Method and device for efficiently using IPv4 public address
CN102882733A (en) WEB webmaster method realized by penetrating through NAT (Network Address Translation) equipment
CN102480476A (en) Multi-service access method based on DHCP protocol extension
CN101426030B (en) Method and terminal for acquiring network address
CN103812868A (en) Method and system for realizing free Internet access based on IPv4/IPv6 conversion
JP2012527794A (en) Method and system for host identity tag acquisition
JP2008258917A (en) Identical nat subordinate communication control system, nat device, identical nat subordinate communication control method, and program
CN104756462A (en) Method and system for tcp turn operation behind a restrictive firewall

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150610

Termination date: 20210208

CF01 Termination of patent right due to non-payment of annual fee