Verisim: Formal Analysis of Network Simulations

31
Verisim: Formal Analysis of Network Simulations Karthikeyan Bhargavan, Carl A. Gunter, Moonjoo Kim, Insup Lee, Davor Obradovic, Oleg Sokolsky, Mahesh Viswanathan University of Pennsylvania

description

Verisim: Formal Analysis of Network Simulations. Karthikeyan Bhargavan, Carl A. Gunter , Moonjoo Kim, Insup Lee, Davor Obradovic, Oleg Sokolsky, Mahesh Viswanathan University of Pennsylvania. Internetwork Routing Protocols. - PowerPoint PPT Presentation

Transcript of Verisim: Formal Analysis of Network Simulations

Page 1: Verisim: Formal Analysis of Network Simulations

Verisim: Formal Analysis of Network Simulations

Karthikeyan Bhargavan, Carl A. Gunter, Moonjoo Kim, Insup Lee, Davor Obradovic, Oleg Sokolsky, Mahesh ViswanathanUniversity of Pennsylvania

Page 2: Verisim: Formal Analysis of Network Simulations

Internetwork Routing Protocols Internetwork routing protocols

enable interoperability between physical networks.

Routing protocols for the Internet: RIP, OSPF, and BGP.

Routing protocols for packet radio: AODV and DSR.

Routing protocols and software have growing importance and complexity.

Page 3: Verisim: Formal Analysis of Network Simulations

Current Analysis Techniques Rigorous mathematical models and

proofs – limited by complexity. Testing.

Testbed – expensive. Operational – risky and inconvenient.

Simulation. Performance attributes: throughput,

latency, reliability, etc.

Page 4: Verisim: Formal Analysis of Network Simulations

Limitations of Performance Analysis of Simulations Flaws may not be detected if no

expected performance can be used for comparison.

When flaws are suspected, finer means of analysis are useful.

Some flaws do not manifest themselves as performance problems (e.g. most security gaps).

Page 5: Verisim: Formal Analysis of Network Simulations

Verisim Verisim provides support for “logical”

analysis of network simulations. This talk describes its architecture

and logic. We provide a series of experiments

aimed at assessing the approach.

Page 6: Verisim: Formal Analysis of Network Simulations

Monitoring and Checking (MaC) Framework

MonitoringScript

ProgramMonitor Checker

Properties

MetatraceTrace

Data

NS MEDL

Page 7: Verisim: Formal Analysis of Network Simulations

Meta Event Description Language (MEDL) Expresses properties of traces. Extension of Linear Temporal Logic

(LTL) with auxiliary variables. More expressive than LTL. Properties classified into

(instantaneous) events and (enduring) conditions.

S Kannan, M Kim, I Lee, O Sokolsky, M Viswanathan 98

Page 8: Verisim: Formal Analysis of Network Simulations

NS Network SimulatorInstrumentedProtocol Code

P : C++

ConfigurationParameters:

OTcl

TrafficModel:OTcl

Topology:OTcl

Scenario

P

N

src/sink

P

N

src/sink

P

N

src/sink

ProtocolAgents

NetworkModel

TrafficAgents

NS TraceVINT Project

Page 9: Verisim: Formal Analysis of Network Simulations

Verisim

Trace Checker

Properties: MEDL

Metatrace

InstrumentedProtocol: C++

Scenario:OTcl

NS

Page 10: Verisim: Formal Analysis of Network Simulations

Ad Hoc Networks Routing for a wireless internetwork

without the aid of a central base station.

Connections are low-bandwidth, lossy, and highly transient.

Unique routing assumptions: Most routes are seldom used. Bandwidth must be protected.

Page 11: Verisim: Formal Analysis of Network Simulations

Illustration Part 1 of 2

Routing

Movement

Page 12: Verisim: Formal Analysis of Network Simulations

Illustration Part 2 of 2

NewRouting

Page 13: Verisim: Formal Analysis of Network Simulations

AODV Protocol If a node S needs a route to a destination D

and does not have one, it floods a route-request (RREQ) packet through the network.

Each recipient R of this RREQ keeps a return pointer.

R broadcasts the request to its neighbors if it is not D and does not have a route to D.

If R is D, or has a route to D, it responds with a route-reply (RREP) packet using the return pointers for S.

Perkins and Royer 99

Page 14: Verisim: Formal Analysis of Network Simulations

Loop Freedom in AODV Routing loops are undesirable. AODV uses sequence numbers to

indicate freshness of link information. Key Invariant: If next(n) = n’, then

seqno(n) seqno(n’), and if seqno(n) = seqno(n’), then hops(n) >

hops(n’). The invariant ensures that there are

no loops.

Page 15: Verisim: Formal Analysis of Network Simulations

Outline of Experiment Run a scenario of modest complexity. Analyze it in Verisim using a list of 9

properties of AODV expressed in MEDL. First pass: Repair First Bug (RFB). Second pass: “tune” the MEDL formulas to

avoid rerunning the simulation discovering bugs in the metatrace.

We instrumented simulation code for AODVv0 supplied by the CMU Monarch Project.

Page 16: Verisim: Formal Analysis of Network Simulations

Experiment Scenario1

2 3

4

5

Page 17: Verisim: Formal Analysis of Network Simulations

Experiment Scenario1

2 3

4

5

Page 18: Verisim: Formal Analysis of Network Simulations

Experiment Scenario1

2 3

4

5

Page 19: Verisim: Formal Analysis of Network Simulations

Experiment Scenario1

2 3

4

5

Page 20: Verisim: Formal Analysis of Network Simulations

Experiment Scenario1

2 3

4

5

Page 21: Verisim: Formal Analysis of Network Simulations

Sample MEDL Alarmalarm LoopInv[at][nxt][dst] = sendrout[at][dst] when ((atnxt) (atdst) (nxtdst) (obs_nexthop[at][dst] == nxt) ((obs_seqno[at][dst] > obs_seqno[nxt][dst]) ((obs_seqno[at][dst] == obs_seqno[nxt][dst]) (obs_hopcont[at][dst] <= obs_hopcnt[at][dst]))))

This is the negation of the fundamental invariant ensuringno loops in AODV:

If the next hop from node at toward destination dst is node nxt then the sequence number (for dst) of at is less than or equal to that of nxt or they are equal and the hop count (for dest) of at is less than or equal to that of nxt.

Page 22: Verisim: Formal Analysis of Network Simulations

Repair First Bug Experiment Let be the MEDL property set. Run the simulation to get a trace T. Run the checker to get a metatrace T. Repair the first bug in the metatrace to get

new protocol code. Rerun the simulation with the new protocol

code to get a new trace U. Rerun the checker to get a new metatrace

U. Continue until an empty metatrace is

obtained.

Page 23: Verisim: Formal Analysis of Network Simulations

RFB Experiment StatisticsMeta-trace

DestRep

DetectRErr

NodeRep

LoopEnv

TotalAlarms

T 4 54 38 43 220

U 0 54 38 43 216

V 0 48 39 44 206

W 0 0 0 0 1

Page 24: Verisim: Formal Analysis of Network Simulations

Tuning Experiment StatisticsMeta-trace

DestRep

DetectRErr

NodeRep

LoopEnv

TotalAlarms

T 4 54 38 43 220

T 0 54 38 43 216

T 0 0 38 50 166

T 0 0 21 0 21

No newsimulation

traces.

Page 25: Verisim: Formal Analysis of Network Simulations

Analysis of “Off-The-Shelf” (OTS) Simulations The prior experiment involved fewer

than 10,000 events, and we designed it to exercise key scenarios.

Can we do useful analysis with OTS performance simulations?

Aim: Verisim can be added with small modifications, run alongside OTS simulations, and find logical failures in a practical period of time.

Page 26: Verisim: Formal Analysis of Network Simulations

Experiment Took largest available OTS simulation for

AODV and ran it to create a trace. Simulation from Monarch uses 50 mobile nodes on

1500x300m grid moving 20 m/s. 5220 seconds (1.5 hours) to complete simulation. 6,446,316 events.

Naïve effort: ran MEDL with MonSeqNo test on all nodes (2500 relations) using 550Mhz dual processor machine with 1GB of memory.

Aborted the experiment after 4 days; estimate 100 days to complete this analysis.

Page 27: Verisim: Formal Analysis of Network Simulations

Optimizations For Network Routing Simulations Population Abstraction: test the

property for a subset of the routers. Packet Type Abstraction: prune the

trace to include only relevant events.

Page 28: Verisim: Formal Analysis of Network Simulations

Sample Experiment Results for MonSeqNo Population Abstraction for 5 nodes.

Trace size: 6,446,316 events Property size: 14,543 bytes Time: 51,054 seconds Rate: 0.54 micro seconds per event per property.

Population and Packet Type Abstractions. Trace size: 6812 events Property size: 14,543 bytes Time: 51 seconds (found failures) Rate: 0.51 micro seconds per event per property.

Page 29: Verisim: Formal Analysis of Network Simulations

Sample Experiment Results for LoopInv Population Abstraction for 5 nodes.

Trace size: 69,411 events Property size: 75,508 bytes Time: 8064 seconds Rate: 1.54 micro seconds per event per property.

Population and Packet Type Abstractions. Trace size: 48,735 events Property size: 75,508 bytes Time: 5912 seconds (found failures) Rate: 1.61 micro seconds per event per property.

Page 30: Verisim: Formal Analysis of Network Simulations

Related Work Communication-based test generation

systems. STRESS and Verisoft. Test oracles based on formulas or

formal operational specifications. GIL and TETRA.

Formal instance verification of routing protocols. SPIN/PITHIA for PNNI.

Simulations based on logical specifications. MTSim and Maude.

Network monitoring systems. Emerald.

Page 31: Verisim: Formal Analysis of Network Simulations

Summary Verisim integrates simulation and

logical trace analysis. The combination provides a more

flexible approach to analyzing network simulations for safety properties.

It is able to find bugs in existing simulator studies.

Its flexibility can be exploited to improve debugging turn-around time.