計(jì)算機(jī)網(wǎng)絡(luò)第五版教學(xué)Chapter3AriesHE.ppt_第1頁(yè)
計(jì)算機(jī)網(wǎng)絡(luò)第五版教學(xué)Chapter3AriesHE.ppt_第2頁(yè)
計(jì)算機(jī)網(wǎng)絡(luò)第五版教學(xué)Chapter3AriesHE.ppt_第3頁(yè)
計(jì)算機(jī)網(wǎng)絡(luò)第五版教學(xué)Chapter3AriesHE.ppt_第4頁(yè)
計(jì)算機(jī)網(wǎng)絡(luò)第五版教學(xué)Chapter3AriesHE.ppt_第5頁(yè)
已閱讀5頁(yè),還剩90頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、本章小結(jié),應(yīng)用層協(xié)議原理 客戶服務(wù)器模式WEB和HTTP 非持久連接和持久連接 請(qǐng)求報(bào)文和響應(yīng)報(bào)文 cookie、cache、條件GETFTP 兩個(gè)連接、兩個(gè)端口、服務(wù)器兩類進(jìn)程 EMAIL SMTP、POP3、IMAP DNS 分布式、層次結(jié)構(gòu),GET /icwork/? search=product HTTP/1.1 Accept:image/gif,image/x-xbitmap,image/jpeg,image/ pjpeg,application/vnd.ms-powerpoint,application /vnd.ms-excel,application/msword,*.* Ac

2、cept-Language:en-us Accept-Encoding:gzip,deflate User-Agent:Mozilla/4.0(compatible;MSIE 5.01;Windows NT 5.0;DigExt) Host:8080 Referer: Connection:Keep-Alive,Chapter 3 Transport Layer,Computer Networking: A Top Down Approach 4rd edition. Jim Kurose, Keith Ross,Chapter 3: Transport Layer,Our goals: un

3、derstand principles behind transport layer services: multiplexing/demultiplexing reliable data transfer flow control congestion control,learn about transport layer protocols in the Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control,Chapter 3 outline,3.1

4、 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP con

5、gestion control,從通信和信息處理的角度看,傳輸層向它上面的應(yīng)用層提供通信服務(wù),它屬于面向通信部分的最高層,同時(shí)也是用戶功能中的最低層。,物理層,網(wǎng)絡(luò)層,傳輸層,應(yīng)用層,數(shù)據(jù)鏈路層,面向信息處理,面向通信,用戶功能,網(wǎng)絡(luò)功能,傳輸層在協(xié)議層次結(jié)構(gòu)中的位置,問(wèn)題的提出,計(jì)算機(jī)網(wǎng)絡(luò)最本質(zhì)的活動(dòng)是分布在不同地理位置的主機(jī)之間的進(jìn)程通信,以實(shí)現(xiàn)各種網(wǎng)絡(luò)服務(wù)功能; 網(wǎng)絡(luò)層及以下的各層實(shí)現(xiàn)了網(wǎng)絡(luò)中主機(jī)之間的通信,但是數(shù)據(jù)通信不是最終的目的; 設(shè)置傳輸層的主要目的就是要實(shí)現(xiàn)分布式進(jìn)程通信。,問(wèn)題的提出,需要一套傳輸控制機(jī)制,更可靠、更方便 和有效的傳送數(shù)據(jù),且將這種機(jī)制與應(yīng)用 程序分離開(kāi),并向

6、應(yīng)用程序提供一致的數(shù) 據(jù)流傳送接口。,傳輸層就是應(yīng)上述要求而產(chǎn)生的,網(wǎng)絡(luò)環(huán)境中分布式進(jìn)程通信需要解決,進(jìn)程命名與尋址方法 多重協(xié)議的識(shí)別 進(jìn)程間相互作用的模式,進(jìn)程尋址與端口,在一臺(tái)計(jì)算機(jī)中,不同的進(jìn)程用進(jìn)程號(hào)或進(jìn)程標(biāo)識(shí)(process ID)惟一地標(biāo)識(shí)出來(lái)。 網(wǎng)絡(luò)環(huán)境中完整的進(jìn)程標(biāo)識(shí)應(yīng)該是: 本地主機(jī)地址-本地進(jìn)程標(biāo)識(shí) ; 遠(yuǎn)程主機(jī)地址-遠(yuǎn)程進(jìn)程標(biāo)識(shí)。 進(jìn)程地址也叫做端口號(hào)(port number)。 端口就是運(yùn)輸層服務(wù)訪問(wèn)點(diǎn) TSAP。 端口的作用就是讓應(yīng)用層的各種應(yīng)用進(jìn)程都能將其數(shù)據(jù)通過(guò)端口向下交付給運(yùn)輸層,以及讓運(yùn)輸層知道應(yīng)當(dāng)將其報(bào)文段中的數(shù)據(jù)向上通過(guò)端口交付給應(yīng)用層相應(yīng)的進(jìn)程。 從這

7、個(gè)意義上講,端口是用來(lái)標(biāo)志應(yīng)用層的進(jìn)程。,多重協(xié)議的識(shí)別,網(wǎng)絡(luò)環(huán)境中一個(gè)進(jìn)程的全網(wǎng)惟一的標(biāo)識(shí)需要一個(gè)三元組來(lái)表示:協(xié)議,本地地址,本地端口號(hào)。 網(wǎng)絡(luò)環(huán)境中一個(gè)完整的進(jìn)程通信標(biāo)識(shí)需要一個(gè)五元組來(lái)表示: 協(xié)議 本地地址 本地端口號(hào) 遠(yuǎn)地地址 遠(yuǎn)地端口號(hào),Transport services and protocols,provide logical communication between app processes running on different hosts transport protocols run in end systems send side: breaks app me

8、ssages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP,transport layer: logical communication between processes,5 4 3 2 1,傳輸層提供應(yīng)用進(jìn)程間的邏輯通信,主機(jī) A,主機(jī) B,應(yīng)用進(jìn)程,應(yīng)用進(jìn)程,路由器 1,路由器 2,

9、AP1,LAN2,WAN,AP2,AP3,AP4,IP 層,LAN1,AP1,AP2,AP4,5 4 3 2 1,網(wǎng)絡(luò)層協(xié)議的作用范圍,傳輸層協(xié)議 TCP 和 UDP 的作用范圍,AP3,Transport vs. network layer,network layer: logical communication between hosts transport layer: logical communication between processes relies on, enhances, network layer services,Household analogy: 12 kids

10、 sending letters to 12 kids processes = kids app messages = letters in envelopes hosts = houses transport protocol = Ann and Bill network-layer protocol = postal service,傳輸層協(xié)議和網(wǎng)絡(luò)層協(xié)議的主要區(qū)別,應(yīng)用進(jìn)程,應(yīng)用進(jìn)程,IP 協(xié)議的作用范圍 (提供主機(jī)之間的邏輯通信),TCP 和 UDP 協(xié)議的作用范圍 (提供進(jìn)程之間的邏輯通信),因 特 網(wǎng),Internet transport-layer protocols,relia

11、ble, in-order delivery (TCP) congestion control flow control connection setup unreliable, unordered delivery: UDP no-frills(不提供必要服務(wù)的) extension of “best-effort”,傳輸層數(shù)據(jù)單元,傳輸層之間傳輸?shù)膱?bào)文叫做傳輸協(xié)議數(shù)據(jù)單元( Transport Protocol Unit,TPDU); TPDU有效載荷是應(yīng)用層的數(shù)據(jù)。 網(wǎng)絡(luò)層:Datagaram 傳輸層:Segment,H T T P,F T P,S M T P,T F T P,D N S

12、,T e l n e t,S N M P,21,23,25,53,69,161,TCP UDP,應(yīng)用層,傳輸層,TCP和UDP都用端口(port)號(hào)來(lái)識(shí)別應(yīng)用層實(shí)體,以便準(zhǔn)確地把信息提交給上層對(duì)應(yīng)的協(xié)議(進(jìn)程)。,port,80,傳輸層向上提供可靠的和不可靠的邏輯通信信道,?,應(yīng) 用 層,傳 輸 層,發(fā) 送 進(jìn) 程,接 收 進(jìn) 程,接 收 進(jìn) 程,數(shù)據(jù),數(shù)據(jù),全雙工可靠信道,數(shù)據(jù),數(shù)據(jù),使用 TCP 協(xié)議,使用 UDP 協(xié)議,不可靠信道,發(fā) 送 進(jìn) 程,TCP 與 UDP,UDP 在傳送數(shù)據(jù)之前不需要先建立連接。對(duì)方的傳輸層在收到 UDP 報(bào)文后,不需要給出任何確認(rèn)。雖然 UDP 不提供可靠交

13、付,但在某些情況下 UDP 是一種最有效的工作方式。 TCP 則提供面向連接的服務(wù)。由于 TCP 要提供可靠的、面向連接的傳輸服務(wù),因此不可避免地增加了許多的開(kāi)銷。這不僅使協(xié)議數(shù)據(jù)單元的首部增大很多,還要占用許多的處理機(jī)資源。,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented tran

14、sport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,Multiplexing/demultiplexing,application,transport,network,link,physical,P1,application,transport,network,link,physical,application,transport,network,

15、link,physical,P2,P3,P4,P1,host 1,host 2,host 3,= process,= socket,delivering received segments to correct socket,gathering data from multiple sockets, enveloping data with header (later used for demultiplexing),Multiplexing/demultiplexing,應(yīng) 用 層,運(yùn) 輸 層,網(wǎng) 絡(luò) 層,TCP 報(bào)文段,UDP 用戶數(shù)據(jù)報(bào),應(yīng)用進(jìn)程,TCP 復(fù)用,IP 復(fù)用,UDP 復(fù)用,

16、TCP 報(bào)文段,UDP 用戶數(shù)據(jù)報(bào),應(yīng)用進(jìn)程,端口,端口,TCP 分用,UDP 分用,IP 分用,發(fā)送方,接收方,How demultiplexing works,host receives IP datagrams each datagram has source IP address, destination IP address each datagram carries 1 transport-layer segment each segment has source, destination port number host uses IP addresses DatagramSoc

17、ket mySocket2 = new DatagramSocket(12535); UDP socket identified by two-tuple: (dest IP address, dest port number),When host receives UDP segment: checks destination port number in segment directs UDP segment to socket with that port number IP datagrams with different source IP addresses and/or sour

18、ce port numbers directed to same socket,Connectionless demux (cont),DatagramSocket serverSocket = new DatagramSocket(6428);,SP provides “return address”,Connection-oriented demux,TCP socket identified by 4-tuple: source IP address source port number dest IP address dest port number recv host uses al

19、l four values to direct segment to appropriate socket,Server host may support many simultaneous TCP sockets: each socket identified by its own 4-tuple Web servers have different sockets for each connecting client non-persistent HTTP will have different socket for each request,Connection-oriented dem

20、ux (cont),Client IP:B,server IP: C,SP: 9157,DP: 80,D-IP:C,S-IP: A,D-IP:C,S-IP: B,D-IP:C,S-IP: B,Connection-oriented demux: Threaded Web Server,Client IP:B,server IP: C,SP: 9157,DP: 80,P4,D-IP:C,S-IP: A,D-IP:C,S-IP: B,D-IP:C,S-IP: B,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and

21、demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,UDP: User Datagram Protocol RFC

22、 768,“no frills,” “bare bones” (簡(jiǎn)約)Internet transport protocol “best effort” service, UDP segments may be: lost delivered out of order to app,Why is there a UDP? no connection establishment (which can add delay) simple: no connection state at sender, receiver small segment header no congestion contr

23、ol: UDP can blast away as fast as desired,用戶數(shù)據(jù)報(bào)協(xié)議 UDP,UDP 只在 IP 的數(shù)據(jù)報(bào)服務(wù)之上增加了很少一點(diǎn)的功能,即端口的功能和差錯(cuò)檢測(cè)的功能。 雖然 UDP 用戶數(shù)據(jù)報(bào)只能提供不可靠的交付,但 UDP 在某些方面有其特殊的優(yōu)點(diǎn)。 發(fā)送數(shù)據(jù)之前不需要建立連接 UDP 的主機(jī)不需要維持復(fù)雜的連接狀態(tài)表。 UDP 用戶數(shù)據(jù)報(bào)只有8個(gè)字節(jié)的首部開(kāi)銷。 網(wǎng)絡(luò)出現(xiàn)的擁塞不會(huì)使源主機(jī)的發(fā)送速率降低。,UDP: more,often used for streaming multimedia apps loss tolerant rate sensitiv

24、e other UDP uses DNS SNMP reliable transfer over UDP: add reliability at application layer application-specific error recovery!,source port #,dest port #,32 bits,Application data (message),UDP segment format,length,checksum,Length, in bytes of UDP segment, including header,偽首部,源端口,目的端口,長(zhǎng) 度,檢驗(yàn)和,數(shù) 據(jù),首

25、 部,IP 數(shù)據(jù)報(bào),12,2,2,2,2,字節(jié),發(fā)送在前,數(shù) 據(jù),首 部,UDP 用戶數(shù)據(jù)報(bào),Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control co

26、nnection management 3.6 Principles of congestion control 3.7 TCP congestion control,Principles of Reliable data transfer,important in app., transport, link layers top-10 list of important networking topics!,characteristics of unreliable channel will determine complexity of reliable data transfer pro

27、tocol (rdt),Principles of Reliable data transfer,important in app., transport, link layers top-10 list of important networking topics!,characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt),Principles of Reliable data transfer,important in app., tran

28、sport, link layers top-10 list of important networking topics!,characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt),Reliable data transfer: getting started,send side,receive side,Reliable data transfer: getting started,Well: Incrementally漸進(jìn)的 develo

29、p sender, receiver sides of reliable data transfer protocol (rdt) consider only unidirectional單向的 data transfer but control info will flow on both directions! use finite state machines (FSM) to specify sender, receiver,event causing state transition,actions taken on state transition,state: when in t

30、his “state” next state uniquely determined by next event,Building a reliable data transfer protocol,Rdt1.0 Rdt2.0 Rdt 2.1 Rdt 2.2 Rdt 3.0,Rdt1.0: reliable transfer over a reliable channel,underlying channel perfectly reliable no bit errors no loss of packets separate FSMs(有限狀態(tài)機(jī)) for sender, receiver

31、: sender sends data into underlying channel receiver read data from underlying channel,Wait for call from above,packet = make_pkt(data) udt_send(packet),rdt_send(data),extract (packet,data) deliver_data(data),Wait for call from below,rdt_rcv(packet),sender,receiver,Rdt2.0: channel with bit errors,un

32、derlying channel may flip bits(比特翻轉(zhuǎn)) in packet checksum to detect bit errors the question: how to recover from errors: acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK negative acknowledgements (NAKs): receiver explicitly tells sender that pkt had errors sender retransm

33、its pkt on receipt of NAK new mechanisms in rdt2.0 (beyond rdt1.0): error detection receiver feedback: control msgs (ACK,NAK) rcvr-sender,rdt3.0: channels with errors and loss,New assumption: underlying channel can also lose packets (data or ACKs) checksum, seq. #, ACKs, retransmissions will be of h

34、elp, but not enough,Approach: sender waits “reasonable” amount of time for ACK retransmits if no ACK received in this time if pkt (or ACK) just delayed (not lost): retransmission will be duplicate, but use of seq. #s already handles this receiver must specify seq # of pkt being ACKed requires countd

35、own timer,Chapter 3 outline,3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of

36、 congestion control 3.7 TCP congestion control,TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581,full duplex data:全雙工數(shù)據(jù)流 bi-directional data flow in same connection 一個(gè)連接有兩個(gè)方向的數(shù)據(jù)流 MSS: maximum segment size MSS:最大段大小 connection-oriented:面向連接 handshaking (exchange of control msgs) inits sender, receiver

37、state before data exchange 握手(交換控制信息):在交換數(shù)據(jù)之前初始化發(fā)送方和接收方狀態(tài) flow controlled: sender will not overwhelm receiver 發(fā)送方不會(huì)淹沒(méi)接收方,point-to-point:點(diǎn)對(duì)點(diǎn) one sender, one receiver一個(gè)發(fā)送方一個(gè)接收方 reliable, in-order byte steam:可靠的,有序的數(shù)據(jù)流 no “message boundaries” 沒(méi)有信息邊界 pipelined:管道的 TCP congestion and flow control set win

38、dow size 通過(guò)設(shè)置窗口大小進(jìn)行流量控制和擁塞控制 send server: contacted by client Socket connectionSocket = welcomeSocket.accept();,Three way handshake:三次握手 Step 1: client host sends TCP SYN segment to server客戶端發(fā)SYN段 specifies initial seq #指明序列號(hào) no data沒(méi)有數(shù)據(jù) Step 2: server host receives SYN, replies with SYNACK segment回

39、復(fù)ACK段 server allocates buffers分配緩存 specifies server initial seq. #定義服務(wù)端序號(hào) Step 3: client receives SYNACK, replies with ACK segment, which may contain data客戶端接收ACK回復(fù)ACK段,里面沒(méi)有數(shù)據(jù),TCP Connection Management (cont.),Closing a connection:關(guān)閉連接 client closes socket: clientSocket.close();客戶端關(guān)閉socket Step 1: c

40、lient end system sends TCP FIN control segment to server 客戶端發(fā)送FIN控制段 Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN. 服務(wù)器端發(fā)FIN的確認(rèn),關(guān)閉連接,發(fā)送FIN,TCP Connection Management (cont.),Step 3: client receives FIN, replies with ACK. 客戶端收到FIN回復(fù)確認(rèn) Step 4: server, receives ACK. Connect

41、ion closed. 服務(wù)器端收到確認(rèn),關(guān)閉連接,client,FIN,server,ACK,ACK,FIN,closing,closing,closed,timed wait,closed,服務(wù)器,CLOSED,CLOSED,主動(dòng)打開(kāi),被動(dòng)打開(kāi),A,B,客戶,TCP 的連接建立用三次握手建立 TCP 連接,A 的 TCP 向 B 發(fā)出連接請(qǐng)求報(bào)文段,其首部中的 同步位 SYN = 1,并選擇序號(hào) seq = x,表明傳送 數(shù)據(jù)時(shí)的第一個(gè)數(shù)據(jù)字節(jié)的序號(hào)是 x。,服務(wù)器,B 的 TCP 收到連接請(qǐng)求報(bào)文段后,如同意,則 發(fā)回確認(rèn)。 B 在確認(rèn)報(bào)文段中應(yīng)使 SYN = 1,使 ACK = 1,

42、其確認(rèn)號(hào) ack = x 1,自己選擇的序號(hào) seq = y。,CLOSED,CLOSED,主動(dòng)打開(kāi),被動(dòng)打開(kāi),A,客戶,B,TCP 的連接建立用三次握手建立 TCP 連接,服務(wù)器,A 收到此報(bào)文段后向 B 給出確認(rèn),其 ACK = 1, 確認(rèn)號(hào) ack = y 1。 A 的 TCP 通知上層應(yīng)用進(jìn)程,連接已經(jīng)建立。,主動(dòng)打開(kāi),被動(dòng)打開(kāi),A,客戶,B,通知 應(yīng)用 進(jìn)程,服務(wù)器,B 的 TCP 收到主機(jī) A 的確認(rèn)后,也通知其上層 應(yīng)用進(jìn)程:TCP 連接已經(jīng)建立。 以后就可以傳送數(shù)據(jù)了。,主動(dòng)打開(kāi),被動(dòng)打開(kāi),A,客戶,B,通知 應(yīng)用 進(jìn)程,在數(shù)據(jù)包丟失、重復(fù)和延遲的情況下, 3次握手法是保證連接

43、無(wú)二義性的充要條件。,主動(dòng)關(guān)閉,數(shù)據(jù)傳送,A,B,客戶,服務(wù)器,CLOSED,TCP 的連接釋放,數(shù)據(jù)傳輸結(jié)束后,通信的雙方都可釋放連接。 現(xiàn)在 A 的應(yīng)用進(jìn)程先向其 TCP 發(fā)出連接釋放 報(bào)文段,并停止再發(fā)送數(shù)據(jù),主動(dòng)關(guān)閉 TCP 連接。 A 把連接釋放報(bào)文段首部的 FIN = 1,其序號(hào) seq = u,等待 B 的確認(rèn)。,被動(dòng)關(guān)閉,數(shù)據(jù)傳送,通知 應(yīng)用 進(jìn)程,B 發(fā)出確認(rèn),確認(rèn)號(hào) ack = u 1, 而這個(gè)報(bào)文段自己的序號(hào) seq = v。 TCP 服務(wù)器進(jìn)程通知高層應(yīng)用進(jìn)程。 從 A 到 B 這個(gè)方向的連接就釋放了,TCP 連接 處于半關(guān)閉狀態(tài)。B 若發(fā)送數(shù)據(jù),A 仍要接收。,主動(dòng)關(guān)

