Arrange nodes in ns2

依然范特西╮ 提交于 2019-12-11 17:06:52

问题


I need to arrange 100 nodes in a hexagonal shape in my tcl script. My simulation is wireless (dsr protocol). How can I do this? Which is the best size of the grid? I thought 3000x3000.

Thank you.


回答1:


The simplest way is to build the network graphically .. you can use nsg tool to build the network and generate the tcl code very easily

http://www.nsnam.com/2013/04/ns2-scenario-generator.html

first you must determine the transition range of nodes, put required number of node-> get network size , or you can compute it mathematically using transmition range and hexagon aria

https://en.wikipedia.org/wiki/Hexagon

If you plan to use nsg to draw a regular hexagon use this simple trick:

  • if the transmition range is equal to 300 m then make it 250 m
  • put first node in the center of the network.
  • put two nodes in the border of first node coverage aria.
  • put other nodes in the 4 Intersection of coverage area o previous 3 nodes.
  • repeat previous steps for other hexagons.
  • return the transmition range to its correct value (300 m).



来源:https://stackoverflow.com/questions/47359275/arrange-nodes-in-ns2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!