author | Lalith Suresh <suresh.lalith@gmail.com> |
Thu, 26 May 2011 22:32:18 +0100 | |
changeset 7300 | 54af69b941fd |
parent 7285 | 83f76a2f8449 |
permissions | -rw-r--r-- |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
1 |
Click Modular Router Integration |
7214
052d30ceb700
split manual; create model library
Tom Henderson <tomh@tomh.org>
parents:
7034
diff
changeset
|
2 |
-------------------------------- |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
3 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
4 |
Click is a software architecture for building configurable routers. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
5 |
By using different combinations of packet processing units called elements, |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
6 |
a Click router can be made to perform a specific kind of functionality. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
7 |
This flexibility provides a good platform for testing and experimenting with |
7278
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
8 |
different protocols. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
9 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
10 |
Model Description |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
11 |
***************** |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
12 |
|
6973
692d041f61d4
Updates directory listings in Click manual entry
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6832
diff
changeset
|
13 |
The source code for the Click model lives in the directory ``src/click``. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
14 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
15 |
Design |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
16 |
====== |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
17 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
18 |
ns-3's design is well suited for an integration with Click due to the following reasons: |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
19 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
20 |
* Packets in ns-3 are serialised/deserialised as they move up/down the stack. This allows ns-3 packets to be passed to and from Click as they are. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
21 |
* This also means that any kind of ns-3 traffic generator and transport should work easily on top of Click. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
22 |
* By striving to implement click as an Ipv4RoutingProtocol instance, we can avoid significant changes to the LL and MAC layer of the ns-3 code. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
23 |
|
7278
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
24 |
The design goal was to make the ns-3-click public API simple enough such that the user needs to merely add an Ipv4ClickRouting instance to the node, and inform each Click node of the Click configuration file (.click file) that it is to use. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
25 |
|
7278
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
26 |
This model implements the interface to the Click Modular Router and |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
27 |
provides the Ipv4ClickRouting class to allow a node to use Click |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
28 |
for external routing. Unlike normal Ipv4RoutingProtocol sub types, |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
29 |
Ipv4ClickRouting doesn't use a RouteInput() method, but instead, |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
30 |
receives a packet on the appropriate interface and processes it |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
31 |
accordingly. Note that you need to have a routing table type element |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
32 |
in your Click graph to use Click for external routing. This is needed |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
33 |
by the RouteOutput() function inherited from Ipv4RoutingProtocol. |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
34 |
Furthermore, a Click based node uses a different kind of L3 in the |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
35 |
form of Ipv4L3ClickProtocol, which is a trimmed down version of |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
36 |
Ipv4L3Protocol. Ipv4L3ClickProtocol passes on packets passing through |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
37 |
the stack to Ipv4ClickRouting for processing. |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
38 |
|
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
39 |
|
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
40 |
Developing a Simulator API to allow ns-3 to interact with Click |
63894c46913a
Move click module description out of doxygen
Tom Henderson <tomh@tomh.org>
parents:
7220
diff
changeset
|
41 |
############################################################### |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
42 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
43 |
Much of the API is already well defined, which allows Click to probe for information from the simulator (like a Node's ID, an Interface ID and so forth). By retaining most of the methods, it should be possible to write new implementations specific to ns-3 for the same functionality. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
44 |
|
7285 | 45 |
Hence, for the Click integration with ns-3, a class named Ipv4ClickRouting will handle the interaction with Click. The code for the same can be found in ``src/click/model/ipv4-click-routing.{cc,h}``. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
46 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
47 |
Packet hand off between ns-3 and Click |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
48 |
###################################### |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
49 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
50 |
There are four kinds of packet hand-offs that can occur between ns-3 and Click. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
51 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
52 |
* L4 to L3 |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
53 |
* L3 to L4 |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
54 |
* L3 to L2 |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
55 |
* L2 to L3 |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
56 |
|
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
57 |
To overcome this, we implement Ipv4L3ClickProtocol, a stripped down version of Ipv4L3Protocol. Ipv4L3ClickProtocol passes packets to and from Ipv4ClickRouting appropriately to perform routing. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
58 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
59 |
Scope and Limitations |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
60 |
===================== |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
61 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
62 |
* In its current state, the NS-3 Click Integration is limited to use only with L3, leaving NS-3 to handle L2. We are currently working on adding Click MAC support as well. See the usage section to make sure that you design your Click graphs accordingly. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
63 |
* Furthermore, ns-3-click will work only with userlevel elements. The complete list of elements are available at http://read.cs.ucla.edu/click/elements. Elements that have 'all', 'userlevel' or 'ns' mentioned beside them may be used. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
64 |
* As of now, the ns-3 interface to Click is Ipv4 only. We will be adding Ipv6 support in the future. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
65 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
66 |
References |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
67 |
========== |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
68 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
69 |
* Eddie Kohler, Robert Morris, Benjie Chen, John Jannotti, and M. Frans Kaashoek. The click modular router. ACM Transactions on Computer Systems 18(3), August 2000, pages 263-297. |
7300
54af69b941fd
Updates references in Click model documentation
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7285
diff
changeset
|
70 |
* Lalith Suresh P., and Ruben Merz. Ns-3-click: click modular router integration for ns-3. In Proc. of 3rd International ICST Workshop on NS-3 (WNS3), Barcelona, Spain. March, 2011. |
54af69b941fd
Updates references in Click model documentation
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7285
diff
changeset
|
71 |
* Michael Neufeld, Ashish Jain, and Dirk Grunwald. Nsclick: bridging network simulation and deployment. MSWiM '02: Proceedings of the 5th ACM international workshop on Modeling analysis and simulation of wireless and mobile systems, 2002, Atlanta, Georgia, USA. http://doi.acm.org/10.1145/570758.570772 |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
72 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
73 |
Usage |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
74 |
***** |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
75 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
76 |
Building Click |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
77 |
============== |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
78 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
79 |
The first step is to build Click. At the top of your Click source directory:: |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
80 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
81 |
$: ./configure --enable-userlevel --disable-linuxmodule --enable-nsclick --enable-wifi |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
82 |
$: make |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
83 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
84 |
The --enable-wifi flag may be skipped if you don't intend on using Click with Wifi. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
85 |
* Note: You don't need to do a 'make install'. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
86 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
87 |
Once Click has been built successfully, change into the ns-3 directory and |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
88 |
configure ns-3 with Click Integration support:: |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
89 |
|
7034
4392d52b3536
Make examples not be built by default
Mitch Watrous <watrous@u.washington.edu>
parents:
7008
diff
changeset
|
90 |
$: ./waf configure --enable-examples --enable-tests --with-nsclick=/path/to/click/source |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
91 |
|
7220
66e672a8ea00
Updates click documentation to specify minimum required set of modules for building ns-3-click examples
Lalith Suresh <suresh.lalith@gmail.com>
parents:
7214
diff
changeset
|
92 |
If it says 'enabled' beside 'NS-3 Click Integration Support', then you're good to go. Note: If running modular ns-3, the minimum set of modules required to run all ns-3-click examples is wifi, csma and config-store. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
93 |
|
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
94 |
Next, try running one of the examples:: |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
95 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
96 |
$: ./waf --run nsclick-simple-lan |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
97 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
98 |
You may then view the resulting .pcap traces, which are named nsclick-simple-lan-0-0.pcap and nsclick-simple-lan-0-1.pcap. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
99 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
100 |
Click Graph Instructions |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
101 |
======================== |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
102 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
103 |
The following should be kept in mind when making your Click graph: |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
104 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
105 |
* Only userlevel elements can be used. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
106 |
* You will need to replace FromDevice and ToDevice elements with FromSimDevice and ToSimDevice elements. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
107 |
* Packets to the kernel are sent up using ToSimDevice(tap0,IP). |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
108 |
* For any node, the device which sends/receives packets to/from the kernel, is named 'tap0'. The remaining interfaces should be named eth0, eth1 and so forth (even if you're using wifi). Please note that the device numbering should begin from 0. In future, this will be made flexible so that users can name devices in their Click file as they wish. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
109 |
* A routing table element is a mandatory. The OUTports of the routing table element should correspond to the interface number of the device through which the packet will ultimately be sent out. Violating this rule will lead to really weird packet traces. This routing table element's name should then be passed to the Ipv4ClickRouting protocol object as a simulation parameter. See the Click examples for details. |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
110 |
* The current implementation leaves Click with mainly L3 functionality, with ns-3 handling L2. We will soon begin working to support the use of MAC protocols on Click as well. This means that as of now, Click's Wifi specific elements cannot be used with ns-3. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
111 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
112 |
Debugging Packet Flows from Click |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
113 |
================================= |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
114 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
115 |
From any point within a Click graph, you may use the Print (http://read.cs.ucla.edu/click/elements/print) element and its variants for pretty printing of packet contents. Furthermore, you may generate pcap traces of packets flowing through a Click graph by using the ToDump (http://read.cs.ucla.edu/click/elements/todump) element as well. For instance:: |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
116 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
117 |
myarpquerier |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
118 |
-> Print(fromarpquery,64) |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
119 |
-> ToDump(out_arpquery,PER_NODE 1) |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
120 |
-> ethout; |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
121 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
122 |
...will print the contents of packets that flow out of the ArpQuerier, then generate a pcap trace file which will have a suffix 'out_arpquery', for each node using the Click file, before pushing packets onto 'ethout'. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
123 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
124 |
Helper |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
125 |
====== |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
126 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
127 |
To have a node run Click, the easiest way would be to use the ClickInternetStackHelper |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
128 |
class in your simulation script. For instance:: |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
129 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
130 |
ClickInternetStackHelper click; |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
131 |
click.SetClickFile (myNodeContainer, "nsclick-simple-lan.click"); |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
132 |
click.SetRoutingTableElement (myNodeContainer, "u/rt"); |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
133 |
click.Install (myNodeContainer); |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
134 |
|
6973
692d041f61d4
Updates directory listings in Click manual entry
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6832
diff
changeset
|
135 |
The example scripts inside ``src/click/examples/`` demonstrate the use of Click based nodes |
7285 | 136 |
in different scenarios. The helper source can be found inside ``src/click/helper/click-internet-stack-helper.{h,cc}`` |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
137 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
138 |
Examples |
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
139 |
======== |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
140 |
|
6973
692d041f61d4
Updates directory listings in Click manual entry
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6832
diff
changeset
|
141 |
The following examples have been written, which can be found in ``src/click/examples/``: |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
142 |
|
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
143 |
* nsclick-simple-lan.cc and nsclick-raw-wlan.cc: A Click based node communicating with a normal ns-3 node without Click, using Csma and Wifi respectively. It also demonstrates the use of TCP on top of Click, something which the original nsclick implementation for NS-2 couldn't achieve. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
144 |
|
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
145 |
* nsclick-udp-client-server-csma.cc and nsclick-udp-client-server-wifi.cc: A 3 node LAN (Csma and Wifi respectively) wherein 2 Click based nodes run a UDP client, that sends packets to a third Click based node running a UDP server. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
146 |
|
6831
df63f4938ae8
Removes Click manual entry warnings
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6828
diff
changeset
|
147 |
* nsclick-routing.cc: One Click based node communicates to another via a third node that acts as an IP router (using the IP router Click configuration). This demonstrates routing using Click. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
148 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
149 |
Scripts are available within ``<click-dir>/conf/`` that allow you to generate Click files for some common scenarios. The IP Router used in ``nsclick-routing.cc`` was generated from the make-ip-conf.pl file and slightly adapted to work with ns-3-click. |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
150 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
151 |
Validation |
6832
eda3c4832b29
promote validation section header in click manual documentation
Tom Henderson <tomh@tomh.org>
parents:
6831
diff
changeset
|
152 |
********** |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
153 |
|
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
154 |
This model has been tested as follows: |
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
155 |
|
6973
692d041f61d4
Updates directory listings in Click manual entry
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6832
diff
changeset
|
156 |
* Unit tests have been written to verify the internals of Ipv4ClickRouting. This can be found in ``src/click/ipv4-click-routing-test.cc``. These tests verify whether the methods inside Ipv4ClickRouting which deal with Device name to ID, IP Address from device name and Mac Address from device name bindings work as expected. |
692d041f61d4
Updates directory listings in Click manual entry
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6832
diff
changeset
|
157 |
* The examples have been used to test Click with actual simulation scenarios. These can be found in ``src/click/examples/``. These tests cover the following: the use of different kinds of transports on top of Click, TCP/UDP, whether Click nodes can communicate with non-Click based nodes, whether Click nodes can communicate with each other, using Click to route packets using static routing. |
6828
26b3f160b071
Add click.rst manual file
Lalith Suresh <suresh.lalith@gmail.com>
parents:
diff
changeset
|
158 |
* Click has been tested with Csma, Wifi and Point-to-Point devices. Usage instructions are available in the preceding section. |