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

Re: [ns] ns-2.1b8 & MNS v2



<Install Guide of MNS v2.0 for ns-2.1b8>


1. Install the 'ns-2.1b8', ns program.


2. Create subdir 'ns-2.1b8/tcl/lib/mns_v2.0' and
   copy the following 7 files to 'ns-2.1b8/tcl/lib/mns_v2.0' directory.
     ns-mpls-simulator.tcl
     ns-mpls-node.tcl
     ns-mpls-classifier.tcl
     ns-mpls-ldpagent.tcl
     ns-mpls-cbq.tcl
     ns-mpls-te-reroute.tcl
     ns-mpls-cr.tcl


3. Comment out / remove the following 4 lines from file
'ns-2.1b8/tcl/lib/ns-lib.tcl':
     source ../mpls/ns-mpls-simulator.tcl
     source ../mpls/ns-mpls-node.tcl
     source ../mpls/ns-mpls-ldpagent.tcl
     source ../mpls/ns-mpls-classifier.tcl

   Insert the following 7 lines into file 'ns-2.1b8/tcl/lib/ns-lib.tcl'
   instead:
     source ns-sat.tcl
     source ../mns_v2.0/ns-mpls-simulator.tcl          <<== inserted line
     source ../mns_v2.0/ns-mpls-node.tcl               <<== inserted line
     source ../mns_v2.0/ns-mpls-classifier.tcl         <<== inserted line
     source ../mns_v2.0/ns-mpls-ldpagent.tcl           <<== inserted line
     source ../mns_v2.0/ns-mpls-cbq.tcl                <<== inserted line
     source ../mns_v2.0/ns-mpls-te-reroute.tcl         <<== inserted line
     source ../mns_v2.0/ns-mpls-cr.tcl                 <<== inserted line


4. Insert 2 lines into 'Simulator instproc init' in
   'ns-2.1b8/tcl/lib/ns-lib.tcl' file as follows:

     Simulator instproc init args {
          $self create_packetformat

          $self instvar linked_mplsnodes_          <<== inserted line
          set linked_mplsnodes_ ""                 <<== inserted line

          ..................
     }


5. Insert the following lines into 'ns-2.1b8/tcl/lib/ns-link.tcl' file as
   follows:

    SimpleLink instproc init { src dst bw delay q {lltype "DelayLink"} } {
        $self next $src $dst
        $self instvar link_ queue_ head_ toNode_ ttl_
        $self instvar drophead_

        # Inserted line : top of line

        $self instvar usable_bw_ cbq_root_ cbq_bes_root_ cbq_rts_root_ \
                      cbq_st_root_
        $self instvar cbq_pool_flowids_ cbq_pool_classes_ cbq_pool_queues_
        set usable_bw_ -1
        set cbq_root_  nil
        set cbq_bes_root_  nil
        set cbq_rts_root_  nil
        set cbq_st_root_   nil
        set cbq_pool_flowids_  ""
        set cbq_pool_classes_  ""
        set cbq_pool_queues_   ""

        # Inserted line : bottom of line

       ..................
    }


6. In 'ns-2.1b8/tcl/lib/ns-default.tcl' comment out / remove all lines
   containing the phrases "MPLS" and "LDP".
      
   Insert the following lines into 'ns-2.1b8/tcl/lib/ns-default.tcl' file
   as follows:

     Phy/WiredPhy set bandwidth_ 10e6

     Classifier/Addr/MPLS set packetSize_ 0            <<== inserted line
     Classifier/Addr/MPLS set ttl_   32                <<== inserted line
     Classifier/Addr/MPLS set exp_   32                <<== inserted line
     Classifier/Addr/MPLS set trace_mpls_ 0            <<== inserted line
     Classifier/Addr/MPLS set label_ -1                <<== inserted line
     Classifier/Addr/MPLS set data_driven_trigger_ 0   <<== inserted line
     Classifier/Addr/MPLS set enable_reroute_    0     <<== inserted line
     Classifier/Addr/MPLS set reroute_option_ 0        <<== inserted line 
     Classifier/Addr/MPLS set reroute_egress_lsr_ 0    <<== inserted line
     Classifier/Addr/MPLS set dont_care_ 0             <<== inserted line
     Classifier/Addr/MPLS set failure_detection_ 0     <<== inserted line
     Classifier/Addr/MPLS set is_cbq_installed_ 0      <<== inserted line
     Agent/LDP set packetSize_  64                     <<== inserted line
     Agent/LDP set new_msgid_ 0                        <<== inserted line
     Agent/LDP set trace_ldp_ 0                        <<== inserted line


