2007/12/17

NS2 快速入門: DV-distance 模擬 (5)

存取實體層

Reference: http://www.baisi.net/viewthread.php?tid=13936

節錄片段程式碼:
dv-distance/dv-distance.cc
[cpp]
int DV_DistanceAgent::command(int argc, const char*const* argv) {
Node* self_ = Node::get_node_by_address(addr());
printf("S: self->nodeid(): %d\n", self_->nodeid());
}

void DV_DistanceAgent::recv(Packet* pkt, Handler*) {
printf("Recv OK\n");

printf("R: pkt->txinfo_.getNode()->nodeid(): %d\n", pkt->txinfo_.getNode()->nodeid());
printf("R: txinfo_.getTxPr(): %.20lf\n", pkt->txinfo_.getTxPr());
printf("R: txinfo_.getLambda(): %.20lf\n", pkt->txinfo_.getLambda());
printf("R: txinfo_.RxPr: %.20lf\n", pkt->txinfo_.RxPr);
printf("R: distance: %.20lf\n", this->getDist(pkt));
}

double DV_DistanceAgent::getDist(Packet* pkt) const {
Antenna* ant = pkt->txinfo_.getAntenna();
WirelessPhy* phy = (WirelessPhy*)(pkt->txinfo_.getNode()->ifhead().lh_first);

double lambda = pkt->txinfo_.getLambda();
double Pr = pkt->txinfo_.RxPr;
double Pt = pkt->txinfo_.getTxPr();
double Gt = ant->getTxGain(ant->getX(), ant->getY(), ant->getZ(), lambda);
double Gr = ant->getRxGain(ant->getX(), ant->getY(), ant->getZ(), lambda);
double ht = ant->getZ();
double hr = ant->getZ();
double L = phy->getL();

return phy->getDist(Pr, Pt, Gt, Gr, ht, hr, L, lambda);
}
[/cpp]

2007/12/15

NS2 快速入門: DV-distance 模擬 (4)

先新增一個自訂的 Agent

之後在修改執行演算法的部份來跑自訂的 protocol

新增 Agent 的方法如下:

(附註: 這裡的 ns2 目錄是指 ns2 所在的目錄,每個人不一定一樣,
ex: ~/ns-allinone-2.33/ns-2.33)

ns2/dv-distance/dv-distance.h
[cpp]
#ifndef ns_dv_distance_h
#define ns_dv_distance_h

#include "agent.h"
#include "tclcl.h"
#include "packet.h"
#include "address.h"
#include "ip.h"

struct hdr_dv_distance {

// Header access method
static int offset_; // required by PacketHeaderManager
inline static int& offset() { return offset_; }
inline static hdr_dv_distance* access(const Packet* p) {
return (hdr_dv_distance*) p->access(offset_);
}
};

class DV_DistanceAgent : public Agent {
public:
DV_DistanceAgent();
virtual int command(int argc, const char*const* argv);
virtual void recv(Packet*, Handler*);
};

#endif // ns_dv_distance_h
[/cpp]

ns2/dv-distance/dv-distance.cc
[cpp]
#include "dv-distance.h"

int hdr_dv_distance::offset_;
static class DV_DistanceHeaderClass : public PacketHeaderClass {
public:
DV_DistanceHeaderClass() : PacketHeaderClass("PacketHeader/DV_Distance",
sizeof(hdr_dv_distance)) {
bind_offset(&hdr_dv_distance::offset_);
}
} class_dv_distancehdr;

static class DV_DistanceClass : public TclClass {
public:
DV_DistanceClass() : TclClass("Agent/DV_Distance") {}
TclObject* create(int, const char*const*) {
return (new DV_DistanceAgent());
}
} class_dv_distance;

DV_DistanceAgent::DV_DistanceAgent() : Agent(PT_DV_DISTANCE) {
//bind("packetSize_", &size_);
}

int DV_DistanceAgent::command(int argc, const char*const* argv) {
if(argc == 2) {
if(strcmp(argv[1], "start") == 0) {
// Create a new packet
Packet* pkt = allocpkt();

// Access the DV_Distance header for the new packet
hdr_dv_distance* hdr = hdr_dv_distance::access(pkt);

// Send the packet
send(pkt, 0);

// return TCL_OK, so the calling function knows that
// the command has been processed
return (TCL_OK);
}
}
return (Agent::command(argc, argv));
}

void DV_DistanceAgent::recv(Packet* pkt, Handler*) {
// Access the IP header for the received packet
hdr_ip* hdrip = hdr_ip::access(pkt);

// Access the DV_distance header for the received packet
hdr_dv_distance* hdr = hdr_dv_distance::access(pkt);

printf("Recv OK");
Packet::free(pkt);
}
[/cpp]

