ns-3 中文教程
GNS3中文教程——ITAA[第一版]
![GNS3中文教程——ITAA[第一版]](https://img.taocdn.com/s3/m/74e8d0ef856a561252d36fd0.png)
GNS3中文教程——ITAA一、基础篇GNS3是一款图形网络模拟器,它可以模拟非常复杂的网络。
它是基于Dynagen和Dynamips的图形化软件,可以轻易的设计出来自己所需要的拓扑图,而且因为加载的是真实的IOS,所以就像真机一样能运行绝大部分指令。
(最近版0.7已经可以模拟JUNOS!)Step1.安装GNS3下载之后你将会得的一个GNS3-0.6.1-win32-all-in-one.exe的安装程序。
双击运行它,然后一路next直到出现右图,这是GNS3的相关组件,建议按照默认设置全选,继续一路next,期间会弹出安装Winpcap的提示框,确认之后继续。
Window Vista或者Windows 7的用户建议不要按照默认安装在C盘下,否则有可能运行不起来,建议装在D盘下。
一路next到结束,finish。
Step2.GNS3基本设置安装完运行GNS3,第一次运行会出现向导,点第一个,之后会出现右图的设置界面。
在language里面选择“简体中文”,然后点选APPL Y就会让GNS3变成中文。
将默认的工程目录和IOS/PIXOS目录改变(temp文档容易被清理且不易找),我们可以在GNS3的安装目录(默认是C:\Program Files\GNS3)下新建两个文件夹,一个叫temp 一个叫IOS,分别放工程文件和IOS文件切换到GUI SETTINGS,勾选“当添加链接默认使用手动模式”点选左边的“dynamips”,进行设置,工作目录可以改成GNS3下的C:\Program Files\GNS3\dytemp(需自己手动新建),然后勾选下面的三个“允许”,如果你安装GNS3是默认安装可以点击“测试”来测试一下Dynamips 是否正常。
基础设置就到此结束,点OK返回。
Step3.IOS设置下面我们把压缩包中(或者网上下载)的IOS拷贝进IOS文件夹C:\Program Files\GNS3\IOS,然后在GNS3中点“编辑”-“IOS和hypervisors”这里我们以c7200-adventerprisek9_sna-mz.150-1.M.bin这个IOS为例,在IOS文件中找到c7200-adventerprisek9_sna-mz.150-1.M.bin,然后点保存。
NS3对于初学者的教学教程,高手忽略这个吧
![NS3对于初学者的教学教程,高手忽略这个吧](https://img.taocdn.com/s3/m/074949d0fe4733687e21aaf3.png)
1.Ns3 的安装:开发环境配置:sudo apt-get install gcc g++ python python-dev //C++和python安装,必装sudo apt-get install mercurial //NS3代码维护使用的源码版本控制管理系统sudo apt-get install bzr //运行python绑定ns-3-dev需要bazaar这个组件sudo apt-get install libgtk2.0-0 libgtk2.0-dev //基于GTK的配置系统sudo apt-get install gdb valgrind //调试工具sudo apt-get install doxygen graphviz imagemagick //文档生成器sudo apt-get install texlive texlive-latex-extra //文档生成器,从源代码中生成说明文档sudo apt-get install texinfo dia texlive-extra-utils texi2html //ns-3手册和tutorial编写查看工具sudo apt-get install flex bison //仿真必需的词法分析器和语法分析生成器,必装sudo apt-get install libgoocanvas-dev //部分移动场景仿真的可视化测试需要这个组件sudo apt-get install tcpdump //读取pcap的packet traces,即包嗅探器sudo apt-get install sqlite sqlite3 libsqlite3-dev //支持统计特性的数据库软件sudo apt-get install libxml2 //xml的配置存储软件sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas //Gustavo's ns-3-pyviz的可视化软件sudo apt-get install qt4-qmakesudo apt-get install qt4-dev-tools安装完成后:进入ns-allinone-3.16目录sudo ./build.py之后进入ns-allinone-3.16/ns-3.16sudo ./waf -check返回目录ns-allinone-3.16进入目录netanim-3.103sudo make cleansudo qmake NetAnim.prosudo make之后sudo ls可以看见绿色的NetAnim这个东西就成功了sudo ./NetAnim 打开仿真界面安装全部完成2.ns3仿真的运行ctrl+alt+t调出终端,进入ns-allinone-3.16目录,输入cd ns-3.16/ 进入ns-3.16文件夹输入cd examples/tutorial/ 进入examples里面的tutorial文件夹(里面有刚刚上手专用的实例,我们就用这个来调试)在tutorial目录下,输入cp ~/ns-allinone/ns-3.16/scratch/ ,将这个文件复制到ns-3.16的scratch文件夹里面. 具体位置由实际的自己的计算机的文件目录所定。
NS3安装与脚本说明文档
![NS3安装与脚本说明文档](https://img.taocdn.com/s3/m/1dafc5996429647d27284b73f242336c1eb930e6.png)
NS3安装与脚本说明⽂档NS-3说明⽂档第⼀章主要内容:⼀、配置⼆、下载ns-3三、建⽴ns-3项⽬四、测试ns-3五、运⾏⼀个脚本⼀、配置本次的使⽤环境是linux/Ubuntu。
在安装ns-3之前,需要输⼊以下命令,进⾏事先的配置。
1、如果对C++组件的需求⽐较少,输⼊以下命令:sudo apt-get install gcc g++ python如果对python组件的需求⽐较少,输⼊以下命令:sudo apt-get install gcc g++ python python-dev以上命令⼆者选⼀。
之后的命令依次输⼊。
2、sudo apt-get install mercurial3、sudo apt-get install bzr4、sudo apt-get install gdb valgrind5、sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl6、sudo apt-get install flex bison libfl-dev7、sudo apt-get install g++-3.4 gcc-3.48、sudo apt-get install tcpdump9、sudo apt-get install sqlite sqlite3 libsqlite3-dev10、sudo apt-get install libxml2 libxml2-dev11、sudo apt-get install libgtk2.0-0 libgtk2.0-dev12、sudo apt-get install vtun lxc13、sudo apt-get install uncrustify14、sudo apt-get install doxygen graphviz imagemagick15、sudo apt-get install texlive texlive-extra-utils texlive-latex-extra16、sudo apt-get install python-sphinx dia17、sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev18、sudo apt-get install libboost-signals-dev libboost-filesystem-dev19、sudo apt-get install openmpi*⼆、下载ns-3最简单的下载⽅法是,在linux下输⼊以下命令:cdmkdir tarballscd tarballswget /doc/31786f7cf011f18583d049649b6648d7c0c7085d.html /releases/ns-allinone-3.13.tar.bz2tar xjf ns-allinone-3.13.tar.bz2如果进⼊虚拟机中ns-allinone-3.13⽂件夹中,可以看到以下⽂件:build.py ns-3.13/ pybindgen-0.15.0.795/ util.pyconstants.py nsc-0.5.2/ README那么ns-3已经下载成功,并解压完毕。
GNS3(0.5)+tutorial(中文版)(最详细最有用)
![GNS3(0.5)+tutorial(中文版)(最详细最有用)](https://img.taocdn.com/s3/m/386a998d67ec102de2bd89ea.png)
GNS3教程Version 0.5by Longbow2008-12-8目录译序 (3)GNS3 图形化网络模拟器 (4)Windows用户的GNS3 Quick Start Guide (6)Step 1:下载GNS3 (6)Step 2:安装GNS3 (7)Step 3:配置IOS (8)创建简单的网络拓扑 (9)GNS3的主界面 (13)创建复杂的网络拓扑 (14)在网路拓扑中添加PC (17)使用PuTTY或TeraTerm等终端程序 (23)使用软件WinTabber来组织多个Telnent窗口 (24)内存和CPU利用率问题 (25)IOS映像文件的解压缩 (27)Frame Relay、ATM、Ethernet交换设备 (27)分组捕获 (28)保存和load网络拓扑 (29)Client/Server和Multi-Server模式 (30)Console工作区和Dynagen命令 (30)PIX防火墙仿真 (30)GNS3的图标管理 (30)相关资源 (31)译序Dynamips作为一款十分优秀的Cisco路由器模拟软件,实验模拟效果远比Boson NetSim更加真实可信。
Boson NetSim是对IOS命令行的模拟,而Dynamips 是通过在计算机中构建运行IOS的虚拟机来真正运行IOS实现对Cisco路由器的模拟。
Gynagen是一种基本文本的Dynamips前端系统,初学者使用Dynamips时总是感觉存在一定程度的不便和困难。
当前,如果对Dynamips非常熟悉,无须任何前端系统就可以很好地进行相关网络模拟。
就像一个用户可以在命令行中实现在图形界面中完成的所有任务一样。
GNS3的推出在一定程度上解决了Dynamips不如Boson NetSim易用的问题,受到了Dynamips初学者的欢迎。
Dynamips的图形化前端系统除了GNS3外,还有GynamipsGUI。
用源代码进行ns-3编译、安装与测试的基本过程。
![用源代码进行ns-3编译、安装与测试的基本过程。](https://img.taocdn.com/s3/m/4fbc2de1db38376baf1ffc4ffe4733687f21fc5b.png)
用源代码进行ns-3编译、安装与测试的基本
过程。
ns-3编译、安装与测试的基本过程主要分为五步:
1.下载ns-3源码。
ns-3源码可以从ns-3的GitHub页面获取,也可以从官方网站下载压缩文件安装。
2.通过CMake编译和安装ns-3源码,可以使用命令行,或者通过CMake GUI界面来进行安装,CMake推荐使用GNU GCC作为编译器,安装完成后,将生成ns-3-dev文件夹。
3.运行程序前,需要测试例子是否可以运行,可以使用提供的命令行工具./waf运行例子,如果测试例子通过,说明编译正确,可以正常运行ns-3模拟器。
4.可以在ns-3-dev/examples目录下使用./waf --run test运行收获用例进行测试,确认其是否可以正确工作,得出期望的结果。
5.如果测试结果都有效,则说明ns-3编译、安装与测试过程成功。
暗黑3 switch 操作方法
![暗黑3 switch 操作方法](https://img.taocdn.com/s3/m/8dad742f59fafab069dc5022aaea998fcc2240a5.png)
暗黑3 switch 操作方法
以下是《暗黑破壞神3》在任天堂Switch上的操作方法:
1. 单手持握Joy-Con控制器
可以使用单手持握Joy-Con控制器进行操作。
左右手各持一只Joy-Con,并使用其中一只Joy-Con的控制摇杆来移动角色,使用其他按键进行攻击、释放技能、使用物品等操作。
2. 手柄模式
如果使用Switch主机和Joy-Con控制器的手柄配件,可以将Joy-Con插入手柄配件中,然后使用手柄进行游戏。
移动角色、攻击、释放技能和使用物品的操作与单手持握Joy-Con控制器时相同。
3. 投影模式
连接Switch主机和电视后,可以将Switch主机放入底座,并使用Joy-Con 或Pro控制器进行游戏。
操作方式与手柄模式相同。
值得注意的是,Switch版《暗黑破壞神3》还支持多人合作游戏。
你可以通过连接多个Joy-Con或Pro控制器在同一台Switch主机上进行多人游戏,或者通过在线多人游戏与其他玩家合作或对抗。
NS3对于初学者的教程,高手忽略这个吧
![NS3对于初学者的教程,高手忽略这个吧](https://img.taocdn.com/s3/m/63a8506869eae009581becd1.png)
1.Ns3 的安装:开发环境配置:sudo apt-get install gcc g++ python python-dev //C++和python安装,必装sudo apt-get install mercurial //NS3代码维护使用的源码版本控制管理系统sudo apt-get install bzr //运行python绑定ns-3-dev需要bazaar这个组件sudo apt-get install libgtk2.0-0 libgtk2.0-dev //基于GTK的配置系统sudo apt-get install gdb valgrind //调试工具sudo apt-get install doxygen graphviz imagemagick //文档生成器sudo apt-get install texlive texlive-latex-extra //文档生成器,从源代码中生成说明文档sudo apt-get install texinfo dia texlive-extra-utils texi2html //ns-3手册和tutorial编写查看工具sudo apt-get install flex bison //仿真必需的词法分析器和语法分析生成器,必装sudo apt-get install libgoocanvas-dev //部分移动场景仿真的可视化测试需要这个组件sudo apt-get install tcpdump //读取pcap的packet traces,即包嗅探器sudo apt-get install sqlite sqlite3 libsqlite3-dev //支持统计特性的数据库软件sudo apt-get install libxml2 //xml的配置存储软件sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas //Gustavo's ns-3-pyviz的可视化软件sudo apt-get install qt4-qmakesudo apt-get install qt4-dev-tools安装完成后:进入ns-allinone-3.16目录sudo ./build.py之后进入ns-allinone-3.16/ns-3.16sudo ./waf -check返回目录ns-allinone-3.16进入目录netanim-3.103sudo make cleansudo qmake NetAnim.prosudo make之后sudo ls可以看见绿色的NetAnim这个东西就成功了sudo ./NetAnim 打开仿真界面安装全部完成2.ns3仿真的运行ctrl+alt+t调出终端,进入ns-allinone-3.16目录,输入cd ns-3.16/ 进入ns-3.16文件夹输入 cd examples/tutorial/进入examples里面的tutorial文件夹(里面有刚刚上手专用的实例,我们就用这个来调试)在tutorial目录下,输入cp ~/ns-allinone/ns-3.16/scratch/ ,将这个文件复制到ns-3.16的scratch文件夹里面. 具体位置由实际的自己的计算机的文件目录所定。
Uctronics Raspberry Pi 3 Starter Kit 快速入门指南说明书
![Uctronics Raspberry Pi 3 Starter Kit 快速入门指南说明书](https://img.taocdn.com/s3/m/7d927c8dafaad1f34693daef5ef7ba0d4a736df5.png)
Raspberry Pi Game Quick-Start GuideRev 1.0, Mar 2017Table of Contents1.Raspberry Pi Start Kits (2)A.Generation Introduction: (2)B.Package including: (2)2.Assembly: (3)A.32GB Micro SD card Class 10 Pre-Loaded with the dual system (3)B MicroSD Card Reader (4)C.Power Supply Adapter Charger 5V 2.5A (US) (5)D. USB cable with ON/OFF switch (6)E.ABS Protective Case Enclosure (7)F.Premium High Speed HDMI Cable (8)G. Heatsink kit with Thermal Pad (9)H. Raspberry Pi Compatible "SNES" Style USB Gamepad (10)3.Installation diagram: (11)A.Getting started (12)B.Dual system (13)1.Raspberry Pi Start KitsA.Generation Introduction:The Raspberry Pi 3 Starter Kit is a great way to gain a solid introduction to the small, credit-card sized computer. The starter kit make the Raspberry Pi intuitive and easy to learn.With this kit, you will be able to get your Raspberry Pi 3 as your own credit card sized computer, getting started with programming and coding, setting-up the Raspberry Pi as a game player. So, if you are looking for a new challenge or a way to get in on the RPi craze, check out the Raspberry Pi 3 Starter Kit!UCTRONICS team has carefully done the compatibility test for all components, and offer the plug and play dual boot operation system like Raspbian and Recalbox. Users only need additional HDMI monitor and keyboard/mice to use this kit as a standard PC desktop or a game player.B.Package including:1pcs 32GB Micro SD card Class 10 Pre-Loaded with the dual system1pcs USB MicroSD Card Reader1pcs Power Supply Adapter Charger 5V 2.5A (US)1pcs USB cable with ON/OFF switch1pcs ABS Protective Case Enclosure1pcs Premium High Speed HDMI Cable3pcs Heatsink kit with Thermal Pad2pcs Raspberry Pi Compatible "SNES" Style USB Gamepad2.Assembly:A.32GB Micro SD card Class 10 Pre-Loaded with the dualsystemThis Micro SD Card Bundle for the Raspberry Pi consists of a Micro SD card pre-loaded with the dual system (Raspbian and Recalbox).Specification:Capacity: 32GBSpeed Class 10Weight: approx 0.2gSimply plug this SD card into your Raspberry PiFully tested to work with the Raspberry Pi 3 Model BPre-Loaded with pre-loaded with the dual system (Raspbian and Recalbox)Superior Random-Access Performance - Perfect for the Raspberry PiB MicroSD Card ReaderThis is a miniature microSD USB reader. Just slide your microSD card into the inside of the USB connector, then stick this into a USB port and the card’s contents will pop up on your computer. Very sneaky - we love it! This little guy is great for pulling data logs off microSD media. This device is completely plug-and-play, so no drivers needed.Specification:TF/microSD/microSDHC Card High-Speed ReaderUSB InterfaceRemovable CapC.Power Supply Adapter Charger 5V 2.5A (US)These have a standard USB ‘A’ connector for the output so you can power your Raspberry Pi through a USB cable. Any device that uses a USB cable for charging or power can be powered with this supply.Specification:Input Voltage: AC100~240V 50/60HzOutput: DC 5.0v 2500mA (2.5A)Short Circuit ProtectionOverload ProtectionConsistent fixed switching voltageInternal Fuse for Extra SafetyAdapter plug type: USB cable with ON/OFF switchThis Raspberry Pi Micro USB Cable with ON / OFF Switch is specifically designed for Raspberry Pi. Just press the button to turn your Pi on and off, no need to pull the cable to restart or reboot your Raspberry Pi, prevent the Raspberry Pi's Micro USB connector from frequent pulling and inserting the USB cable. 1.5m length Can be used as power supply for the Raspberry Pi module, not for data transfer use.Specification:Tested for Compatibility with the Raspberry PiWith ON/OFF switch1.5m LongColor: BlackConnector Type A: USBConnector Type B: Micro USBE.ABS Protective Case EnclosureThis enclosure case is elegant, beautiful, and functional for Raspberry Pi 3 Model B.Made of ultra-durable, super-glossy polycarbonate, it is both good looking and tough enough to toss into your bookbag or toolbox. It has slim openings for all your cables, an easy-to-remove beveled slot for your Micro SD card, slots for both your Pi camera and upcoming display, and a space for your GPIO cable to extend out from the Pi.Specification:Durable two part ABS plastic caseLarge internal volume for HATs, break-out boards, or heat sinksVents on three sides double as fly-through cable portsTwo-section breakout on A/V side for break-out board I/OMicro SD card access portMounting option 1: two M3.5/M3/#6 screws slide into wall mounts for easy removal, horizontal orientation with A/V side down, 40mm spacingMounting option 2: four M3.5/M3/#6 screws through feet from inside for secure mounting in any orientation, 68.3 x 38.8mm spacingExternal dimensions: 96 x 66 x 41mmInternal volume for breakout boards:Length: 90.0mmWidth: 60.0mmF.Premium High Speed HDMI CableThe 1.5m Gold Plated HDMI to HDMI cable is the perfect low cost solution to connecting your Raspberry Pi to your HDMI monitor or TV.This is the latest high speed version V1.4 with Ethernet, 3D support! Specification:1.5m LongFlat "Noodle" Type CableTested for Compatibility with the Raspberry PiHDMI Male (19 Pin) to HDMI Male (19 Pin)24k Gold-Plated Contacts Prevents Corrosion for Life-Long Optimum SignalTransferFully Ethernet and 3D over HDMI enabled (V1.4 Connection)Supports 4Kx2K, 1080p ResolutionsG.Heatsink kit with Thermal PadThe Raspberry Pi Heat Sink Kit consists of three high quality aluminum heat sinks, each selected to perfectly match the size of the main heat out-put components on your Raspberry Pi board. The heatsinks are designed to fit on top of the chip and Ethernet SOC's. Keep your Raspberry Pi super cool with this Raspberry Pi Heat Sink Kit in stunning silver! Extend the life of your Raspberry Pi and reduce the risk of hardware failure.Specification:3 x Silver Aluminum Heat Sinks.Compact, and Able to Fit in Most Raspberry Pi Cases (Including the ModMyPi case).High quality Thermal Adhesive Tape for Easy Application.Thermal Resistance 25°C/W.1pcs 9x9x5mm Heat Sink, Floor Thinness:1.6mm, Vane Thickness:0.8mm.2pcs 14x14x6mm Heat Sink, Floor Thinness:1.1mm, Vane Thickness:0.6mm.H.Raspberry Pi Compatible "SNES" Style USB GamepadGet your retro on with the Raspberry Pi compatible SNES style USB gamepad! This is not an official Nintendo product, but a 3rd party USB type replica of the Super Nintendo/Famicom unit produced in the early 90's!The SNES USB controller with eight-way steering wheel and four digital buttons allows you to enjoy the look and feel of your favorite computer game playing SNES controller. And its USB connection makes it possible to install PC or Mac.Specification:USB ConnectorRaspberry Pi CompatibleD-PadButtons: Start, Select, X, Y, A, B, R, LCable Length: 1.4m3.Installation diagram:Figure1.Figure2.A.Getting started1. If you have a case, start by installing the Raspberry pi inside the case.2. Insert a pre-programmed MicroSD card into the MicroSD card slot on the bottom side of the Raspberry Pi.3. Connect a USB keyboard and mouse to the USB ports.4. Connect a HDMI monitor or TV to the Raspberry Pi using a HDMI cable. Ensure your monitor or TV is turned on and that you have selected the correct input.5. Once all connections have been made, it is now time to connect the MicroUSB Power Supply to the board. When the power is connected, the Raspberry Pi will start to boot.B.Dual systemThe kit default loaded a dual boot system, during booting user can navigate one of the OS using keyboard Up/Down and select a prefer OS from the following dialog.Select the Raspbian OS, it will enter into the Raspbian desktop, or else it will enter into the Recalbox game console.If you want to switch between the two OS, you need to reboot the system and select the other one during the boot stage.Raspbian desktop overviewrecalbox game console over viewNOTE: Our gamepad has been configured in the system, See the following diagrams for reference:For more information about how to use recalbox, please refer to website:/blog。
NS-3网络模拟器版本3的全球路由协议实现及分析说明书
![NS-3网络模拟器版本3的全球路由协议实现及分析说明书](https://img.taocdn.com/s3/m/1c3487221fb91a37f111f18583d049649b660e94.png)
Simulation of the Global Routing Protocol based on NS-3Keng YeSchool of Information and Communication Engineering Beijing Information Science and Technology UniversityBeijing, Chinae-mail:**************Jinhe ZhouSchool of Information and Communication Engineering Beijing Information Science and Technology UniversityBeijing, Chinae-mail:*******************.cnAbstract—NS-3 (Network Simulator version 3) could construct a network environment to simulate protocols in computer network. The purpose of this paper is implementing global routing by using the NS-3 with modified OSPF source code. The processing of simulation had been described with C++ code. Furthermore, the result of the network simulation had been analyzed with different software tools such as gawk, gunplot. In this paper we focused on simulating the global routing of Internet by NS-3 and analyzing the related theories about the routing protocol, at last, this paper was analyzing the average delay under different rates.Keywords-routing protocol; NS-3; OSPF; simulationI.I NTRODUCTIONNS-3 not only had abandoned shortcomings of the current mainstream network simulation software such as OPNET and NS-2, but also integrated the advantages of them. NS-3 had excellence including the following aspects: (1) documenting kernel of the standard components; (2) using scripting language such as C + + or Python; (3) applying to real system (network interface, device, driver interface) perfectly; (4) software integration; (5) virtualization and test-bed integration; (6) excellent documented property system; (7) updating the model in real time.NS-3 is a kind of unique simulator which includes integrity, openness, scalability and etc, and these feathers make it superior to most of the existing mainstream network simulator software. NS-3 has extremely powerful function to simulate a variety of network, protocols at all levels.NS-3 is different from the NS-2, although NS-3 is still using the C++ language to realize the simulation node. It hadn’t supported on NS-2 API and obsoleted Otcl language to control the processing of simulation. The framework of NS-3, whose simulation process can be described by pure C++ code, is much clearer than other software [1].II.T HE P RINCIPLE OF G LOBAL R OUTING P ROTOCOLIn NS-3, a C++ object builds an OSPF (Open Shortest Path First) routing database of information about the network topology [2], and executes a Dijkstra SPF (Shortest Path First) algorithm on the topology for each node, and stores the computed routes in each node's layer 3 forwarding table by making use of the routing API(Application Program Interface). The format of the data exported harmonizes with the OSPFv2 standard. In particular, the information is exported in the form of ns3::GlobalLSA objects that semantically conform to the LSA (Link State Advertisements) of OSPF. By utilizing a standard data format for informing topology, existing OSPF route computation code can be reused, and that is what can be done by ns3::GlobalRouteManager objects.OSPF is one kind of IGP (Interior Gateway Protocol), which is used for making routing decision in a single AS (Autonomous System). OSPF is a kind of link-state routing protocol, while RIP is a kind of distance vector routing protocol. In the other words, link is called router interface, so OSPF is also known as the interface state routing protocol. The OSPF is establishing the link state database, generating the shortest path tree through the network interface state of router notice, each OSPF router using the shortest path to construct the routing table [3].The routing algorithm is the core of the OSPF routing protocol. The SPF algorithm is also called Dijkstra algorithm as shown in Fig. 1, because of the shortest path first algorithm SPF is invented by Dijkstra. The SPF algorithm utilize each router as root node to calculate the distance from root node to each destination router, according to a unified database each router will be worked out the topological structure in routing domain, which is similar to a tree called SPT( shortest path tree )in the SPF algorithm. In the OSPF routing protocol, the trunk length of SPT is the distance from the root router to other routers. Smaller Cost means that the OSPF distance between source and destination is shorter.S represents the set of nodes which have not found the shortest path to the root node.R [i]represents the node which is located in front the node i on the path from the specified source node to node i.D [i]represent the shortest distance from the specified source to the node i.Initialization of the algorithm:The set S is initialized as a set which include all nodes but the source node.D[i]: If there is a link from the source node to node v, D (v) is the Cost of the link; otherwise D (v) is infinity.R[i]: If there is a link from source node to node v, R (v) is source node; otherwise R (v) =0International Conference on Software Engineering and Computer Science (ICSECS2013)Figure 1. Pseudo code for Dijstra algorthmWhen the router is initializing or the network structure is changing (for example, increasing or decreasing in the router, link state changing), the router will generate LSA, which contains all of the routers connected to the link, and calculate the shortest path.All routers exchange data of link state with each other through a Flooding, which is that the routers sent LSA to all adjacent OSPF routers. Basing on which the routers received, they have been updating their database and forwarding link state information to the adjacent routers until a stable process When the network is re-stabilized, the convergences of OSPF routing protocol have been completed. All routers will be calculated by the respective link state database of information to generate routing table, which contains the router to another reachable one and the destination to the next router.III.T HE SIMULATION PROCESS OF GLOBAL ROUTINGIn this section, we’ll introduce some important terms that are realizing specific function in ns-3.A.NodeIn NS-3 the basic abstraction of network device is called the Node. The class Node provides methods for managing the functions of network devices in simulation. You should consider a Node as a computer or a router to which you will add functionality by yourself [1]. One adds things like topology, channel, protocol stacks and peripheral devices with their associated drivers to activate the Node to do practical function.Class NodeContainer provides a very convenient way to create, manage, and access nodes, set as follows,NodeContainer c;c.Create (7); B.TopologyClass NodeContainer can connect any two nodes, set asfollows,NodeContainer n0n4 = NodeContainer(c.Get(0), c.Get(4));C.ChannelThe class Channel provides methods for constructingcommunication subnetwork objects and connecting nodes toeach other. Channels may also be specialized by us in theobject- oriented programming method. The specializedChannel can simulate things as complicated as a wire, alarge Ethernet switch, or three-dimensional space full ofobstructions in the case of wireless networks [1].We will utilize specialized versions of the Channelcalled CsmaChannel, PointToPointChannel and WifiChannel in NS-3. This paper choosesPointToPointHelper to simulate, set as follows,PointToPointHelper p2p;DeviceIn ns-3 the abstraction of network device covers both thesoftware driver and the simulated hardware. A network device is “installed” in a Node so as to activate the Node tocommunicate with other Nodes in the simulation viaChannels. Just as in a real computer, a Node may beconnected to more than one Channel via multipleNetDevices. The abstraction of network device isrepresented in C++ by the class NetDevice. The classNetDevice provides methods for managing connections toNode and Channel objects; and may be specialized by us inthe object-oriented programming. We will utilize the severalspecialized versions of the NetDevice calledCsmaNetDevice, PointToPointNetDevice, andWifiNetDevice in NS-3[1]. This paper choosesPointToPointNetDevice to simulate, set as follows, p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));NetDeviceContainer d0d4 = p2p.Install (n0n4);E.Protocol StackUntil now, nodes, devices and channels are created, wewill use class InternetStack to add stack, set as follows, InternetStackHelper internet;internet.Install (c);F.Assignning Ipv4 AddressThis paper chooses Class Ipv4AddressHelper assign IPaddresses to the device interfaces.NS_LOG_INFO ("Assign IP Addresses.");Ipv4AddressHelper ipv4;ipv4.SetBase ("10.1.1.0", "255.255.255.0");Ipv4InterfaceContainer i0i4=ipv4.Assign (d0d4); G.Setting OSPF Cost Metrici0i4.SetMetric (0, sampleMetric04);i0i4.SetMetric (1, sampleMetric04);H.Generating Routing TableNS_LOG_INFO is recording information on the progress of the program. This paper chooses global routing protocol which is introduced in section 2.Ipv4GlobalRoutingHelper::PopulateRoutingTables ();I.Sending Traffic And Setting Data Rate , The Size OfPacketNS_LOG_INFO ("Create Applications.");uint16_t port = 80; // Discard port (RFC 863)OnOffHelper onoff ("ns3::TcpSocketFactory",InetSocketAddress (i5i6.GetAddress (1), port));onoff.SetAttribute("OnTime", RandomVariableValue (ConstantVariable (1)));onoff.SetAttribute("OffTime", RandomVariableValue (ConstantVariable (0)));onoff.SetAttribute("DataRate",StringValue("5kbps") );onoff.SetAttribute ("PacketSize", UintegerValue (50)); J.Generating And Stopping TrafficApplicationContainer apps = onoff.Install (c.Get (0));apps.Start (Seconds (1.0));apps.Stop (Seconds (100.0));K.Class Packetsink Receive The Traffic OfPacketSinkHelper sink ("ns3::TcpSocketFactory",Address (InetSocketAddress (Ipv4Address::GetAny (), port)));apps = sink.Install (c.Get (6));apps.Start (Seconds (1.0));apps.Stop (Seconds (100.0));NS_LOG_INFO ("Configure Tracing.");L.Generating Trace File To Record SimulationInformationAsciiTraceHelper ascii;Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream ("ospf.tr");p2p.EnableAsciiAll (stream);internet.EnableAsciiIpv4All (stream);M.Generating Routing File To Record Route Information Ipv4GlobalRoutingHelper g;Ptr<OutputStreamWrapper>routingStream=Create<OutputStreamWrapper>("ospf.routes",std::ios::out);g.PrintRoutingTableAllAt(Seconds(12), routingStream);N.Executing SimulatorNS_LOG_INFO ("Run Simulation.");Simulator::Run ();Simulator::Destroy ();NS_LOG_INFO ("Done.");IV.S IMULATION R ESULTSimulation results verify that the shortest path tree conforms to Dijkstra algorithm in OSPF protocol and count package delay to check network performance.A.Generating Shortest PathAccording to the topology in Fig. 2, in the 1st second executes a Dijkstra SPF algorithm on the topology for each node, finds the shortest path between node 0 and node 3, as shown in Fig. 3 the shortest path is node 0->node 4-> node 1-> node 2-> node 5-> node 6-> node 3, rather than node 0->node 4-> node 1-> node 2-> node 3 which include the least node.In 2nd second, disconnecting the link node 1 and node 2, node 0 executes a Dijkstra SPF algorithm on the topology for each node, finds the shortest path between node 0 and node 3, as shown in Fig.4 at the moment, the shortest path is node 0->node 4-> node 1-> node 5-> node 6 -> node 3.In 4th second, reconnecting the link node 1 and node 2, node 0 executes a Dijkstra SPF algorithm on the topology for each node, finds the shortest path between node 0 and node 3, the shortest path is node 0->node 4-> node 1-> node 2-> node 5-> node 6-> node 3.In 6th second, disconnecting the link node 5 and node 6,node 0 executes a Dijkstra SPF algorithm on the topology for each node, finds the shortest path between node 0 and node 3, at the moment, the shortest path is node 0->node 4-> node 1-> node 2-> node 3.In 8th second, disconnecting the link node 2 and node 3,node 0 executes a Dijkstra SPF algorithm on the topology for each node, finds the shortest path between node 0 and node 3, at the moment, the shortest path is node 0->node 4-> node 1-> node 5-> node 2 -> node 3.In 12th second, reconnecting the link node 1 and node 2, node 0 executes a Dijkstra SPF algorithm on the topology for each node, finds the shortest path between node 0 and node 3, at the moment, the shortest path is node 0->node 4-> node 1-> node 5-> node 6 -> node 3.In 14th second, reconnecting the link node 1 and node 2, node 0 executes a Dijkstra SPF algorithm on the topology for each node, finds the shortest path between node 0 and node 3, at the moment, the shortest path is node 0->node 4-> node 1-> node 2-> node 5-> node 6-> node 3.Figure 2. topology with cost in simulationFigure 3. shortest path in 1stsecondFigure 4. shortest path in 2ndsecondB. DelayIn Fig. 5 are shown the simulation results of delay for the communication between node 0 and node 3. Under different shortest path, delay is diverse. The network delay is very close to the case when the packets take the same path. The path of least delay is not necessarily the shortest path.The average delay is the time of all data packets arrived at destination node from the source node. The characterization means the current status of the network. As shown in Fig. 6,V.C ONCLUSIONSummary, this paper describes an effective simulation method to realize global routing protocols, evaluate network performance, and carry out a detailed analysis of delay and shortest path tree. The conclusion has certain reference value.A CKNOWLEDGMENTThis work was supported by National Natural Science Foundation of China (61271198) and Beijing Natural Science Foundation (4131003).Figure 5.the packet delayFigure 6. the average delay under different rateR EFERENCES[1] NS-3 Tutorial. /, 12 Dev 2012[2] NS-3 project NS-3 Doxygen. /,12 Dev 2012 [3] Andrew S. Tanenbaum. Computer Network Fourth Edition. Beijing:Tsinghua University Press.pp.350-366,454-459(2008) [4] WANG Jianqiang,LI Shiwei,ZENG Junwei,DOUYingying.(2011)Simulation Research of VANETs Routing Protocols Performance Based on NS -3Microcomputer Applications Vol. 32 No. 11.[5] NS-3 project NS-3 Reference Manual. /,12Dev 2012[6] Timo Bingmann.( 2009). Accuracy Enhancements of the 802.11Model and EDCA QoS Extensions in ns-3. Diploma Thesis at the Institute of Telematics[7] Learmonth, G. Holliday, J. (2011) NS3 simulation and analysis ofMCCA: Multihop Clear Channel Assessment in 802.11 DCF .Consumer Communications and Networking Conference (CCNC). IEEE[8] Henderson T R,Floyd S,Riley G F(2006) NS-3 Project Goals.Proceedings of the Workshop of Network Simulation. Pisa, Italy.[9] Vincent.S,Montavont.J(2008).Implementation of an IPv6 Stack forNS-3. Proceedings of the Workshop of Network Simulation.AthensGreece:[s. n.].。
ns3 traceconnectwithoutcontext 例子 -回复
![ns3 traceconnectwithoutcontext 例子 -回复](https://img.taocdn.com/s3/m/35b8a4acb9f67c1cfad6195f312b3169a451eac9.png)
ns3 traceconnectwithoutcontext 例子-回复ns3是一种广泛应用于网络仿真研究的开源网络模拟器。
在ns3中,trace connect without context是一种用于模拟网络中节点之间的连接的功能。
本文将一步一步回答关于ns3 trace connect without context 例子的问题,并对其进行详细解析和说明。
首先,我们需要了解什么是ns3。
ns3是一个基于C++开发的网络仿真器。
它可以模拟各种网络环境,包括有线网络、无线网络、移动网络等。
ns3不仅可以模拟数据包的传输和路由,还可以模拟其他网络特性,如链路质量、干扰情况等。
它在学术界和行业中广泛应用于网络性能评估、协议设计和优化等领域。
在ns3中,trace connect without context是一种用于建立网络中节点之间连接的功能。
它允许用户根据事先定义的轨迹文件,模拟节点之间的连接建立和关闭过程,以及连接参数的变化。
这种功能在研究网络拓扑、节点行为和网络协议时非常有用。
为了更好地理解trace connect without context的使用,我们可以通过一个具体的例子来说明。
假设我们要研究一个有10个节点的无线传感器网络,其中节点之间的连接将根据时间变化。
我们可以通过使用ns3 trace connect without context来实现这一目标。
首先,我们需要创建一个轨迹文件,用于描述节点之间的连接变化。
这个文件可以是一个简单的文本文件,每一行代表一个连接事件,包括连接建立和关闭的时间、节点的编号以及连接的参数。
例如,我们可以创建一个trace.txt文件,内容如下:0 1 2 10Mbps10 1 3 5Mbps20 2 3 2Mbps30 2 4 1Mbps40 3 4 10Mbps...在这个轨迹文件中,第一列是连接事件发生的时间,第二列是连接建立或关闭的节点编号,第三列是与节点连接的目标节点编号,第四列是连接的参数,如带宽或延迟。
Ruby on Rails 3 教程说明书
![Ruby on Rails 3 教程说明书](https://img.taocdn.com/s3/m/a025024bc381e53a580216fc700abb68a982ad9a.png)
Table of ContentsAbout1 Chapter 1: Getting started with ruby-on-rails-32 Remarks2 Examples2 Installating Rails on mac.2 Hello World in Rails3 Credits5AboutYou can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: ruby-on-rails-3It is an unofficial and free ruby-on-rails-3 ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official ruby-on-rails-3.The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners.Use the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to ********************Chapter 1: Getting started with ruby-on-rails-3RemarksThis section provides an overview of what ruby-on-rails-3 is, and why a developer might want to use it.It should also mention any large subjects within ruby-on-rails-3, and link out to the related topics. Since the Documentation for ruby-on-rails-3 is new, you may need to create initial versions of those related topics.ExamplesInstallating Rails on mac.You would need to install ruby before you can install rails.Mac already comes with ruby installed based on how recent your macOS is? Depending on what ruby version you want for your development, the best way to install Ruby is to use RVM. In your terminal, type the command below listed in steps:1.Install rvmcurl -sSL https://get.rvm.io | bash -s stable --ruby2.For Rails 3, best version to install is ruby 1.9.3rvm install 1.9.3ruby -v #=> 1.9.33.Set your Ruby versionrvm use 1.9.3 --default4.Install Rails (this rails version requires ruby-version >=1.9.3)gem install rails -v 4.2.7.1rails -v #=> 4.2.7.15.Install rails apprails new my_first_app #(this will install the app for you.)cd my_first_apprails s #(run the server)6.Open the browser and type below in your URL.http://localhost:3000Message saying 'Welcome to rails' will be displayed or similar.Hello World in Rails1.Say "Hello", RailsTo get Rails saying "Hello", you need to create at minimum a controller and a view.A controller's purpose is to receive specific requests for the application. Routing decideswhich controller receives which requests. Often, there is more than one route to eachcontroller, and different routes can be served by different actions. Each action's purpose is to collect information to provide it to a view.A view's purpose is to display this information in a human readable format. An importantdistinction to make is that it is the controller, not the view, where information is collected. The view should just display that information. By default, view templates are written in a language called eRuby (Embedded Ruby) which is processed by the request cycle in Rails beforebeing sent to the user.To create a new controller, you will need to run the "controller" generator and tell it you wanta controller called "Welcome" with an action called "index", just like this:$ bin/rails generate controller Welcome indexRails will create several files and a route for you.create app/controllers/welcome_controller.rbroute get 'welcome/index'invoke erbcreate app/views/welcomecreate app/views/welcome/index.html.erbinvoke test_unitcreate test/controllers/welcome_controller_test.rbinvoke helpercreate app/helpers/welcome_helper.rbinvoke assetsinvoke coffeecreate app/assets/javascripts/welcome.coffeeinvoke scsscreate app/assets/stylesheets/welcome.scssMost important of these are of course the controller, located at2.app/controllers/welcome_controller.rb and the view, located atapp/views/welcome/index.html.erb.Open the app/views/welcome/index.html.erb file in your text editor. Delete all of the existing code in the file, and replace it with the following single line of code:<h1>Hello, Rails!</h1>3.Now that we have made the controller and view, we need to tell Rails when we want "Hello, Rails!" to show up. In our case, we want it to show up when we navigate to the root URL of our site, http://localhost:3000.Next, you have to tell Rails where your actual home page is located.Edit the file by adding the line of code root 'welcome#index'. It should look something like the following:Rails.application.routes.draw doget 'welcome/index'root 'welcome#index'end4.root welcome#index tells Rails to map requests to the root of the application to the welcome controller's index action and get welcome/index tells Rails to map requests tohttp://localhost:3000/welcome/index to the welcome controller's index action. This wascreated earlier when you ran the controller generator (bin/rails generate controller Welcome index).Yay, now the moment of truth. Launch web server after restarting your rails server and5.navigate to http://localhost:3000 in your browser. You'll see the "Hello, Rails!" message you put into app/views/welcome/index.html.erb, indicating that this new route is indeed going to WelcomeController's index action and is rendering the view correctly.This Guide is from . Happy Hacking!Read Getting started with ruby-on-rails-3 online: https:///ruby-on-rails-3/topic/9066/getting-started-with-ruby-on-rails-3Credits。
Switch中文详尽学习笔记
![Switch中文详尽学习笔记](https://img.taocdn.com/s3/m/dafc0d20cd1755270722192e453610661ed95a78.png)
Switch中文详尽学习笔记第一章园区网概述园区网特点1. 在一个固定地理区域内的一个公司或一个公司的一部分。
2. 拥有该园区网的公司通常也拥有该园区内所用的物理线路。
传统园区网的主要问题1. 可用性2. 性能在传统园区网中,通常用多端口网桥将一个局域网分段成隔离的碰撞域。
这样可解决两个问题:1. 冲突域(Collision Domain)2. 距离限制网络中通信的三种形式:单播(Unitcast)、组播(Multicast)、广播(Broadcast)。
1. 多点广播实例:Cisco IP/TV分发多媒体数据、定位IP服务上的Novell 5。
2. 提出请求的广播:IP的地址解析协议(ARP)、NetBIOS的名字请求、网间包交换协议(IPX)寻找最近服务器(Get Nearest Server,GNS)请求。
3. 发布通告的广播:IPX服务通告协议(SAP)数据包、路由信息协议(RIP)、内部网关路由选择协议(IGRP)。
遏制广播的两种方法:1. 使用路由器生成多个子网;2. 利用交换机实施VLAN。
当前园区网由两部分组成:1. 局域网交换机2. 路由器传统的80/20规则和新的20/80规则1. 80/20规则:在设计恰当地网络环境中,一个给定网段上80%的流量是本地的,不超过20%的网络流量需要通过主干。
2. 20/80规则:只有20%的流量是到本地工作组局域网的,而80%的流量需要流出本地网络。
导致流量模式的改变有两个因素:1. 基于Web应用的计算普遍,很多PC既是信息的接受者,也是信息的发布者;2. 企业部署集中式的服务器群(既降低成本、提高安全、便于管理)。
新的园区网模型中的3类服务1. 本地服务:本地数据流不进入网络主干或通过路由器2. 远程服务:远程服务数据流穿过广播域边界,但可能也可不通过网络主干3. 企业级服务:放在距离网络主干很近的一个独立的子网上与OSI分层相应的PDU和设备类型模型层 PDU类型设备类型数据链路层(第2层) 数据帧交换机/网桥网络层(第3层) 数据包路由器传输层(第4层) TCP数据分段 TCP端多层交换机多层交换基于单独的流,MLS-SE为MLS流维护一个缓存条目并为每个流存储统计信息。
网络仿真工具NS3的培训文档精品文档
![网络仿真工具NS3的培训文档精品文档](https://img.taocdn.com/s3/m/2e4818b8240c844769eaee9c.png)
Node Basics
An ns-3 Node is a husk of a computer to which applications, stacks, and NICs are added
ns-3 is a discrete-event network simulator for Internet systems
ns-3 allows researchers to study Internet protocols and large-scale systems in a controlled environment
UdpEchoClientHelper
28
Simulator
What we need to do at this point is to actually run the simulation.
scheduled events in the simulator at 1.0 seconds, 2.0 seconds and two events at 10.0 seconds
# ./build.py
11
Building ns-3 (2/5)
# ./waf -d optimized configure
ns-3 uses the waf build system
12
Building ns-3 (3/5)
# ./waf -d debug configure
ns3 提供的 log 訊息分成了以下幾個等級:
1.NS_LOG_ERROR — Log error messages;
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
本教程变成 C++教程,所以我们希望读者能够掌握基本的 C++命令。在网站上和书籍 中,你可以找到无数的关于 C++知识的信息。 如果读者是个 C++新手,那么您在继续阅读本指南之前可能需要找一些 C++教程 或者网站,至少必须熟悉一下 C++的基本语言特征。例如,Cplusplus 教程。 NS-3 系统开发过程中使用了许多的 GNU 工具链(toolchain)组件。所谓软件的工 具链是指在给定环境中可用编程工具的集合。如果读者想要快速地了解一下 GNU 工具 链所包含的内容,请浏览 /wiki/GNU_toolchain . NS-3 使用 gcc, GNU binutils,以及 gdb. 但是,我们并不使用 GNU 编译系统工具 (build system tools) , 既不用 make ,也不用 autotools,而是使用 Waf 来作为编译管理工具。 通常,NS-3 使用者的工作环境为 Linux 或者类 Linux 系统。对于 Windows 环境, 有几种可以不同程度模拟 Linux 环境的软件,比如 Cygwin。NS-3 支持在 Cygwin 环境 下的开发。 Windows 用户可以浏览 / 获取该软件(虽然有许多工程 维护者使用 MinGW,但是 MinGW 现在还没有得到官方支持)。Cygwin 可以提供许多 流行的 Linux 系统命令。但是,某些情况下它也会出现问题,因为它毕竟只是 Linux 系 统的模拟。Cygwin 和 Windows 中其他程序的交互也有可能会导致程序出现问题。 如果读者正在使用 Cygwin 或者 MinGW;并使用着 Logitech 的某些软件产品,我 们或许可以让您少点麻烦:建议您去看一看 MinGW FAQ。 搜索 Logitech 并阅读 FAQ 条目: “为什么当我编译源码时,make 经常崩溃,留下 一个 sh.exe.stackdump 文件” 。无论您相信与否,当运行 Logitech 时,Logitech 进程监视 器潜入了每个正在系统中运行的动态连接库(DLL)当中。它可能导致您的 Cygwin 或者 MinGw 的动态连接库奇怪地中止,常常也会阻止调试器的运行。所以当运行 Cygwin 的时候,一定要小心您的 Logitech 软件。 替代 Cygwin 的一种选择是安装虚拟机,比如在 VMware 上安装 Linux 虚拟机。
ns-3code server.
Both PDF and HTML versions should be available on the server. Changes to the document should be discussed on the ns-developers@ mailing list. This software is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see /licenses/.
难通过繁冗的参考手册收集到对当前仿真任务有用的实质信息。 在本教程中, 我们将通 过几个仿真实例向读者介绍和阐释 NS-3 的主要概念和特点。 随着本教程的深入,我们会介绍完整的 NS-3 文档,并指出源代码的具体位置,以 便于对 NS-3 软件系统运行机制感兴趣的研究者做深入的钻研。 开始之前,有几个要点需要读者注意: NS-3 并不是 NS-2 的扩展,而是一个全新的模拟器。虽然二者都由 C++编写,但 NS-3 并不支持 NS-2 的 API。NS-2 中的一些模块已经被移植到了 NS-3。在 NS-3 开发的过程 中,NS-3 项目组会继续维护 NS-2,同时也会研究过渡和整合机制。 NS-3 是开源的。NS-3 项目努力为研究者提供一个开放的环境来共享他们自己的软件。
NS-3 用户有必要知道几个重要的网站:
主站点位于 , 提供 NS-3 系统的基本信息。 详细文档位于主站点的 /documents.html. 您也可以从这个网页 上得到系统架构的相关信息。
维基百科网页 /wiki 可以作为 NS-3 主站点的补充。您可以在 那里找到用户和开发者的 FAQs,以及相关问题的解决途径,第三方的共享代码、论文 等等。 NS-3 的源码可以在 找到。读者也可以在名为 ns3-dev 的源码 仓库找到当前的 NS-3 开发树。还有 NS-3 的之前发行版本和最新测试版本的代码。
2.2 源码管理系统 Mercurial
复杂的软件系统需要一种途径,用于管理和组织对现有代码和文档的修改。有很
多种方法可以实现这种管理,读者可能已听说过某些版本控制软件,CVS(Concurrent Version System)或许是其中最常见的一个。 NS-3 项目采用 Mercurial 系统作为它的源码管理系统。尽管读者在阅读本教程时 不需要知道太多的 Mercurial 相关知识,但我们建议读者能够熟悉 Mercurial,并用于查 看 NS-3 源码。Mercurial 的网址为 /mercurial/,读者可以从上面获 取到这个软件配置管理系统(Software Configuration management, SCM)的二进制程序和 源码。Mercurial 的开发者 Selenic 提供了一个 Mercurial 教程,网址为 /mercurial/wiki/index.cgi/Tutorial/,以及快速入门指南: /mercurial/wiki/index.cgi/QuickStart/ . 在 NS-3 的主页上, 读者也可以获取到有关 Mercurial 和 NS-3 配合使用的最常用信 息。
1.2 共享 contributing
NS-3 是由学术研究者开发和使用的用于网络科研和教学的仿真器。它依赖于研究
者们持续不懈地努力,开发新模块、调试和维护已有模块、并共享成果。为了鼓励研究 者像支持 NS-2 那样支持 NS-3,我们希望 NS-3 的开发者遵守下面几条规则:
基于 GNU GPLv2 兼容性的开放源码许可 维客 共享代码(Contributed Code) 页(类似于 NS-2 的共享代码页) Src/contrib. 目录(我们会保留您共享的代码) 开放的错误追踪器(bug tracker) NS-3 开发者会很乐意帮助潜在的代码共享者们,提供 NS-3 仿真器的入门途径(请联系我 们) 我们也意识到,如果您正在读本教程,对 NS-3 项目的共享或许还不在您当前最关 心的事,但是我们希望您知道, “共享”是 NS-3 项目的灵魂。即使是给我们写一个关 于您使用 NS-3 的经验便条(例如: “这个教程的章节条理不够清晰” ) ,通知某些文档 已过时等等,我们将会感激之至。
1.1 致 NS-2 用户
对于熟悉 NS-2 的读者来说, NS-3 和 NS-2 最明显的区别是脚本语言的选择。 NS-2
使用 OTcl 脚本语言,仿真的结果可以通过网络动画器 nam(Network Animator nam)来 演示。 在 NS-2 中, 如果仅使用 C++语言而不用 OTcl, 仿真过程是不可能运行起来的(即, 只有 main()函数而没有任何 OTcl 语句)。另外,NS-2 的许多模块由 C++编写,其他的 用 OTcl 语言编写。 而在 NS-3 中, 仿真器全都由 C++编写, 仅仅带有可选择性的 Python 语言绑定。因此,仿真脚本可以由 C++或者 Python 语言编写。某些仿真结果可以通过 nam 演示,但是新的动画演示器也正在开发之中。由于 NS-3 可以生成 pcap 包 trace 文 件,也可以利用其他工具通过 trace 文件来分析仿真过程。在本教程中,我们先重点讲 解使用 C++编写脚本,并通过 trace 文件来分析仿真结果。 NS-3 和 NS-2 也有一些相似之处 (比如二者都是基于 C++对象,一些 NS-2 的模块 已移植到了 NS-3 上)。在本教程中,我们将强调 NS-3 和 NS-2 的区别。 我们经常听到一个疑问: “我到底是要继续使用 NS-2,还是转向 NS-3 呢?” 答案视情况而定。虽然 NS-3 现在还没有包含所有的 NS-2 模块,但是另一方面NS-3 也有一些新的功能(比如,能正确地处理节点上的多重接口,使用 IP 地址,与因特网协 议和设计保持一致,以及更加详细的 802.11 模块等)。NS-2 的模块可以被移植到 NS-3 中(移植帮助文档正在准备之中) 。NS-3 的多个前端也正在积极开发中。同时,NS-3 开发者也相信(部分早期用户也已证明)NS-3 已经可以充分使用, 也是用户进行新仿真项 目时的一个富有吸引力的选择。
ns-3
project is available in four forms: