⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 在NS-2环境中实现了移动Ad Hoc的两种广播算法:Flood和Bcast。里面本来有个test目录
💻
字号:
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.


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -