计算机网络第五版(英文版)(6)

上传人:a**** 文档编号:243065047 上传时间:2024-09-14 格式:PPT 页数:81 大小:6.04MB
返回 下载 相关 举报
计算机网络第五版(英文版)(6)_第1页
第1页 / 共81页
计算机网络第五版(英文版)(6)_第2页
第2页 / 共81页
计算机网络第五版(英文版)(6)_第3页
第3页 / 共81页
点击查看更多>>
资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,The Transport Layer,Chapter 6,6.1 The Transport Service,6.1.1Services Provided to the Upper Layers (1),Transport layer adds reliability to the network layer,Offers connectionless (e.g., UDP) and connection-oriented (e.g, TCP) service to applications,6.1.1Services Provided to the Upper Layers (2),Transport layer sends,segments,in packets (in frames),Segment,Segment,6.1.2 Transport Service Primitives (1),Primitives that applications might call to transport data for a simple connection-oriented service,Client calls CONNECT, SEND, RECEIVE, DISCONNECT,Client calls CONNECT, SEND, RECEIVE, DISCONNECT,Segment,6.1.2 Transport Service Primitives (2),State diagram for a simple connection-oriented service,Solid lines (right) show client state sequence,Dashed lines (left) show server state sequence,Transitions in italics are due to segment arrivals.,5.1.3 Berkeley Sockets,Very widely used primitives started with TCP on UNIX,Notion of “sockets as transport endpoints,Like simple set plus SOCKET, BIND, and ACCEPT,6.2 Elements of Transport Protocols,6.2.1 Addressing (1),Transport layer adds TSAPs,Multiple clients and servers can run on a host with a single network (IP) address,TSAPs are ports for TCP/UDP,Well-known TSAPs,6.2.1 Addressing (2),How a user process in host 1 establishes a connection with a mail,server in host 2 via a process server,Process server,that acts as a proxy for less heavily used servers,6.2.2 Connection Establishment (1),Key problem is to ensure reliability even though packets may be lost, corrupted,delayed, and,duplicated,Dont 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 secs,Three-way handshake for establishing connection,6.2.2 Connection Establishment (2),Use a sequence number space large enough that it will not wrap, even when sending at full rate,Clock (high bits) advances & keeps state over crash,For a clock rate of,C,and a sequence number space of size,S, we must have,S/CT,Need seq. number not to wrap within T seconds,Need seq. number not to climb too slowly for too long,6.2.2 Connection Establishment (3),Three-way handshake used for initial packet,Since no state from previous connection,Both hosts contribute fresh seq. numbers,CR = Connect Request,6.2.2 Connection Establishment (4),Three-way handshake protects against odd cases,Duplicate CR. Spurious ACK does not connect,Duplicate CR and DATA. Same plus DATA will be rejected (wrong ACK).,To avoid an attacker to predict the next initial sequence number,pseudorandom initial sequence numbers,are used for connections in practice.,a),b),Problems: 4,6.2.3 Connection Release (1),Key problem is to ensure reliability while releasing,Asymmetric release (when one side breaks connection) is abrupt and may lose data,X,6.2.3 Connection Release (2),Symmetric release (both sides agree to release) cant be handled solely by the transport layer,Two-army problem shows pitfall of agreement,Attack?,Attack?,6.2.3 Connection Release (3),Normal release sequence, initiated by transport user on Host 1,DR=Disconnect Request,Both DRs are ACKed by the other side,6.2.3 Connection Release (4),Error cases are handled with timer and retransmission,Final ACK lost, Host 2 times out,Lost DR causes retransmissions,Extreme: Many lost DRs cause both hosts to timeout,6.2.4 Error Control and Flow Control (1),Foundation for error control is a sliding window (from Link layer) with checksums and retransmissions,Flow control,manages buffering at sender/receiver,Issue is that data goes to/from the network and applications at different times,Window tells sender available buffering at receiver,Makes a variable-size sliding window,The sender and receiver need to,dynamically adjust,their buffer allocations,6.2.4 Error Control and Flow Control (2),Different buffer strategies trade efficiency / complexity,a) Chained fixed-size buffers,b) Chained variable-size buffers,c) One large circular buffer,6.2.4 Error Control and Flow Control (3),Flow control example: As data is limited by Bs buffer,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4,2,3,4,5,3,4,5,6,3,4,5,6,3,4,5,6,3,4,5,6,7,8,9,10,Bs Buffer,6.2.4 Error Control and Flow Control (4),The carrying capacity of the network limits the maximum flow,If the network can handle,c,segments/sec and the round-trip time is,r, the senders window should be,cr,The window size should be adjusted frequently, to track changes in the carrying capacity,6.2.5 Multiplexing,Kinds of transport / network sharing that can occur,Multiplexing: connections share a network address,Inverse multiplexing: addresses share a connection,Multiplexing,Inverse Multiplexing,6.2.6 Crash Recovery,Application needs to help recovering from a crash,Transport can fail since A(ck) / W(rite) not atomic,Write Short reports (6-1),1. There is crash recovery in connection between ATM and remote data base in a bank. Design a solution which is beneficial to costumer or the bank. Is there a fair solution for both parts? If yes, design the solution, if no, give your reason.,6.3 Congestion Control,Two layers are responsible for congestion control,Transport layer, controls the offered load,Network layer, experiences congestion,Delay begins to rise sharply when congestion sets in,Goodput rises more slowly than load when congestion sets in,6.3.1 Desirable Bandwidth Allocation (1),Efficient use of bandwidth gives high goodput, low delay,The load with the,highest power,represents an efficient load for the transport entity to place on the network.,Bottleneck link,6.3.1 Desirable Bandwidth Allocation (2),Fair use gives bandwidth to all flows (no starvation),This is,max-min fair, which maximizes the minimum bandwidth flows get, then lets flows go ahead when they are able to use excess bandwidth.,Max-min fairness gives equal shares of bottleneck,6.3.1 Desirable Bandwidth Allocation (3),We want bandwidth levels to converge quickly when traffic patterns change,Flow 1 slows quickly when Flow 2 starts,Flow 1 speeds up quickly when Flow 2 stops,6.3.2 Regulating the Sending Rate (1),Sender may need to slow down for different reasons,Flow control, when the receiver is not fast enough left,Congestion, when the network is not fast enough right,Our focus is dealing with this problem congestion,A fast network feeding a low-capacity receiver, flow control is needed,A slow network feeding a high-capacity receiver, congestion control is needed,6.3.2 Regulating the Sending Rate (3),Different congestion signals the network may use to tell the transport endpoint to slow down (or speed up),Except the following list, Windows includes Compound TCP that uses both packet loss and delay as feedback signals.,6.3.2 Regulating the Sending Rate (4),If two flows increase/decrease their bandwidth in the same way when the network signals free/busy they will not converge to a fair allocation,+/ percentage,+ / constant,6.3.2 Regulating the Sending Rate (5),The,AIMD,(,Additive Increase Multiplicative Decrease,) control law does converge to a fair and efficient point!,TCP uses AIMD for this reason,User 1s bandwidth,User 2s bandwidth,6.3.3 Wireless Issues,Wireless links lose packets due to transmission errors,Do not want to confuse this loss with congestion,Or connection will run slowly over wireless links!,Masking strategy,Wireless links use ARQ, which masks errors,Discussing Topics (6-1),1. Summarize a transport protocol that is designed for wireless links, especially a wireless mesh network.,6.4 The Internet Transport Protocols: UDP,6.4.1 Introduction to UDP (1),UDP (User Datagram Protocol) is a shim over IP,Header has ports (TSAPs), length and checksum,6.4.1 Introduction to UDP (2),Checksum covers UDP segment and IP pseudoheader,Fields that change in the network are zeroed out,Provides an end-to-end delivery check,The UDP checksum operation is mandatory with IPv6 for all packets,6.4.2 UDP Header Compression Using 6LoWPAN (1),UDP headers using LOWPAN_NHC,The UDP compression format,Bits 0 through 4 represent the NHC ID and 11110 indicates the specific UDP header compression encoding,C: Checksum,1: All 16 bits of Checksum are elided.,P: Ports,11: First 12 bits of both Source Port and Destination Port are 0xf0b and elided. The remaining 4 bits for each are carried in-line,The UDP Length field MUST always be elided and is inferred from lower layers using the 6LoWPAN Fragmentation header or the IEEE 802.15.4 header.,6.4.2 UDP Header Compression Using 6LoWPAN (2),Compressing UDP Ports,Allows a particular range of ports number (0xf0b0 to 0xf0bf) to be compressed down to 4 bits,Should avoid using those ports as dynamic ports whenever possible,Compressing UDP Checksum,A compressor in the source transport endpoint MAY elide the UDP Checksum if it is authorized by the upper layer.,A decompressor that expands a 6LoWPAN packet with the C bit set MUST compute the UDP Checksum on behalf of the source node and place that value in the restored UDP header,6.4.3 RPC (Remote Procedure Call),RPC connects applications over the network with the familiar abstraction of procedure calls,Stubs package parameters/results into a message,UDP with retransmissions is a low-latency transport,6.4.4 Real-Time Transport (1),RTP (Real-time Transport Protocol) provides support for sending real-time media over UDP,Often implemented as part of the application,6.4.4 Real-Time Transport (2),RTP header contains fields to describe the type of media and synchronize it across multiple streams,RTCP sister protocol helps with management tasks,6.4.4 Real-Time Transport (3),Buffer at receiver is used to delay packets and absorb jitter so that streaming media is played out smoothly,6.4.4 Real-Time Transport (4),High jitter, or more variation in delay, requires a larger playout buffer to avoid playout misses,Propagation delay does not affect buffer size,Problems: 17, 20,6.5 The Internet Transport Protocols: TCP,6.5.1 The TCP Service Model (1),TCP provides applications with a reliable byte stream between processes; it is the workhorse of the Internet,Popular servers run on well-known ports,6.5.1 The TCP Service Model (2),Applications using TCP see only the byte stream right and not the segments left sent as separate IP packet,s,6.5.2 The TCP Segment Header,TCP header includes addressing (ports), sliding window (seq. / ack. number), flow control (window), error control (checksum) and more.,Problems: 18,6.5.3 TCP Connection Establishment,TCP sets up connections with the three-way handshake,Release is symmetric, also as described before,6.5.4 TCP Connection State Modeling (1),The TCP connection finite state machine has more states than our simple example from earlier.,6.5.4 TCP Connection State Modeling (2),Solid line is the normal path for a client.,Dashed line is the normal path for a server.,Light lines are unusual events.,Transitions are labeled by the cause and action, separated by a slash.,6.5.5 TCP Sliding Window (1),TCP adds flow control to the sliding window as before,ACK + WIN is the senders limit,6.5.5 TCP Sliding Window (2),Need to add special cases to avoid unwanted behavior,E.g., silly window syndrome below,6.5.6 TCP Timer Management,TCP estimates retransmit timer from segment RTTs,Tracks both average and variance (for Internet case),Timeout is set to average plus 4 x variance,6.5.7 TCP Congestion Control (1),TCP uses AIMD with loss signal to control congestion,Implemented as a congestion window (cwnd) for the number of segments that may be in the network,Uses several mechanisms that work together,6.5.7 TCP Congestion Control (2),Congestion window controls the sending rate,Rate is cwnd / RTT; window can stop sender quickly,ACK clock (regular receipt of ACKs) paces traffic and smoothes out sender bursts,6.5.7 TCP Congestion Control (3),Slow start grows congestion window exponentially,Doubles every RTT while keeping ACK clock going,6.5.7 TCP Congestion Control (4),Additive increase grows cwnd slowly,Adds 1 every RTT,Keeps ACK clock,6.5.7 TCP Congestion Control (5),Slow start followed by additive increase (TCP Tahoe),Threshold is half of previous loss cwnd,6.5.7 TCP Congestion Control (6),With fast recovery, we get the classic sawtooth (TCP Reno),Retransmit lost packet after 3 duplicate ACKs,New packet for each dup. ACK until loss is repaired,6.5.7 TCP Congestion Control (7),SACK (Selective ACKs) extend ACKs with a vector to describe received segments and hence losses,Allows for more accurate retransmissions / recovery,Problems: 25, 26, 27, 28, 30,Discussing Topics (6-2),2. Problems: 38, 39, 40,6.5.8 SSL,The Secure Sockets Layer (1),TLS,(Transport Layer Security) is the IETF version,6.5.8 SSL,The Secure Sockets Layer (2),Phases in SSL V3 connection establishment (simplified),Only the client (Alice) authenticates the server (Bob),Session key computed on both sides (E,B, R,A, R,B,),6.5.8 SSL,The Secure Sockets Layer (3),Data transmission using SSL. Authentication and encryption for a connection use the session key,6.6 Performance Issues,6.6.1 Performance Problems,Unexpected loads often interact with protocols to cause performance problems,Need to find the situations and improve the protocols,Examples,Broadcast storm: one broadcast triggers another,Synchronization: a building of computers all contact the DHCP server together after a power failure,Tiny packets: some situations can cause TCP to send many small packets instead of few large ones,6.6.2 Measuring Network Performance,Measurement is the key to understanding performance but has its own pitfalls.,Example pitfalls:,Caching: fetching Web pages will give surprisingly fast results if they are unexpectedly cached,Timing: clocks may over/underestimate fast events,Interference: there may be competing workloads,6.6.3 Host Design for Fast Networks,Poor host software can greatly slow down networks.,Rules of thumb for fast host software:,Host speed more important than network speed,Reduce packet count to reduce overhead,Minimize data touching,Minimize context switches,Avoiding congestion is better than recovering from it,Avoid timeouts,6.6.4 Fast Segment Processing (1),Speed up the common case with a fast path pink,Handles packets with expected header; OK for others to run slowly,6.6.4 Fast Segment Processing (2),Header fields are often the same from one packet to the next for a flow; copy/check them to speed up processing,6.6.5 Header Compression,Overhead can be very large for small packets,40 bytes of header for RTP/UDP/IP VoIP packet,Problematic for slow links, especially wireless,Header compression mitigates this problem,Runs between Link and Network layer,Omits fields that dont change or change predictably,40 byte TCP/IP header 3 bytes of information,Gives simple high-layer headers and efficient links,6.6.7 Protocols for “Long Fat Networks (1),Networks with high bandwidth (“Fat) and high delay (“Long) can store much information inside the network,Requires protocols with ample buffering and few RTTs, rather than reducing the bits on the wire,6.6.7 Protocols for “Long Fat Networks (2),You can buy more bandwidth but not lower delay,Need to shift ends (e.g., into cloud) to lower further,Problems: 31, 32, 33, 34, 35, 36, 37,6.7 Delay Tolerant Networking,DTNs (Delay Tolerant Networks) store messages inside the network until they can be delivered,6.7.1DTN Architecture (1),Messages called bundles are stored at DTN nodes while waiting for an intermittent link to become a contact,Bundles might wait hours, not milliseconds in routers,May be no working end-to-end path at any time,6.7.1 DTN Architecture (2),Example DTN connecting a satellite to a collection point,6.7.2 Bundle Protocol (1),The Bundle protocol uses TCP or other transports and provides a DTN service to applications,6.7.2 Bundle Protocol (2),Features of the bundle message format,Dest./source add high-level addresses (not port/IP),Custody transfer shifts delivery responsibility,Dictionary provides compression for efficiency,End,Chapter 6,
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 考试试卷


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!