0% found this document useful (0 votes)
18 views

CN lab report 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

CN lab report 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

(LAB:1)

Title:Implementing a Simple Network of 3 Nodes using


Omnet++ Simulator.

1.Introduction:
Project Description:
This project demonstrates the implementation of a basic network
topology using the Omnet++ network simulator. The network
consists of three interconnected nodes, forming a simple circular
topology. Each node will transmit and receive data packets,
simulating basic network communication.

2. Network Description:
Step 1: Adding NED File:
Network Description:
The network, named "lab1net_09," consists of three identical
nodes labeled "A," "B," and "C." Each node is an instance of the
"lab1node_09" compound module. The nodes are interconnected
in a circular fashion:

 Node A sends data to Node B.


 Node B sends data to Node C.
 Node C sends data to Node A.

NED File (lab1.ned):


network lab1net_09{ submodules: A : lab1node_09; B :
lab1node_09; C : lab1node_09; connections: A.out --> B.in; B.out
--> C.in; C.out --> A.in; } module lab1node_09{ gates: input in;
output out; }

Screenshot of NED File: (Source Code and Design):


Source Code:
Design:

Step 2: The Source File/C++ files:


Description:
The "lab1node_09.cc" file defines the behavior of the individual
nodes in the network. It includes:

 Declaration of the "lab1node_09" class, derived from the


"cSimpleModule" class.
 Initialization of the input and output gates.
 Overriding the "initialize()" function to set up the simulation.
 Overriding the "handleMessage()" function to handle
incoming packets.
 Sending out packets at regular intervals.

Screenshot Source Code:

Step 3: Adding omnetpp.ini

Description:
The "omnetpp.ini" file contains configuration parameters for the
simulation. It specifies:

 The network to simulate ("network = lab1net_09").


 The number of runs ("repeat = 1").
 Simulation parameters for the nodes, such as the delay
between packet transmissions ("**.lab1node_09.sendInterval
= 0.1").

[General] network = lab1net_09 repeat = 1


**.lab1node_09.sendInterval = 0.1

Screenshot omnetpp.ini code:

Step 4: Build and Run


Building and Running the Simulation:

1. Open the Omnet++ IDE and import the project folder.


2. Build the project by clicking "Build" in the IDE menu.
3. Run the simulation by clicking "Run" in the IDE menu.

3. Result Analysis:
Description and Screenshot of Output and Elog File:
The "Output" file displays simulation-related information,
including:

 Simulation start and end times.


 Messages sent and received by each node.
 Simulation statistics.

The "Elog" file contains error messages and warnings that


occurred during the simulation.\

4. Conclusion
This project successfully implemented a simple network topology
using the Omnet++ simulator. The project demonstrated the
creation of network models, defining node behavior through C++
code, configuring simulation parameters, and interpreting the
simulation results. This simple example serves as a foundation for
building more complex and realistic network simulations.

You might also like