Home » Source Code » The hidden node simulation under ns2.35

The hidden node simulation under ns2.35

2014-06-03 10:59:13
The author
Download(s): 1
Point (s): 1 
Category Category:
Shell ScriptShell Script Shell ScriptShell


The purpose of the experiment
- master the essence of the hidden node problem
The hidden node problem - the use of NS2 simulation
2 experimental background
The hidden node refers to in the coverage of the sending node external nodes in the coverage of the receiving nodes in. Due to listen to not to send the sending node, the hidden node may be transmitted to a receiving node grouping the same, lead to packet at the receiving node conflict. Hidden nodes can be divided into a sending node and the receiving node of hidden hidden.
Such as teaching eightieth page shown in Figure 3.17, the node A and C also wants to send data to the node B, but A and C are not in the transmission range of each other within the. So when A sends data to the B, C was not detected in A is to send data, think in the current network data transfer, data will be sent to the B. In this way, A and C and sends the data to B, making data conflict in B, eventually leading to send data is not available. This because of transmission distance and miscarriage of justice problem called the hidden node problem.
In order to solve the problem of hidden node, the request can use materials described in section 3.5.1 (Request to Send, the RTS transmits) and clear to send (Clear to Send, CTS) of the control information to avoid conflict. When the sender sends data, first sends a RTS packet to inform all the nodes in the transmission, not within the scope of any send operation. If the receiver is currently idle, in response to a CTS package, tell the sender can start sending data, the CTS package will inform all in receiver signal transmission range of the other nodes do not carry any transfer operation. Process such as teaching eightieth page shown in figure 3.18.
More about the textbook knowledge hidden nodes refer to section 3.5.1.
3 experimental environment
Cygwin, ns-allinone-2.34
4 experimental procedures
The hidden node simulation before the need to install a particular module.
The 4.1 module is installed
The simulation needs to install the module for mUDP, it is an extension of UDP, besides having function of UDP, the package information can also record transmitted. MUdpSink can bring the information recording packets received to a file. The installation process simulation module required as follows.
The acquisition of mUDP, the module file mUdpSink, specific have the following file, can in the electronic resources -- Experiment
Jin & Jiang, "a technical course of wireless networks: principles, applications and simulation experiment Handbook", Tsinghua University press
The source code of the 3.5.1 to get the;
Mudp.cc mudp.h mudpsink.cc mudpsink.h
The new measure folder under /ns-allinone-2.34/ns-2.34/, these four files into one;
The modification of the /ns-allinone-2.34/ns-2.34/common/ under the packet.h file, the following procedure to join struct hdr_cmn{}, as shown in figure 2.1;
Int frametype_;
Double sendtime_;
Unsigned int pkt_id_;
Unsigned int frame_pkt_id_;
Figure 2.1 add code position
The modification of the /ns-allinone-2.34/ns-2.34/ under the Makefile file, the following procedure to join OBJ_CC as shown in Figure 2.2 position;
Measure/mudp.o measure/mudpsink.o \
Figure 2.2 Makefile modified position
The modification of the /ns-allinone-2.34/ns-2.34/tcl/lib/ under the ns-default.tcl, the following procedure to join the last line of the file;
Agent/mUDP set packetSize_ 1000
6 in the Cygwin change to the /ns-allinone-2.34/ns-2.34 directory under the implementation of make clean; the make command, as shown in Figure 2.3, the compiler about ten minutes can be completed.
Figure 2.3 compiler add module switching path
4.2 simulation runs
The installation is completed after the module, you can start the simulation. The simulation process is as follows, topology see textbook page eightieth.
The simulation script for running a new directory in the "home/< username >/" directory, and different types of scripts separated by sub directory, then the simulation script copy Hidden_Terminal.tcl to the directory (TCL script writing is not
Jin & Jiang, "a technical course of wireless networks: principles, applications and simulation experiment Handbook", Tsinghua University press
To repeat, please refer to the relevant literature). As shown in Figure 2.4, where a new WNT directory in the directory, then placed in each experimental simulation code subdirectories. The experiment is the content of the 3.5.1 section of the textbook, the subdirectory named 3.5.1;
Figure 2.4 simulation code location
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
Hidden_Terminal.tcl3.13 kB28-02-11 11:31
mudp.cc2.64 kB17-02-11 11:31
mudp.h324.00 B17-02-11 11:31
mudpsink.cc1.19 kB17-02-11 11:31
mudpsink.h386.00 B17-02-11 11:31
<mUDP>0.00 B01-11-13 08:01
<3.5.1>0.00 B01-11-13 08:01
Sponsored links


(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words


  • 1
  • Page 1
  • Total 1

The hidden node simulation under ns2.35 (3.54 kB)

Need 1 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points


Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com


CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D