[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] MPLS simulation



>         The only problem with this setup is that I don't know how to create
> new MPLS tcl classes based on this new structure.

You can derive your new module from RtModule/MPLS, just like you'd derive
a new mpls node from Node. Then:

(1) implement an instproc just like Simulator::MPLS{} in ns-lib.tcl
(suppose your module is called MyMPLS):
Simulator instproc mympls { val } {
        if { $val == "ON" } {
                Node enable-module "MyMPLS"
        } else {
                Node disable-module "MyMPLS"
        }
}
then you can use node-config in the same way: instead of saying
$ns node-config -MPLS ON, you say, $ns node-config -mympls ON

OR, (2) you don't use node-config, but directly use Node
enable-module. This will work, but the node-config is the recommended way.

- Haobo