接著要把自訂的 Agent 加到 NS2 中

才能在 NS2 中使用

1. 修改 ns2/Makefile.in
在 OBJ_CC = 的地方加上 dv-distance/dv-distance.o
(注意:修改 Makefile 無效,Makefile 會在每次 configure 後依據 Makefile.in 產生)


2. 修改 ns2/common/packet.h 加上新的 packet type

ns 2.32 以前:
在 enum packet_t 加上 PT_DV_DISTANCE
(不能加在最後一個,PT_NTYPE 必須最後)

在 class p_info 的 public: p_info() { } 內
加上 name_[PT_DV_DISTANCE]="DV_Distance";

ns 2.33 以後:
在 static packet_t PT_NTYPE 前加上
static const packet_t PT_DV_DISTANCE = XX;
XX 為其他 packet type 沒用過的數字 (ex: 62)
(注意:一定要加在 PT_NTYPE 之前,且 PT_NTYPE 的 value 一定要最大,
否則發送 packet 時,會出現 Segmentation fault (core dumped) 無法正常運作)


在 class p_info 的 public: static void initName() { } 內
name_[PT_NTYPE]= "undefined"; 附近加上
name_[PT_DV_DISTANCE]="DV_Distance";
建議和加 PT_DV_DISTANCE 一樣
加在 name_[PT_NTYPE]= "undefined"; 之前


3. 修改 trace/cmu-trace.cc (非必要)

在 void CMUTrace::format(Packet* p, const char *why) {} 加上 case PT_DV_DISTANCE:

4. 修改 tcl/lib/ns-packet.tcl (非必要)
在 foreach prot { } 加上 DV_Distance
加這個是為了方便在模擬時
可以用下列方式寫在 tcl 內
只顯示想要觀察的 packet type

[code]remove-packet-header AODV ARP DV_Distance

# ...

set ns [new Simulator][/code]
[code]remove-all-packet-headers
add-packet-header AODV ARP DV_Distance

# ...

set ns [new Simulator][/code]

大功告成

開始編譯

1. 有改 Makefile.in 或 XXX.h 檔時
在 ns2 目錄下執行 ./configure; make clean; make depend; make

2. 只改 source code (XXX.cc 檔) 時
在 ns2 目錄下直接執行 make 就可以了

3. 只改 XXX.h 檔
如果不想等太久,可以 touch XXX.cc 後再 make
ex: touch dv-distance/dv-distance.cc; make
但不保證能正常運作

附註:若編譯時出現關於 proxytrace2any.cc 的錯誤,請參考這篇文章,以我的經驗如果是第一次編譯,2.32和2.33都會出現這個問題,可以先修改後再編譯,才不用花很久的時間重新編譯

2007/12/14

NS2 2.32 core dump when "make"

Problem:

Core dump message as follows:

NS2 2.32 make error with "proxytrace2any.cc"

Problem: NS2 2.32 make error with "proxytrace2any.cc"


proxytrace2any.cc: In function `int main(int, char**)':
proxytrace2any.cc:112: error: `IsLittleEndian' undeclared (first use this function)
proxytrace2any.cc:112: error: (Each undeclared identifier is reported only once for each function it appears in.)
proxytrace2any.cc:120: error: `ToOtherEndian' undeclared (first use this function)
make[1]: *** [proxytrace2any.o] Error 1
make[1]: Leaving directory `/home/sokoyo/ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/sokoyo/ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/epa'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/sokoyo/ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/sokoyo/ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/nlanr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/sokoyo/ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/sokoyo/ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/ucb'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/sokoyo/ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/ucb'



Solution: Modify file "ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/dec/my-endian.h"

-#ifndef _ENDIAN_H_
-#define _ENDIAN_H_
+#ifndef _MY_ENDIAN_H_
+#define _MY_ENDIAN_H_


...

2007/12/13

NS2 快速入門: DV-distance 模擬 (3)

節錄使用 Hierarchical Addressing 片段

參考
ns-2/tcl/test/test-suite-WLtutorial.tcl
ns-2/tcl/test/test-suite-wireless-lan-aodv.tcl
ns-2/tcl/test/test-suite-wireless-lan-tora.tcl

case 1
[code]
$ns node-config -wiredRouting OFF

$ns node-config -addressType hierarchical
AddrParams set domain_num_ 2
lappend cluster_num 1 2
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 2 2
AddrParams set nodes_num_ $eilastlevel

