Creating a network topology

76 views 8:58 am 0 Comments March 20, 2023

Simulating a Network Using Mininet and Analyzing Packets Using Wireshark Guide

 

 

Introduction

Mininet requires a Linux operating system to be installed. If you are using Windows, you can run Linux in a virtual computer.

Open a terminal and enter the following commands to install Mininet:

sudo apt-get update

sudo apt-get install mininet

 

Creating a network topology:

To begin, open a terminal and enter the following command:

sudo mn –topo [topology] –controller [controller]

[topology] should be replaced with the desired topology (e.g., single, linear, tree) and [controller] with the chosen controller (e.g. ovs, remote, none).

Once the network has been established, use the pingall command to test connection between hosts.

 

Capturing packets with Wireshark:

Launch Wireshark and choose the interface from which you want to capture packets. Select lo if you are running Wireshark on the same system as Mininet (loopback).

Begin the packet capture and conduct network activities (e.g. pinging between hosts).

Stop the capture and examine the collected packets.

 

Packet analysis:

Filter packets using Wireshark’s filter function depending on different criteria (e.g., protocol, source/destination IP address).

To study packet statistics, use Wireshark’s statistics tool (e.g. round-trip time, packet loss).

 

Step -1 Launch Instance

  • Navigate to the EC2 dashboard after logging into your AWS interface.
  • To begin the instance launch wizard, click the “Launch Instance” button.
  • For your instance, choose an Amazon Machine Image (AMI). You can select from a variety of operating systems and software packages.
  • Based on your requirements, select an instance type (e.g. CPU, memory, network performance).
  • Configure instance parameters such as the number of instances, network settings, and storage.
  • For your instance, create a security group. A security group serves as a virtual firewall, controlling traffic to and from your instance. Click “Create a new security group” and configure the security group options, such as protocol, port range, and source IP address.
  • Make any required adjustments to your instance launch setup.
  • Start the instance and wait for it to boot up. Once the instance is up and running, you may connect to it via SSH or RDP, depending on your operating system.

 

 

Step -2 Review and Launch Instance

Examine the instance settings, such as the instance ID, type, public IP address, and security group. This information is available via the EC2 dashboard or by choosing the instance from the list and clicking on the “Description” page.

 

 

Step -3 Connect and checking Instance

  • Navigate to the EC2 dashboard after logging into your AWS interface.
  • Select the instance to which you wish to connect and ensure that it has a public IP address.
  • Launch a terminal on your local PC and go to the directory containing your private key. The private key is a.pem file that you downloaded when you began your instance.
  • Use the following command to change the permissions of your private key file:

chmod 400 you-private-key.pem

Your-private-key.pem should be replaced with the name of your private key file.

  • Connect to your instance with the SSH command as follows:

ssh -i your-private-key.pem user@public-ip

  • Replace your-private-key.pem with the name of your private key file, user with your instance’s username (e.g., ubuntu, ec2-user, admin), and public-ip with your instance’s public IP address.
  • If you are connecting to the instance for the first time, you may be prompted to add the instance’s public key to your list of known hosts. To proceed, type “yes”.
  • You should now be connected to your EC2 instance and have command-line access.

 

 

 

 

Ubuntu System Screenshot

Connect using RDP

 

 

  • On your Windows machine, launch the Remote Desktop Connection (RDC) app. You can find it in the Start menu or by pressing the Windows key + R and typing “mstsc” into the Run dialogue.
  • To expand the settings in the RDC app, click the “Show Options” button.
  • In the “Computer” field, enter the public IP address of your EC2 instance.
  • To access the advanced settings, click the “Advanced” button.
  • Click the “Settings” button under “Connect from anywhere” in the “Advanced” tab.
  • Check the “Use these RD Gateway server settings” box and enter the following information in the “Gateway Settings” dialogue:

Server name: ec2-<public-ip>.compute-1.amazonaws.com

Logon method: “Ask for password”

 

  • Close the “Gateway Settings” dialogue by clicking “OK,” then close the “Advanced” tab by clicking “OK” again.
  • Enter your EC2 instance’s username and password in the “General” tab. For Windows instances, the default username is “Administrator” with a blank password.
  • To begin the RDP session, click the “Connect” button. You may be prompted to accept the security certificate for the EC2 instance. To proceed, press the “Yes” button.
  • You should now be able to access your EC2 instance and the Windows desktop.

 

 

Connect with other machine and open wireshark to check for packets.