Beruflich Dokumente
Kultur Dokumente
2. WHOAMI
3. CLEAR
[mait@mta-192-180-1-166 ~]$
4. MKDIR filename
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
8. CD ..
[mait@mta-192-180-1-166 Shubham]$ cd ..
[mait@mta-192-180-1-166 ~]$
9. DATE
10. UPTIME
11. CAL
12. SU -
[mait@mta-192-180-1-166 ~]$ su -
Password:
[root@mta-192-180-1-166 ~]#
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.
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.
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"
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"
NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");
NodeContainer nodes;
nodes.Create (3);
PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
InternetStackHelper stack;
stack.Install (nodes);
Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.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"
NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");
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);
}
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);
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"
NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");
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);}
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"));
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);
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
pointToPoint.EnablePcapAll ("second");
csma.EnablePcap ("second", csmaDevices.Get (1), true);
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:
/* 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"
NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");
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);
NodeContainer subnet3;
subnet3.Add (router.Get (1)); subnet3.Add (router.Get (2));
NetDeviceContainer subnet3Devices;
subnet3Devices = pointToPoint.Install (subnet3);
NodeContainer subnet4;
subnet4.Add (router.Get (1)); subnet4.Add (router.Get (3));
NetDeviceContainer subnet4Devices;
subnet4Devices = pointToPoint.Install (subnet4);
NodeContainer subnet5;
subnet5.Add (router.Get (2)); subnet5.Add (host1.Get (0));
NetDeviceContainer subnet5Devices;
subnet5Devices = pointToPoint.Install (subnet5);
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
OUTPUT: