Using Finite State Machine at the Testing of Network Protocols

18 downloads 4469 Views 120KB Size Report
Using new software and, mainly, changing the network protocol generation, such as ... theory of finite state machines (FSM) (Fujiwara et al.,; Stevens, 1996).
Australian Journal of Basic and Applied Sciences, 5(10): 956-960, 2011 ISSN 1991-8178

Using Finite State Machine at the Testing of Network Protocols 1

Ashraf Abdel-Karim Helal Abu-Ein, 2Hazem (Moh'd Said) Abdel Majid Hatamleh and 1 Ahmed A.M. Sharadqeh

1

Computer Engineering Department, University of Al-Balqa’ Applied, Faculty of Engineering Technology, Amman- Jordan. 2 Computer Department, University of Al-Balqa' Applied, Faculty of Ajloun, Ajloun- Jordan.

Abstract: The choice of the finite state machine model use as an initial description of a tested network protocol is made in this article. The possibility of this model usage for the description of protocol operation errors is shown. The possible solution of an optimization problem and of a generated test sequence completeness support is proposed. INTRODUCTION Using new software and, mainly, changing the network protocol generation, such as IPv6, provokes a necessity to carry out the following sorts of the software testing:  The conformity test for a compliance with the specification detects.  The compatibility test for a software interconnection detects. There is enough information about the test generation conformity methods for protocols of new generation IPV6. Thus the main problem consists in necessity of check of new IPV6 protocols compatibility especially taking into account their new functionality such as mobility, safety and multicast. Considering it, we can present in a general way tasks which must be solved for it. 1) The comparative analysis of test generation methods of conformity and compatibility tests for an IPV6 protocols stack, on purpose to select the best among them. 2) The development of the strategy of automatic compatibility tests generation for a stack of IPv6 protocols considering new functionality, such as mobility, safety and multicast. 3) The analysis of possibility to apply the generated tests to existing protocol stacks and platforms, placing emphasis on new functionality. This approach should allow carrying out modeling of mobile network node migration to inspect tested implementations. Considering inevitable contradictions between a tester functions and a safety principles into IPv6 protocol implementation, it is necessary to come to the compromise to find the satisfactory solutions allowing a tester to test sequence for tested system generate, possessing properties of protocols safety support. The test of protocols which carry out multicast means of special algorithms application for a tests generation. It is a question of tests for such tools as a videoconferences or a network TV with multicast using. The study of such test algorithms for transmission and data flow reception also should become an object of research. The developed system architecture should have the characteristics allowing it to be as much as possible distributed and "friendly" to any implementation and to any operating system, to possess of a parallelism properties, etc. It is required to solve the task of formalizing of the network protocols (object of testing) representation. This article is devoted to the first stage, namely, to the analysis of possibility of application of finite state machines theory for formalizing of tested protocols. Network Model Based on the Theory of Finite State Machines: The most part of a network test researches is devoted to methods based on graph theory, namely, on the theory of finite state machines (FSM) (Fujiwara et al.,; Stevens, 1996). Below we will present the basic statements from FSM theory and we will explain its use for the protocol test problem. Thus automaton S is presented by following parameter set: a set of states of the automaton (A), a set of entry events (X), a set of output events (Y), a set of output functions (f) and a set of the automaton transitions (F). Often, it is set as well an initial status of the automaton (a0). So, we have six parameters which present some automaton: Corresponding Author: Ashraf Abdel-Karim Helal Abu-Ein, Computer Engineering Department, University of Al-Balqa, Applied, Faculty of Engineering Technology, Amman- Jordan. E-mail: [email protected] Tel: +962-777-516494, Fax: +962-6-4894294

956

Aust. J. Basic & Appl. Sci., 5(10): 956-960, 2011

S = {a0, A, X, Y, f, F}. This model also can be presented in a graph form where: nods are a system states, arcs are transitions from one system state to another one, entry events provoke the automaton transitions, and output events appear during these transitions. Here we mean xi as entry words and yj as output words. In a figure 1 the operation of some network under protocol action is resulted.

x3 / y1 a0

a2

x2

/ y

x3 / y3

x1 / y1

x1 / y2

3

x1 / y1

a1

a3

Fig. 1: Example of the finite state machine graph model. So, using the given description form of the network under action of some protocol, we can present structure and functioning of some network protocol. For example, in (Castanet, 1994) transition graph of TCPv4 protocol is given practically in the form of a finite state machine (Fig. 2 below). starting point CLOSED

re c

v :S

Y

se N;

nd

:S

re c

, YN

v :R

AC

ST

SYN, RCVD

appl: close send: FIN

s e n re c v d: : A C

FIN_WAIT_1

e lo s l : c F IN p ap n d : se recv: FIN send:ACK

recv: ACK send: FIN_WAIT_2

recv: FIN send:ACK

K

n pe eo iv N ct Y :a :S p l en d s

timeout send: RST

ap

appl: passive open send:

LISTEN ap passive open s pl : s en en d d: SY d ata N recv: SYN send: SYN,ACK simultaneous open

CK

,A N CK Y S :A l: cv n d re s e recv: FIN ESTABLISHED send:ACK data transfer state

simultaneous close

SYN, SENT active open

appl: close or timeout

CLOSE_WAIT appl: close send: FIN

CLOSING

LAST_ACK

recv: ACK send:

passive close

recv: ACK send:

TIME_WAIT 2MSI, timeout

active close normal transitions for client normal transitions for server

appl: state transitions taken when application issues operation recv: state transitions taken when segment received send: what is sent for this transition

Fig. 2: TCPv4 network protocol specification.

957

Aust. J. Basic & Appl. Sci., 5(10): 956-960, 2011

Having presented the given protocol in a graph form, we will gain the classical Mealy finite state machine automaton graph (see bellow). For this purpose we will rename nods and arcs of the protocol presented in a figure 2 as follows. Under a nod a1 is implied the CLOSED protocol state (Starting point); a2: LISTEN (Passive open); a3: SYN_RCVD; a4: SYN_SENT (Active open); a5: ESTABLISHED (Data transfer state); a6: CLOSE_WAIT (Passive close); a7: LAST_ACK (Passive close); a8: FIN_WAIT_1 (Active close); a9: CLOSING (Active close); a10: FIN_WAIT_2 (Active close). Last state TIME_WAIT corresponds to a state a1 CLOSED (Starting point) and not marked as a new state. It’ means that after a final cycle the system transfers in an initial state that also corresponds to the Mealy automaton. In a similar way we will treat a protocol transitions from one state to another one. x1: SYN; x2: RST; x3: ACK; x4: FIN; x5: timeout; х6: appl. We will designate an output words as follows: y1: Passive Open; y2: Active Open; y3: SYN; y4: ACK; y5: Send Data; y6: FIN; y7: RST. An output word absence we will designate as (-). The following finite state machine graph is resulted in figure 3.

/y3 x6

x5/y7

x6 /-

a1

x 2/ y 3y 4 x 1/

a3

a2 x6 /

x1/y4y5 x3 /-

/y 6

a6

x4/y4 a9

x3/-

4

a10

x4/y4

/y

4

a7

x3/-

x3/-

a8 x3 x

x6 /-

x6 / y6

x6

a4

/y 4 x 1x 3 x4/y4

a5

x6 /y6

y3

a1

Fig. 3: The Transition graph of transport protocol TCPv4. SDL Model Use: The final purpose of our approach is a test sequence generation for the specified network protocol (Schaff and Nemchenko, 2001). One of stages of this solution is representation of the initial description of the protocol functioning in the formal language comprehensible to data input in a computer. That is protocol representation as a finite state machine is the intermediate stage of protocol simulation. Our research shows, that one of the most comprehensible and perspective is the specialized language SDL (Specification and Description Language). This language is based on usage of the finite state machine model as it is shown in a figure 4, for example. This simulation language is presented in a literature completely enough. For example in (Grabowski, 1994; Baranov, 1997). That is why it is not a subject of this publication.

958

Aust. J. Basic & Appl. Sci., 5(10): 956-960, 2011

Models of Network Errors: Having assumed as a basis representation of network system behaviour on analogies to the theory of behaviour of finite state machines as it is made in (Baranov, 1997); we can class network system behaviour errors as follows: 1 Output errors: presents a case when some correct output word yj is substituted by another word yk. At the same time, transition from the previous state to another one is realized correctly. 2 Transition errors: corresponds to a case when instead of аm - аn, transition under an entry word xi with a corresponding output word уj, a transition in another state as (not provided) under the influence of the same entry word xi is carried out. 3 State errors: occurs when a quantity of states specified and the quantity of real states and also its composition in some implementation of system differs from the protocol specification. Model of the protocol implementation with a different type of errors above mentioned is shown at the figure 4. xi / yj an

xk

/ y

am

x i / yi

am

l

an

xk

/ y

p

xk / as

as

ac

b) Protocol implementation model with a different error types

а) Protocol specification model Fig. 4: The graph model of some network protocol.

Let some network system can be in one of three states аm, аn, as according to the protocol specification (see fig. 4). The specification provides the transition from a state аm to a state аn. Also according to the specification an output word yj appears as a result of such transition provoked by an entry word xi. Let also a transition from state аm to state аs is carried out under entry word xi and the output word yj is thus worked out (fig. 4, b). We will note that in this case there is a transition error according to the classification resulted above. On the given model it is easy to see as well an output error on transition аn - аs (fig. 4, b). One more error type a state error, is shown also in a figure 4, b. We see here presence of a state ас which has been not provided by the specification of this protocol. It is obvious, that a presented automaton model above can be referred to an automaton of a Mealy type. It is possible to familiarize with Mealy and Moore automata theory more in detail in (Baranov. 1977) or in paper «Implementing Mealy and Moore Machines» on page http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Seq/impl.html Errors Coverage: At a graph usage as a finite state machine model for the network protocol description we face a typical problem of graph coverage. It is obvious, that the problem of errors coverage at usage of the graphic model can be reduced to the graph coverage problem. That is necessary to solve the problem to pass the graph for minimum possible number of steps. Thus all nods and all arcs of the graph should be passed at least once. The optimal test sequence with minimal quantity of test vectors will be as a result gained at sufficient entirety of test vectors coverage for the tested protocol. This problem is well enough lighted in the literature, for example [8] and is not a subject of the present article. It is easy to note, that the statement of graph coverage problem is not new and meets even in Euler's works. Conclusion: As is known, any problem of testing including testing of network protocols is a complex one and consists of subtasks set. And among them the problem of formalization of a testing object representation is the first. This research is devoted to justification of a finite state machine model choice and to adapt this model to needs of network protocol test algorithm. Possibility of the given model usage for the description of a various protocol functioning errors is besides shown. Also the solution paths of an optimization problem and support of

959

Aust. J. Basic & Appl. Sci., 5(10): 956-960, 2011

generated test sequence entirety are planned. Narrow frameworks of this publication have not allowed to go deep into consideration of a tests classification problem and the test sequences generation problem, as is a subject of the further researches in this domain. REFERENCES Baranov, S.I., 1977. Matrix Realization of Control Automata.- Proceedings of the Second International Symposium on Discrete Systems. Dresden, vol. 2. Castanet, R., 1994. Test de protocoles de communication. Réseaux de Communication et Techniques Formelles. Paris. Fujiwara, S., G.V. Bochmann, F. Khendek, M. Amalou, A. Ghedamsi, Test selection based on finite state models. Université de Montréal. Canada. Grabowski, J., 1994. SDL and MSC Based Test Case Generation – An overall view pf the SAMsTaG method. IAM-94-005. Petrenko, A., G.V. Bochmann, 1994. On Fault Coverage of Tests for Finite State Specifications. Montreal University. Canada. Schaff, A., V. Nemchenko, 2001. Test of the new generation internet protocols IPv6. / Radioélectronika i informatika. - Kharkiv, 1: 87-89. SDL Specification and Description Language, 1988. CCITT SG XI, Recommendation Z.100. Stevens, W.R., 1996. TCP/IP Illustré. Les Protocoles. Vol. 1. International Thomson Publishing Company.

960

Suggest Documents