《IP网络技术基础课件(英文)ppt.ppt》由会员分享,可在线阅读,更多相关《IP网络技术基础课件(英文)ppt.ppt(41页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Meng TianTian207 NJUPT1End-to-End ProtocolOutline Simple Demultiplexer (UDP) Reliable Byte-Stream (TCP)Connection Establishment/TerminationSliding Window Revisited Flow ControlMeng TianTian207 NJUPT2The Layered Network StackPhysical LayerApplication LayerTransport Layer (TCP/UDP)Network Layer (IP)Da
2、ta Link LayerInternet StackPhysical LayerSession LayerTransport LayerNetwork LayerData Link LayerOSI StackPresentation LayerApplication LayerMeng TianTian207 NJUPT3End-to-End Protocols Underlying best-effort network drop messages re-orders messages delivers duplicate copies of a given message limits
3、 messages to some finite size delivers messages after an arbitrarily long delay Common end-to-end services guarantee message delivery deliver messages in the same order they are sent deliver at most one copy of each message support arbitrarily large messages support synchronization allow the receive
4、r to flow control the sender support multiple application processes on each hostMeng TianTian207 NJUPT4 Transport layer uses the network layer, to send and receive data. Transport Protocol Data Unit (TPDU) Each layer adds its part TCP segment, IP packet, Data link frameOverview of Transport LayerMen
5、g TianTian207 NJUPT5Overview of Transport Layer(cont.)Meng TianTian207 NJUPT6 Two types of transport services connection-oriented connectionlessEnd-to-End ProtocolsMeng TianTian207 NJUPT7Simple Demultiplexor (UDP) Transport protocol above IP simply passes IP through to the upper (application) layers
6、 Unreliable and unordered datagram service Adds multiplexing No flow control Endpoints identified by ports servers have well-known ports FTP - 21, Telnet - 23, http - 80, pop - 110, DNS - 53Meng TianTian207 NJUPT8UDP “Features” Gives apps the option to send packets unreliably Useful for multicast ap
7、ps Low delay transmission for interactive text/audio/video Minimal connection state: “connectionless” Minimal connection setup time No congestion control blast away Build own application-level protocol on top of UDPMeng TianTian207 NJUPT9UDPUDP Header:Only 8 bytes! (vs. IP 20 bytes header)Source por
8、t for UDP sending processDest port for UDP receiving processLength in bytes of UDP header + payloadChecksum over UDP header + payloadSource Port #Dest. Port #UDP lengthChecksum1632UDP payload dataUDP payloadIPhdrUDPhdrError DetectionMeng TianTian207 NJUPT10Error Detection Why is there error detectio
9、n in the transport layer given that the same function is provided by the data link layer Reliable transmission along each link is still no guarantee of error-free transmission between the source and the destination.Meng TianTian207 NJUPT11Error Detection (cont.)Meng TianTian207 NJUPT12TCP Overview C
10、onnection-oriented TCP provides: Reliable delivery of packets, Stream or in-order deliveryApplication processWritebytesTCPSend bufferSegmentSegmentSegmentTransmit segmentsApplication processReadbytesTCPReceive buffer Full duplex Flow control: keep sender from overrunning receiver Congestion control:
11、 keep sender from overrunning networkMeng TianTian207 NJUPT13Transport Control Protocol Provides a reliable end-to-end byte stream over an unreliable network such as IP. Provides connection oriented user-to-user service connection management No intermediate nodes are involved in connection establish
12、ment. TCP service is obtained by having both the sender and receiver create end points called sockets. Each socket is associated (bound) with IP address of the host 16-bit number local to the host called a portMeng TianTian207 NJUPT14Transport Control Protocol(cont.)Meng TianTian207 NJUPT15Data Link
13、 Versus Transport Potentially connects many different hosts need explicit connection establishment and termination Potentially different RTT need adaptive timeout mechanism Potentially long delay in network need to be prepared for arrival of very old packets Potentially different capacity at destina
14、tion need to accommodate different node capacity Potentially different network capacity need to be prepared for network congestionMeng TianTian207 NJUPT16TCP Segment A segment consists of a fixed 20-byte header (plus an optional part) followed by zero or more data bytesMeng TianTian207 NJUPT17TCP Se
15、gment (cont.)Source port (16 bits) Specifies the application sending the segment.Meng TianTian207 NJUPT18TCP Segment (cont.)Destination port (16 bits) Identifies the application to which the segment is sent.Meng TianTian207 NJUPT19TCP Segment (cont.)Sequence number (32 bits) Contains the sequence nu
16、mber of the first byte of data. Meng TianTian207 NJUPT20TCP Segment (cont.)Acknowledgment number (32 bits) Contains the byte sequence number which the receiving TCP entity expects to receive next.Meng TianTian207 NJUPT21TCP Segment (cont.)Header length (4 bits): the size of the TCP header.Meng TianT
17、ian207 NJUPT22TCP Segment (cont.)Flags (6 bits) Control functions for establishing and removing connections etc. Include URG, ACK, PSH, RST, SYN, FIN.Meng TianTian207 NJUPT23TCP Segment (cont.)Window (16 bits) Tells the receiving TCP entity how many data bytes the sending TCP entity can accept.Meng
18、TianTian207 NJUPT24TCP Segment (cont.)Checksum (16 bits) Used for transport layer error detection. pseudo header(12Bytes) + TCP header + dataMeng TianTian207 NJUPT25TCP Segment (cont.)Urgent pointer (16 bits) Signal the receiver to deliver the data to the higher layer as quickly as possible.Meng Tia
19、nTian207 NJUPT26TCP Segment (cont.)Options/padding - maximum segment sizeMeng TianTian207 NJUPT27Segment Format (cont) Each connection identified with 4-tuple: (SrcPort, SrcIPAddr, DsrPort, DstIPAddr) Sliding window + flow control acknowledgment, SequenceNum, AdvertisedWinowSenderData (SequenceNum)A
20、cknowledgment +AdvertisedWindowReceiverMeng TianTian207 NJUPT28Connection EstablishmentActive participant(client)Passive participant(server)SYN, SequenceNum = xSYN + ACK, SequenceNum = y,ACK, Acknowledgment = y + 1Acknowledgment = x + 1SequenceNum =x+1 Meng TianTian207 NJUPT29Connection TerminationM
21、eng TianTian207 NJUPT30State Transition DiagramCLOSEDLISTENSYN_RCVDSYN_SENTESTABLISHEDCLOSE_WAITLAST_ACKCLOSINGTIME_WAITFIN_WAIT_2FIN_WAIT_1Passive openCloseSend/SYNSYN/SYN + ACKSYN + ACK/ACKSYN/SYN + ACKACKClose /FINFIN/ACKClose/FINFIN/ACKACK + FIN/ACKTimeout after two segment lifetimesFIN/ACKACKAC
22、KACKClose /FINCloseCLOSEDActive open /SYNMeng TianTian207 NJUPT31Sliding Window Revisited Sending side LastByteAcked = LastByteSent LastByteSent = LastByteWritten buffer bytes between LastByteAcked and LastByteWrittenSending applicationLastByteWrittenTCPLastByteSentLastByteAckedReceiving application
23、LastByteReadTCPLastByteRcvdNextByteExpected Receiving side LastByteRead NextByteExpected NextByteExpected = LastByteRcvd +1 buffer bytes between NextByteRead and LastByteRcvdMeng TianTian207 NJUPT32Flow Control Send buffer size: MaxSendBuffer Receive buffer size: MaxRcvBuffer Receiving side LastByte
24、Rcvd - LastByteRead = MaxRcvBuffer AdvertisedWindow = MaxRcvBuffer (NextByteExpected -1)-NextByteRead) Sending side LastByteSent - LastByteAcked = AdvertisedWindow EffectiveWindow = AdvertisedWindow - (LastByteSent - LastByteAcked) LastByteWritten - LastByteAcked MaxSenderBuffer Always send ACK in r
25、esponse to arriving data segment Persist when AdvertisedWindow = 0Meng TianTian207 NJUPT33Flow Control Transport protocols resemble the data link protocols Flow control, error control, sequencing A sliding window is used for flow control Differences A router usually has only a few links to others, w
26、hile a transport entity may have numerous connections. This difference makes it impractical to implement a data link buffering strategy in the transport layer. The receiver may not dedicate specific buffers to specific connections.Meng TianTian207 NJUPT34Flow Control Dynamic buffer management - cred
27、it mechanism Initially, the sender requests a certain number of buffers (credit), based on its perceived needs. The receiver grants as many of these as it can afford. Every time the sender transmits a TPDU, it decreases its allocation (credit), stopping when the allocation (credit) reaches zero. The
28、 receiver returns both acknowledgments and buffer allocations (credit).Meng TianTian207 NJUPT35Move forward by ACK1002003004005006007008009001012013014015016017018011Sender windowData that can be sent不可发送pointer Sender wants to send 900 bytes 9 segments(100 bytes each segment). The sender window is
29、500 bytes. Sender can move the window forward by the ACK from the receiver. In addition, the sender maintain a pointer to identify the data which have been sent.Data that cannot be sentMeng TianTian207 NJUPT361002003004005006007008009001012013014015016017018011可发送不可发送pointer1002003004005006007008009
30、001012013014015016017018011发送窗口可发送不可发送Send window moves forward The sender have send 400 bytes. And the sender only receive the ACK of the top 200 bytes. The window is 500. So the sender can still send 300 bytes. Sent &acked已发送但未被确认Sender windowData that can be sentMove forward by ACK500600700800900
31、501601701801不可发送Data that cannot be sentpointerSent &Not ackedData that can be sentData that cannot be sentMeng TianTian207 NJUPT371002003004005006007008009001012013014015016017018011Sent &acked可发送pointerSend window reduce The sender receive the ACK of the following 200 bytes. The window is changed
32、to 400. So the sender can send 400 bytes.1002003004005006007008009001012013014015016017018011可发送不可发送pointerSend window moves forwardSent &acked已发送但未被确认Sent &Not ackedData that can be sentData that cannot be sentData that can be sentData that cannot be sentMeng TianTian207 NJUPT38Flow Control (cont.)
33、 - Example Assume each entity agree to a credit of 200 bytes Assume entities send 100 bytes in each TPDUMeng TianTian207 NJUPT39Protection Against Wrap Around 32-bit SequenceNumBandwidthTime Until Wrap AroundT1 (1.5 Mbps)6.4 hoursEthernet (10 Mbps)57 minutesT3 (45 Mbps)13 minutesFDDI (100 Mbps)6 min
34、utesSTS-3 (155 Mbps)4 minutesSTS-12 (622 Mbps)55 secondsSTS-24 (1.2 Gbps)28 secondsMeng TianTian207 NJUPT40Keeping the Pipe Full 16-bit AdvertisedWindow (the max win.=64KB)BandwidthDelay x Bandwidth ProductT1 (1.5 Mbps)18KBEthernet (10 Mbps)122KBT3 (45 Mbps)549KBFDDI (100 Mbps)1.2MBSTS-3 (155 Mbps)1.8MBSTS-12 (622 Mbps)7.4MBSTS-24 (1.2 Gbps)14.8MB assuming 100ms RTTMeng TianTian207 NJUPT41HOMEWORK Exercises 10 Review question1. How does TCP establish a connection?2. Give the UDP segment format. Required Reading Stallings chapter 5.1, 5.2