TCP Flowchart - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

TCP Flowchart

Description:

... accepted, and adjusts RCV.WND as appropriate to the current ... The total of RCV.NXT and RCV.WND should not be reduced. Send an acknowledgment of the form: ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 14
Provided by: michael1046
Category:
Tags: tcp | com | flowchart | wnd

less

Transcript and Presenter's Notes

Title: TCP Flowchart


1
TCP Flowchart
2
TCP Header
3
TCP Header FreeBSD (tcp.h)
4
User Defined Options (tcp.h)
5
TCP Initialization
6
TCP Sending - tcp_output.c
  • TCP offers a mechanism for the receiver to govern
    the amount of data sent by windowing
  • Window is returned with every ACK. Indicates the
    allowed number of octets

7
Silly Window Syndrome
  • Tradeoff in determining optimal size of TCP
    segments
  • If segments are too large, might be fragmented at
    the IP level
  • If segments are too small, highly reduced
    performance because sending a small amount of
    data with large header.

8
tcp_output.c
  • Avoid the problem by transmitting only under the
    following conditions
  • We have a full segment
  • This is the last buffer and we are in IDLE
  • We have timed out
  • We have more than 1/2 the maximum send windows
    worth of data
  • We need to retransmit

9
  • tcp_input.c
  • If the state is CLOSED
  • (i.e., TCB does not exist) then
  • all data in the incoming segment is discarded.
  • If the state is LISTEN then
  • 1) first check for an RST
  • 2) second check for an ACK
  • Any acknowledgment is bad if it arrives on a
    connection still in the LISTEN state.
  • (send RST)

10
  • 3) third check for a SYN
  • If the SYN bit is set, check the security.
  • If no match, RST
  • 4) fourth check for other text or control
  • Any other control or text-bearing segment (not
    containing SYN)
  • must have an ACK and thus would be discarded by
    the ACK
  • processing.

11
If the state is SYN-SENT then1) first check the
ACK bit2) second check the RST bit3) third
check the security and precedence4) fourth check
the SYN bitIf our SYN has been ACKed, change
the connectionstate to ESTABLISHED, form an ACK
segment and send it.
12
  • Once in the ESTABLISHED state,
  • it is possible to deliver segment text to user
    RECEIVE buffers. Text from segments can be moved
    into buffers until either the buffer is full or
    the segment is empty.
  • When the TCP takes responsibility for delivering
    the data to the user it must also acknowledge the
    receipt of the data.

13
  • Once the TCP takes responsibility for the data it
    advances RCV.NXT over the data accepted, and
    adjusts RCV.WND as appropriate to the current
    buffer availability. The total of RCV.NXT and
    RCV.WND should not be reduced.
  • Send an acknowledgment of the form
  • ltSEQSND.NXTgtltACKRCV.NXTgtltCTLACKgt
  • This acknowledgment should be piggybacked on a
    segment being transmitted if possible.
Write a Comment
User Comments (0)
About PowerShow.com