资源预览内容
第1页 / 共77页
第2页 / 共77页
第3页 / 共77页
第4页 / 共77页
第5页 / 共77页
第6页 / 共77页
第7页 / 共77页
第8页 / 共77页
第9页 / 共77页
第10页 / 共77页
亲,该文档总共77页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
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 LayerCN5E 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. 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) service 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)SegmentSegmentTransport 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, 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 italics 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 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 code (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 address 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 close 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 Education-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 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 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. number 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 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:a)Duplicate CR. Spurious ACK does not connectb)Duplicate CR and DATA. Same plus DATA will be rejected (wrong 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 (w
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号