set n0 [$ns node 0.0.0]
$n0 random-motion 0
$n0 set X_ 301
$n0 set Y_ 399
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node 1.0.0]
$n1 random-motion 0
$n1 base-station [AddrParams addr2id [$n0 node-addr]]
$n1 set X_ 480
$n1 set Y_ 544
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
[/code]

case 2
[code]
puts "Hierarchical Routing..."
set naddr {0.0.0 \
0.0.1 \
0.0.2 \
0.0.3 \
0.0.4 \
0.0.5 \
0.0.6 \
0.0.7 \
0.0.8 \
0.0.9 \
0.0.10 \
0.0.11 \
0.0.12 \
0.0.13 \
0.0.14 \
0.0.15 \
0.0.16 \
0.0.17 \
0.0.18 \
0.0.19}

# Create 20 nodes
for {set i 0} {$i < $opt(nn)} {incr i} {
set node($i) [$ns node [lindex $naddr $i]]
$node($i) random-motion 0
$node($i) base-station [AddrParams addr2id [$node(0) node-addr]]
}
[/code]

2007/12/11

NS2 快速入門: DV-distance 模擬 (2)

第一個可正常使用 DSR, DSDV, AODV Routing 的 Wireless Simulation

參考 ns-2/tcl/test/test-suite-WLtutorial.tcl
參考網址 http://www.net.c.dendai.ac.jp/~yuuki/

如果要使用 DSDV

記得 Application 啟動的時間要比較晚

因為 DSDV 要建立好 routing table

花的時間比較久

routing-test.tcl
[code]
#===================================
# Simulation parameters setup
#===================================
set opt(chan) Channel/WirelessChannel ;# channel type
set opt(prop) Propagation/TwoRayGround ;# radio-propagation model
set opt(netif) Phy/WirelessPhy ;# network interface type
set opt(mac) Mac/802_11 ;# MAC type
set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant) Antenna/OmniAntenna ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 20 ;# number of mobilenodes
set opt(rp) DSDV ;# routing protocol
set opt(x) 700 ;# X dimension of topography
set opt(y) 550 ;# Y dimension of topography
set opt(stop) 150.0 ;# time of simulation end
set opt(cp) "cbr-test.tcl"
set opt(sc) "scen-test.tcl"

#===================================
# Initialization
#===================================

# Create a ns simulator
set ns [new Simulator]

# Setup topography object
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)
set god [create-god $opt(nn)]

# Open the NS trace file
$ns use-newtrace
set tracefile [open out.tr w]
$ns trace-all $tracefile

# Open the NAM trace file
set namfile [open out.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $opt(x) $opt(y)

#===================================
# Mobile node parameter setup
#===================================
if {$opt(rp) == "DSR"} {
set opt(ifq) CMUPriQueue
} else {
set opt(ifq) Queue/DropTail/PriQueue
}

$ns node-config -adhocRouting $opt(rp) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channel [new $opt(chan)] \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON

#===================================
# Nodes Definition
#===================================

# Create 20 nodes
for {set i 0} {$i < $opt(nn)} {incr i} {
set node($i) [$ns node]
$node($i) random-motion 0
}

puts "Loading scenario file..."
source $opt(sc)

for {set i 0} {$i < $opt(nn)} {incr i} {
$ns initial_node_pos $node($i) 20
}

#===================================
# Agents & Applications Definition
#===================================

puts "Loading connection pattern..."
source $opt(cp)

#===================================
# Termination
#===================================

# Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile

puts "running nam..."
exec nam out.nam &
exit 0
}
for {set i 0} {$i < $opt(nn)} {incr i} {
$ns at $opt(stop) "$node($i) reset"
}
$ns at $opt(stop) "$ns nam-end-wireless $opt(stop)"
$ns at $opt(stop) "finish"
$ns at $opt(stop) "puts \"done\" ; $ns halt"

puts "Starting Simulation..."
$ns run
[/code]

cbr-test.tcl
[code]
#===================================
# Agents Definition
#===================================

# Setup a TCP connection
set tcp [new Agent/TCP]
$ns attach-agent $node(15) $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $node(4) $sink
$ns connect $tcp $sink

#===================================
# Applications Definition
#===================================

set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 120.0 "$ftp start"
[/code]

scen-test.tcl
[code]
#===================================
# Nodes Definition
#===================================
set god [God instance]
#$god set-dist 15 16 1 ;# node 15 <--> node 16 : 2 hop
#$god set-dist 16 17 1 ;# node 15 <--> node 17 : 2 hop
#$god set-dist 17 18 1 ;# node 15 <--> node 16 : 2 hop


$node(0) set X_ 0
$node(0) set Y_ 600
$node(0) set Z_ 0.0

$node(1) set X_ 200
$node(1) set Y_ 600
$node(1) set Z_ 0.0

$node(2) set X_ 400
$node(2) set Y_ 600
$node(2) set Z_ 0.0

$node(3) set X_ 600
$node(3) set Y_ 600
$node(3) set Z_ 0.0

$node(4) set X_ 800
$node(4) set Y_ 600
$node(4) set Z_ 0.0

$node(5) set X_ 0
$node(5) set Y_ 400
$node(5) set Z_ 0.0

$node(6) set X_ 200
$node(6) set Y_ 400
$node(6) set Z_ 0.0

$node(7) set X_ 400
$node(7) set Y_ 400
$node(7) set Z_ 0.0

$node(8) set X_ 600
$node(8) set Y_ 400
$node(8) set Z_ 0.0

$node(9) set X_ 800
$node(9) set Y_ 400
$node(9) set Z_ 0.0

$node(10) set X_ 0
$node(10) set Y_ 200
$node(10) set Z_ 0.0

$node(11) set X_ 200
$node(11) set Y_ 200
$node(11) set Z_ 0.0

$node(12) set X_ 400
$node(12) set Y_ 200
$node(12) set Z_ 0.0

$node(13) set X_ 600
$node(13) set Y_ 200
$node(13) set Z_ 0.0

$node(14) set X_ 800
$node(14) set Y_ 200
$node(14) set Z_ 0.0

$node(15) set X_ 0
$node(15) set Y_ 0
$node(15) set Z_ 0.0

$node(16) set X_ 200
$node(16) set Y_ 0
$node(16) set Z_ 0.0

$node(17) set X_ 400
$node(17) set Y_ 0
$node(17) set Z_ 0.0

$node(18) set X_ 600
$node(18) set Y_ 0
$node(18) set Z_ 0.0

$node(19) set X_ 800
$node(19) set Y_ 0
$node(19) set Z_ 0.0
[/code]

2007/12/06

Proxy.pac example

最近常常連不到某些網站

不知道是哪裡擋掉

或是能 login 的連線有限

所以利用跳板就很重要啦 XD

紀錄一下 proxy.pac 的寫法如下:

[code]
function FindProxyForURL(url, host)
{
if (dnsDomainIs(host, "study-area.org"))
return "PROXY proxy.teatime.com.tw:8080";
else if(dnsDomainIs(host, "ieee.org"))
return "PROXY b.com:8080";
else
return "DIRECT";
}
[/code]

2007/12/05

Windows XP 安全性設定

Windows XP 在 "資料夾選項" 取消 "使用簡易檔案共用 (建議使用)" 後

會多出安全性的設定

然而 Windows XP 的安全性控制非常的爛

啟用後常常會出現不能存取某些檔案的怪問題

這裡紀錄最基本的安全性設定

如果安全性跑掉了

就重新照下面的方法設定吧

目前試過暫時還沒遇到問題

ps: 請使用進階設定

C:\ (系統碟) 設定:

[權限]
取消 "從父項繼承套用到子物件的權限項目,包括明確定義於此的項目"

權限項目:
Administrators
- 套用在 "這個資料夾,子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
CREATOR OWNER
- 套用在 "只有子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Everyone
- 套用在 "只有這個資料夾"
- "周遊資料夾/執行檔案", "列出資料夾/讀取資料", "讀取屬性", "讀取擴充屬性", "讀取使用權限"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
SYSTEM
- 套用在 "這個資料夾,子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Users
- 套用在 "這個資料夾,子資料夾及檔案"
- "周遊資料夾/執行檔案", "列出資料夾/讀取資料", "讀取屬性", "讀取擴充屬性", "讀取使用權限"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Users
- 套用在 "這個資料夾及子資料夾"
- "建立資料夾/附加資料"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Users
- 套用在 "只有子資料夾"
- '建立檔案/寫入資料"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
[擁有者]
Administrators

C:\WINDOWS (Windows 系統檔案目錄,注意若設定出錯,重開機後會無法進入 Windows) 設定:

[權限]
取消 "從父項繼承套用到子物件的權限項目,包括明確定義於此的項目"

權限項目:
Administrators
- 套用在 "這個資料夾,子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
CREATOR OWNER
- 套用在 "只有子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Power Users
- 套用在 "這個資料夾,子資料夾及檔案"
- 先選取"完全控制"後,取消"完全控制", "刪除子資料夾及檔案", "變更使用權限", "取得擁有權"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
SYSTEM
- 套用在 "這個資料夾,子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Users
- 套用在 "這個資料夾,子資料夾及檔案"
- "周遊資料夾/執行檔案", "列出資料夾/讀取資料", "讀取屬性", "讀取擴充屬性", "讀取使用權限"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
[擁有者]
Administrators

其他硬碟 (ex: D:\) 設定:

[權限]
取消 "從父項繼承套用到子物件的權限項目,包括明確定義於此的項目"

[權限]
取消 "從父項繼承套用到子物件的權限項目,包括明確定義於此的項目"

權限項目:
Administrators
- 套用在 "這個資料夾,子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
CREATOR OWNER
- 套用在 "只有子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Everyone
- 套用在 "這個資料夾,子資料夾及檔案"
- "周遊資料夾/執行檔案", "列出資料夾/讀取資料", "讀取屬性", "讀取擴充屬性", "讀取使用權限"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
SYSTEM
- 套用在 "這個資料夾,子資料夾及檔案"
- "完全控制"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Users
- 套用在 "這個資料夾,子資料夾及檔案"
- "周遊資料夾/執行檔案", "列出資料夾/讀取資料", "讀取屬性", "讀取擴充屬性", "讀取使用權限"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Users
- 套用在 "這個資料夾及子資料夾"
- "建立資料夾/附加資料"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
Users
- 套用在 "只有子資料夾"
- '建立檔案/寫入資料"
- 取消 "套用這些權限到此容器中的物件及(或)容器"
[擁有者]
Administrators

Present 的論文內容

明顯有類似 protocol 這類的 paper

不要選實驗、理論推導

看看有沒有類似第一步、第二步 ... 的結構

主要是要融會貫通講精髓

讓大家知道一個流程

如果是用數學 model 來推導

難懂又不好講

著重找到該文主要突破點, 並找出該突迫所以能達成的 smart ideas, key techniques。

結論:
1. What are the important considerations in the special topic of research (與以前從相關論文所得心得相互驗証, 校正, 並總結)?
2. What are the existing approaches for the special topic of research?
3. What are their relative merits (優點) and disadvantages?
4. If this paper has any relative merits, how are they achieved?
5. If the paper has any disadvantages, what are the causes for them?
6. How to avoid such shortages in your proposed approach?
7. If they are unavoidable, what are the reasons for?

2007/12/04

NS2 快速入門: DV-distance 模擬 (1)

寫 Tcl 檔產生節點、座標和設定環境

NS2 快速入門: DV-distance 模擬 (0)

0. 先了解 DV-distance

論文:D. Niculescu and B. Nath. Ad Hoc Positioning System (APS). In Proceedings of IEEE GlobeCom, San Antonio, AZ, November 2001.

定位 protocol,屬於 Application Layer

DV-hop
1. 先使用 distance vector 交換到網路所有 node,以取得到 landmark 的 hop 距離
2. 每個 node 維護一個 table 包含 (X, Y, h) 只從 neighbor 更新,(X, Y) 為 landmark 的位置, h 為 hop count
3. 只要 landmark 收到到其他 landmark 的距離,就估計平均一個 one hop 的距離,接著廣播發佈一個 correction 通知到整個網路
4. 接收到 correction 的節點,會在可以用三角測量時,估計到 landmark 的距離
5. 接收到 correction 的節點,以第一個收到的 correction 為準

每個 landmark 計算 The correction a landmark (Xi, Yi) ci, 一個 hop 的平均距離,以公尺為單位

每個 landmark 知道與其他 landmark 間的 hop count 與 euclidean distance

flooding 時,forward 一個 correction 後,會 drop 隨後的同一個 correction,
以確保每個 node 只會收到一個 correction,從最近的 landmark

可以用封包 TTL 限制一個 node 收到的 landmark 數

DV-distance

和 DV-hop 相同只是與鄰居 node 間的距離用訊號強度而不是 hop count,以公尺為單位
distance vector algorithm 使用訊號強度來累計旅行的距離


1. 要撰寫 NS2 模擬需要了解的步驟


TCL 相關
- 如何產生節點和座標
- 如何使用 protocol

C++ 相關
- 如何產生自訂的 protocol
- C++ 和 TCL 間的關係
- 如何在 NS2 內用個 table (structure)
- 如何從點 A 傳資料到點 B
- 如何從點 A flooding 資料出去
- 如何用 RSSI 估計兩點間的距離
- 如何改封包 TTL 的位置