基于NS2下的DSR路由协议的研究与优化(具体仿真代码步骤)

更新时间:2023-11-13 12:43:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

基于NS2下的DSR路由协议的研究与优化

基于NS2下的DSR路由协议的研究与

优化

李志斌 陶然

摘 要:Ad Hoc网络是当前无线通信领域一种新的、发展迅速的通信技术,由

于它不依赖固定的基础通信设施,没有中心控制节点,抗毁性强,因此适用于许多网络布线存在困难的环境。基于这些特殊优势,Ad hoc网络在军事领域中发挥着重要作用,在民用领域也有着很好的应用前景。DSR 协议是专为Ad hoc网络设计的一种按需路由控制协议,它以简单有效、网络开销小、算法复杂度不高、支持单向链路等优点而受到广泛的关注,被认为是最有实用前景的Ad hoc网络路由协议之一。

NS2( Network Simulator Version 2),是UC Berkeley开发的一个离散事件驱动的事件模拟器。它能模拟Ad Hoc网络路由协议运行的全过程,并把仿真结果输出到一个trace文件中。通过对trace文件的分析,可以了解到Ad Hoc网络路由协议运行的状况,从而分析评价路由协议的性能好坏。

本文首先介绍Ad Hoc网络的基本概念、关键技术和路由协议。其次,对DSR协议的概念、特点及工作原理给予详细的介绍和分析。然后在NS2网络仿真模拟平台下建立无线网络模型,以AODV作对比,对DSR和AODV协议仿真模拟,分析评价DSR路由协议性能。仿真结果表明,同AODV对比,DSR在快速变化的网络拓扑结构中更具优势。最后文章对DSR协议的优化改进作总结。

关键词:Ad hoc,DSR 协议,优化,网络仿真,NS2

基于NS2下的DSR路由协议的研究与优化

The research and optimization of DSR route protocol based on NS2

LI Zhi-bin ,TAO Ran

Abstract: Ad Hoc network is a new technique in wireless communication field

which develops rapidly in recent years. As it does not depend on fixed network infrastructure, and has no central controlling node as well as good in resisting destructions, it is applicable to many situations that have difficulties in wiring networks. Based on these special advantages, Ad hoc plays an important part in military applications, and it also has a good prospect in civil applications. DSR protocol is an on-demand routing protocol that is specifically designed for Ad hoc. It attracts widely attention because of its advantages such as its simplicity, low network overhead, low algorithm complexity, supporting unidirectional routes and so on. So DSR protocol will probably play an important role in future Ad hoc application.

NS2 (Network Simulator Version 2), developed by UC Berkeley, is a simulator driven by discrete events. It can simulate a routing protocol operation process of Ad Hoc network, and export simulation results to a trace file. From the trace file, we can know the operation process of routing protocol, then analyze and evaluate the performance of routing protocol.

This paper, first of all, introduces the basic concept, key technologies and routing protocols of Ad Hoc Network. Secondly, for the concept, feature and

基于NS2下的DSR路由协议的研究与优化

working principle of DSR,the paper gives a detailed introduction and analysis. Then, to evaluate the performance of DSR and AODV, we established a simulation platform of wireless network model based on the NS2。The simulator results show that compared with AODV, DSR performs better in the network with dynamic topology. At last, the paper analyzes the improvement and makes a summary of DSR.

Key words:Ad Hoc, DSR protocol,Optimization,Network simulation,NS2

基于NS2下的DSR路由协议的研究与优化

目录

第一章 绪论 ·························································································1 1.1 Ad hoc网络 ·················································································1 1.1.1 Ad hoc网络的产生与发展 ·····························································1 1.1.2 Ad hoc网络的特点 ······································································2 1.1.3 Ad hoc网络的应用领域 ································································3 1.2 Ad Hoc研究的问题和技术挑战 ························································4 1.2.1进行相关研究的主要大学和组织 ····················································4 1.2.2研究问题和技术挑战 ···································································5 1.3 Ad hoc网络路由协议 ·····································································7 1.3.1表驱动路由协议 ·········································································8 1.3.2按需驱动路由协议 ···································································· 10 1.4论文研究的内容和任务 ··································································· 12 1.4.1研究内容 ················································································ 12 1.4.1主要任务 ················································································ 12 1.5本章小结 ····················································································· 13 第二章 DSR协议 ················································································ 16 2.1 DSR协议概述··············································································· 16 2.2 DSR协议分组格式 ········································································ 16 2.3 DSR协议的运行机制 ····································································· 17 2.3.1 DSR协议的路由发现机制 ·························································· 17

基于NS2下的DSR路由协议的研究与优化

2.3.1 DSR协议的路由维护机制 ·························································· 20 2.4 DSR协议的优缺点分析 ·································································· 21 2.5 DSR协议的优化途径 ····································································· 23 2.5.1缓存 cache 管理优化 ································································ 23 2.5.2路由建立过程中捎带数据分组的优化 ············································ 23 2.5.3路由请求分组的跳数限制 ··························································· 24 2.5.4路径自动缩短 ·········································································· 24 2.5.5随机延迟 ················································································ 25 2.5.6无确认路由修复 ······································································· 25 2.5.7混合侦听 ················································································ 25 2.5.8抢修 ······················································································ 25 2.6本章小结 ····················································································· 26 第三章 DSR 协议的仿真及性能分析 ······················································· 28 3.1网络仿真工具NS2 ········································································· 28 3.1.1 NS2简介 ················································································ 28 3.1.2 NS2的安装步骤 ······································································· 28 3.2 Ad hoc网络路由协议在NS2中的实现················································ 31 3.3 NS2网络基本模拟流程 ··································································· 33 3.4

NS2下DSR代码分析 ································································ 35

3.5 DSR和AODV协议仿真比较 ··························································· 38 3.5.1仿真过程 ················································································ 38 3.5.2分析比较 ················································································ 47

本文来源:https://www.bwwdw.com/article/hjev.html

Top