Automatic Testing of Neighbor Discovery Protocol Based on FSM and TTCN Zhiliang Wang, Xia Yin, Haibin Wang, Jianping Wu Department of Computer Science Tsinghua University APCC’2004 Sep. 1, 2004
APCC'20042 Outline Background Motivation Our proposed method Conclusion and Future work
APCC'20043 Background: Protocol Conformance Testing Protocol Specification Test Generation Abstract Test Suite Test Implementation Implementation Process Protocol Impl. IUT Test Execution Test Verdict
APCC'20044 Background: Neighbor Discovery Protocol One of the basic protocols in IPv6 protocol set Should be supported in all IPv6 implementations Corresponding functions in IPv4 – ARP (Address Resolution Protocol) – ICMP router discovery – ICMP redirect function Using 5 ICMP packet types: – Router Solicitation – Router Advertisement – Neighbor Solicitation – Neighbor Advertisement – Redirect
APCC'20045 Background: Related work Conformance testing of ND Protocol – InterOperability Laboratory, University of New Hampshire – TAHI Project – Institute of Computing Technology, Chinese Academy of Sciences Existing Problems – No standard language used to specify test suite – Must be executed on the proprietary test systems – Not guided by formal methods – Cannot ensure test coverage and reliability of test suite
APCC'20046 Background: Our method FSM – Finite State Machine – To specify protocol specification TTCN-2 – Tree and Tabular Notations – Test case specification language PITS – Our previous work – Protocol Integrated Test System – TTCN-based test system – Automatic test process – Test practice Protocol Specification Test Generation Abstract Test Suite Test Implementation Implementation Processes Protocol Impl. IUT Test Execution Test Verdict FSM TTCN PITS
APCC'20047 Outline Background Motivation Our proposed method Conclusion and Future work
APCC'20048 Motivation Protocol Modeling –Control part –Data part –Timed part ND Protocol includes simple Timer Operations! How to specify it? –EFSM? (Extended FSM) Control part and data part, no timer! –TIOA? (Timed Input Output Automata) Common model for timed system Test generation process has tremendous costs on time and space Difficult to be applied in practical conformance testing –Our method: EFSM + simple timer operations
APCC'20049 Outline Background Motivation Our proposed method –Formal Model –Test Architecture –Test Generation –Test Practice –Test Results and Analysis Conclusion and Future work
APCC' Formal Model EFSM with Simple Timed Extensions –EFSM + simple timer operations –A local timer for each state –Transition of such a model: tact (timed action): invoke the local timer start(t q ) Timeout transition: input is timeout(t s ) INCOMPLETE REACHABLE NONE t5t5 t3t3 t 5 : ?NA [NA.S=1]/{LLA:=NA.TLLA;start(T R )}!ERep t 3 : timeout(T I ) [counter=3]/{counter:=0} i: InputP: Predicate up: variable update function i: Input P: Predicate up: variable update function tact: timed action o: output
APCC' Formal Model (cont) Protocol specification of Neighbor Unreachability Detection in ND Protocol States: 6 Transitions: 45
APCC' Formal Model (cont) Protocol specification of Neighbor Unreachability Detection in ND Protocol
APCC' Formal Model (cont) External Observable timed features – Do not apply any external inputs to the machine in state s. If an external output o can be observed after waiting a while, state s has an External Observable Timed Feature and its observed output is o. – the external behaviors of timeout transitions –To verify the transient state Example
APCC' Test Architecture PCO: Point of Control and Observation IUT: Implementation Under Test
APCC' Test Generation Conformance test suite –State cover: for each state S –Transition cover: for each transition t S0S0 S? r pre(S) ds(S) pre(S): Preamble ds(S): Distinguishing Sequence ? State cover test case S0S0 S? r pre(S) ds(Q) ? Q t Transition cover test case Lead the machine to the initial state S 0 Lead the machine from S 0 to state S Transition to be tested Verify the final state is S Verify the final state is Q r : Reset State to be tested
APCC' Test Generation (cont) Generation of Distinguishing Sequence –Extension of traditional method Key idea: Consider Timed Features of model {N,I,S,R,D,P} Wait mNS (1s) uNS (1s) uNS (5s) -- I P D{N,S,R} EReq mNS ERep N{S,R} Wait uNS (5s) -- SR Example: Distinguishing Seq. of state S: Wait/--; ?EReq/!EPep; Wait(5s)/!uNS
APCC' Test Generation (cont) TTCN-2 Test case example:
APCC' Test Generation (cont)
APCC' Test Practice Test System RI: Reference Implementation PCO: Point of Control and Observation IUT: Implementation Under Test
APCC' Test Practice (cont) RI (Reference Implementation)
APCC' Test Results and Analysis Overview of NDP test suite Test Result
APCC' Conclusion and Future work A formal method to test neighbor discovery protocol –Protocol specification: FSM-based method –Test generation –Test specification: TTCN-2 –Test practice: PITS Future work: –Data flow testing for such a model –further test activities on IPv6 protocols, especially routing protocols
Thank you! Q&A