Title: Modelling and Analysis of TCP
1Modelling and Analysis of TCPs Connection
Management Procedures
- Jonathan Billington and Bing Han
- Computer Systems Engineering Centre
- University of South Australia
2Motivation
- Finding design flaws of complex protocols such as
TCP is an important and difficult research
problem. - Design flaws
- Specification rather than implementation
- Including deadlocks, livelocks, sequence
inconsistency, dead code, and so on - Important problem
- TCP provides a reliable data transfer service to
many Internet applications. - TCP is used as the basis of new protocols, e.g.
DCCP - Difficult problem
- TCP is a complex protocol.
- The operation of TCP was originally specified in
RFC 793 using narrative descriptions, message
sequence diagrams, a FSM diagram and pseudo code.
3Outline
- Research Scope
- TCP Connection Management
- Desired properties
- Termination
- Absence of deadlocks
- Approach
- Modelling approach
- Analysis approach
- Analysis Results
4TCP and its Environment
Two peer TCP entities communicate over the
Internet Protocol (IP) as well as interacting
with their application processes.
5TCP Segment Format
6Normal Connection Establishment
7Simultaneous Connection Establishment
8Normal Connection Release (Graceful Close)
9Simultaneous Connection Release
10TCP State Variables
- SND_NXT (send next)
- Stores the sequence number of the next segment to
be sent. - RCV_NXT (receive next)
- Stores the sequence number of the next segment to
be received. - SND_UNA (send unacknowledged)
- Records the sequence number of the earliest
segment that has been sent but has yet to be
acknowledged. - ISS (initial send sequence number)
- The first sequence number sent in a connection.
11Our Approach
Model TCP Connection Management using CPNs
Define desired properties using ML
Configure the CPN model
Generate the state spaces
Automatically check the terminal states using ML
12Top Level Page TCP Overview
13 Level 1
Level 2
Level 3
Level 4
Model Statistics Hierarchical Levels 4 CPN
Pages 19 Places 6 Substitution transitions
19 Executable transitions 97
1. Overview
2. Event Processing
3. User Commands Segment Processing
Retransmissions
4. Command Pages State Pages
14Desired Properties (Termination)
Successful Establishment
Proper Establishment
Successful Abort
Successful Release
15Desired Terminal State for Establishment
Successful Establishment
Proper Establishment
16Acceptable Terminal State for Establishment
17CPN Model Configurations Some Examples
Configuration Initial Marking
A C_S Opening
D C_S Opening Closing
E Sim. Opening Closing
18Analysis Results of Model 1 No Loss, No Retrans
Config Time V A TMs DLs
A B C D E F G H I J K 0 0 0 0 3 0 1 1 0 0 1 11 42 57 225 2850 51 355 356 79 73 742 12 60 92 455 8260 91 870 792 141 129 1896 2 2 1 3 6 3 4 13 2 3 4 0 0 0 1 2 0 0 0 0 0 0
- Reordering channel with no loss
- No retransmission
- Run on a machine with 2.6GHz Pentium CPU and 1GB
RAM.
19Initial Marking
1 User_1 1A_Open1Close User_2
1P_Open1Close H1_H2 empty H2_H1 empty TCB
1 1CLOSED,RCV_NXT0,SND_NXT0,SND_UNA0,ISS10
,cls TCB 2 1CLOSED,RCV_NXT0,SND_NXT0,SND_U
NA0,ISS20,cls
20Dead Marking
95 User_1 empty User_2 empty H1_H2
empty H2_H1 empty TCB 1 1FIN_W2,RCV_NXT21,SN
D_NXT12,SND_UNA12,ISS10,cls TCB 2
1CLOSING,RCV_NXT12,SND_NXT22,SND_UNA21,ISS2
0,lis
21A Reachability Graph Path to the Deadlock of
Config.D
22Connection Release Fails
23Analysis Results of Model 2 (Configuration D)
Config D hhmmss V A TMs DLs
(0,0,0,1) (0,1,0,0) (1,0,0,0) (0,1,0,1) (0,0,1,0) (1,1,0,0) (1,0,0,1) (0,0,1,1) (0,1,1,0) (1,1,0,1) (1,0,1,0) (0,1,1,1) (1,0,1,1) 000001 000001 000002 000011 000015 000015 000016 000028 000426 000507 000716 001434 004835 1309 1362 1810 8743 10156 10381 10481 16612 64871 65381 77940 104046 126098 3899 3498 4810 31122 34825 33056 38071 59184 258399 273981 317337 426872 530381 5 7 6 11 11 16 10 15 24 24 24 32 32 1 2 2 2 0 4 2 0 0 4 0 0 0
- Reordering channel with no loss
- Retransmissions
- Run on a machine with 2.6GHz Pentium CPU and 1GB
RAM.
24Analysis Results of Model 2 (Configuration E)
Config E hhmmss V A TMs DLs
(0,0,0,1) (0,1,0,0) (1,0,0,0) (0,0,1,0) (0,1,0,1) 000048 000626 002250 002525 091037 19354 45293 98627 122654 328023 75158 163984 392610 516530 1524604 8 21 24 12 29 2 8 8 0 8
25Conclusions
- Over a reordering channel without loss, TCP
terminates correctly in the following scenarios - Client-server connection establishment
- Simultaneous connection establishment
- Orderly release after the connection is
established - Aborting of connections
- However, TCP can deadlock when the user releases
the connection before it is established, i.e.,
while the TCP entity is in SYN_RCVD. - Retransmissions of the FIN in state FIN_WAIT_1 or
CLOSING removes these deadlocks.
26Configuration 1A_Open1Close and 1P_Open
Nodes28 Arcs 37 DMs 4
27Configuration 1A_Open and 1P_Open1Close
Nodes25 Arcs 33 DMs 3