




版權說明:本文檔由用戶提供并上傳,收益歸屬內(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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- LY/T 2762-2024黃精
- 2025至2030年中國平衡重式電動車數(shù)據(jù)監(jiān)測研究報告
- 2025至2030年中國PVC防靜電膠地板數(shù)據(jù)監(jiān)測研究報告
- 【假期提升】 五升六語文暑假作業(yè)(十三)-人教部編版(含答案含解析)
- 2025年消防設施操作員之消防設備中級技能提升訓練試卷A卷附答案
- 城步中考數(shù)學試題及答案
- 采購與制造分包合同(2篇)
- 高等教育自學考試《00102世界市場行情》模擬試卷二
- 2024年廣東省公務員《申論(省市級)》試題真題及答案
- 內(nèi)燃機基礎知識培訓課件
- 2025年天翼云解決方案架構師認證考試指導題庫-上(單選題)
- 2025年廣東省深圳市高考語文一模試卷
- 2025年春人教版英語八年級下冊同步課件 Unit 7 Whats the highest mountain in the world課件 Section A 1a-2d
- 2025年哈爾濱鐵道職業(yè)技術學院單招職業(yè)傾向性測試題庫必考題
- 行為規(guī)范教育中學校長在國旗下講話:嚴格要求自己規(guī)范自己的行為
- 2025年福建省高職單招職業(yè)適應性測試題庫及答案解析
- 七下綜合世界真奇妙-共享“地球村”
- 自媒體運營實戰(zhàn)教程(抖音版) 課件 第7章 短視頻運營-自媒體中級
- 2025年信陽職業(yè)技術學院高職單招職業(yè)技能測試近5年常考版參考題庫含答案解析
- 2024年廣東職業(yè)技術學院高職單招語文歷年參考題庫含答案解析
評論
0/150
提交評論