0% found this document useful (0 votes)
34 views7 pages

Network Report 2

The document presents a Network Simulator designed to aid learners and professionals in understanding networking concepts through an intuitive graphical interface. It allows users to manage devices, establish connections, and simulate message exchanges, addressing usability issues found in existing simulators. The report also discusses challenges faced during development and proposed solutions to enhance the simulator's functionality.

Uploaded by

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

Network Report 2

The document presents a Network Simulator designed to aid learners and professionals in understanding networking concepts through an intuitive graphical interface. It allows users to manage devices, establish connections, and simulate message exchanges, addressing usability issues found in existing simulators. The report also discusses challenges faced during development and proposed solutions to enhance the simulator's functionality.

Uploaded by

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

DEVELOPMENT OF A NETWORK SIMULATOR FOR VISUALIZING

AND MANAGING NETWORK DEVICES

BY:
Haneen Khaled Ebrahim
231027213

Youssef Adel
231027101

Mahmoud Ali Eissa


231017617

Prepared for:
Dr. Mahmoud Safwat
Dr. Ramy Saeed
INTRODUCTION
In the modern era, computer networking has become an integral part of almost every industry.
Professionals, students, and researchers alike need tools that help them understand and simulate
networking concepts effec vely. A network simulator provides an interac ve and cost-efficient
environment to visualize and experiment with network topologies, device configura ons, and
connec vity scenarios. However, most exis ng simulators are either too complex, not customizable, or
lack intui ve user interfaces for beginners.

This report presents a Network Simulator designed to meet these needs. It aims to assist learners and
networking professionals in understanding fundamental networking concepts, such as device
management, IP addressing, subne ng, and connec on handling, all within an intui ve graphical
environment.

LITERATURE SURVEY
The field of network simula on has been well-explored in various research studies and prac cal
applica ons. Several network simula on tools have been developed to meet different needs. Commonly
used simulators include:

1. Cisco Packet Tracer: It provides a graphical interface to create and simulate network topologies
but is o en complex for beginners and restricted to Cisco devices.

2. GNS3 (Graphical Network Simulator-3): A It is widely used by professionals but can be


challenging for beginners due to its complexity and resource demands.

3. NS3 (Network Simulator 3): It is used for research and academic purposes.

While these tools are well-established, they o en suffer from usability issues for beginners or
lack the flexibility to simulate simpler network environments interac vely. Our proposed
simulator seeks to fill this gap by offering a user-friendly, flexible solu on for visualizing and
managing basic network topologies.

THE PROPOSED NETWORK ENVIRONMENT


The Network Simulator is a Python-based graphical applica on built using the Tkinter library for the GUI
and the Pillow (PIL) library for image rendering. The tool simulates basic network devices, including
Routers, Switches, and PCs. Users can add, configure, and connect devices, visualize network topologies,
and simulate the exchange of messages between PCs.
KEY FEATURES:
• Device Management: The simulator allows users to add three types of devices: Routers, Switches, and
PCs, with basic configura ons like IP addresses and subnet masks.

• Network Connec ons: Users can establish connec ons between devices by selec ng two devices and
drawing a connec on between them, simula ng network links.

• Graphical Interface: A canvas displays network devices as images, with draggable devices and editable
se ngs.

• Message Simula on: The tool supports simula ng messages between connected PCs, with logic that
checks if the devices are in the same network and connected appropriately.

SOURCE CODE:
1. Imports:
• tkinter (aliased as tk): For the GUI frame

• copy :For crea ng shallow and deep copies of objects.

• PIL (Pillow library): For image handling (resizing device icons).


• networkx as nx : For crea ng and manipula ng graphs.
• numpy : For numerical opera ons and handling arrays.
• os : For interac ng with the opera ng system.
• re: For working with regular expressions (pa ern matching).
2. NetworkSimulator Class:
Ini aliza on (__init__ method):

• Sets up the main window (self.root), canvas for drawing network devices, and bu ons for user
interac on.
• Ini alizes a dic onary self.devices to store devices with their details (ID, type, posi on,
se ngs, connec ons).
• Ini alizes a list self.connec ons to store network connec ons between devices. • Loads device
images (router, switch, PC) for display on the canvas.

DEVICE MANAGEMENT:
• add_router(), add_switch(), add_pc(): Functions that allow adding specific types of devices
(routers, switches, PCs) to the simulation.

• add_device():A helper function that adds any device (router, switch, or PC) by generating a
random position for it on the canvas and assigning a unique device ID.
 draw_device():Draws a device on the canvas at a given position, using an icon to represent
the device.

 get_random_position():Generates a random posi on for devices on the canvas to be placed.

DEVICE INTERACTION:
 start_connec on(): Ac vates connec on mode, allowing users to click two devices to form a network
