CS 6250 Class 20 10'29'2002 - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

CS 6250 Class 20 10'29'2002

Description:

Flags: SYN, FIN, RESET, PUSH, URG, ACK. Checksum: computed as in UDP ... After all pending data have been sent and ACKed, send last segment with FIN bit set ... – PowerPoint PPT presentation

Number of Views:11
Avg rating:3.0/5.0
Slides: 12
Provided by: ccGa
Category:
Tags: class | fin

less

Transcript and Presenter's Notes

Title: CS 6250 Class 20 10'29'2002


1
CS 6250 Class 20 10.29.2002
  • End-to-end protocols
  • (a.k.a. transport or layer-4 protocols)
  • UDP,
  • and introduction to TCP

2
News
  • Project progress reviews Friday, Nov-8
  • TAs will schedule for appointment with each group
  • Work on problems 19, 20, 24, 26 of chapter 4
  • Nov 5 Jinliang will go through some chapter 4
    problems
  • Nov 7 midterm (in class)
  • Dont forget your calculators
  • Nov 12 Amogh will go through midterm solutions,
    and cover part of chapter 6

3
Transport protocols
  • Transform host-to-host communication, offered by
    network layer, to process-to-process
    communication
  • Deliver important services to application layer
  • Guaranteed message delivery
  • In-order delivery
  • Detect/eliminate message replication
  • Support arbitrarily large messages
  • Support synchronization between sender receiver
  • Allow receiver to apply flow control to sender
  • Support multiple application processes on each
    host
  • Other services? (congestion control,
    quality-of-service, )
  • Overview
  • UDP unreliable message delivery protocol
  • TCP reliable stream transfer protocol

4
User Datagram Protocol (UDP)
  • Connectionless, unreliable, message delivery
  • But, optional checksum provides limited error
    detection
  • Computed over UDP header, message, and IP
    pseudoheader
  • Pseudoheader IP src dst addresses, protocol ,
    and UDP length
  • If source does not want to compute checksum, it
    sets it to zero
  • Allows process demultiplexing using ports
  • 16 bits per port 65536 possible channels per
    host
  • No flow control sender can overrun receivers
    buffers

5
Application demultiplexing with UDP
Application
Application
Application
process
process
process
  • Well-known ports
  • See /etc/services
  • How does the sender learn the receivers port?
  • UDP preserves message boundaries

Ports
Queues
Packets
demultiplexed
UDP
Packets arrive
6
Transmission Control Protocol (TCP)
  • Reliable, connection-oriented, byte-stream
    delivery service
  • Full duplex connection
  • Supports flow control (and congestion control to
    be covered later)
  • Supports application layer demultiplexing using
    ports
  • Segments vs application-layer writes when does
    TCP transmit a segment?
  • Maximum Segment Size (MSS), Push operation,
    Send-Timer

Application process
Application process
W
rite
Read


bytes
bytes
TCP
TCP
Send buffer
Receive buffer

Segment
Segment
Segment
T
ransmit segments
7
More on TCP
  • A TCP connection provides full-duplex
    (simultaneous bidirectional) transfer
    capabilities
  • Sender and receiver semantics are related to
    unidirectional TCP transfer
  • Sliding window for flow control reliability
    (see next class)
  • Side note Maximum Segment Lifetime (MSL)
  • maximum time an IP packet can live in the network
  • wandering duplicates and the problem of
    previous connection incarnations

Data
(SequenceNum)
Sender
Receiver
Acknowledgment
AdvertisedWindow
8
TCP segment format
  • Ports as in UDP
  • SeqNum, AckNum, AdvWindow used in sliding-window
    algorithm for reliable, in-order, unique
    delivery, and for flow-control
  • Flags SYN, FIN, RESET, PUSH, URG, ACK
  • Checksum computed as in UDP (but required)
  • HdrLen in 32-bit words TCP header may include
    options
  • TCP options Maximum Segment Size (MSS),
    timestamp, window scale

9
Connection establishment
  • Caller (active open) and callee (passive open)
  • 3-way handshake algorithm
  • Why dont we set the initial sequence numbers to
    zero?
  • What if any of the 3WHS messages get
    lost/delayed?
  • What if the server wants to deny the connection?
  • Map the Unix system calls socket(), bind(),
    connect(), listen(), accept() to the following
    diagram

Active participant
Passive participant
(client)
(server)
SYN, SequenceNum
x
y
,
1

SYN ACK, SequenceNum
x
Acknowledgment
ACK, Acknowledgment
y

1
10
Connection termination
  • Graceful close independent termination of each
    direction of the connection
  • Initiated by close() system call
  • After all pending data have been sent and ACKed,
    send last segment with FIN bit set
  • That direction of the connection is closed 2MSL
    seconds (2120secs) after the remote end ACKs the
    FIN message
  • Why do we need to wait before closing the
    connection?
  • Why to wait for 2 MSL instead of 1MSL?
  • Abrupt connection termination
  • Initiated by abort(), or by error conditions
  • Send segment with RST bit set, discarding any
    pending data

11
TCP connection establishment tear-down
state-transition diagram
CLOSED
Active open
/SYN
Passive open
Close
Close
LISTEN
Send/
SYN
SYN/SYN ACK
SYN/SYN ACK
SYN_RCVD
SYN_SENT
SYN ACK/ACK
ACK
ESTABLISHED
Close
/FIN
FIN/ACK
Close
/FIN
FIN_WAIT_1
CLOSE_WAIT
FIN/ACK
ACK
Close
/FIN
ACK FIN/ACK
FIN_WAIT_2
LAST_ACK
CLOSING
Timeout after two
ACK
ACK
segment lifetimes
FIN/ACK
TIME_WAIT
CLOSED
Write a Comment
User Comments (0)
About PowerShow.com