7. Create subdir 'ns-2.1b8/mns_v2.0' and
   copy the following 4 files to 'ns-2.1b8/mns_v2.0' directory.
     classifier-addr-mpls.h
     classifier-addr-mpls.cc
     ldp.h
     ldp.cc


8. Modify
     ns-2.1b8/mns_v2.0/classifier-addr-mpls.h
     ns-2.1b8/mns_v2.0/classifier-addr-mpls.cc
     ns-2.1b8/mns_v2.0/ldp.h
     ns-2.1b8/mns_v2.0/ldp.cc
   as follows:
   - comment out / remove all lines which contain
     "off_mpls_" or
     "off_ldp_"
   - replace
     "hdr_ldp *hdrldp = (hdr_ldp *) pkt->access(off_ldp_);" with
     "hdr_ldp *hdrldp = hdr_ldp::access(pkt);"
     and
     "hdr_ip *iphdr = (hdr_ip *) p->access(off_ip_);" with
     "hdr_ip* iphdr = hdr_ip::access(p);"
     and
     "hdr_mpls *mplshdr = (hdr_mpls *) p->access(off_mpls_);" with
     "hdr_mpls *mplshdr = hdr_mpls::access(p);"


9. Modify "ns-2.1b8/tcl/lib/mns_v2.0/ns-mpls-node.tcl" file as follows

   MplsNode instproc mk-default-classifier {} {
        $self instvar address_ classifier_ id_

        set classifier_ [new Classifier/Addr/MPLS]

        $classifier_ set mpls_node_ $self

        #$classifier_ set mask_ [AddrParams set NodeMask_(1)]     <<==
        #$classifier_ set shift_ [AddrParams set NodeShift_(1)]   <<==
        $classifier_ set mask_ [AddrParams NodeMask 1]            <<==
        $classifier_ set shift_ [AddrParams NodeShift 1]          <<==
        set address_ $id_   
   }


10. In file 'ns-2.1b8/Makefile.in' REMOVE line
        mpls/classifier-addr-mpls.o mpls/ldp.o mpls/mpls-module.o \
    and lines
        tcl/mpls/ns-mpls-classifier.tcl \
        tcl/mpls/ns-mpls-ldpagent.tcl \
        tcl/mpls/ns-mpls-node.tcl \
        tcl/mpls/ns-mpls-simulator.tcl \

    Instead insert line in file 'ns-2.1b8/Makefile.in' as follows:
        tfrc.o tfrc-sink.o energy-model.o ping.o tcp-rfc793edu.o \
        mns_v2.0/classifier-addr-mpls.o /mns_v2.0/ldp.o              <<==
    and lines
        tcl/mns_v2.0/ns-mpls-classifier.tcl \
        tcl/mns_v2.0/ns-mpls-ldpagent.tcl \
        tcl/mns_v2.0/ns-mpls-node.tcl \
        tcl/mns_v2.0/ns-mpls-simulator.tcl \
        tcl/mns_v2.0/ns-mpls-cbq.tcl \
        tcl/mns_v2.0/ns-mpls-te-reroute.tcl \
        tcl/mns_v2.0/ns-mpls-cr.tcl \

        
11. execute 'make clean", "configure" and "make"


NS should then compile nicely. Unfortunately there is another bug: When
trying to run the test scripts e.g. 'test-lsp.tcl' a segmentation error
occurs. The reason is in '~Agent::send()' -> the pointer to 'target_' is
NULL.
I'm currently working towards the solution of this problem. Does anybody
know the reason for 'target_' being NULL? Maybe the 
'configure-ldp-on-all-mpls-nodes' does not work properly.


----------------------------------------------------------------------------
Christian Glomb
Siemens AG
Corporate Technology
Networks and Multimedia Communications
Email: Christian.Glomb@mchp.siemens.de
----------------------------------------------------------------------------