+ All Categories
Home > Documents > “Non-intrusive” Testing Techniques for Communication...

“Non-intrusive” Testing Techniques for Communication...

Date post: 22-Jun-2020
Category:
Upload: others
View: 9 times
Download: 0 times
Share this document with a friend
371
1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION “Non-intrusive” Testing Techniques for Communication Protocols 12 th TAROT Summer School, Paris, France Jorge L ´ opez <jorge.lopez[at]telecom-sudparis.eu> el´ ecom SudParis / Universit´ e Paris-Saclay July 8 th , 2016
Transcript
Page 1: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

1/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“Non-intrusive” Testing Techniques forCommunication Protocols

12th TAROT Summer School, Paris, France

Jorge Lopez<jorge.lopez[at]telecom-sudparis.eu>

Telecom SudParis / Universite Paris-Saclay

July 8th, 2016

Page 2: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

2/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

OUTLINE

MOTIVATION AND INTRODUCTION

STATIC CODE ANALYSIS

NETWORK TRACE ANALYSIS

FUTURE WORK / CONCLUSIONS

Page 3: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

3/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

ACKNOWLEDGMENT. . .

The results presented in this talk were obtained along withdifferent co-authors. Therefore, a special thank note isdedicated to those who directly contributed in this talk, theyare:

I Ana CavalliI Natalia KushikI Stephane MaagI Gerardo MoralesI Nina Yevtushenko

Спасибо! ¡Gracias! Merci !

I would also like to thank all the speakers of TAROT, includingstudents. Your presentations were fantastic and will enrich thispresentation.

Page 4: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

4/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

MOTIVATION

I The widespread adoption of applications using networks(i.e., communication protocols)

I A second life (for some, their life)I Critical Operations + Sensitive InformationI Tell me the last application you used which does not

interact over the network?

ImportantTesting is crucial for such systems (or applications)!

Page 5: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

4/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

MOTIVATION

I The widespread adoption of applications using networks(i.e., communication protocols)

I A second life (for some, their life)

I Critical Operations + Sensitive InformationI Tell me the last application you used which does not

interact over the network?

ImportantTesting is crucial for such systems (or applications)!

Page 6: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

4/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

MOTIVATION

I The widespread adoption of applications using networks(i.e., communication protocols)

I A second life (for some, their life)I Critical Operations + Sensitive Information

I Tell me the last application you used which does notinteract over the network?

ImportantTesting is crucial for such systems (or applications)!

Page 7: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

4/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

MOTIVATION

I The widespread adoption of applications using networks(i.e., communication protocols)

I A second life (for some, their life)I Critical Operations + Sensitive InformationI Tell me the last application you used which does not

interact over the network?

ImportantTesting is crucial for such systems (or applications)!

Page 8: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

4/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

MOTIVATION

I The widespread adoption of applications using networks(i.e., communication protocols)

I A second life (for some, their life)I Critical Operations + Sensitive InformationI Tell me the last application you used which does not

interact over the network?

ImportantTesting is crucial for such systems (or applications)!

Page 9: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

5/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“NON-INTRUSIVE” TESTING OF COMMUNICATION

SYSTEMS

Testing of communication systems

I Active testing feels like an intuitive method for testingsoftware and systems

I Sometimes you can’t interfere the system!

Reasons not to interfere the system?

I The data on the system are susceptible towards theexecution of tests

I Certain functionality is not available if “real” data are notprocessed

I Even if a system can be interrupted, we might want to testthe “real” service / application / data

Page 10: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

5/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“NON-INTRUSIVE” TESTING OF COMMUNICATION

SYSTEMS

Testing of communication systems

I Active testing feels like an intuitive method for testingsoftware and systems

I Sometimes you can’t interfere the system!

Reasons not to interfere the system?

I The data on the system are susceptible towards theexecution of tests

I Certain functionality is not available if “real” data are notprocessed

I Even if a system can be interrupted, we might want to testthe “real” service / application / data

Page 11: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

5/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“NON-INTRUSIVE” TESTING OF COMMUNICATION

SYSTEMS

Testing of communication systems

I Active testing feels like an intuitive method for testingsoftware and systems

I Sometimes you can’t interfere the system!

Reasons not to interfere the system?

I The data on the system are susceptible towards theexecution of tests

I Certain functionality is not available if “real” data are notprocessed

I Even if a system can be interrupted, we might want to testthe “real” service / application / data

Page 12: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

5/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“NON-INTRUSIVE” TESTING OF COMMUNICATION

SYSTEMS

Testing of communication systems

I Active testing feels like an intuitive method for testingsoftware and systems

I Sometimes you can’t interfere the system!

Reasons not to interfere the system?

I The data on the system are susceptible towards theexecution of tests

I Certain functionality is not available if “real” data are notprocessed

I Even if a system can be interrupted, we might want to testthe “real” service / application / data

Page 13: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

5/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“NON-INTRUSIVE” TESTING OF COMMUNICATION

SYSTEMS

Testing of communication systems

I Active testing feels like an intuitive method for testingsoftware and systems

I Sometimes you can’t interfere the system!

Reasons not to interfere the system?

I The data on the system are susceptible towards theexecution of tests

I Certain functionality is not available if “real” data are notprocessed

I Even if a system can be interrupted, we might want to testthe “real” service / application / data

Page 14: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

5/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“NON-INTRUSIVE” TESTING OF COMMUNICATION

SYSTEMS

Testing of communication systems

I Active testing feels like an intuitive method for testingsoftware and systems

I Sometimes you can’t interfere the system!

Reasons not to interfere the system?

I The data on the system are susceptible towards theexecution of tests

I Certain functionality is not available if “real” data are notprocessed

I Even if a system can be interrupted, we might want to testthe “real” service / application / data

Page 15: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

5/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

“NON-INTRUSIVE” TESTING OF COMMUNICATION

SYSTEMS

Testing of communication systems

I Active testing feels like an intuitive method for testingsoftware and systems

I Sometimes you can’t interfere the system!

Reasons not to interfere the system?

I The data on the system are susceptible towards theexecution of tests

I Certain functionality is not available if “real” data are notprocessed

I Even if a system can be interrupted, we might want to testthe “real” service / application / data

Page 16: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .

I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysis

I A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 17: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysis

I A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 18: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approach

I We assume we do not disrupt the implementation, we havean access to its source code

I Analyzing its code, we test the implementationI Passive network trace analysis

I A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 19: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source code

I Analyzing its code, we test the implementationI Passive network trace analysis

I A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 20: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysis

I A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 21: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysis

I A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 22: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysisI A “black-box’ approach

I We assume we do not disrupt the implementation, we havean access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 23: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysisI A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 24: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysisI A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 25: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

6/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

METHODS FOR NON-INTRUSIVE TESTING

We focus on two of them. . .I Static (code) analysis

I A “white-box’ approachI We assume we do not disrupt the implementation, we have

an access to its source codeI Analyzing its code, we test the implementation

I Passive network trace analysisI A “black-box’ approachI We assume we do not disrupt the implementation, we have

an access to the “messages” being exchanged by theimplementation

I The “source” where the messages are taken is called a Pointof Observation (P.O.)

Let’s take a look at each of them. . . “on y va”

Page 26: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

7/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

Static Code Analysis 101

Page 27: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

8/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS

/*Test equal distribution of random number generation algorithm*/#include <stdio.h>#include <stdlib.h>#define NUM 30#define MEM_SIZE 512*1024 //512MBint main(){

short i = 0 , j;long acc = 0;char *numbers = malloc(MEM_SIZE);if(!numbers){

printf(‘‘Can’t allocate memory\n’’);exit(-1);

}while (1){

numbers[i] = rand() % NUM ; //random numbers from 0 - NUMacc = 0;for (j = 0; j < i; j++)

acc += numbers[j];printf(‘‘New average: %ld\n’’, acc/++i); //should converge to NUM/2

}}

Do you see any problems with the code?

Page 28: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

9/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS (CONT.)/*Test equal distribution of random number generation algorithm*/#include <stdio.h>#include <stdlib.h>#define NUM 30#define MEM_SIZE 512*1024 //512MBint main(){

short i = 0 , j;long acc = 0;char *numbers = malloc(MEM_SIZE);if(!numbers){

printf(‘‘Can’t allocate memory\n’’);exit(-1);

}while (1){

numbers[i] = rand() % NUM ; //random numbers from 0 - NUMacc = 0;for (j = 0; j < i; j++)

acc += numbers[j];printf(‘‘New average: %ld\n’’, acc/++i); //should converge to NUM/2

}}

Hard to see, hard to detect (iteration # 32,768)

Page 29: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

10/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC (CODE) ANALYSIS

We can look for anything. . .

I Which is not functional related (the code compiles)I Usually we check properties

I For instance, for the simple grammar P 7→ P P|(P)|(),ensure that on the even parenthesis list elements, the depthlevel is not more than 2(())()()((())) violates the property, but (((())))() does not(i.e., is valid)

I Ensure that starting from the N-th element of the list atleast m levels are foundFor N = 2,m = 2, ()()() violates the property, and()(())((())) does not

I For a more complex grammar there is much more fun :)

I Let’s look at more real-world examples. . .

Page 30: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

10/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC (CODE) ANALYSIS

We can look for anything. . .

I Which is not functional related (the code compiles)

I Usually we check properties

I For instance, for the simple grammar P 7→ P P|(P)|(),ensure that on the even parenthesis list elements, the depthlevel is not more than 2(())()()((())) violates the property, but (((())))() does not(i.e., is valid)

I Ensure that starting from the N-th element of the list atleast m levels are foundFor N = 2,m = 2, ()()() violates the property, and()(())((())) does not

I For a more complex grammar there is much more fun :)

I Let’s look at more real-world examples. . .

Page 31: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

10/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC (CODE) ANALYSIS

We can look for anything. . .

I Which is not functional related (the code compiles)I Usually we check properties

I For instance, for the simple grammar P 7→ P P|(P)|(),ensure that on the even parenthesis list elements, the depthlevel is not more than 2(())()()((())) violates the property, but (((())))() does not(i.e., is valid)

I Ensure that starting from the N-th element of the list atleast m levels are foundFor N = 2,m = 2, ()()() violates the property, and()(())((())) does not

I For a more complex grammar there is much more fun :)

I Let’s look at more real-world examples. . .

Page 32: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

10/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC (CODE) ANALYSIS

We can look for anything. . .

I Which is not functional related (the code compiles)I Usually we check properties

I For instance, for the simple grammar P 7→ P P|(P)|(),ensure that on the even parenthesis list elements, the depthlevel is not more than 2(())()()((())) violates the property, but (((())))() does not(i.e., is valid)

I Ensure that starting from the N-th element of the list atleast m levels are foundFor N = 2,m = 2, ()()() violates the property, and()(())((())) does not

I For a more complex grammar there is much more fun :)

I Let’s look at more real-world examples. . .

Page 33: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

10/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC (CODE) ANALYSIS

We can look for anything. . .

I Which is not functional related (the code compiles)I Usually we check properties

I For instance, for the simple grammar P 7→ P P|(P)|(),ensure that on the even parenthesis list elements, the depthlevel is not more than 2(())()()((())) violates the property, but (((())))() does not(i.e., is valid)

I Ensure that starting from the N-th element of the list atleast m levels are foundFor N = 2,m = 2, ()()() violates the property, and()(())((())) does not

I For a more complex grammar there is much more fun :)

I Let’s look at more real-world examples. . .

Page 34: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

10/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC (CODE) ANALYSIS

We can look for anything. . .

I Which is not functional related (the code compiles)I Usually we check properties

I For instance, for the simple grammar P 7→ P P|(P)|(),ensure that on the even parenthesis list elements, the depthlevel is not more than 2(())()()((())) violates the property, but (((())))() does not(i.e., is valid)

I Ensure that starting from the N-th element of the list atleast m levels are foundFor N = 2,m = 2, ()()() violates the property, and()(())((())) does not

I For a more complex grammar there is much more fun :)

I Let’s look at more real-world examples. . .

Page 35: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

10/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC (CODE) ANALYSIS

We can look for anything. . .

I Which is not functional related (the code compiles)I Usually we check properties

I For instance, for the simple grammar P 7→ P P|(P)|(),ensure that on the even parenthesis list elements, the depthlevel is not more than 2(())()()((())) violates the property, but (((())))() does not(i.e., is valid)

I Ensure that starting from the N-th element of the list atleast m levels are foundFor N = 2,m = 2, ()()() violates the property, and()(())((())) does not

I For a more complex grammar there is much more fun :)

I Let’s look at more real-world examples. . .

Page 36: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checked

I Cross-Site Scripting (XSS) attacksI SQL injection (SQLI) attacksI Buffer overflow attacks

XSS

I Works by supplying data to users which can lead toinsecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 37: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checked

I Cross-Site Scripting (XSS) attacksI SQL injection (SQLI) attacksI Buffer overflow attacks

XSS

I Works by supplying data to users which can lead toinsecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 38: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checkedI Cross-Site Scripting (XSS) attacks

I SQL injection (SQLI) attacksI Buffer overflow attacks

XSS

I Works by supplying data to users which can lead toinsecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 39: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checkedI Cross-Site Scripting (XSS) attacksI SQL injection (SQLI) attacks

I Buffer overflow attacks

XSS

I Works by supplying data to users which can lead toinsecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 40: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checkedI Cross-Site Scripting (XSS) attacksI SQL injection (SQLI) attacksI Buffer overflow attacks

XSS

I Works by supplying data to users which can lead toinsecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 41: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checkedI Cross-Site Scripting (XSS) attacksI SQL injection (SQLI) attacksI Buffer overflow attacks

XSS

I Works by supplying data to users which can lead toinsecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 42: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checkedI Cross-Site Scripting (XSS) attacksI SQL injection (SQLI) attacksI Buffer overflow attacks

XSSI Works by supplying data to users which can lead to

insecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 43: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

11/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES

Source Code Security Issues

I Many problems arise when the user input is not checkedI Cross-Site Scripting (XSS) attacksI SQL injection (SQLI) attacksI Buffer overflow attacks

XSSI Works by supplying data to users which can lead to

insecure actions, executing unwanted javascript, or addinga sub-site filled with publicity or others

I Simple example: in a forum, users are allowed to insertcomments. If the comment is displayed as-it-is, an attackermight successfully inject malicious code that will affect theforum users

Page 44: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

12/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IISQLI

I Essentially works by supplying data to the database forexecuting undesired actions, e.g., a user inputs a searchcriterion, and the database looks for the users matchingthis criterion:SELECT * from users where name=’$CRIT’;

What if the criterion is:a’; DROP TABLE users

How to prevent this attack using static analysis?

I A very simple approach is to guarantee that a sanitizationfunction is called before the storing or displaying theinput. Many languages provide such built-in functions,e.g., PHP provides the htmlspecialchars() function

Page 45: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

12/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IISQLI

I Essentially works by supplying data to the database forexecuting undesired actions, e.g., a user inputs a searchcriterion, and the database looks for the users matchingthis criterion:SELECT * from users where name=’$CRIT’;

What if the criterion is:a’; DROP TABLE users

How to prevent this attack using static analysis?

I A very simple approach is to guarantee that a sanitizationfunction is called before the storing or displaying theinput. Many languages provide such built-in functions,e.g., PHP provides the htmlspecialchars() function

Page 46: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

12/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IISQLI

I Essentially works by supplying data to the database forexecuting undesired actions, e.g., a user inputs a searchcriterion, and the database looks for the users matchingthis criterion:SELECT * from users where name=’$CRIT’;

What if the criterion is:a’; DROP TABLE users

How to prevent this attack using static analysis?

I A very simple approach is to guarantee that a sanitizationfunction is called before the storing or displaying theinput. Many languages provide such built-in functions,e.g., PHP provides the htmlspecialchars() function

Page 47: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

12/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IISQLI

I Essentially works by supplying data to the database forexecuting undesired actions, e.g., a user inputs a searchcriterion, and the database looks for the users matchingthis criterion:SELECT * from users where name=’$CRIT’;

What if the criterion is:a’; DROP TABLE users

How to prevent this attack using static analysis?

I A very simple approach is to guarantee that a sanitizationfunction is called before the storing or displaying theinput. Many languages provide such built-in functions,e.g., PHP provides the htmlspecialchars() function

Page 48: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

13/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IIIBuffer Overflow

I The canonical example:

#include <string.h>#define BUFFSIZE 100void load (char *userdata){

char buff[BUFFSIZE];strcpy(buff, userdata); //not good

}

int main (int argc, char **argv){load(argv[1]);...

}

I A string which is longer than BUFFSIZE will be writteninto the memory space of the function load, potentiallyoverwriting the return address

I A string which contains code and the memory address ofthis code in the position of the return address will do thetrick

Page 49: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

13/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IIIBuffer Overflow

I The canonical example:

#include <string.h>#define BUFFSIZE 100void load (char *userdata){

char buff[BUFFSIZE];strcpy(buff, userdata); //not good

}

int main (int argc, char **argv){load(argv[1]);...

}

I A string which is longer than BUFFSIZE will be writteninto the memory space of the function load, potentiallyoverwriting the return address

I A string which contains code and the memory address ofthis code in the position of the return address will do thetrick

Page 50: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

13/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IIIBuffer Overflow

I The canonical example:

#include <string.h>#define BUFFSIZE 100void load (char *userdata){

char buff[BUFFSIZE];strcpy(buff, userdata); //not good

}

int main (int argc, char **argv){load(argv[1]);...

}

I A string which is longer than BUFFSIZE will be writteninto the memory space of the function load, potentiallyoverwriting the return address

I A string which contains code and the memory address ofthis code in the position of the return address will do thetrick

Page 51: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

13/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IIIBuffer Overflow

I The canonical example:

#include <string.h>#define BUFFSIZE 100void load (char *userdata){

char buff[BUFFSIZE];strcpy(buff, userdata); //not good

}

int main (int argc, char **argv){load(argv[1]);...

}

I A string which is longer than BUFFSIZE will be writteninto the memory space of the function load, potentiallyoverwriting the return address

I A string which contains code and the memory address ofthis code in the position of the return address will do thetrick

Page 52: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

14/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IV

Buffer Overflow

I If a program with a potentially susceptible stack overflowruns with admin privileges, consequences can bedevastating

Many other properties

I Each file should be closed only onceI Each db connection that was open should be closedI Any other properties are welcome

How to perform static analysis (SA)?

Page 53: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

14/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IV

Buffer OverflowI If a program with a potentially susceptible stack overflow

runs with admin privileges, consequences can bedevastating

Many other properties

I Each file should be closed only onceI Each db connection that was open should be closedI Any other properties are welcome

How to perform static analysis (SA)?

Page 54: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

14/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IV

Buffer OverflowI If a program with a potentially susceptible stack overflow

runs with admin privileges, consequences can bedevastating

Many other properties

I Each file should be closed only onceI Each db connection that was open should be closedI Any other properties are welcome

How to perform static analysis (SA)?

Page 55: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

14/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IV

Buffer OverflowI If a program with a potentially susceptible stack overflow

runs with admin privileges, consequences can bedevastating

Many other properties

I Each file should be closed only once

I Each db connection that was open should be closedI Any other properties are welcome

How to perform static analysis (SA)?

Page 56: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

14/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IV

Buffer OverflowI If a program with a potentially susceptible stack overflow

runs with admin privileges, consequences can bedevastating

Many other properties

I Each file should be closed only onceI Each db connection that was open should be closed

I Any other properties are welcome

How to perform static analysis (SA)?

Page 57: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

14/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IV

Buffer OverflowI If a program with a potentially susceptible stack overflow

runs with admin privileges, consequences can bedevastating

Many other properties

I Each file should be closed only onceI Each db connection that was open should be closedI Any other properties are welcome

How to perform static analysis (SA)?

Page 58: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

14/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS FOR SECURITY PROPERTIES IV

Buffer OverflowI If a program with a potentially susceptible stack overflow

runs with admin privileges, consequences can bedevastating

Many other properties

I Each file should be closed only onceI Each db connection that was open should be closedI Any other properties are welcome

How to perform static analysis (SA)?

Page 59: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

15/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES

Source Code is?

I A text representation of “computer instructions” in aspecific programming language

I Not text. . . Nor machine codeI A description of a system

Static Analysis is?

I The analysis of source code is performed by a staticanalyzer without executing the program under test

I The code is assumed to be compilable, thus we do not lookfor lexical, syntactical, or type errors that a compiler finds

Page 60: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

15/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES

Source Code is?I A text representation of “computer instructions” in a

specific programming language

I Not text. . . Nor machine codeI A description of a system

Static Analysis is?

I The analysis of source code is performed by a staticanalyzer without executing the program under test

I The code is assumed to be compilable, thus we do not lookfor lexical, syntactical, or type errors that a compiler finds

Page 61: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

15/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES

Source Code is?I A text representation of “computer instructions” in a

specific programming languageI Not text. . . Nor machine code

I A description of a system

Static Analysis is?

I The analysis of source code is performed by a staticanalyzer without executing the program under test

I The code is assumed to be compilable, thus we do not lookfor lexical, syntactical, or type errors that a compiler finds

Page 62: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

15/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES

Source Code is?I A text representation of “computer instructions” in a

specific programming languageI Not text. . . Nor machine codeI A description of a system

Static Analysis is?

I The analysis of source code is performed by a staticanalyzer without executing the program under test

I The code is assumed to be compilable, thus we do not lookfor lexical, syntactical, or type errors that a compiler finds

Page 63: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

15/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES

Source Code is?I A text representation of “computer instructions” in a

specific programming languageI Not text. . . Nor machine codeI A description of a system

Static Analysis is?

I The analysis of source code is performed by a staticanalyzer without executing the program under test

I The code is assumed to be compilable, thus we do not lookfor lexical, syntactical, or type errors that a compiler finds

Page 64: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

15/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES

Source Code is?I A text representation of “computer instructions” in a

specific programming languageI Not text. . . Nor machine codeI A description of a system

Static Analysis is?

I The analysis of source code is performed by a staticanalyzer without executing the program under test

I The code is assumed to be compilable, thus we do not lookfor lexical, syntactical, or type errors that a compiler finds

Page 65: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

15/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES

Source Code is?I A text representation of “computer instructions” in a

specific programming languageI Not text. . . Nor machine codeI A description of a system

Static Analysis is?

I The analysis of source code is performed by a staticanalyzer without executing the program under test

I The code is assumed to be compilable, thus we do not lookfor lexical, syntactical, or type errors that a compiler finds

Page 66: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?

I This would be terriblyn hard

I A data structure is needed to effectively manipulate it

I A famous structure to manipulate the source code is anAbstract Syntax Tree (AST)

I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 67: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?

I This would be terriblyn hardI A data structure is needed to effectively manipulate it

I A famous structure to manipulate the source code is anAbstract Syntax Tree (AST)

I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 68: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?I This would be terriblyn hard

I A data structure is needed to effectively manipulate it

I A famous structure to manipulate the source code is anAbstract Syntax Tree (AST)

I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 69: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?I This would be terriblyn hard

I A data structure is needed to effectively manipulate it

I A famous structure to manipulate the source code is anAbstract Syntax Tree (AST)

I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 70: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?I This would be terriblyn hard

I A data structure is needed to effectively manipulate itI A famous structure to manipulate the source code is an

Abstract Syntax Tree (AST)

I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 71: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?I This would be terriblyn hard

I A data structure is needed to effectively manipulate itI A famous structure to manipulate the source code is an

Abstract Syntax Tree (AST)I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 72: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?I This would be terriblyn hard

I A data structure is needed to effectively manipulate itI A famous structure to manipulate the source code is an

Abstract Syntax Tree (AST)I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 73: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?I This would be terriblyn hard

I A data structure is needed to effectively manipulate itI A famous structure to manipulate the source code is an

Abstract Syntax Tree (AST)I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 74: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

16/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS PRINCIPLES (CONT.)How do we analyze the source code then?

I Can we treat it as text?I This would be terriblyn hard

I A data structure is needed to effectively manipulate itI A famous structure to manipulate the source code is an

Abstract Syntax Tree (AST)I To build an AST, we need to parse the code

A parser. . .

I Can be generated automatically by a parser generator(takes a context free grammar (CFG) as an input andproduces a parser)

I Takes a CFG production (a sentence / source code) andproduces a “parse tree”

Page 75: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

17/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

AN AST

AST for 2 + 3 ∗ 4

Page 76: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

18/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS

Mainly cares about data flow and data dependencies

Consider the following code:

void func (int x){int y = 10;int z = 2 + y;

if(x > 10){z=10;x = y + 1;

}print(z);

}

How can Dataflow analysis help us?

Page 77: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

18/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS

Mainly cares about data flow and data dependencies

Consider the following code:

void func (int x){int y = 10;int z = 2 + y;

if(x > 10){z=10;x = y + 1;

}print(z);

}

How can Dataflow analysis help us?

Page 78: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

18/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS

Mainly cares about data flow and data dependencies

Consider the following code:

void func (int x){int y = 10;int z = 2 + y;

if(x > 10){z=10;x = y + 1;

}print(z);

}

How can Dataflow analysis help us?

Page 79: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

19/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — FORWARD ANALYSIS

The data flow

Page 80: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

20/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — FORWARD ANALYSIS

The data flow

Potential values

I Negative array indicesI Closed DB connections

Page 81: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

20/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — FORWARD ANALYSIS

The data flow

Potential values

I Negative array indicesI Closed DB connections

Page 82: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

20/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — FORWARD ANALYSIS

The data flow

Potential valuesI Negative array indices

I Closed DB connections

Page 83: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

20/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — FORWARD ANALYSIS

The data flow

Potential valuesI Negative array indicesI Closed DB connections

Page 84: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

21/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — BACKWARD ANALYSIS

The data flow

Data dependencies

I Useful for security testingI Useful for dead code elimination

Page 85: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

21/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — BACKWARD ANALYSIS

The data flow

Data dependencies

I Useful for security testingI Useful for dead code elimination

Page 86: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

21/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — BACKWARD ANALYSIS

The data flow

Data dependencies

I Useful for security testing

I Useful for dead code elimination

Page 87: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

21/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — BACKWARD ANALYSIS

The data flow

Data dependencies

I Useful for security testingI Useful for dead code elimination

Page 88: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

22/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — CONTROL FLOW GRAPH

void func (int x){//b1int y = 10;int z = 2 + y;

if(x > 10){//b2z=10;x = y + 1;

}//b3print(z);

}

(b1)y=10z=2+y

(b2)z=10x=y+1

(b3)

x>10

x≤10

Page 89: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

22/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — CONTROL FLOW GRAPH

void func (int x){//b1int y = 10;int z = 2 + y;

if(x > 10){//b2z=10;x = y + 1;

}//b3print(z);

}

(b1)y=10z=2+y

(b2)z=10x=y+1

(b3)

x>10

x≤10

Page 90: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

23/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS

(b1)y=10z=2+y

(b2)z=10x=y+1

(b3)

x>10

x≤10

(b1)x y z↓ 10 12

(b2)x y z

y+1 ↓ 10

(b3)x y z↓ ↓ ↓

x>10

x≤10

Page 91: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

24/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS (2)

(b1)x y z↓ 10 12

(b2)x y z

y+1 ↓ 10

(b3)x y z↓ ↓ ↓

x>10

x≤10

Putting inputs andoutputs. . .

I Assume ⊥ = notenough information

I Assume > = “toomuch” information(all possible values)

Page 92: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

24/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS (2)

(b1)x y z↓ 10 12

(b2)x y z

y+1 ↓ 10

(b3)x y z↓ ↓ ↓

x>10

x≤10

Putting inputs andoutputs. . .

I Assume ⊥ = notenough information

I Assume > = “toomuch” information(all possible values)

Page 93: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

24/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS (2)

(b1)x y z↓ 10 12

(b2)x y z

y+1 ↓ 10

(b3)x y z↓ ↓ ↓

x>10

x≤10

Putting inputs andoutputs. . .

I Assume ⊥ = notenough information

I Assume > = “toomuch” information(all possible values)

Page 94: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

24/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS (2)

(b1)> > >x y z↓ 10 12⊥ ⊥ ⊥

(b2)⊥ ⊥ ⊥x y z

y+1 ↓ 10⊥ ⊥ ⊥

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Putting inputs andoutputs. . .

I Assume ⊥ = notenough information

I Assume > = “toomuch” information(all possible values)

Page 95: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12⊥ ⊥ ⊥

(b2)⊥ ⊥ ⊥x y z

y+1 ↓ 10⊥ ⊥ ⊥

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

Page 96: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12⊥ ⊥ ⊥

(b2)⊥ ⊥ ⊥x y z

y+1 ↓ 10⊥ ⊥ ⊥

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

Page 97: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12⊥ ⊥ ⊥

(b2)⊥ ⊥ ⊥x y z

y+1 ↓ 10⊥ ⊥ ⊥

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

Page 98: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12⊥ ⊥ ⊥

(b2)⊥ ⊥ ⊥x y z

y+1 ↓ 10⊥ ⊥ ⊥

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

Page 99: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)⊥ ⊥ ⊥x y z

y+1 ↓ 10⊥ ⊥ ⊥

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

(b1)

Page 100: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)> 10 12x y z

y+1 ↓ 10⊥ ⊥ ⊥

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

(b2)

Page 101: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)> 10 12x y z

y+1 ↓ 1011 10 10

(b3)⊥ ⊥ ⊥x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

(b2)

Page 102: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)> 10 12x y z

y+1 ↓ 1011 10 10

(b3){>, 11} 10 {12, 10}

x y z↓ ↓ ↓⊥ ⊥ ⊥

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

(b3)

Page 103: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)> 10 12x y z

y+1 ↓ 1011 10 10

(b3){>, 11} {10} {12, 10}

x y z↓ ↓ ↓> 10 {12, 10}

x>10

x≤10

Propagation. . .

I Propagate frominputs to outputs

I From one block toanother

I Join the inputs

(b3)

Page 104: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)> 10 12x y z

y+1 ↓ 1011 10 10

(b3){>, 11} {10} {12, 10}

x y z↓ ↓ ↓> 10 {12, 10}

x>10

x≤10

Value AnalysisYup... that’s what we did

I y=10 is truth for allexecution pathsOptimizations: constantpropagation (lesscalculations), removal ofy (smaller stackconsumption)

I z ∈ {10, 12}Optimizations: smallerdata type of z; perhapsthis might be furtherused to verify that allfunctions return valuesbetween [11− 20]?

Page 105: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)> 10 12x y z

y+1 ↓ 1011 10 10

(b3){>, 11} {10} {12, 10}

x y z↓ ↓ ↓> 10 {12, 10}

x>10

x≤10

Value AnalysisYup... that’s what we did

I y=10 is truth for allexecution pathsOptimizations: constantpropagation (lesscalculations), removal ofy (smaller stackconsumption)

I z ∈ {10, 12}Optimizations: smallerdata type of z; perhapsthis might be furtherused to verify that allfunctions return valuesbetween [11− 20]?

Page 106: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

25/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW NOTIONS — THE PROPAGATION GAME

(b1)> > >x y z↓ 10 12> 10 12

(b2)> 10 12x y z

y+1 ↓ 1011 10 10

(b3){>, 11} {10} {12, 10}

x y z↓ ↓ ↓> 10 {12, 10}

x>10

x≤10

Value AnalysisYup... that’s what we did

I y=10 is truth for allexecution pathsOptimizations: constantpropagation (lesscalculations), removal ofy (smaller stackconsumption)

I z ∈ {10, 12}Optimizations: smallerdata type of z; perhapsthis might be furtherused to verify that allfunctions return valuesbetween [11− 20]?

Page 107: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)I ∀x, y ∈ L,∃x ∨ y(sup) & ∃x ∧ y(inf)I If ∀S ⊆ L,∃ ∨ S(greatest element >) & ∧S(least element ⊥) L

is a complete lattice

I x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → LI Output outb = fb(inn) is calculated with a transfer functionI inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}

(usually ∨ = ∪)

Page 108: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)

I ∀x, y ∈ L,∃x ∨ y(sup) & ∃x ∧ y(inf)I If ∀S ⊆ L,∃ ∨ S(greatest element >) & ∧S(least element ⊥) L

is a complete lattice

I x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → LI Output outb = fb(inn) is calculated with a transfer functionI inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}

(usually ∨ = ∪)

Page 109: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)I ∀x, y ∈ L, ∃x ∨ y(sup) & ∃x ∧ y(inf)

I If ∀S ⊆ L,∃ ∨ S(greatest element >) & ∧S(least element ⊥) Lis a complete lattice

I x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → LI Output outb = fb(inn) is calculated with a transfer functionI inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}

(usually ∨ = ∪)

Page 110: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)I ∀x, y ∈ L, ∃x ∨ y(sup) & ∃x ∧ y(inf)I If ∀S ⊆ L, ∃ ∨ S(greatest element >) & ∧S(least element ⊥) L

is a complete latticeI x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...

Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → LI Output outb = fb(inn) is calculated with a transfer functionI inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}

(usually ∨ = ∪)

Page 111: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)I ∀x, y ∈ L, ∃x ∨ y(sup) & ∃x ∧ y(inf)I If ∀S ⊆ L, ∃ ∨ S(greatest element >) & ∧S(least element ⊥) L

is a complete latticeI x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...

Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → LI Output outb = fb(inn) is calculated with a transfer functionI inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}

(usually ∨ = ∪)

Page 112: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)I ∀x, y ∈ L, ∃x ∨ y(sup) & ∃x ∧ y(inf)I If ∀S ⊆ L, ∃ ∨ S(greatest element >) & ∧S(least element ⊥) L

is a complete latticeI x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...

Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → L

I Output outb = fb(inn) is calculated with a transfer functionI inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}

(usually ∨ = ∪)

Page 113: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)I ∀x, y ∈ L, ∃x ∨ y(sup) & ∃x ∧ y(inf)I If ∀S ⊆ L, ∃ ∨ S(greatest element >) & ∧S(least element ⊥) L

is a complete latticeI x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...

Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → LI Output outb = fb(inn) is calculated with a transfer function

I inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}(usually ∨ = ∪)

Page 114: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

26/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS

Lattice L (The analysis domain)

I A partially ordered set (L,≤)I ∀x, y ∈ L, ∃x ∨ y(sup) & ∃x ∧ y(inf)I If ∀S ⊆ L, ∃ ∨ S(greatest element >) & ∧S(least element ⊥) L

is a complete latticeI x0 ≤ x1 ≤ x2... =⇒ ∃n : xn = xn+1 = xn+2 = ...

Ensures ascending chain condition (no infinite progress)

Inputs, outputs, and transfer functions, depend on thecontrol flow block (CFB) b

I Transfer function fb : L → LI Output outb = fb(inn) is calculated with a transfer functionI inb = denotes inputs of b, inb = ∨{outm|m ∈ pred(b)}

(usually ∨ = ∪)

Page 115: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

27/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS (CONT.)

Requirements

I The join operation ∨must not lose information: ∨(x, y) ⊇ xand ∨(x, y) ⊇ y

I ∀f ∈ F, x ⊆ y =⇒ f (x) ⊆ f (y), all transfer functions aremonotones, i.e., they preserve the given order

Necessary conditions for termination!

I Previous requirements + ascending chain condition

We won’t see proofs

I However, this is certainly proven and easy to find. . .

Page 116: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

27/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS (CONT.)

Requirements

I The join operation ∨must not lose information: ∨(x, y) ⊇ xand ∨(x, y) ⊇ y

I ∀f ∈ F, x ⊆ y =⇒ f (x) ⊆ f (y), all transfer functions aremonotones, i.e., they preserve the given order

Necessary conditions for termination!

I Previous requirements + ascending chain condition

We won’t see proofs

I However, this is certainly proven and easy to find. . .

Page 117: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

27/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS (CONT.)

Requirements

I The join operation ∨must not lose information: ∨(x, y) ⊇ xand ∨(x, y) ⊇ y

I ∀f ∈ F, x ⊆ y =⇒ f (x) ⊆ f (y), all transfer functions aremonotones, i.e., they preserve the given order

Necessary conditions for termination!

I Previous requirements + ascending chain condition

We won’t see proofs

I However, this is certainly proven and easy to find. . .

Page 118: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

27/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS (CONT.)

Requirements

I The join operation ∨must not lose information: ∨(x, y) ⊇ xand ∨(x, y) ⊇ y

I ∀f ∈ F, x ⊆ y =⇒ f (x) ⊆ f (y), all transfer functions aremonotones, i.e., they preserve the given order

Necessary conditions for termination!

I Previous requirements + ascending chain condition

We won’t see proofs

I However, this is certainly proven and easy to find. . .

Page 119: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

27/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS BASICS (CONT.)

Requirements

I The join operation ∨must not lose information: ∨(x, y) ⊇ xand ∨(x, y) ⊇ y

I ∀f ∈ F, x ⊆ y =⇒ f (x) ⊆ f (y), all transfer functions aremonotones, i.e., they preserve the given order

Necessary conditions for termination!

I Previous requirements + ascending chain condition

We won’t see proofs

I However, this is certainly proven and easy to find. . .

Page 120: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

28/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATA ANALYSIS BASICS — CALCULATION

ALGORITHM

Maximal Fixed Point algorithm

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization (>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← B \ {b0}while worklist 6= ∅ do

b← pop(worklist)inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist ∪ bend if

end while

Page 121: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

28/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATA ANALYSIS BASICS — CALCULATION

ALGORITHM

Maximal Fixed Point algorithm

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization (>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← B \ {b0}while worklist 6= ∅ do

b← pop(worklist)inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist ∪ bend if

end while

Page 122: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

29/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

void bk (int j, char c[], size_t sc){

size_t midx = 4;int d = 0,i =0;while(i< j){

d = midx - i;c[d] = i;i++;

}}

(b1)j sc midx d i↓ ↓ 4 0 0

(b2)j sc midx d i↓ ↓ ↓ midx-i i+1

(b3)j sc midx d i↓ ↓ ↓ ↓ ↓

i<j

i≥j

i≥j

i<j

Page 123: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

30/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(2)Lattice L is defined over theset of all subsets of {−, 0,+}and ⊆

I ∨ = ∪> ∈ {+,−}⊥ = no information yet

I Operations over LI Addition(

⊕) and

multiplication (⊗

) oflattice values:{−}

⊕{+} =

{−, 0,+} ∧ {0}⊕{+} =

{+} ∧ {−}⊕{−}∧. . .

I fb ∈ F use operations +sign of constants

(b1)j sc midx d i↓ ↓ 4 0 0

(b2)j sc midx d i↓ ↓ ↓ midx-i i+1

(b3)j sc midx d i↓ ↓ ↓ ↓ ↓

i<j

i≥j

i≥j

i<j

Page 124: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

30/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(2)Lattice L is defined over theset of all subsets of {−, 0,+}and ⊆

I ∨ = ∪> ∈ {+,−}⊥ = no information yet

I Operations over LI Addition(

⊕) and

multiplication (⊗

) oflattice values:{−}

⊕{+} =

{−, 0,+} ∧ {0}⊕{+} =

{+} ∧ {−}⊕{−}∧. . .

I fb ∈ F use operations +sign of constants

(b1)j sc midx d i↓ ↓ {+} {0} {0}

(b2)j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

(b3)j sc midx d i↓ ↓ ↓ ↓ ↓

i<j

i≥j

i≥j

i<j

Page 125: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← B \ {b0}while worklist 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)j sc midx d i↓ ↓ {+} {0} {0}

(b2)j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

(b3)j sc midx d i↓ ↓ ↓ ↓ ↓

Page 126: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← B \ {b0}while worklist 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)j sc midx d i↓ ↓ {+} {0} {0}⊥ ⊥ ⊥ ⊥ ⊥

(b2)j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

⊥ ⊥ ⊥ ⊥ ⊥

(b3)j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 127: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← B \ {b0}while worklist 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}⊥ ⊥ ⊥ ⊥ ⊥

(b2)> > > > >j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

⊥ ⊥ ⊥ ⊥ ⊥

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 128: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← B \ {b0}while worklist 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > > > >j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

⊥ ⊥ ⊥ ⊥ ⊥

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 129: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while worklist 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > > > >j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

⊥ ⊥ ⊥ ⊥ ⊥

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 130: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > > > >j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

⊥ ⊥ ⊥ ⊥ ⊥

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 131: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)for all b ∈ B do

outb ← fb(⊥)end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b2,b3})//b=b2

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > > > >j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

⊥ ⊥ ⊥ ⊥ ⊥

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 132: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0} {0}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

⊥ ⊥ ⊥ ⊥ ⊥

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 133: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb2 ← fb2(inb2)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0} {0}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} {+} {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 134: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb2 ← fb2(inb2)if outb2 changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0} {0}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} {+} {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 135: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb2 ← fb2(inb2)if outb2 changed then{b3} ← {b3} ∪ {b2}

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0} {0}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} {+} {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 136: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0} {0}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} {+} {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 137: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0,+} {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} {+} {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 138: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb2 ← fb2(inb2)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0,+} {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} {+,−} = > {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 139: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb2 ← fb2(inb2)if outb2 changed then{b3} ← {b3} ∪ {b2}

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0,+} {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 140: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} {0,+} {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 141: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 142: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb2 ← ∨{outm|m ∈ pred(b2)}outb2 ← fb2(inb2)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 143: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b3} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > > > >j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 144: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b3} 6= ∅ do

b← pop({} )

inb3 ← ∨{outm|m ∈ pred(b3)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ ↓ ↓⊥ ⊥ ⊥ ⊥ ⊥

Page 145: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb3 ← ∨{outm|m ∈ pred(b3)}outb3 ← fb3(inb3)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ ↓ ↓> > {+} > {0,+}

Page 146: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb3 ← ∨{outm|m ∈ pred(b3)}outb3 ← fb3(inb3)if outb changed then{} ←worklist ∪ {b3}

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ ↓ ↓> > {+} > {0,+}

Page 147: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b3} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ ↓ ↓> > {+} > {0,+}

Page 148: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b3} 6= ∅ do

b← pop({} )

inb3 ← ∨{outm|m ∈ pred(b3)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ ↓ ↓> > {+} > {0,+}

Page 149: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {b2,b3} 6= ∅ do

b← pop({b3} )

inb3 ← ∨{outm|m ∈ pred(b3)}outb3 ← fb3(inb3)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ ↓ ↓> > {+} > {0,+}

Page 150: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

31/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3)

for all b ∈ B dooutb ← fb(⊥)

end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

(b1)> > > > >j sc midx d i↓ ↓ {+} {0} {0}> > {+} {0} {0}

(b2)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ {[midx]}

⊕{−}

⊗{[i]} {[i]}

⊕{+}

> > {+} > {+}

(b3)> > {+} > {0,+}j sc midx d i↓ ↓ ↓ ↓ ↓> > {+} > {0,+}

Page 151: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

32/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3.1)for all b ∈ B do

outb ← fb(⊥)end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

Fixpoint Reached!

Possible values:j sc midx d i> > {+} > {0,+}

(specially in b2)

void bk (int j, char c[], size_t sc){

size_t midx = 4;int d = 0,i =0;while(i< j){

d = midx - i;c[d] = i;i++;

}}

Page 152: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

32/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3.1)for all b ∈ B do

outb ← fb(⊥)end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

Fixpoint Reached!Possible values:

j sc midx d i> > {+} > {0,+}

(specially in b2)

void bk (int j, char c[], size_t sc){

size_t midx = 4;int d = 0,i =0;while(i< j){

d = midx - i;c[d] = i;i++;

}}

Page 153: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

32/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DATAFLOW ANALYSIS — SIGN ANALYSIS EXAMPLE

(3.1)for all b ∈ B do

outb ← fb(⊥)end forinb0 ← I //I=initialization(>.⊥, ∅ are usual)outb0 ← fn0(I)worklist← {b2, b3}while {} 6= ∅ do

b← pop(worklist)

inb ← ∨{outm|m ∈ pred(b)}outb ← fb(inb)if outb changed then

worklist←worklist∪ b

end ifend while

Fixpoint Reached!Possible values:

j sc midx d i> > {+} > {0,+}

(specially in b2)

void bk (int j, char c[], size_t sc){

size_t midx = 4;int d = 0,i =0;while(i< j){

d = midx - i;c[d] = i;i++;

}}

Page 154: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

33/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS – FINAL REMARKS

I It can be used for many things including statementreachability

I It can be used for test generation, for determining theinputs that will cover the code

I False-positives can be acceptableI There exist well-known plug-in (or feature) based tools,

e.g., Frama-CI There exist other formal approaches, e.g., abstract

interpretation

Page 155: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

33/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS – FINAL REMARKS

I It can be used for many things including statementreachability

I It can be used for test generation, for determining theinputs that will cover the code

I False-positives can be acceptableI There exist well-known plug-in (or feature) based tools,

e.g., Frama-CI There exist other formal approaches, e.g., abstract

interpretation

Page 156: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

33/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS – FINAL REMARKS

I It can be used for many things including statementreachability

I It can be used for test generation, for determining theinputs that will cover the code

I False-positives can be acceptableI There exist well-known plug-in (or feature) based tools,

e.g., Frama-CI There exist other formal approaches, e.g., abstract

interpretation

Page 157: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

33/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS – FINAL REMARKS

I It can be used for many things including statementreachability

I It can be used for test generation, for determining theinputs that will cover the code

I False-positives can be acceptable

I There exist well-known plug-in (or feature) based tools,e.g., Frama-C

I There exist other formal approaches, e.g., abstractinterpretation

Page 158: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

33/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS – FINAL REMARKS

I It can be used for many things including statementreachability

I It can be used for test generation, for determining theinputs that will cover the code

I False-positives can be acceptableI There exist well-known plug-in (or feature) based tools,

e.g., Frama-C

I There exist other formal approaches, e.g., abstractinterpretation

Page 159: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

33/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATIC ANALYSIS – FINAL REMARKS

I It can be used for many things including statementreachability

I It can be used for test generation, for determining theinputs that will cover the code

I False-positives can be acceptableI There exist well-known plug-in (or feature) based tools,

e.g., Frama-CI There exist other formal approaches, e.g., abstract

interpretation

Page 160: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

34/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

Passive Testing using NetworkTraces

Page 161: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

35/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

ARCHITECTURE(EXAMPLE)An image, 103 words. . .

I Direction: From server to clientI P.O. = one network interface of the server (usually a P.O. is

associated with a network host, it can vary. . . )I No information regarding on-line or off-line trace

collection (perhaps on-line is more interesting)

How do we test this?

Page 162: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

35/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

ARCHITECTURE(EXAMPLE)An image, 103 words. . .

I Direction: From server to clientI P.O. = one network interface of the server (usually a P.O. is

associated with a network host, it can vary. . . )I No information regarding on-line or off-line trace

collection (perhaps on-line is more interesting)

How do we test this?

Page 163: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

35/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

ARCHITECTURE(EXAMPLE)An image, 103 words. . .

I Direction: From server to client

I P.O. = one network interface of the server (usually a P.O. isassociated with a network host, it can vary. . . )

I No information regarding on-line or off-line tracecollection (perhaps on-line is more interesting)

How do we test this?

Page 164: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

35/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

ARCHITECTURE(EXAMPLE)An image, 103 words. . .

I Direction: From server to clientI P.O. = one network interface of the server (usually a P.O. is

associated with a network host, it can vary. . . )

I No information regarding on-line or off-line tracecollection (perhaps on-line is more interesting)

How do we test this?

Page 165: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

35/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

ARCHITECTURE(EXAMPLE)An image, 103 words. . .

I Direction: From server to clientI P.O. = one network interface of the server (usually a P.O. is

associated with a network host, it can vary. . . )I No information regarding on-line or off-line trace

collection (perhaps on-line is more interesting)

How do we test this?

Page 166: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

35/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

ARCHITECTURE(EXAMPLE)An image, 103 words. . .

I Direction: From server to clientI P.O. = one network interface of the server (usually a P.O. is

associated with a network host, it can vary. . . )I No information regarding on-line or off-line trace

collection (perhaps on-line is more interesting)

How do we test this?

Page 167: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.

I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attack

I Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 168: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.

I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attack

I Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 169: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.

I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attack

I Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 170: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.

I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attackI Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 171: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attack

I Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 172: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attackI Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 173: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attackI Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 174: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

36/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 101What is DPI?

I The process of examining the data of a network packetwhen searching for specific parameter values in it:

I Protocol non-compliance, e.g., TCP SYN-FIN (or xmas treepacket)

I Viruses, buffer overflows, etc.I These can be identified by a signatureI A signature is a known binary sequence inside a packet that

identifies the attackI Specific application layer data, for instance:a’; DROP TABLE users

What to do, once certain value is found?

I Report the finding (usually the search targets forprohibited elements)

Page 175: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

37/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 102

I Mostly in firewalls, Intrusion Detection Systems (IDS), andIntrusion Prevention Systems (IPS)

I Off-line approaches are not very popularI Off-line approaches are sometimes considered as a form of

computer forensics (examining an already killedcomputer)

How to describe which values to search?

I There exist various approaches (Cisco, Snort, etc.),nonetheless, they tend to have common points. . .

Page 176: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

37/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 102

I Mostly in firewalls, Intrusion Detection Systems (IDS), andIntrusion Prevention Systems (IPS)

I Off-line approaches are not very popularI Off-line approaches are sometimes considered as a form of

computer forensics (examining an already killedcomputer)

How to describe which values to search?

I There exist various approaches (Cisco, Snort, etc.),nonetheless, they tend to have common points. . .

Page 177: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

37/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 102

I Mostly in firewalls, Intrusion Detection Systems (IDS), andIntrusion Prevention Systems (IPS)

I Off-line approaches are not very popular

I Off-line approaches are sometimes considered as a form ofcomputer forensics (examining an already killedcomputer)

How to describe which values to search?

I There exist various approaches (Cisco, Snort, etc.),nonetheless, they tend to have common points. . .

Page 178: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

37/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 102

I Mostly in firewalls, Intrusion Detection Systems (IDS), andIntrusion Prevention Systems (IPS)

I Off-line approaches are not very popularI Off-line approaches are sometimes considered as a form of

computer forensics (examining an already killedcomputer)

How to describe which values to search?

I There exist various approaches (Cisco, Snort, etc.),nonetheless, they tend to have common points. . .

Page 179: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

37/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 102

I Mostly in firewalls, Intrusion Detection Systems (IDS), andIntrusion Prevention Systems (IPS)

I Off-line approaches are not very popularI Off-line approaches are sometimes considered as a form of

computer forensics (examining an already killedcomputer)

How to describe which values to search?

I There exist various approaches (Cisco, Snort, etc.),nonetheless, they tend to have common points. . .

Page 180: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

37/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DEEP PACKET INSPECTION (DPI) 102

I Mostly in firewalls, Intrusion Detection Systems (IDS), andIntrusion Prevention Systems (IPS)

I Off-line approaches are not very popularI Off-line approaches are sometimes considered as a form of

computer forensics (examining an already killedcomputer)

How to describe which values to search?I There exist various approaches (Cisco, Snort, etc.),

nonetheless, they tend to have common points. . .

Page 181: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

38/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DESCRIBING VALUES IN DPI

Based on “rules”

I For common protocols (IP, TCP, UDP, HTTP, etc.) variablesare provided, for example:

alert tcp any any -> any 21 (msg:"FTP ROOT"; content:"USER root"; nocase;)

I A signature can be described as a set of strings (potentiallybinary) of a regular language

I It can be described by a regular expression

alert tcp any any -> any 80 (content:"/foo.php?id=";pcre:"/foo.php?id=[0-9]{1,10}/iU";)

(All the previous rules were written using the syntax ofsnort)

Page 182: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

38/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DESCRIBING VALUES IN DPI

Based on “rules”I For common protocols (IP, TCP, UDP, HTTP, etc.) variables

are provided, for example:

alert tcp any any -> any 21 (msg:"FTP ROOT"; content:"USER root"; nocase;)

I A signature can be described as a set of strings (potentiallybinary) of a regular language

I It can be described by a regular expression

alert tcp any any -> any 80 (content:"/foo.php?id=";pcre:"/foo.php?id=[0-9]{1,10}/iU";)

(All the previous rules were written using the syntax ofsnort)

Page 183: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

38/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DESCRIBING VALUES IN DPI

Based on “rules”I For common protocols (IP, TCP, UDP, HTTP, etc.) variables

are provided, for example:

alert tcp any any -> any 21 (msg:"FTP ROOT"; content:"USER root"; nocase;)

I A signature can be described as a set of strings (potentiallybinary) of a regular language

I It can be described by a regular expression

alert tcp any any -> any 80 (content:"/foo.php?id=";pcre:"/foo.php?id=[0-9]{1,10}/iU";)

(All the previous rules were written using the syntax ofsnort)

Page 184: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

38/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DESCRIBING VALUES IN DPI

Based on “rules”I For common protocols (IP, TCP, UDP, HTTP, etc.) variables

are provided, for example:

alert tcp any any -> any 21 (msg:"FTP ROOT"; content:"USER root"; nocase;)

I A signature can be described as a set of strings (potentiallybinary) of a regular language

I It can be described by a regular expression

alert tcp any any -> any 80 (content:"/foo.php?id=";pcre:"/foo.php?id=[0-9]{1,10}/iU";)

(All the previous rules were written using the syntax ofsnort)

Page 185: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

38/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DESCRIBING VALUES IN DPI

Based on “rules”I For common protocols (IP, TCP, UDP, HTTP, etc.) variables

are provided, for example:

alert tcp any any -> any 21 (msg:"FTP ROOT"; content:"USER root"; nocase;)

I A signature can be described as a set of strings (potentiallybinary) of a regular language

I It can be described by a regular expression

alert tcp any any -> any 80 (content:"/foo.php?id=";pcre:"/foo.php?id=[0-9]{1,10}/iU";)

(All the previous rules were written using the syntax ofsnort)

Page 186: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

38/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DESCRIBING VALUES IN DPI

Based on “rules”I For common protocols (IP, TCP, UDP, HTTP, etc.) variables

are provided, for example:

alert tcp any any -> any 21 (msg:"FTP ROOT"; content:"USER root"; nocase;)

I A signature can be described as a set of strings (potentiallybinary) of a regular language

I It can be described by a regular expression

alert tcp any any -> any 80 (content:"/foo.php?id=";pcre:"/foo.php?id=[0-9]{1,10}/iU";)

(All the previous rules were written using the syntax ofsnort)

Page 187: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

38/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DESCRIBING VALUES IN DPI

Based on “rules”I For common protocols (IP, TCP, UDP, HTTP, etc.) variables

are provided, for example:

alert tcp any any -> any 21 (msg:"FTP ROOT"; content:"USER root"; nocase;)

I A signature can be described as a set of strings (potentiallybinary) of a regular language

I It can be described by a regular expression

alert tcp any any -> any 80 (content:"/foo.php?id=";pcre:"/foo.php?id=[0-9]{1,10}/iU";)

(All the previous rules were written using the syntax ofsnort)

Page 188: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

39/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATELESS AND STATEFUL DPI CONCEPTS

Stateless DPI

I Each rule is applied to each network packet and no state issaved

I It can be good if we are tying to search for a virustransmitted over SMTP, for instance

Stateful DPI

I Certain information regarding the state of the connectiongets stored

I For example, the FTP data channel get associated to theFTP control channel

Page 189: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

39/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATELESS AND STATEFUL DPI CONCEPTS

Stateless DPII Each rule is applied to each network packet and no state is

saved

I It can be good if we are tying to search for a virustransmitted over SMTP, for instance

Stateful DPI

I Certain information regarding the state of the connectiongets stored

I For example, the FTP data channel get associated to theFTP control channel

Page 190: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

39/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATELESS AND STATEFUL DPI CONCEPTS

Stateless DPII Each rule is applied to each network packet and no state is

savedI It can be good if we are tying to search for a virus

transmitted over SMTP, for instance

Stateful DPI

I Certain information regarding the state of the connectiongets stored

I For example, the FTP data channel get associated to theFTP control channel

Page 191: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

39/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATELESS AND STATEFUL DPI CONCEPTS

Stateless DPII Each rule is applied to each network packet and no state is

savedI It can be good if we are tying to search for a virus

transmitted over SMTP, for instance

Stateful DPI

I Certain information regarding the state of the connectiongets stored

I For example, the FTP data channel get associated to theFTP control channel

Page 192: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

39/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATELESS AND STATEFUL DPI CONCEPTS

Stateless DPII Each rule is applied to each network packet and no state is

savedI It can be good if we are tying to search for a virus

transmitted over SMTP, for instance

Stateful DPII Certain information regarding the state of the connection

gets stored

I For example, the FTP data channel get associated to theFTP control channel

Page 193: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

39/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATELESS AND STATEFUL DPI CONCEPTS

Stateless DPII Each rule is applied to each network packet and no state is

savedI It can be good if we are tying to search for a virus

transmitted over SMTP, for instance

Stateful DPII Certain information regarding the state of the connection

gets storedI For example, the FTP data channel get associated to the

FTP control channel

Page 194: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

40/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

BEYOND DPIWhat if we want more?.. What is more?

I The Very Simple Network Protocol (VSNP)I Every client request has an integer IDI Each client request is followed by a VSNP server responseI The VSNP server response should be even if the request ID

is odd, and vice-versa

I Assume we want to check the odd/even, even/oddconstraints

I Or we want to check the behavior of non-typical protocolimplementations or not predefined set of rules

I Or to choose what to save and how to correlate it withfuture packets

Passive Testing using Network Traces

Page 195: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

40/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

BEYOND DPIWhat if we want more?.. What is more?

I The Very Simple Network Protocol (VSNP)I Every client request has an integer IDI Each client request is followed by a VSNP server responseI The VSNP server response should be even if the request ID

is odd, and vice-versa

I Assume we want to check the odd/even, even/oddconstraints

I Or we want to check the behavior of non-typical protocolimplementations or not predefined set of rules

I Or to choose what to save and how to correlate it withfuture packets

Passive Testing using Network Traces

Page 196: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

40/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

BEYOND DPIWhat if we want more?.. What is more?

I The Very Simple Network Protocol (VSNP)I Every client request has an integer IDI Each client request is followed by a VSNP server responseI The VSNP server response should be even if the request ID

is odd, and vice-versa

I Assume we want to check the odd/even, even/oddconstraints

I Or we want to check the behavior of non-typical protocolimplementations or not predefined set of rules

I Or to choose what to save and how to correlate it withfuture packets

Passive Testing using Network Traces

Page 197: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

40/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

BEYOND DPIWhat if we want more?.. What is more?

I The Very Simple Network Protocol (VSNP)I Every client request has an integer IDI Each client request is followed by a VSNP server responseI The VSNP server response should be even if the request ID

is odd, and vice-versa

I Assume we want to check the odd/even, even/oddconstraints

I Or we want to check the behavior of non-typical protocolimplementations or not predefined set of rules

I Or to choose what to save and how to correlate it withfuture packets

Passive Testing using Network Traces

Page 198: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

40/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

BEYOND DPIWhat if we want more?.. What is more?

I The Very Simple Network Protocol (VSNP)I Every client request has an integer IDI Each client request is followed by a VSNP server responseI The VSNP server response should be even if the request ID

is odd, and vice-versa

I Assume we want to check the odd/even, even/oddconstraints

I Or we want to check the behavior of non-typical protocolimplementations or not predefined set of rules

I Or to choose what to save and how to correlate it withfuture packets

Passive Testing using Network Traces

Page 199: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

40/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

BEYOND DPIWhat if we want more?.. What is more?

I The Very Simple Network Protocol (VSNP)I Every client request has an integer IDI Each client request is followed by a VSNP server responseI The VSNP server response should be even if the request ID

is odd, and vice-versa

I Assume we want to check the odd/even, even/oddconstraints

I Or we want to check the behavior of non-typical protocolimplementations or not predefined set of rules

I Or to choose what to save and how to correlate it withfuture packets

Passive Testing using Network Traces

Page 200: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

41/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES 101

We want to guarantee that:

I Certain functional and non-functional requirements holdover the network traces, also known as properties (orrules, or invariants, more on this later)

I We are able to analyze properties that go beyond singlepacket analysis or simple associations

Consider the VSNP protocol and its even/odd, odd/evenproperty

I Let’s take a look at a potential network trace to list someproperties

Page 201: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

41/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES 101

We want to guarantee that:

I Certain functional and non-functional requirements holdover the network traces, also known as properties (orrules, or invariants, more on this later)

I We are able to analyze properties that go beyond singlepacket analysis or simple associations

Consider the VSNP protocol and its even/odd, odd/evenproperty

I Let’s take a look at a potential network trace to list someproperties

Page 202: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

41/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES 101

We want to guarantee that:

I Certain functional and non-functional requirements holdover the network traces, also known as properties (orrules, or invariants, more on this later)

I We are able to analyze properties that go beyond singlepacket analysis or simple associations

Consider the VSNP protocol and its even/odd, odd/evenproperty

I Let’s take a look at a potential network trace to list someproperties

Page 203: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

41/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES 101

We want to guarantee that:

I Certain functional and non-functional requirements holdover the network traces, also known as properties (orrules, or invariants, more on this later)

I We are able to analyze properties that go beyond singlepacket analysis or simple associations

Consider the VSNP protocol and its even/odd, odd/evenproperty

I Let’s take a look at a potential network trace to list someproperties

Page 204: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

41/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES 101

We want to guarantee that:

I Certain functional and non-functional requirements holdover the network traces, also known as properties (orrules, or invariants, more on this later)

I We are able to analyze properties that go beyond singlepacket analysis or simple associations

Consider the VSNP protocol and its even/odd, odd/evenproperty

I Let’s take a look at a potential network trace to list someproperties

Page 205: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

41/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES 101

We want to guarantee that:

I Certain functional and non-functional requirements holdover the network traces, also known as properties (orrules, or invariants, more on this later)

I We are able to analyze properties that go beyond singlepacket analysis or simple associations

Consider the VSNP protocol and its even/odd, odd/evenproperty

I Let’s take a look at a potential network trace to list someproperties

Page 206: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

42/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS

Consider the following trace

ID:2N:

ID:3N:

ID:4N:

ID:2N: 77

ID:4N: 89

ID:21N:

ID:21N: 101

Questions

I How can two requests / responses be together?

I As packets go through, the P.O. allows to observe nsequential client(s) requests before a response arrives to theP.O.

I What do we do with a non-replied request?

I It depends if the analysis is performed on-line or off-line

Page 207: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

42/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS

Consider the following traceID:2N:

ID:3N:

ID:4N:

ID:2N: 77

ID:4N: 89

ID:21N:

ID:21N: 101

Questions

I How can two requests / responses be together?

I As packets go through, the P.O. allows to observe nsequential client(s) requests before a response arrives to theP.O.

I What do we do with a non-replied request?

I It depends if the analysis is performed on-line or off-line

Page 208: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

42/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS

Consider the following traceID:2N:

ID:3N:

ID:4N:

ID:2N: 77

ID:4N: 89

ID:21N:

ID:21N: 101

Questions

I How can two requests / responses be together?

I As packets go through, the P.O. allows to observe nsequential client(s) requests before a response arrives to theP.O.

I What do we do with a non-replied request?

I It depends if the analysis is performed on-line or off-line

Page 209: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

42/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS

Consider the following traceID:2N:

ID:3N:

ID:4N:

ID:2N: 77

ID:4N: 89

ID:21N:

ID:21N: 101

Questions

I How can two requests / responses be together?

I As packets go through, the P.O. allows to observe nsequential client(s) requests before a response arrives to theP.O.

I What do we do with a non-replied request?

I It depends if the analysis is performed on-line or off-line

Page 210: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

42/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS

Consider the following traceID:2N:

ID:3N:

ID:4N:

ID:2N: 77

ID:4N: 89

ID:21N:

ID:21N: 101

Questions

I How can two requests / responses be together?I As packets go through, the P.O. allows to observe n

sequential client(s) requests before a response arrives to theP.O.

I What do we do with a non-replied request?

I It depends if the analysis is performed on-line or off-line

Page 211: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

42/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS

Consider the following traceID:2N:

ID:3N:

ID:4N:

ID:2N: 77

ID:4N: 89

ID:21N:

ID:21N: 101

Questions

I How can two requests / responses be together?I As packets go through, the P.O. allows to observe n

sequential client(s) requests before a response arrives to theP.O.

I What do we do with a non-replied request?

I It depends if the analysis is performed on-line or off-line

Page 212: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

42/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS

Consider the following traceID:2N:

ID:3N:

ID:4N:

ID:2N: 77

ID:4N: 89

ID:21N:

ID:21N: 101

Questions

I How can two requests / responses be together?I As packets go through, the P.O. allows to observe n

sequential client(s) requests before a response arrives to theP.O.

I What do we do with a non-replied request?I It depends if the analysis is performed on-line or off-line

Page 213: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

Actions:

Page 214: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:2N:

Tester Storing queue / MemoryID:2N:

Actions:Read REQ with ID = 2

Page 215: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:2N:

Actions:Store packet in the requests to be replied queue

Page 216: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:3N:

Tester Storing queue / MemoryID:2N:

ID:2N:

Actions:Read REQ with ID = 3

Page 217: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:2N:

ID:3N:

Actions:Store packet in the requests to be replied queue

Page 218: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:4N:

Tester Storing queue / MemoryID:2N:

ID:2N:

ID:3N:

Actions:Read REQ with ID = 4

Page 219: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:2N:

ID:3N:

ID:4N:

Actions:Store packet in the requests to be replied queue

Page 220: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:2N: 77

Tester Storing queue / MemoryID:2N:

ID:2N:

ID:3N:

ID:4N:

Actions:Read RES with ID = 2

Page 221: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:2N: 77

Tester Storing queue / MemoryID:2N:

ID:2N:

ID:3N:

ID:4N:

Actions:Check to which stored packet it corresponds

Page 222: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:2N: 77

Tester Storing queue / MemoryID:2N:

ID:2N:

ID:3N:

ID:4N:

Actions:Verify the property

Page 223: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:2N:

ID:3N:

ID:4N:

Actions:Report PASS (+)

Page 224: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:4N:

Actions:Remove corresponding stored packet from the stored requestsqueue

Page 225: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:4N: 89

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:4N:

Actions:Read RES with ID = 4

Page 226: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:4N: 89

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:4N:

Actions:Check to which stored packet it corresponds

Page 227: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:4N: 89

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:4N:

Actions:Verify the property

Page 228: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:4N:

Actions:Report PASS (+)

Page 229: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Remove corresponding stored packet from the stored requestsqueue

Page 230: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:21N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Read REQ with ID = 21

Page 231: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:21N:

Actions:Store packet in the requests to be replied queue

Page 232: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:21N: 101

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:21N:

Actions:Read RES with ID = 21

Page 233: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:21N: 101

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:21N:

Actions:Check to which stored packet it corresponds

Page 234: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

ID:21N: 101

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:21N:

Actions:Verify the property

Page 235: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

ID:21N:

Actions:Report FAIL (-)

Page 236: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Remove corresponding stored packet from the stored requestsqueue

Page 237: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:What’s next?

Page 238: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Wait. . . wait until another packet comes (live capture)

Page 239: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Until when do we wait? What do we do with this left-alonepacket

Page 240: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Until a determined timeout

Page 241: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

Actions:After the determined timeout, report TIME FAIL (!) andremove packets whose time stored > timeout

Page 242: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Now assume it was off-line

Page 243: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

EOT(end of trace)

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:Read EOT

Page 244: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

ID:3N:

Actions:For each packet left on memory report ?

Page 245: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

43/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE ON-LINE VS. OFF-LINE MONITORING VERDICTS

Incoming (or read) packetsID:2N:

Tester Storing queue / MemoryID:2N:

Actions:Report INCONCLUSIVE (?)! (What if the trace was cut beforethe packet arrived?) and delete the left packets

Page 246: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

44/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CORRELATED NETWORK INTERACTIONS (CONT.)

Some conclusions / questions

I Given the nature of properties, matching packets cannot beexpressed by a regular language

I How do we express the properties?

I Given the network interactions, each packet can representa connection in any state (bad, very bad. . . )

I How to avoid resource consumption?

Page 247: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

44/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CORRELATED NETWORK INTERACTIONS (CONT.)

Some conclusions / questions

I Given the nature of properties, matching packets cannot beexpressed by a regular language

I How do we express the properties?I Given the network interactions, each packet can represent

a connection in any state (bad, very bad. . . )

I How to avoid resource consumption?

Page 248: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

44/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CORRELATED NETWORK INTERACTIONS (CONT.)

Some conclusions / questions

I Given the nature of properties, matching packets cannot beexpressed by a regular language

I How do we express the properties?

I Given the network interactions, each packet can representa connection in any state (bad, very bad. . . )

I How to avoid resource consumption?

Page 249: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

44/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CORRELATED NETWORK INTERACTIONS (CONT.)

Some conclusions / questions

I Given the nature of properties, matching packets cannot beexpressed by a regular language

I How do we express the properties?I Given the network interactions, each packet can represent

a connection in any state (bad, very bad. . . )

I How to avoid resource consumption?

Page 250: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

44/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CORRELATED NETWORK INTERACTIONS (CONT.)

Some conclusions / questions

I Given the nature of properties, matching packets cannot beexpressed by a regular language

I How do we express the properties?I Given the network interactions, each packet can represent

a connection in any state (bad, very bad. . . )I How to avoid resource consumption?

Page 251: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

45/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS (CONT. 2)Interaction

Invariants or properties

I Test purposes hold over all the observed network tracesI E.g., β6 is not allowed to occur before the occurrence of α4I There have been proposed many languages to express

invariants

Page 252: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

45/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS (CONT. 2)Interaction

Invariants or properties

I Test purposes hold over all the observed network traces

I E.g., β6 is not allowed to occur before the occurrence of α4I There have been proposed many languages to express

invariants

Page 253: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

45/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS (CONT. 2)Interaction

Invariants or properties

I Test purposes hold over all the observed network tracesI E.g., β6 is not allowed to occur before the occurrence of α4

I There have been proposed many languages to expressinvariants

Page 254: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

45/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

UNDERSTANDING CORRELATED NETWORK

INTERACTIONS (CONT. 2)Interaction

Invariants or properties

I Test purposes hold over all the observed network tracesI E.g., β6 is not allowed to occur before the occurrence of α4I There have been proposed many languages to express

invariants

Page 255: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)

I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)I Is not ideal if many states are assumed to be possible for

different connections (many sequential requests)

I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 256: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)

I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)I Is not ideal if many states are assumed to be possible for

different connections (many sequential requests)I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 257: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)I Describes an ω-regular language (over infinite words)

I Fits pretty well if assuming an interaction has a single state(the P.O. is not situated on a server, for instance)

I Is not ideal if many states are assumed to be possible fordifferent connections (many sequential requests)

I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 258: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)

I Is not ideal if many states are assumed to be possible fordifferent connections (many sequential requests)

I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 259: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)I Is not ideal if many states are assumed to be possible for

different connections (many sequential requests)

I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 260: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)I Is not ideal if many states are assumed to be possible for

different connections (many sequential requests)I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 261: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)I Is not ideal if many states are assumed to be possible for

different connections (many sequential requests)I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the task

I Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 262: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)I Is not ideal if many states are assumed to be possible for

different connections (many sequential requests)I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .

I Concepts behind the languages are more important. . .

Page 263: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

46/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING PROPERTIES

Many languages have been proposed. . .

I Linear Temporal Logic (LTL)I Describes an ω-regular language (over infinite words)I Fits pretty well if assuming an interaction has a single state

(the P.O. is not situated on a server, for instance)I Is not ideal if many states are assumed to be possible for

different connections (many sequential requests)I Languages based on Context Free Grammars (CFG)

I Languages are adjusted to the taskI Examples: XML-based, or others. . .I Concepts behind the languages are more important. . .

Page 264: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

47/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS

I A property expresses a sequence of premises andconsequences of non-chronologically arranged, but relatednetwork packets

I Example: in English, if(A) then B (before or after), or if{if(A) then B(before or after)} then C (before or after), etc...

I A property must be able to characterize different packets

I That is, to describe a template of each packetExample: a packet that uses TCP in the port 1010 and thefirst value is an ID, etc.

I A property must be able to create relationships betweenthe different network packets

I That is, to describe how packet A relates to packet B(request port is equal to response port, etc.)

Page 265: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

47/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS

I A property expresses a sequence of premises andconsequences of non-chronologically arranged, but relatednetwork packets

I Example: in English, if(A) then B (before or after), or if{if(A) then B(before or after)} then C (before or after), etc...

I A property must be able to characterize different packets

I That is, to describe a template of each packetExample: a packet that uses TCP in the port 1010 and thefirst value is an ID, etc.

I A property must be able to create relationships betweenthe different network packets

I That is, to describe how packet A relates to packet B(request port is equal to response port, etc.)

Page 266: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

47/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS

I A property expresses a sequence of premises andconsequences of non-chronologically arranged, but relatednetwork packets

I Example: in English, if(A) then B (before or after), or if{if(A) then B(before or after)} then C (before or after), etc...

I A property must be able to characterize different packets

I That is, to describe a template of each packetExample: a packet that uses TCP in the port 1010 and thefirst value is an ID, etc.

I A property must be able to create relationships betweenthe different network packets

I That is, to describe how packet A relates to packet B(request port is equal to response port, etc.)

Page 267: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

47/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS

I A property expresses a sequence of premises andconsequences of non-chronologically arranged, but relatednetwork packets

I Example: in English, if(A) then B (before or after), or if{if(A) then B(before or after)} then C (before or after), etc...

I A property must be able to characterize different packets

I That is, to describe a template of each packetExample: a packet that uses TCP in the port 1010 and thefirst value is an ID, etc.

I A property must be able to create relationships betweenthe different network packets

I That is, to describe how packet A relates to packet B(request port is equal to response port, etc.)

Page 268: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

47/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS

I A property expresses a sequence of premises andconsequences of non-chronologically arranged, but relatednetwork packets

I Example: in English, if(A) then B (before or after), or if{if(A) then B(before or after)} then C (before or after), etc...

I A property must be able to characterize different packetsI That is, to describe a template of each packet

Example: a packet that uses TCP in the port 1010 and thefirst value is an ID, etc.

I A property must be able to create relationships betweenthe different network packets

I That is, to describe how packet A relates to packet B(request port is equal to response port, etc.)

Page 269: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

47/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS

I A property expresses a sequence of premises andconsequences of non-chronologically arranged, but relatednetwork packets

I Example: in English, if(A) then B (before or after), or if{if(A) then B(before or after)} then C (before or after), etc...

I A property must be able to characterize different packetsI That is, to describe a template of each packet

Example: a packet that uses TCP in the port 1010 and thefirst value is an ID, etc.

I A property must be able to create relationships betweenthe different network packets

I That is, to describe how packet A relates to packet B(request port is equal to response port, etc.)

Page 270: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

47/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS

I A property expresses a sequence of premises andconsequences of non-chronologically arranged, but relatednetwork packets

I Example: in English, if(A) then B (before or after), or if{if(A) then B(before or after)} then C (before or after), etc...

I A property must be able to characterize different packetsI That is, to describe a template of each packet

Example: a packet that uses TCP in the port 1010 and thefirst value is an ID, etc.

I A property must be able to create relationships betweenthe different network packets

I That is, to describe how packet A relates to packet B(request port is equal to response port, etc.)

Page 271: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .

I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet valuesI These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 272: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .

I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet valuesI These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 273: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .I Request TCP source port = response destination port?

I Individual comparisons are performed against constants orprevious (chronological) packet values

I These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 274: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet values

I These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 275: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet valuesI These comparisons make relationships between packets

I A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 276: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet valuesI These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 277: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet valuesI These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 278: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet valuesI These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packet

I Hierarchical as you can see. . .

Page 279: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

48/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT.)How can we proceed to characterize packets andrelationships between them?

I Comparisons. . .I Request TCP source port = response destination port?I Individual comparisons are performed against constants or

previous (chronological) packet valuesI These comparisons make relationships between packetsI A set of individual comparisons characterizes a packet

To make individual comparisons we need granular dataaccess

I The SYN flag of the TCP header of the i-th the packetI Hierarchical as you can see. . .

Page 280: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

49/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT.)

Granular data access is needed

I Because byte offset access is not feasible

I Example: the value of the IHL (Internet header length)affects the offset mapping

I The communication protocol data point to other locations(semantics of the protocol)

I Otherwise, how to refer to the TCP SYN flag inside theTCP header of the packet?

Granular data access can be achieved with hierarchicalkey-value structure of the packet

I A mapping function between the raw data bytes and thestructure is needed

Page 281: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

49/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT.)

Granular data access is neededI Because byte offset access is not feasible

I Example: the value of the IHL (Internet header length)affects the offset mapping

I The communication protocol data point to other locations(semantics of the protocol)

I Otherwise, how to refer to the TCP SYN flag inside theTCP header of the packet?

Granular data access can be achieved with hierarchicalkey-value structure of the packet

I A mapping function between the raw data bytes and thestructure is needed

Page 282: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

49/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT.)

Granular data access is neededI Because byte offset access is not feasible

I Example: the value of the IHL (Internet header length)affects the offset mapping

I The communication protocol data point to other locations(semantics of the protocol)

I Otherwise, how to refer to the TCP SYN flag inside theTCP header of the packet?

Granular data access can be achieved with hierarchicalkey-value structure of the packet

I A mapping function between the raw data bytes and thestructure is needed

Page 283: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

49/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT.)

Granular data access is neededI Because byte offset access is not feasible

I Example: the value of the IHL (Internet header length)affects the offset mapping

I The communication protocol data point to other locations(semantics of the protocol)

I Otherwise, how to refer to the TCP SYN flag inside theTCP header of the packet?

Granular data access can be achieved with hierarchicalkey-value structure of the packet

I A mapping function between the raw data bytes and thestructure is needed

Page 284: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

49/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT.)

Granular data access is neededI Because byte offset access is not feasible

I Example: the value of the IHL (Internet header length)affects the offset mapping

I The communication protocol data point to other locations(semantics of the protocol)

I Otherwise, how to refer to the TCP SYN flag inside theTCP header of the packet?

Granular data access can be achieved with hierarchicalkey-value structure of the packet

I A mapping function between the raw data bytes and thestructure is needed

Page 285: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

49/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT.)

Granular data access is neededI Because byte offset access is not feasible

I Example: the value of the IHL (Internet header length)affects the offset mapping

I The communication protocol data point to other locations(semantics of the protocol)

I Otherwise, how to refer to the TCP SYN flag inside theTCP header of the packet?

Granular data access can be achieved with hierarchicalkey-value structure of the packet

I A mapping function between the raw data bytes and thestructure is needed

Page 286: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

49/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT.)

Granular data access is neededI Because byte offset access is not feasible

I Example: the value of the IHL (Internet header length)affects the offset mapping

I The communication protocol data point to other locations(semantics of the protocol)

I Otherwise, how to refer to the TCP SYN flag inside theTCP header of the packet?

Granular data access can be achieved with hierarchicalkey-value structure of the packet

I A mapping function between the raw data bytes and thestructure is needed

Page 287: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

50/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT. CONT.)

P packet. . .

(TCP Header)eb5d01bbd3e75a55cfa6e7c0801810001cd50000

. . .

Accessing the ACK flag ofthe TCP header

I Given packet P, the valueis 1 forP->TCP->flags->ACK

Page 288: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

50/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT. CONT.)

P packet. . .

(TCP Header)eb5d01bbd3e75a55cfa6e7c0801810001cd50000

. . .

Accessing the ACK flag ofthe TCP header

I Given packet P, the valueis 1 forP->TCP->flags->ACK

Page 289: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

50/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT. CONT.)

P packet. . .

(TCP Header)eb5d01bbd3e75a55cfa6e7c0801810001cd50000

. . .

Accessing the ACK flag ofthe TCP header

I Given packet P, the valueis 1 forP->TCP->flags->ACK

Page 290: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

50/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING WITH NETWORK TRACES

CONCEPTS (CONT. CONT. CONT.)

P packet. . .

(TCP Header)eb5d01bbd3e75a55cfa6e7c0801810001cd50000

. . .

Accessing the ACK flag ofthe TCP header

I Given packet P, the valueis 1 forP->TCP->flags->ACK

Page 291: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

51/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING INVARIANTS

Without a “formal” language

I For each response with an even number a “corresponding”request with an odd ID should have been received

I Example:

if RES(

RES->TCP->srcP = 1010 &RES->VSNP->Num % 2 = 0 &RES->IP->srcIP = REQ->IP->dstIP &REQ->VSNP->ID = RES->VSNP->ID &REQ->VSNP->ID %2 != 0

) then REQ<RES(

REQ->VSNP->Num = NULL)

Page 292: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

51/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING INVARIANTS

Without a “formal” language

I For each response with an even number a “corresponding”request with an odd ID should have been received

I Example:

if RES(

RES->TCP->srcP = 1010 &RES->VSNP->Num % 2 = 0 &RES->IP->srcIP = REQ->IP->dstIP &REQ->VSNP->ID = RES->VSNP->ID &REQ->VSNP->ID %2 != 0

) then REQ<RES(

REQ->VSNP->Num = NULL)

Page 293: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

51/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXPRESSING INVARIANTS

Without a “formal” language

I For each response with an even number a “corresponding”request with an odd ID should have been received

I Example:

if RES(

RES->TCP->srcP = 1010 &RES->VSNP->Num % 2 = 0 &RES->IP->srcIP = REQ->IP->dstIP &REQ->VSNP->ID = RES->VSNP->ID &REQ->VSNP->ID %2 != 0

) then REQ<RES(

REQ->VSNP->Num = NULL)

Page 294: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

52/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

WHY IS THIS NOT COMMERCIAL / WIDESPREAD?

Resource intensive!!! The industry lost interest. . .

What if I could identify a subset of properties to check at thecurrent execution point?..

How?

An idea: model the protocol as an FSM to identify its states?

Page 295: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

52/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

WHY IS THIS NOT COMMERCIAL / WIDESPREAD?Resource intensive!!! The industry lost interest. . .

What if I could identify a subset of properties to check at thecurrent execution point?..

How?

An idea: model the protocol as an FSM to identify its states?

Page 296: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

52/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

WHY IS THIS NOT COMMERCIAL / WIDESPREAD?Resource intensive!!! The industry lost interest. . .What if I could identify a subset of properties to check at thecurrent execution point?..

How?

An idea: model the protocol as an FSM to identify its states?

Page 297: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

52/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

WHY IS THIS NOT COMMERCIAL / WIDESPREAD?Resource intensive!!! The industry lost interest. . .What if I could identify a subset of properties to check at thecurrent execution point?..

How?

An idea: model the protocol as an FSM to identify its states?

Page 298: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

52/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

WHY IS THIS NOT COMMERCIAL / WIDESPREAD?Resource intensive!!! The industry lost interest. . .What if I could identify a subset of properties to check at thecurrent execution point?..

How?An idea: model the protocol as an FSM to identify its states?

Page 299: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

53/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE SIMPLE CONNECTION PROTOCOL (SCP)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Used to transmit data from one entity (called the upper layer)to the other (called the lower layer)

Page 300: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

53/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE SIMPLE CONNECTION PROTOCOL (SCP)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Used to transmit data from one entity (called the upper layer)to the other (called the lower layer)

Page 301: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

53/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE SIMPLE CONNECTION PROTOCOL (SCP)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

It starts with a QoS negotiation phase, the sending entityproposes the level, the receiving decides

Page 302: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

53/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE SIMPLE CONNECTION PROTOCOL (SCP)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Then, the transmitting entity attempts connecting to thereceiving one (up to 3 times)

Page 303: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

53/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

THE SIMPLE CONNECTION PROTOCOL (SCP)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

After a successful connection, the transmitting entity sendsdata, the receiving entity acknowledges

Page 304: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

54/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CHECKING SCP PROPERTIES. . .

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Assume we want to check that:

I An acknowledgment is always sent after transmitting dataI After a successful connection a reset is sentI Only relevant properties to the current execution state!

Page 305: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

54/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CHECKING SCP PROPERTIES. . .

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Assume we want to check that:I An acknowledgment is always sent after transmitting data

I After a successful connection a reset is sentI Only relevant properties to the current execution state!

Page 306: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

54/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CHECKING SCP PROPERTIES. . .

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Assume we want to check that:I An acknowledgment is always sent after transmitting data

Why to check for data packets when the connection hasnot been even established?

I After a successful connection a reset is sentI Only relevant properties to the current execution state!

Page 307: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

54/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CHECKING SCP PROPERTIES. . .

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Assume we want to check that:I An acknowledgment is always sent after transmitting dataI After a successful connection a reset is sent

I Only relevant properties to the current execution state!

Page 308: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

54/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CHECKING SCP PROPERTIES. . .

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Assume we want to check that:I An acknowledgment is always sent after transmitting dataI After a successful connection a reset is sent

Why to check for connection requests/replies if no QoSlevel has been agreed on?

I Only relevant properties to the current execution state!

Page 309: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

54/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

CHECKING SCP PROPERTIES. . .

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Assume we want to check that:I An acknowledgment is always sent after transmitting dataI After a successful connection a reset is sentI Only relevant properties to the current execution state!

Page 310: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

55/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FINITE STATE MACHINE (FSM)

Do you remember?..An FSM is a 5-tupleM = 〈S, I,O, hs,S

′〉

I S is a finite nonempty setof states with a non-emptysubset S′

of initial statesI I and O are finite input and

output alphabetsI hs ⊆ S× I ×O× S is a

behavior relation

s1 s2

i1/o1

i2/o2

i1/o1

i1/o1, o3

S′= {s1}

FSMi1i2i1. . . o1o2o3. . .

Page 311: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

55/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FINITE STATE MACHINE (FSM)

Do you remember?..An FSM is a 5-tupleM = 〈S, I,O, hs,S

′〉I S is a finite nonempty set

of states with a non-emptysubset S′

of initial states

I I and O are finite input andoutput alphabets

I hs ⊆ S× I ×O× S is abehavior relation

s1 s2

i1/o1

i2/o2

i1/o1

i1/o1, o3

S′= {s1}

FSMi1i2i1. . . o1o2o3. . .

Page 312: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

55/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FINITE STATE MACHINE (FSM)

Do you remember?..An FSM is a 5-tupleM = 〈S, I,O, hs,S

′〉I S is a finite nonempty set

of states with a non-emptysubset S′

of initial statesI I and O are finite input and

output alphabets

I hs ⊆ S× I ×O× S is abehavior relation

s1 s2

i1/o1

i2/o2

i1/o1

i1/o1, o3

S′= {s1}

FSMi1i2i1. . . o1o2o3. . .

Page 313: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

55/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FINITE STATE MACHINE (FSM)

Do you remember?..An FSM is a 5-tupleM = 〈S, I,O, hs,S

′〉I S is a finite nonempty set

of states with a non-emptysubset S′

of initial statesI I and O are finite input and

output alphabetsI hs ⊆ S× I ×O× S is a

behavior relation

s1 s2

i1/o1

i2/o2

i1/o1

i1/o1, o3

S′= {s1}

FSMi1i2i1. . . o1o2o3. . .

Page 314: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

55/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FINITE STATE MACHINE (FSM)

Do you remember?..An FSM is a 5-tupleM = 〈S, I,O, hs,S

′〉I S is a finite nonempty set

of states with a non-emptysubset S′

of initial statesI I and O are finite input and

output alphabetsI hs ⊆ S× I ×O× S is a

behavior relation

s1 s2

i1/o1

i2/o2

i1/o1

i1/o1, o3

S′= {s1}

FSMi1i2i1. . . o1o2o3. . .

Page 315: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

55/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FINITE STATE MACHINE (FSM)

Do you remember?..An FSM is a 5-tupleM = 〈S, I,O, hs,S

′〉I S is a finite nonempty set

of states with a non-emptysubset S′

of initial statesI I and O are finite input and

output alphabetsI hs ⊆ S× I ×O× S is a

behavior relation

s1 s2

i1/o1

i2/o2

i1/o1

i1/o1, o3

S′= {s1}

FSMi1i2i1. . . o1o2o3. . .

Page 316: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

56/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXTENDED FSM (EFSM)

EFSM augments an FSMwith

I Context variablesI Input and output

parametersI PredicatesI Update functions

A transition is executed if thecorresponding predicate is true

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

i and o can have parametersContext variables are updatedwhen a transition is executedPredicates allow to execute thetransition if it is true

Page 317: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

56/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXTENDED FSM (EFSM)

EFSM augments an FSMwith

I Context variables

I Input and outputparameters

I PredicatesI Update functions

A transition is executed if thecorresponding predicate is true

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

i and o can have parametersContext variables are updatedwhen a transition is executedPredicates allow to execute thetransition if it is true

Page 318: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

56/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXTENDED FSM (EFSM)

EFSM augments an FSMwith

I Context variablesI Input and output

parameters

I PredicatesI Update functions

A transition is executed if thecorresponding predicate is true

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

i and o can have parametersContext variables are updatedwhen a transition is executedPredicates allow to execute thetransition if it is true

Page 319: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

56/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXTENDED FSM (EFSM)

EFSM augments an FSMwith

I Context variablesI Input and output

parametersI Predicates

I Update functions

A transition is executed if thecorresponding predicate is true

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

i and o can have parametersContext variables are updatedwhen a transition is executedPredicates allow to execute thetransition if it is true

Page 320: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

56/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXTENDED FSM (EFSM)

EFSM augments an FSMwith

I Context variablesI Input and output

parametersI PredicatesI Update functions

A transition is executed if thecorresponding predicate is true

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

i and o can have parametersContext variables are updatedwhen a transition is executedPredicates allow to execute thetransition if it is true

Page 321: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

56/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXTENDED FSM (EFSM)

EFSM augments an FSMwith

I Context variablesI Input and output

parametersI PredicatesI Update functions

A transition is executed if thecorresponding predicate is true

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

i and o can have parametersContext variables are updatedwhen a transition is executedPredicates allow to execute thetransition if it is true

Page 322: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

56/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

EXTENDED FSM (EFSM)

EFSM augments an FSMwith

I Context variablesI Input and output

parametersI PredicatesI Update functions

A transition is executed if thecorresponding predicate is true

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

i and o can have parametersContext variables are updatedwhen a transition is executedPredicates allow to execute thetransition if it is true

Page 323: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

57/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PROPERTIES OF AN FSM M = 〈S, I,O, hs,S′〉

An FSM can be

I deterministic if for each pair (s, i) ∈ S× I there exists at mostone pair (o, s′) ∈ O× S such that (s, i, o, s′) ∈ hs, otherwiseM is nondeterministic

I complete if for each (s, i) ∈ S× I there exists (o, s′) ∈ O× Ssuch that (s, i, o, s′) ∈ hs, otherwise M is partial

I observable if for each triple (s, i, o) ∈ S× I ×O there exist atmost one state s′ ∈ S such that (s, i, o, s′) ∈ hs, otherwise Mis nonobservable

This is a partial, nondeterministic and nonobservableFSM

s1 s2i1/o1

i2/o2

i1/o1

i1/o1, o3

Page 324: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

57/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PROPERTIES OF AN FSM M = 〈S, I,O, hs,S′〉

An FSM can beI deterministic if for each pair (s, i) ∈ S× I there exists at most

one pair (o, s′) ∈ O× S such that (s, i, o, s′) ∈ hs, otherwiseM is nondeterministic

I complete if for each (s, i) ∈ S× I there exists (o, s′) ∈ O× Ssuch that (s, i, o, s′) ∈ hs, otherwise M is partial

I observable if for each triple (s, i, o) ∈ S× I ×O there exist atmost one state s′ ∈ S such that (s, i, o, s′) ∈ hs, otherwise Mis nonobservable

This is a partial, nondeterministic and nonobservableFSM

s1 s2i1/o1

i2/o2

i1/o1

i1/o1, o3

Page 325: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

57/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PROPERTIES OF AN FSM M = 〈S, I,O, hs,S′〉

An FSM can beI deterministic if for each pair (s, i) ∈ S× I there exists at most

one pair (o, s′) ∈ O× S such that (s, i, o, s′) ∈ hs, otherwiseM is nondeterministic

I complete if for each (s, i) ∈ S× I there exists (o, s′) ∈ O× Ssuch that (s, i, o, s′) ∈ hs, otherwise M is partial

I observable if for each triple (s, i, o) ∈ S× I ×O there exist atmost one state s′ ∈ S such that (s, i, o, s′) ∈ hs, otherwise Mis nonobservable

This is a partial, nondeterministic and nonobservableFSM

s1 s2i1/o1

i2/o2

i1/o1

i1/o1, o3

Page 326: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

57/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PROPERTIES OF AN FSM M = 〈S, I,O, hs,S′〉

An FSM can beI deterministic if for each pair (s, i) ∈ S× I there exists at most

one pair (o, s′) ∈ O× S such that (s, i, o, s′) ∈ hs, otherwiseM is nondeterministic

I complete if for each (s, i) ∈ S× I there exists (o, s′) ∈ O× Ssuch that (s, i, o, s′) ∈ hs, otherwise M is partial

I observable if for each triple (s, i, o) ∈ S× I ×O there exist atmost one state s′ ∈ S such that (s, i, o, s′) ∈ hs, otherwise Mis nonobservable

This is a partial, nondeterministic and nonobservableFSM

s1 s2i1/o1

i2/o2

i1/o1

i1/o1, o3

Page 327: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

57/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PROPERTIES OF AN FSM M = 〈S, I,O, hs,S′〉

An FSM can beI deterministic if for each pair (s, i) ∈ S× I there exists at most

one pair (o, s′) ∈ O× S such that (s, i, o, s′) ∈ hs, otherwiseM is nondeterministic

I complete if for each (s, i) ∈ S× I there exists (o, s′) ∈ O× Ssuch that (s, i, o, s′) ∈ hs, otherwise M is partial

I observable if for each triple (s, i, o) ∈ S× I ×O there exist atmost one state s′ ∈ S such that (s, i, o, s′) ∈ hs, otherwise Mis nonobservable

This is a partial, nondeterministic and nonobservableFSM

s1 s2i1/o1

i2/o2

i1/o1

i1/o1, o3

Page 328: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

58/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FROM AN EFSM TO AN FSM

EFSM FSM

I Deleting context variables and predicates that significantlydepend on them (Context-free Slice)

EFSM

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

FSM

s1 s2

s3

T1:req / nosupportT2: conn,data / errT3: reset / abort

T4:req / support

T5:conn/ refuseT6: req,data / err

T8:conn / abortT9: reset / abort

T7:conn / accept

T10:data/ ackT11:req, conn / err

T12:reset / abort

Page 329: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

58/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FROM AN EFSM TO AN FSM

EFSM FSM

I Deleting context variables and predicates that significantlydepend on them (Context-free Slice)

EFSM

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

FSM

s1 s2

s3

T1:req / nosupportT2: conn,data / errT3: reset / abort

T4:req / support

T5:conn/ refuseT6: req,data / err

T8:conn / abortT9: reset / abort

T7:conn / accept

T10:data/ ackT11:req, conn / err

T12:reset / abort

Page 330: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

58/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

FROM AN EFSM TO AN FSM

EFSM FSM

I Deleting context variables and predicates that significantlydepend on them (Context-free Slice)

EFSM

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

FSM

s1 s2

s3

T1:req / nosupportT2: conn,data / errT3: reset / abort

T4:req / support

T5:conn/ refuseT6: req,data / err

T8:conn / abortT9: reset / abort

T7:conn / accept

T10:data/ ackT11:req, conn / err

T12:reset / abort

Page 331: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

59/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

HOMING SEQUENCE (HS)

I The sequence αallows toconclude aboutthe final state s′itrough theobservation of βi(the outputreaction)

I After applying αat any state si ∈ Sthe final state s′ibecomes known,depending on theobserved βi

I α is a homingsequence

s1 s2 . . . sn

s′1 s′2 s′′2 s′3

α/β1 α/β2 α/β3 α/βi

If βi = βj =⇒ s′i = s′j (For observableFSMs)

Page 332: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

59/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

HOMING SEQUENCE (HS)I The sequence α

allows toconclude aboutthe final state s′itrough theobservation of βi(the outputreaction)

I After applying αat any state si ∈ Sthe final state s′ibecomes known,depending on theobserved βi

I α is a homingsequence

s1 s2 . . . sn

s′1 s′2 s′′2 s′3

α/β1 α/β2 α/β3 α/βi

If βi = βj =⇒ s′i = s′j (For observableFSMs)

Page 333: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

59/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

HOMING SEQUENCE (HS)I The sequence α

allows toconclude aboutthe final state s′itrough theobservation of βi(the outputreaction)

I After applying αat any state si ∈ Sthe final state s′ibecomes known,depending on theobserved βi

I α is a homingsequence

s1 s2 . . . sn

s′1 s′2 s′′2 s′3

α/β1 α/β2 α/β3 α/βi

If βi = βj =⇒ s′i = s′j (For observableFSMs)

Page 334: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

59/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

HOMING SEQUENCE (HS)I The sequence α

allows toconclude aboutthe final state s′itrough theobservation of βi(the outputreaction)

I After applying αat any state si ∈ Sthe final state s′ibecomes known,depending on theobserved βi

I α is a homingsequence

s1 s2 . . . sn

s′1 s′2 s′′2 s′3

α/β1 α/β2 α/β3 α/βi

If βi = βj =⇒ s′i = s′j (For observableFSMs)

Page 335: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

59/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

HOMING SEQUENCE (HS)I The sequence α

allows toconclude aboutthe final state s′itrough theobservation of βi(the outputreaction)

I After applying αat any state si ∈ Sthe final state s′ibecomes known,depending on theobserved βi

I α is a homingsequence

s1 s2 . . . sn

s′1 s′2 s′′2 s′3

α/β1 α/β2 α/β3 α/βi

If βi = βj =⇒ s′i = s′j (For observableFSMs)

Page 336: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

60/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DERIVING ALL (NON-REDUNDANT) HS OF LENGTH l

I Derive a TruncatedSuccessor Tree (TST)∃o ∈ ((s1, ij, o, s

′1) ∈ hs&

(s2, ij, o, s′2) ∈ hs&

(s3, ij, o, s′3) ∈ hs. . . )

I Truncating rules

I Rule 1 The node P hasonly singletons

