資源描述:
《第3章+TCPIP協(xié)議?!酚蓵?huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、第三章TCP/IP協(xié)議棧主講人:ALLEN本章目標(biāo)通過本章的學(xué)習(xí),您應(yīng)該掌握以下內(nèi)容:掌握TCP/IP分層模型掌握三次握手過程理解OSI和TCP/IP模型的區(qū)別和聯(lián)系早期的協(xié)議族全球范圍TCP/IP介紹主機(jī)InternetTCP/IP主機(jī)TCP/IP協(xié)議族7654325432應(yīng)用層表示層會(huì)話層傳輸層網(wǎng)絡(luò)層數(shù)據(jù)鏈路層物理層1應(yīng)用層主機(jī)到主機(jī)層Internet層1網(wǎng)絡(luò)接入層應(yīng)用層概述*路由器使用應(yīng)用層主機(jī)到主機(jī)層Internet層文件傳輸-TFTP*-FTP*-NFSE-Mail-SMTP遠(yuǎn)程登陸-Telnet*-rlogin*網(wǎng)絡(luò)管理-SNMP*名稱管理-DNS*網(wǎng)絡(luò)接入層主機(jī)到主機(jī)層
2、概述TransmissionControlProtocol(TCP)UserDatagramProtocol(UDP)應(yīng)用層主機(jī)到主機(jī)層Internet層網(wǎng)絡(luò)接入層面向連接非面向連接TCP數(shù)據(jù)格式Sourceport(16)Destinationport(16)Sequencenumber(32)Headerlength(4)Acknowledgementnumber(32)Reserved(6)Codebits(6)Window(16)Checksum(16)Urgent(16)Options(0or32ifany)Data(varies)20BytesBit0Bit15Bit1
3、6Bit31端口號(hào)TCP端口號(hào)FTP傳輸層TELNETDNSSNMPTFTPSMTPUDP應(yīng)用層2123255369161RIP520TCP端口號(hào)源端口目標(biāo)端口…HostA102823…SPDPHostZTelnetZ目標(biāo)端口=23.發(fā)送SYN(seq=100ctl=SYN)接收SYNHostAHostBTCP三次握手1發(fā)送SYN(seq=100ctl=SYN)接收SYN發(fā)送SYN,ACK(seq=300ack=101ctl=syn,ack)HostAHostB接收SYN12TCP三次握手發(fā)送SYN(seq=100ctl=SYN)接收SYN發(fā)送
4、SYN,ACK(seq=300ack=101ctl=syn,ack)建立會(huì)話(seq=101ack=301ctl=ack)HostAHostB123接收SYNTCP三次握手TCP連接建立TCP簡(jiǎn)單確認(rèn)滑動(dòng)窗口=1發(fā)送方接收方TCP簡(jiǎn)單確認(rèn)滑動(dòng)窗口=1發(fā)送方接收方發(fā)送1接收1TCP簡(jiǎn)單確認(rèn)滑動(dòng)窗口=1發(fā)送方接收方發(fā)送1接收1接收ACK2發(fā)送ACK2TCP簡(jiǎn)單確認(rèn)滑動(dòng)窗口=1發(fā)送方接收方發(fā)送1接收1接收ACK2發(fā)送ACK2發(fā)送2接收2TCP簡(jiǎn)單確認(rèn)滑動(dòng)窗口=1發(fā)送方接收方發(fā)送1接收1接收ACK2發(fā)送ACK2發(fā)送2接收2接收ACK3發(fā)送ACK3TCP簡(jiǎn)單確認(rèn)滑動(dòng)窗口=1發(fā)送方接收方發(fā)送1接
5、收1接收ACK2發(fā)送ACK2發(fā)送2接收2接收ACK3發(fā)送ACK3發(fā)送3接收3滑動(dòng)窗口=1發(fā)送方接收方發(fā)送1接收1接收ACK2發(fā)送ACK2發(fā)送2接收2接收ACK3發(fā)送ACK3發(fā)送3接收3接收ACK4發(fā)送ACK4TCP簡(jiǎn)單確認(rèn)TCP順序號(hào)和確認(rèn)號(hào)源端口目標(biāo)端口…順序號(hào)#確認(rèn)號(hào)#SourceDest.Seq.Ack.102823101我發(fā)送#10.TCP順序號(hào)和確認(rèn)號(hào)我已收到#10,現(xiàn)在我需要#11.源端口目標(biāo)端口…順序號(hào)#確認(rèn)號(hào)#102823SourceDest.10Seq.1Ack.102823SourceDest.11Seq.1Ack.我發(fā)送#10.TCP順序號(hào)和確認(rèn)號(hào)源端口目標(biāo)端口
6、…順序號(hào)#確認(rèn)號(hào)#102823SourceDest.11Seq.2Ack.102823SourceDest.10Seq.1Ack.102823SourceDest.11Seq.1Ack.我已收到#10,現(xiàn)在我需要#11.我發(fā)送#10.TCP順序號(hào)和確認(rèn)號(hào)源端口目標(biāo)端口…順序號(hào)#確認(rèn)號(hào)#102823SourceDest.11Seq.2Ack.102823SourceDest.10Seq.1Ack.102823SourceDest.11Seq.1Ack.102823SourceDest.12Seq.2Ack.我已收到#11,現(xiàn)在我需要#12.我發(fā)送#11TCP窗口發(fā)送方接收方TCP窗口W
7、indowsize=3Send2發(fā)送方接收方Windowsize=3Send1Windowsize=3Send3Windowsize=3Send2TCP窗口發(fā)送方Windowsize=3Send1Windowsize=3Send3ACK3Windowsize=2數(shù)據(jù)3被丟棄接收方Windowsize=3Send2TCP窗口發(fā)送方Windowsize=3Send1Windowsize=3Send3ACK3Windowsize=2數(shù)據(jù)3被丟棄Windowsiz