Bcast_Flood

所属分类:网络
开发工具:C++
文件大小:673KB
下载次数:167
上传日期:2009-03-26 20:56:19
上 传 者phenix_yw
说明:  在NS-2环境中实现了移动Ad Hoc的两种广播算法:Flood和Bcast。里面本来有个test目录,包含了很多节点移动模型文件,由于太大了,因此就没上传。
(This code implements two broadcast protocols, FLOOD and BCAST. FLOOD is a simple flooding protocol: the first time a node receives a packet, it is re-broadcast. BCAST is more optimized, keeping track of 1-hop and 2-hop neighbors. Only packets that would reach additional neighbors are re-broadcast.)

文件列表:
bcast\bcast.cc (25961, 2004-03-24)
bcast\bcast.h (9184, 2004-03-24)
bcast\bcast.tcl (3007, 2004-03-24)
bcast\bcast_packet.h (4178, 2004-03-24)
bcast\bcast_queue.cc (6411, 2004-03-24)
bcast\bcast_queue.h (1965, 2004-03-24)
bcast (0, 2008-11-24)
flood\flood.cc (5082, 2004-03-24)
flood\flood.h (1748, 2004-03-24)
flood\flood.tcl (2879, 2004-03-24)
flood (0, 2009-03-26)
MANET_multicast\cache.cc (1460, 2004-03-24)
MANET_multicast\cache.h (876, 2004-03-24)
MANET_multicast\COPYING (18009, 2004-03-24)
MANET_multicast\mttable.cc (1797, 2004-03-24)
MANET_multicast\mttable.h (2738, 2004-03-24)
MANET_multicast\nhlist.cc (3807, 2004-03-24)
MANET_multicast\nhlist.h (1517, 2004-03-24)
MANET_multicast\unique_id.cc (1454, 2004-03-24)
MANET_multicast\unique_id.h (1337, 2004-03-24)
MANET_multicast (0, 2008-11-24)
misc\cmu-trace.cc (34540, 2004-03-24)
misc\cmu-trace.h (5062, 2004-03-24)
misc\ns-agent.tcl (5634, 2004-03-24)
misc\ns-lib.tcl (61433, 2004-03-24)
misc\ns-mcast.tcl (14355, 2004-03-24)
misc\ns-mobilenode.tcl (21208, 2004-03-24)
misc\ns-packet.tcl (7587, 2004-03-24)
misc\packet.h (17612, 2004-03-24)
misc (0, 2008-11-24)
Cascon2003.pdf (139061, 2008-11-24)
Multicasting.pdf (535333, 2008-11-24)

BCAST and FLOOD for NS 2.27 =========================== This code implements two broadcast protocols, FLOOD and BCAST. FLOOD is a simple flooding protocol: the first time a node receives a packet, it is re-broadcast. BCAST is more optimized, keeping track of 1-hop and 2-hop neighbors. Only packets that would reach additional neighbors are re-broadcast. The disadvantage is that BCAST needs to exchange periodic HELLO messages to maintain this neighborhood information. BCAST also comes in a "reliable" version, where nodes buffer the most recent packets. When a node receives packet N from sender A, it will check whether it received packet N-1 from that sender as well. If not, it will ask its neighbors to retransmit by sending a NACK(N-1, A). Nodes receiving a NACK will check their buffer, and if they have this packet buffered, will schedule a retransmission. If they overhear another node retransmitting that packet, they will cancel their own retransmission. In highly congested scenarios, adding network traffic in the form of NACKs and ensuing retransmissions makes a bad situation worse. So each node keeps track of the local network load (timestamping the most recent packet receptions) and suppressing NACKs if too many packets were received in too short an interval. The parameters, similar to the HELLO interval, required number of missed HELLOs before a node is no longer assumed to be a neighbor, etc. are all defined in BCAST.H and can be set to different values. The code is divided into 4 groups: 3 subdirectories and a collection of miscellaneous other files. To install the code, get a complete NS-ALLINONE-2.27 distribution from the NS2 website. This should install and validate based on the description in the top-level README file. Add the three directories MANET_multicast, bcast, and flood, to the ns-2.27 directory. MANET_multicast contains the code for a number of shared utilities, such as keeping track of recently received packet IDs, or implementing a FIFO cache of recently received packets. This code is used by FLOOD and BCAST, and can be helpful in the implementation of other multicast and broadcast routing protocols as well. The code in "flood" implements the simple FLOOD algorithm, the code in "bcast" similarly implements the BCAST algorithm. The skeleton was derived from the AODV implementation (i.e., the FLOOD or BCAST routing agents fit into the node structure similar to the AODV routing agent, which is different from the DSR routing agent). A number of other sources had to be modified as well. The allow nodes to join a multicast group, NS-MCAST.TCL in TCL/MCAST is changed to support TCL commands "bcast-join-group(group)", "bcast-leave-group(group)", and the same for FLOOD. Similarly, as we define two new routing agents and one new type of packet header, files NS-AGENT.TCL, NS-LIB.TCL, NS-MOBILENODE.TCL, and NS-PACKET.TCL in TCL/LIB need to be changed. To support the new BCAST protocol header, file PACKET.H in COMMON is changed as well. Finally, to support more meaningful tracefile output, we added routines to CMU-TRACE.{CC,H} in TRACE. The files provided in the MISC directory in this distribution can just be used to overwrite the corresponding files in the original NS2 distribution. A last required modification is to add the new object files to OBJ_CC in Makefile.in in ns-2.27. For example, the following lines, added after the aodv object files, would do the trick: MANET_multicast/mttable.o \ MANET_multicast/nhlist.o \ MANET_multicast/unique_id.o \ MANET_multicast/cache.o \ bcast/bcast.o bcast/bcast_queue.o \ flood/flood.o \ Once all these changes are made, simply type "./configure; make clean; make" in the ns-2.27 directory and the resulting NS2 binary will support the two new routing protocols. Scripts ======= To test the software, the directory TESTS contains a number of scripts to run a series of experiments with the two protocols. The subdirectories TRAFFIC.FLOOD and TRAFFIC.BCAST contain traffic descriptions (how many nodes are multicast sender, how many nodes are multicast receiver), the subdirectory SCENARIOS contains mobility scenarios for different mobility rates (all zero pause time, with maximum speeds of 0 m/s, 1 m/s, or 20 m/s). The scripts MASTER.FLOOD.BAT and MASTER.BCAST.BAT invoke a number of NS2 runs (for all combinations of 1, 2, 5, or 10 multicast sender, and 10, 20, 40, 60, 80, or 100 multicast receiver), for 10 different mobility models for the given speed. The scripts take three parameters: - the name of the directory with the traffic files, - the name of the directory for the result files, and - the maximum speed of the mobility scenarios Each NS2 run is invoked by the appropriate DRIVER.{BCAST,FLOOD}.TCL. After the run produced a tracefile in the result directory RESULTS.{BCAST,FLOOD}, the AWK-script EVAL.AWK is applied to the tracefile to extract relevant information and the tracefile is deleted.

近期下载者

相关文件


收藏者