Hi, I'm trying to attach two routing protocols in one node:

I have tried this code (Monarch Project)


Class MyNODE -superclass Node/MobileNode

MyNODE instproc init {args} {
    global opt ns_ tracefd RouterTrace
    $self instvar rtr_agent_ second_agent_ first_agent_ dmux_ second_dmux_ 
entry_point_

    eval $self next $args    ;# parent class constructor

    
    set rtr_agent_ [new Agent/RTRAgent]
    $rtr_agent_ ip-addr [$self id]

    set first_agent_ [new Agent/Agentx]
    $first_agent_ ip-addr [$self id]

    set second_agent_ [new Agent/XXXRPAgent]
    $second_agent_ ip-addr [$self id]

    if { $RouterTrace == "ON" } {
    # Recv Target
    set rcvT [cmu-trace Recv "XXX" $self]
    $rcvT target $rtr_agent_
    set entry_point_ $rcvT   
    } else {
    # Recv Target
    set entry_point_ $rtr_agent_
    }

    #
    # Drop Target (always on regardless of other tracing)
    #
    set drpT [cmu-trace Drop "XXX" $self]

    $rtr_agent_ drop-target $drpT
    $first_agent_ drop-target $drpT
    $second_agent_ drop-target $drpT

    #
    # Log Target
    #
    set T [new Trace/Generic]
    $T target [$ns_ set nullAgent_]
    $T attach $tracefd
    $T set src_ [$self id]

    $rtr_agent_ log-target $T
    $first_agent_ log-target $T
    $second_agent_ log-target $T

    # jj: not sure abt mask
    set second_dmux_ [new Classifier/Addr]
    $second_dmux_ set mask_ 0xffffffff
    $second_dmux_ set shift_ 0
    $self add-route [$self id] $second_dmux_

    # ported: this was in MobileNode but they removed it
    set dmux_ [new Classifier/Addr]
    $dmux_ set mask_ 0xff
    $dmux_ set shift_ 0
    $self add-route [$self id] $dmux_
    # end port

    $rtr_agent_ target $first_agent_
    $rtr_agent_ mcast_target $second_agent_
    $first_agent_ target $dmux_
    $second_agent_ target $second_dmux_

 
 
    $self instvar classifier_
    set classifier_ "srnode made illegal use of classifier_"
   
}




If you know how to attach more than one routing protocols in one node ple tell 
me how to start or what read

THANK YOU! 

                                          

Reply via email to