44、閉,數(shù)據(jù)傳送,A,B,客戶,服務(wù)器,TCP 的連接釋放,被動(dòng)關(guān)閉,數(shù)據(jù)傳送,若 B 已經(jīng)沒(méi)有要向 A 發(fā)送的數(shù)據(jù), 其應(yīng)用進(jìn)程就通知 TCP 釋放連接。,數(shù)據(jù)傳送,主動(dòng)關(guān)閉,數(shù)據(jù)傳送,A,B,客戶,服務(wù)器,TCP 的連接釋放,被動(dòng)關(guān)閉,通知 應(yīng)用 進(jìn)程,半關(guān)閉狀態(tài),FIN = 1, ACK = 1, seq = v, ack= u 1,半關(guān)閉狀態(tài),關(guān)閉狀態(tài),數(shù)據(jù)傳送,數(shù)據(jù)傳送,主動(dòng)關(guān)閉,數(shù)據(jù)傳送,A,B,客戶,服務(wù)器,被動(dòng)關(guān)閉,通知 應(yīng)用 進(jìn)程,A 向 B 發(fā)送確認(rèn)后,TCP 連接進(jìn)入關(guān)閉狀態(tài)。,Chapter 3 outline,3.1 Transport-layer services 3.

45、2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,TCP reliable

46、 data transfer,TCP creates rdt service on top of IPs unreliable service TCP在IP層之上提供了可靠的數(shù)據(jù)出傳輸服務(wù) Pipelined segments 段的流水線傳輸 Cumulative acks累計(jì)確認(rèn) TCP uses single retransmission timer TCP使用單個(gè)重傳時(shí)鐘 Retransmissions are triggered by:重傳被下面事件觸發(fā) timeout events超時(shí)事件 duplicate acks重復(fù)確認(rèn),TCP: retransmission scenario

47、s重傳方案,Host A,Seq=100, 20 bytes data,ACK=100,premature timeout 過(guò)早超時(shí),Host B,Seq=92, 8 bytes data,ACK=120,Seq=92, 8 bytes data,ACK=120,Seq=92 timeout,SendBase = 100,SendBase = 120,SendBase = 120,Sendbase = 100,TCP retransmission scenarios (more),SendBase = 120,Chapter 3 outline,3.1 Transport-layer serv

48、ices 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer,3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control,TCP F

49、low Control,receive side of TCP connection has a receive buffer:接收方有一個(gè)接收緩沖區(qū),speed-matching service: matching the send rate to the receiving apps drain rate速度匹配:將發(fā)送方的發(fā)送速率和接收方的排空速率匹配,app process may be slow at reading from buffer應(yīng)用程序從緩沖區(qū)讀數(shù)據(jù)可能會(huì)比較慢,TCP Flow control: how it works,(Suppose TCP receiver di

50、scards out-of-order segments) spare room in buffer = RcvWindow = RcvBuffer-LastByteRcvd - LastByteRead 假設(shè)TCP將失序的段丟棄 緩沖區(qū)的空閑空間=接收窗口大小=接收緩沖區(qū)-(最后一個(gè)接收到的字節(jié)-應(yīng)用程序最后一個(gè)讀的字節(jié)),Sender limits unACKed data to RcvWindow guarantees receive buffer doesnt overflow,seq = 1, DATA,seq = 201, DATA,seq = 401, DATA,seq = 301, DATA,seq = 101, DATA,seq = 201, DATA,seq = 501, DATA,ACK = 1, ack = 201, rwnd = 300,ACK = 1,

溫馨提示

  • 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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論