




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、 FTP服務(wù)的工作過程服務(wù)的工作過程 TCP通信過程 TCP數(shù)據(jù)報格式 正常TCP通信過程: 建立連接 數(shù)據(jù)傳輸 斷開連接TCP數(shù)據(jù)報格式TCP數(shù)據(jù)報格式 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連接建立過程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結(jié)束TCP連接。 程序截圖如下??蛻舳税l(fā)送數(shù)據(jù)客戶端發(fā)送數(shù)據(jù)服務(wù)端接收到數(shù)據(jù)服務(wù)端接收到數(shù)據(jù)捕獲數(shù)據(jù)包 在Client發(fā)送數(shù)據(jù)之前,在4主機(Client)上開啟Ethereal。 在捕獲前不進(jìn)行過濾,直接捕獲所有數(shù)據(jù)包。 當(dāng)Client結(jié)束TCP連接之后,停止捕獲數(shù)據(jù)包。 采用捕獲后過濾的方法,過濾規(guī)則是tcp AND ip.addr=
4、19其中,19是Server主機。 過濾后,共得到11個數(shù)據(jù)包,見下頁圖。數(shù)據(jù)包詳細(xì)分析 這11個數(shù)據(jù)包的含義如下: 13:三次握手,建立連接 45:第一次發(fā)送數(shù)據(jù) 67:第二次發(fā)送數(shù)據(jù) 811:斷開連接 下面將對這11個數(shù)據(jù)包進(jìn)行詳細(xì)分析。1 CS SYNSEQ=X+0與與TCP報報文文格格式式相相對對應(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)容見下頁圖數(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ù)結(jié)束第一次傳輸數(shù)據(jù)結(jié)束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ù)結(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)地主機建立連接。 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 提示用戶鍵入口令。用戶這時可鍵入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 的標(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ù)制到本地主機上,并改
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)在一個新的本地文件已產(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)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 尊能者師傳統(tǒng)文化課件
- 股權(quán)轉(zhuǎn)讓合同解除與撤銷條件說明
- 文化產(chǎn)業(yè)采購保密協(xié)議及知識產(chǎn)權(quán)保護(hù)與許可合同
- 車輛抵押貸款擔(dān)保協(xié)議范本
- 辦公家具采購與綠色采購認(rèn)證合同
- 教學(xué)課件幼小銜接
- 中國石化加油站業(yè)務(wù)知識及操作規(guī)范測試試卷
- 體育和休閑預(yù)浸料市場分析:碳纖維預(yù)浸料是最大的細(xì)分市場占90%份額
- 輔音音素教學(xué)課件
- 服務(wù)質(zhì)量監(jiān)控工具應(yīng)用考核試卷
- 勞動仲裁內(nèi)部培訓(xùn)
- 工廠注塑考試題及答案
- 2024年懷化麻陽苗族自治縣招聘事業(yè)單位工作人員筆試真題
- 湖南省長沙市望城區(qū)第二中學(xué)2024-2025學(xué)年高一下學(xué)期6月第三次月考政治試卷(含答案)
- 四川省甘孜州道孚一中學(xué)2025屆七下英語期末統(tǒng)考試題含答案
- 廣東省深圳市寶安區(qū)2023-2024學(xué)年四年級下學(xué)期數(shù)學(xué)期末試卷(含答案)
- 緬甸語教學(xué)與學(xué)習(xí)作業(yè)指導(dǎo)書
- 水表制造企業(yè)生產(chǎn)條件要求征求意見稿
- T/CACEM 25-2023高速公路限速標(biāo)志設(shè)置規(guī)范
- 醫(yī)院感染暴發(fā)報告流程及處置預(yù)案
- 八年級英語下學(xué)期期末考試(廣州專用)(解析版)
評論
0/150
提交評論