gpsr
所属分类:其他
开发工具:C/C++
文件大小:41KB
下载次数:8
上传日期:2019-03-14 22:58:35
上 传 者:
夜静思
说明: ns2网络仿真器
可以进行网络仿真
支持无线和有线网络
GPSR路由算法是使用地理位置信息实现路由(非辅助作用)的一种算法,它使用贪婪算法来建立路由。当节点S需要向节点D转发数据分组的时候,它首先在自己的所有邻居节点中选择一个距节点D最近的节点作为数据分组的下一跳,然后将数据传送给它。该过程一直重复,直到数据分组到达目的节点D或某个最佳主机。
产生或收到数据的节点向以欧氏距离计算出的最靠近目的节点的邻节点转发数据,但由于数据会到达没有比该节点更接近目的点的区域(称为空洞),导致数据无法传输,当出现这种情况时,空洞周围的节点能够探测到,并利用右手法则沿空洞周围传输来解决此问题.
该协议避免了在节点中建立、维护、存储路由表,只依赖直接邻节点进行路由选择,几乎是一个无状态的协议;且使用接近于最短欧氏距离的路由,数据传输时延小;并能保证只要网络连通性不被破坏,一定能够发现可达路由.
(The GPSR implemenation for NS2 version 2.26 or later
Author: Ke Liu, Computer Science Department,
State University of New York, at Binghamton (SUNY Binghamton)
October, 2005
This code is under copyleft. You can use it, change it and distribute it
as you wish. But no responsibility would be taken by the author of this
code. For any publication or product based on this code, you should
reference it, even for your course projects if you are using it for any
educational purposes.)
文件列表:
gpsr\cbr100.tcl (1635, 2005-12-02)
gpsr\cmu-trace.cc (31925, 2005-12-02)
gpsr\gpsr.cc (10486, 2006-03-23)
gpsr\gpsr.h (4993, 2006-03-23)
gpsr\gpsr.tcl (2092, 2005-12-02)
gpsr\gpsr_neighbor.cc (10059, 2005-12-02)
gpsr\gpsr_neighbor.h (4534, 2006-03-23)
gpsr\gpsr_packet.h (4186, 2006-03-23)
gpsr\gpsr_sinklist.cc (3494, 2006-03-23)
gpsr\gpsr_sinklist.h (2382, 2006-03-23)
gpsr\grid-deploy10x10.tcl (10304, 2005-12-02)
gpsr\ns-packet.tcl (7572, 2005-12-02)
gpsr\packet.h (17502, 2005-12-02)
gpsr\priqueue.cc (4911, 2005-12-02)
gpsr\wireless-gpsr.tcl (8815, 2005-12-02)
gpsr (0, 2015-05-15)
The GPSR implemenation for NS2 version 2.26 or later
Author: Ke Liu, Computer Science Department,
State University of New York, at Binghamton (SUNY Binghamton)
October, 2005
This code is under copyleft. You can use it, change it and distribute it
as you wish. But no responsibility would be taken by the author of this
code. For any publication or product based on this code, you should
reference it, even for your course projects if you are using it for any
educational purposes.
GPSR code for NS2 version 2.26 or later
Note: this implementation of GPSR is different from its original
version wich implemented by Brad Karp, Harvard Univ. 1999
It is not guaranteed precise implementation of the GPSR design
Files:
1. To create a directory called "gpsr" in ns2/ns-2.2x/, put all the
below files in it.
gpsr_packet.h : definition of packets of different type used by this
implementaion
gpsr_neighbor.h : definition of the neighbor list of each node used by
this gpsr implementation
including the planaring procedure (both GG and RNG)
gpsr_neighbor.cc : the implementation of the neighbor list class
gpsr.h : the definition of functions of GPSR routing agent of this
implementation
gpsr.cc : the implementation of the GPSR routing agent
gpsr_sinklist.h: definition used for scenarios with multiple sinks
gpsr_sinklist.cc: implementation of gpsr_sinklist.cc
gpsr.tcl : the node and agent creation functions used by simultion
configuration in wireless-gpsr.tcl
wireless-gpsr.tcl : the simulation configuration
grid-deploy10x10.tcl : 100 nodes in a 200x200 meter area
cbr100.tcl : node 99 sends cbr traffic on UDP to node 0
2. The below files should replace the original files of ns2
packet.h : file in ns2/common
Or you just need to add one more packet type as "PT_GPSR"
cmu-trace.cc : file in ns2/trace
Or you just need to tell the trace "PT_GPSR" is recognized
priqueue.cc : file in ns2/queue
Or you just need to tell the queue "PT_GPSR" should be enqueued
through enquenHighpriority the same as PT_DSR, PT_DSDV, etc.
ns-packet.tcl : file in ns2/tcl/lib,
be careful for this file, you just need to add one more entry in the
foreach prot {} function : GPSR. You don't really need this file to
be replaced if you use another version of ns2 than ns2.26
3. In the Makefile, you need to replace line
$(OBJ_STL)
in ns2/ns-2.2x/Makefile as
$(OBJ_STL) \
gpsr/gpsr_neighbor.o \
gpsr/gpsr_sinklist.o \
gpsr/gpsr.o
Notice:
1) check the wireless-gpsr.tcl first and you need to configure:
ns2home -- the home directory of your ns2 code directory
opt(nn) -- number of nodes
opt(start) -- the time your data source starts to publish data
opt(stop) -- the time your data source stops to publish data
Agent/GPSR
planar_type_ -- used for different planarizing algorithm
0 for RNG planarize
1 for GG planarize
hello_period_ -- the period used for hello message periodically
2) after you change or replace all above files in ns2 original ones, please
make sure you delete the packet.o file in common directory, and then
make the ns2 again (in ns2/ns-2.2x, type make)
For more possibilities for simulation, check the wireless-gpsr.tcl file
and the GPSR routing agent implementation code
近期下载者:
相关文件:
收藏者: