免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1291 | 回复: 0
打印 上一主题 下一主题

Simulation of 3-node DSR network in GlomoSim [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-03 13:37 |只看该作者 |倒序浏览

                                                                                                 illidan.modeler@gmail.com1.1 scenarioThere are 3 nodes that run DSR, with position (50, 10), (450, 10), (850, 10). The radio range is about 627 meters. The terrain size is set to 900x900m.dsr_3nodes.nodes.conf
0 (50, 10)1 (450, 10)2 (850, 10)
dsr_3nodes.sim.conf
TERRAIN-DIMENSIONS (900, 900)
Node positioning illustrated in the visualization tool after a successful run:

file:///C:/DOCUME%7E1/msc/LOCALS%7E1/Temp/moz-screenshot-4.jpg
1.2 trafficNode0 is sending CBR traffic to Node2, which is out of 1 hop range to Node0. Thus a DSR route discovery and forwarding is mandatory.
dsr_3nodes.app.conf
CBR 0 2 0 64 0.2S 0S 0S
1.3 protocolsThe 3 nodes run DSR as routing protocol, and 802.11 as MAC protocol.
dsr_3nodes.sim.conf
ROUTING-PROTOCOL DSRMAC-PROTOCOL 802.11
1.4 Run and Analysis
Run the simulation:
glomosim dsr_3nodes.sim.conf > sim.log
Analysis the output stat file with awk script:
awk -f dsr_3nodes.awk dsr_3nodes.stat
Results:
+CBR stats:CBR.Total traffic sent (bytes) : 160000CBR.Total traffic sent (bytes/sec) : 320.13CBR.Total traffic received (bytes) : 160000CBR.Total traffic received (bytes/sec) : 320.13CBR.Total traffic dropped (bytes) : 0
+DSR statsDSR.Total control traffic sent (packets) : 5DSR.Total requests sent (packets) : 3DSR.Total replies sent (packets) : 2DSR.Total route errors sent (packets) : 0DSR.Total data packets originated (packets) : 2500DSR.Total data packets received (packets) : 2500DSR.Total packets dropped (packets) : 01.5 ConclusionIt's possible to simulate MANET in GloMoSim. The workflow for discrete event simulation of a simple MANET that runs DSR is presented. The same workflow is able to be applied to MANETs that are more complicated.  Appendix
The awk script:
BEGIN {    global_dsr_req_sent = 0;    global_dsr_rep_sent = 0;    global_dsr_error_sent = 0;    global_dsr_ctrl_sent = 0;    global_dsr_dropped = 0;    global_dsr_data_originated = 0;    global_dsr_data_recv = 0;    global_cbr_pkts_sent = 0;    global_cbr_pkts_recv = 0;    global_cbr_bytes_sent = 0;    global_cbr_bytes_recv = 0;    cbr_sent_start_time = 0.0;    cbr_sent_end_time = 0.0;    cbr_recv_start_time = 0.0;    cbr_recv_end_time = 0.0;    }/*Begin*/{    if ($4=="RoutingDsr,") {    if ($7 == "Requests") {     global_dsr_req_sent += $10;    }    else if ($7 == "Replies") {     global_dsr_rep_sent += $10;     }    else if ($7 == "CTRL") {     global_dsr_ctrl_sent += $11;    }    else if ($7 == "Errors") {     global_dsr_error_sent += $10;    }    else if ($7 == "Dropped") {     global_dsr_dropped += $10;    }    if ($8 == "Originated") {     global_dsr_data_originated += $10;     }    else if ($8 == "Received") {     global_dsr_data_recv += $10;    }    } /* if */}$4~/AppCbr/ {    if ($9=="bytes") {     if ($10=="sent:")    global_cbr_bytes_sent += $11;     if ($10=="received:") global_cbr_bytes_recv += $11;    }    else if ($6=="First") {     if($8=="sent" && (cbr_sent_start_time>$11)) {        /*Get the network-wide start time for sending CBR */        cbr_sent_start_time = $11;     }     else if ($8=="received" && (cbr_recv_start_time>$11)) {        /*Get the network-wide start time for receiving CBR */        cbr_recv_start_time = $11;     }    }     else if ($6=="Last") {     if ($8=="sent" && (cbr_sent_end_time$11)) cbr_sent_end_time = $11;     if ($8=="recv" && (cbr_recv_end_time$11)) cbr_recv_end_time = $11;    }    }/*END*/END {    print("+CBR stats:");    printf("CBR.Total traffic sent (bytes) : %d\n", global_cbr_bytes_sent );    printf("CBR.Total traffic sent (bytes/sec) : %.2f\n", global_cbr_bytes_sent/(cbr_sent_end_time-cbr_sent_start_time));    printf("CBR.Total traffic received (bytes) : %d\n", global_cbr_bytes_recv );    printf("CBR.Total traffic received (bytes/sec) : %.2f\n", global_cbr_bytes_recv/(cbr_sent_end_time-cbr_sent_start_time));    printf("CBR.Total traffic dropped (bytes) : %d\n", global_cbr_bytes_sent-global_cbr_bytes_recv);    print("");    print("+DSR stats");    printf("DSR.Total control traffic sent (packets) : %d\n", global_dsr_ctrl_sent );    printf("DSR.Total requests sent (packets) : %d\n", global_dsr_req_sent );    printf("DSR.Total replies sent (packets) : %d\n", global_dsr_rep_sent);    printf("DSR.Total route errors sent (packets) : %d\n", global_dsr_error_sent);    printf("DSR.Total data packets originated (packets) : %d\n", global_dsr_data_originated);    printf("DSR.Total data packets received (packets) : %d\n", global_dsr_data_recv);    printf("DSR.Total packets dropped (packets) : %d\n", global_dsr_dropped);    }
 
               
               
               
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/22344/showart_333042.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP