特性
- 一次(一個session)傳送一個檔案
- data 以block的方式傳送,一個block最多100 byte
- receiver收到每個block都要做 acknowledges
- 使用check sum 作error detection
- 傳送中abort的話要整個file重新傳送
Sequence
- Client ready,送出NACK (Negative Acknowledge) 給server。Server回應S (Initialization),之後送出包含file name的F (File Header) packet。
- 用D (File Data) packet來送 file data。
- End of Transmission 用 Z (End of File) packet 來通知。
- Server 要 terminate session 用 B (End of Batch) packet
- Server 的每一個packet,Client都要送出 acknowledge packet.
- Client 或 Server timeout 時都要送出 T (timeout) packet.
- E (Fatal Error) packet會terminate session.
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
沒有留言:
張貼留言