270 likes | 370 Views
Modelling and Analysis of TCP’s Connection Management Procedures. Jonathan Billington and Bing Han Computer Systems Engineering Centre University of South Australia. Motivation. Finding design flaws of complex protocols such as TCP is an important and difficult research problem.
E N D
Modelling and Analysis of TCP’s Connection Management Procedures Jonathan Billington and Bing Han Computer Systems Engineering Centre University of South Australia Paris Seminar
Motivation • 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. Paris Seminar
Outline • Research Scope • TCP Connection Management • Desired properties: • Termination • Absence of deadlocks • Approach • Modelling approach • Analysis approach • Analysis Results Paris Seminar
TCP and its Environment Two peer TCP entities communicate over the Internet Protocol (IP) as well as interacting with their application processes. Paris Seminar
TCP Segment Format Paris Seminar
Normal Connection Establishment Paris Seminar
Simultaneous Connection Establishment Paris Seminar
Normal Connection Release (Graceful Close) Paris Seminar
Simultaneous Connection Release Paris Seminar
TCP 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. Paris Seminar
Our 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 Paris Seminar
Top Level Page: TCP Overview Paris Seminar
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 Paris Seminar
Desired Properties (Termination) Successful Establishment Proper Establishment Successful Release Successful Abort Paris Seminar
Desired Terminal State for Establishment Successful Establishment Proper Establishment Paris Seminar
Acceptable Terminal State for Establishment Paris Seminar
CPN Model Configurations – Some Examples Paris Seminar
Analysis Results of Model 1: No Loss, No Retrans • Reordering channel with no loss • No retransmission • Run on a machine with 2.6GHz Pentium CPU and 1GB RAM. Paris Seminar
Initial Marking 1 User_1: 1`A_Open++1`Close User_2: 1`P_Open++1`Close H1_H2: empty H2_H1: empty TCB 1: 1`{CLOSED,{RCV_NXT=0,SND_NXT=0,SND_UNA=0,ISS=10},cls} TCB 2: 1`{CLOSED,{RCV_NXT=0,SND_NXT=0,SND_UNA=0,ISS=20},cls} Paris Seminar
Dead Marking 95 User_1: empty User_2: empty H1_H2: empty H2_H1: empty TCB 1: 1`{FIN_W2,{RCV_NXT=21,SND_NXT=12,SND_UNA=12,ISS=10},cls} TCB 2: 1`{CLOSING,{RCV_NXT=12,SND_NXT=22,SND_UNA=21,ISS=20},lis} Paris Seminar
A Reachability Graph Path to the Deadlock of Config.D Paris Seminar
Connection Release Fails Paris Seminar
Analysis Results of Model 2 (Configuration D) • Reordering channel with no loss • Retransmissions • Run on a machine with 2.6GHz Pentium CPU and 1GB RAM. Paris Seminar
Analysis Results of Model 2 (Configuration E) Paris Seminar
Conclusions • 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. Paris Seminar
Configuration: 1`A_Open++1`Close and 1`P_Open Nodes:28 Arcs: 37 DMs: 4 Paris Seminar
Configuration: 1`A_Open and 1`P_Open++1`Close Nodes:25 Arcs: 33 DMs: 3 Paris Seminar