今天试验黄化吉那本书上的第三个例程的时候发现了一些小问题。有两个已经解决,还有一个有待求证。
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
第一:在建立节点之间的连接的时候添加的数据流不对:
set udp0 [newAgent/UDP]
$ns attach-agent$ss(0) $udp0
set null0 [newAgent/Null]
$ns attach-agent$sinkNode $null0
$ns connect $udp0$null0
set ugs0 [newApplication/Traffic/CBR]
$ugs0 attach-agent$udp0
set udp1 [newAgent/UDP]
$ns attach-agent$sinkNode $udp1
set null1 [newAgent/Null]
$ns attach-agent$ss(1) $null1
$ns connect $udp1$null1
set ugs1 [newApplication/Traffic/CBR]
原文上面都是
set ugs0 [newApplication/Traffic/UGS]
...
set ugs1 [newApplication/Traffic/UGS]
...
如果不改的话就是会一直报错:
invalid command name “Application/Traffic/UGS”
...
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
第二:到这里这个例程还有一些问题,就是在执行nam动画的时候会出现很奇怪的现象:
这个问题在书上其实已经解决了,但是还是列出来看看:
书上说的是把nam文件里面的两行删掉就可以了。(如下图)
书上的解释是,会使节点0和节点1在nam显示时黏合在一起。具体是怎么回事还不是很清楚。
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
第三:最后还有一个最Bug的问题,未能解决但是有解决方案(求证中)
就是执行nam文件的时候会在大概中间的时候产生很多的类似下图的警告:
找到一个解决方案但是知道是不是对的,就只是试了一下,但是貌似没什么作用,可能是操作有误吧!
如果要试试的话记得保存源文件!!!
http://blog.sokoyo.inq.tw/2008/07/solution-warning-tracefile-events-are.html
Hi,
I'vefixed two trace problems that I've found in trace/cmutrace.cc
One is for time field precision, which modifies the validation, andthe
second for wireless packet coloring.
--------
a) someparts of the trace functions have different precision, which causes
nam to protest:
"Warning:Tracefile events are not sorted by time.
v -t 7.10770017082439 -e sim_annotation 7.10770017082439 347.1077002:
HANDOVER LATENCY: seqno 42 AP_OLD: 0 max_CQ: 0 latency==
0.10770017082438699
The above event should occur at or after -t 7.107700.
(...)"
Thishappens not all parts of the code use the "TIME_FORMAT"macro:
puts-nam-traceall {r -t %.9f -s %d ...
puts-nam-traceall {r -t "TIME_FORMAT" -s %d ...
Thebelow patch fixes this problem in cmutrace.cc.
Apparently, only imep/imep.cc continues use "-t %.9f" (see below).
pmsrve at leme:_:[cims]$ grep -C4 "t %.9f"*/*.cc
imep/imep.cc- if (NULL == p)return; // no more pkts on queue
imep/imep.cc: if (verbose) trace("T%.9f _%d_ rexmit trigger again for %d
at %.9f (in %.9f)",
imep/imep.cc- CURRENT_TIME, ipaddr, ch->uid(), rexat, rexat -
CURRENT_TIME );
imep/imep.cc- rexmitTimer.start(rexat -CURRENT_TIME);
HOWEVER,please note that this patch fixes the traces, causing failed
validation.
b)packet marking in wireless scenarios:
some parts of the same code have color 2 hardwired for wireless packets.
("-c 2 -a 0");
thesecond patch depends on the first, and modifies this to correct"-c
flowid() -a flowid()"
http://tagus.inesc-id.pt/~pestrela/ns2/files/namtrace_precision_time.patch
http://tagus.inesc-id.pt/~pestrela/ns2/files/namtrace_wireless_colors.patch
Pedro Estrela
http://tagus.inesc-id.pt/~pestrela/ns2
>-----Original Message-----
> From: ns-users-bounces at ISI.EDU [mailto:ns-users-bounces at ISI.EDU] On Behalf
> Of Jamal Toutouh
> Sent: quarta-feira, 7 de Novembro de 2007 15:51
> To: NS-users list
> Subject: [ns] How to colour nam simulations??
>
>
> Dear all,
>
> How are you?
>
> I want to show some simulations using NAM, but the problem isthat I want
> to show
> the different packets that are created by diferent nodes withdifferent
> colours.
>
> I am simulating mobil nodes that uses wifi connections.
>
> Thank you...
>
> ------------------------------------------------
> Jamal Toutouh El Alamin
> NEO Group - Networking and Emerging Optimization
> University of Malaga
> ------------------------------------------------
> Phone: (+34) 952 13 33 03
> ------------------------------------------------
> Addres:
> E.T.S Ingenieria Informatica
> Complejo Tecnologico, Lab. 3.3.4b
> Campus de Teatinos
> 29071 Malaga, Spain
> -------------------------------------------------
>
>
>
>
>
> ______________________________________________
> Pregunta, Responde, Descubre.
> Comparte tus consejos y opiniones con los usuarios de Yahoo!Respuestas
> http://es.answers.yahoo.com/info/welcome