I Rule 2 The depth of thenode P is greater than l

s1, s2, ..., sn

. . . . . .

s′1, s′2, .., s

′x, s′′1 , s

′′2 , .., s

′′y

. . . . . .

i1ij

im

α is a homing sequence iff itlabels the path truncated by

Rule 1

Page 337: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

60/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DERIVING ALL (NON-REDUNDANT) HS OF LENGTH l

I Derive a TruncatedSuccessor Tree (TST)∃o ∈ ((s1, ij, o, s

′1) ∈ hs&

(s2, ij, o, s′2) ∈ hs&

(s3, ij, o, s′3) ∈ hs. . . )

I Truncating rules

I Rule 1 The node P hasonly singletons

I Rule 2 The depth of thenode P is greater than l

s1, s2, ..., sn

. . . . . .

s′1, s′2, .., s

′x, s′′1 , s

′′2 , .., s

′′y

. . . . . .

i1ij

im

α is a homing sequence iff itlabels the path truncated by

Rule 1

Page 338: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

60/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DERIVING ALL (NON-REDUNDANT) HS OF LENGTH l

I Derive a TruncatedSuccessor Tree (TST)∃o ∈ ((s1, ij, o, s

′1) ∈ hs&

(s2, ij, o, s′2) ∈ hs&

(s3, ij, o, s′3) ∈ hs. . . )

I Truncating rulesI Rule 1 The node P has

only singletons

I Rule 2 The depth of thenode P is greater than l

s1, s2, ..., sn

. . . . . .

s′1, s′2, .., s

′x, s′′1 , s

′′2 , .., s

′′y

. . . . . .

i1ij

im

α is a homing sequence iff itlabels the path truncated by

Rule 1

Page 339: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

60/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DERIVING ALL (NON-REDUNDANT) HS OF LENGTH l

I Derive a TruncatedSuccessor Tree (TST)∃o ∈ ((s1, ij, o, s

′1) ∈ hs&

(s2, ij, o, s′2) ∈ hs&

(s3, ij, o, s′3) ∈ hs. . . )

I Truncating rulesI Rule 1 The node P has

only singletonsI Rule 2 The depth of the

node P is greater than l

s1, s2, ..., sn

. . . . . .

s′1, s′2, .., s

′x, s′′1 , s

′′2 , .., s

′′y

. . . . . .

i1ij

im

α is a homing sequence iff itlabels the path truncated by

Rule 1

Page 340: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

60/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

DERIVING ALL (NON-REDUNDANT) HS OF LENGTH l

I Derive a TruncatedSuccessor Tree (TST)∃o ∈ ((s1, ij, o, s

′1) ∈ hs&

(s2, ij, o, s′2) ∈ hs&

(s3, ij, o, s′3) ∈ hs. . . )

I Truncating rulesI Rule 1 The node P has

only singletonsI Rule 2 The depth of the

node P is greater than l

s1, s2, ..., sn

. . . . . .

s′1, s′2, .., s

′x, s′′1 , s

′′2 , .., s

′′y

. . . . . .

i1ij

im

α is a homing sequence iff itlabels the path truncated by

Rule 1

Page 341: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

61/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

APPLYING STATE IDENTIFICATION TO SCP

Let’s assume α = (req.conn)

I If β ∈{(nosupport.err), (err.abort)},then current state is s1,check no properties

I If β ∈{(support.refuse), (err.refuse)},then current state is s2,check for req/conn

I Else current state is s3check for data/ack +reset/abort (small heuristic)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Page 342: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

61/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

APPLYING STATE IDENTIFICATION TO SCP

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

The resulting set of HSs of length l = 2{(req.reset), (req.conn), (req.data), (reset), (data.rec), (data.conn),data.reset), (conn.req), (conn.data), (conn.reset)}

Let’s assume α = (req.conn)

I If β ∈{(nosupport.err), (err.abort)},then current state is s1,check no properties

I If β ∈{(support.refuse), (err.refuse)},then current state is s2,check for req/conn

I Else current state is s3check for data/ack +reset/abort (small heuristic)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Page 343: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

61/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

APPLYING STATE IDENTIFICATION TO SCP

Let’s assume α = (req.conn)

I If β ∈{(nosupport.err), (err.abort)},then current state is s1,check no properties

I If β ∈{(support.refuse), (err.refuse)},then current state is s2,check for req/conn

I Else current state is s3check for data/ack +reset/abort (small heuristic)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Page 344: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

61/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

APPLYING STATE IDENTIFICATION TO SCP

Let’s assume α = (req.conn)

I If β ∈{(nosupport.err), (err.abort)},then current state is s1,check no properties

I If β ∈{(support.refuse), (err.refuse)},then current state is s2,check for req/conn

I Else current state is s3check for data/ack +reset/abort (small heuristic)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Page 345: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

61/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

APPLYING STATE IDENTIFICATION TO SCP

Let’s assume α = (req.conn)

I If β ∈{(nosupport.err), (err.abort)},then current state is s1,check no properties

I If β ∈{(support.refuse), (err.refuse)},then current state is s2,check for req/conn

I Else current state is s3check for data/ack +reset/abort (small heuristic)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Page 346: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

61/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

APPLYING STATE IDENTIFICATION TO SCP

Let’s assume α = (req.conn)

I If β ∈{(nosupport.err), (err.abort)},then current state is s1,check no properties

I If β ∈{(support.refuse), (err.refuse)},then current state is s2,check for req/conn

I Else current state is s3check for data/ack +reset/abort (small heuristic)

s1 s2

s3

T1:req(QoS) / nosupport(QoSOut)QoSOut := QoST2: conn,data(size, value) / errT3: reset / abort

T4:req(QoS) /support(QoSOut)ConnQoS := QoSQoSOut := ConnQoS

T5:conn, TryCount < 2 & SysAvail = 0/ refuseTryCount := TryCount + 1T6: req(QoS),data(size, value) / err

T8:conn, TryCount ≥ 2 / abortTryCount := 0; ConnQoS := 0;DataCount := 0T9: reset / abort TryCount :=0; ConnQoS := 0;DataCount := 0 T7:conn, TryCount < 2

& SysAvail = 1 / accept(QoSOut)

T10:data(size, value) /ack(DataCountOut)DataCount := DataCount + sizeDataCountOut := DataCountT11:req(QoS), conn / err

T12:reset / abortTryCount := 0;ConnQoS := 0;DataCount := 0

Page 347: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

62/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATE IDENTIFICATION FOR NETWORK TRACE

ANALYSIS — FINAL REMARKS

What if the TST up to the length l does not contain a HS?..

I Continue with your TST with l = l + 1

I Or perhaps not. . . If ∀S′j ∈ SHs, |S

′ | >> |S′i |

S′

. . . . . .

{S′1,S

′2, ..., s

k} = SHs

. . . . . .

i1ij

im

Only check properties for the identified subset!

What sequences to choose?

I Sequences that are frequent to observe!I Sequences that follow the protocol flow, e.g., not (conn.req)I Can be chosen by experimental evaluation

Page 348: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

62/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATE IDENTIFICATION FOR NETWORK TRACE

ANALYSIS — FINAL REMARKS

What if the TST up to the length l does not contain a HS?..

I Continue with your TST with l = l + 1

I Or perhaps not. . . If ∀S′j ∈ SHs, |S

′ | >> |S′i |

S′

. . . . . .

{S′1,S

′2, ..., s

k} = SHs

. . . . . .

i1ij

im

Only check properties for the identified subset!

What sequences to choose?

I Sequences that are frequent to observe!I Sequences that follow the protocol flow, e.g., not (conn.req)I Can be chosen by experimental evaluation

Page 349: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

62/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATE IDENTIFICATION FOR NETWORK TRACE

ANALYSIS — FINAL REMARKS

What if the TST up to the length l does not contain a HS?..

I Continue with your TST with l = l + 1

I Or perhaps not. . . If ∀S′j ∈ SHs, |S

′ | >> |S′i |

S′

. . . . . .

{S′1,S

′2, ..., s

k} = SHs

. . . . . .

i1ij

im

Only check properties for the identified subset!

What sequences to choose?

I Sequences that are frequent to observe!I Sequences that follow the protocol flow, e.g., not (conn.req)I Can be chosen by experimental evaluation

Page 350: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

62/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATE IDENTIFICATION FOR NETWORK TRACE

ANALYSIS — FINAL REMARKS

What if the TST up to the length l does not contain a HS?..

I Continue with your TST with l = l + 1

I Or perhaps not. . . If ∀S′j ∈ SHs, |S

′ | >> |S′i |

S′

. . . . . .

{S′1,S

′2, ..., s

k} = SHs

. . . . . .

i1ij

im

Only check properties for the identified subset!

What sequences to choose?

I Sequences that are frequent to observe!I Sequences that follow the protocol flow, e.g., not (conn.req)I Can be chosen by experimental evaluation

Page 351: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

62/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATE IDENTIFICATION FOR NETWORK TRACE

ANALYSIS — FINAL REMARKS

What if the TST up to the length l does not contain a HS?..

I Continue with your TST with l = l + 1

I Or perhaps not. . . If ∀S′j ∈ SHs, |S

′ | >> |S′i |

S′

. . . . . .

{S′1,S

′2, ..., s

k} = SHs

. . . . . .

i1ij

im

Only check properties for the identified subset!

What sequences to choose?

I Sequences that are frequent to observe!

I Sequences that follow the protocol flow, e.g., not (conn.req)I Can be chosen by experimental evaluation

Page 352: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

62/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATE IDENTIFICATION FOR NETWORK TRACE

ANALYSIS — FINAL REMARKS

What if the TST up to the length l does not contain a HS?..

I Continue with your TST with l = l + 1

I Or perhaps not. . . If ∀S′j ∈ SHs, |S

′ | >> |S′i |

S′

. . . . . .

{S′1,S

′2, ..., s

k} = SHs

. . . . . .

i1ij

im

Only check properties for the identified subset!

What sequences to choose?

I Sequences that are frequent to observe!I Sequences that follow the protocol flow, e.g., not (conn.req)

I Can be chosen by experimental evaluation

Page 353: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

62/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

STATE IDENTIFICATION FOR NETWORK TRACE

ANALYSIS — FINAL REMARKS

What if the TST up to the length l does not contain a HS?..

I Continue with your TST with l = l + 1

I Or perhaps not. . . If ∀S′j ∈ SHs, |S

′ | >> |S′i |

S′

. . . . . .

{S′1,S

′2, ..., s

k} = SHs

. . . . . .

i1ij

im

Only check properties for the identified subset!

What sequences to choose?

I Sequences that are frequent to observe!I Sequences that follow the protocol flow, e.g., not (conn.req)I Can be chosen by experimental evaluation

Page 354: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

63/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES – FINAL

REMARKS

I Very useful when: no access to the code is possible, realdata analysis is desirable, the system cannot be influencedby test cases

I It can be computationally expensive, but techniques toreduce the complexity are being actively studied

I The approach was presented with network traces, but itcan be applied to passive testing of othersoftware/hardware (embedded) systems

Page 355: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

63/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES – FINAL

REMARKS

I Very useful when: no access to the code is possible, realdata analysis is desirable, the system cannot be influencedby test cases

I It can be computationally expensive, but techniques toreduce the complexity are being actively studied

I The approach was presented with network traces, but itcan be applied to passive testing of othersoftware/hardware (embedded) systems

Page 356: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

63/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES – FINAL

REMARKS

I Very useful when: no access to the code is possible, realdata analysis is desirable, the system cannot be influencedby test cases

I It can be computationally expensive, but techniques toreduce the complexity are being actively studied

I The approach was presented with network traces, but itcan be applied to passive testing of othersoftware/hardware (embedded) systems

Page 357: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

63/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

PASSIVE TESTING USING NETWORK TRACES – FINAL

REMARKS

I Very useful when: no access to the code is possible, realdata analysis is desirable, the system cannot be influencedby test cases

I It can be computationally expensive, but techniques toreduce the complexity are being actively studied

I The approach was presented with network traces, but itcan be applied to passive testing of othersoftware/hardware (embedded) systems

Page 358: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

64/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

Future work / Conclusions

Page 359: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzing

I New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)

I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 360: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzing

I New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)

I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 361: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)

I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 362: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)

I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 363: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)

I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 364: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)

I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 365: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)I Through simplifying the checking algorithms

I Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 366: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 367: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 368: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

65/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

RESEARCH OPPORTUNITIES / FUTURE WORK

Static Code Analysis

I Reducing the complexity when analyzingI New methods / Heuristics

I New analysis approaches using different algebraicstructures

Passive Testing using Network Traces

I Reducing the complexity when checking properties2 (!)I Through simplifying the checking algorithmsI Through minimizing the number checks :)

I Considering:Synchronizing distributed traces. . .Encrypted protocol testing. . .

I Developing efficient tools. . .

Page 369: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

66/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

END

Thank you for your attention!

Page 370: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

67/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

Q&A / SOME CLARIFICATIONS

Ariadna Barinova from ITMO asked about the applicabilityof static code analysis to scripting languages

In the example, we saw how static analysis can be usedfor sign analysis and detected a negative array index. Forscripting languages this is not important as array indexes canbe anything they are not the offset of a memory address.However, sign analysis can reveal errors in the code, e.g., afunction that should guarantee a positive return value does not,etc. Furthermore, many other analyses can be useful, like thelive variables analysis to detect potential waste of resources,etc. I hope the explanation was clear during the presentation,or at least it is now :)

Page 371: “Non-intrusive” Testing Techniques for Communication Protocolstarot2016.wp.imtbs-tsp.eu/files/2016/02/Non... · 1/68 INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

68/68

INTRODUCTION STATIC CODE ANALYSIS NETWORK TRACE ANALYSIS CONCLUSION

Q&A / SOME CLARIFICATIONS (2)

Natalia Kushik from Telecom SudParis pointed out the factthat the extended finite state machine under experimentto obtain a homing sequence had an initial state

In fact, as she correctly pointed out, if the initial state isknown, there is no need for the entire experiment. My intentionwas to show a communication protocol description; thisprotocol description has an initial state in fact. However, it istheoretically incorrect depict an initial state when performingthe state identification experiment. These slides were correctedand updated taking this into consideration.

Thank you, Natalia :)


Recommended