Zhu Yanping Changzhou University Changzhou Jiangsu 213164
Abstract: With the vigorous development of Internet of Things technology, wireless sensor network courses are offered in the undergraduate teaching of communication and computer specialty. This article introduces an excellent open source wireless network simulation software-OMNeT ++, and applies it to the teaching of wireless sensor networks, which can simulate most of the channels, topologies and protocols in wireless sensor networks. Based on the research of OMNeT ++, a concrete example of network simulation is given. Practice has shown that the use of OMNeT ++ for demonstration teaching has an active classroom teaching atmosphere and good teaching effects. Students also have a deeper understanding of wireless sensor network channels, topology and protocols.
Keywords: OMNeT ++; simulation teaching; wireless sensor network
Wireless sensor network is one of the hotspot research fields that have received much attention. It integrates multiple technologies such as sensors, microelectromechanical systems, embedded computing, modern networks and wireless communications, and distributed information processing to realize the connection between the physical world, the computing world, and human society, and improve humans' ability to understand and transform nature.
The vigorous development of the Internet of Things technology requires teachers to constantly update and track the latest technology in the teaching process to better adapt to the requirements of wireless sensor network course teaching. But at present, there is a problem of lack of necessary experimental equipment in the teaching of wireless sensor networks. Experimental equipment such as radio frequency transceivers and gateways are relatively expensive, and ordinary colleges and universities cannot provide students with them. Students cannot better understand and master the principles of wireless network communication and exercise the application capabilities of wireless sensor network engineering through a real experimental environment. Therefore, try to apply the network simulation software OMNeT ++ (Objective Modular Network TestBed in C ++) to the wireless sensor network course teaching, and use its animation demonstration to clearly demonstrate the operation of the network protocol to students. Through OMNeT ++ teaching, students can intuitively see the behavior of the wireless sensor network protocol, understand the impact of various topologies, channel environments, etc. on the wireless sensor network, visualize the abstract concept, and concrete the boring principle.
1 OMNeT ++ principle and structure
OMNeT ++ is an open source, component-based and modular open network simulation platform developed by the Communication Engineering Department of Budapest University. It is an excellent network simulation platform that has gradually become popular in the scientific and industrial fields in recent years. As a discrete event simulator, OMNeT ++ has a powerful and complete graphical interface interface and embeddable simulation kernel. Compared with simulation platforms such as NS2, OPNET and JavaSim, OMNeT ++ can run on multiple operating system platforms and can easily define the network topology. With functions such as programming, debugging and tracking support. The simulation environment used in this article is OMNeT ++ 4.0, this version comes with Mingw compilation environment, and no longer requires Visual C compilation environment. In version 4.0, an IDE based on Eclipse is added, which can be used directly.
1.1 OMNeT ++ architecture
OMNeT ++ is mainly composed of 6 parts: Simulation Kernel Library (Simulation Kernel Library, Sim), Network Description Compiler (Network Description Compiler, nedc), graphical network editor (Graphical Network Description Editor, GNED), simulation program The graphical user interface Tkenv, the command line user interface of the simulation program Cmdenv, the graphical vector output tool Plove. OMNeT ++ has a modular structure. Figure 1 is the high-level architecture of OMNeT ++ simulation (the arrows indicate the interaction between the two components).
Figure 1 OMNeT ++ simulation program architecture
Among them, Sim is an embedded simulation kernel, which is the core of processing and running simulation. When an event occurs, the simulation kernel calls the module in the execution model. Between Sim and the user interface CMDENV or TKENV is a universal interface ENVIR, the user can define the running environment of the simulation by replacing the user interface. The model component library contains all the compiled simple modules and compound modules. The simulation model contains some commonly used network protocols, applications and communication models.
The design of wireless sensor networks needs to consider the effects of energy efficiency, fault tolerance, synchronization, quality of service, scheduling methods, system topology, etc. Therefore, network simulators such as NS-2 have limitations for the simulation of wireless sensor networks. OMNeT ++ is a simulation suitable for teaching wireless sensor networks. First of all, the user interface of OMNeT ++ is used to realize the human-computer interaction of the simulation program. OMNeT ++ provides a powerful and complete graphical user interface, with three output tools: module output window, monitor and automatic animation generation, which can dynamically observe the operation of the simulation program , And the memory consumption is small and fast. Allows the internal mechanism of the model to be visualized to the user, also allows the user to start and stop the simulation, and change the variables inside the model. Users can test and debug simulation programs under a powerful graphical user interface, and finally can run in a simple and fast user interface, and the interface supports batch processing. Secondly, as an open source software, all source codes of OMNeT ++ are publicly available, anyone can obtain, use and modify their source codes, so it is very flexible to use OMNeT ++ to build a special wireless sensor network simulation experiment teaching environment.
1.2 Working principle of OMNeT ++
OMNeT ++ simulation has to go through three stages: model establishment, simulation implementation and result analysis. OMNeT ++ uses a hybrid modeling method, and uses OMNeT ++ 's unique Network Discription (NED) language and C ++ for modeling. NED is a modular network description language, including a large number of component descriptions, such as channels, simple and composite module types. NED can also realize dynamic loading, which is convenient for updating the topology of the simulation model. C ++ is used to implement functions such as model simulation and message processing, and the NED file can be compiled into C ++ code and connected to the simulation program.
The message transmission in OMNeT ++ is mainly completed by simple modules. There are two methods of message transmission: port transmission and direct transmission. Port transmission is through the ports and connections between modules, according to certain rules, the message is gradually transmitted to the destination module. Direct transmission directly transmits messages to the destination module through the emulation kernel. Through this set of mechanisms, you can flexibly use several basic classes defined by C ++ or OMNeT ++ itself, and you can implement simulation of almost all current network models.
1.3 Output of simulation results
OMNeT ++ provides two user interfaces: TKENV and CMDENV. TKENV is the GUI (Graphical User Interface) user interface of OMNeT ++, and CMDENV is a pure command line interface. Testing and debugging of the simulation can be carried out under the TKENV interface. TKENV is a simple and easy-to-use graphical windowed user interface. TKENV supports the functions of tracking, debugging and executing simulation. It can provide detailed status information at any time during the execution of the simulation. The main features of TKENV are: each module's text output has its own independent window. During the simulation process, you can see autobiographical messages in the TKENV window, support simulation animation, mark breakpoints, and have an inspection window to check and change variables in the model , Graphical display of the simulation results during execution and the results can be displayed with histograms and time series graphs. The simulation can be repeated, and snapshot files are used to display detailed information about the model.
2 Simulation example
Because the OMNeT ++ software is an English version, it has a certain complexity when used, so in classroom teaching and experimental practice, the teacher first demonstrates and explains the wireless sensor network channel, topology and protocol through several specific examples, so that students can Understand the theoretical knowledge in the textbook intuitively and vividly. Then deepen it further and consider guiding students to program independently.
The application of OMNeT ++ in wireless sensor network experimental teaching (under Windows XP and OMNeT ++ 4.0 environment) is illustrated by the implementation of the classic routing protocol LEACH (Low Energy Adaptive Clustering Hierarchy) algorithm in wireless sensor networks.
2.1 Simulation scenarios and topology
The LEACH algorithm is an adaptive clustering topology algorithm. Its execution process is periodic. Each round is divided into a cluster establishment phase and a stable data communication phase. Using OMNeT ++ to simulate the module diagram of LEACH algorithm (as shown in Figure 2), the sensor node is composed of 4 modules, sm_application is mainly the application layer module program, sm_cordinator module is a coordination module, coordinating the work of each part of the module, sm_layer0 module is responsible The transmission of data packets between nodes and the selection of routes, the sm_energy module is an energy module.
Figure 2 OMNeT ++ simulation module diagram
The process of OMNeT ++ modeling is shown in Figure 3.
Figure 3 OMNeT ++ modeling flow chart
The topology of the wireless sensor network generated by OMNeT ++ is shown in Figure 4.
Figure 4 Topology diagram of wireless sensor network
2.2 Simulation results
The result demonstration diagram (shown in Figure 5) explains: the large black solid circle node identifies the Sink node, the star-shaped hollow node identifies the ordinary source node, the small black solid circle node identifies the cluster head node, and the source nodes pass random cluster heads The election mechanism selects the cluster head node, and then the cluster head node directly transmits the collected data to the sink node.
Figure 5 LEACH algorithm result demonstration diagram
3 Conclusion
Using OMNeT ++ software to introduce simulation teaching in wireless sensor network course teaching can realize network topology simulation, protocol simulation and traffic simulation and simulate the process of network traffic transmission and exchange in the actual network. OMNET ++ can simulate most of the principles and protocols in the wireless sensor network course. By demonstrating to students in classroom teaching, the classroom teaching atmosphere is active and the teaching effect is good. Students agree that using OMNET ++ to learn wireless sensor networks is no longer boring, and at the same time it has a deeper understanding of principles and protocols. In the next step, we will consider guiding students to self-program, introduce some students with excellent grades to the tutor's subject as soon as possible, and engage in the research of network technology subject. Only by combining theoretical demonstration teaching with practical links in teaching, with complementary advantages and mutual penetration, can we better help students understand and master knowledge, cultivate students' innovative spirit and comprehensive practical ability, and cultivate high-level Internet of Things technology Talent.
references
[1] Wang Fubao, Shi Long, Ren Fengyuan. Self-localization system and algorithm in wireless sensor networks [J]. Journal of Software, 2005, 16 (5): 857 ~ 868
[2] Chen Ming, Wang Suozhu. The emergence and development of Internet of Things [J]. Computer Education, 2010, 12: 1-3
[3] Zhu Xiaoshu. Research and application of OMNeT ++ simulation tool [J]. Journal of Dalian University of Technology, 2010, 29 (1): 62 ~ 65
GlazeKing Ceramics TechnologyCo.,Ltd. , http://www.maglazekingceramics.com