Вы находитесь на странице: 1из 63

SSFNet For Network Simulation Presented By Molham Bali

Introduction Why do we need network simulator?


In order to understand the configuration changes in one single or multiple link or errors in the network topology and to be able to predict the solution of these changes and effects in big scenarios we need to adapt very reliable and scalable tools such as network simulator. Network modeling and simulation plays an Important role when designing large network infrastructures both heterogeneous and homogenous. Simulations are a cost effective solution to this problem. They are inexpensive, and quickly deployed. Network simulation tools help researchers and developers estimate network functionality and performance prior to deployment. They are a Virtual environment for testing the performance of new networking protocols And they model networks and analyze their performance under different scenarios.

Overview
SSFNet consists of two parts:  SSFNet part: it is an open source This part contains the simulation of networks, interface cards, hosts, routers and protocols. The source code is available and can be adapted.  SSF part it is not an open source The jar library is available. This part is simulation engine for simulating systems based on discrete events.
3

What Is SSF?
 

Scalable Simulation Framework SSF is used to model discrete event simulation for large and complex systems in both Java and C++. It is a set of application programming interfaces (APIs) is created in a common language to provide object oriented models for elements used in the simulation. Those API can hide all the detail of the internal simulator and provide easy use interface with Kernel. Once the models are created, they can be used in any type of simulation that requires those types of elements. SSF models are considered the to be the foundation it is the engine under hood of SSFNet . SSF is not dictated to simulate network only. It simulates everything that can be modeled in term of process and event.

   

Simulation Architecture Model


5

The five APIs base classes used to define the SSF environment:

Entity
The base class for all simulation components. It serves as a container mechanism for the definition of alignment relations to other entities.

Event
Base class for single bit of information which exchanged between entities.

InChannels
used to receive data within the SSF simulation for the entity.

OutChannels
used in the entity to send data to other entities within the SSF simulation.

 Process
control the information generated and requested by the entities that contain the processes. Also, it used for modeling an entity s behavior. For example, a protocols functionality. Each process is associated with one specific entity that has the possibility of:
Waiting on input to arrive on an InChannel Waiting for some amount of time Or simply waiting forever.

Example of SSF implementation

 The example illustrates the concept of SSF

simulation. In fact, if we look at the two hosts which are representing the entities and each one of them has a network interface for sending/receiving the bits of link.  Each host network interface consists of two channels which are called InChannels and OutChannel where the send/receive of bits is called event.  Each host has protocol running on the two hosts and manage the bits exchange which can be modeled by process.
9

How does the simulation work?


1. 2. 3. 4. 5. 6. 7.

When the simulation starts, first it calls the first entity using startAll() method. Framework will subsequently calls other entities startAll() methods. All processes and entities will be initialized. Frameworks will call their init() method. The order of initialization may be implementation independent and may occur concurrently. Processes are ready to start then the framework will execute the processes using action() till the simulation is reached. When a process has to wait for a condition, it is suspended by the framework and resumed again, once the condition has been met.

10

import com.renesys.raceway.SSF.*; public class ExampleHost extends Entity { public int rcvd; public inChannel IN; public outChannel OUT; public ExampleHost() { rcvd = 0; IN = new inChannel( this ); OUT = new outChannel( this, 20 ); new process(this) { // receiver process public void action() { waitOn( IN ); rcvd++; } } new process(this) { // sender process public void action() { OUT.write(new Event()); waitFor( 20 ); } }
}

11

Class Testing
public static void main(String[] argv) { ExampleHost host1 = new ExampleHost(); ExampleHost host2 = new ExampleHost(); host1.OUT.mapto( host2.IN ); host2.OUT.mapto( host1.IN ); host1.startAll( 200 ); host1.joinAll(); System.out.println("total received events for host1 = " host1.rcvd); System.out.println("total received events for host2 = " + host2.rcvd); } }
12

OUTPUT
We can implement the java class by using java command followed by the class name :

$ java ExampleHost ---------------------------------------------------------------------| Raceway SSF 1.0b08 (11 November 2000) | Proprietary Internal Development Release | (c)2000 Renesys Corporation ------------------------------------------------------------------------------------------------------------------------------------------| 1 timelines, 5 barriers, 40 events, 110 ms, 0 Kevt/s ---------------------------------------------------------------------total received events for host1 = 9 total received events for host2 = 9
13

SSF Implementations Currently there are for independent implementation of SSF, which implement the SSF API. but the most popular two are :  Raceway: is a high-performance commercial implementation of Java SSF API and is maintained by Renesys Corporation.  DaSSF: is a high-performance implementation of the C++ SSF API maintained at Dartmouth college.

14

What is SSFNet?
 It is collection of complete Java implementation of SSF engine, along with high modeling scalability of Internet protocols such as (IP, TCP, UDP, BGP4, OSPF, and others) and large networks elements (hosts, routers, links, LANs).

SSFNet models are self-configuring-- which means, each SSFNet class instance can be separately configure itself by querying the parameter of the database which might be reside locally or over the Web.  SSFNet has a single integrated interface which can be used to design networks.  SSFNet models provide components for the simulation of networks at IP level and above and include models for hosts, router, links and a framework for modeling protocols.

15

Simulation Layers
DML Configurations
configure

Model Instances Network Components as Java Classes Simulator Implementations

SSFNet
enhances

DaSSF
implements C++

CSSF
implements C

Raceway
implements Java

SSF standard

Simulator API

SSFNet Libraries


The SSFNet distribution consists of two frameworks - SSF.OS and SSF.Net. Any Internet model can be constructed using these frameworks.

SSFNet can be divided to four packages:


   

SSF.OS
Contains all the framework for protocols models that are related to operating system.

SSF.Net
The package includes the hardware for modeling network objects such as (hosts, router, links .etc).

SSF. Util.Random
Contains additional classes for generation random stream.

SSF.Util.Streams
Contains the support for efficient multiple-point network, monitor the infrastructure for collecting stream data.
17

The main classes are contained within the SSF.Net package: Net, defines the network configuration. Host, defines host endpoints on the network. Router, defines network interconnection devices. NIC, defines network interfaces for hosts and routers. Link, defines connections between hosts and router interfaces. Frequency, sets the time resolution of the simulation as the number of simulation ticks per clock second.
Graph, specifies the list of protocols to be used. It is mandatory for

every host to have a graph attribute in its definition. Interface, facilitates the configuration of the network interface of the Ethernet card. Traffic, specifies the traffic scenario for different client/servers. It is used by protocols like TCP, UDP and HTTP. Addressing, NHI (Netowrk,Host,Interface) addressing is used as an internal addressing format for model building convenience
18

Distribution Organization
doc/ ... Net/ ...

SSFNet Host.java Router.java link.java Net.java

examples/
DML Configurations

... /ssfnet/

src/

SSF/

OS/

IP.java TCP/ OSPF/ BGP/ HTTP/

... ... ... ...

lib/

cernlite.jar regexp.jar ssfnet.jar raceway.jar

Util/
SSFNet Raceway

Random/ Streams/ cernlite/

... ... ...

SSFNet support Parallel Simulation

20

Scalable Self Organizing Simulation Achievements


Below picture shows the successful project simulation using SSF & SSFNet for A multi-domain SSFNet model with over 25,000 highly detailed multiprotocol hosts and routers. SSFNet provides a database-oriented scalable modeling environment allowing rapid configuration of 100,000-node and larger models, and includes open-source, validated models of the major Internet protocols

21

SSFNet

Basic Network Components


physical entities
IP router host link Sockets FTP BGP

protocols
TCP

logical containers
Net

HTTP OSPF

protocol graph
22

Domain Modeling Language (DML)


     

It is a decryption language that can be used by SSFNet for modeling configuration. It is used as a tool to describe the topology of simulated network and the configuration in different components. Can be used as a dictionary to keep the common configuration of the components for composing large network. The DML specification provides a standard format for defining elements within the model. Each value is encapsulated with brackets, indicating the start and end of the Different keys can be separated with spaces or carriage returns: key1 [value1] key2 [value2] key3 [value3]

value: key [ value ] Example:




There may also be definitions of keys within value descriptions:

Example: key1 [ key2 [value2] ]

23

A Simple Scenario

Two identical computers connected by a cable.

Identify Primary Components


host link host

Describe Components in DML


host [ ] link [ ] host [ ]

Create a Host
host [ ]

Assign Host Unique Identifier


host [ id 1 ]

Add Interfaces to a Host


host [ id 1 interface [ ] ]

Assign Interface Unique Identifier


host [ id 1 interface [ id 1 ] ]

Hosts Differ Only in Identifier


host [ id 2 interface [ id 1 ] ]

1
1 1

Create the Link


link [ ]

1
1 1

Put Them All Together


host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 1 ] ] link [ ]

1 1

Attach the Link to an Interface


host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 2 ] ] link [ attach 1(1) ]

1
1

Complete the Connection


host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 1 ] ] link [ attach 1(1) attach 2(1) ]

1
1

2
1

Code Style is Flexible


host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 2 ] ] link [ attach 1(1) attach 2(1) ]

1
1 1

Add the Top-Level Net


File example.dml Net [ host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 2 ] ] link [ attach 1(1) attach 2(1) ] ]

Using a Router
1 2 Net [ host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 1 ] ] host [ id 3 interface [ id 1 ] ] host [ id 4 interface [ id 1 ] ] router [ id 5 interface [ id 1 ] interface [ id 2 ] interface [ id 3 ] interface [ id 4 ] interface [ id 5 ] interface [ id 6 ] ] ]

1 6 5

5
4 3

Reduce Repetition: idrange


Net [ host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 1 ] ] host [ id 3 interface [ id 1 ] ] host [ id 4 interface [ id 1 ] ] router [ id 5 interface [ idrange [ from 1 to 6 ] ] ] ] Net [ host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 1 ] ] host [ id 3 interface [ id 1 ] ] host [ id 4 interface [ id 1 ] ] router [ id 5 interface [ id 1 ] interface [ id 2 ] interface [ id 3 ] interface [ id 4 ] interface [ id 5 ] interface [ id 6 ] ] ]

Reduce Repetition: idrange


Net [ host [ id 1 interface [ id 1 ] ] host [ id 2 interface [ id 1 ] ] host [ id 3 interface [ id 1 ] ] host [ id 4 interface [ id 1 ] ] router [ id 5 interface [ idrange [ from 1 to 6 ] ] ] ] Net [ host [ idrange [ from 1 to 4 ] interface [ id 1 ] ] router [ id 5 interface [ idrange [ from 1 to 6 ] ] ] ]

Protocols and Protocol Graphs




Protocol Graph : servers as a container for all protocol services in a host or a router. It provides the means to locate and access the individual ProtocolSessions given the protocol's name. Protocol Session: It is a node of a ProtocolGraph and contains mechanisms for initialization, configuration and access to the services of the protocol implemented by this ProtocolSessions. protocol graph

Protocol Implementation in SSFNet - IP implementation It keeps tracks of all the interfaces configured on a particular host or router and the IP addresses of the interfaces that are attached to the links. For example, Routes are not computed by SSF.OS.IP but are computed by routing protocols. - OSPF implementation The routers use the OSPF protocol to compute the routing tables. The specification of the OSPF protocol occurs in the router s Protocol Graph which specification. At the start of the simulation, protocol finds all the neighbor routers, creates the link state database and computes the routes.

42

- UDP implementation

It is used for server models with UDP streaming traffic. The UDP client configuration should specify the earliest time to send a request to the UDP server and must specify the size of the requested file in bytes. The UDP server configures itself with the parameters specified in the DML file.

43

Add Host Protocols

HTTP client Sockets TCP IP

protocol graph

host [ graph [ ProtocolSession [ name client use SSF.OS.WWW.httpClient ] ProtocolSession [ name socket use SSF.OS.Socket.socketMaster ] ProtocolSession [ name tcp use SSF.OS.TCP.tcpSessionMaster ] ProtocolSession [ name ip use SSF.OS.IP ] ] ]

Add Routing Protocols

BGP OSPF TCP IP

protocol graph

router [ graph [ ProtocolSession [ name bgp use SSF.OS.BGP4.BGPSession ] ProtocolSession [ name ospf use SSF.OS.OSPF.sOSPF ] ProtocolSession [ name tcp use SSF.OS.TCP.tcpSessionMaster ] ProtocolSession [ name ip use SSF.OS.IP ] ] ]

BGP: Border Gateway Protocol is an inter-autonomous system routing protocol OSPF: Open Shortest Path Find routing protocol developed for IP networks.

A Network of Clients

1 6 5

5
4 3

Net [ host [ idrange [ from 1 to 4 ] graph [ ProtocolSession [ name client use SSF.OS.WWW.httpClient ] ProtocolSession [ name socket use SSF.OS.Socket.socketMaster ] ProtocolSession [ name tcp use SSF.OS.TCP.tcpSessionMaster ] ProtocolSession [ name ip use SSF.OS.IP ] ] interface [ id 1 ] ] router [ id 5 graph [ ProtocolSession [ name bgp use SSF.OS.BGP4.BGPSession ] ProtocolSession [ name ospf use SSF.OS.OSPF.sOSPF ] ProtocolSession [ name tcp use SSF.OS.TCP.tcpSessionMaster ] ProtocolSession [ name ip use SSF.OS.IP ] ] interface [ idrange [ from 1 to 6 ] ] ] ]

Reusable Parts in DML


 build a dictionary of commonly-used parts
can use multiple files
File dictionary.dml dictionary [ clientGraph [ graph [ ProtocolSession [ name client use SSF.OS.WWW.httpClient ] ProtocolSession [ name socket use SSF.OS.Socket.socketMaster ] ProtocolSession [ name tcp use SSF.OS.TCP.tcpSessionMaster ] ProtocolSession [ name ip use SSF.OS.IP ] ] ] ]

Reusable Parts
 Use _find keyword for

File dictionary.dml

inline substitution of parts


File example.dml Net [ host [ idrange [ from 1 to 4 ] _find .dictionary.clientGraph.graph interface [ id 1 ] ] router [ id 5 _find .dictionary.routerGraph.graph interface [ idrange [ from 1 to 6 ] ] ] ]

dictionary [ clientGraph [ graph [ ProtocolSession [ name client use SSF.OS.WWW.httpClient ] ProtocolSession [ name socket use SSF.OS.Socket.socketMaster ] ProtocolSession [ name tcp use SSF.OS.TCP.tcpSessionMaster ] ProtocolSession [ name ip use SSF.OS.IP ] ] ] routerGraph [ graph [ ... ] ] ]

Add a Network of Servers


1 1
1 1 1

1 1 6 5 6 5

5
4 3

5 2
4 2 3

1 1

servers

clients

DML Code for Server Net


1
excerpt from file example.dml

6 5

5 2
4 2 3

Net [ host [ idrange [ from 1 to 2 ] _find .dictionary.serverGraph.graph interface [ id 1 ] ] router [ id 5 _find .dictionary.routerGraph.graph interface [ idrange [ from 1 to 6 ] ] ] ]

servers

NHI Addressing
 Internal format for model-building convenience  N:N:N: ... :N:H(I)
N = network id H = host id I = interface id

 top-level Net cannot have id  local vs. global


local link need not attach to global NHI address networks and hosts may be abbreviated or omitted

Extending Existing Components


 put reusable parts in the dictionary
leave out specifics if possible (such as id values)

 use _extends keyword to inherit all attributes


File dictionary.dml
dictionary [ serverNet [ host [ idrange [ from 1 to 2 ] _find .dictionary.serverGraph.graph interface [ id 1 ] ] router [ id 5 _find .dictionary.routerGraph.graph interface [ idrange [ from 1 to 6 ] ] ] ] ]

