NS3 Network Simulator
The best way to learn NS3 must be to read the official document given. At present NS3 official online gave tutorial, Mannual, module three pdf, for the Novice of me, tutorial is clearly a better primer, so began to read tutorial, at the same time part of the translation, and mixed with some personal ideas.
ns-3.2- Introductory Basics
- Introduced
NS3 is a discrete event-driven network simulator designed to help with academic research and education. NS3 is an open source project that originated in 2006.
For new users of NS3, it is sometimes cumbersome and lengthy to gather information from the detailed English technical details manual and translate it into a simulation environment, so this article translates ns3-tutorial to provide a convenient learning interface for NS3 Chinese new users. In the following sections, we will gradually build some of the examples provided by NS3 and explain the concepts and features involved.
Before we get started, we need to understand the following points:
L NS3 Open Source, designed to maintain an open network simulation environment for research scholars to share and learn.
L NS3 is a new simulator and it is not backwards compatible with NS2. Although both are written in C + +, NS3 does not support the API in NS2. In addition, some of the modules in the NS2 have been transferred to the NS3, and the project will continue to maintain ns2 while building the NS3, and study the transition and integration mechanism between the two.
1.1 About NS3
NS3 was developed to provide an open, extensible network simulation Platform for research and education purposes. Simply put, NS3 provides a basic package delivery model and a simulation platform for users to conduct network experiments. The reason why you choose to use NS3 is that many times users cannot validate their ideas in a real network system, and NS3 just provides a highly controlled, reusable network simulation platform that is very similar to real-world network performance. Some users may have noticed that the current modules in NS3 are mainly about protocols in the Internet and the way the network works, but it is important to note that NS3 is not confined to simulating the Internet environment, and some users use it to emulate non-internet systems.
Today, the open source community already has a lot of network simulation tools, NS3 and their main differences are as follows:
L NS3 is composed of a series of function library files that can be combined as needed, and can be combined with external library files. Some other network emulators directly provide a single, integrated graphical interface for the user to use. So NS3 is relatively flexible and modular. While NS3 encourages users to work at the command line, this does not mean that NS3 does not have a corresponding graphical simulation tool.
L NS3 is mainly run under the Linux operating system (also supported by FreeBSD and Cygwin (used under Windows platform)), and under Windows The VS support is currently under development.
L NS3 is not funded by the company and is supported by NS3 users.
1.2 For NS2 Users
For users who are familiar with NS2, the biggest transition from NS2 to NS3 may be the choice of scripting language. It is not possible to run a pure C + + language on NS2 because the components in NS2 are written in both C + + and OTCL. While NS3 is all written in C + +, the scripting language supports C + + and Python. NS3 can also generate Pcap packet trace files, which are used to analyze the package.
NS2 User A more common question is: Should I continue to use NS2 or transfer to NS3? The answer to this article is that if you are not particularly interested in ns2, you are more creative under NS3:
L NS3 is maintained and developed by a group of motivated people, and the main code of NS2 has not changed in almost 10 years.
L NS3 provides features that are not available in ns2, such as user-defined source execution environments.
L NS3 provides a lower abstraction, which makes it easier to understand how parts of a real system are organized together.
NS2 has a long history, so it has much more modules than NS3. But the details of NS3 in some modules are more complete than the NS2. And the support of the code implementation is NS2 incomparable advantage. Assuming a module that requires C + + implementation in NS2, it must be migrated to NS3 for implementation.
1.3 Funding
Todo
1.4 Organizational Structure
l download and compile ns3;
L run some basic examples;
L View the output, analyze it and adjust it.
2. NS3 Resources
2.1 Network resources
NS3 users must know about the network resources:
Main website: http://www.nsnam.org (can get basic information to NS3 system)
Document Web site: http://www.nsnam.org/documentation (System architecture, classes, and other documents)
Wiki Encyclopedia: Http://www.nsnam.org/wiki
NS3 Source: http://code.nsnam.org
2.2 Mercurial
It is important to manage and organize the underlying code and documentation for the system, and the concurrent Version system (CVS) in such a tool should be quite famous. NS3 provides a similar source manager mercurial, while mercurial can also be used to download NS3 source code. Information about mercurial can also be found on the NS3 homepage.
Mercurial home: http://www.selenic.com/mercurial
2.3 Waf
Once the source code has been downloaded, it needs to be compiled to build the available project. In many Linux build tools, it should be known as make, but make works for small systems. The NS3 project then compiles the system using WAF.
WAF RELATED Links: Http://code.google.com/p/waf
2.4 Development environment
The NS3 scripting language is C + + and Python, so it is best for NS3 users to develop in a Linux environment. Of course, for users under Windows, we also provide a linux-like environment Cygwin (to some extent, the Linux environment) +MINGW (compiler, but it doesn't seem to support it at the moment).
Cygwin website: http://www.cygwin.com
2.5 Socket Programming
In some examples of this article will use the relevant socket API, if you are unfamiliar with sockets, it is recommended to familiarize yourself with sockets (TCP/IP Sockets in C, Donahoo and Calvert).
NS3 Road---ns3tutorial interpretation---Introduction & Resource