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