User Datagram Protocol UDP Transmission Control Protocol TCP - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

User Datagram Protocol UDP Transmission Control Protocol TCP

Description:

Before sending a UDP packet, we do not need to set up a connection first ... Resequencing of out-of-order data; discarding of duplicate data ... – PowerPoint PPT presentation

Number of Views:145
Avg rating:3.0/5.0
Slides: 20
Provided by: alpha5Cs
Category:

less

Transcript and Presenter's Notes

Title: User Datagram Protocol UDP Transmission Control Protocol TCP


1
User Datagram Protocol (UDP)Transmission Control
Protocol (TCP)
2
User Datagram Protocol (UDP)
  • Connectionless
  • Before sending a UDP packet, we do not need to
    set up a connection first
  • No error, flow, congestion control
  • No packet resequencing
  • Multiplexing feature via protocol ports
  • UDP checksum mechanism violates strict protocol
    layering concept

3
UDP Header
Fig. 11.2 p.144
  • UDP length the length (in bytes) of the UDP
    segment including header. The minimum value is 8
    bytes.
  • UDP checksum (optional) checksum of the UDP
    pseudo header, UDP header, and the UDP data

4
Fields for UDP checksum computation
Fig. 11.3 p.145
  • UDP pseudo header
  • The checksum algorithm calculates checksum over
    even number of bytes. A pad byte of 0 is appended
    is necessary.

5
Transmission Control Protocol (TCP)
  • Connection-oriented
  • Before sending a TCP packet, we need to set up a
    TCP connection first
  • A TCP connection is a full-duplex logical
    communication channel
  • The sending and receiving nodes need to be
    configured
  • However, the routers on the connection path need
    not be configured
  • Provide a reliable, in-sequence byte-stream
    delivery service
  • With error, flow, and congestion control
  • Can resequence arrived packets

6
TCP Reliability
  • Reliability is provided by
  • Reliable connection startup Data on old
    connection does not confuse new connections
  • Graceful connection shutdown Data sent before
    closing a connection is not lost
  • Data segmented for transmission and acknowledged
    by destination Timeout Retransmission provided
    if data unacknowledged
  • Checksum provided to catch errors
  • Resequencing of out-of-order data discarding of
    duplicate data
  • Window flow control gt sender cannot overrun
    receiver buffers

7
TCP Header Format
Fig. 17.2 p.225
8
TCP Header
  • Source Port (16 bits)
  • Destination Port (16 bits)
  • Sequence Number (32 bits) sequence number of the
    first byte in the segment
  • If SYN bit is set, this is the initial
    sequence number (ISN) and the first data byte is
    ISN1
  • Ack number (32 bits) sequence number of the next
    byte expected
  • Header length (4 bits) in unit of 4 bytes
  • (to handle the variable option field)
  • Reserved (6 bits)

9
TCP Header (continued)
  • Control (6 bits)
  • URG the urgent field is valid if this is set
  • ACK the acknowledgement number filed is valid if
    this is set
  • PSH tells the receiver to pass this data to the
    application as soon as possible (Flush)
  • RST tells the receiver to reset the connection
    (Reset)
  • SYN synchronize sequence number to initiate a
    connection
  • FIN tell the receiver there is no more data left
    (Final)

10
TCP Header (continued)
  • Window size (16 bits) of bytes the receiver is
    willing to accept
  • Checksum (16 bits) covers the segment plus a
    pseudo header (similar to UDP)
  • Includes the following fields from IP header
    source and destination address, protocol, segment
    length
  • Urgent pointer (16 bits) Points to the byte
    following urgent data
  • Lets receiver know how much data it should
    deliver right away

11
Connection Establishment
  • Three way handshake
  • 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

12
Connection Termination
13
Why applications use UDP?
  • No connection establishment
  • No connection state
  • Small packet header overhead
  • Unregulated send rate

14
Why applications use UDP? (continued)
  • No connection establishment
  • TCP uses a three-way handshake before it starts
    to transfer data
  • UDP just blasts away without any formal
    preliminaries.
  • Thus UDP does not introduce any delay to
    establish a connection

15
Why applications use UDP? (continued)
  • No connection state
  • TCP maintains connection state in the end systems
  • Connection state includes
  • Receive and send buffers
  • Congestion-control parameters
  • Sequence and acknowledgment number parameters
  • This state information is needed to implement
    TCP's reliable data transfer service and to
    provide congestion control
  • UDP does not maintain connection state and does
    not track any of these parameters
  • A server can typically support many more active
    clients when the application runs over UDP rather
    than TCP

16
Why applications use UDP? (continued)
  • Small packet header overhead
  • The TCP segment has 20 bytes of header overhead
    in every segment
  • UDP only has 8 bytes of overhead

UDP
TCP
17
Why applications use UDP? (continued)
  • Unregulated send rate
  • TCP congestion control mechanism
  • one or more links between sender and receiver
    become congested gt reduce send rate
  • UDP send rate is only constrained by
  • the rate at which the application generates data
  • the capabilities of the source (CPU, clock rate,
    and so on)
  • the access bandwidth to the Internet
  • UDP receiver does not necessarily receive all the
    data
  • network congested gt packet lost due to router
    buffer overflow
  • UDP Receive rate can be limited if network
    congested

18
What applications use TCP?
  • Applications that need the reliable data transfer
    service of TCP
  • Examples e-mail
  • remote terminal access
  • the Web
  • file transfer
  • and etc.

19
What applications use UDP?
  • UDP is commonly used with multimedia
    applications, such as
  • Internet phone
  • real-time video conferencing
  • streaming of stored audio and video
  • All of these applications can tolerate a small
    fraction of packet loss
  • UDP is used to carry network management (SNMP)
    messages
  • UDP is preferred to TCP in this case
  • Network management applications must often run
    when the network is in a stressed (congested)
    state when reliable, congestion-controlled
    data transfer is difficult to achieve
Write a Comment
User Comments (0)
About PowerShow.com