Title: Session 3: Industrial Protocols
1Session 3 Industrial Protocols
- Jonathan Billington
- (joint with Bing Han (TCP), Chun Ouyang (IOTP))
- Computer Systems Engineering Centre
- School of Electrical and Information Engineering
- University of South Australia
- 26 September 2003
2Introductory Remarks
- Aim give some insight into application to
practical protocols - Specification
- Analysis
- Service specification
- Concentrate on TCP
- Initial Results - Work in progress
3Agenda
- TCP Connection Management specification
- TCP CM analysis
- TCP Service specification
- IOTP Specification
- Conclusions
4TCP Connection Management Specification and
Analysis Initial Results
5Outline
- Overview of the Transmission Control Protocol
(TCP) - TCP Connection Management
- CPN Model of TCP Connection Management
- Analysis Results
- Conclusions and Future Work
6Overview of TCP
Internet
- Services provided to the application layer
- Connection-oriented service
- Reliable data transfer service
- Flow Control
- Multiplexing
7TCP Segment Format
Source port
Dest. port
Sequence number
Acknowledgment number
URG
ACK
PSH
HLEN
RSVD
FLAG
Window
RST
SYN
FIN
Checksum
Urgent Pointer
Options (if any)
Data (if any)
8TCP Connection Management
- TCP establishes connections using what is called
a 3-way handshake - Avoid the problem of old duplicates
- Once established, data can be transferred in
either direction independently - Connections are released gracefully
- No data is lost in either direction, but
- Connections can be aborted, in which case data
can be lost
9Normal Scenario
Client TCP Segments
Server
LISTEN
SYN_RECEIVED
ESTABLISHED
LAST_ACK CLOSED
CLOSED
FIN_WAIT_1 FIN_WAIT_2
CLOSED
SYN SYN , ACK
FIN
SYN_SENT
ESTABLISHED
ACK
Data Transfer
Data Transfer
FIN
CLOSE_WAIT
ACK
TIME_WAIT
ACK
10 TCP Finite State Diagram
University of South Australia
11Examining the Functional Behaviour of
TCP (Previous Work)
- Connection management in transport protocols
(Sunshine Dalal 1978) - Modelling and analysis of DOD TCP/IP protocol
using numerical Petri nets (Mehrpour Karbouiak
1990) - Formal verification of communication protocols
(Smith 1996) - An analysis of TCP connection management using
coloured Petri nets (Han Billington 2001)
12CPN TCP Specification
- Separate the specification into
- Connection management (CM) procedures
- Data transfer procedures
- Here only concerned with CM
- Starting point is TCP state diagram
- Enhanced by the description in section 3.9 of
TCPs RFC 793
13Modelling Assumptions and Abstraction
- The communication channel does not lose, corrupt
nor duplicate packets, but may re-order packets. - No retransmissions
- A single instance of connection no port
numbers - Three TCP header fields are modelled
- the sequence number,
- the acknowledgment number and
- 4 bits of the FLAG.
14CPN Specification
- Model TCP CM using 3 levels of hierarchy
- Model both TCP entities using instances, since
TCP is symmetrical - Include the IP service (just re-ordering)
- Both intra and inter-object model
- Use Design/CPN to construct the model
- Net inscriptions are written in CPN ML.
15Hierarchy Page
16Top Level CPN Page TCP_Overview
17Declarations - 1
- User Commands
- color COMMANDwith A_OPEN P_OPEN SEND
CLOSE - Transmission Control Block (TCB)
- color STATEwith CLOSED LISTEN SYN_SENT
SYN_RCVD EST CLOSE_WAIT LAST_ACK FIN_W1
FIN_W2 CLOSING TIME_WAIT - color SVrecord RCV_NXT Int SND_NXT Int
SND_UNA Int ISS Int - var vSV
- color TCBproduct STATE SV
18Declarations - 2
- Segments
- color CTLbitwith SYN ACK FIN RST
- color ACKflagwith on off
- color SEG_CTLproduct CTLbitACKflag
- color SEGrecord SEQ Int ACK Int CTL
SEG_CTL - var segSEG
- Additional Control
- color LISTENflagwith l c
19Second Level CPN Page TCP_CM
20Third Level CPN Page CLOSED
21Declarations Functions
- fun SYNseg(vSV)SEGSEQISS(v), ACK0,
CTL(SYN,off) - fun SYNACKseg(vSV)SEGSEQISS(v),
ACKRCV_NXT(v), CTL(SYN,on) - fun ACKseg(vSV)SEGSEQSND_NXT(v),
ACKRCV_NXT(v), CTL(ACK,on) - fun FINseg(vSV)SEGSEQSND_NXT(v),
ACKRCV_NXT(v), CTL(FIN,on) - fun RSTackon(segSEG)SEGSEQ0,
ACKSEQ(seg)1, CTL(RST,on) - fun RSTackoff(segSEG)SEGSEQACK(seg), ACK0,
CTL(RST,off)
22Analysis Approach
- Examine the terminal states (dead markings) for
each case through automated reachability
analysis. - If they are desired, then check the transition
sequences. - If the sequence is problematic (not desired),
find the transitions responsible for it. - Validate the model against the TCP definition -
RFC 793. - If it is a true reflection, this indicates a
problem with the definition. - Correct the problem, revise the model and
re-analyse.
23Cases and Models
- Only consider connection establishment
- Case 1 Client-server
- M0(User_1) 1A_OPEN
- M0(User_2) 1P_OPEN
- Case 2 Simultaneous Open
- M0(User_1) 1A_OPEN
- M0(User_2) 1A_OPEN
- Problems discovered in Case 2
- Model A (original)
- Model B (after first modification)
- Model C (after second modification)
24Reachability Analysis Results
25Simultaneous Open (RFC 793)
CLOSED SYN_SENT
SYN_RECEIVED ESTABLISHED
CLOSED SYN_SENT SYN_RECEIVED ESTABLISHED
SYN K
SYN J
SYN K, ACK J1
SYN J, ACK K1
26Model A Unnecessary Acknowledgments
CLOSED SYN_SENT SYN_RECEIVED ESTABLISHED
CLOSED SYN_SENT
SYN_RECEIVED ESTABLISHED
SYN K
SYN J
SYN K, ACK J1
SYN J, ACK K1
ACK (K1,J1)
ACK (J1,K1)
27Model B Simultaneous Open Fails
CLOSED SYN_SENT
SYN_RECEIVED CLOSED
CLOSED SYN_SENT SYN_RECEIVED CLOSED
SYN K
SYN J
SYN K, ACK J1
SYN J, ACK K1
RST (J1,0)
RST (K1,0)
28Conclusions
- TCP connection management is modelled at a
sufficient level of detail for a meaningful
initial analysis. - Discovered two problems with the simultaneous
open procedure in the TCP specification (RFC
793). - Solutions are proposed and verified for both
problems.
Future Work
- Connection termination, Retransmissions
- Lossy communication channel, Duplicate SYNs
- Verification against service
29Defining the Service Provided by TCP
30Motivation
- TCP dominant transport protocol in the Internet.
- Specified in IETF RFC 793
- narrative descriptions
- incomplete state transition diagram
- implementation oriented
- Problems with TCP
- Murphy and Shankar (1991), RFC 2525 (1999), Han
and Billington (2002) - Verification needed
- Is TCP a faithful refinement of the TCP service?
- Defining the service is the first step.
31Motivation
- Previous work on defining TCP service
- RFC 983 (1986), RFC 1006 (1987), Murphy Shankar
(1991), RFC 1859 (1995), Smith (1996), RFC 2126
(1997) - Inadequate in various ways
- too close to user interface definition
- some main service features not considered
32Proposed Service Definition
- Follows the OSI service conventions
- Includes all required services
- Normal and Simultaneous open
- Normal and urgent data transfer
- Graceful connection release
- User and provider abort
33Outline
- TCP Service Definition
- Service Primitives
- State Table for local sequences
- A CPN Specification of TCP Service
- Global Sequences
- Conclusions
34TCP Service Concept
Initiator
Responder
TCPS-user
TCPS-user
Submit
Deliver
Deliver
Submit
Request
Response
indication
Confirm
SAP2
SAP1
TCP Service Provider
35TCP Service Primitives
36Normal Client-Server Scenario
SAP1 SP SAP2
Connection Establishment
TCP-CONNECT req
TCP-CONNECT ind
TCP-CONNECT cnf
TCP-CONNECT res
Data Transfer
TCP-DATA req
TCP-DATA ind
TCP-RELEASE req
Connection Release
TCP-RELEASE ind
TCP-RELEASE cnf
TCP-RELEASE res
37Global Opening Scenarios
SAP1 SP SAP2
TCP-CONNECT req
Normal Connection Establishment
TCP-CONNECT ind
TCP-CONNECT cnf
TCP-CONNECT res
TCP-CONNECT req
TCP-CONNECT req
Simultaneous Connection Establishment
TCP-CONNECT cnf
TCP-CONNECT cnf
38Local Sequencing Constraints
- Need to define the sequences of primitives at
each service access point - Define using a state table (following OSI
conventions) - Based on OSI Transport and Session Services
39Interface State Definition
40TCP Service State Table
41The FSA for A Local SAP
42Client SAP State Table
43CPN Model - Hierarchy Page
44TCP Service Overview
45Connection Establishment Service
46Connection Establishment Service
CON
IDLE
OCP
IDLE
ICP
47Two Features of the CPN Model
- Urgent data can overtake any amount of normal
data in the queue. - When aborts are entered in the queue, any amount
of data may be discarded.
DATA,DATA,UDATA..DATA,UDATA,DATA
...ABORT
48Data Transfer Service
49Connection Release Service
50Abort Service
51CPN Model - Aborting Service
hd(rev(q))ABORT
52Global Primitive Sequences
- Restrict to
- Connection Establishment
- Connection Release
- Abort
- Implies
- Finite state space
- Finite sequences
- Can use OG and FSA minimisation
- What about Data Transfer ?
- later
53State Space Statistics
Client-Server
Abort
Simultaneous
Abort
54Minimised FSA Statistics
Client-Server
Abort
Simultaneous
Abort
55Service Primitives Abbreviations
CREQ CIND CRES CCNF
creq cind cres ccnf
rreq rind rres rcnf areq aind pind
RREQ RIND RRES RCNF AREQ AIND PIND
56(No Transcript)
57Global Sequences of TCP CM Service Primitives
Automata Reduction Technique
Reachability Graph
Service Language
58A Connection Opening and Closing Scenario
SAP1 SP SAP2
TCP-CONNECT req
TCP-CONNECT ind
TCP-CONNECT cnf
TCP-CONNECT res
TCP-RELEASE req
TCP-RELEASE ind
TCP-RELEASE cnf
TCP-RELEASE res
59Conclusions and Future Work
- The advantage of our TCP Service Definition
- Implementation independent
- Includes all service features
- The TCP service is formalised using CPNs
- The global sequences are specified
- Verification of CM
- Need comprehensive CPN model of TCP Connection
Management - Data Transfer Service
- Infinite state space, but
- Parameterise channel capacity
60Internet Open Trading ProtocolColoured Petri Net
Model
61Overview
62Top Level
color TRxTRxMQ product tradingrole trading
role MsgQueue
- Four IOTP entities (trading roles) communicate
with each other via a simple model of the
underlying transport medium (HTTP service)
63Trading Roles
64Transaction Level
- Examples Authentication transaction pages
AuthTr_C page
AuthTr_M page
65Exchange Level (I)
- Examples Authentication document exchange pages
Authenticatee page
66Exchange Level (II)
Authenticator page
67Final Remarks
- Specification of industrially relevant protocols
(TCP, WAP, IOTP, RSVP, H.245) - using hierarchical HLNs such as CPNs
- is feasible
- Analysis and Verification
- Feasible for CM and transaction protocols for
small parameter values
68Challenges
- General results for all values of parameters for
connection management and transaction protocols - Data transfer protocols
- Arbitrary channel capacity
- Parameters
- sequence numbers
- window sizes
- retransmission counters
69Challenges - 2
- Verification techniques lifted to HLNs
- McMillans prefix (unfoldings)
- Structural properties (traps)
- On the fly comparison
- Data independence
- Different equivalences?
- Service specifications
- Inclusion PL subset of SL
- How do you specify acceptable subsets?
- e.g. IOTP