Subject: Need a clarification on use of ACK Flag.....

From: "A. Joseph Dupre III" <[email-masked]>
Date: Wed, 21 Jul 1999 10:27:57 -0400

Hello,

I could use some help interpretting the below section of RFC 793:

From RFC 793: (page 16)
=======================
   Acknowledgment Number:  32 bits
  
     If the ACK control bit is set this field contains the value of the
     next sequence number the sender of the segment is expecting to
     receive.  Once a connection is established this is always sent.

One vendor who we are trying to interoperate with has interpreted the
above lines to mean that an ACK control bit MUST always be SET on
every packet that is sent by our TCP after reaching ESTABLISHED state.
This means setting the ACK flag on data segments, FIN, and RST.

However, when looking at the state machine below from RFC 793, it does not
show the ACK Flag being set on FIN packets for example.  When looking
at Steven's TCP/IP Illustrated #1, one transition from FIN_WAIT_1 to 
TIME_WAIT has an explicit FIN,ACK as the receive event that causes
that transition.

Any help people can provide me in understanding the appropriate use of
the ACK control flag would be greatly appreciated.  Particularly if
there is a section of the RFC 793 that clears this up or some other
RFC such as 1122, pointing me at that would be great.

-------------------------------------------------------------------------------

September 1981                                                          
                                           Transmission Control Protocol
                                                Functional Specification

                                    
                              +---------+ ---------\      active OPEN  
                              |  CLOSED |            \    -----------  
                              +---------+<---------\   \   create TCB  
                                |     ^              \   \  snd SYN    
                   passive OPEN |     |   CLOSE        \   \           
                   ------------ |     | ----------       \   \         
                    create TCB  |     | delete TCB         \   \       
                                V     |                      \   \     
                              +---------+            CLOSE    |    \   
                              |  LISTEN |          ---------- |     |  
                              +---------+          delete TCB |     |  
                   rcv SYN      |     |     SEND              |     |  
                  -----------   |     |    -------            |     V  
 +---------+      snd SYN,ACK  /       \   snd SYN          +---------+
 |         |<-----------------           ------------------>|         |
 |   SYN   |                    rcv SYN                     |   SYN   |
 |   RCVD  |<-----------------------------------------------|   SENT  |
 |         |                    snd ACK                     |         |
 |         |------------------           -------------------|         |
 +---------+   rcv ACK of SYN  \       /  rcv SYN,ACK       +---------+
   |           --------------   |     |   -----------                  
   |                  x         |     |     snd ACK                    
   |                            V     V                                
   |  CLOSE                   +---------+                              
   | -------                  |  ESTAB  |                              
   | snd FIN                  +---------+                              
   |                   CLOSE    |     |    rcv FIN                     
   V                  -------   |     |    -------                     
 +---------+          snd FIN  /       \   snd ACK          +---------+
 |  FIN    |<-----------------           ------------------>|  CLOSE  |
 | WAIT-1  |------------------                              |   WAIT  |
 +---------+          rcv FIN  \                            +---------+
   | rcv ACK of FIN   -------   |                            CLOSE  |  
   | --------------   snd ACK   |                           ------- |  
   V        x                   V                           snd FIN V  
 +---------+                  +---------+                   +---------+
 |FINWAIT-2|                  | CLOSING |                   | LAST-ACK|
 +---------+                  +---------+                   +---------+
   |                rcv ACK of FIN |                 rcv ACK of FIN |  
   |  rcv FIN       -------------- |    Timeout=2MSL -------------- |  
   |  -------              x       V    ------------        x       V  
    \ snd ACK                 +---------+delete TCB         +---------+
     ------------------------>|TIME WAIT|------------------>| CLOSED  |
                              +---------+                   +---------+
 
                      TCP Connection State Diagram
                               Figure 6.

                                                               [Page 23]

...............................................................................
 A. Joseph Dupre III   : Midnight Networks 205B Lowell St. Wilmington, MA 01887
 Software Engineer     : Vox 781/890-1001 
 [email-masked]      : Fax 781/890-0028 

                   *** Midnight Networks is hiring! ***
   *** Come check out our job opportunities- www.midnight.com/jobs.html ***