星期四, 3月 24, 2005

Kermit File Transfer


特性

  • 一次(一個session)傳送一個檔案
  • data 以block的方式傳送,一個block最多100 byte
  • receiver收到每個block都要做 acknowledges
  • 使用check sum 作error detection
  • 傳送中abort的話要整個file重新傳送

Sequence
  1. Client ready,送出NACK (Negative Acknowledge) 給server。Server回應S (Initialization),之後送出包含file name的F (File Header) packet。
  2. 用D (File Data) packet來送 file data。
  3. End of Transmission 用 Z (End of File) packet 來通知。
  4. Server 要 terminate  session 用 B (End of Batch) packet
  5. Server 的每一個packet,Client都要送出 acknowledge packet.
  6. Client 或 Server timeout 時都要送出 T (timeout) packet.
  7. E (Fatal Error) packet會terminate session.
Packet

Packet 格式

Start of Packet   : 1 byte - 0x01
Data Block Length : 1 byte - 0x23 + Data block length
Packet Sequence   : 1 byte - 0x20 + packet sequence number
Packet Type       : 1 byte - reference below ..
Data block        : N byte
Check Byte        : 1 byte
End of Packet     : 1 byte - 0x0D


Packet Type

'N' : NACK  - datablock contains no data
'S' : Initialization - datablock contains initialize parameters
'F' : File Header - datablock contains the filename
'D' : File Data - datablock contains the file data
'Z' : End of fil - datablock contains user-selectable attribute
'B' : End of batch - datablock contains no data
'T' : Timeout delay exceed - datablock contains no data.
'E' : Fatal Error - block contains no data, transfer will be aborted.

Sequence


 initialize

        NCAK
Client----------->Server
      <----------
        S & F


 Data transfer

          D
Client <---------- Server
       ----------->
         ACK


 End Transder

          Z
Cient <------------ Server
      ------------->
         ACK

Client <----------- Server
          B

沒有留言:

網誌存檔