Sie sind auf Seite 1von 21

EXPERIMENT 1

AIM: LINUX commands


1. PWD

[mait@mta-192-180-1-166 ~]$ pwd


/home/mait

2. WHOAMI

[mait@mta-192-180-1-166 ~]$ whoami


mait

3. CLEAR

[mait@mta-192-180-1-166 ~]$

4. MKDIR filename

[mait@mta-192-180-1-166 ~]$ mkdir Shubham

5. LS

[mait@mta-192-180-1-166 ~]$ ls
2 Downloads ns-allinone-2.35 Pictures shubham
acn ex-tcl.tcl ns-allinone-2.35.tar.gz Public Shubham
Desktop Music ns-simple.tcl Templates
Documents ns2-install.txt out.nam Videos

6. LS -a

[mait@mta-192-180-1-166 ~]$ ls -a
. .bashrc ex-tcl.tcl ns-allinone-2.35 .ssh
.. .cache .gnupg ns-allinone-2.35.tar.gz Templates
2 .config .ICEauthority ns-simple.tcl Videos
acn Desktop .local out.nam .wireshark
.bash_history Documents .mozilla Pictures shubham
.bash_logout Downloads Music .pki Shubham
.bash_profile .esd_auth ns2-install.txt Public

7. CD foldername

[mait@mta-192-180-1-166 ~]$ cd Shubham


[mait@mta-192-180-1-166 Shubham]$

8. CD ..

[mait@mta-192-180-1-166 Shubham]$ cd ..
[mait@mta-192-180-1-166 ~]$
9. DATE

[mait@mta-192-180-1-166 ~]$ date


Wed april 02 20 09:13:27 IST 2017

10. UPTIME

[mait@mta-192-180-1-166 ~]$ uptime


09:13:30 up 26 min, 2 users, load average: 0.11, 0.10, 0.14

11. CAL

[mait@mta-192-180-1-166 ~]$ cal


april 2017
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

12. SU -

[mait@mta-192-180-1-166 ~]$ su -
Password:
[root@mta-192-180-1-166 ~]#

13. DNF UPDATE

[root@mta-192-180-1-166 dnf update


Transaction Summary
================================================================
=======
Install 16 Packages
Upgrade 711 Packages
Total download size: 991 M

14. DNF UPGRADE

[root@mta-192-180-1-166]# dnf upgrade


Last metadata expiration check performed 0:32:07 ago on Wed Jan 20 09:35:12
2016.
Dependencies resolved.
Nothing to do.
Complete!
EXPERIMENT 2

AIM:-INTRODUCTION TO DISCRETE EVENT SIMULATION

What is a System?
A collection of entities that act & interact together toward the accomplishment of some logical end. The term
system may also refer to a set of rules that governs structure &/or behaviour. A system is often affected by changes
occurring outside the system. Such changes are said to occur in the system environment.

What is a Discrete System?


Discrete system is a system with a countable number of states. The state variables change instantaneously at
separated points in time. A bank is an example of a discrete system, since state variables, e.g. the number of
customers in the bank, change only when a customer arrives or when a customer finishes being served & departs.

What is a Continuous System?


The state variables change continuously with respect to time i.e. the state variables change in a continuous way, &
not abruptly from one state to another. An aeroplane moving through the air is an example of a continuous system,
since state variables such as position & velocity can change continuously with respect to time.

What is Discrete Event Simulation?


A discrete event simulation (DES) models the operation of a system as a discrete sequence
of events in time. Each event occurs at a particular instant in time & marks a change of state in
the system. Between consecutive events, no change in the system is assumed to occur; thus the
simulation can directly jump in time from one event to the next.
This contrasts with continuous simulation in which the simulation continuously tracks the system
dynamics over time. Instead of being event based, this is called an activity based simulation; time
is broken up into small time slices & the system state is updated according to the set of activities
happening in the time slice. Because discrete event simulations do not have to simulate every time
slice, they can typically run much faster than the corresponding continuous simulation.

Tools used to simulate DES


1. ns-1

ns-1 is a powerful simulation tool that enables NEXO users to configure & optimise the performance of any NEXO
system by predicting its behaviour in any venue. An intuitive drag & drop interface includes all NEXO GEO,
Alpha, Alpha E & PS Systems, plus all sub bass cabinets, with measured speaker data processed along with
complex mathematical data to predict SPL & delay coverage in 3 dimensions.
Combining full acoustical & mechanical computations, NS-1 builds on the features of the existing GEOSoft
application, all of which are present in the new software. Along with tools for optimising curved vertical array
design, a Help section defines mechanical constraints to establish flown system safety, & generates reports for
system dimensions, weight, gravity centre position, forces, moments, working load & safety factors.

2. ns-2

Ns began as a variant of the REAL network simulator in 1989 & has evolved substantially over the past few years.
In 1995 ns development was supported by DARPA through the VINT project at LBL, Xerox PARC, UCB, &
USC/ISI. Currently ns development is support through DARPA with SAMAN & through NSF with CONSER, both
in collaboration with other researchers including ACIRI. Ns has always included substantal contributions from
other researchers, including wireless code from the UCB Daedelus & CMU Monarch projects & Sun Microsystems.
For documentation on recent changes, see the version 2 change log.

3. ns-3
ns-3 is a discrete-event network simulator, targeted primarily for research & educational use. ns-3 is free software,
licensed under the GNU GPLv2 license, & is publicly available for research, development, & use.
The goal of the ns-3 project is to develop a preferred, open simulation environment for networking research: it
should be aligned with the simulation needs of modern networking research & should encourage community
contribution, peer review, & validation of the software.

4. OMNeT++

OMNeT++ is an extensible, modular, component-based C++ simulation library & framework, primarily for
building network simulators.OMNeT++ provides a component architecture for models. Components (modules) are
programmed in C++, then assembled into larger components & models using a high-level language (NED).
Reusability of models comes for free. OMNeT++ has extensive GUI support, & due to its modular architecture, the
simulation kernel (& models) can be embedded easily into your applications.

Application of Discrete Event Simulation in real life:


Military is a big user of discrete event simulation models. The use of these models range from training &
war gaming their constructive use in important military analyses

DES is commonly used to monitor & predict the behaviour of investments; the stock market is a classic
example.

Discrete event simulation is used in computer network to simulate new protocols for different network
traffic scenarios before deployment.
EXPERIMENT-3
AIM- Installation of ns3
EXPERIMENT-4
AIM- Write a program to show connection of two nodes one as a server
& one as a client.
PROGRAM CODE:
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-global-routing-helper.h"

using namespace ns3;

int main()
{
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
NodeContainer node;
node.Create(2);
PointToPointHelper point;
point.SetDeviceAttribute("DataRate", StringValue ("5Mbps"));
point.SetChannelAttribute("Delay",StringValue("2ms"));
NetDeviceContainer ndc;
ndc=point.Install(node);
InternetStackHelper ish;
ish.Install(node);
Ipv4AddressHelper addhel;
addhel.SetBase("10.1.1.0","255.255.255.0");
Ipv4InterfaceContainer interfaces=addhel.Assign(ndc);
UdpEchoServerHelper echoServer (9);
ApplicationContainer serverApps = echoServer.Install (node.Get (1));
serverApps.Start(Seconds (1.0));
serverApps.Stop(Seconds(10.0));
UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9);
echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
ApplicationContainer clientApps = echoClient.Install (node.Get (0));
clientApps.Start (Seconds (2.0));
clientApps.Stop (Seconds (10.0));
Simulator::Run();
Simulator::Destroy();
return 0;
}

OUTPUT:
EXPERIMENT-5
AIM: Write a program to create 3 nodes, 1 as a client & 1 as a server.
PROGRAM CODE:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */

/* This program is free software; you can redistribute it &/or modify it under the terms of the GNU General Public
License version 2 as published by the Free Software Foundation;

* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

* You should have received a copy of the GNU General Public License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");

int main (int argc, char *argv[])


{
Time::SetResolution (Time::NS);
LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);

NodeContainer nodes;
nodes.Create (3);

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer devices, devices1;


devices = pointToPoint.Install (nodes.Get(0),nodes.Get(1));
devices1 = pointToPoint.Install (nodes.Get(0),nodes.Get(2));

InternetStackHelper stack;
stack.Install (nodes);

Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");

Ipv4InterfaceContainer interfaces = address.Assign (devices);


Ipv4InterfaceContainer interfaces1 = address.Assign (devices1);
UdpEchoServerHelper echoServer (9);

ApplicationContainer serverApps = echoServer.Install (nodes.Get (0));


serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (10.0));

UdpEchoClientHelper echoClient (interfaces.GetAddress (0), 9);


echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));

ApplicationContainer clientApps = echoClient.Install (nodes.Get (1));


clientApps.Start (Seconds (2.0));
clientApps.Stop (Seconds (10.0));

UdpEchoClientHelper echoClient1 (interfaces1.GetAddress (0), 9);


echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));

ApplicationContainer clientApps1 = echoClient1.Install (nodes.Get (2));


clientApps1.Start (Seconds (1.0));
clientApps1.Stop (Seconds (5.0));

Simulator::Run ();
Simulator::Destroy ();
return 0;}

OUTPUT:
EXPERIMENT-6
AIM- Write a program showing the connection of 1 nodes & 1 bus topology with this node as
a part.
CODE:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */

/* This program is free software; you can redistribute it &/or modify it under the terms of the GNU General Public
License version 2 as published by the Free Software Foundation;

* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

* You should have received a copy of the GNU General Public License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-global-routing-helper.h"

// Default Network Topology


//
// 10.1.1.0
// n0 -------------- n1 n2 n3 n4
// point-to-point | | | |
// ================
// LAN 10.1.2.0

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");

int main (int argc, char *argv[])


{
bool verbose = true;
uint32_t nCsma = 3;

CommandLine cmd;
cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);

cmd.Parse (argc,argv);

if (verbose)
{
LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);
}

nCsma = nCsma == 0 ? 1 : nCsma;

NodeContainer p2pNodes;
p2pNodes.Create (2);

NodeContainer csmaNodes;
csmaNodes.Add (p2pNodes.Get (1));
csmaNodes.Create (nCsma);

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer p2pDevices;
p2pDevices = pointToPoint.Install (p2pNodes);

CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));

NetDeviceContainer csmaDevices;
csmaDevices = csma.Install (csmaNodes);

InternetStackHelper stack;
stack.Install (p2pNodes.Get (0));
stack.Install (csmaNodes);

Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer p2pInterfaces;
p2pInterfaces = address.Assign (p2pDevices);

address.SetBase ("10.1.2.0", "255.255.255.0");


Ipv4InterfaceContainer csmaInterfaces;
csmaInterfaces = address.Assign (csmaDevices);

UdpEchoServerHelper echoServer (9);

ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (nCsma));


serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (10.0));

UdpEchoClientHelper echoClient (csmaInterfaces.GetAddress (nCsma), 9);


echoClient.SetAttribute ("MaxPackets", UintegerValue (10));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));

ApplicationContainer clientApps = echoClient.Install (p2pNodes.Get (0));


clientApps.Start (Seconds (2.0));
clientApps.Stop (Seconds (10.0));
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

pointToPoint.EnablePcapAll ("second");
csma.EnablePcap ("second", csmaDevices.Get (1), true);

Simulator::Run ();
Simulator::Destroy ();
return 0;
}

OUTPUT:
EXPERIMENT-7
AIM- Write a program showing the connection of 2 nodes & 1 bus topology with these 2 nodes as a part.

CODE:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */

/*This program is free software; you can redistribute it &/or modify it under the terms of the GNU General Public
License version 2 as published by the Free Software Foundation;

* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-global-routing-helper.h"

// Default Network Topology


//
// 10.1.1.0 10.1.3.0
// n0 -------------- n1 n2 n3 n4----------n5
// point-to-point | | | |
// ================
// LAN 10.1.2.0

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");

int main (int argc, char *argv[])


{
bool verbose = true; uint32_t nCsma = 3;

CommandLine cmd;
cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);

cmd.Parse (argc,argv);

if (verbose)
{ LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);}

nCsma = nCsma == 0 ? 1 : nCsma;


NodeContainer p2pNodes, p2pNodes1;
p2pNodes.Create (2); p2pNodes1.Create (2);

NodeContainer csmaNodes;
csmaNodes.Add (p2pNodes.Get (1));
csmaNodes.Create (2);
csmaNodes.Add (p2pNodes1.Get (0));

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer p2pDevices, p2pDevices1;


p2pDevices = pointToPoint.Install (p2pNodes); p2pDevices1 = pointToPoint.Install (p2pNodes1);

CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));

NetDeviceContainer csmaDevices;
csmaDevices = csma.Install (csmaNodes);

InternetStackHelper stack;
stack.Install (p2pNodes.Get (0));
stack.Install (csmaNodes);
stack.Install (p2pNodes1.Get (1));

Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer p2pInterfaces;
p2pInterfaces = address.Assign (p2pDevices);

address.SetBase ("10.1.2.0", "255.255.255.0");


Ipv4InterfaceContainer csmaInterfaces;
csmaInterfaces = address.Assign (csmaDevices);

address.SetBase ("10.1.3.0", "255.255.255.0");


Ipv4InterfaceContainer p2pInterfaces1;
p2pInterfaces1 = address.Assign (p2pDevices1);

UdpEchoServerHelper echoServer (9);

ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (2));


serverApps.Start (Seconds (1.0)); serverApps.Stop (Seconds (10.0));

UdpEchoClientHelper echoClient (csmaInterfaces.GetAddress (2), 9);


echoClient.SetAttribute ("MaxPackets", UintegerValue (10));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
ApplicationContainer clientApps = echoClient.Install (p2pNodes.Get (0));
clientApps.Start (Seconds (2.0)); clientApps.Stop (Seconds (10.0));

ApplicationContainer clientApps1 = echoClient.Install (p2pNodes1.Get (1));


clientApps1.Start (Seconds (4.0)); clientApps1.Stop (Seconds (8.0));

Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

pointToPoint.EnablePcapAll ("second");
csma.EnablePcap ("second", csmaDevices.Get (1), true);

Simulator::Run (); Simulator::Destroy (); return 0;}

OUTPUT:
EXPERIMENT-8
AIM- Write a program showing the connection of 2 nodes & 4 router
such that the extremes nodes act as client & server.
CODE:

/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */

/* This program is free software; you can redistribute it &/or modify it under the terms of the GNU General Public
License version 2 as published by the Free Software Foundation;

* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

* You should have received a copy of the GNU General Public License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-global-routing-helper.h"

// Default Network Topology 10.1.5.0


// r2---------n1
// / 10.1.3.0
// no----------r0--------r1
// 10.1.1.0 10.1.2.0 \ 10.1.4.0
// r3

using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");

int main (int argc, char *argv[])


{bool verbose = true;
if (verbose)
{ LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO); }

NodeContainer host, router, host1;


host.Create (1); router.Create (4); host1.Create (1);

NodeContainer subnet1;
subnet1.Add (host.Get (0)); subnet1.Add (router.Get (0));

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer subnet1Devices;
subnet1Devices = pointToPoint.Install (subnet1);

InternetStackHelper stack;
stack.Install (router); stack.Install (host); stack.Install (host1);

Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer subnet1Interfaces;
subnet1Interfaces = address.Assign (subnet1Devices);

NodeContainer subnet2;
subnet2.Add (router.Get (0)); subnet2.Add (router.Get (1));

NetDeviceContainer subnet2Devices;
subnet2Devices = pointToPoint.Install (subnet2);

address.SetBase ("10.1.2.0", "255.255.255.0");


Ipv4InterfaceContainer subnet2Interfaces;
subnet2Interfaces = address.Assign (subnet2Devices);

NodeContainer subnet3;
subnet3.Add (router.Get (1)); subnet3.Add (router.Get (2));

NetDeviceContainer subnet3Devices;
subnet3Devices = pointToPoint.Install (subnet3);

address.SetBase ("10.1.3.0", "255.255.255.0");


Ipv4InterfaceContainer subnet3Interfaces;
subnet3Interfaces = address.Assign (subnet3Devices);

NodeContainer subnet4;
subnet4.Add (router.Get (1)); subnet4.Add (router.Get (3));

NetDeviceContainer subnet4Devices;
subnet4Devices = pointToPoint.Install (subnet4);

address.SetBase ("10.1.4.0", "255.255.255.0");


Ipv4InterfaceContainer subnet4Interfaces;
subnet4Interfaces = address.Assign (subnet4Devices);

NodeContainer subnet5;
subnet5.Add (router.Get (2)); subnet5.Add (host1.Get (0));

NetDeviceContainer subnet5Devices;
subnet5Devices = pointToPoint.Install (subnet5);

address.SetBase ("10.1.5.0", "255.255.255.0");


Ipv4InterfaceContainer subnet5Interfaces;
subnet5Interfaces = address.Assign (subnet5Devices);
UdpEchoServerHelper echoServer (9);

ApplicationContainer serverApps = echoServer.Install (subnet5.Get (1));


serverApps.Start (Seconds (1.0)); serverApps.Stop (Seconds (10.0));

UdpEchoClientHelper echoClient (subnet5Interfaces.GetAddress (1), 9);


echoClient.SetAttribute ("MaxPackets", UintegerValue (3));
echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));
echoClient.SetAttribute ("PacketSize", UintegerValue (1024));

ApplicationContainer clientApps = echoClient.Install (subnet1.Get (0));


clientApps.Start (Seconds (1.0)); clientApps.Stop (Seconds (10.0));

Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

Simulator::Run (); Simulator::Destroy (); return 0; }

OUTPUT:

Das könnte Ihnen auch gefallen