- 论坛徽章:
- 0
|
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
对于目前的一个多接口多信道的NS2代码实现的简单分析
Aodv_MCMI的调试还是比较简单的,一般人都能够调的出来,因为提供的资料还是比较全面的。当然我是个好人,这里我会想办法提供下载的。那位高尚的外国人甚至连脚本和awk文件都已经给出,这让我联想到一个无私的外国友人毫不利己专门利人的精神…….
我在调试的时候碰到了2个问题:
1 根据其论文的要求,当某个节点fixed_channel被使用次数过多时,需要在forward的过程中对其进行切换。而这个切换是有一定要求的,需要按照一定的概念进行切换,文中给出的概率是0.4。所以在后面的结果分析中我的数据有一个数据有些偏差我就归咎于这个概率了。
2 在MCMI的代码中,并没有提到当两个相邻的节点随机分配的fixed_channel是相同的时候应该怎么处理。可能作者的RP比较好,相邻节点正好分配的fixed_channel不相同,但是我却撞到了相邻节点该信道相同的情况。没有办法,自己在AODV::recvRequest的前面加了一段话,这样就基本能保证其相邻节点的fixed_channel的多样性了。
file:///C:/DOCUME%7E1/YJC/LOCALS%7E1/Temp/msohtml1/01/clip_image002.jpg
延时的图(见相册mcmi_delay)
file:///C:/DOCUME%7E1/YJC/LOCALS%7E1/Temp/msohtml1/01/clip_image004.jpg
吞吐量的图(见相册mcmi_throughput)
上面是我做的关于吞吐量和延时的示意图,图比较粗糙,大家将就着看,懒的修改了,就这样吧,可以看出和文档中给出的图基本是吻合的。
在MCMI中还有个比较大的不完美就是路由metric仍然是用的跳数,这个metric对于多接口多信道已经有些过时,希望对其有兴趣有研究的读者做点工作。纯属个人工作纰漏在所难免,请各位读者指出讨论。
代码参考(自己比较与原代码的不同):
void
AODV::recvRequest(Packet *p) {
struct hdr_ip *ih = HDR_IP(p);
//5.15
struct hdr_cmn *ch = HDR_CMN(p);
struct hdr_aodv_request *rq = HDR_AODV_REQUEST(p);
//5.15
u_int8_t Iface;
aodv_rt_entry *rt;
/*
* Drop if:
* - I'm the source
* - I recently heard this request.
*/
if(rq->rq_src == index) {
#ifdef DEBUG
fprintf(stderr, "%s: got my own
REQUEST\n", __FUNCTION__);
#endif // DEBUG
Packet::free(p);
return;
}
if
(id_lookup(rq->rq_src, rq->rq_bcast_id)) {
#ifdef DEBUG
fprintf(stderr, "%s: discarding request\n", __FUNCTION__);
#endif // DEBUG
Packet::free(p);
return;
}
/*
* Cache the
broadcast ID
*/
id_insert(rq->rq_src, rq->rq_bcast_id);
//mcmi
if(nIfaces)
{
//by yjc--1109
To make the neighbour own different fixed channel.
if(nIfaces)
{
while(rq->rq_fixed_channel_used==neighbour_table[(int)index])
{
channel_usage_list[neighbour_table[(int)index]]--;
neighbour_table[(int)index]=rand()
% (nIfaces);
channel_usage_list[neighbour_table[(int)index]]++;
#ifdef MCMI_DEBUG
printf("n%d\trecvRequest-rq->rq_fixed_channel_used:%d\n",rq->rq_sender_node_ip,rq->rq_fixed_channel_used);
printf("n%d\trecvRequest-neighbour_table[%d]:%d\n",(int)index,(int)index,neighbour_table[(int)index]);
#endif
}
}
//by yjc--1109
neighbour_table[(int)(rq->rq_sender_node_ip)]=rq->rq_fixed_channel_used;
for(int
i=0;i
if(i==(int)index)
{
continue;
}
if(rq->rq_neighbour_table!=-1)
{
channel_usage_list[rq->rq_neighbour_table]++;
}
}
#ifdef MCMI_DEBUG
printf("n%d\trecvRequest-rq->rq_sender_node_ip:%d\n",(int)index,rq->rq_sender_node_ip);
printf("n%d\trecvRequest-rq->rq_fixed_channel_used:%d\n",(int)index,rq->rq_fixed_channel_used);
rt_print_NT_CUL();
#endif
}//if(nIfaces)
//mcmi
.....
![]()
文件:mcmi_report.pdf
大小:670KB
下载:
下载
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/97671/showart_2110680.html |
|