This article is a great, it explains the process in more detail but it is application specific and more complicated that the needed stuff. So I tried to down the stairs and make a simplified version of the code to override the UDP and Application layer.
To run the example you just need to do the following steps:
1- Download the source and extract it then place the ex1 folder @ /your path/ns-allinone-2.32/ns-2.32/
2- Modify the ns-default.tcl file @ /your path/ns-allinone-2.32/ns-2.32/ tcl/lib/
Add the following line
Agent/UdpLayer set packetSize_ 1052
3- Modify the Makefile.in @ /your path/ns-allinone-2.32/ns-2.32/
Put in the OBJ_CC list the following lines
ex1/udplayer.o \
ex1/sinklayer.o \
ex1/trafficlayer.o \
@V_STLOBJ@
4- Recompilation of NS-2
cd /your path/ns-allinone-2.32/ns-2.32/
./configure;
make clean; make
5- Run the example
ns ex1/test.tcl
I hope this can help and I can do next tasks quickly
No comments:
Post a Comment