Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Ilya Moiseenko <iliamo@cs.ucla.edu> |
| 19 | */ |
| 20 | |
| 21 | |
| 22 | #include "ns3/core-module.h" |
| 23 | #include "ns3/network-module.h" |
| 24 | #include "ns3/point-to-point-module.h" |
| 25 | #include "ns3/NDNabstraction-module.h" |
| 26 | #include "ns3/point-to-point-grid.h" |
| 27 | #include "ns3/ipv4-global-routing-helper.h" |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 28 | #include "ns3/animation-interface.h" |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 29 | // #include "ns3/ccnx-l3-protocol.h" |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 30 | |
| 31 | #include <iostream> |
| 32 | #include <sstream> |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 33 | #include "ns3/annotated-topology-reader.h" |
Alexander Afanasyev | 7dbdcaf | 2011-12-13 21:40:37 -0800 | [diff] [blame] | 34 | #include "../utils/spring-mobility-helper.h" |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 35 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 36 | #include "ns3/config-store.h" |
| 37 | |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 38 | using namespace ns3; |
| 39 | using namespace std; |
| 40 | |
| 41 | NS_LOG_COMPONENT_DEFINE ("CcnxAbileneTopology"); |
| 42 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 43 | // int transmittedInterests = 0; |
| 44 | // int receivedInterests = 0; |
| 45 | // int droppedInterests = 0; |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 46 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 47 | // int transmittedData = 0; |
| 48 | // int receivedData = 0; |
| 49 | // int droppedData = 0; |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 50 | |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 51 | void PrintTime () |
| 52 | { |
| 53 | NS_LOG_INFO (Simulator::Now ()); |
| 54 | |
| 55 | Simulator::Schedule (Seconds (10.0), PrintTime); |
| 56 | } |
| 57 | |
| 58 | void PrintFIBs () |
| 59 | { |
| 60 | NS_LOG_INFO ("Outputing FIBs into [fibs.log]"); |
| 61 | Ptr<OutputStreamWrapper> routingStream = Create<OutputStreamWrapper> ("fibs.log", std::ios::out); |
| 62 | for (NodeList::Iterator node = NodeList::Begin (); |
| 63 | node != NodeList::End (); |
| 64 | node++) |
| 65 | { |
| 66 | // *routingStream->GetStream () << "Node " << (*node)->GetId () << "\n"; |
| 67 | |
| 68 | Ptr<CcnxFib> fib = (*node)->GetObject<CcnxFib> (); |
| 69 | NS_ASSERT_MSG (fib != 0, "Fire alarm"); |
| 70 | *routingStream->GetStream () << *fib << "\n\n"; |
| 71 | } |
| 72 | } |
| 73 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 74 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 75 | struct AggregateAppTrace |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 76 | { |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 77 | AggregateAppTrace () |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 78 | : m_transmittedInterests (0) |
| 79 | , m_transmittedData (0) |
| 80 | , m_receivedInterests (0) |
| 81 | , m_receivedNacks (0) |
| 82 | , m_receivedData (0) |
| 83 | { |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 84 | Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::CcnxConsumer/TransmittedInterests", |
| 85 | MakeCallback (&AggregateAppTrace::TransmittedInterests, this)); |
| 86 | |
| 87 | Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::CcnxConsumer/ReceivedNacks", |
| 88 | MakeCallback (&AggregateAppTrace::ReceivedNacks, this)); |
| 89 | |
| 90 | Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::CcnxProducer/ReceivedInterests", |
| 91 | MakeCallback (&AggregateAppTrace::ReceivedInterests, this)); |
| 92 | |
| 93 | Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::CcnxProducer/TransmittedContentObjects", |
| 94 | MakeCallback (&AggregateAppTrace::TransmittedData, this)); |
| 95 | |
| 96 | Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::CcnxConsumer/ReceivedContentObjects", |
| 97 | MakeCallback (&AggregateAppTrace::ReceivedData, this)); |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | void |
| 101 | TransmittedInterests (std::string context, |
| 102 | Ptr<const CcnxInterestHeader>, Ptr<CcnxApp>, Ptr<CcnxFace>) |
| 103 | { |
| 104 | m_transmittedInterests++; |
| 105 | } |
| 106 | |
| 107 | void |
| 108 | TransmittedData (std::string context, |
| 109 | Ptr<const CcnxContentObjectHeader>, Ptr<const Packet>, |
| 110 | Ptr<CcnxApp>, Ptr<CcnxFace>) |
| 111 | { |
| 112 | m_transmittedData++; |
| 113 | } |
| 114 | |
| 115 | void |
| 116 | ReceivedInterests (std::string context, |
| 117 | Ptr<const CcnxInterestHeader>, |
| 118 | Ptr<CcnxApp>, Ptr<CcnxFace>) |
| 119 | { |
| 120 | m_receivedInterests++; |
| 121 | } |
| 122 | |
| 123 | void |
| 124 | ReceivedNacks (std::string context, |
| 125 | Ptr<const CcnxInterestHeader>, |
| 126 | Ptr<CcnxApp>, Ptr<CcnxFace>) |
| 127 | { |
| 128 | m_receivedNacks++; |
| 129 | } |
| 130 | |
| 131 | void |
| 132 | ReceivedData (std::string context, |
| 133 | Ptr<const CcnxContentObjectHeader>, Ptr<const Packet>, |
| 134 | Ptr<CcnxApp>, Ptr<CcnxFace>) |
| 135 | { |
| 136 | m_receivedData++; |
| 137 | } |
| 138 | |
| 139 | uint64_t m_transmittedInterests; |
| 140 | uint64_t m_transmittedData; |
| 141 | uint64_t m_receivedInterests; |
| 142 | uint64_t m_receivedNacks; |
| 143 | uint64_t m_receivedData; |
| 144 | }; |
| 145 | |
| 146 | ostream& |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 147 | operator << (ostream &os, const AggregateAppTrace &trace) |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 148 | { |
| 149 | os << ">> (i): " << trace.m_transmittedInterests << "\n"; |
| 150 | os << ">> (d): " << trace.m_transmittedData << "\n"; |
| 151 | os << "<< (i): " << trace.m_receivedInterests << "\n"; |
| 152 | os << "<< (d): " << trace.m_receivedData << "\n"; |
| 153 | os << "<< (n): " << trace.m_receivedNacks << "\n"; |
| 154 | return os; |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 155 | } |
| 156 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 157 | struct AggregateCcnxTrace |
| 158 | { |
| 159 | AggregateCcnxTrace (const std::string &node = "*") |
| 160 | : m_inInterests (0) |
| 161 | , m_outInterests (0) |
| 162 | , m_dropInterests (0) |
| 163 | , m_inNacks (0) |
| 164 | , m_outNacks (0) |
| 165 | , m_dropNacks (0) |
| 166 | , m_inData (0) |
| 167 | , m_outData (0) |
| 168 | , m_dropData (0) |
| 169 | { |
| 170 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/ForwardingStrategy/OutInterests", |
| 171 | MakeCallback (&AggregateCcnxTrace::OutInterests, this)); |
| 172 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/InInterests", |
| 173 | MakeCallback (&AggregateCcnxTrace::InInterests, this)); |
| 174 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/DropInterests", |
| 175 | MakeCallback (&AggregateCcnxTrace::DropInterests, this)); |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 176 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 177 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/OutNacks", |
| 178 | MakeCallback (&AggregateCcnxTrace::OutNacks, this)); |
| 179 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/InNacks", |
| 180 | MakeCallback (&AggregateCcnxTrace::InNacks, this)); |
| 181 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/DropNacks", |
| 182 | MakeCallback (&AggregateCcnxTrace::DropNacks, this)); |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 183 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 184 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/OutData", |
| 185 | MakeCallback (&AggregateCcnxTrace::OutData, this)); |
| 186 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/InData", |
| 187 | MakeCallback (&AggregateCcnxTrace::InData, this)); |
| 188 | Config::Connect ("/NodeList/"+node+"/$ns3::CcnxL3Protocol/DropData", |
| 189 | MakeCallback (&AggregateCcnxTrace::DropData, this)); |
| 190 | } |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 191 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 192 | void OutInterests (std::string context, |
| 193 | Ptr<const CcnxInterestHeader>, Ptr<const CcnxFace>) |
| 194 | { m_outInterests++; } |
| 195 | void InInterests (std::string context, |
| 196 | Ptr<const CcnxInterestHeader>, Ptr<const CcnxFace>) |
| 197 | { m_inInterests++; } |
| 198 | void DropInterests (std::string context, |
| 199 | Ptr<const CcnxInterestHeader>, Ccnx::DropReason, Ptr<const CcnxFace>) |
| 200 | { m_dropInterests++; } |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 201 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 202 | void OutNacks (std::string context, |
| 203 | Ptr<const CcnxInterestHeader>, Ptr<const CcnxFace>) |
| 204 | { m_outNacks++; } |
| 205 | void InNacks (std::string context, |
| 206 | Ptr<const CcnxInterestHeader>, Ptr<const CcnxFace>) |
| 207 | { m_inNacks++; } |
| 208 | void DropNacks (std::string context, |
| 209 | Ptr<const CcnxInterestHeader>, Ccnx::DropReason, Ptr<const CcnxFace>) |
| 210 | { m_dropNacks++; } |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 211 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 212 | void OutData (std::string context, |
| 213 | Ptr<const CcnxContentObjectHeader>, bool fromCache, Ptr<const CcnxFace>) |
| 214 | { m_inData++; } |
| 215 | void InData (std::string context, |
| 216 | Ptr<const CcnxContentObjectHeader>, Ptr<const CcnxFace>) |
| 217 | { m_outData++; } |
| 218 | void DropData (std::string context, |
| 219 | Ptr<const CcnxContentObjectHeader>, Ccnx::DropReason, Ptr<const CcnxFace>) |
| 220 | { m_dropData++; } |
| 221 | |
| 222 | uint64_t m_inInterests; |
| 223 | uint64_t m_outInterests; |
| 224 | uint64_t m_dropInterests; |
| 225 | uint64_t m_inNacks; |
| 226 | uint64_t m_outNacks; |
| 227 | uint64_t m_dropNacks; |
| 228 | uint64_t m_inData; |
| 229 | uint64_t m_outData; |
| 230 | uint64_t m_dropData; |
| 231 | }; |
| 232 | |
| 233 | ostream& |
| 234 | operator << (ostream &os, const AggregateCcnxTrace &trace) |
| 235 | { |
| 236 | os << "(Interests)\n"; |
| 237 | os << ">> (in): " << trace.m_inInterests << "\n"; |
| 238 | os << ">> (out): " << trace.m_outInterests << "\n"; |
| 239 | os << "<< (drop): " << trace.m_dropInterests << "\n"; |
| 240 | os << "(Nacks)\n"; |
| 241 | os << "<< (in): " << trace.m_inNacks << "\n"; |
| 242 | os << "<< (out): " << trace.m_outNacks << "\n"; |
| 243 | os << "<< (drop): " << trace.m_dropNacks << "\n"; |
| 244 | os << "(Data)\n"; |
| 245 | os << ">> (in): " << trace.m_inData << "\n"; |
| 246 | os << ">> (out): " << trace.m_outData << "\n"; |
| 247 | os << "<< (drop): " << trace.m_dropData << "\n"; |
| 248 | return os; |
| 249 | } |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 250 | |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 251 | int |
| 252 | main (int argc, char *argv[]) |
| 253 | { |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 254 | // Packet::EnableChecking(); |
| 255 | // Packet::EnablePrinting(); |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 256 | string input ("./src/NDNabstraction/examples/abilene-topology.txt"); |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 257 | |
Alexander Afanasyev | 8633d5d | 2011-12-12 18:02:31 -0800 | [diff] [blame] | 258 | Time finishTime = Seconds (20.0); |
| 259 | string animationFile; |
| 260 | string strategy = "ns3::CcnxFloodingStrategy"; |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 261 | CommandLine cmd; |
Alexander Afanasyev | 8633d5d | 2011-12-12 18:02:31 -0800 | [diff] [blame] | 262 | cmd.AddValue ("finish", "Finish time", finishTime); |
| 263 | cmd.AddValue ("netanim", "NetAnim filename", animationFile); |
| 264 | cmd.AddValue ("strategy", "CCNx forwarding strategy", strategy); |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 265 | cmd.Parse (argc, argv); |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 266 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 267 | ConfigStore config; |
| 268 | config.ConfigureDefaults (); |
| 269 | |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 270 | // ------------------------------------------------------------ |
| 271 | // -- Read topology data. |
| 272 | // -------------------------------------------- |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 273 | |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 274 | AnnotatedTopologyReader reader ("/abilene"); |
Alexander Afanasyev | 7dbdcaf | 2011-12-13 21:40:37 -0800 | [diff] [blame] | 275 | reader.SetMobilityModel ("ns3::SpringMobilityModel"); |
Alexander Afanasyev | 8633d5d | 2011-12-12 18:02:31 -0800 | [diff] [blame] | 276 | reader.SetFileName (input); |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 277 | |
Alexander Afanasyev | 8633d5d | 2011-12-12 18:02:31 -0800 | [diff] [blame] | 278 | NodeContainer nodes = reader.Read (); |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 279 | |
Alexander Afanasyev | 8633d5d | 2011-12-12 18:02:31 -0800 | [diff] [blame] | 280 | if (reader.LinksSize () == 0) |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 281 | { |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 282 | NS_LOG_ERROR ("Problems reading the topology file. Failing."); |
| 283 | return -1; |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 284 | } |
| 285 | |
Alexander Afanasyev | 7dbdcaf | 2011-12-13 21:40:37 -0800 | [diff] [blame] | 286 | SpringMobilityHelper::InstallSprings (reader.LinksBegin (), reader.LinksEnd ()); |
| 287 | |
Alexander Afanasyev | a174aa5 | 2011-12-13 01:30:32 -0800 | [diff] [blame] | 288 | // InternetStackHelper stack; |
| 289 | // Ipv4GlobalRoutingHelper ipv4RoutingHelper ("ns3::Ipv4GlobalRoutingOrderedNexthops"); |
| 290 | // stack.SetRoutingHelper (ipv4RoutingHelper); |
| 291 | // stack.Install (nodes); |
| 292 | |
| 293 | // reader.AssignIpv4Addresses (Ipv4Address ("10.0.0.0")); |
| 294 | |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 295 | NS_LOG_INFO("Nodes = " << nodes.GetN()); |
Alexander Afanasyev | 8633d5d | 2011-12-12 18:02:31 -0800 | [diff] [blame] | 296 | NS_LOG_INFO("Links = " << reader.LinksSize ()); |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 297 | |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 298 | // Install CCNx stack |
| 299 | NS_LOG_INFO ("Installing CCNx stack"); |
| 300 | CcnxStackHelper ccnxHelper; |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 301 | ccnxHelper.SetForwardingStrategy (strategy); |
| 302 | ccnxHelper.EnableLimits (false, Seconds(0.1)); |
| 303 | ccnxHelper.SetDefaultRoutes (true); |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 304 | ccnxHelper.InstallAll (); |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 305 | |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 306 | NS_LOG_INFO ("Installing Applications"); |
Alexander Afanasyev | a174aa5 | 2011-12-13 01:30:32 -0800 | [diff] [blame] | 307 | CcnxConsumerHelper consumerHelper ("/5"); |
Alexander Afanasyev | 66e6fd7 | 2011-12-12 21:34:51 -0800 | [diff] [blame] | 308 | ApplicationContainer consumers = consumerHelper.Install (Names::Find<Node> ("/abilene", "ATLAng")); |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 309 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 310 | CcnxProducerHelper producerHelper ("/5",1024); |
| 311 | ApplicationContainer producers = producerHelper.Install (Names::Find<Node> ("/abilene", "IPLSng")); |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 312 | |
Alexander Afanasyev | a174aa5 | 2011-12-13 01:30:32 -0800 | [diff] [blame] | 313 | // // Populate FIB based on IPv4 global routing controller |
| 314 | // ccnxHelper.InstallFakeGlobalRoutes (); |
| 315 | // ccnxHelper.InstallRouteTo (Names::Find<Node> ("/abilene", "IPLSng")); |
| 316 | |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 317 | // Simulator::Schedule (Seconds (1.0), PrintFIBs); |
Alexander Afanasyev | a174aa5 | 2011-12-13 01:30:32 -0800 | [diff] [blame] | 318 | // PrintFIBs (); |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 319 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 320 | // Simulator::Schedule (Seconds (10.0), PrintTime); |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 321 | |
Alexander Afanasyev | 8633d5d | 2011-12-12 18:02:31 -0800 | [diff] [blame] | 322 | Simulator::Stop (finishTime); |
Alexander Afanasyev | 4a5c2c1 | 2011-12-12 18:50:57 -0800 | [diff] [blame] | 323 | |
| 324 | AnimationInterface *anim = 0; |
| 325 | if (animationFile != "") |
| 326 | { |
| 327 | anim = new AnimationInterface (animationFile); |
| 328 | anim->SetMobilityPollInterval (Seconds (1)); |
| 329 | } |
| 330 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 331 | // NS_LOG_INFO ("Configure Tracing."); |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 332 | AggregateAppTrace appTrace; |
| 333 | AggregateCcnxTrace ccnxTrace ("1"); |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 334 | |
Alexander Afanasyev | bdc0d98 | 2011-12-16 01:15:26 -0800 | [diff] [blame] | 335 | config.ConfigureAttributes (); |
| 336 | |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 337 | NS_LOG_INFO ("Run Simulation."); |
| 338 | Simulator::Run (); |
| 339 | Simulator::Destroy (); |
| 340 | NS_LOG_INFO ("Done."); |
Ilya Moiseenko | 816de83 | 2011-12-15 16:32:24 -0800 | [diff] [blame] | 341 | |
Alexander Afanasyev | f8fd590 | 2011-12-16 16:23:23 -0800 | [diff] [blame] | 342 | NS_LOG_INFO ("AppTrace: \n" << appTrace); |
| 343 | NS_LOG_INFO ("CcnxTrace: \n" << ccnxTrace); |
Alexander Afanasyev | 3406f3e | 2011-12-08 14:11:31 -0800 | [diff] [blame] | 344 | return 0; |
| 345 | } |