NS-DDN@DDN2.UUCP (01/20/87)
Has anyone successfully implemented the FTP restart support? Can anyone explain definitively how it should work? I'm not confident that I've got a handle on how it actually works according to RFC959. It appears that something like the following must happen (illustrating on a three-party model): Host A:User-PI ==> Host B:Server-PI [Establish session] Host A:User-PI ==> Host C:Server-PI [Establish session] Host A:User-PI ==> Host B:Server-PI "PASV"<CRLF> Host A:User-PI <== Host B:Server-PI "227 10,1,0,1,16,5"<CRLF> Host A:User-PI ==> Host C:Server-PI "PORT 10,1,0,1,16,5"<CRLF> Host A:User-PI <== Host C:Server-PI "220 Okay"<CRLF> Host A:User-PI ==> Host B:Server-PI "MODE B"<CRLF> Host A:User-PI ==> Host C:Server-PI "MODE B"<CRLF> Host A:User-PI <== Host B:Server-PI "220 Okay"<CRLF> Host A:User-PI <== Host C:Server-PI "220 Okay"<CRLF> Host A:User-PI ==> Host B:Server-PI "STOR bigfile"<CRLF> Host A:User-PI ==> Host C:Server-PI "RETR bigfile"<CRLF> Host C:Server-DTP ==> Host B:User-DTP [Establish session] Host A:User-PI <== Host B:Server-PI "125 Transfer started"<CRLF> Host A:User-PI <== Host C:Server-PI "125 Transfer started"<CRLF> Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [1st 16Kbytes of data] Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [2nd 16Kbytes of data] Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [3rd block of data] Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [4th block of data] Host C:Server-DTP ==> Host B:User-DTP BH = 16,0,8, "SOFAR001" Obviously Host C supports restarting. Now it's up to Host B. If he does not support restarts, he ignores the restart marker and continues receiving data. Otherwise, he figures out where he is in his file, does whatever needs to be done to ensure that come what may, this much of the received data will survive a catastrophe, constructs his restart marker (e.g., "MINE0001"), and: Host A:User-PI <== Host B:Server-PI "110 MARK MINE0001 = SOFAR001"<CRLF> Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [5th block of data] Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [6th block of data] Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [7th block of data] Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [8th block of data] Host C:Server-DTP ==> Host B:User-DTP BH = 16,0,8, "SOFAR002" Host A:User-PI <== Host B:Server-PI "110 MARK MINE0002 = SOFAR002"<CRLF> Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [9th block of data] Then the unthinkable happens. The building engineer pulls the wrong switch, and Host B goes to Never-Never Land. Host C gives up upon discovering Host B will have to be resurected... Host A:User-PI <== Host C:Server-PI "426 Transfer aborted"<CRLF> while Host A is also telling the end user that his PI session with Host B is history. Some time in the future, the end user receives a birth announcement, at which point he reestablishes his PI sessions, performing the same sequence of events up through the MODE B commands. Then, having noted the last 110 reply he received before the crash, he does the following: Host A:User-PI ==> Host B:Server-PI "REST SOFAR002"<CRLF> Host A:User-PI ==> Host C:Server-PI "REST MINE0002"<CRLF> Host A:User-PI <== Host B:Server-PI "350 Ready to restart"<CRLF> Host A:User-PI <== Host C:Server-PI "350 Ready to restart"<CRLF> Host A:User-PI ==> Host B:Server-PI "STOR bigfile"<CRLF> Host A:User-PI ==> Host C:Server-PI "RETR bigfile"<CRLF> Host C:Server-DTP ==> Host B:User-DTP [Establish session] Host A:User-PI <== Host B:Server-PI "125 Transfer started"<CRLF> Host A:User-PI <== Host C:Server-PI "125 Transfer started"<CRLF> Host C:Server-DTP ==> Host B:User-DTP BH = 0,64,0, [9th block of data] and on to a happy ending. Did I get it right? With deep appreciation to (and awed admiration of) all who read this far, I am Dave Craig Network Solutions, Inc.