版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、1,Bilingual CourseNetwork Communications網(wǎng)絡(luò)通信(For Master Students in the Department of Electronic Engineering)Chapter 17 Transport Protocols,Instructor: Dr. Tianshuang Qiu School of the Electronic and Information Engineering Fall of 2009,2,OSI與TCP/IP協(xié)議的關(guān)系,3,Introduction,The transport protocol provide
2、s an end-to-end data transfer service that shields upper layer protocols from the details of the intervening(中介)network or networks. A transport protocol can be either connection oriented, such as TCP (Transmission control protocol), or connectionless, such as UDP (User datagram protocol). If the un
3、derlying(下層)network or internetwork service is unreliable, such as with the use of IP, then a connection-oriented transport protocol becomes quite complex. The basic cause of this complexity is the need to deal with the relatively large and variable delays experienced between end systems. These larg
4、e, variable delays complicate(使復(fù)雜)the flow control and error control techniques. TCP uses a credit-based(基于信用量)flow and error control technique that is somewhat different from the sliding-window flow control found in X.25 and HDLC. In essence, TCP separates acknowledgements from the management of th
5、e size of the sliding window. Although the TCP credit-based mechanism was designed for end-to-end flow control, it is also used to assist in internetwork congestion control. When a TCP entity detects the presence of congestion in the internet, it reduces the flow of data onto the internet until it d
6、etects an easing(緩解)in congestion.,4,傳輸層協(xié)議與其它協(xié)議的關(guān)系,In a protocol architecture, the transport protocol sits above a network or internetwork layer,which provides network related services, and just below application and other upper-level protocols. The transport protocol provides services to transport
7、service (TS) users, such as FTP (File Transfer Protocol ), SMTP (Simple Mail Transfer Protocol ), and TELNET. The local transport entity communicates with some remote transport entity, using the services of some lower layer, such as the internet protocol. The general service provided by a transport
8、protocol is the end-to-end transport of data in a way that shields the TS user from the details of the underlying communications systems. We find that most of the complexity relates to connection-oriented services. As might be expected, the less the network service provides, the more the transport p
9、rotocols: transmission control protocol (TCP) and UDP.,5,傳輸層協(xié)議與其它協(xié)議的關(guān)系,6,17-1 面向連接的傳輸協(xié)議機(jī)制,兩種基本類型的服務(wù) 面向連接的 對(duì)應(yīng)于虛電路方式。 面向連接的服務(wù)提供了TS用戶之間(端到端)的一條邏輯連接的建立、維護(hù)以及終止操作。 是最常見(jiàn)的有效協(xié)議服務(wù)類型,有廣泛的應(yīng)用。 面向連接暗示了這種服務(wù)是可靠的。 面向非連接的 對(duì)應(yīng)于數(shù)據(jù)報(bào)方式。,7,1. 可靠的順序網(wǎng)絡(luò)服務(wù),假設(shè) 網(wǎng)絡(luò)服務(wù)可以接受任意長(zhǎng)度的報(bào)文; 以100%的可靠性按順序交付到目的地。 這樣的網(wǎng)絡(luò)包括 具有X.25接口的高可靠分組交換網(wǎng)絡(luò); 使用L
10、APF(Link Access Procedure for Frame Mode Bearer Services)控制協(xié)議的幀中繼網(wǎng)絡(luò); 使用面向連接的LLC服務(wù)的IEEE 802.3局域網(wǎng)。 對(duì)于可靠的順序網(wǎng)絡(luò)服務(wù),需要討論 尋址(Addressing) 復(fù)用(Multiplexing) 流控制(Flow control) 連接的建立/終止(Connection establishment/termination),8,尋址,概念 某個(gè)給定的傳輸實(shí)體的用戶希望與另一個(gè)傳輸實(shí)體的用戶建立一條連接,或者進(jìn)行無(wú)連接的數(shù)據(jù)傳送。 需要為目標(biāo)用戶指定 用戶的標(biāo)識(shí)(User identification
11、); 傳輸實(shí)體的標(biāo)識(shí)(Transport entity identification); 主機(jī)地址(Host address); 網(wǎng)絡(luò)編號(hào)(Network number) 返回,9,進(jìn)一步說(shuō)明,傳輸層協(xié)議必須能夠從TS用戶地址中推算出上面所列的所有信息。 典型情況下,用戶地址定義為(主機(jī),端口)。 通常,一個(gè)主機(jī)只有一個(gè)傳輸實(shí)體,這樣就不需要傳輸實(shí)體的標(biāo)識(shí)。 地址中應(yīng)當(dāng)包含傳輸協(xié)議類型標(biāo)記(如TCP或UDP)。 在單一網(wǎng)絡(luò)的情況下,“主機(jī)”標(biāo)識(shí)的是連接到網(wǎng)絡(luò)上的一個(gè)設(shè)備。 在互聯(lián)網(wǎng)情況下,“主機(jī)”是一個(gè)全局互聯(lián)網(wǎng)地址。 在TCP中,端口和主機(jī)的結(jié)合稱為套接字(socket). 傳輸層不涉及路由
12、選擇,僅僅將地址的“主機(jī)”部分向下交付給網(wǎng)絡(luò)服務(wù)。 “端口”包含在傳輸層首部中,由目的站的目的傳輸協(xié)議來(lái)使用。,10,套接字的概念,“套接字”或者“插座”(Socket)也是一種軟件形式的抽象,用于表達(dá)兩臺(tái)機(jī)器間一個(gè)連接的“終端”。針對(duì)一個(gè)特定的連接,每臺(tái)機(jī)器上都有一個(gè)“套接字”,可以想象它們之間有一條虛擬的“線纜”。線纜的每一端都插入一個(gè)“套接字”或者“插座”里。當(dāng)然,機(jī)器之間的物理性硬件以及電纜連接都是完全未知的。 套接字是通信的基石,是支持TCP/IP協(xié)議的網(wǎng)絡(luò)通信的基本操作單元??梢詫⑻捉幼挚醋鞑煌鳈C(jī)間的進(jìn)程進(jìn)行雙向通信的端點(diǎn),它構(gòu)成了單個(gè)主機(jī)內(nèi)及整個(gè)網(wǎng)絡(luò)間的編程界面。套接字存在于通
13、信域中,通信域是為了處理一般的線程通過(guò)套接字通信而引進(jìn)的一種抽象概念。套接字通常和同一個(gè)域中的套接字交換數(shù)據(jù)(數(shù)據(jù)交換也可能穿越域的界限,但這時(shí)一定要執(zhí)行某種解釋程序)。各種進(jìn)程使用這個(gè)相同的域互相之間用Internet協(xié)議簇來(lái)進(jìn)行通信。,11,復(fù)用,兩種復(fù)用 傳輸協(xié)議復(fù)用 多個(gè)用戶使用相同的傳輸協(xié)議; 通過(guò)端口號(hào)或服務(wù)訪問(wèn)點(diǎn)相互區(qū)分。 傳輸實(shí)體復(fù)用 上行復(fù)用(upward multiplexing),將單個(gè)低層的多個(gè)連接復(fù)用。(Multiplexing of multiple connections on a single lower-level connection) 下行復(fù)用(downw
14、ard multiplexing),將單個(gè)連接劃分成多個(gè)低層連接 返回,12,流控制,傳輸層流量控制比較復(fù)雜,其原因 與實(shí)際傳輸時(shí)間相比,傳輸實(shí)體之間的傳輸時(shí)延比較長(zhǎng); 傳輸層是一個(gè)在網(wǎng)絡(luò)和互聯(lián)網(wǎng)之上操作的,因此傳輸時(shí)延可能是高度可變的,從而使得為丟失數(shù)據(jù)而重傳時(shí)所使用的超時(shí)機(jī)制難以做到高效率。 四種流控方法(對(duì)于接收方) 什么也不做; 拒絕接受來(lái)自網(wǎng)絡(luò)服務(wù)的后續(xù)報(bào)文段; 使用固定的滑動(dòng)窗協(xié)議; 使用信用量機(jī)制(credit scheme) 返回,13,什么也不做,問(wèn)題 溢出的報(bào)文將被丟棄; 發(fā)送端由于沒(méi)有收到確認(rèn),會(huì)重新發(fā)送這些報(bào)文; 這樣,發(fā)送方將不得不增加輸出流量; 返回,14,反壓(b
15、ackpressure)機(jī)制,反壓機(jī)制,即第二種選擇 依賴于網(wǎng)絡(luò)服務(wù); 當(dāng)緩存溢出時(shí),拒絕接收來(lái)自網(wǎng)絡(luò)的更多的服務(wù),會(huì)觸發(fā)網(wǎng)絡(luò)內(nèi)部的流控過(guò)程,從而抑制發(fā)送端的網(wǎng)絡(luò)服務(wù); 拒絕更多的報(bào)文段。 返回,15,第三種選擇(滑動(dòng)窗),在數(shù)據(jù)單元上使用序號(hào); 使用固定大小的窗口; 通過(guò)確認(rèn)使窗口向前滑動(dòng) 返回,16,第四種選擇(信用量機(jī)制),信用量機(jī)制 向接收方提供了更高級(jí)程度的數(shù)據(jù)流控制; 可以產(chǎn)生較平穩(wěn)的數(shù)據(jù)流。 返回,17,信用量分配機(jī)制舉例,18,信用量分配機(jī)制說(shuō)明,Assume that 200 octets of data are sent in each segment. Initially
16、, through the connection establishment process, the sending and receiving sequence numbers are synchronized establishment process, the sending and receiving sequence numbers are synchronized and A is granted an initial credit allocation of 1400 octets, beginning with octet number 1001. After sending
17、 600 octets in three segments, A has shrunk its window to a size of 800 octets (numbers 1601 through 2400). Following receipt of these segments, B acknowledges receipt of all octets through 1601 and issues a credit of 1000 octets. This means that A can send octets 1601 through 2600 (5 segments). How
18、ever, by the time that Bs message has arrived at A, A has already sent two segments, containing octets 1601 through 2000 (which was permissible under the initial allocation). Thus, As remaining credit at this point is only 400 octets (2 segments). As the exchange proceeds, A advances the trailing ed
19、ge of its window each time that it transmits and advances the leading edge only when it is granted credit.,19,Sending and Receiving Perspectives,20,17-2 TCP,概念 TCP is designed to provide reliable communication between pairs of processes (TCP users) across a variety of reliable and unreliable network
20、s and internets. TCP provides two useful facilities for labeling data: push(急迫)and urgent(緊急): Data stream push: ordinarily, TCP decides when sufficient data have accumulated to form a segment for transmission. The TCP user can require TCP to transmit all outstanding data up to and including that la
21、beled with a push flag. On the receiving end, TCP will deliver these data to the user in the same manner. A user might request this if it has come to a logical break in the data. Urgent data signaling: This provides a mean of informing the destination TCP user that signification or “urgent” data is
22、in the upcoming data stream. It is up to the destination user to determine appropriate action.,21,TCP服務(wù)的原語(yǔ)與參數(shù)(Read by yourself),TCP服務(wù)請(qǐng)求原語(yǔ)(表17.2) 是TCP用戶向TCP發(fā)出的,例: Active Open-Request connection at a particular security and precedence(優(yōu)先)to a specified destination Send-Transfer data across named conne
23、ction TCP服務(wù)響應(yīng)原語(yǔ)(表17.3) 是TCP向本地TCP用戶發(fā)出的,例: Deliver-Reports arrival of data Open success-Reports completion of pending(掛起的)open request TCP服務(wù)參數(shù)(表17.4) Source Port-Local TCP user; Data-Block of data sent by TCP user or delivered to a TCP user.,22,TCP首部格式( Read by yourself ),23,TCP首部說(shuō)明( Read by yourself
24、 ),Source port (16 bits): 源TCP用戶; Destination port (16 bits): 目的TCP用戶; Sequence number(32 bits): 報(bào)文段中第一個(gè)八位組的序號(hào); Acknowledgement number(32 bits):捎帶確認(rèn),包含了TCP實(shí)體希望接收的下一個(gè)數(shù)據(jù)八位組的序號(hào); Data offset(4 bits): 首部中32位字的數(shù)量; Reserved(6 bits): 為將來(lái)使用保留; Flag(6 bits): URG-緊急指針;ACK-確認(rèn);PSH-急迫;RST-復(fù)位; SYN-序號(hào)同步;FIN-發(fā)送者沒(méi)有其他
25、數(shù)據(jù)了; Window(16 bits): 控制流的信用分配; Checksum(16 bits): 校驗(yàn) Urgent pointer(16 bits): 指向緊急數(shù)據(jù)的最后一個(gè)八位組; Options(Options): 指出能夠接受的最大報(bào)文長(zhǎng)度。,24,TCP機(jī)制,連接建立(三次握手) 發(fā)送方實(shí)體發(fā)送一個(gè)SYN,使SN=X (Sequence number) ,X為初始序號(hào); 接收將SYN和ACK置位,以SN=Y,AN=X+1( Acknowledgement number )來(lái)響應(yīng); 初始方用AN=Y來(lái)響應(yīng) 數(shù)據(jù)傳送 按八位組編號(hào),以232為模; 流控制采用信用量分配機(jī)制; 數(shù)據(jù)有緩
26、存,PUSH強(qiáng)迫傳輸方把積累的數(shù)據(jù)都發(fā)出去; 可以用緊急指針指出數(shù)據(jù)的末端; 若有不屬于本次傳輸?shù)膱?bào)文段出現(xiàn),則將報(bào)文中的RST置位。 連接終止 每個(gè)TCP用戶發(fā)CLOSE原語(yǔ),在最后一個(gè)報(bào)文段將FIN置位; 若發(fā)出ABORT原語(yǔ),則發(fā)生粗暴終止。,25,TCP實(shí)現(xiàn)中的策略選擇(P.663, Read by yourself ),發(fā)送策略(Send policy) 交付策略(Deliver policy) 接受策略(Accept policy) 按順序(In-order) 按窗口(In-window) 重傳策略(Retransmit policy) 僅重傳第一個(gè)(First-only) 批量重
27、傳(Batch) 單個(gè)重傳(Individual) 確認(rèn)策略(Acknowledge policy),26,17-3 TCP擁塞控制,目的 基于信用量控制機(jī)制的目的是使目的站能夠限制來(lái)自源站的報(bào)文流,以避免目的站的緩存溢出; 重傳計(jì)時(shí)器管理(超時(shí)后重傳,動(dòng)態(tài)調(diào)整) 簡(jiǎn)單平均 對(duì)觀察到的一些報(bào)文段的往返時(shí)間簡(jiǎn)單地取平均 其中:RTT(i)=第i個(gè)報(bào)文段的往返時(shí)間;ARTT(K)=前K個(gè)報(bào)文的平均往返時(shí)間,27,指數(shù)平均,給越近的采樣值以更大的權(quán)。 其中 SRTT(K+1)=平滑往返時(shí)間估值,SRTT(0)=0; Alpha值越小,給予近期觀察值的權(quán)越大,28,指數(shù)平均的使用,29,RTT方差估計(jì)
28、( Read by yourself ),RTT方差估計(jì) TCP標(biāo)準(zhǔn)中規(guī)定的方法,可以使TCP實(shí)體能夠適應(yīng)往返時(shí)間的變化,但是不能很好地處理較高方差的情況。 高方差的三個(gè)來(lái)源 若TCP連接的數(shù)據(jù)率較低,則傳輸時(shí)間傳播時(shí)間,由于IP數(shù)據(jù)報(bào)大小變化所引起的時(shí)延方差會(huì)很可觀; 互聯(lián)網(wǎng)通信量負(fù)荷及狀況可能會(huì)隨來(lái)自其他源站的通信量的變化而變化,從而造成RTT的突然變化。 對(duì)等TCP實(shí)體可能會(huì)因其自身的處理延時(shí)而并不對(duì)每個(gè)報(bào)文段都立即發(fā)出確認(rèn),或者因?yàn)樗昧死鄯e確認(rèn)的特權(quán)。 平均估計(jì) MDEV(X)=E|X-E(X)| 其中:EX是X的期望值。,30,Jacobson算法( Read by yourse
29、lf ),其中:g=1/8=0.125; H=1/4=0.25; f=2 or 4,31,Jacobson算法計(jì)算RTO,32,17-4 UDP,概念 In addition to TCP, there is one other transport-level protocol that is in common use as part of the TCP/IP protocol suite: the user datagram protocol (UDP). UDP provides a connectionless service for application level procedures. Thus, UDP is basically an unreliable service; delivery and duplicate protection are not guaranteed. Howev
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 北京理工大學(xué)《植物生物學(xué)》2024 - 2025 學(xué)年第一學(xué)期期末試卷
- 軟件項(xiàng)目質(zhì)量管理
- 心理咨詢和輔導(dǎo)
- 2026年劇本殺運(yùn)營(yíng)公司市場(chǎng)費(fèi)用預(yù)算管理制度
- 2025年智能垃圾桶清潔十年技術(shù)報(bào)告
- 2026年文化娛樂(lè)產(chǎn)業(yè)虛擬現(xiàn)實(shí)報(bào)告
- 2026年及未來(lái)5年中國(guó)車廂底板市場(chǎng)運(yùn)行態(tài)勢(shì)及行業(yè)發(fā)展前景預(yù)測(cè)報(bào)告
- 小學(xué)道德與法治教學(xué)中生命教育的實(shí)施路徑課題報(bào)告教學(xué)研究課題報(bào)告
- 企業(yè)盤(pán)點(diǎn)和對(duì)賬制度
- 藝術(shù)研究院試題及答案
- 承包團(tuán)建燒烤合同范本
- 電力線通信技術(shù)
- 人工流產(chǎn)手術(shù)知情同意書(shū)
- 2025秋人教版七年級(jí)全一冊(cè)信息科技期末測(cè)試卷(三套)
- 教師三筆字培訓(xùn)課件
- 鋼鐵燒結(jié)機(jī)脫硫脫硝施工方案
- 中國(guó)醫(yī)藥行業(yè)中間體出口全景分析:破解政策難題深挖全球紅利
- 搶工補(bǔ)償協(xié)議書(shū)
- 山東省青島市城陽(yáng)區(qū)2024-2025學(xué)年九年級(jí)上學(xué)期語(yǔ)文期末試卷(含答案)
- 孕婦尿液捐獻(xiàn)協(xié)議書(shū)
- 賓館物資轉(zhuǎn)讓協(xié)議書(shū)
評(píng)論
0/150
提交評(píng)論