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

[ns] wdmlinks?



Hello ns users,

As most of them might have seen me trying to realise wdm in NS.
I had tried many possibilities and still trying to understand NS ,to add this feature.
 

please check the codes below and give the  suggestions .
might be inefficient but to start with......
 
 
 

Class WDMLink
WDMLink instproc init { noc } {
    $self next
    $self instvar nochannel_
    set nochannel_ $noc
}
 

Class SimpleWDMLink -superclass WDMLink
#this class responsible to create WDM links

SimpleWDMLink instproc init { noc bw delay {lltype "DelayLink"} } {
    $self instvar link_ queue_ head_

    for $head_ set link_ $selfor]incr i} {

    #here i create links for each channel
        set link_[set $i] [new $lltype]  # could i have a multiple links this way???
    #assign the parameter for each link
        $link_[set $i]   set bandwidth_  $bw
        $link_[set $i]  set delay_ $delay

        lappend wdmchlist  $link_[set $i] $bandwidth_ $delay

    }
}

Class  Linko -superclass Simulator

#this will be a procedure of simulator later
Linko instproc wdm-link { noc bw delay }
    set ns_[Simulator instance]
    $self instvar link_
    $self link_ [new SimpleWDMLink $noc $bw $delay]
}

please post the suggestions on this to contine further!
thanks
kishore
 
 
--
________________________________________________________________________________
Kishore Kumar Sathyanandam
Trainee at CTIT
University Of Twente
Netherlands
email: [email protected]
  (or)
   [email protected]
________________________________________________________________________________