63
SSFNet For Network Simulation Presented By Molham Bali 1

SSFNet Network Simulator

  • Upload
    mebali

  • View
    644

  • Download
    2

Embed Size (px)

Citation preview

Page 1: SSFNet Network Simulator

1

SSFNetFor

Network Simulation

Presented ByMolham Bali

Page 2: SSFNet Network Simulator

2

IntroductionWhy 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.

Page 3: SSFNet Network Simulator

3

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.

Page 4: SSFNet Network Simulator

4

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.

Page 5: SSFNet Network Simulator

5

Simulation Architecture Model

Page 6: SSFNet Network Simulator

6

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.

Page 7: SSFNet Network Simulator

7

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.

Page 8: SSFNet Network Simulator

8

Example of SSF implementation

Page 9: SSFNet Network Simulator

9

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.

Page 10: SSFNet Network Simulator

10

How does the simulation work?

1. When the simulation starts, first it calls the first entity using startAll() method.

2. Framework will subsequently calls other entities startAll() methods.

3. All processes and entities will be initialized.

4. Frameworks will call their init() method.

5. The order of initialization may be implementation independent and may occur concurrently.

6. Processes are ready to start then the framework will execute the processes using action() till the simulation is reached.

7. When a process has to wait for a condition, it is suspended by the framework and resumed again, once the condition has been met.

Page 11: SSFNet Network Simulator

11

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 );

}

}}

Page 12: SSFNet Network Simulator

12

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);

}

}

Page 13: SSFNet Network Simulator

13

OUTPUTWe 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 = 9total received events for host2 = 9

Page 14: SSFNet Network Simulator

14

SSF ImplementationsCurrently there are for independent

implementation of SSF, which implement the SSF API. but

the most popular two are : Raceway: is a high-performance

commercialimplementation 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.

Page 15: SSFNet Network Simulator

15

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.

Page 16: SSFNet Network Simulator

Simulation Layers

SSF standard Simulator API

C++ C Java

CSSF RacewayDaSSF SimulatorImplementations

implements implements implements

SSFNetNetworkComponentsas Java Classes

enhances

Model Instances

DML Configurations

configure

Page 17: SSFNet Network Simulator

17

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.

Page 18: SSFNet Network Simulator

18

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

Page 19: SSFNet Network Simulator

DistributionOrganization

... /ssfnet/

doc/

examples/

lib/

src/

...

...

cernlite.jarregexp.jarssfnet.jarraceway.jar SSFNet

Raceway

DML Configurations

...

SSF/ OS/

Util/

Net/

Random/Streams/cernlite/

Host.javaRouter.javalink.javaNet.java

IP.javaTCP/OSPF/BGP/HTTP/

...

...

...

...

...

...

SSFNet

Page 20: SSFNet Network Simulator

20

SSFNet support Parallel Simulation

Page 21: SSFNet Network Simulator

21

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

Page 22: SSFNet Network Simulator

22

Basic Network Components

physical entities

linkrouter

host

logical containers

Net

protocol graph

protocols

BGP

OSPF

FTP

HTTP

Sockets

IP TCP

SSFNet

Page 23: SSFNet Network Simulator

23

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

value: key [ value ] Different keys can be separated with spaces or carriage returns:

Example: key1 [value1] key2 [value2]

key3 [value3] There may also be definitions of keys within value descriptions:

Example: key1 [ key2 [value2] ]

Page 24: SSFNet Network Simulator

A Simple Scenario

Two identical computers connected by a cable.

Page 25: SSFNet Network Simulator

Identify Primary Components

host

link

host

Page 26: SSFNet Network Simulator

Describe Components in DML

host [ ]link [ ]host [ ]

Page 27: SSFNet Network Simulator

Create a Host

host [ ]

Page 28: SSFNet Network Simulator

Assign Host Unique Identifier

host [ id 1]

1

Page 29: SSFNet Network Simulator

Add Interfaces to a Host

host [ id 1 interface [ ]]

1

Page 30: SSFNet Network Simulator

Assign Interface Unique Identifier

host [ id 1 interface [ id 1 ]]

1

1

Page 31: SSFNet Network Simulator

Hosts Differ Only in Identifier

host [ id 2 interface [ id 1 ]]

