350 likes | 477 Views
A Formal Approach to Robustness Testing of Network Protocol. Chuanming Jing 1,2 , Zhiliang Wang 1,3 , Xia Yin 1,2 , Jianping Wu 1,2,3 1 Tsinghua National Laboratory for Information Science and Technology 2 Department of Computer Science & Technology, Tsinghua University
E N D
A Formal Approach to Robustness Testing of Network Protocol Chuanming Jing1,2, Zhiliang Wang1,3, Xia Yin1,2, Jianping Wu1,2,3 1 Tsinghua National Laboratory for Information Science and Technology 2 Department of Computer Science & Technology, Tsinghua University 3 Network Research Center of Tsinghua University NPC 2008
Outline • Motivation and previous works • Our proposed method • Conclusions
Outline • Motivation and previous works • Our proposed method • Conclusions
Motivation • Among 5925 holes, 60%~80% were caused by Inputs • Input Validation: 23% • Boundary Condition:21% • Exceptional Conditon:11% • Access Validation: 10% • Design Error:18% Bugtrap Statistic in 2002(http://www.securityfocus.com)
Related works • Robustness testing (IEEE STD 610.12) • test to verify whether Implementation Under Test(IUT) can function correctly in the presence of invalid inputs or stressful environmental conditions • aims to detect vulnerabilities of protocol implementations • vulnerabilities of malformed message parsing • vulnerabilities of state transitions • hole of buffer overflow
Related works • Model-based robustness testing • Fuzz testing • Limitations: • lacks guidance of theory • verdict mechanism needs improvement • test system is not generic to other protocols • readability, extensibility and maintainability of test suite are not good • Highly desirable and critical to have a formal approach to robustness testing
Outline • Motivation and previous works • Formal Model • Test Generation • Extension of TTCN-3 and its Systems • Test practice • Conclusions
Formal Model: NPEFSM • Existing Models • FSM: Finite State Machine • EFSM: FSM + data -- protocol variables and operations • PEFSM: EFSM + parameters • Robustness testing • requires injecting many invalid messages • state transitions after these invalid injections are often nondeterministic • Our Model • NPEFSM: Nondeterministic Parameterized EFSM • covers more detailed and precise nondeterministic features i/o s1 s2
Formal Model: NPEFSM • Transitions after injecting invalid inputs • Tdeter • Tnondeter-spec • Tnondeter-unspec
Outline • Motivation and previous works • Formal Model • Test Generation • Extension of TTCN-3 and its System • Test practice • Conclusions
Structure of Robustness Testing • Conformance testing • <State Leading Sequence, Executing Sequence, State Verification Sequence> • Robustness testing • Anomalous Test Case • <State Leading Sequence, Invalid PDU Inputting, Normal-Verification Sequence>
Normal-Verification Sequence • Requirements of Robustness testing • keep in the normal state • continue normal operations conforming to protocol specification • Construct Normal-Verification Sequence • tTdeter • Normal-Verification Sequence=State Verification Sequence • UIO Seq: Unique Input Output • tTnondeter • Normal-Verification Sequence=State Identification Sequence • Use Forced transition in test practice Tdeter State Verification s1 s2 Forced Transition Tnondeter State Verification s1 s2 S*
Compound Anomalous Test Case • Why compound anomalous test case? • Simplify the test sequence • Inject a large number of invalid inputs
Invalid Message Generation • Invalid inputs generation • Check one or more fields of a PDU • Normal PDU invalid PDU (mutation) • Single-field • Multi-field • pairwise algorithm
Outline • Motivation and previous works • Formal Model • Test Generation • Extension of TTCN-3 and its System • Test Practice • Conclusions
Why we use TTCN-3 • TTCN-3 • Test and Testing Control Notations • ETSI: European Telecommunications Standards Institute • A standard testing language • Has many advantages and been widely used • Extension • Not good for mutation operation • Difficult for test case description
Outline • Motivation and previous works • Formal Model • Test Generation • Extension of TTCN-3 and its Systems • Test Practice • Conclusions
Test practice • Tester:PITSv3 • IUT:Zebra-0.94
Test results multi-field single-field Zebra: cannot parse invalid messages with mutated “length” field in OSPF header with robustness
Outline • Motivation and previous works • Formal Model • Test Generation • Extension of TTCN-3 and its System • Test Practice • Conclusions
Conclusion and Future work • Conclusion • A formal approach to robustness testing • NPEFSM • TTCN-3 • Future work • application layer protocols • test real-time distributed systems • semantics of protocol
Thank you! Q&A wzl@cernet.edu.cn http://netarchlab.tsinghua.edu.cn/~wzl
Related works • Model-based robustness testing • Difficult to guide test practice • Fuzz testing • Deliver semi-valid data to the target • Widely used in software testing • manual, not efficient • not generic
Formal Model: NPEFSM • Forced Transition:(sS')sj
Formal Model: NPEFSM • APart of NPEFSM for OSPFv2 Neighbor State Machine: Link State Database Exchange
Invalid Message Generation • Field value mutation rules • Boundary value • Input partition value • Field values mismatch • Format error • Length,Checksum and Encapsulation error • Field mutation rules • Removal and Addition • Overflow • Permutation
Invalid Message Generation • Multi-field mutation • Pairwise algorithm: cover any pair of any two fields
Invalid Message Generation • Invalid inputs generation • Check one or more fields of a PDU • Normal PDU invalid PDU (mutation) • Single-field and Multi-field (pairwise algorithm) • Field value mutation rules • Boundary value • Input partition value • Field mutation rules • Removal and Addition • Overflow • Permutation