บทความ

กำลังแสดงโพสต์จาก 2010

Setup NS2 for Eclipse under Linux

Download Eclipse SDK Download Eclipse C++ Development Tooling Extract Eclipse SDK to a folder, i.e. /home/username/eclipse Extract Eclipse CDT to the same folder Download NS2 Extract NS2 to a folder, i.e. /home/username/ns-allinone-2.29 Edit Makefile if necessary (see note below for details) Build NS2 Start Eclipse Choose your ns2 folder as your workspace folder, default:/home/username/ns-allinone-2.29 Create new C++ Project Select File->New->Project... Select C++->Standard C++ Make Project Click Next Enter ns-2.29 as your project name Click Finish Create a Launch Configuration Select Run->Debug... Select C/C++ Local Application Click "New Launch Configuration" Under Project, click Browse and select "ns-2.29" Under C/C++ Application, click Search Project and select "ns" Click Apply Click Close Note: The debugger needs debug information to be generated by the compiler. To make the compiler genera...

Install Ns-2.29 on Ubuntu 10.04

1. Installed the tcl, tk, gcc, g++ $ sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3 2. Copy ns-allinone-2.29.tar.gz in directory sudo cp -R ns-allinone-2.29.tar.gz /usr/src 3. Extract ns-allinone-2.29.tar.gz sudo tar xvfz ns-allinone-2.29.tar.gz sudo tar -jxvf ns-allinone-2.29.tbz 4. change ns-allinone-2.29 /otcl-1.13 CC = @CC@ to CC = gcc-4.3 5. Download & install some packages sudo apt-get install build-essential autoconf automake libxmu-dev 6. install NS2 sudo ./install 7. goto ns-2.29 sudo ./validate 8. test run ns2 ns % Reference : http://paulson.in/?p=29 www.scribd.com/doc/33039298/NS2-in-Ubuntu-10-by-Noor-Zaman www.techquark.com/2009/09/install-ns-2-on-ubuntu-9.04.html

Message Flow

Node-------------------------->Server HandShake Message BitField Message Interested Message Unchoke Message Request Message Piece Message Have Message Not Interested Message or Cancel Message Choke Message

UDP Protocol Position

./~ns-2.29/apps/udp -------------------------------------------------- ./~ns-2.29/tcl/lib/ns-default.tcl Agent/UDP set packetSize_ 1000 Agent/UDP instproc done { } { } Agent/UDP instproc process_data {from data} { } -------------------------------------------------- find . -name *UDP* -print ./doc/udp.tex ./tcl/ex/udpdata.tcl ./apps/udp.cc ./apps/udp.h ./apps/udp.o ---------------------------------------------------

Add UDP Protocol

bittorrent_connection.cc send_udp receive_udp Line 59 ---> tcl.eval("new Agent/TCP/FullTcp/Newreno); ------------------------------------------------------------- set udp [new Agent/UDP] $ns attach-agent $node_(0) $udp set null [new Agent/Null] $ns attach-agent $node_(i) $null $connect $udp $null $ap attach-agent $udp ------------------------------------------------------------- for { set i 0 } {$i { set udp($i) [new Agent/myUDP] $ns attach-agent $node_(0) $udp($i) $udp($i) set packetSize_$packetsize $udp($i) set_filename sd_foreman_$i }

Work

work 15/07/2010 เปลี่ยนจาก TCP เป็น UDP TCP ใช้ในการ control message ระหว่าง tracker, super node และ peer UDP ใช้ในการส่ง Video Streaming ระหว่าง peer ทำ Cluster โดย พิจารณาการเลือก super node แบบที่มีอยู่แล้ว