Emulation Set-up
The set-up to run emulation would be to have a minimum of three (3) PC’s. One would be the real source, the second would run NetSim emulation server, and the third would be the real destination.
Prerequisite for NetSim Emulation: Enabling IP routing in windows.
IP Routing is the process that allows data to cross over a network of computers rather than just one. Routing is often disabled by default in Windows, to check whether IP routing enabled or not.
Open Command Prompt (cmd.exe) type ipconfig /all. It will show if IP Routing Enabled: YesNo. If IP Routing Enabled is set to No we may have to manually enable IP routing as shown Figure-1.
Figure-1: IP Routing Enabled
Steps to enable IP routing in windows:
Open the start menu, and type REGEDIT32.EXE into the search box. Hit enter. You can also click on "Run" and type REGEDIT to open it.
Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRouter setting
Right click and select Modify. Change 0 to 1 and click OK then exit the editor as shown below Figure-2.
Figure-2: IP Enable Router value is set to 1
Restart the system and check if IP Enabled Router is set to Yes by using the command ipconfig /all
Setting up the NetSim Server
NOTE: Never use NetSim License server as Source or destination for emulation application. Also, if the license server is running on Virtual Machine (VM) than any VM on that physical system cannot be used as source or destination. If used, this will lead to license check out problems in the license server.
Run NetSim in Administrative Mode (Right Click on NetSim.exe Run as Administrator).
User has to open any Stack based Network (Any network except Legacy Networks and Cellular Network) in NetSim with Emulation.
Create a network scenario of your choice (refer application examples provided) and set the Application properties as shown below Figure-3.
Figure-3: Application properties window
In the Application Properties, set Application Type as “EMULATION”. Assign real Source IP address and Destination IP address in the respective fields. Then Click OK.
Set the Simulation Time as how long you want to perform the Emulation in Real World. Do not run the simulation until setting up Emulation in the Client system.
NOTE: If the Emulation Server is located in a different subnet from clients
User has to configure the router settings of the real-world network so as to allow the packets to be transmitted to the Emulation Server.
For Example, if we consider a sample real world network scenario where the Emulation clients and server are located in different subnets as shown Figure-4.
Figure-4: Emulation Server is located in a different subnet from clients
Routing table of router 3 needs to be configured such that any packet having Source Address as IP Address of Node 6(Client Source) and Destination Address as IP Address of Node 8(Client Destination) must be routed to Emulation Server. NetSim configuration will ensure that the packet is re-injected with destination set to the appropriate IP Address (set in the application properties)
Setting up the Client systems (Real Source and Destination system)
The client systems which are sources of real traffic can be connected to NetSim emulator by resetting the gateway. NetSim Emulator supports both Windows and Linux clients. Once the gateway for the client system is set as the NetSim Emulator PC then traffic from the clients will go via NetSim Emulator PC. The steps involved in configuring the gateway will vary based on the operating system used.
Configuring Windows clients
The following steps can be used to configure the gateway IP address in systems running windows operating system.
Open command prompt in administrative mode as shown Figure-5.
Figure-5: Run Command prompt in administrative mode
Type command, route delete <Network Address>
Then press Enter key. You will get “OK”. For example, if your IP address is 192.168.0.4 and the subnet mask is 255.255.255.0 then the network address is 192.168.0.0 (Got by performing a bitwise AND of the IP Address and the subnet mask)
Type command
route add <Network Address>mask 255.255.255.0 <IP Address where NetSim Emulation server is running> metric 1
Here the subnet mask is taken as 255.255.255.0). After execution, you will get “OK”.
Type command
netstat –r
To check if the IP configuration is done or not.
Figure-6: Route Table
Note that in the above screenshot, for the network 192.168.0.0, the gateway address assigned is 192.168.0.87(Address of the system where NetSim Emulation Server is running).
Configuring Linux clients running RHEL 7
Go to the Wired Settings option in the Network Adapter Icon.
Figure-7: Wired Settings option in the Network Adapter Icon
In the IPV4 settings, set static IP Address to the machine and specify the Emulation Server IP as the Gateway IP.
Figure-8: Set static IP Address to the machine and specify the Emulation Server IP as the Gateway IP
Example: If 192.168.0.141 is the IP of the system where Emulation Server is running. This is specified as the gateway IP.
Figure-9: Setting up Gateway to Emulation Server IP:192.168.0.141
Turn off Automatic DNS.
Figure-10: Turn off Automatic DNS
Turn off and on the Network Adapter
Figure-11: Turn off Network Adapter
Figure-12: Turn ON Network Adapter
Open terminal window
Type command
sudo su
This is to switch to root user.
Enter the root password
Type command
ip route
This is to check the default route
It will now show the default via <Emulation server IP>
Figure-13: Default route
Type command
ip route del <Network Address>
Figure-14: ip route del 192.168.0.0/24
Example:
ip route del 192.168.0.0/24
Type command
ip route
This is to check if the IP configuration is done.
Figure-15: IP configuration is done
Configuring Linux clients running Ubuntu
In Ubuntu Environment, if you want to set NetSim Emulator as the gateway, you can use command line tool in your client systems such as
ip command – show / manipulate routing, devices, policy routing and tunnels.
route command – show / manipulate the IP routing table.
Save routing information to a configuration file so that after reboot you get same default gateway.
Any of the following methods can be used for this purpose:
In this example we have considered the NetSim Emulator IP address as 10.244.1.55
ip command to set a default router to 10.244.1.55
Login as the root and type:
# ip route add default via 10.244.1.55
OR
$ sudo ip route add default via 10.244.1.55
route command to set a default router to 10.244.1.55
Login as the root and type:
# route add default gw 10.244.1.55
OR
$ sudo route add default gw 10.244.1.55
Save routing information to a configuration file /etc/network/interfaces
Open /etc/network/interfaces file
# vi /etc/network/interfaces
OR
$ sudo vi /etc/network/interfaces
Find eth0 or desired network interface and add following option
gateway 10.244.1.55
Save and close the file. Restart networking:
# /etc/init.d/networking restart
OR
$ sudo /etc/init.d/networking restart
After setting static routes through NetSim Emulator, you can use 'traceroute <destination ip>' command in the client systems to check if the packets are sent via the NetSim emulator.
Configuring Raspberry Pi clients
Open Raspberry PI terminal and apply “sudo su”
Apply “nano /etc/sysctl.conf” command and edit the file by adding the following comment
net.ipv4.ip_forward=1
To save and Exit
[Ctrl] + X, then chose yes or no
Apply “nano /etc/sysctl” command
Then add the following comments
IP_DYNIP=”no”
IP_TCP_SYNCOOKIES=”yes”
IP_FORWARD=”yes”
Follow step 3
Figure-16: IP configuration is done
Apply “nano /etc/dhcpcd.conf”
change the ”static routers” to NetSim Server IP as shown in the below image
Apply “route” command
Figure-17: Route Print
Apply “ip r del <network ip>/24”
Figure-18: ip r del 192.168.0.0/24
Example: ip r del 192.168.0.0/24
Apply “ping <any ip within the network>”. Example: ping 192.168.0.202
Figure-19: Pinging to 192.168.0.202
Setting up the network for client systems communicating across the network
Devices communicating across networks can be connected to NetSim Emulator. This is achieved by connecting the system running NetSim to the routers which connect to the client machines taking part in communication.
System Configuration
Connecting devices across network to NetSim emulator involves configurations at the router and in the NetSim Emulator system. There is no configuration required in the client systems communicating across the network, unlike the case of emulation within the same network.
The System running NetSim Emulator will require two or more Network Interface Cards (NICs) to connect to different networks.
Static routes should be set to route packets to specific Network Interfaces as they come in.
Static routes should be set for routing any external network traffic to the interface that connects to NetSim emulator.
Consider the network shown in the figure below Figure-20.
Figure-20: LAB Setup
PC 1 and PC 2 are connected to Router 1 and Router 2 respectively. NetSim Emulation PC connects to Router 1 in one of its interface and Router 2 in the other.
To send packets exchanged between PC1 and PC2 via NetSim Emulator, following settings are to be done:
Router 1
Route is added to send any packet to PC 2(192.168.4.2), to NetSim Emulator interface that is connected to it. (Interface with IP 192.168.1.2)
Router 2
Route is added to send any packet to PC 1(192.168.2.2), to NetSim Emulator interface that is connected to it. (Interface with IP 192.168.3.2)
NetSim Emulator
Route is added to send any packet to PC1(192.168.2.2), to its first interface (192.168.1.2)
Route is added to send any packet to PC2(192.168.4.2), to its second interface (192.168.3.2)
After performing the above settings, packets from PC 1 to PC 2 will take the following route:
PC 1 -> NetSim Emulator Interface 1 -> NetSim Emulator Interface 2 -> PC 2
And vice versa for packets from PC 2 to PC 1.
Setting up the network for Database PostgreSQL Emulation
Devices running Database Management Systems such as PostgreSQL can be connected to NetSim Emulator. This is achieved by connecting the systems running the database server, the database web client and the system running NetSim Emulator to a switch.
System Configuration
Connecting devices involved in database application to NetSim emulator involves configurations at both the systems that run the database server and the web client.
Static routes should be set to route all outgoing packets to the system running NetSim Emulator.
Consider the network shown in the figure below Figure-21.
Figure-21: PgAdmin web client and server with NetSim Emulator to switch
System 1, System 2 and System 3 are connected to a L2 switch and are part of the same network.
To send packets exchanged between System 1 and System 2 via System 3(NetSim Emulator), following settings are to be done:
System 1
Route is added to send any packet to System 2(192.168.0.154), to NetSim Emulator interface that is connected to it. (Interface with IP 192.168.0.22)
System 2
Route is added to send any packet to System 1(192.168.0.21), to NetSim Emulator interface that is connected to it. (Interface with IP 192.168.0.22)
After performing the above settings, packets from PC 1 to PC 2 will take the following route:
System 1 (PgAdmin Server) -> System 3 (NetSim Emulator) -> System 2 (PgAdmin WebClient)
And vice versa for packets from System 2 to System 1.
Steps to Start generating Network Traffic
Start PgAdmin application in System 1 and create a database with 100000 Records in it.
Now open PgAdmin application in System 2 and connect to the database created in System 1. In the example shown below, we are attempting to retrieve the records from a large csv file.
Figure-22: PgAdmin application in System 2
Steps to configure application for NetSim Emulation
Once the database connection is established, In System 3, create a simple scenario in internetworks as shown below:
Figure-23: Network Topology
Configure an Emulation Application from Wired Node 2 to Wired Node 3 as shown below:
Figure-24: Application properties window for Application 1
Configure an Emulation Application from Wired Node 3 to Wired Node 2 as shown below:
Figure-25: Application properties window for Application 2
The above settings will ensure that packets from System 1 to System 2 and vice versa will be sent via NetSim Emulator.
Results and Analysis
Start Simulation in NetSim
Perform any query on the database while NetSim simulation is running.
Analyse the impact of flow of the packets through the network designed in NetSim based on the time taken for the query response.
The pcap log files such as All Network Packets Capture, Dispatched to Emulator, Reinjected from Emulator, Not Dispatched to Emulator that are accessible from the NetSim results dashboard after the simulation is over, can be used for further analysis.
Setting up the network for GeoServer Application Emulation
Devices running Database Management Systems such as PostgreSQL can be connected to NetSim Emulator. This is achieved by connecting the systems running the database server, the database web client and the system running NetSim Emulator to a switch.
System Configuration
Connecting devices involved in database application to NetSim emulator involves configurations at both the systems that run the database server and the web client.
Static routes should be set to route all outgoing packets to the system running NetSim Emulator.
Consider the network shown in the figure below Figure-26.
Figure-26: Geo web client and server applications and server with NetSim Emulator to switch
System 1, System 2 and System 3 are connected to a L2 switch and are part of the same network.
To send packets exchanged between System 1 and System 2 via System 3(NetSim Emulator), following settings are to be done:
System 1
Route is added to send any packet to System 2(192.168.0.154), to NetSim Emulator interface that is connected to it. (Interface with IP 192.168.0.22)
System 2
Route is added to send any packet to System 1(192.168.0.21), to NetSim Emulator interface that is connected to it. (Interface with IP 192.168.0.22)
After performing the above settings, packets from PC 1 to PC 2 will take the following route:
System 1 (Geo Server) -> System 3 (NetSim Emulator) -> System 2 (Geo WebClient)
And vice versa for packets from System 2 to System 1.
Steps to Start generating Network Traffic
Start GeoServer application in System 1
Now access GeoServer via web browser in System 2 by specifying IP address: GeoServerPort//Geoserver/browser. Eg:192.168.0.21:2020/Geoserver/browser
Figure-27: GeoServer application in System 2
Steps to configure application for NetSim Emulation
Once the database connection is established, In System 3, create a simple scenario in internetworks as shown below Figure-28.
Figure-28: Network Topology
Configure an Emulation Application from Wired Node 2 to Wired Node 3 as shown below:
Figure-29: Application properties window for Application 1
Configure an Emulation Application from Wired Node 3 to Wired Node 2 as shown below:
Figure-30: Application properties window for Application 2
The above settings will ensure that packets from System 1 to System 2 and vice versa will be sent via NetSim Emulator.
Results and Analysis
Start Simulation in NetSim
Try to access specific regions of the map by zooming in and other operations to generate live network traffic.
Analyse the impact of flow of the packets through the network designed in NetSim based on the time taken for the map to load.
The pcap log files such as All Network Packets Capture, Dispatched to Emulator, Reinjected from Emulator, Not Dispatched to Emulator that are accessible from the NetSim results dashboard after the simulation is over, can be used for further analysis.
Note: The Wireshark pcap log files generated as part of emulation will not be saved when the scenario is saved. Users can save these files manually if required.
Setting multiple Virtual Machines (VM) to act as Nodes for Emulation
VMs sharing the same network as the host
A computer on which one or more virtual machines are running is defined as a Host Machine. Each virtual machine is called a Guest Machine. In this scenario, we have 3 VMs running in a Host Machine – VM1, VM2 and VM3. Users can run NetSim License server in any system connected to the network in which Host Machine is running.
Figure-31: Multiple Virtual Machines (VM)
Now right click on each VM and select Settings. Click on Network Adapter, and select “Bridged: Connected directly to the physical network”. Also enable the “Replicate Physical network connection state”.
Figure-32: Multiple Virtual Machines setting window
An advantage of this technique is that, if the license server is running in another system, connected to the same network as the original host, then NetSim running in the VM can obtain the licenses.
VMs sharing a network but insulated from the host network
A computer on which one or more virtual machines are running is defined as a Host Machine. Each virtual machine is called a Guest Machine. In this scenario, we have 3 VMs running in a Host Machine – VM1, VM2 and VM3. NetSim License server is running in one of these 3 VMs.
Figure-33: NetSim License server is running in one VM
If user needs to create an internal network which is segregated from host network, follow the steps
Right click on each VM and select Settings.
Click on Network Adapter, and select “Custom: Specific Virtual network”
Select “VMnet8 (NAT)”
Figure-34: Select Specific Virtual network to VMnet8 (NAT)
By default, a network address is assigned to this segregated network by VMware. To configure this IP address, go to EDIT 🡪 Virtual Network Editor
Figure-35: Select option to Virtual Network Editor in VM
Figure-36: Modify the Subnet IP and Subnet Mask in Virtual Network Editor
User can modify the Subnet IP and Subnet Mask to suit their own preference.
The disadvantage of this technique is that, if the license server must compulsorily run in the VM for NetSim to obtain the licenses.
NetSim Emulator interfacing with Kubernetes Clients
Objective: Kubernetes Client running on the docker generates application traffic destined for Kubernetes Client. This traffic is sent through NetSim Emulator in which an equivalent virtual network is created. Thereby test the performance of your real application when transported over the virtual network.
Installation
For installation and running Kubernetes and Docker on Windows please refer
https://www.youtube.com/watch?v=cgYOpw5XLtk
Traffic flow diagram
Figure-37: Traffic flow diagram
Lab Setup
3 Systems
Kubernetes Clients
Pods IP Address: 10.10.10.1
Host IP Address: 192.168.0.100
Kubernetes Server
Pods IP Address: 10.10.10.2
Host IP Address: 192.168.0.102
NetSim Emulation server (IP Address: 192.168.0.101)
Kubernetes Client/server applications running on respective system. They be any application. In this example, we run the jperf application on client and server.
Static routing in the lab setup.
CLIENT POD:
Run CLI docker in administrator mode and add a route to Server Pod. This must be in such way that the traffic generated from the Client Pod must flow through the Emulation server.
Command Windows: route add 10.10.10.2 MASK 255.255.255.255 192.168.0.101 METRIC 1
SERVER POD:
Run CLI docker in administrator mode and add a route to Client Pod. This must be in such way that the traffic generated from the Server Pod must flow through the Emulation server.
Command Windows: route add 10.10.10.1 MASK 255.255.255.255 192.168.0.101 METRIC 1
Steps to configure the application for NetSim Emulation.
Once the Client Pod and Server Pod connection is established, In NetSim Emulation server, create a simple scenario in internetworks as shown below Figure-38.
Figure-38: An example network topology with 2 nodes mapped to a Kubernetes client and a server. Note that the virtual network topology can have any number (typically < 500) of nodes. And can be mapped to any number of external devices.
Configure an Emulation Application from Wired Node 1 to Wired Node 2 as shown below:
Figure-39: Application properties window for Application 1
The above settings will ensure that packets from System 1 to System 2 and vice versa will be sent via NetSim Emulator.
Results and Analysis
Start Simulation in NetSim
Analyze the impact of the flow of the packets through the virtual network designed in NetSim
The pcap log files such as All Network Packets Capture, Dispatched to Emulator, Reinjected from Emulator, Not Dispatched to Emulator that are accessible from the NetSim results dashboard after the simulation is over, can be used for further analysis.