File example.dml
Net [ # top-level Net Net [ idrange [ from 1 to 6 ] ] # server Nets Net [ idrange [ from 7 to 12 ] ] # client Nets Net [ # variant server Net _extends .dictionary.clientNet id 13 host [ id 3 _find .dictionary.serverGraph.graph interface [ id 1 ] ] ] # lots of links ]

Controlling Traffic Patterns


 top-level Net contains traffic attribute  specifies client and server networks
traffic [ pattern [ client 2 servers [ port 80 nhi_range [ from 1:5(0) to 1:7(0) ] ] ] # more patterns ]

How to run SSFNet


After creating the DML model, the simulation can be run using the following command.

Java SSF.Net.Net 100 test.dml


where time defines the amount of time (in seconds) you want the simulation to run, and model name defines the DML file you want to use in the simulation.
54

Installing SSFNet
SSFNet can be downloaded from http://www.ssfnet.org/download/download.html Unix Installation - Unpack the compressed distribution to choosing directory, in our case we choose /usr/local directing as permanents directory.
tar -zxvf ssfnet_raceway[1].tar.gz -C /usr/local - Modify the PATH environment variable and add the location of JDK 1.4.1. export PATH=$PATH:/usr/java/j2sdk1.4.1_01/bin - Add the SSFNet *.jars libraries' files to the CLASSPATH environment variable. This modification of PATH and CLASSPATH environments variables can be done in either .profile or .bashrc files depending on the Unix or Linux system that you are using.
55

export CLASSPATH=$CLASSPATH:/usr/local/ssfnet/lib/raceway.jar: /usr/local/ssfnet/lib/ssfnet.jar:/usr/local/ssfnet/lib/cernlite. jar:/usr/local/ssfnet/lib/regexp.jar:/usr/local/ssfnet/src/ In Windows - The CLASSPATH in windows can be set from the System Properties dialog box, as with the PATH environment variable. So if you install SSFNet on C:\ssfnet then you need to add to the classpath all *.jars files as the following: set set set set set CLASSPATH=D:\ssfnet\lib\raceway.jar;D:\ssfnet\lib\ssfnet.jar CLASSPATH=%CLASSPATH%;D:\ssfnet\lib\cernlite.jar CLASSPATH=%CLASSPATH%;D:\ssfnet\lib\raceway.jar CLASSPATH=%CLASSPATH%;D:\ssfnet\lib\regexp.jar CLASSPATH=%CLASSPATH%;D:\ssfnet\src\

56

After setting the PATH and CLASSPATH environment, you must log out and log back in to acquire the new settings. - You can validate the whether the environments variables have been set correctly by running the SSFNet without specifying a DML file as the following: $ java SSF.Net.Net

57

--------------------------------------------------------------------| Raceway SSF 1.1b01 (15 March 2002) | (c)2000,2001,2002 Renesys Corporation | | ?? | --------------------------------------------------------------------Syntax: Net [-check] [-dump] [-relax] [-ip a.b.c.d/m] maxtime dmlfile1 [ dmlfile2 [...dmlfileN]]] -check: schema-check the input DML file(s) first -dump: dump NHI/CIDR/IP address tables, but don t actually run the model -relax: fail to enforce strict rules about CIDR/IP attributes -ip addr: allocate IP addresses from the given block (default: 0.0.0.0/0) $
58

Since SSFNet is implemented as a set of Java libraries (.jar files), it can be used on any platform that supports Java. This means that you can run SSFNet simulations on both your Unix hosts and your Windows workstations.

59

Raceway graphical capabilities

How to add graphics to existing DML files?


 Raceway Views editing capabilities allow you to add graphics

attributes to existing DML network configurations in two steps:  loading a non-graphic DML network to the Views display will cause an automatic insertion of default graphics attributes, and will generate certain default placement of network nodes.  Raceway is a high-performance commercial implementation of the Java SSF API and is maintained by Renesys Corp.  Raceway Views is a software tool for visualization and editing of graphical representation of large network configurations, including navigation in large hierarchical networks. it is also use to view the animation of network displays driven by distributed net measurement data streams, and animated plotting of time series.
60

      

Raceway viewer can be executed using the following command: To run the animations and start Raceway Viewer the following command should be given; java RacewayViewer <Filename>.dml -s <DataFile>.dat p <Player>.java -start 30 -stop 10000 (optional - if the start/stop options are provided, they define the timestamp range for records to be played; otherwise, the entire stream is played). 4. You can then employ the familiar select and drag, scale, rotate, etc. operations to place the hosts, routers and Nets you desire, and finally save the DML files to finalize your changes.
61

 Example Demo can be found in:

/usr/local/ssfnet-2.0/animation/tcp1

62

References
- http://www.ssfnet.org - http://bj.premore.net/edu/pubs/nist-1999.pdf

63

Вам также может понравиться