TWiki home TWiki > Simulation > INETFramework > INETFrameworkTCPTests TWiki webs:
Main | TWiki | Know | Sandbox
Simulation . { Changes | Index | Search | Go }

Basic test1: Sender --> Receiver over an 800 Kb/s link with 100 ms delay

TCP Sender Pseudo Code

nextSeqNum = initialSeqNumber
sendBase = initialSeqNumber
numDupACKs = 0
while (1) {
   switch (event) {
      case (event == data received from application above)
         create TCP segment with seqNumber = nextSeqNum
         if (timer is not running) {
            start timer
         }
         deliver segment to IP layer
         nextSeqNum = nextSeqNum + length(data)
         break
      case (event == timer expiry)
         retransmit not-yet-acknowledged segment which has smallest sequence number
         restart timer
         break
      case (event == ACK)
         y = ACK field value
         if (y > sendBase) { // receiver acknowledges delivery of fresh data
            sendBase = y
            numDupACKs = 0
            if (nextSeqNum - 1 - sendBase > 0) { // there are currently not-yet-acknowledged segments
               restart timer
            } else {
               cancel timer
            }
         } else { // a dupACK for an already ACKed segment
            numDupAcks++
            restart timer // There is at least one currently not-yet-acknowledged segment
            if (numDupACKs == 3) { // TCP fast retransmit
               resend segment with seqNum = y
            } else if (numDupACKs > 3) {
               // It seems that TAHOE doesn't send any fresh segments. Our RENO behaves like TAHOE -- see below graph.
               // Every dupACK is a sign of correct delivery of a segment. 
               // RENO DOES send -- See Figure 2 of K. Fall and S. Floyd "Simulation based comparisons of Tahoe, Reno, and SACK TCP"
            }
         }
         break
   } // switch
} // while

I think whenever a dupACK arrives, the sender should keep sending packets. Every ACK is a sign of correct delivery of a packet. I am going to add some more info.

Topic INETFrameworkTCPTests . { Edit | Attach | Ref-By | Printable | Diffs | r1.7 | > | r1.6 | > | r1.5 | More }
Revision r1.7 - 07 Dec 2005 - 01:43 GMT - AhmetSekercioglu
Parents: INETFramework
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.