Chapter 5 Transport Layer: UDP, TCP - PowerPoint PPT Presentation

About This Presentation
Title:

Chapter 5 Transport Layer: UDP, TCP

Description:

Minimal connection setup time. Minimal connection state: 'connectionless' ... Most common option: Maximum Segment Size (MSS) exchanged during setup. Source Port ... – PowerPoint PPT presentation

Number of Views:529
Avg rating:3.0/5.0
Slides: 25
Provided by: profri
Category:
Tags: tcp | udp | chapter | layer | setup | transport

less

Transcript and Presenter's Notes

Title: Chapter 5 Transport Layer: UDP, TCP


1
Chapter 5Transport Layer UDP, TCP
  • Professor Rick Han
  • University of Colorado at Boulder
  • rhan_at_cs.colorado.edu

2
Announcements
  • Netstat portion of Homework 3 on Web, due March
    12 (two weeks)
  • Programming Assignment 2 due Friday March 22 by
    midnight
  • Midterm March 14
  • Only through Network Layer, Chapter 4
  • OH changed today 445-545 due to BACTAC talk
  • Next, transport layer

3
Recap of Previous Lecture
  • IP Multicast
  • 1-gtN
  • Link-State Multicast MOSPF
  • Piggyback off of Dijkstras shortest path tree
  • Distance-Vector Multicast DVMRP
  • Reverse-path flooding to all nodes
  • Reverse-path pruning
  • Protocol Independent Multicast PIM
  • For sparse wide-area trees
  • Unicast to Rendezvous Point, RP then multicasts
  • Tree built by explicit joins
  • Internet Group Management Protocol (IGMP)
  • How leaf nodes join a multicast group

4
The Layered Network Stack
Internet Stack
Application Layer
Transport Layer (TCP/UDP)
Network Layer (IP)
Data Link Layer
Physical Layer
5
UDP Unreliable Transport Protocols
  • IP Provides Best-Effort unreliable datagram
    delivery
  • User Datagram Protocol (UDP) provides best-effort
    unreliable datagram delivery
  • Packets may be lost
  • Due to congestion
  • In routers
  • At receiver and/or sender
  • Due to fading
  • Packets may be reordered
  • Packets may be duplicated

6
UDP (2)
  • UDP Features
  • Transport protocol above IP
  • simply passes IP through to the upper
    (application) layers
  • UDP Features
  • Gives apps the option to send packets unreliably
  • Useful for multicast apps
  • Low delay transmission for interactive
    text/audio/video
  • Minimal connection setup time
  • Minimal connection state connectionless
  • No congestion control blast away
  • Build own application-level protocol on top of
    UDP

7
UDP (3)
16
32
Source Port
Dest. Port
UDP length
Checksum
UDP payload
UDP payload data
IP hdr
UDP hdr
  • UDP Header
  • Only 8 bytes! (vs. IP 20 bytes header)
  • Source port for UDP sending process
  • Dest port for UDP receiving process
  • Length in bytes of UDP header payload
  • Checksum over UDP header payload

8
UDP (4)
  • UDP Checksum calculation
  • UDP creates a pseudo-header containing IP
    header info
  • Doublechecks that the packet has the correct IP
    address and UDP port

16
32
32-bit IP source address
32-bit IP destination address
Pseudo-Header
Protocol
UDP length
0
Source Port
Dest. Port
UDP Header
UDP length
Checksum
  • Discarded if checksum fails

UDP payload data
9
UDP Multiplexing/Demultiplexing
Host 1
Host 2
UDP Port 5100
UDP Port 5200
UDP Port 6001
UDP Port 433
  • IP layer inspects Protocol field UDP
  • Sends to buffer of waiting UDP process with
    matching port

IP
IP
Eth. MAC
Eth MAC
Phys.
Phys.
10
TCP Transmission Control Protocol Reliable
Delivery
  • TCP provides
  • Reliable delivery of packets, AND
  • Stream or in-order delivery
  • Also, full-duplex service
  • Why TCP, when we can build reliable protocols on
    top of UDP?
  • Many applications require reliable in-order
    delivery of packets
  • Web pages, email, file transfer,
  • Why should each application reinvent the wheel?
  • Can concentrate expert knowledge into building
    one reliable protocol provided to every
    application

11
TCP (2)
  • TCP is a true transport protocol, above IP
  • TCP Features
  • Flow control
  • Congestion control
  • Connection setup
  • Connection state machine
  • Reliability, at the cost of some delay
  • Achieves reliability by
  • Retransmission of a segment after a timeout or
    duplicate ACK
  • Sliding window with sequence s

TCP payload
IP hdr
TCP hdr
12
TCP (3)
  • TCP Header
  • 20 bytes
  • Source port for TCP sending process
  • Dest port for TCP receiving process
  • 32-bit Sequence (host is sender)
  • 32-bit ACK (host is receiver ACKing data sent
    by other endpoint)

16
32
Source Port
Dest. Port
32-bit Sequence
32-bit Acknowledgement
Window Size
Flags
Checksum
Urgent Pointer
13
TCP (3)
  • TCP Header
  • Flags
  • SYN synchronize sequence s to initiate
    connection
  • FIN sender is finished sending data
  • RST reset the connection,
  • More

16
32
Source Port
Dest. Port
32-bit Sequence
32-bit Acknowledgement
Window Size
Flags
Checksum
Urgent Pointer
14
TCP (4)
  • TCP Header
  • Flow control window size Receiver advertises how
    many bytes it is willing to accept into its
    buffer
  • Checksum computed over TCP header payload
  • Similar to UDP, prepends an IP Pseudo-Header
  • Urgent Pointer points to where there is emergency
    data in payload

16
32
Source Port
Dest. Port
32-bit Sequence
32-bit Acknowledgement
Window Size
Flags
Checksum
Urgent Pointer
15
TCP (5)
  • TCP Header
  • Variable-sized (not just 20 bytes), can have
    Options after the Urgent Pointer field
  • Signalled in Flags field
  • Most common option Maximum Segment Size (MSS)
    exchanged during setup

16
32
Source Port
Dest. Port
32-bit Sequence
32-bit Acknowledgement
Window Size
Flags
Checksum
Urgent Pointer
16
High-Level TCP Characteristics
  • Protocol implemented entirely at the ends
  • Fate sharing
  • Protocol has evolved over time and will continue
    to do so
  • Nearly impossible to change the header
  • Uses options to add information to the header
  • Change processing at endpoints
  • Backward compatibility is what makes it TCP

17
Connection Setup
  • A and B must agree on initial sequence number
    selection
  • Use 3-way handshake

A
B
SYN Seq A
SYNACK-A Seq B
ACK-B
18
Connection Setup (2)
  • Why a three-way handshake?
  • Three-way handshake is necessary and sufficient
    for unambiguous setup/teardown even under
    conditions of
  • Loss
  • Duplication
  • Delay

19
Two-Way Handshake
Handshake pictures courtesy of UMass Amherst
20
Two-Way Handshake Old Accepts
21
Two-Way Handshake Duplicate Requests
22
Two-Way Handshake Failure
23
Two-Way Handshake W/ Timers
24
3-way Handshake Unique IDs
Server (passive)
Client (active)
  • Both sender and receiver choose unique IDs to
    label their (x,y) connection
  • x chosen by Sender, y by receiver
  • Prevents Failure scenario in two-way handshakes
    w/o timers
Write a Comment
User Comments (0)
About PowerShow.com