initial scenario draft
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu Feb 26 11:36:24 2009 +0100 (11 months ago)
changeset 1d853522040ab
parent 0 47110f41a796
child 2 5be8920d0b2f
initial scenario draft
Makefile
scenario.dia
wns3-helper.cc
wns3.tex
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Thu Feb 26 11:36:24 2009 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +%.eps: %.dia
     1.5 +	dia --export=$@ --filter=eps-builtin $^
     1.6 +
     1.7 +%.pdf: %.eps
     1.8 +	epstopdf  --outfile=$@ $^
     1.9 +
    1.10 +%.emf: %.eps
    1.11 +	pstoedit -pta -f "emf:-OO" $^ $@
    1.12 +
    1.13 +all: wns3.pdf
    1.14 +
    1.15 +wns3.pdf: wns3.tex 
    1.16 +	pdflatex wns3.tex
    1.17 +
    1.18 +force:
    1.19 +	pdflatex wns3.tex
    1.20 +	pdflatex wns3.tex
    1.21 +
    1.22 +view: wns3.pdf 
    1.23 +	evince wns3.pdf
    1.24 +
    1.25 +clean:  
    1.26 +	-rm -f wns3.aux wns3.log wns3.nav wns3.out wns3.pdf wns3.snm wns3.toc 2>/dev/null
    1.27 +	-rm -f *~ 2>/dev/null
     2.1 Binary file scenario.dia has changed
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/wns3-helper.cc	Thu Feb 26 11:36:24 2009 +0100
     3.3 @@ -0,0 +1,88 @@
     3.4 +#include <iostream>
     3.5 +#include <fstream>
     3.6 +#include "ns3/simulator-module.h"
     3.7 +#include "ns3/node-module.h"
     3.8 +#include "ns3/core-module.h"
     3.9 +#include "ns3/helper-module.h"
    3.10 +#include "ns3/global-route-manager.h"
    3.11 +#include "ns3/contrib-module.h"
    3.12 +
    3.13 +using namespace ns3;
    3.14 +
    3.15 +int main (int argc, char *argv[])
    3.16 +{
    3.17 +  CommandLine cmd;
    3.18 +  cmd.Parse (argc, argv);
    3.19 +
    3.20 +
    3.21 +  NodeContainer csmaNodes;
    3.22 +  csmaNodes.Create (2);
    3.23 +  NodeContainer wifiNodes;
    3.24 +  wifiNodes.Add (csmaNodes.Get (1));
    3.25 +  wifiNodes.Create (3);
    3.26 +
    3.27 +  NetDeviceContainer csmaDevices;
    3.28 +  CsmaHelper csma;
    3.29 +  csma.SetChannelAttribute ("DataRate", StringValue ("5Mbps"));
    3.30 +  csma.SetChannelAttribute ("Delay", StringValue ("2ms"));
    3.31 +  csmaDevices = csma.Install (csmaNodes);
    3.32 +
    3.33 +  NetDeviceContainer wifiDevices;
    3.34 +  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
    3.35 +  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
    3.36 +  wifiPhy.SetChannel (wifiChannel.Create ());
    3.37 +  WifiHelper wifi = WifiHelper::Default ();
    3.38 +  wifiDevices = wifi.Install (wifiPhy, wifiNodes);
    3.39 +
    3.40 +  MobilityHelper mobility;
    3.41 +  mobility.SetPositionAllocator ("ns3::RandomDiscPositionAllocator",
    3.42 +				 "X", StringValue ("100.0"),
    3.43 +				 "Y", StringValue ("100.0"),
    3.44 +				 "Rho", StringValue ("Uniform:0:30"));
    3.45 +  mobility.SetMobilityModel ("ns3::StaticMobilityModel");
    3.46 +  mobility.Install (wifiNodes);
    3.47 +
    3.48 +  Ipv4InterfaceContainer csmaInterfaces;
    3.49 +  Ipv4InterfaceContainer wifiInterfaces;
    3.50 +  InternetStackHelper internet;
    3.51 +  internet.Install (NodeContainer::GetGlobal ());
    3.52 +  Ipv4AddressHelper ipv4;
    3.53 +  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    3.54 +  csmaInterfaces = ipv4.Assign (csmaDevices);
    3.55 +  ipv4.SetBase ("10.1.2.0", "255.255.255.0");
    3.56 +  wifiInterfaces = ipv4.Assign (wifiDevices);
    3.57 +
    3.58 +  GlobalRouteManager::PopulateRoutingTables ();
    3.59 +
    3.60 +  ApplicationContainer apps;
    3.61 +  OnOffHelper onoff ("ns3::UdpSocketFactory", 
    3.62 +                     InetSocketAddress ("10.1.2.2", 1025));
    3.63 +  onoff.SetAttribute ("OnTime", StringValue ("Constant:1.0"));
    3.64 +  onoff.SetAttribute ("OffTime", StringValue ("Constant:0.0"));
    3.65 +  apps = onoff.Install (csmaNodes.Get (0));
    3.66 +  apps.Start (Seconds (1.0));
    3.67 +  apps.Stop (Seconds (4.0));
    3.68 +
    3.69 +  PacketSinkHelper sink ("ns3::UdpSocketFactory",
    3.70 +			 InetSocketAddress ("10.1.2.2", 1025));
    3.71 +  apps = sink.Install (wifiNodes.Get (1));
    3.72 +  apps.Start (Seconds (0.0));
    3.73 +  apps.Stop (Seconds (4.0));
    3.74 +
    3.75 +  std::ofstream ascii;
    3.76 +  ascii.open ("wns3-helper.tr");
    3.77 +  CsmaHelper::EnableAsciiAll (ascii);
    3.78 +  CsmaHelper::EnablePcapAll ("wns3-helper");
    3.79 +  YansWifiPhyHelper::EnablePcapAll ("wsn3-helper");
    3.80 +
    3.81 +  GtkConfigStore config;
    3.82 +  config.Configure ();
    3.83 +
    3.84 +  Simulator::Stop (Seconds (4.5));
    3.85 +
    3.86 +  Simulator::Run ();
    3.87 +  Simulator::Destroy ();
    3.88 +
    3.89 +
    3.90 +  return 0;
    3.91 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/wns3.tex	Thu Feb 26 11:36:24 2009 +0100
     4.3 @@ -0,0 +1,132 @@
     4.4 +\documentclass{beamer}
     4.5 +\usetheme{Madrid}
     4.6 +\title{}
     4.7 +\author{Mathieu Lacage}
     4.8 +\institute{INRIA}
     4.9 +\date{march 2nd 2009}
    4.10 +\begin{document}
    4.11 +
    4.12 +
    4.13 +\AtBeginSection[]
    4.14 +{
    4.15 +  \begin{frame}<beamer>
    4.16 +    \frametitle{Outline}
    4.17 +    \tableofcontents[currentsection,subsectionstyle=show/show/hide]
    4.18 +  \end{frame}
    4.19 +}
    4.20 +
    4.21 +\AtBeginSubsection[]
    4.22 +{
    4.23 +  \begin{frame}<beamer>
    4.24 +    \frametitle{Outline}
    4.25 +    \tableofcontents[currentsection,currentsubsection,subsectionstyle=show/shaded/hide]
    4.26 +  \end{frame}
    4.27 +}
    4.28 +
    4.29 +\begin{frame}
    4.30 +\titlepage
    4.31 +\end{frame}
    4.32 +
    4.33 +\begin{frame}{Outline}
    4.34 +\tableofcontents[subsectionstyle=hide]
    4.35 +\end{frame}
    4.36 +
    4.37 +\section{The example scenario}
    4.38 +
    4.39 +\begin{frame}{}
    4.40 +\end{frame}
    4.41 +
    4.42 +\section{The Helper version}
    4.43 +
    4.44 +\begin{frame}{}
    4.45 +\end{frame}
    4.46 +
    4.47 +\subsection{The point to point link}
    4.48 +
    4.49 +\begin{frame}{}
    4.50 +\end{frame}
    4.51 +
    4.52 +\subsection{The wifi infrastructure network}
    4.53 +
    4.54 +\begin{frame}{}
    4.55 +\end{frame}
    4.56 +
    4.57 +\subsection{Generating UDP traffic}
    4.58 +
    4.59 +\begin{frame}{}
    4.60 +\end{frame}
    4.61 +
    4.62 +
    4.63 +\subsection{Running the simulation}
    4.64 +
    4.65 +\begin{frame}{}
    4.66 +\end{frame}
    4.67 +
    4.68 +\section{The low-level version}
    4.69 +
    4.70 +\begin{frame}{}
    4.71 +\end{frame}
    4.72 +
    4.73 +\subsection{The point to point link}
    4.74 +
    4.75 +\begin{frame}{}
    4.76 +\end{frame}
    4.77 +
    4.78 +\subsection{The wifi infrastructure network}
    4.79 +
    4.80 +\begin{frame}{}
    4.81 +\end{frame}
    4.82 +
    4.83 +\subsection{Generating UDP traffic}
    4.84 +
    4.85 +\begin{frame}{}
    4.86 +\end{frame}
    4.87 +
    4.88 +\section{Diving in: topology construction}
    4.89 +
    4.90 +\begin{frame}{}
    4.91 +\end{frame}
    4.92 +
    4.93 +\subsection{Memory management}
    4.94 +
    4.95 +\begin{frame}{}
    4.96 +\end{frame}
    4.97 +
    4.98 +\subsection{Object aggregation}
    4.99 +
   4.100 +\begin{frame}{}
   4.101 +\end{frame}
   4.102 +
   4.103 +\subsection{Configuration}
   4.104 +
   4.105 +\begin{frame}{}
   4.106 +\end{frame}
   4.107 +
   4.108 +\section{Diving in: runtime}
   4.109 +
   4.110 +\begin{frame}{}
   4.111 +\end{frame}
   4.112 +
   4.113 +\subsection{Event scheduling}
   4.114 +
   4.115 +\begin{frame}{}
   4.116 +\end{frame}
   4.117 +
   4.118 +\subsection{Packets}
   4.119 +
   4.120 +\begin{frame}{}
   4.121 +\end{frame}
   4.122 +
   4.123 +\subsection{Sockets}
   4.124 +
   4.125 +\begin{frame}{}
   4.126 +\end{frame}
   4.127 +
   4.128 +\subsection{Headers and Trailers}
   4.129 +
   4.130 +\begin{frame}{}
   4.131 +\end{frame}
   4.132 +
   4.133 +
   4.134 +
   4.135 +\end{document}