Client Socket Unit Test Procedures - TCP Project

EventHelix.com/EventStudio 2.0
Generated on 04-Jul-03 14:31

Code Reviewed By:

Unit Tested By:

TCP Basic Handling

Legs Taken:

Test Procedures:

NumActionResultStatus
1.Create object Client_Socket (Created by Client_App)
  1. Check if object Client_Socket has been initialized correctly
  2. Client_Socket should change state to "Closed"
  3. Client_Socket should take action "seq_num = 0"

CR:

UT:

2.Send Active_Open to Client_Socket (Message from Client_App)
  1. Active_Open message handler should be called
  2. Client_Socket should send SYN to Network with fields src = Client_Port, dst = Server_Port, seq_num = 0
  3. Client_Socket should change state to "SYN Sent"

CR:

UT:

3.Send SYN_ACK to Client_Socket (Message from Network) with parameters src = Server_Port, dst = Client_Port, seq_num = 100, ack_num = 1, window = 65535
  1. SYN_ACK message handler should be called
  2. Client_Socket should send ACK to Network with fields src = Client_Port, dst = Server_Port, ack_num = 101, window = 5000
  3. Client_Socket should change state to "Established"

CR:

UT:

4.Send Data to Client_Socket (Message from Client_App) with parameters size = 1024
  1. Data message handler should be called
  2. Client_Socket should take action "Split data into TCP segments"
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 1, len = 512
  4. Client_Socket should send TCP_Segment to Network with fields seq_num = 513, len = 512

CR:

UT:

5.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 1025
  1. ACK message handler should be called

CR:

UT:

6.Send TCP_Segment to Client_Socket (Message from Network) with parameters seq_num = 1, len = 512
  1. TCP_Segment message handler should be called

CR:

UT:

7.Send TCP_Segment to Client_Socket (Message from Network) with parameters seq_num = 613, len = 188
  1. TCP_Segment message handler should be called
  2. Client_Socket should take action "Assemble TCP Segments"
  3. Client_Socket should send Data to Client_App with fields size = 700
  4. Client_Socket should send ACK to Network with fields ack_num = 701

CR:

UT:

8.Send Close to Client_Socket (Message from Client_App)
  1. Close message handler should be called
  2. Client_Socket should send FIN to Network
  3. Client_Socket should change state to "FIN Wait 1"

CR:

UT:

9.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should change state to "FIN Wait 2"

CR:

UT:

10.Send FIN to Client_Socket (Message from Network)
  1. FIN message handler should be called
  2. Client_Socket should send ACK to Network
  3. Client_Socket should start timer Close_Timer
  4. Client_Socket should change state to "Time Wait"

CR:

UT:

11.Send timeout Close_Timer to Client_Socket
  1. Close_Timer timeout handler should be called
  2. Client_Socket should change state to "Closed"

CR:

UT:

12.Delete object Client_Socket (Deleted by Client_App)
  1. Verify that object Client_Socket has released all resources

CR:

UT:

TCP Slow Start

Legs Taken:

Test Procedures:

NumActionResultStatus
1.Create object Client_Socket (Created by Client_App)
  1. Check if object Client_Socket has been initialized correctly
  2. Client_Socket should change state to "Closed"
  3. Client_Socket should take action "seq_num = 0"

CR:

UT:

2.Send Active_Open to Client_Socket (Message from Client_App)
  1. Active_Open message handler should be called
  2. Client_Socket should send SYN to Network with fields src = Client_Port, dst = Server_Port, seq_num = 0
  3. Client_Socket should change state to "SYN Sent"

CR:

UT:

3.Send SYN_ACK to Client_Socket (Message from Network) with parameters src = Server_Port, dst = Client_Port, seq_num = 100, ack_num = 1, window = 65535
  1. SYN_ACK message handler should be called
  2. Client_Socket should send ACK to Network with fields src = Client_Port, dst = Server_Port, ack_num = 101, window = 5000
  3. Client_Socket should change state to "Established"
  4. Client_Socket should take action "cwnd = 512 (1 segment)"
  5. Client_Socket should take action "ssthresh = 65535"
  6. Client_Socket should change state to "Slow Start"

CR:

UT:

4.Send Data to Client_Socket (Message from Client_App) with parameters size = _5120
  1. Data message handler should be called
  2. Client_Socket should send TCP_Segment to Network with fields seq_num = 1, len = 512

CR:

UT:

5.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 513
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 1024 (2 segments)"
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 513, len = 512
  4. Client_Socket should send TCP_Segment to Network with fields seq_num = 1025, len = 512

CR:

UT:

6.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 1537
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 1536 (3 segments)"
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 1537, len = 512
  4. Client_Socket should send TCP_Segment to Network with fields seq_num = 2049, len = 512
  5. Client_Socket should send TCP_Segment to Network with fields seq_num = 2561, len = 512

CR:

UT:

7.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 2561
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 2048 (4 segments)"

CR:

UT:

8.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 3073
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 2560 (5 segments)"
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 3073, len = 512
  4. Client_Socket should send TCP_Segment to Network with fields seq_num = 3585, len = 512
  5. Client_Socket should send TCP_Segment to Network with fields seq_num = 4097, len = 512
  6. Client_Socket should send TCP_Segment to Network with fields seq_num = 4609, len = 512
  7. Client_Socket should send TCP_Segment to Network with fields seq_num = 5121, len = 512

CR:

UT:

9.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 4097
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 3072 (6 segments)"

CR:

UT:

10.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 5121
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 3584 (7 segments)"

CR:

UT:

11.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 5633
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 4096 (8 segments)"
  3. Client_Socket should send TCP_Segment to Network
  4. Client_Socket should send TCP_Segment to Network
  5. Client_Socket should send TCP_Segment to Network
  6. Client_Socket should send TCP_Segment to Network
  7. Client_Socket should send TCP_Segment to Network
  8. Client_Socket should send TCP_Segment to Network
  9. Client_Socket should send TCP_Segment to Network
  10. Client_Socket should send TCP_Segment to Network

CR:

UT:

12.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 4608 (9 segments)"

CR:

UT:

13.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 5120 (10 segments)"

CR:

UT:

14.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 5630 (11 segments)"

CR:

UT:

15.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 6144 (12 segments)"
  3. Client_Socket should change state to "Congestion Avoidance"

CR:

UT:

16.Send Close to Client_Socket (Message from Client_App)
  1. Close message handler should be called
  2. Client_Socket should send FIN to Network
  3. Client_Socket should change state to "FIN Wait 1"

CR:

UT:

17.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should change state to "FIN Wait 2"

CR:

UT:

18.Send FIN to Client_Socket (Message from Network)
  1. FIN message handler should be called
  2. Client_Socket should send ACK to Network
  3. Client_Socket should start timer Close_Timer
  4. Client_Socket should change state to "Time Wait"

CR:

UT:

19.Send timeout Close_Timer to Client_Socket
  1. Close_Timer timeout handler should be called
  2. Client_Socket should change state to "Closed"

CR:

UT:

20.Delete object Client_Socket (Deleted by Client_App)
  1. Verify that object Client_Socket has released all resources

CR:

UT:

TCP Congestion Avoidance

Legs Taken:

Test Procedures:

NumActionResultStatus
1.Create object Client_Socket (Created by Client_App)
  1. Check if object Client_Socket has been initialized correctly
  2. Client_Socket should change state to "Closed"
  3. Client_Socket should take action "seq_num = 0"

CR:

UT:

2.Send Active_Open to Client_Socket (Message from Client_App)
  1. Active_Open message handler should be called
  2. Client_Socket should send SYN to Network with fields src = Client_Port, dst = Server_Port, seq_num = 0
  3. Client_Socket should change state to "SYN Sent"

CR:

UT:

3.Send SYN_ACK to Client_Socket (Message from Network) with parameters src = Server_Port, dst = Client_Port, seq_num = 100, ack_num = 1, window = 65535
  1. SYN_ACK message handler should be called
  2. Client_Socket should send ACK to Network with fields src = Client_Port, dst = Server_Port, ack_num = 101, window = 5000
  3. Client_Socket should change state to "Established"
  4. Client_Socket should take action "cwnd = 512 bytes (1 segment)"
  5. Client_Socket should take action "ssthresh = 65535 bytes"
  6. Client_Socket should change state to "Slow Start"

CR:

UT:

4.Send Data to Client_Socket (Message from Client_App)
  1. Data message handler should be called
  2. Client_Socket should send TCP_Segment to Network with fields seq_num = 100000, len = 512
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 100512, len = 512

CR:

UT:

5.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 101024, window = 80000
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 64947 + 512 = 65459"
  3. Client_Socket should change state to "Congestion Avoidance"

CR:

UT:

6.Send Data to Client_Socket (Message from Client_App)
  1. Data message handler should be called
  2. Client_Socket should send TCP_Segment to Network with fields seq_num = 101024, len = 512
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 101536, len = 512

CR:

UT:

7.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 102048, window = 80000
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 65459 + [(512 * 512) / 65459] = 65459 + 4 = 65463"

CR:

UT:

8.Send Data to Client_Socket (Message from Client_App)
  1. Data message handler should be called
  2. Client_Socket should send TCP_Segment to Network with fields seq_num = 102048, len = 512
  3. Client_Socket should start timer AckTimer

CR:

UT:

9.Send timeout AckTimer to Client_Socket
  1. AckTimer timeout handler should be called
  2. Client_Socket should take action "ssthresh = 65463/2 = 32731"
  3. Client_Socket should take action "cwnd = 512 bytes (1 segment)"
  4. Client_Socket should change state to "Slow Start"
  5. Client_Socket should send TCP_Segment to Network with fields seq_num = 102048, len = 512

CR:

UT:

10.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 102560
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 512 + 512 = 1024"

CR:

UT:

11.Send Data to Client_Socket (Message from Client_App) with parameters size = 3072
  1. Data message handler should be called
  2. Client_Socket should send TCP_Segment to Network with fields size = 512
  3. Client_Socket should send TCP_Segment to Network with fields size = 512
  4. Client_Socket should send TCP_Segment to Network with fields size = 512
  5. Client_Socket should send TCP_Segment to Network with fields size = 512
  6. Client_Socket should send TCP_Segment to Network with fields size = 512
  7. Client_Socket should send TCP_Segment to Network with fields size = 512

CR:

UT:

12.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 32730 + 512 = 33242"
  3. Client_Socket should change state to "Congestion Avoidance"

CR:

UT:

13.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 33242 + (512*512)/33242 = 33242 + 8 = 33250"

CR:

UT:

14.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = 33250 + (512*512)/33250 = 33250 + 8 = 33258"

CR:

UT:

15.Send Close to Client_Socket (Message from Client_App)
  1. Close message handler should be called
  2. Client_Socket should send FIN to Network
  3. Client_Socket should change state to "FIN Wait 1"

CR:

UT:

16.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should change state to "FIN Wait 2"

CR:

UT:

17.Send FIN to Client_Socket (Message from Network)
  1. FIN message handler should be called
  2. Client_Socket should send ACK to Network
  3. Client_Socket should start timer Close_Timer
  4. Client_Socket should change state to "Time Wait"

CR:

UT:

18.Send timeout Close_Timer to Client_Socket
  1. Close_Timer timeout handler should be called
  2. Client_Socket should change state to "Closed"

CR:

UT:

19.Delete object Client_Socket (Deleted by Client_App)
  1. Verify that object Client_Socket has released all resources

CR:

UT:

TCP Fast Transmit and Recovery

Legs Taken:

Test Procedures:

NumActionResultStatus
1.Create object Client_Socket (Created by Client_App)
  1. Check if object Client_Socket has been initialized correctly
  2. Client_Socket should change state to "Closed"
  3. Client_Socket should take action "seq_num = 0"

CR:

UT:

2.Send Active_Open to Client_Socket (Message from Client_App)
  1. Active_Open message handler should be called
  2. Client_Socket should send SYN to Network with fields src = Client_Port, dst = Server_Port, seq_num = 0
  3. Client_Socket should change state to "SYN Sent"

CR:

UT:

3.Send SYN_ACK to Client_Socket (Message from Network) with parameters src = Server_Port, dst = Client_Port, seq_num = 100, ack_num = 1, window = 65535
  1. SYN_ACK message handler should be called
  2. Client_Socket should send ACK to Network with fields src = Client_Port, dst = Server_Port, ack_num = 101, window = 5000
  3. Client_Socket should change state to "Established"
  4. Client_Socket should take action "cwnd = 70000"

CR:

UT:

4.Send Data to Client_Socket (Message from Client_App) with parameters size = 4096
  1. Data message handler should be called
  2. Client_Socket should take action "Segment data into 8 TCP segments"
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 100000
  4. Client_Socket should send TCP_Segment to Network with fields seq_num = 100512
  5. Client_Socket should send TCP_Segment to Network with fields seq_num = 101024
  6. Client_Socket should send TCP_Segment to Network with fields seq_num = 101536
  7. Client_Socket should send TCP_Segment to Network with fields seq_num = 102048
  8. Client_Socket should send TCP_Segment to Network with fields seq_num = 102560
  9. Client_Socket should send TCP_Segment to Network with fields seq_num = 103072
  10. Client_Socket should send TCP_Segment to Network with fields seq_num = 103584

CR:

UT:

5.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 100512
  1. ACK message handler should be called

CR:

UT:

6.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 100512
  1. ACK message handler should be called
  2. Client_Socket should change state to "Fast Retransmit"

CR:

UT:

7.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 100512
  1. ACK message handler should be called

CR:

UT:

8.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 100512
  1. ACK message handler should be called
  2. Client_Socket should take action "ssthresh = cwnd/2 = 70000/2 = 35000"
  3. Client_Socket should send TCP_Segment to Network with fields seq_num = 100512
  4. Client_Socket should change state to "Fast Recovery"
  5. Client_Socket should take action "cwnd = ssthresh + 3 segments = 35000 + 3*512 = 36536"

CR:

UT:

9.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 100512
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = cwnd + 1 segment = 37048"

CR:

UT:

10.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 100512
  1. ACK message handler should be called
  2. Client_Socket should take action "cwnd = cwnd + 1 segment = 37560"

CR:

UT:

11.Send ACK to Client_Socket (Message from Network) with parameters ack_num = 104096
  1. ACK message handler should be called
  2. Client_Socket should change state to "Congestion Avoidance"
  3. Client_Socket should take action "cwnd = ssthresh = 35000"

CR:

UT:

12.Send Close to Client_Socket (Message from Client_App)
  1. Close message handler should be called
  2. Client_Socket should send FIN to Network
  3. Client_Socket should change state to "FIN Wait 1"

CR:

UT:

13.Send ACK to Client_Socket (Message from Network)
  1. ACK message handler should be called
  2. Client_Socket should change state to "FIN Wait 2"

CR:

UT:

14.Send FIN to Client_Socket (Message from Network)
  1. FIN message handler should be called
  2. Client_Socket should send ACK to Network
  3. Client_Socket should start timer Close_Timer
  4. Client_Socket should change state to "Time Wait"

CR:

UT:

15.Send timeout Close_Timer to Client_Socket
  1. Close_Timer timeout handler should be called
  2. Client_Socket should change state to "Closed"

CR:

UT:

16.Delete object Client_Socket (Deleted by Client_App)
  1. Verify that object Client_Socket has released all resources

CR:

UT: