blob: 9ec64b3346711b39aeecc5ace376b4a038059ece [file] [log] [blame]
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -07001FAQ
2===
3
4Boost libraries
5---------------
6
7.. topic:: Custom boost libraries compilation problem
8
9 I'm trying to use custom boost libraries, but something is going wrong. What should I do?
10
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080011.. Please refer to :ref:`boost-custom-install` section for an example how custom boost libraries could be built.
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -070012
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080013.. include:: boost-custom-install.rst
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -070014
15Visualizer problems
16-------------------
17
18.. topic:: Visualizer module is not working
19
20 Every time I'm trying to run visualizer, I get the following error::
21
22 Waf: Entering directory `/ndnSIM/ns-3/build'
23 Could not find a task generator for the name 'ns3-visualizer'..
24
25Something is wrong with your python bindings and python bindings dependencies.
26Please follow the :ref:`requirements` section that lists what should be installed in order to run visualizer.
27
28Code questions
29--------------
30
31.. topic:: Failing a link between nodes
32
33 How can I fail a link between to NDN nodes?
34
35
36Right now, NS-3 does not provide ability to actually "break" the link between nodes in NS-3.
37However, exactly the same effect can be achieved by making an interface (:ndnsim:`ndn::Face`) up or down (:ndnsim:`ndn::Face::SetUp(true)` or :ndnsim:`ndn::Face::SetUp(false)`).
38
39Here is an example of function to "fail" a point-to-point link between two NDN nodes:
40
41.. code-block:: c++
42
43 // hijacker is more than an application. just disable all faces
44 void
45 FailLinks (Ptr<Node> node1, Ptr<Node> node2)
46 {
47 Ptr<ndn::L3Protocol> ndn1 = node1->GetObject<ndn::L3Protocol> ();
48 Ptr<ndn::L3Protocol> ndn2 = node2->GetObject<ndn::L3Protocol> ();
49
50 // iterate over all faces to find the right one
51 for (uint32_t faceId = 0; faceId < ndn1->GetNFaces (); faceId++)
52 {
53 Ptr<ndn::NetDeviceFace> ndFace = ndn1->GetFace (faceId)->GetObject<ndn::NetDeviceFace> ();
54 if (ndFace == 0) continue;
55
56 Ptr<PointToPointNetDevice> nd1 = ndFace->GetNetDevice ()->GetObject<PointToPointNetDevice> ();
57 if (nd1 == 0) continue;
58
59 Ptr<Channel> channel = nd1->GetChannel ();
60 if (channel == 0) continue;
61
62 Ptr<PointToPointChannel> ppChannel = DynamicCast<PointToPointChannel> (channel);
63
64 Ptr<NetDevice> nd2 = ppChannel->GetDevice (0);
65 if (nd2->GetNode () == node1)
66 nd2 = ppChannel->GetDevice (1);
67
68 if (nd2->GetNode () == node2)
69 {
70 Ptr<ndn::Face> face1 = ndn1->GetFaceByNetDevice (nd1);
71 Ptr<ndn::Face> face2 = ndn2->GetFaceByNetDevice (nd2);
72
73 face1->SetUp (false);
74 face2->SetUp (false);
75 break;
76 }
77 }
78 }
79
80
81General questions
82-----------------
83
84.. topic:: Errors/bugs reporting
85
86 I found an error in the documentation / bug in the code. What should I do?
87
88Please create an issue for the documentation error or code bug.
89We will try to resolve the problem as fast as we can.