1 / 34

Chapter Eight

Chapter Eight. The Transport Layer. Objectives. Take a look at some other forms of logical addressing. Examine the process of encapsulation. Take a closer look at flow control. Examine error correction/detection in detail. See how the Transport layer controls congestion on the network.

landon
Télécharger la présentation

Chapter Eight

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter Eight The Transport Layer

  2. Objectives • Take a look at some other forms of logical addressing. • Examine the process of encapsulation. • Take a closer look at flow control. • Examine error correction/detection in detail. • See how the Transport layer controls congestion on the network.

  3. The Transport Layer • The responsibilities of the Transport Layer are: • Handle end-to-end addressing • Repackage long message into smaller segments for transmission • At the receiving end, rebuild packets into the original message • Monitor flow control of data • Handle end-to-end error detection and recovery • Handle congestion control on the network

  4. The Transport Layer • Why do we need transport layer? • Network layer is focused on the routers. It provides logical communication between hosts. • Transport layer runs on end-user devices. It provides logical communication between processes Household analogy: 12 kids sending letters to 12 kids processes = kids app messages = letters in envelopes hosts = houses transport protocol = John and Bill network - layer protocol = postal service

  5. Addressing in the Transport Layer • Ports and sockets can tell the OS what data is intended for what applications. • Ports are 16-bit numbers that identify applications or processes. • Sockets are a logical address consisting of a combination of a port and an IP address.

  6. Ports • Well-known ports • Assigned by Internet Assigned Number Authority (IANA) • Occupy ports 0 through 1023 • Ephemeral ports • Used by the client software to establish a link between applications • Generally assigned by the application when it launches

  7. Port Protocol 20 FTP, File Transfer Protocol, data 21 FTP, File Transfer Protocol, control 23 Telnet 25 SMTP, Simple Mail Transfer Protocol 80 HTTP, HyperText Transfer Protocol 109 POP, Post Office Protocol, version 2 110 POP, Post Office Protocol, version 3 666 Doom, ID software Some Commonly Used Ports

  8. Transport Layer Connections • Connectionless connections • No virtual connection is created. • Data is basically thrown out onto the wire and the transmitting workstation assumes it will arrive safely. • The UDP is an example of a connectionless service • Connection-oriented connections • A virtual connection is created. • For every packet transmitted, either an ACK or a NACK must be returned. • The TCP is an example of connection-oriented service

  9. UDP • often used for streaming multimedia apps • loss tolerant • rate sensitive • other UDP uses • DNS 32 bits dest port # source port # Length, in checksum bytes of UDP length segment, including header data UDP segment format

  10. The Real-Time Transport Protocol • RFC 1889 • Basic function of RTP is to Multiplex several real-time data streams onto a single UDP stream • (a) The position of RTP in the protocol stack. (b) Packet nesting.

  11. TCP segment structure 32 bits 32 bits URG: urgent data counting source port # source port # dest port # dest port # (generally not used) by bytes sequence number sequence number of data ACK: ACK # (not segments!) acknowledgement number acknowledgement number valid head head not not Receive window Receive window U U A A P P R R S S F F PSH: push data now len len used used # bytes (generally not used) checksum checksum Urg Urg data data pnter pnter rcvr willing to accept RST, SYN, FIN: Options (variable length) Options (variable length) Connection’ estab (setup, teardown commands) application application data data Internet (variable length) (variable length) checksum (as in UDP)

  12. TCP segment structure • A 32-bit sequence number keeps packets in order. • A 32-bit acknowledgement number is used to verify the packet. • 4-bit Header Length – Indicate the size of the entire TCP header the receiver • URG – 0 or 1. When set to 1, this bit indicate the urgent pointer field is valid and should be considered. • ACK – 0 or 1. When set to 1, this bit indicates that acknowledgement number field is valid and being used

  13. TCP segment structure • A window sized field dictates how many packets will be sent before waiting for ACKS. • PSH – 0 or 1. When set to 1, this bit tells the receiver to pass all data received at the point to the receiving application immediately. • RST – 0 or 1. This bit indicates an error condition has been detected and notify the receiver to reset the connection

  14. TCP segment structure • SYN – 0 or 1. This bit synchronizes the sequence numbers in order to establish a connection • 16 bit TCP checksum – ensure that the TCP header has not been modified in transmit • 16-bit Urgent Pointer – This pointer is added to the sequence number field to yield the sequence number of urgent data.

  15. Flow Control application application writes data reads data socket socket • Buffer overflow • Memory fills; transmission stops • Stop and wait • Send a frame and wait for the reply • Neither methods very useful for busy networks • Rarely used door door TCP TCP send buffer receive buffer segment

  16. Advanced Flow Control • Static window • A fixed number of frames are transmitted. • The transmitting station waits for the replies. • No adjustments in transmission speed can be made. • Sliding window • It starts with a higher number of frames. • As failures occur, the number of frames transmitted drops. • If a frame is dropped, that frame and all frames following it will get retransmitted.

  17. MORE Flow Control • Selectively repeat • A number of frames are transmitted. • If a failure occurs, only the bad packets need to be transmitted.

  18. MORE Flow Control • Go Back N • It is similar to sliding window except that a single ACK is sent for all frames in a window. • If a failure occurs, the protocol counts back the correct number of frames and retransmits all.

  19. Error Control in Transport • The error correction in Data Link was bit-level error correction. • If user data was corrupted, the error was detected and, if possible, fixed. • Transport layer error correction is end-to-end. • There may have error during encapsulation • If a packet is lost or corrupted, the error is fixed.

  20. Error Control in Transport • Packet level errors can include packet loss, packet corruption, and packet duplication. The network uses • three-way handshake • sequence number • time-out for each packet

  21. TCP Connection Establishment Three way handshake: • Recall: TCP sender, receiver establish connection before exchanging data segments • initialize TCP variables: • seq. #s • buffers, flow control info (e.g. RcvWindow) Step 1: client host sends TCP SYN segment to server specifies initial seq # no data Step 2: server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data

  22. TCP Connection Establishment • (a)TCP connection establishment in the normal case. • (b)Call collision. – only one connection is established

  23. TCP Connection Close • Closing a connection: • Step 1: client end system sends TCP FIN control segment to server • Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN. • Step 3: client receives FIN, replies with ACK. • Step 4: server, receives ACK. Connection closed. client client server server close close FIN FIN ACK ACK FIN FIN close close timed wait timed wait ACK ACK closed closed

  24. Principles of Congestion Control • Congestion: • informally: too many sources sending too much data too fast for network to handle • different from flow control! • manifestations: • lost packets (buffer overflow at routers) • long delays (queueing in router buffers) • a top-10 problem!

  25. Congestion Control • (a)A fast network feeding a low capacity receiver. • (b)A slow network feeding a high-capacity receiver.

  26. Congestion Control • No single device can control overall network congestion. • Therefore, Transport does what it can to make sure THIS DEVICE does not contribute to congestion. • Connections requiring excessive retransmission of data are dropped.

  27. Approaches towards congestion control Two broad approaches towards congestion control: • End-end congestion control: • no explicit feedback from network • congestion inferred from end-system observed loss, delay • approach taken by TCP • Network-assisted congestion control: • routers provide feedback to end systems • single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) • explicit rate sender should send at

  28. TCP Congestion Control • Slow start (Jacobson 1998) • Start with the maximum segment size • If this is acknowledge then double the window size • Send two maximum segemnt size • Repeat • When the CongWin = threshold, increase linearly. • Threshold = 1/2 of CongWin value before timeout. • Initially 64KB in addition to receiver flow control and congestion control window • When timeout occur • reduce threshold to half of the congestion window • Congestion window is reset to 1 segment

  29. Slow Start • When connection begins, increase rate exponentially until threshold: • double CongWin every RTT • done by incrementing CongWin for every ACK received • Summary: initial rate is slow but ramps up exponentially fast one segment Host A Host B two segments RTT four segments time time

  30. TCP Congestion Control (2) • An example of the Internet congestion algorithm.

  31. Summary: TCP Congestion Control • When CongWin is below Threshold, sender in slow-start phase, window grows exponentially. • When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly. • When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS.

  32. TCP Round Trip Time and Timeout • Q: how to set TCP timeout value? • longer than RTT • but RTT varies • too short: premature timeout • unnecessary retransmissions • too long: slow reaction to segment loss • Q: how to estimate RTT? • SampleRTT: measured time from segment transmission until ACK receipt • ignore retransmissions • SampleRTT will vary, want estimated RTT smoother • average several recent measurements, not just current SampleRTT

  33. TCP Timer Management • Variable Retransmission based on RTT • Timeout based on Round Trip Time (RTT) • RTT = αRTT + (1-α)M • M is the time the ack received • α is smoothing factor typically 7/8 • A better estimate • Timeout = RTT + 4xD • D = αD + (1-α)|RTT-M| • Karn’s Algorithm • Do not use RTT if retransmission happens • Time out is doubled on every failure

  34. Example RTT estimation: RTT: gaia.cs.umass.edu to fantasia.eurecom.fr 350 300 RTT (milliseconds) 250 200 150 100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 time (seconnds) SampleRTT Estimated RTT

More Related