版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Transport LayerChapter 6CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Transport ServiceElements of Transport ProtocolsCongestion ControlInternet Protocols UDP Internet Protocols TCP Performance IssuesDelay-Tolerant NetworkingRevised: August 2011The Transport La
2、yerCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Responsible for delivering data across networks with the desired reliability or qualityPhysicalLinkNetworkTransportApplicationTransport ServiceCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D.
3、 Wetherall, 2011Services Provided to the Upper Layer Transport Service Primitives Berkeley Sockets Socket Example: Internet File Server Services Provided to the Upper Layers (1)Transport layer adds reliability to the network layerOffers connectionless (e.g., UDP) and connection-oriented (e.g, TCP) s
4、ervice to applications CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Services Provided to the Upper Layers (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Transport layer sends segments in packets (in frames)SegmentSegmen
5、tTransport Service Primitives (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Primitives that applications might call to transport data for a simple connection-oriented service:Client calls CONNECT, SEND, RECEIVE, DISCONNECTServer calls LISTEN, RECEIVE, SEND,
6、DISCONNECTSegmentTransport Service Primitives (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011State diagram for a simple connection-oriented serviceSolid lines (right) show client state sequenceDashed lines (left) show server state sequenceTransitions in itali
7、cs are due to segment arrivals. Berkeley SocketsCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Very widely used primitives started with TCP on UNIXNotion of “sockets” as transport endpointsLike simple set plus SOCKET, BIND, and ACCEPTSocket Example Internet File
8、 Server (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011. . .Get servers IP addressMake a socketTry to connectClient code . . .Socket Example Internet File Server (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Client co
9、de (cont.) . . .Loop reading (equivalent to receive) until no more data; exit implicitly calls closeWrite data (equivalent to send)Socket Example Internet File Server (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011. . .Server code . . .Make a socketAssign add
10、ress Prepare for incoming connectionsSocket Example Internet File Server (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Server code . . .Block waiting for the next connectionRead (receive) request and treat as file name Write (send) all file dataDone, so clos
11、e this connectionElements of Transport ProtocolsCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Addressing Connection establishment Connection release Error control and flow control Multiplexing Crash recovery AddressingCN5E by Tanenbaum & Wetherall, Pearson Educ
12、ation-Prentice Hall and D. Wetherall, 2011Transport layer adds TSAPsMultiple clients and servers can run on a host with a single network (IP) addressTSAPs are ports for TCP/UDPConnection Establishment (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Key problem
13、 is to ensure reliability even though packets may be lost, corrupted, delayed, and duplicatedDont treat an old or duplicate packet as new(Use ARQ and checksums for loss/corruption) Approach:Dont reuse sequence numbers within twice the MSL (Maximum Segment Lifetime) of 2T=240 secsThree-way handshake
14、for establishing connection Connection Establishment (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Use a sequence number space large enough that it will not wrap, even when sending at full rateClock (high bits) advances & keeps state over crashNeed seq. numb
15、er not to wrap within T secondsNeed seq. number not to climb too slowly for too longConnection Establishment (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Three-way handshake used for initial packetSince no state from previous connectionBoth hosts contribute
16、 fresh seq. numbersCR = Connect RequestConnection Establishment (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Three-way handshake protects against odd cases:Duplicate CR. Spurious ACK does not connectDuplicate CR and DATA. Same plus DATA will be rejected (wr
17、ong ACK).a)b)XXXConnection Release (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Key problem is to ensure reliability while releasingAsymmetric release (when one side breaks connection) is abrupt and may lose dataXConnection Release (2)CN5E by Tanenbaum & We
18、therall, Pearson Education-Prentice Hall and D. Wetherall, 2011Symmetric release (both sides agree to release) cant be handled solely by the transport layerTwo-army problem shows pitfall of agreementAttack?Attack?Connection Release (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall an
19、d D. Wetherall, 2011Normal release sequence, initiated by transport user on Host 1DR=Disconnect RequestBoth DRs are ACKed by the other sideConnection Release (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Error cases are handled with timer and retransmissionF
20、inal ACK lost, Host 2 times outLost DR causes retransmissionsExtreme: Many lost DRs cause both hosts to timeoutError Control and Flow Control (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Foundation for error control is a sliding window (from Link layer) wit
21、h checksums and retransmissionsFlow control manages buffering at sender/receiver Issue is that data goes to/from the network and applications at different timesWindow tells sender available buffering at receiver Makes a variable-size sliding windowError Control and Flow Control (2)CN5E by Tanenbaum
22、& Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Different buffer strategies trade efficiency / complexitya) Chained fixed-size buffersb) Chained variable-size buffersc) One large circular bufferError Control and Flow Control (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Pren
23、tice Hall and D. Wetherall, 2011Flow control example: As data is limited by Bs buffer0123012301230123123412341234123412342345345634563456345678910Bs BufferMultiplexingKinds of transport / network sharing that can occur:Multiplexing: connections share a network addressInverse multiplexing: addresses
24、share a connectionCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011MultiplexingInverse MultiplexingCrash RecoveryCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Application needs to help recovering from a crashTransport can fai
25、l since A(ck) / W(rite) not atomicCongestion ControlCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Two layers are responsible for congestion control:Transport layer, controls the offered load hereNetwork layer, experiences congestion previousDesirable bandwidth
26、allocation Regulating the sending rate Wireless issues Desirable Bandwidth Allocation (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Efficient use of bandwidth gives high goodput, low delayDelay begins to rise sharply when congestion sets inGoodput rises more
27、 slowly than load when congestion sets inDesirable Bandwidth Allocation (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Fair use gives bandwidth to all flows (no starvation)Max-min fairness gives equal shares of bottleneckBottleneck linkDesirable Bandwidth All
28、ocation (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011We want bandwidth levels to converge quickly when traffic patterns changeFlow 1 slows quickly when Flow 2 startsFlow 1 speeds up quickly when Flow 2 stopsRegulating the Sending Rate (1)CN5E by Tanenbaum &
29、 Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Sender may need to slow down for different reasons:Flow control, when the receiver is not fast enough rightCongestion, when the network is not fast enough overA fast network feeding a low-capacity receiver flow control is neededRegula
30、ting the Sending Rate (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Our focus is dealing with this problem congestionA slow network feeding a high-capacity receiver congestion control is neededRegulating the Sending Rate (3)CN5E by Tanenbaum & Wetherall, Pea
31、rson Education-Prentice Hall and D. Wetherall, 2011Different congestion signals the network may use to tell the transport endpoint to slow down (or speed up)Regulating the Sending Rate (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011If two flows increase/decre
32、ase their bandwidth in the same way when the network signals free/busy they will not converge to a fair allocation+/ percentage+ / constantRegulating the Sending Rate (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011The AIMD (Additive Increase Multiplicative De
33、crease) control law does converge to a fair and efficient point!TCP uses AIMD for this reasonUser 1s bandwidthUser 2s bandwidthWireless IssuesCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Wireless links lose packets due to transmission errorsDo not want to conf
34、use this loss with congestionOr connection will run slowly over wireless links!Strategy:Wireless links use ARQ, which masks errorsInternet Protocols UDP CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Introduction to UDP Remote Procedure Call Real-Time Transport
35、Introduction to UDP (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011UDP (User Datagram Protocol) is a shim over IPHeader has ports (TSAPs), length and checksum.Introduction to UDP (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wethera
36、ll, 2011Checksum covers UDP segment and IP pseudoheaderFields that change in the network are zeroed outProvides an end-to-end delivery checkRPC (Remote Procedure Call)RPC connects applications over the network with the familiar abstraction of procedure callsStubs package parameters/results into a me
37、ssageUDP with retransmissions is a low-latency transportCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Real-Time Transport (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011RTP (Real-time Transport Protocol) provides support
38、 for sending real-time media over UDPOften implemented as part of the applicationReal-Time Transport (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011RTP header contains fields to describe the type of media and synchronize it across multiple streamsRTCP sister
39、protocol helps with management tasks Real-Time Transport (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Buffer at receiver is used to delay packets and absorb jitter so that streaming media is played out smoothlyPacket 8s network delay is too large for buffer
40、 to helpConstant rateVariable rateConstant rateReal-Time Transport (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011High jitter, or more variation in delay, requires a larger playout buffer to avoid playout missesPropagation delay does not affect buffer sizeBuf
41、ferMissesInternet Protocols TCPCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011The TCP service model The TCP segment header TCP connection establishment TCP connection state modeling TCP sliding window TCP timer management TCP congestion control The TCP Service M
42、odel (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011TCP provides applications with a reliable byte stream between processes; it is the workhorse of the InternetPopular servers run on well-known ports The TCP Service Model (2)CN5E by Tanenbaum & Wetherall, Pea
43、rson Education-Prentice Hall and D. Wetherall, 2011Applications using TCP see only the byte stream right and not the segments left sent as separate IP packetsFour segments, each with 512 bytes of data and carried in an IP packet2048 bytes of data delivered to application in a single READ callThe TCP
44、 Segment HeaderCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011TCP header includes addressing (ports), sliding window (seq. / ack. number), flow control (window), error control (checksum) and more.TCP Connection EstablishmentCN5E by Tanenbaum & Wetherall, Pearson
45、 Education-Prentice Hall and D. Wetherall, 2011TCP sets up connections with the three-way handshakeRelease is symmetric, also as described beforeNormal case Simultaneous connectTCP Connection State Modeling (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011The T
46、CP connection finite state machine has more states than our simple example from earlier.TCP Connection State Modeling (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Solid line is the normal path for a client. Dashed line is the normal path for a server. Light
47、 lines are unusual events. Transitions are labeled by the cause and action, separated by a slash.TCP Sliding Window (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011TCP adds flow control to the sliding window as beforeACK + WIN is the senders limitTCP Sliding W
48、indow (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Need to add special cases to avoid unwanted behaviorE.g., silly window syndrome belowReceiver application reads single bytes, so sender always sends one byte segments TCP Timer ManagementCN5E by Tanenbaum &
49、 Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011TCP estimates retransmit timer from segment RTTsTracks both average and variance (for Internet case)Timeout is set to average plus 4 x varianceLAN case small, regular RTTInternet case large, varied RTTTCP Congestion Control (1)CN5E by
50、 Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011TCP uses AIMD with loss signal to control congestionImplemented as a congestion window (cwnd) for the number of segments that may be in the networkUses several mechanisms that work together NameMechanismPurposeACK clockCon
51、gestion window (cwnd)Smooth out packet burstsSlow-startDouble cwnd each RTTRapidly increase send rate to reach roughly the right levelAdditive IncreaseIncrease cwnd by 1 packet each RTTSlowly increase send rate to probe at about the right level Fast retransmit / recoveryResend lost packet after 3 du
52、plicate ACKs; send new packet for each new ACKRecover from a lost packet without stopping ACK clockTCP Congestion Control (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Congestion window controls the sending rateRate is cwnd / RTT; window can stop sender quic
53、kly ACK clock (regular receipt of ACKs) paces traffic and smoothes out sender burstsACKs pace new segments into the network and smooth burstsTCP Congestion Control (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Slow start grows congestion window exponentially
54、Doubles every RTT while keeping ACK clock goingIncrement cwnd for each new ACKTCP Congestion Control (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011ACKAdditive increase grows cwnd slowlyAdds 1 every RTTKeeps ACK clockTCP Congestion Control (5)CN5E by Tanenbau
55、m & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Slow start followed by additive increase (TCP Tahoe)Threshold is half of previous loss cwndLoss causes timeout; ACK clock has stopped so slow-start againTCP Congestion Control (6)With fast recovery, we get the classic sawtooth (TCP
56、 Reno)Retransmit lost packet after 3 duplicate ACKsNew packet for each dup. ACK until loss is repairedCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011The ACK clock doesnt stop, so no need to slow-startTCP Congestion Control (7)CN5E by Tanenbaum & Wetherall, Pears
57、on Education-Prentice Hall and D. Wetherall, 2011SACK (Selective ACKs) extend ACKs with a vector to describe received segments and hence lossesAllows for more accurate retransmissions / recovery No way for us to know that 2 and 5 were lost with only ACKsPerformance IssuesCN5E by Tanenbaum & Wetheral
58、l, Pearson Education-Prentice Hall and D. Wetherall, 2011Many strategies for getting good performance have been learned over timePerformance problems Measuring network performance Host design for fast networks Fast segment processing Header compression Protocols for “l(fā)ong fat” networks Performance P
59、roblemsCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Unexpected loads often interact with protocols to cause performance problemsNeed to find the situations and improve the protocolsExamples:Broadcast storm: one broadcast triggers anotherSynchronization: a buil
60、ding of computers all contact the DHCP server together after a power failureTiny packets: some situations can cause TCP to send many small packets instead of few large onesMeasuring Network Performance CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Measurement i
溫馨提示
- 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年橡塑制品與原料項目可行性研究報告
- 物流公司合同管理流程的效率提升
- 2025年度臨建設(shè)施臨時占用補償合同示范文本3篇
- 2025年離婚協(xié)議及起訴狀專業(yè)法律咨詢與解答服務(wù)合同2篇
- 2025年度綠化工程環(huán)保驗收委托合同3篇
- 單位試用期合同模板3
- 2025年發(fā)票融資合同解除協(xié)議
- 2025年銷售員市場拓展與客戶關(guān)系維護勞務(wù)用工協(xié)議3篇
- 二零二五版滅火器研發(fā)中心合作共建合同4篇
- 二零二五年度民用無人機運營管理合同3篇
- 中外美術(shù)史試題及答案
- 工會換屆公示文件模板
- 江蘇省南京市協(xié)同體七校2024-2025學(xué)年高三上學(xué)期期中聯(lián)合考試英語試題答案
- 青島版二年級下冊三位數(shù)加減三位數(shù)豎式計算題200道及答案
- GB/T 12723-2024單位產(chǎn)品能源消耗限額編制通則
- GB/T 16288-2024塑料制品的標(biāo)志
- 麻風(fēng)病防治知識課件
- 干部職級晉升積分制管理辦法
- TSG ZF003-2011《爆破片裝置安全技術(shù)監(jiān)察規(guī)程》
- 2024年代理記賬工作總結(jié)6篇
- 電氣工程預(yù)算實例:清單與計價樣本
評論
0/150
提交評論