Professional Documents
Culture Documents
M.TECH – WEEKEND
Session 2021
Computer Science & Engineering
Third Semester
MECS-773
Submitted To:
Dr. V P Vishwakarma
Submitted By:
Muskan
00916424821
1|Page
INDEX
Sno. Experiment Name
2|Page
Experiment – 1: Study of basic network command and Network configuration commands
(with all their options).
P.T.O.
3|Page
3) ipconfig /flushdns :- Flush Your DNS Resolver Cache Windows uses a cache that
remembers DNS responses it's received, saving time when you access the same
addresses again in the future. To ensure Windows is getting addresses from the new
DNS servers instead of using old, cached entries, run the ipconfig /flushdns command
after changing your DNS server.
• Syntax: - ipconfig/flushdns
• Output
4) ipconfig /all: - Displays the same IP addressing information for each adapter as the
default option. Additionally, it displays DNS and WINS settings for each adapter. WINS is
an abbreviation for Windows Internet Name Service and DNS stands for Domain Name
System. Displays the full TCP/IP configuration for all adapters. Adapters can represent
physical interfaces, such as installed network adapters, or logical interfaces, such as
dial-up connections.
• Syntax: - ipconfig/all
• Output
P.T.O.
4|Page
5) ipconfig /release:- To release the current IP configuration ipconfig /release is executed
to force the client to immediately give up its lease by sending the server a DHCP release
notification which updates the server's status information and marks the old client's IP
address as "available". Then, the command ipconfig /renew is executed to request a
new IP address.
• Syntax: - ipconfig/release
• Output
7) ping: - The ping command is used to verify that a device can communicate with another
on a network.
• Syntax: - ping google.co.in
• Output
5|Page
8) ping target address:- The ping command is used to verify that a device can
communicate with another on a network. Here we provide a Ip Address of a Device
within the Same Network.
• Syntax: - ping 192.168.x.x (Ip Address of the Other Device we want to ping with)
• Output
9) ping -n count: - count is the number of echo requests to send The switch sends a series
of Internet Control Message Protocol (ICMP) echo (ping) requests to a specified host
and receives ICMP echo responses.
• Syntax: - ping -n 6 google.co.in
• Output
P.T.O
6|Page
10) tracert: - Tracert is a command which can show you the path a packet of information
taken from your computer to one you specify. It will list all the routers it passes through
until it reaches its destination, or fails to and is discarded. In addition to this, it will tell
you how long each 'hop' from router to router takes.
• Syntax: - tracert google.co.in
• Output
11) netstat: - Display protocol statistics and current TCP/IP network connections. Displays
all connections and listening ports. Netstat Execute the netstat command alone to show
a relatively simple list of all active TCP connections which, for each one, will show the
local IP address (your computer), the foreign IP address (the other computer or
network device), along with their respective port numbers, as well as the TCP state.
• Syntax: - netstat
• Output
7|Page
12) netstat -a:- Proto, Local Address, Foreign Address, and State, Gives brief info about
them.
• Proto - defined the protocol type (TCP, UDP, etc..,) of the socket.
• Local Address - displays your computer IP address and port, local end of the
socket.
• Foreign Address - displays remote computer that your computer is connected
to, the remote end of the socket.
• State - defines the state of the socket (LISTENING. ESTABLISHED, CLOSE_WAIT,
TIME_WAIT).
• Syntax: - netstat -a
• Output
13) netstat | findstr ESTABLISHED: - To view all established connection from/to your
system.
• Syntax: - netstat | findstr ESTABLISHED
8|Page
• Output
9|Page
16) getmac:- Get the MAC details of the system.
• Syntax: - getmac
• Output
17) arp -a: - Displays and modifies the IP-to-Physical address translation tables used by
address resolution protocol (ARP).
• Syntax: - arp -a
• Output
10 | P a g e
19) nslookup: - Getting domain name from IP address is Reverse DNS.
• Syntax: - nslookup (Your desired Address)
• Output
20) route print: - It allows you to see your computers routing table.
• Syntax: - nslookup (Your desired Address)
• Output
11 | P a g e
Experiment – 2: - Configuration of Ip Addressing for a given set of topology.
12 | P a g e
Step 3 – Repeat the above Process to place as many PCs.
Step 4 – Now Select “Connections” and then click on “Automatically choose Connection Type”.
13 | P a g e
Step 6 – Double Click on a PC, a box will appear. After that click on “Desktop” Tab and then
select “IP configuration.”
Step 7 – Write the IP Address of your network and click at the subnet mask field. Subnet Mask
will appear automatically.
14 | P a g e
Step 8 – Repeat Step 6 & Step 7 to set the IPs for all the PC’s.
Fig A
Step 10 – We can also make use of the “Simulation Mode”. Once the Message is Drag and
Drop to Source and Destination Device respectively, choose the “Auto Capture/Play”.
P.T.O.
15 | P a g e
Step 11 – Observe the Path of the Message from source to hub, then to all devices, and then
from destination to hub then back to the source.
16 | P a g e
Experiment – 3: -Configuration of Router and Introduction to Basic User Interface.
✓ We will begin building our network topology by selecting devices and the media in
which to connect them. Several types of devices and network connections can be used.
✓ For this Experiment we will use End Devices, like Routers and PCs.
Step 1 – Choose “Networking Devices” -> “Routers” and select “Router 4321”. After selecting
click on the main area, a router will be added.
Step 3 – Just Like Routers, Now Add 2 Switches into the Main-Area.
Step 4 – Select “End Devices” and then select the “PC” and click on the main area.
17 | P a g e
PC0 Will be Added into the Main-
Area.
Step 6 – Now Select “Connections” and then click on “Automatically choose Connection Type”.
18 | P a g e
Fig A
Step 8 – Double Click on a Router, a box will appear. After that click on “Config” Tab.
According to the Network, User have to Manually figure out which Interface Port
(GigabitEthernet0/0/0 or GigabitEthernet0/0/1) is Connected to the Switch/Router.
19 | P a g e
Fig.1.1 Config For GigabitEthernet0/0/0
We can also configure the router from the command-line interface (CLI).
Following Figures 1.3 & 1.4, show the Implementation of Config of GigabitEthernet0/0/0 &
GigabitEthernet0/0/1 using CLI Commands.
P.T.O.
20 | P a g e
Fig1.3 CLI Config Commands on GigabitEthernet0/0/0
Step 10 – In “Config” Tab, Click on the “Routing” then Static and Config the Static Routes of
the Network.
21 | P a g e
Fig1.5 Static Route Config for Router0
We can also configure the Static Route from the command-line interface (CLI).
Following Figures 1.7 & 1.8, show the Implementation of Config of Router0 & Router1 using
CLI Commands.
Fig1.7 Static Route Config using CLI Fig1.8 Static Route Config using CLI
Commands for Router0 Commands for Router1
22 | P a g e
Step 11 – Double Click on a PC, a box will appear. After that click on “Desktop” Tab and then
select “IP configuration”.
Step 12 – Write the IP Address of your network and click at the subnet mask field. Subnet
Mask will appear automatically. Also Input the Default Gateway.
Step 13 – Repeat Step 11 & Step 12 to set the IPs for all the PC’s.
P.T.O.
23 | P a g e
Fig B
Step 14 – Select “Add Simple Message”. Drag and Drop the Message to the Source Device and
then to the Destination Device and observe the Output of “Realtime” tab.
P.T.O.
24 | P a g e
In above Scenario –
1) My Source Device is PC2 and My Destination Device is Router1.
Status is returned “Successful”.
2) My Source Device is PC0 and My Destination Device is Router0.
Status is returned “Successful”.
In above Scenario –
1) My Source Device is PC0 and My Destination Device is Router1.
Status is returned “Successful”.
2) My Source Device is PC0 and My Destination Device is PC3.
Status is returned “Successful”.
3) My Source Device is PC2 and My Destination Device is Router0.
Status is returned “Successful”.
4) My Source Device is PC2 and My Destination Device is PC1.
Status is returned “Successful”.
Step 15 – We can also make use of the “Simulation Mode”. Once the Message is Drag and
Drop to Source and Destination Device respectively, choose the “Auto Capture/Play”.
25 | P a g e
Step 16 – Observe the Path of the Message from source to hub, then to all devices, and then
from destination to hub then back to the source.
Packets
Receiving at
Destination is
showed by
“Green Tick”
26 | P a g e
Experiment – 4: - Configuration of Dynamic Routing Protocols RIP, OSPF and BGP protocols
using CISCO Packet Tracer.
BGP
RIP OSPF
✓ RIP exchanges state only between adjacent routers. The information exchanged by the
router is all the information currently known by the router, namely the routing table.
Routing information is exchanged at regular intervals.
✓ OSPF sends information to all routers of the local AS. The information sent is the link
state of all routers adjacent to the router. That is, the network topology of the router.
If the link status changed, the router will use flooding to send information to all
routers.
✓ RIP and OSPF are Intra-Autonomous Interior Routing Protocol.
✓ BGP is Intra-Autonomous Exterior Routing Protocol.
✓ We will begin building our network topology by selecting devices and the media in
which to connect them. Several types of devices and network connections can be used.
✓ For this Experiment we will use End Devices, like PCs and “Router-PT”.
➢ Step 1 to Step 12 Show the Formation & Configuration of Autonomous System
(RIP).
➢ Step 13 to Step 24 Show the Formation & Configuration of Autonomous System
(OSPF).
Step 1 – Choose “Networking Devices” -> “Routers” and select “Router-PT”. After selecting
click on the main area, a router will be added.
27 | P a g e
Step 2 – Repeat “Step 1” to add another Router.
Step 3 – Select “End Devices” and then select the “PC” and click on the main area.
Step 5 – Now Select “Connections” and then click on “Automatically choose Connection Type”.
28 | P a g e
Step 6 – Draw Connections.
Fig A
Autonomous
System (RIP)
Step 7 – Double Click on a Router, a box will appear. After that click on “Config” Tab.
According to the Network, User have to Manually figure out which Interface Port
(FastEthernet0/0, FastEthernet1/0, Serial 2/0, … ) is Connected to the PC/Router.
29 | P a g e
Fig.1.1 Config For FastEthernet0/0
We can also configure the router from the command-line interface (CLI).
Following Figures 1.3 & 1.4, show the Implementation of Config of FastEthernet0/0 & Serial
2/0 using CLI Commands.
P.T.O.
30 | P a g e
Fig1.3 CLI Config Commands on FastEthernet0/0
Step 9 – In “Config” Tab, Click on the “Routing” then RIP and Config the RIP Routes of the
Network.
31 | P a g e
Fig1.5 RIP Route Config for Router0
We can also configure the Static Route from the command-line interface (CLI).
Following Figures 1.7 & 1.8, show the Implementation of Config of Router0 & Router1 using
CLI Commands.
Fig1.7 RIP Route Config using CLI Fig1.8 RIP Route Config using CLI
Commands for Router0 Commands for Router1
Step 10 – Double Click on a PC, a box will appear. After that click on “Desktop” Tab and then
select “IP configuration”.
32 | P a g e
Step 11 – Write the IP Address of your network and click at the subnet mask field. Subnet
Mask will appear automatically. Also Input the Default Gateway.
33 | P a g e
Step 12 – Autonomous System (RIP) is Formed and Configured.
Fig B
Step 13 – Choose “Networking Devices” -> “Routers” and select “Router-PT”. After selecting
click on the main area, a router will be added.
34 | P a g e
Router3 Will be Added into the Main-Area.
Step 15 – Select “End Devices” and then select the “PC” and click on the main area.
35 | P a g e
Step 17 – Now Select “Connections” and then click on “Automatically choose Connection
Type”.
Fig C
Autonomous
System (OSPF)
Step 19 – Double Click on a Router, a box will appear. After that click on “Config” Tab.
According to the Network, User have to Manually figure out which Interface Port
(FastEthernet0/0, FastEthernet1/0, Serial 2/0, … ) is Connected to the PC/Router.
36 | P a g e
Fig.2.1 Config For FastEthernet0/0
We can also configure the router from the command-line interface (CLI).
Following Figures 2.3 & 2.4, show the Implementation of Config of FastEthernet0/0 & Serial
2/0 using CLI Commands.
P.T.O.
37 | P a g e
Fig2.3 CLI Config Commands on FastEthernet0/0
Step 21 – In “Config” Tab, click on the “Routing” then RIP and Config the RIP Routes of the
Network.
38 | P a g e
Fig2.5 RIP Route Config for Router2
We can also configure the Static Route from the command-line interface (CLI).
Following Figures 1.7 & 1.8, show the Implementation of Config of Router0 &
Router1 using CLI Commands.
Fig2.7 RIP Route Config using CLI Fig2.8 RIP Route Config using CLI
Commands for Router2 Commands for Router3
39 | P a g e
Step 22 – Double Click on a PC, a box will appear. After that click on “Desktop”
Tab and then select “IP configuration”.
Step 23 – Write the IP Address of your network and click at the subnet mask
field. Subnet Mask will appear automatically. Also Input the Default Gateway.
40 | P a g e
Step 24 – Autonomous System (OSPF) is Formed and Configured.
Fig D
41 | P a g e
Fig3.1 Router1 BGP Config
Step 29 – Select “Add Simple Message”. Drag and Drop the Message to the
Source Device and then to the Destination Device and observe the Output of
“Realtime” tab.
42 | P a g e
In above Scenario –
3) My Source Device is PC2 and My Destination Device is Router1.
Status is returned “Successful”.
4) My Source Device is PC1 and My Destination Device is PC2.
Status is returned “Successful”.
In above Scenario –
5) My Source Device is PC0 and My Destination Device is Router1.
6) Status is returned “Successful”.
7) My Source Device is PC0 and My Destination Device is PC3.
8) Status is returned “Successful”.
9) My Source Device is PC2 and My Destination Device is Router0.
10) Status is returned “Successful”.
11) My Source Device is PC2 and My Destination Device is PC1.
Status is returned “Successful”.
Step 30 – We can also make use of the “Simulation Mode”. Once the Message is
Drag and Drop to Source and Destination Device respectively, choose the “Auto
Capture/Play”.
Step 31 – Observe the Path of the Message from source to hub, then to all
devices, and then from destination to hub then back to the source.
43 | P a g e
Packets Going Across the Networks
Packets
Receiving at
Destination is
showed by
“Green Tick”
44 | P a g e
Experiment – 5: -Configuration of DHCP Server to Serve Contiguous IP Address
to the Pool of Four IP Devices with a Default Gateway and Default DNS
Address.
45 | P a g e
➢ For this Experiment we will use End Devices, like PCs, “Switch-2950” &
“Router-1841”.
Step 2 – Just Like Routers, Now Add a Switch into the Main-Area
46 | P a g e
Step 3 – Select “End Devices” and then select the “PC” and click on the main
area.
Step 5 – Again Select “End Devices” and then select the “SERVER” and click on
the main area.
47 | P a g e
Step 6 – Now Select “Connections” and then click on “Automatically choose
Connection Type”.
Fig A
A
Step 8 – Double Click on a Router, a box will appear. After that click on “Config”
Tab.
48 | P a g e
Step 9 – In “Config” Tab, We have to Config the Router With Switch.
According to the Network, User have to Manually figure out which Interface
Port (FastEthernet0/0, FastEthernet1/0, Serial 2/0, … ) is Connected to the
Switch.
In Fig A. Router0 is Connected to Switch via FastEthernet0/0. Therefore,
Config will be like :–
We can also configure the router from the command-line interface (CLI).
Following Figure 1.2, show the Implementation of Config of FastEthernet0/0
using CLI Commands.
49 | P a g e
Fig1.2 CLI Config Commands on FastEthernet0/0
Step 10 – Double Click on the Server, a box will appear. After that click on
“Services” Tab and then select “DHCP”.
50 | P a g e
Step 11 – In DHCP Service Tab, Config DHCP Service for the Network as -
Fig1.3 Config of
DHCP Service
on Server
Step 12 – After “DHCP Service” is Configured, click on “Desktop” Tab and then
select “IP configuration”.
Step 13 – Write the IP Address of your network and click at the subnet mask
field. Subnet Mask will appear automatically. Also Input the Default Gateway.
Step 14 – Double Click on a PC, a box will appear. After that click on “Desktop”
Tab and then select “IP configuration”.
51 | P a g e
Step 15 – In “IP configuration” Tab Click on the “DHCP”, IP Address, Subnet
Mask and Default Gateway will be automatically Assigned.
52 | P a g e
Fig B
Step 17 – Select “Add Simple Message”. Drag and Drop the Message to the
Source Device and then to the Destination Device and observe the Output of
“Realtime” tab.
In above Scenario –
5) My Source Device is PC0 and My Destination Device is PC1.
Status is returned “Successful”.
6) My Source Device is PC0 and My Destination Device is Router0.
Status is returned “Successful”.
7) My Source Device is PC0 and My Destination Device is Server0.
Status is returned “Successful”.
Step 18 – We can also make use of the “Simulation Mode”. Once the Message is
Drag and Drop to Source and Destination Device respectively, choose the “Auto
Capture/Play”.
53 | P a g e
Step 19 – Observe the Path of the Message from source to hub, then to all
devices, and then from destination to hub then back to the source.
54 | P a g e
Packets
Receiving at
Destination is
showed by
“Green Tick”
55 | P a g e
Step 2 – Select “End Devices” and then select the “PC” and click on the main
area.
Step 3 – In “End Devices” Tab then select the “SERVER” and click on the main
area.
Step 6 – Double Click on a PC, a box will appear. After that click on “Desktop”
Tab and then select “IP configuration”.
56 | P a g e
Step 7 – Write the IP Address and DNS Server IP and click at the subnet mask
field. Subnet Mask will appear automatically.
Step 8 – Double Click on the Server, a box will appear. After that click on
“Desktop” Tab and then select “IP configuration”.
57 | P a g e
Step 9 – Write the IP Address of your network and click at the subnet mask field.
Subnet Mask will appear automatically. Also Input the Default Gateway.
58 | P a g e
Step 11 – In DNS Service Tab, Config DNS Server for the Network IP and map
with domain as -
59 | P a g e
Step 13 – In HTTP Service Tab, add a new File Named – “index.html” and a
simple HTML Code in it and Save it.
Step 15 – Again Double Click on a PC, a box will appear. After that click on
“Desktop” Tab and then select “Web Browser”.
60 | P a g e
Step 16 – In the Web Browser, type the DNS Name, which was configured in
“Step 11” and Verify the Output.
1. Topology definition: To ease the creation of basic facilities and define their
interrelationships, ns-3 has a system of containers and helpers that
facilitates this process.
2. Model development: Models are added to simulation (for example, UDP,
IPv4, point-to-point devices and links, applications); most of the time this
is done using helpers.
3. Node and link configuration: models set their default values (for example,
the size of packets sent by an application or MTU of a point-to-point link);
most of the time this is done using the attribute system.
4. Execution: Simulation facilities generate events, data requested by the user
is logged.
5. Performance analysis: After the simulation is finished and data is available
as a time-stamped event trace. This data can then be statistically analysed
with tools like R to draw conclusions.
6. Graphical Visualization: Raw or processed data collected in a simulation
can be graphed using tools like Gnuplot, matplotlib or XGRAPH.
Ns3 gives us special features which can be used for real life integrations. Some of
these features are :
1. Tracing of the nodes: NS3 allows us to trace the routes of the nodes which
helps us to know how much data is send or received. Trace files are
generated to monitor these activities.
2. NetAnim: It stands for Network Animator.It is an animated version of how
network will look in real and how data will be transferred from one node to
other.
62 | P a g e
3. Pcap file: NS3 helps to generate pcap file which can be used to get all
information of the packets (e.g., Sequence number, Source IP, destination
IP, etc). These pcaps can be seen using a software tool known as wireshark.
4. gnuPlot: GnuPlot is used to plot graphs from the data which we get from
trace file of NS3. Gnuplot gives more accurate graph compare to other
graph making tools and also it is less complex than other tools.
This is a brief introduction to NS3. Basically NS3 can perform most of the
activities which are performed in the network in reality.
Or
go to the location of the download folder and copy the file to the home folder and
open the terminal and give the command
This will take some time for getting compiled and build. To check any application
is running. do the following steps
$] cd ns-3.27/
$] ./waf --run hello-simulator
This will print the hello Simulator which
indicates that ns3 is installed successfully.
63 | P a g e
Experiment – 8 - Implementation of script to create fixed wireless nodes.
Code
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
64 | P a g e
Output
Code
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
66 | P a g e
Output
67 | P a g e
Experiment – 10 -Implementation of script to create star topology.
Code
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/netanim-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/point-to-point-layout-module.h"
69 | P a g e