connec on.

 n_click(): Handles clicks on devices: In connection mode, it allows pairing devices.

 on_double_click(): Opens the settings window for configuring the selected device.

  on_drag(): Moves a device across the canvas as the user drags it.

 highlight_device(): Highlights a selected device, indicating it can be moved or connected.

 create_connection(): Creates a network connection (draws a line) between two devices on the
canvas.

 move_device(): Moves a device to a new location on the canvas and updates its network
connections.

SETTINGS AND CONNECTIONS:


open_settings_window(): This function will open a window where users can
modify device configurations, such as IP address, subnet mask, etc.

. save_settings(): Saves any changes made to the device settings.

. can_connect(): Determines whether a device can establish new connections


based on its type (PC, Switch, Router).

. are_connected(): Checks if two devices can communicate based on their


connection and subnet settings.

MESSAGE SENDING:
 open_message_window: This will open a new window to simulate sending a message
between two devices by entering the sender and receiver's IP addresses.
 send_message_action: This will check if both devices are on the same network or connected
through the same gateway. If they are, the message will be sent successfully; otherwise, an error
message will be displayed.

SUBNET AND IP HANDLING:


 p_to_bin(): Converts an IP to binary format.
 mask_to_bin(): Converts a subnet mask to binary.
 get_network_address(): Calculates the network address from an IP and subnet mask.

 check_same_subnet(): Checks if two devices are in the same subnet.

MAIN PROGRAM:
creates a Tkinter root window and runs the event loop, enabling user interaction. It allows device
selection, configuration, and message sending simulation. The program uses NetworkX for
network management and displays devices on a canvas in the GUI.

REQUIRED LIBRARIES:
• tkinter Official Documenta on

• Pillow (PIL) Documenta on

NETWORK TOPOLOGY:
The network environment simulates simple topologies, where the user can: 1. Add devices (Router,
Switch, PC) to the canvas.

2. Connect devices to each other, establishing network links.

3. Visualize connec ons and device configura ons on the canvas.

RESULTS AND DISCUSSION


Results; the Network Simulator successfully allows users to:

• Add Devices: Users can add routers, switches, and PCs to the network with basic configura on se ngs
such as IP addresses.
• Make Connec ons: Users can connect devices and visualize the network topology in real- me.

• Move Devices: Devices can be dragged around on the canvas, and the connec ons are updated
automa cally. • Simulate Messages: Although the messaging func onality is in its preliminary stages, it
provides basic checks to determine if two PCs can communicate based on their subnet.

DISCUSSION
The simulator offers a simple yet effec ve way for beginners to experiment with network devices and
connec vity. While it excels in ease of use and flexibility, it is limited by:

• Device Support: Only a basic set of devices (Router, Switch, and PC) is supported.

• Message Simula on: The message simula on feature is not fully implemented, and real-world
networking protocols are not yet simulated in depth.

Despite these limita ons, the simulator serves as a great tool for learning fundamental networking
concepts.

CHALLENGES AND PROPOSED SOLUTIONS


1. Mul ple Switches Between Devices:
• Problem: When two devices are connected via mul ple switches, there was an issue where
messages could be sent back to the port from which they originated.
• Solu on: The solu on was to prevent messages from being sent to the port that issued the
original message, ensuring that the communica on only flows through the intended network
path.
2. GUI Issues with Object Movement:
• Problem: The graphical user interface (GUI) ini ally had issues allowing devices (such as
routers and PCs) to be moved smoothly on the canvas.
• Solu on: This problem was resolved with assistance from gemini.google.com, which helped in
implemen ng a more intui ve drag-and-drop func onality, enabling smooth object movement
on the canvas.

3. PCs from Different Subnets Connec ng:


• Problem: The simulator previously allowed PCs from different subnets to connect, which was
unrealis c in a real-world networking scenario.
• Solu on: This issue was addressed by adding a check that verifies the IP address and subnet
mask of both the sender and receiver. If they are not in the same subnet, the connec on is not
allowed, ensuring more accurate network behavior.

CONCLUSION
This report provides a comprehensive analysis of the Network Simulator applica on, exploring its design,
func onality, and poten al for enhancing learning in the field of computer networking. The proposed
enhancements aim to improve the simulator's capabili es, making it a valuable tool for both educa onal
and professional use.

Sources:

• "Python GUI Programming with Tkinter" by Alan D. Moore.

• "Computer Networking: A Top-Down Approach" by Kurose and Ross.

• Online coding pla orms such as: § GeeksforGeeks § Real Python § Tutorialspoint

• Networking Concepts:

§ Concepts such as subnet masks and IP valida on are drawn from basic networking knowledge, o en
covered in resources like:

§ Networking tutorials on Cisco Networking Academy.

• Gemini

• ChatGpt

You might also like