Thursday, March 4, 2010

Classifiers and Routing Modules

Note: This is a detailed note for the book, Introduction to Network Simulator NS2. You may have to read the book for better understanding.

Classifiers

Typically residing in a Node, a classifier is an NS2 component responsible for classifying packets. A classifier has one input link and several output links. When packets enters a classifier (via an input link), they are classified based on predefined criteria. Packets of different categories are forwarded to the different corresponding output links. These output links refer to logical connections from a classifier to another NS2 object such as a physical link, a transport layer protocol, a prioritized queue, etc.
A node can contains several classifiers. Configuring classifiers one by one is a laborious task. It would be more convenient to configure all the classifiers via a single point of management. In NS2, that single points is called Routing Module.

Routing Modules

Routing module is an NS2 component designed specifically for managing classifiers. Via routing module, all classifiers can be configured by using a single command (e.g., add-route).

Relationship of Classifiers and Routing Modules
By convention, NS2 uses one routing module to manage a classifier. When a node has multiple classifiers, NS2 creates multiple routing module and associated each routing module with each classifier. An example configuration is shown below:


From the above figure, a routing module has a pointer "classifier_" which points to the associated classifier. Multiple routing modules are links together by using pointer "next_rtm_". When we need to add a routing entry to all classifiers (by calling the instproc add-route), we only need to send the command through the first routing module (RM1), and the chain of routing modules will automatically propagate the commend to all connecting classifiers.

Great! Now, we understand the purpose of routing modules. But how do we create the structure like the above picture? Stay tune. I will blog about it soon!

For more information about classifiers and routing module, see Chapter 6 in the following book from Springer:

T. Issaraiyakul and E. Hossain, "Introduction to Network Simulator NS2", Springer 2009. Buy it now from

You may also find lecture notes and other resource at the following website: http://www.ece.ubc.ca/~teerawat/NS2.htm

No comments: