Document Sample
CNC Powered By Docstoc
					  Lecture #19: Transport Protocols.
           Elements and Examples
    OSI Transport Layer   2

    Transport Service Primitives   4

    Addressing      6

    Connection Control    9

    Transport Layer in Internet    11

    TCP Addressing 12
    TCP protocol 13
    UDP 18                              1
                                   OSI Transport Layer
              Application layer         User application 1                       ...
                                     Encryption/         compression/              Choice of
              Presentation layer     decryption           expansion                 syntax

                Session layer      Session   Session   Session to transport        Session
                                   control   synch.         mapping              management

              Transport layer      Layer and flow             Error              Multiplexing
                                      control                recovery

               Network layer         Connection              Routing              Addressing
                                      Data link         Error       Flow      Synch     Framing
                Link layer
                                    establishment      control     control
                                       Access to          Physical and            Activation/
  6/1          Physical layer       transm. media      electrical interface   deactivation of con.
Functions within the transport layer may include:
 •   mapping transport-address onto network-address;
 •   multiplexing (end-to-end) transport-connections onto network-connections;
 •   establishment and release of transport-connections;
 •   end-to-end sequence control on individual connections;
 •   end-to-end error detection and any necessary monitoring of the quality of 2
     service; etc.
                  Services of the Transport Layer
   Services to the session (or application) layer:
     – unique identification of each session entity by its transport
        address. The transport-service provides the means to establish,
        maintain and release transport-connections (case the service is
     – duplex transmission between a pair of transport addresses (one
        or more transport connection can be established between the
        same pair of transport addresses)
     – provides endpoint identifiers that distinguish the transport
        connection endpoints
     – the quality of service provided on a transport connection depends
        on the service class requested by the session entities (the
        selected quality of service is maintained throughout the lifetime of
        the transport connection)
     – the following services are provided by the transport layer:
          • transport-connection establishment
          • data transfer
          • transport-connection release                                   3
   Transport service provider and transport service user.
                                 Service Primitives
            Transportprovided by the access primitives
          Transport services are
         Access primitives provide interface to user applications and
         Example set of transport service’s access primitives

6/3      Transport Protocol Data Unit (TPDU) - standard data entity
          exchanged between transport peers. TPDU payload is packed with
          header in Network Layer packet. NL packet is cut into Data Link Layer frames
          with frame’s headers
6/4      UNIX implementation of transport service primitives: as any other
          interface in UNIX the network transport layer data has file presentation
          established by SOCKET and assigned by BIND. Unblocking LISTEN allocates
          buffer for remote requests.
         State-transition diagram of the transport layer connection
           – event driven control; events: local execution of a
             transport primitive or incoming packet                                  4
                                  Transport Protocol
     Transport protocols implement transport layer
     Example protocol hierarchy (TCP/IP model)                    19/1
     Transport protocol environment:
       – host-to-host communication over the subnet (instead the Network layer
         communication between subnet components - routers, over data link)
       – source/destination addressing (instead addressing by selection of router’s
6/7      outgoing line by the Network Layer
       – possibility to store (and delay) packets in the subnet by datagram model -->
         special transport protocols for real-time and interactive communications
       – dynamic allocation of connection’s buffers as the number of connections is not
         predefined (in contrast to the Network Layer where the number of input/output
         lines is fixed and static allocation of the buffer space is applicable).         5
   Addressing is based on TSAP (Transport Service Access Point) that
    corresponds to some port of a local process. TSAP is defined by pairs

                                    (IP address, local port i)

    where NSAP (Network Layer SAP) is presented by IP address (or another
    adequate addressing - AAL…)

   TSAP are multiple for any transport entity while NSAP are either one or few in
    a machine/router

   Connection phases:
          – server OS assigns a TSAP to an active server process upon its request

          – application process on a remote machine requests connection to server’s TSAP via its
            local TSAP

          – transport entities use the network link to process the communication request either
            as connection oriented service (session) or as connectionless data delivery
     Constant TSAP address services
     Dynamic TSAP assignment to the service
       – Initial connection protocol by process server

       – process server acts as a proxy between a set of
         server processes and remote client processes
       – the requested server is split out from the process
         server set and communicates autonomously to the
         client during the session

Classes of the transport protocol

 Protocol Network
  class                      Functions
    0       A            Minimal functions

    1       B         Network error recovery

    2       A           Connection bonding

                      Network error recovery,
    3       B
                       connection bonding
                    Error detection and recovery,
    4       C
                         connection bonding
            Connection Establishment
    Three-way handshaking
      – Normal operation:
         • control parameters:
6/11a        – sequential number of initiator - x
             – sequential number of the party - y
         • CR - connection request from initiating host
         • ACK - connection accepted from
         • Data transfer

      – delayed duplicate request TPDU - the delayed request is
        rejected by the initiator
      – delayed duplicate request and delayed duplicate acknowledge:
        the initiator rejects the delayed request acknowledge as in
6/11c   previous case; the party rejects the delayed duplicate data-
        acknowledge because of imparity of its sequential number
        (z instead y)
                            Connection Release
• Asymmetric release: connection release initiative of any of the
  • simple and quick
  • possible lost of data

• Symmetric release
  • treats the connection as two independent unidirectional connections
    and release each of them separately
  • no data losses                                   6/13
  • synchronization problem (two-army problem)

          Transport Layer in Internet
  • Connection-oriented and connectionless oriented protocols
       in Internet

  • TCP (Transport Control Protocol) features:
        • connection oriented protocol supporting end-to-end full-
          duplex byte stream over network links with losses and
        • upper interface to user processes or OS kernel requests
        • lower interface to IP
        • brakes user/OS data into IP datagrams of 1500-64kB or
          restore the IP datagrams into upper level byte stream
        • controls the timeout periods, retransmission events,
          sequencing, etc, over the unreliable IP transfer
• Addressing based on sockets:
                                         TCP addressing
    • a socket unifies NSAP end TSAP
    • the socket number consists of:
        • IP address (NSAP) - 4 bytes
        • local port (TSAP) - 16b (up to 64k ports addressing space)
    • a socket pair uniquely identifies a transport connection: (socket1,
    • several connections may ended in a common socket
    • socket calls from the OS:

    • port address space:
        • 0 - 255 - well-known ports:
  7 - Echo; 13 - Daytime; 21 - FTP File Transfer; 23 - Telnet; 49
  - Login Host Protocol; 79 - Finger; 80 - World Wide Web HTTP;
  110 - Post Office Protocol - Version 3 (POP3)                 12
                                            TCP protocol
    • 32-bit numbering (0 - 4G) of the byte sequence
    • TPDUs: segments
    • Segmentation according the network properties (user data
      stream can be split into smaller segments or collected in
      larger ones).
    • Segment structure:
      • header (20B)
      • header options
      • data (optional, up to 64k)
   • Segment header:
      • 5 * 32-bit words
6/24 • Source/Destination port - 16b - local end points of the
      • Sequence Number/Acknowledgement Number - 32b (4G ) -
        the byte numbers in the stream (last received and next expected)
                                                  TCP protocol
  • Segment Header (cont.)
       • TCP header length - (4b) - the header length in 32b words - up
6/24     to 16 words of which 5 are standard header and up to 11 are
         optional header words
       • reserved field of 6b (not used in TCP versions up to now)
       • 6 flags field; the value 1 of the flags means respectively:
           • URG: Urgent pointer in use. Urgent pointer is a facility that points the
             urgent data field. Urgent data contains interrupt messages that are
             interpret by the upper levels but not by TCP itself
           • ACK: Valid Acknowledgement number. If ACK=0 the contents of the
             Acknowledgement number field is ignored
           • PSH: Pushed data indicator. “Pushed data” is data that has to be
             delivered to the application layer without buffering (i.e. without delay)
           • RST: Reset connection. Used in cases of host failure or refusal of
             connection opening attempt
                                                        TCP protocol
• Segment Header - Flags’ field (cont.)
       • SYN: Establish connection. Connection request/replay indicator. SYN=1 and
         ACK=0 means connection request (no piggybacked acknowledgement) and
6/24     SYN=1 and ACK=1 means connection replay (acceptance) with a
         acknowledgement piggybacked in the same segment. SYN segments are
         ordered by the sequence numbers in order to prevent delayed duplications.
       • FIN: Release connection request. The sender has finished the data
         transmission. FIN segments also are ordered by the sequence numbers in
         order to prevent delayed duplications.
   • Window size. 16b - Indicates the free buffer space of the receiver
     after the last received byte (which is Acknowledgement number - 1).
     The maximum buffer buffer indicated is 64kB. 0 buffer space means
     temporarily to stop data transmission to the receiver.
   • Checksum. 16b - checksum over header, data and the pseudoheader:
     (set of segment parameters)
       • pseudoheader: set of transmission parameters that includes
         source/destination IP addresses and the segment length (Note that the control
6/25     over IP addresses is not a functionality of TCP but of IP)
                                     TCP protocol
• Segment Header (cont.)            6/24
   • Urgent pointer. 16b - Used in compination with URG flag.
   • Header Options. Variable length - optional extension of the
     header facilities e.g. maximum segment length. The segment
     length has to be compromised between the transmission
     effectiveness and the host/application requirements.

           TCP connection management
  • TCP uses 3-way handshaking for connection establishment:
       • the server host (host2) waits for incoming having issued LISTEN or
         ACCEPT primitive
       • the client host (host1) issued CONNECT primitive specifying TSAP by (IP
6/26     addr., port) couple; the flags SYN=1, ACK=0
       • the server host acknowledges the connection if there is active server
         process listening the specified port
       • simultaneous attempts to open connection lead to failure because of
         different sequence numbering (6/26b)
       • simultaneous attempts to close connection are not in a collision; FIN
         segments are acknowledged (or timed-out) and the connection is closed
  • Finite state-machine of a TCP connection:
       • set of states                              6/27
       • set of transitions (the transitions are invoced by event/action pair)17
• UDP (User Datagram Protocol) implements
  connectionless unreliable services of the Transport
• The establishment/release of the connection is skipped
• UDP segment:
    • 8B (2x32b words) header
    • extends IP datagram with
         • source/destination ports fields
         • UDP segment length field (data + 8B header)
         • UDP checksum field over header, pseudoheader and data

• UDP is generally the protocol used in transmitting voice and video across
  a network. In some instant messengers/chat programs too.
Miscellaneous Transport protocols
   Stream Control Transmission Protocol (SCTP)
    – RFC 4960 defines the protocol, with RFC 3286 providing an
      introductory text.
    – Provides reliable, in-sequence transport of message
      streams with congestion control.
                   Feature Name           TCP   UDP   SCTP
                   Connection oriented    Yes   No    Yes
                   Reliable transport     Yes   No    Yes
                   Preserve message
                                          No    Yes   Yes
                   Ordered delivery       Yes   No    Yes
                   Unordered delivery     No    Yes   Yes
                   Data checksum          Yes   Yes   Yes
                   Checksum size (bits)   16    16     32
                   Path MTU               Yes   No    Yes
                   Congestion control     Yes   No    Yes
                   Multiple streams       No    No    Yes
                   Multi-homing support   No    No    Yes
                   Bundling               No    No    Yes     19
Miscellaneous Transport protocols (2)
   Real-time Transport Protocol (RTP) defines a
    standardized packet format for delivering audio and video
    over the Internet. It was developed by the Audio-Video
    Transport Working Group of the IETF and first published in
    1996 as RFC 1889 which was made obsolete in 2003 by
    RFC 3550. Real time transport protocol can also be used in
    conjunction with RSVP protocol which enhances the field
    of multimedia applications.

   Resource ReSerVation Protocol (RSVP), described in
    RFC 2205. Designed to reserve resources across a network
    for an integrated services Internet (QoS).
    "RSVP does not transport application data but is rather an
    Internet control protocol, like ICMP, IGMP, or routing
    RSVP provides receiver-initiated setup of resource
    reservations for multicast or unicast data flows with
    scaling and robustness.                                  20



















Shared By:
jianghongl jianghongl http://