Adding Directional Antenna and Multiple Interface Support to ns-2.33

Following this post, I ported the directional antenna and multiple interface support from TeNs to ns-2.33.

You can download my patches, and re-compile ns-2.33 to enable support for directional antennas and multiple interfaces. Don’t forget to set the NS_ANTENNA_FILE environment variable.

Assuming $NS2 points to the directory where you have the ns-2.33 sources, and that you’re using the ns-allinone-2.33 release, here’s what you have to do:

cd $NS2
patch -p1 < dir-antenna.patch
patch -p1 < multi-if.patch
./configure --with-otcl=../otcl-1.13 --with-tclcl=../tclcl-1.19
make
export NS_ANTENNA_FILE=$NS2/mobile/antenna.txt

Comments

  1. hi,
    I am trying to simulate wireless link with multiple interface, when i use adhocRouting protocol WLSTATIC, i get following error

    http://gist.github.com/327076

    Could you please tell me what could be the problem ?

    Rameshwar on April 3, 2009 at 23:49
  2. hi,
    thanks so much for sharing this.

    do you also have a sample TCL script on how to use the directional antenna & multi-interface module? or a readme me will do as well

    hope its not too much trouble

    fizi on June 30, 2009 at 19:42
  3. fizi, this page has sample code: http://www.cse.iitk.ac.in/users/braman/tens/

    cbg on July 7, 2009 at 20:27
  4. Mates,

    I tried to install it on NS2.33 to experiment it. Interesting to find, in the patch, it is not using static routing as TENS thus the sample coding might not really apply directly.

    Wonder how a packet be sent up and front when more than one directional antenna loaded of a particular node. How this can be controlled via flow control.

    Hmm..Still half way on installation as have been attacked with numerous bugs when “make” after installing the patch.

    Do share if you have your user experience here.

    rgds
    Saravanan Kandasamy
    svanan77(at)gmail.com

    Saravanan Kandasamy on July 21, 2009 at 18:20
  5. Hi,
    Thank you for the 2.33 patch… I have incorporated this patch into my build and it seems to work.
    You mentioned that the multi interface functionality currently works only with AODV routing protocol. I was wondering whether it would be possible for you to it to DumbAgent as well? That would be pretty useful.. thanks again!

    regards,
    Swaroop

    Swaroop Sherey on August 19, 2009 at 01:48
  6. Swaroop, I don’t remember saying anything like that. multiple interfaces should work regardless of the routing protocol.

    cbg on August 21, 2009 at 11:18
  7. Hi,
    Everything is fine after patching.
    Now I need some help regarding a TCL script. I have downloaded sample_long.tcl from http://www.cse.iitk.ac.in/users/braman/tens/
    I hope to get more support from u in future.

    bipula on September 22, 2009 at 07:29
  8. Hi,

    Thank you for the 2.33 patch!, When I installed the patches, and executed my file, I have the next error:

    http://gist.github.com/327071

    Could you please tell me what could be the problem ?

    mart8a on October 21, 2009 at 01:04
  9. I have a problem the moment the simulation:

    http://gist.github.com/327069

    Could do you please help me.
    Thanks, Jimmy S. – Ecuador

    Jimmy on December 3, 2009 at 16:43
  10. Hi, I am using ns2.34
    Can the patches be used for ns2.34?

    Thank you very much.

    iCat on February 24, 2010 at 16:41
  11. I changed the code to the following.
    It is run, but while visualizing the nam file, “node 0 is not defined”.

    http://gist.github.com/327083

    icat on March 1, 2010 at 09:20
  12. I haven’t tested these patches on ns-2.34, and I’m not sure if they will work. If anyone can create updated patches for 2.34, I’d be happy to post them here.

    Also, please refrain from posting lengthy code samples directly or asking questions related to ns2, but not my patches.

    In the future, I won’t approve comments containing more than a few lines of code. You can use Gist or Pastebin and post a link here.

    For other ns2 questions, please use Stack Overflow. I wil take a look at your question if you send me a link. You can find my email address on the About page.

    cbg on March 9, 2010 at 22:19
  13. Hi,

    I installed the patches you posted here but i got the error when i execeute a multiinterface (I used net_if(0) and net_if(1)) wireless node simulation.

    _o14 reset: can’t read “reset”: no such variable
    while executing
    “$netif_($i) reset”
    (procedure “_o14″ line 4)
    (Node/MobileNode reset line 4)
    invoked from within
    “_o14 reset”

    The command $ns_ node-config -numif 2 is passed but i have this error. Can you help me?

    Thanks

    serkan on March 31, 2010 at 04:41
  14. serkan, I don’t think the error you’re getting is caused by my patches. Even if it was, I couldn’t help you without seeing your code.

    cbg on March 31, 2010 at 13:32
  15. Hi,i try to install it in NS2.33, when I executing the sample_long.tcl,there is some
    error like this:
    fopen:No such file or directory
    can’t open /home/dixun/ns-allinone-2.33/ns-2.33/mobile/antenna

    Could you please tell me what could be the problem ? i have set the NS_ANTENNA_FILE environment variable.
    thank you

    dixun on April 2, 2010 at 04:01
  16. everything is ok.thank you!
    export NS_ANTENNA_FILE=$NS2/mobile/antenna.txt is right!
    i forget .txt

    dixun on April 2, 2010 at 04:26
  17. Hi,

    Can the multiple interface support code be used to simulate 802.15.4 networks?

    Thank you.

    Best regards,
    Lup.

    Lup on April 19, 2010 at 15:39
  18. Hey I have the same problem that Jimmy from Ecuador had. I installed the patches and while running the sample.tcl or any other one from the samples I encounter the error:

    http://gist.github.com/327069 (same link posted by Jimmy)

    Could you please help me

    Thank you Very much

    Vixxx on September 17, 2010 at 03:09
  19. [...] ns-2.33 and it is working fine. After this I installed the patches for directional antenna from : http://cbg.me/2009/02/adding-directi…ort-to-ns-233/ When I am trying to run a sample script, I have this error: invalid command name [...]

    Error on example simulation on ns2 using add-on for directional antenna on September 21, 2010 at 06:21

Leave a Reply