文件傳輸服務FTP(中山大學計算機網(wǎng)絡實驗資料)_第1頁
文件傳輸服務FTP(中山大學計算機網(wǎng)絡實驗資料)_第2頁
文件傳輸服務FTP(中山大學計算機網(wǎng)絡實驗資料)_第3頁
文件傳輸服務FTP(中山大學計算機網(wǎng)絡實驗資料)_第4頁
文件傳輸服務FTP(中山大學計算機網(wǎng)絡實驗資料)_第5頁
已閱讀5頁,還剩56頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、 FTP服務的工作過程服務的工作過程 TCP通信過程 TCP數(shù)據(jù)報格式 正常TCP通信過程: 建立連接 數(shù)據(jù)傳輸 斷開連接TCP數(shù)據(jù)報格式TCP數(shù)據(jù)報格式 TCP標志位 ACK:確認標志 RST: 復位標志 URG:緊急標志 SYN:建立連接標志 PSH: 推標志 FIN: 結束標志TCP連接建立過程TCP數(shù)據(jù)傳輸過程TCP PacketEstablishedEstablishedSEQ=1001,ACK=751,dataLen=256Sending1Waiting1SEQ=751,ACK=1257OK1ACK1SEQ=751,ACK=1513OK2ACK2SEQ=1257,ACK=751,d

2、ataLen=256Sending2Waiting2TCP連接斷開過程TCP PacketEstablishedEstablishedSEQ=1513,ACK=751,CTL=FIN|ACKFIN-WAIT-1CLOSE-WAITSEQ=751,ACK=1514,CTL=ACKFIN-WAIT-2CLOSE-WAITSEQ=751,ACK=1514,CTL=FIN|ACKTIME-WAITLAST-ACKSEQ=1514,ACK=752,CTL=ACKTIME-WAITCLOSEDCLOSED實驗環(huán)境 位于同一局域網(wǎng)內(nèi)的兩臺主機,IP分別為:4,19

3、 一個C/S模式的程序,實現(xiàn)簡單的TCP數(shù)據(jù)發(fā)送與接收 Client運行在4 Server運行在19實驗環(huán)境 Client發(fā)送兩次數(shù)據(jù),內(nèi)容分別為123和456,然后發(fā)送0結束TCP連接。 程序截圖如下??蛻舳税l(fā)送數(shù)據(jù)客戶端發(fā)送數(shù)據(jù)服務端接收到數(shù)據(jù)服務端接收到數(shù)據(jù)捕獲數(shù)據(jù)包 在Client發(fā)送數(shù)據(jù)之前,在4主機(Client)上開啟Ethereal。 在捕獲前不進行過濾,直接捕獲所有數(shù)據(jù)包。 當Client結束TCP連接之后,停止捕獲數(shù)據(jù)包。 采用捕獲后過濾的方法,過濾規(guī)則是tcp AND ip.addr=

4、19其中,19是Server主機。 過濾后,共得到11個數(shù)據(jù)包,見下頁圖。數(shù)據(jù)包詳細分析 這11個數(shù)據(jù)包的含義如下: 13:三次握手,建立連接 45:第一次發(fā)送數(shù)據(jù) 67:第二次發(fā)送數(shù)據(jù) 811:斷開連接 下面將對這11個數(shù)據(jù)包進行詳細分析。1 CS SYNSEQ=X+0與與TCP報報文文格格式式相相對對應應2 SC SYN,ACKSEQ=Y+0ACK=X+13 CS ACKSEQ=X+1ACK=Y+1三次握手結束三次握手結束4 CS PSH,ACKSEQ=X+1, data length=256, next seq=257ACK=Y+1數(shù)據(jù)內(nèi)容見下頁圖數(shù)據(jù)內(nèi)容見下頁圖T

5、CP segment data(256 bytes)這是第一次這是第一次發(fā)送的數(shù)據(jù)發(fā)送的數(shù)據(jù)1235 SC ACKSEQ=Y+1ACK=X+257第一次傳輸數(shù)據(jù)結束第一次傳輸數(shù)據(jù)結束6 CS PSH,ACKSEQ=X+257, data length=256, next seq=513ACK=Y+1數(shù)據(jù)內(nèi)容見下頁圖數(shù)據(jù)內(nèi)容見下頁圖TCP segment data(256 bytes)這是第二次這是第二次發(fā)送的數(shù)據(jù)發(fā)送的數(shù)據(jù)4567 SC ACKSEQ=Y+1ACK=X+513第二次傳輸數(shù)據(jù)結束第二次傳輸數(shù)據(jù)結束8 CS FIN,ACKSEQ=X+513ACK=Y+19 SC ACKSEQ=Y+

6、1ACK=X+51410 SC FIN,ACKSEQ=Y+1ACK=X+51411 CS ACKSEQ=X+514ACK=Y+2TCP連接已經(jīng)斷開連接已經(jīng)斷開 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restricti

7、ons apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kb

8、ytes/s).14 ftp quit15 221 Goodbye.01 用戶要用 FTP 和遠地主機建立連接。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc

9、09 250 CWD command successful.10 ftp get rfc1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 2

10、21 Goodbye.02 本地 FTP 發(fā)出的連接成功信息。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command succes

11、sful.10 ftp get rfc1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.03 從遠地服務器返回的信息

12、,220 表示“服務就緒”。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get r

13、fc1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.04 本地 FTP 提示用戶鍵入名字。用戶鍵入的名字表示“匿名

14、”。用戶只需鍵入 anonymous 即可。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 f

15、tp get rfc1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.05 數(shù)字 331 表示“用戶名正確”,需要口

16、令。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261.txt n

17、icinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.06 本地 FTP 提示用戶鍵入口令。用戶這時可鍵入guest 作為匿名的口令,也可以

18、鍵入自己的電子郵件地址,即名為 xyz 的主機上的 abc。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command success

19、ful.10 ftp get rfc1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.07 數(shù)字 230 表示用戶已

20、經(jīng)注冊完畢。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261.t

21、xt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.“ftp”是 FTP 的提示信息。用戶鍵入的是將目錄改變?yōu)榘?RFC 文件的

22、目錄。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261.txt

23、nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.09 字符 CWD 是 FTP 的標準命令,代表 Change Working Di

24、rectory。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261

25、.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.10 用戶要求將名為 rfc1261.txt 的文件復制到本地主機上,并改

26、名為 nicinfo。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1

27、261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.11 字符 PORT 是 FTP 的標準命令,表示要建立數(shù)據(jù)連接。2

28、00 表示“命令正確”。 01 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc

29、1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.12 數(shù)字 150 表示“文件狀態(tài)正確, 即將建立數(shù)據(jù)連接”。 0

30、1 ftp 02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261.txt nicin

31、fo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.13 數(shù)字 226 是“釋放數(shù)據(jù)連接”?,F(xiàn)在一個新的本地文件已產(chǎn)生。 01 ftp nic.d

32、02 connected to 03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261.txt nicinfo11 200 PO

33、RT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 bytes).13 226 ASCII Transfer complete. local: nicinfo remote: rfc1261.txt 4488 bytes received in 15 seconds (0.3 Kbytes/s).14 ftp quit15 221 Goodbye.14 用戶鍵入退出命令。 01 ftp 02 connected to

34、03 220 nic FTP server (Sunos 4.1)ready.04 Name: anonymous05 331 Guest login ok, send ident as password.06 Password: 07 230 Guest login ok, access restrictions apply.08 ftp cd rfc09 250 CWD command successful.10 ftp get rfc1261.txt nicinfo11 200 PORT command successful.12 150 ASCII data connection for rfc1261.txt (7,1401) (4318 b

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論