




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 FTP服務(wù)的工作過(guò)程服務(wù)的工作過(guò)程 TCP通信過(guò)程 TCP數(shù)據(jù)報(bào)格式 正常TCP通信過(guò)程: 建立連接 數(shù)據(jù)傳輸 斷開連接TCP數(shù)據(jù)報(bào)格式TCP數(shù)據(jù)報(bào)格式 TCP標(biāo)志位 ACK:確認(rèn)標(biāo)志 RST: 復(fù)位標(biāo)志 URG:緊急標(biāo)志 SYN:建立連接標(biāo)志 PSH: 推標(biāo)志 FIN: 結(jié)束標(biāo)志TCP連接建立過(guò)程TCP數(shù)據(jù)傳輸過(guò)程TCP PacketEstablishedEstablishedSEQ=1001,ACK=751,dataLen=256Sending1Waiting1SEQ=751,ACK=1257OK1ACK1SEQ=751,ACK=1513OK2ACK2SEQ=1257,ACK=751,d
2、ataLen=256Sending2Waiting2TCP連接斷開過(guò)程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實(shí)驗(yàn)環(huán)境 位于同一局域網(wǎng)內(nèi)的兩臺(tái)主機(jī),IP分別為:4,19
3、 一個(gè)C/S模式的程序,實(shí)現(xiàn)簡(jiǎn)單的TCP數(shù)據(jù)發(fā)送與接收 Client運(yùn)行在4 Server運(yùn)行在19實(shí)驗(yàn)環(huán)境 Client發(fā)送兩次數(shù)據(jù),內(nèi)容分別為123和456,然后發(fā)送0結(jié)束TCP連接。 程序截圖如下??蛻舳税l(fā)送數(shù)據(jù)客戶端發(fā)送數(shù)據(jù)服務(wù)端接收到數(shù)據(jù)服務(wù)端接收到數(shù)據(jù)捕獲數(shù)據(jù)包 在Client發(fā)送數(shù)據(jù)之前,在4主機(jī)(Client)上開啟Ethereal。 在捕獲前不進(jìn)行過(guò)濾,直接捕獲所有數(shù)據(jù)包。 當(dāng)Client結(jié)束TCP連接之后,停止捕獲數(shù)據(jù)包。 采用捕獲后過(guò)濾的方法,過(guò)濾規(guī)則是tcp AND ip.addr=
4、19其中,19是Server主機(jī)。 過(guò)濾后,共得到11個(gè)數(shù)據(jù)包,見下頁(yè)圖。數(shù)據(jù)包詳細(xì)分析 這11個(gè)數(shù)據(jù)包的含義如下: 13:三次握手,建立連接 45:第一次發(fā)送數(shù)據(jù) 67:第二次發(fā)送數(shù)據(jù) 811:斷開連接 下面將對(duì)這11個(gè)數(shù)據(jù)包進(jìn)行詳細(xì)分析。1 CS SYNSEQ=X+0與與TCP報(bào)報(bào)文文格格式式相相對(duì)對(duì)應(yīng)應(yīng)2 SC SYN,ACKSEQ=Y+0ACK=X+13 CS ACKSEQ=X+1ACK=Y+1三次握手結(jié)束三次握手結(jié)束4 CS PSH,ACKSEQ=X+1, data length=256, next seq=257ACK=Y+1數(shù)據(jù)內(nèi)容見下頁(yè)圖數(shù)據(jù)內(nèi)容見下頁(yè)圖T
5、CP segment data(256 bytes)這是第一次這是第一次發(fā)送的數(shù)據(jù)發(fā)送的數(shù)據(jù)1235 SC ACKSEQ=Y+1ACK=X+257第一次傳輸數(shù)據(jù)結(jié)束第一次傳輸數(shù)據(jù)結(jié)束6 CS PSH,ACKSEQ=X+257, data length=256, next seq=513ACK=Y+1數(shù)據(jù)內(nèi)容見下頁(yè)圖數(shù)據(jù)內(nèi)容見下頁(yè)圖TCP segment data(256 bytes)這是第二次這是第二次發(fā)送的數(shù)據(jù)發(fā)送的數(shù)據(jù)4567 SC ACKSEQ=Y+1ACK=X+513第二次傳輸數(shù)據(jù)結(jié)束第二次傳輸數(shù)據(jù)結(jié)束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 和遠(yuǎn)地主機(jī)建立連接。 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 從遠(yuǎn)地服務(wù)器返回的信息
12、,220 表示“服務(wù)就緒”。 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 提示用戶鍵入口令。用戶這時(shí)可鍵入guest 作為匿名的口令,也可以
18、鍵入自己的電子郵件地址,即名為 xyz 的主機(jī)上的 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)注冊(cè)完畢。 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 的標(biāo)準(zhǔn)命令,代表 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 的文件復(fù)制到本地主機(jī)上,并改
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 的標(biāo)準(zhǔn)命令,表示要建立數(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)在一個(gè)新的本地文件已產(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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025版包工承包生態(tài)住宅建筑工程合同樣本
- 2025版不良資產(chǎn)處置與資產(chǎn)管理一體化服務(wù)合同
- 二零二五年度綠色環(huán)保辦公用品采購(gòu)合同
- 二零二五年度餐飲連鎖店合作經(jīng)營(yíng)合同模板
- 防水工三級(jí)安全教育試卷含答案
- 2025版保密網(wǎng)絡(luò)安全設(shè)備定制與維護(hù)服務(wù)合同樣本
- 2025版文創(chuàng)產(chǎn)品彩繪墻體素材定制合同
- 二零二五版智能公廁設(shè)計(jì)與施工總承包合同
- 二零二五年度房地產(chǎn)項(xiàng)目裝修材料采購(gòu)合同范本
- 二零二五年農(nóng)產(chǎn)品深加工技術(shù)研發(fā)采購(gòu)返利合同
- 人工智能技術(shù)在醫(yī)療中的應(yīng)用案例
- 中草藥種植的土壤改良技術(shù)
- 尿膿毒癥護(hù)理查房
- 安全綠十字看板(A4打?。?/a>
- 家長(zhǎng)會(huì)課件:七年級(jí)暑假家長(zhǎng)會(huì)課件
- CMK自動(dòng)計(jì)算公式表格模板
- 急性中毒知識(shí)講座課件
- 2023屆廣東省佛山市石門中學(xué)畢業(yè)升學(xué)考試模擬卷數(shù)學(xué)卷含解析
- 2023年應(yīng)聘校長(zhǎng)副校長(zhǎng)面試題
- 代際領(lǐng)導(dǎo)力-用90后思維管理90后-完整版
- 建筑工程造價(jià)鑒定規(guī)范
評(píng)論
0/150
提交評(píng)論