1

1

2

1

Page 32: SSFNet Network Simulator

Create the Link

link [ ]

1

1

2

1

Page 33: SSFNet Network Simulator

1

1

1

2

Put Them All Together

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

Page 34: SSFNet Network Simulator

1

1

1

2

Attach the Link to an Interface

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

Page 35: SSFNet Network Simulator

1

1

1

2

Complete the Connection

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

Page 36: SSFNet Network Simulator

1

1

1

2

Code Style is Flexible

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

Page 37: SSFNet Network Simulator

Add the Top-Level Net

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

1 2

1 2

File example.dml

Page 38: SSFNet Network Simulator

Using a Router

1 2

34

1

11

1

1 2

34

5

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 ] ]]

5

Page 39: SSFNet Network Simulator

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 [ id 1 ] interface [ id 2 ] interface [ id 3 ] interface [ id 4 ] interface [ id 5 ] interface [ id 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 [ idrange [ from 1 to 6 ] ] ]]

Page 40: SSFNet Network Simulator

Reduce Repetition: idrange

Net [ host [ idrange [ from 1 to 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 [ idrange [ from 1 to 6 ] ] ]]

Page 41: SSFNet Network Simulator

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

Page 42: SSFNet Network Simulator

42

Protocol Implementation in SSFNet

- IP implementationIt keeps tracks of all the interfaces configured ona 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 implementationThe 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.

Page 43: SSFNet Network Simulator

43

- 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.

Page 44: SSFNet Network Simulator

AddHost Protocols

protocol graph

IP

TCP

Sockets

HTTP client

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 ] ]]

Page 45: SSFNet Network Simulator

AddRouting Protocols

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 ] ]]

IP

TCP

OSPF

BGP

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

Page 46: SSFNet Network Simulator

A Network of Clients

1 2

34

1

11

1

1 2

34

5

6

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 ] ] ]]

5

Page 47: SSFNet Network Simulator

Reusable Parts in DML

build a dictionary of commonly-used parts can use multiple files

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 ] ] ]]

File dictionary.dml

Page 48: SSFNet Network Simulator

Reusable Parts

Use _find keyword for inline substitution of parts

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 [ ... ] ]]

File dictionary.dml

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 ] ] ]]

Page 49: SSFNet Network Simulator

Add a Network of Servers

1 2

34

1

11

1

1 2

34

5

65

clientsservers

1

2

1

1

61

2 3

54

5

Page 50: SSFNet Network Simulator

DML Codefor Server Net

servers

1

2

1

1

61

2 3

54

5

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 ] ] ]]

excerpt from file example.dml

Page 51: SSFNet Network Simulator

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

Page 52: SSFNet Network Simulator

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

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 dictionary.dmlNet [ # 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]

File example.dml

Page 53: SSFNet Network Simulator

Controlling Traffic Patterns top-level Net contains traffic

attribute specifies client and server networkstraffic [ pattern [ client 2 servers [ port 80 nhi_range [ from 1:5(0) to 1:7(0) ] ] ] # more patterns]

Page 54: SSFNet Network Simulator

54

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.

Page 55: SSFNet Network Simulator

55

Installing SSFNetSSFNet 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.

Page 56: SSFNet Network Simulator

56

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 CLASSPATH=D:\ssfnet\lib\raceway.jar;D:\ssfnet\lib\ssfnet.jarset CLASSPATH=%CLASSPATH%;D:\ssfnet\lib\cernlite.jarset CLASSPATH=%CLASSPATH%;D:\ssfnet\lib\raceway.jarset CLASSPATH=%CLASSPATH%;D:\ssfnet\lib\regexp.jarset CLASSPATH=%CLASSPATH%;D:\ssfnet\src\

Page 57: SSFNet Network Simulator

57

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

Page 58: SSFNet Network Simulator

58

----------------------------------------------------------------------| 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 themodel-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)$

Page 59: SSFNet Network Simulator

59

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.

Page 60: SSFNet Network Simulator

60

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.

Page 61: SSFNet Network Simulator

61

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.

Page 62: SSFNet Network Simulator

62

Example Demo can be found in:/usr/local/ssfnet-2.0/animation/tcp1

Page 63: SSFNet Network Simulator

63

References

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