hi,
i guess there is something wrong on ns-lib.tcl
for some reason "chan" is set as a usual variable. if you follow the
modifications of the document correctly, "chan" is used as an array in
case of mutliple interfaces.
the problem might hide somewhere in here:
> if {[info exists channelType_] && [info exists channel_]} {
> error "Can't specify both channel and channelType, error!"
> } elseif {[info exists channelType_] && ![info exists satNodeType_]} {
> # Single channel, single interface
> warn "Please use -channel as shown in tcl/ex/wireless-mitf.tcl"
> if {![info exists chan]} {
> set chan [new $channelType_]
> }
> } elseif {[info exists channel_]} {
> # Multiple channel, multiple interfaces
> if {[info exists numifs_]} {
> set chan(0) $channel_
> } else {
> set chan $channel_
> }
> }
otherwise "chan" is set wrong before. in that case i would check
"instproc node-config" in ns-lib.tcl
cheers,
tim
Nguyen Lan schrieb:
> Hi,
>
> bacause of you are success to build ns with multi-interface so I'd
> like to ask for your help. When I run a test scenario I got that error
>
> warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
> can't set "chan(0)": variable isn't array
> while executing
> "set chan($indexch) $ch"
> (procedure "_o3" line 3)
> (Simulator add-channel line 3)
> invoked from within
> "$ns_ add-channel 0 $chan_(0)"
> (file "mulif.tcl" line 131)
>
> Do you have any idea ?
>
> Cheers,
> Nguyen.
>
> Tim Elschner wrote:
>> hi,
>>
>> i'm trying to user mutliple interfaces with the adhoc routing agent
>> "noah" - which stands for "NO AdHoc routing". i use only one mobile
>> node, and some basestations with foreign agents, an home agent and a
>> corresponding node.
>> as noah doesn't need a routing table, i use a map for storing the
>> interface. i use the "prev_hop" field in the common-header to
>> associate the interface.
>> in the "forwardPacket" function - which is for unicast transmissions
>> - i use the information stored in the map to send the packets through
>> the correct interface. this works fine with interface 1, but fails
>> vor interface 0. all packets are dropped. if i just flip the channels
>> between interface 0 and 1, still interface 1 is working and interface
>> 0 fails.
>>
>> did i miss something?
>> hints anyone? :)
>>
>> cheers,
>> tim
>>
>>
>> Ramon Aguero schrieb:
>>
>>> Hello Tim,
>>>
>>> thanks for pinpointing the error! Somehow I made a mistake when
>>> copying and pasting the code to the file.
>>>
>>> The correct procedure would be the following one (note that the
>>> arptable_ is now within the 'for' cycle). In this sense, I don't
>>> think you need to change all arptable_ into arptable. Hope this helps.
>>>
>>> Node/MobileNode instproc reset {} {
>>> $self instvar arptable_ nifs_ netif_ mac_ ifq_ ll_ imep_
>>> for {set i 0} {$i < $nifs_} {incr i} {
>>> $netif_($i) reset
>>> $mac_($i) reset
>>> $ll_($i) reset
>>> $ifq_($i) reset
>>> if { [info exists opt(imep)] && $opt(imep) == "ON" } {
>>> $imep_($i) reset
>>> }
>>> if { $arptable_($i) != "" } {
>>> $arptable_($i) reset
>>> }
>>> }
>>> }
>>>
>>> Cheers,
>>> Ramón
>>>
>>> PS - I've already modified the document -- with the correct
>>> procedure -- in the web page:
>>> http://personales.unican.es/aguerocr
>>>
>>>
>>> At 16:39 18/01/2007, Tim Elschner wrote:
>>>
>>>> great job as far as i can see.
>>>> anyway i ran into problems with ns-mobilenode.tcl:
>>>> in "Node/MobileNode instproc reset" i couldn't find any differences
>>>> to the original.
>>>> i got an error, that arptable_ is an array. so i changed every
>>>> arptable_ into arptable. now ns2 complains about the missing
>>>> variable arptable :(
>>>>
>>>> any hints out there?
>>>>
>>>> cheers,
>>>> tim
>>>>
>>>> Ramon Aguero schrieb:
>>>>
>>>>> Dear all,
>>>>>
>>>>> We have seen a lot of requests about the possibility to extend the
>>>>> NS-2 framework to support multiple interfaces. Although there is
>>>>> some information available, according to the messages that have
>>>>> been sent to this list, it seems that a more thorough description
>>>>> may be required.
>>>>>
>>>>> In this sense, after performing an analysis about existing
>>>>> activities in this topic, we have created a document that tries to
>>>>> summarize which are the required changes to be performed within
>>>>> the different pieces of the simulator (tcl, c++) as well as how
>>>>> routing protocols can be adapted to make use of the new feature.
>>>>> The howto is entitled "Adding Multiple Interface Support in NS-2"
>>>>> and it has been written by my colleague Jesús Pérez and myself.
>>>>>
>>>>> I’ve uploaded the document, which can be retrieved from the
>>>>> following url:
>>>>> <http://personales.unican.es/aguerocr>http://personales.unican.es/aguerocr
>>>>>
>>>>>
>>>>>
>>>>> We will be happy to receive any feedback, comments, so as to
>>>>> improve the howto, since we would like to have it like a living
>>>>> document, adding new features as they are available.
>>>>>
>>>>> Best regards,
>>>>> Ramón
>>>>>
>>>>> ========================================
>>>>> Ramón Agüero Calvo
>>>>> Dept. of Communications Engineering
>>>>> Network Planning & Mobile Communications
>>>>> Laboratory
>>>>> University of Cantabria
>>>>> Avda Castros s/n
>>>>> 39005 - Santander
>>>>> SPAIN
>>>>> [EMAIL PROTECTED]
>>>>> Tel: +34 942 201 392 (Ext 14)
>>>>> Fax: +34 942 201 488
>>>>> ========================================
>>>>>
>>>>>
>>
>>
>>
>