1 / 25

Transport Layer

Transport Layer. Foreleser: Carsten Griwodz Email: griff@ifi.uio.no. Credit Mechanism. Flow control Credit mechanism Buffer reservation Receiver allocates buffers dynamically for the connections Allocation depends on the actual situation Principle Sender requests required buffer amount

shaw
Download Presentation

Transport Layer

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. Transport Layer Foreleser: Carsten Griwodz Email: griff@ifi.uio.no 1

  2. Credit Mechanism • Flow control • Credit mechanism • Buffer reservation • Receiver allocates buffers dynamically for the connections • Allocation depends on the actual situation • Principle • Sender requests required buffer amount • Receiver reserves as many buffers as the actual situation permits • Receiver returns ACKs and buffer-credits separately • ACK: confirmation only (does not imply buffer release) • CREDIT: buffer allocation • Sender is blocked when all credits are used up

  3. Credit Mechanism • Dynamic adjustment to • Buffer situation • Number of open connections • Type of connections • high throughput: many buffers • low throughput: few buffers

  4. Data TCP Flow Control • Variable window sizes (credit mechanism) • Implementation • The actual window size is also transmitted with each acknowledgement • Permits dynamic adjustment to existing buffer Sequence number and acknowledgements Version IHL Type of service PRE ToS Total length Identification D M Fragment offset Time to live Protocol Header checksum Source address Credit Destination Address Options Source port Destination port Sequence number THL – TCP header length U: URG – urgent A: ACK – acknowledgement P: PSH – push R: RST – reset S: SYN – sync F: FIN – finalize Piggyback acknowledgement THL unused U A P R S F Window Checksum Urgent pointer Options (0 or more 32 bit words)

  5. TCP Flow Control • “Sliding window” mechanism • Sequence number space is limited • No buffers longer than 232 possible • Acknowledgement and sequence number • Acknowledgments refer to byte positions • Not to whole segment • Sequence numbers refer to the byte position of a TCP connection • Positive acknowledgement • Cumulative acknowledgements • Byte position in the data stream up to which all data has been received correctly • Reduction of overhead • More tolerable to lost acknowledgements

  6. 2K / SEQ=0 ACK=2048 WIN=2048 2K / SEQ=2048 ACK=4096 WIN=0 ACK=4096 WIN=2048 1K / SEQ=4096 TCP Flow Control Sender Receiver Application does a 2K write 4K buffer Sender is blocked 2K Application does a 2K write Sender is blocked Application reads 2K 2K Sender could send 2K but application does only a 1K write time time 1K 2K

  7. TCP Flow Control: Special Cases • Optimization for low throughput rate • Problem • Telnet (and ssh) connection to interactive editor reacting on every keystroke • 1 character typed requires up to 162 byte • Data: 20 bytes TCP header, 20 bytes IP header, 1 byte payload • ACK: 20 bytes TCP header, 20 bytes IP header • Echo: 20 bytes TCP header, 20 bytes IP header, 1 byte payload • ACK: 20 bytes TCP header, 20 bytes IP header • Approach often used • Delay acknowledgment and window update by 500 ms (hoping for more data) • Nagle’s algorithm, 1984 • Algorithm • Send first byte immediately • Keep on buffering bytes until first byte has been acknowledged • Then send all buffered characters in one TCP segment and start buffering again • Comment • Effect at e.g. X-windows: jerky pointer movements

  8. Sender window size=0 Receive buffer full Application reads one byte Room for one byte Window update segment sent Header Header New byte arrives 1 byte Receive buffer full TCP Flow Control: Special Cases • Silly window syndrome (Clark, 1982) • Problem • Data on sending side arrives in large blocks • But receiving side reads data at one byte at a time only • Clark’s solution • Prevent receiver from sending window update for 1 byte • Certain amount of space must be available in order to send window update • min(X,Y)X = maximum segment size announced during connection establishmentY = buffer / 2

  9. Transport Protocols: SCTP 10

  10. Stream Control Transmission Protocol (SCTP) • Stream Control Transmission Protocol • RFC2960, IETF Standards Track • RFC2719, Architectual Framework for Signaling Transport • SCTP Unreliable Data Mode Extension (draft-ietf-tsvwg-usctp-00.txt) • Initial goal • Signaling protocol for SS7 transport over IP networks • Protocol of the telephony world for IP telephony • Players • Motorola, Cisco, Siemens, Nortel Networks, Ericsson, Telcordia, UCLA, ACIRI • Goal now: A new universal transport protocol • Competition or even replacement for TCP

  11. SCTP Motivation • TCP too limited for some applications • E.g., transport signaling from PSTN networks (SS7) over IP-based networks • Examples • TCP: Strict order-of-transmission delivery of data with multiple streams • Partial order within a stream of multiplexed streams sufficient • Stream-orientation of TCP inconvenient • Application must set record markings • Better: message-orientation • TCP cannot deal with multi-homing • I.e., one server with several IP addresses • TCP is vulnerable to DoS attacks • E.g., SYN flooding • Many connect requests (SYN), but SYN/ACK response never acknowledged

  12. SCTP Features • Features • Connection-oriented • Message-oriented • Fully ordered, unordered, partially ordered delivery • Reliable (with extension also: unreliable, partially reliable) • Multi-homed • Deadlines • Applications can give deadline for packet sending • Once sent, delivery is guaranteed (retransmission) • Delivery • Sender can specify • unordered delivery • per packet

  13. Reliability Sender and receiver window are computed Per stream In bytes Changed per stream as in TCP Acknowledgement using selective ACK SACK chunks Are piggybacked Contain ranges of packets Retransmission Not before 4th missing report Always before new packets Unreliable transport – V1 Proposed extension Max. number of retransmissions Specified per stream 0 is legal Ordered and unreliable is possible Unreliable transport – V2 Proposed extension Sender demands ACKs Receiver must ACK Even if packets were not received SCTP Features

  14. Endpoint 1 Endpoint 2 Association Association and Streams • Connection-oriented • Concept of ‘association‘ • Bi-directional • No one-way teardown of connections • Generalization of TCP-connections • Each association endpoint can have several IP addresses (multi-homing) Primary address IP addresses associated with EP1 IP addresses associated with EP2 Secondary addresses

  15. Association Association and Streams • Connection-oriented • Concept of ‘association‘ • Bi-directional • No one-way teardown of connections • Generalization of TCP-connections • Each association endpoint can have several IP addresses (multi-homing) • Each association can contain several streams (multi-streaming) • Stream: sequence of user messages to be delivered in order (up to 216 per direction) • => in contrast to the notion of ‘stream‘ of TCP Stream A Stream B Stream C

  16. Association Association and Streams • Reliable data transfer • Confirmed, no duplicates, error-free • Strictly ordered delivery optional • Strict order: keep order within and among streams of an association • Partial order: keep order within a stream of an association • Effects • Strict order: data transmission stalled if one stream is stalled • Partial order: transmission for non-stalled streams can continue • Example: HTTP with multiple embedded files (images) • Order of arrival of image data not relevant Stream A Strict order 1 2 3 Stream B 2 3 1 2 1 1 1 2 3 1 2 1 1 Arrival at the receiver Stream C 1 3 2 1 2 1 1 2 Partial order

  17. Further SCTP Concepts • Message segmentation according to path-MTU • Path-MTU • maximum transfer unit supported on the path between the endpoints • Path-MTU discovery mechanism as specified in RFC 1191 • Test whether the communication partner is alive: Heartbeats • Flow control and congestion control similar to TCP (Selective Ack,...) • Coexistance with TCP • Security means • 32-bit checksum (Adler-32, CRC-32 under discussion) • 4-way handshake using cookies against DoS attacks

  18. INIT INIT ACK (with cookie) COOKIE ECHO COOKIE ACK 4–way Handshake State Action Action State Closed Closed Start timer Cookie wait Generate cookie Stop timer Cookie sent Start timer Verify cookie Stop timer Established • No half-open states as in TCP • No state information kept at the station receiving the ‘INIT‘ message • No vulnerability for SYN flooding • State information established only after the third step, the ‘COOKIE‘ message • To increase efficiency • User data can be sent already with the ‘COOKIE‘ and ‘COOKIE ACK‘ messages Established time time

  19. Common Header Chunk 1 Chunk 2 … Chunk n Source port Destination port Verification Tag Checksum Message format • Multiplexing of several user messages: Chunk Bundling • Chunk: part of an SCTP packet belonging to a single stream • User can request unbundled chunks • Common Header • Source port / destination port (2 Byte each): As in TCP or UDP • Verification tag: for validation of the sender of the SCTP message • Protection against blind attacks (unauthorized shutdown of association) • Checksum • Adler-32: currently proposed in the RFC • CRC-32: proposed recently, better error detection properties for small packets

  20. General format of a chunk Chunk Type Type of information in the Chunk Value field E.g., type=0: payload data; type=1: INIT message,... Chunk Flags Depend on the chunk type Chunk Length Length of the chunk in bytes Including type, flags, length Chunks DATA SACK INIT ABORT SHUTDOWN HEARTBEAT ERROR ECNE CWR & responses Chunk Value Chunk Type Chunk Flags Chunk Length Chunk Format

  21. Optional/variable length parameters Type=1 Flags: None Chunk Length Initiate Tag Advertised receiver credit window Number of outbound streams Number of inbound streams Initial transmission sequence number INIT Chunk Format • Initiate Tag: random number used in all subsequent messages • Protect against blind attacks • Advertised Receiver Credit Window • Dedicated buffer space reserved for the association • Number of outbound streams • The sender of this INIT chunk wants to open • Number of inbound streams • Maximum the sender of this INIT message can support • Variable-Length parameter • A.o.: list of IP addresses (multi-homing!) being part of the association

  22. Type=0 Flags: U|B|E Chunk Length Transmission Sequence Number (TSN) Stream identifier S Stream sequence number n Payload Protocol Identifier User Data (seq n of stream S) DATA Chunk Format • Example: Format of a DATA chunk (i.e., non SCTP control message) • Flags (one bit each) • Unordered bit: ’1’ indicates unordered DATA chunk, ’0’ an ordered DATA chunk • Beginning bit: ’1’ first fragment of a user message • End bit: ’1’ last fragment of a user message • Transmission Sequence Number (32 bits) => 4,300 Mio numbers • Unique per stream • Used for acknowledgments and duplicate recognition • Acknowledgements are given per message (selective ACK) • ... • …

  23. Type=0 Flags: U|B|E Chunk Length Transmission Sequence Number (TSN) Stream identifier S Stream sequence number n Payload Protocol Identifier User Data (seq n of stream S) DATA Chunk Format • ... • Stream Identifier (16 bits) • Stream Sequence Number (16 bits) • Unique per stream • Used to assure sequenced delivery within a stream • Separate acknowledgement mechanism from sequenced delivery • If fragmentation is necessary, stream sequence number is the same for all fragments • Payload Protocol Identifier (e.g., RTP) • User Data: the actual user data to send via SCTP • …

  24. Transport Protocols: DCCP 25

  25. Datagram Congestion Control Protocol (DCCP) • Datagram Congestion Control Protocol • Under development • http://www.ietf.org/html.charters/dccp-charter.html • Transport Protocol • Offers unreliable delivery • Low overhead like UDP • Applications using UDP can easily change to this new protocol • Accommodates different congestion control • Congestion Control IDs (CCIDs) • Add congestion control schemes on the fly • Choose a congestion control scheme • TCP-friendly Rate Control (TFRC) is included • Half-Connection • Data Packets sent in one direction

More Related