blob: 5efffeb5915ac93d5340945cd715c6e09b3d7368 [file] [log] [blame]
Ilya Moiseenko58d26672011-12-08 13:48:06 -08001/* -*- 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"
28
29#include <iostream>
30#include <sstream>
Ilya Moiseenko58d26672011-12-08 13:48:06 -080031#include "ns3/rocketfuel-topology-reader.h"
32
Ilya Moiseenko58d26672011-12-08 13:48:06 -080033using namespace ns3;
34
35NS_LOG_COMPONENT_DEFINE ("CcnxSprintTopology");
36
37int
38main (int argc, char *argv[])
39{
40 Packet::EnableChecking();
41 Packet::EnablePrinting();
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080042 std::string weights ("./src/NDNabstraction/examples/sprint.weights");
43 std::string latencies ("./src/NDNabstraction/examples/sprint.latencies");
Ilya Moiseenko58d26672011-12-08 13:48:06 -080044
45 // ------------------------------------------------------------
46 // -- Read topology data.
47 // --------------------------------------------
48
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080049 RocketfuelWeightsReader reader;
50
51 reader.SetFileName (weights);
52 reader.SetFileType (RocketfuelWeightsReader::WEIGHTS);
53 NodeContainer nodes = reader.Read ();
54
55 reader.SetFileName (latencies);
56 reader.SetFileType (RocketfuelWeightsReader::LATENCIES);
57 reader.Read ();
Ilya Moiseenko58d26672011-12-08 13:48:06 -080058
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080059 if (reader.LinksSize () == 0)
Ilya Moiseenko58d26672011-12-08 13:48:06 -080060 {
61 NS_LOG_ERROR ("Problems reading the topology file. Failing.");
62 return -1;
63 }
64
65 NS_LOG_INFO("Nodes = " << nodes.GetN());
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080066 NS_LOG_INFO("Links = " << reader.LinksSize ());
Ilya Moiseenko58d26672011-12-08 13:48:06 -080067
68 NS_LOG_INFO ("Run Simulation.");
69 Simulator::Run ();
70 Simulator::Destroy ();
71 NS_LOG_INFO ("Done.");
72 return 0;
Alexander Afanasyev3406f3e2011-12-08 14:11:31 -080073}