mUDP是UDP的延伸,除了具有UDP的功能外,还能记录所发送的包的信息。mUdpSink可以把接收到的包的信息记录到文件中。

  1.下载mUDP, mUdpSink的文件,要下载的有下列几个文件:
       mudp.cc、mudp.h、mudpsink.cc、mudpsink.h

      http://www.pudn.com/Download/item/id/3280230.html


       2.新建/ns-allinone-2.33/ns-2.33/measure文件夹,把这四个文件放入其中。

       3.修改/ns-allinone-2.33/ns-2.33/common/packet.h,把如下程序加入struct hdr_cmn{}中。

                    int frametype_; //added by smallko

                    double    sendtime_;    // added by smallko

                    unsigned int pkt_id_; // added by smallko

                    unsigned int frame_pkt_id_; //added by smallko

      4.修改/ns-allinone-2.33/ns-2.33/Makefile,把如下程序加入OBJ_CC下一行。
                    measure/mudp.o measure/mudpsink.o \

      5.修改/ns-allinone-2.33/ns-2.33/tcl/lib/ns-default.tcl,把如下程序加入Agent/Ping set packetSize_ 64下一行。

                    Agent/mUDP set packetSize_ 1000

      6.用cygwin 的dos窗口在/ns-allinone-2.33/ns-2.33目录下执行./cofigure;make clean,make命令,就OK了。

猜你喜欢

转载自blog.csdn.net/sinat_22988423/article/details/78346121