Lab Manual CN
Lab Manual CN
List of Experiments
Course Name : Computer Network
Datta Meghe College of Engineering
Course Code : CSL502/CSC503.
Airoli, Navi Mumbai
Sr. Name of experiment Cos Covered Page Date of Date of Marks &
No No. Performance Submission Signature
Use of Crimping Tool for
1 CSC503.1
RJ45.
Use of basic networking
2 CSC503.1
Commands in Linux.
Perform network discovery
CSC503.2,
3 using discovery tools ( eg. CSC503.3
Nmap, mrtg )
WAP to implement Socket
4 Programming using TCP & CSC503.5
UDP.
Perform File Transfer and
5 CSC503.6
Access using FTP.
Install and use Telnet in
6 CSC503.6
Ubuntu.
7 Build simple Topology. CSC503.1
________________________
Practical Incharge
DATTA MEGHE COLLEGE OF
ENGINEERING, AIROLI, NAVI MUMBAI
PSO1: To apply basic and advanced computational and logical skills to provide solutions to
computer engineering problems
PSO2: Ability to apply standard practices and strategies in design and development of
software and hardware based systems and adapt to evolutionary changes in computing
to meet the challenges of the future.
PSO3: To develop an approach for lifelong learning and utilize multi-disciplinary knowledge
required for satisfying industry or global requirements.
Program Outcomes as defined by NBA (PO)
10. Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and
design documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the engineering
and management principles and apply these to one’s own work, as a member and leader in a team, to
manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
DATTA MEGHE COLLEGE OF ENGINEERING
Department of Computer Engineering
Course Outcomes
CSC503.1 Demonstrate the concepts of data communication at physical layer and compare ISO -
OSI model with TCP/IP model.
CSC 503.2 Demonstrate the knowledge of networking protocols at data link layer.
CSC 503.3 Design the network using IP addressing and subnetting / supernetting schemes.
CSC 503.4 Analyze various routing algorithms and protocols at network layer.
CSC 503.5 Analyze transport layer protocols and congestion control algorithms.
On-time 3
Punctuality,
R1 Completion Time / Delayed by a Week 2
Timeline
Delayed more than a Week 1
Clear understanding 3
Knowledge & Partially understood 2
R2
Concept
Weak understanding 1
Correct Implementation 3
Correct Results 3
Correct Documentation 3
SEM: V
Rubric Marks
Rubric Title Criteria
Number (out of 5)
On-time 2
Punctuality,
R1 Completion Time Delayed by a Week 1
/ Timeline
Delayed more than a Week 0
Clear understanding 2
Knowledge &
R2 Partially understood 1
Concept
Weak understanding 0
Correct Documentation 1
R3 Documentation
Not documented properly 0
EXPERIMENT NO: 1
Date of Performance :
Date of Submission :
AIM: Use of Crimping Tool for RJ45.
THEORY :
Crimping an RJ45 Connector Correctly Proper Wiring for Ethernet Cat5/Cat5e/Cat 6 Cables
Cables can transmit information along their length. To actually get that information
where it needs to go, you need to make the right connections to an RJ45 connector.
Your cable run needs to terminate into a connector, and that connector needs a jack to plug
into.
Registered Jack 45 (RJ45) is a standard type of physical connector for network cables.
RJ45 connectors are commonly seen with Ethernet cables and networks.
Modern Ethernet cables feature a small plastic plug on each end of the cable. That plug
is inserted into RJ45 jacks of Ethernet devices. The term “plug” refers to the cable or
“male” end of the connection while the term “jack” refers to the port or “female” end.
T568A and T568B are the two colour codes used for wiring eight-position modular plugs.
Both are allowed under the ANSI/TIA/EIA wiring standards. The only difference between
the two color codes is that the orange and green pairs are interchanged.
STEP 1:
Using a Crimping Tool, trim the end of the cable you're terminating, to ensure that the ends of
the conducting wires are even.
STEP 2:
Being careful not to damage the inner conducting wires, strip off approximately 1 inch of the cable's
jacket, using a modular crimping tool or a UTP cable stripper.
STEP 3:
Separate the 4 twisted wire pairs from each other, and then unwind each pair, so that you end up with
8 individual wires. Flatten the wires out as much as possible, since they'll need to be very straight for
proper insertion into the connector.
STEP 4:
Holding the cable with the wire ends facing away from you. Moving from left to right, arrange the wi
in a flat, side-by-side ribbon formation, placing them in the following order: white/orange, solid oran
white/green, solid blue, white/blue, solid green, white/brown, solid brown.
STEP 5:
Holding the RJ45 connector so that its pins are facing away from you and the plug-clip side is facing
down, carefully insert the flattened, arranged wires into the connector, pushing through u
ntil the wire ends emerge from the pins. For strength of connection, also
push as much of the cable jacket as possible into the connector.
STEP 6:
Check to make sure that the wire ends coming out of the connector's pin side are in the correct order;
if not, remove them from the connector, rearrange into proper formation, and re-insert. Remember,
once the connector is crimped onto the cable, it's permanent. If you realize that a mistake has been
made in wire order after termination, you'll have to cut the connector off and start all over again!
STEP 7:
Insert the prepared connector/cable assembly into the RJ45 slot in your crimping tool. Firmly sque
crimper's handles together until you can't go any further. Release the handles and repeat this step to en
proper crimp.
STEP 8:
If your crimper doesn't automatically trim the wire ends upon termination, carefully cut wire ends to
them as flush with the connector's surface as possible. The closer the wire ends are trimmed, the bette
final plug-in connection will be.
STEP 9:
After the first termination is complete, repeat process on the opposite end of your cable.
CONCLUSION: Thus, we have studied the use of crimping tool for RJ-45.
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 2
Date of Performance :
Date of Submission :
AIM: Use basic networking commands in Linux (ping, tracert, nslookup, netstat, ARP, RARP, ip,
ifconfig, dig, route )
THEORY:
1. ifconfig
ifconfig(interface configuration) command is used to configure the kernel-resident network
interfaces. It is used at the boot time to set up the interfaces as necessary. After that, it is usually
used when needed during debugging or when you need system tuning. Also, this command is
used to assign the IP address and netmask to an interface or to enable or disable a given
interface.
2. NSLOOKUP
Nslookup (stands for “Name Server Lookup”) is a useful command for getting
information from DNS server. It is a network administration tool for querying the
Domain Name System (DNS) to obtain domain name or IP address mapping or
any other specific DNS record. It is also used to troubleshoot DNS related
problems.
3. Ping
PING (Packet Internet Groper) command is used to check the network connectivity
between host and server/host. This command takes as input the IP address or the URL and
sends a data packet to the specified address with the message “PING” and get a response
from the server/host this time is recorded which is called latency. Fast ping low latency
means faster connection. Ping uses ICMP(Internet Control Message Protocol) to send
an ICMP echo message to the specified host if that host is available then it sends ICMP
reply message. Ping is generally measured in millisecond every modern operating system
has this ping pre-installed.
4. TRACEROUTEac
traceroute command in Linux prints the route that a packet takes to reach the
host. This command is useful when you want to know about the route and about all
the hops that a packet takes. Below image depicts how traceroute command is used
to reach the Google(172.217.26.206) host from the local machine and it also prints
detail about all the hops that it visits in between.
5. Netstat
Netstat command displays various network related information such as network
connections, routing tables, interface statistics, masquerade connections,
multicast memberships etc.
6. ARP
7. IP
ip command in Linux is present in the net-tools which is used for performing
several network administration tasks. IP stands for Internet Protocol. This command
is used to show or manipulate routing, devices, and tunnels. It is similar
to ifconfig command but it is much more powerful with more functions and facilities
attached to it. ifconfig is one of the deprecated commands in the net-tools of Linux
that has not been maintained for many years. ip command is used to perform
several tasks like assigning an address to a network interface or configuring network
interface parameters.
It can perform several other tasks like configuring and modifying the default and
static routing, setting up tunnel over IP, listing IP addresses and property information,
modifying the status of the interface, assigning, deleting and setting up IP addresses
and routes.
8. Dig
dig command stands for Domain Information Groper. It is used for retrieving
information about DNS name servers. It is basically used by network
administrators. It is used for verifying and troubleshooting DNS problems and to
perform DNS lookups. Dig command replaces older tools such as nslookup and
the host.
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 3
Date of Performance :
Date of Submission :
AIM: Perform network discovery using discovery tools (eg. Nmap, mrtg)
Nmap (Network Mapper) is a security scanner originally written by Gordon Lyon (also
known by his pseudonym Fyodor Vaskovich) used to discover hosts and services on a
computer network, thus creating a "map" of the network. To accomplish its goal, Nmap
sends specially crafted packets to the target host and then analyzes the responses.
Unlike many simple port scanners that just send packets at some predefined constant
rate, Nmap accounts for the network conditions (latency fluctuations, network
congestion, the target interference with the scan) during the run. Also, owing to the large
and active user community providing feedback and contributing to its features, Nmap
has been able to extend its discovery capabilities beyond simply figuring out whether a
host is up or down and which ports are open and closed; it can determine the operating
system of the target, names and versions of the listening services, estimated uptime,
type of device, and presence of a firewall.
SYN scan is the default and most popular scan option for good reasons. It can be
performed quickly, scanning thousands of ports per second on a fast network not
hampered by restrictive firewalls. It is also relatively unobtrusive and stealthy since it
never completes TCP connections
1. Download Nmap from www.nmap.org and install the Nmap Software with WinPcap
Driver utility.
2. Execute the Nmap-Zenmap GUI tool from Program Menu or Desktop Icon
3. Type the Target Machine IP Address(ie.Guest OS or any website Address)
4. Perform the profiles shown in the utility.
CONCLUSION: Thus, we have studied different options to scan ports in Nmap
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 4
Date of Performance :
Date of Submission :
Theory:
A socket connection is a 4-tuple -- (HostA, PortA, HostB, PortB) -- uniquely defining the connection.
Transmission Control Protocol (TCP)
TCP provides a connection oriented service, since it is based on connections between clients and
servers.
TCP provides reliability. When a TCP client send data to the server, it requires an acknowledgement
in return. If an acknowledgement is not received, TCP automatically retransmit the data and waits for
a longer period of time.
TCP properties: reliable, connection-oriented, byte-stream, connection established before
application-level protocols exchange information, two-way communication
The client-server model:The client-server model is one of the most used communication paradigms
in networked systems. Clients normally communicates with one server at a time. From a server’s
perspective, at any point in time, it is not unusual for a server to be communicating with multiple
clients. Client need to know of the existence of and the address of the server, but the server does not
need to know the address of (or even the existence of) the client prior to the connection being
established
As shown in the figure, the steps for establishing a TCP socket on the client side are the following:
● Create a socket using the socket() function;
● Connect the socket to the address of the server using the connect() function;
● Send and receive data by means of the read() and write() functions.
The steps involved in establishing a TCP socket on the server side are as follows:
● Create a socket with the socket() function;
● Bind the socket to an address using the bind() function;
● Listen for connections with the listen() function;
● Accept a connection with the accept() function system call. This call typically blocks until a
client connects with the server.
● Send and receive data by means of send() and receive().
B) WAP to implement socket programming using UDP. Theory:
Datagram sockets, also known as connectionless sockets, which use User Datagram Protocol (UDP).
Stream sockets, also known as connection-oriented sockets, which use Transmission Control Protocol
(TCP), Stream Control Transmission Protocol (SCTP) or Datagram Congestion Control Protocol
(DCCP).
UDP properties: unreliable, packet-switched, packet data, no connection overhead, application-level
protocols exchange information immediately, two-way communication.
Fig. TCP/IP client/server communication flow
Fig: UDP client/server communication flow:
TCP/IP Vs UDP :
1. Connection oriented (bidirectional communication sockets which keeps track of connection
state, established connection , and also create reciever buffer on both sides of the end to end
connection) & other is Connection less (does not keep track of the connection state and it does not
have reciver buffer on either side sender or reciver)
2. Will have Acknowledgment & other one don't
3. Performance slow & other one fast
4. More secure & other is not much
5.TCP/IP offer guaranteed delivery while UDP does not
6. TCP/IP consumes high bandwidth. UDP is good guy and shares band with everyone.
7. TCP/IP guarantees sequencing of packets (Packet sent first will reach destination first). In
UDP you may get last packet first or not at all.
8. TCP does not have message block boundaries (User has to define its own)
9. TCP can Transmit large amount of data as compared to udp
10. Sequencing of packet is guranted in TCP.Means the packets that are sent is delivered in
time where in UDP it is not guranted that the packets will reach in time to the destination.
Code:
A] TCP
Server Side:
import java.net.*;
import java.io.*;
class ServerSide
{
public static void main(String[] args) throws Exception
{
int choice,a,b,c=0;
ServerSocket ss = new ServerSocket(1024);
Socket s = ss.accept();
BufferedReader br = new BufferedReader(new InputStreamReader
(s.getInputStream() ) );
choice =Integer.parseInt(br.readLine());
a =Integer.parseInt(br.readLine());
b = Integer.parseInt(br.readLine());
switch(choice)
{
case 1 : c = a+b; break;
case 2 : c = a-b; break;
case 3 : c = a*b; break;
case 4 : c = a/b; break;
case 5 : c = (a%b); break;
}
PrintStream pr = new PrintStream(s.getOutputStream()) ;
pr.println(c);
ss.close();
s.close();
}
}
Client Side:
import java.net.*;
import java.io.*;
class ClientSide
{
public static void main(String[] args) throws Exception
{
int ch=0,a,b,c;
Socket s = new Socket("localhost",1024); BufferedReader br =
newBufferedReader(newInputStreamReader(System.in));
PrintStream ps=new PrintStream(s.getOutputStream());
System.out.println("Please Enter Number 1:");
a = Integer.parseInt(br.readLine());
System.out.println("Please Enter Number 2:"); b =
Integer.parseInt(br.readLine());
System.out.println("Please Enter The Operation to Be
Performed\n");
System.out.println("1.Addition 2.Subtraction 3.Multiplication 4.Divison
5.Modulo 0.Exit");
ch = Integer.parseInt(br.readLine());
ps.println(ch);
ps.println(a);
ps.println(b);
BufferedReader br1 = new BufferedReader(new
InputStreamReader(s.getInputStream()));
c=Integer.parseInt(br1.readLine());
System.out.println("Answer: "+c); s.close();
}
}
OUTPUT:
Server Side:
Client Side:
B] UDP
Server Socket
Program:
import java.io.*;
import
java.util.*;
import
java.net.*; class
ServerUDP
{
public static void main(String args[])throws IOException
{
DatagramSocket ss=new DatagramSocket(2100);
byte[] sendData=new byte[1024];
byte[] recData=new byte[1024];
while(true)
{
DatagramPacket dp=new
DatagramPacket(recData,recData.length);
ss.receive(dp);
String input=new String(dp.getData());
if(input=="end")
break;
InetAddress ip=dp.getAddress();
System.out.println("Received input :
"+input); String output="Hello ";
int port=dp.getPort();
output=output.concat(input);
sendData=output.getBytes();
DatagramPacket dp1=new
DatagramPacket(sendData,sendData.length,ip,port);
ss.send(dp1);
}
ss.close();
}
}
Client Socket
Program:
import java.io.*;
import
java.util.*;
import
java.net.*; class
ClientUDP
{public static void main(String args[])throws IOException
{ BufferedReader br=new
BufferedReader(new
InputStreamReader(System.in));
DatagramSocket ds=new
DatagramSocket();
InetAddress
ip=InetAddress.getByName("localhost"); byte[]
sendData=new byte[1024];
byte[] recData=new byte[1024];
System.out.println("Enter your name
:"); String input=br.readLine();
sendData=input.getBytes();
DatagramPacket dp=new
DatagramPacket(sendData,sendData.length,ip,2100);
ds.send(dp);
DatagramPacket dp1=new
DatagramPacket(recData,recData.lengt
h);
ds.receive(dp1);
String output=new String(dp1.getData());
System.out.println(output);
ds.close();
}
}
OUTPUT:
Server Side:
Client Side:
Conclusion: Hence we successfully studied and implemented the program of TCP and UDP.
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 5
Date of Performance :
Date of Submission :
Theory:
In the Anonymous mode, remote clients can access the FTP server by using the
default user account called "anonymous" or "ftp" and sending an email address as
the password.
In the Authenticated mode a user must have an account and a password. User
access to the FTP server directories and files is dependent on the permissions
defined for the account used at login. As a general rule, the FTP daemon will hide
the root directory of the FTP server and change it to the FTP Home directory. This
hides the rest of the file system from remote sessions.
Steps
1. vsftpd is an FTP daemon available in Ubuntu. To install vsftpd we can run the
following command in root mode:
5. In your browser type: ftp://localhost and enter login username and password.
6. After authentication, we can transfer and access files using ftp
delete to delete (remove) a file in the current remote directory (same as rm in UNIX)
get to copy one file from the remote machine to the local machine
get ABC DEF
This copies file ABC in the current remote directory to (or on top of) a file named
DEF in your current local directory.
get ABC
This copies file ABC in the current remote directory to (or on top of) a file with the
same name, ABC, in your current local directory.
mget to copy multiple files from the remote machine to the local machine;
you are prompted for a y/n answer before transferring each file
mget *
This copies all the files in the current remote directory to your current local directory,
using the same filenames. Notice the use of the wild card character, *.
mput to copy multiple files from the local machine to the remote machine;
you are prompted for a y/n answer before transferring each file
put to copy one file from the local machine to the remote machine
pwd to find out the pathname of the current directory on the remote machine
Output:
Conclusion: Hence we successfully studied the program of FTP.
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 6
Date of Performance :
Date of Submission :
Theory:
The telnet command is used for interactive communication with another host using
the TELNET protocol. It begins in command mode, where it prints a telnet prompt ("telnet>
"). If telnet is invoked with a host argument, it performs an open command implicitly; see
the description below.
Options:
-4 Force IPv4 address resolution.
-6 Force IPv6 address resolution.
-8 Request 8-bit operation. This causes an attempt to negotiate the TELNET BINARY
option for both input and output. By default telnet is not 8-bit clean.
-E Disables the escape character functionality; that is, sets the escape character to
``no character''.
-K Specifies no automatic login to the remote system.
-L Specifies an 8-bit data path on output.This causes the TELNET BINARY option
to negotiated on just output.
Once a connection has been opened, telnet will attempt to enable the TELNET LINEMODE
option.If this fails, then telnet will revert to one of two input modes: either “character at a time” or
“old line by line” depending on what the remote system supports
So, I”ll write “sudo apt-get install telnetd” and press enter. If you are a root user, then you don’t
need to write sudo in Ubuntu. “telnetd” is a daemon that gets invoked by “inetd” or its extension
“xinetd”, both are the internet servers.
Step 2: Then you are asked to enter the user password and then press enter. Processing will start
as soon as you press enter. After this, I have noticed a line “274 KB additional disk space will be
used” on the terminal screen.
You may also observe some sort of a message like this and then you”ll be asked to continue
or not. Just write “y” and then press enter to continue.
Step 3: Now when you are done with it, restart “inetd”.
“inetd” is daemon used for dealing with incoming network and it is responsible for deciding which
program to run when a request comes.
Step 4: To ensure “inetd” is started, press enter after writing the above command.
To connect with any remote client:
Step 5: Just type:“telnet hostipaddress”. For an example: “telnet 122.175.140.221” and
press enter.
Step 6: Then you”ll see, it is connected to “host ip address”. For security reasons, you
are required to provide “username” and “password” as well.
Conclusion: Hence we successfully studied the program of telnet.
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 7
Date of Performance :
Date of Submission :
AIM: Build a simple network topology and configure it for static routing protocol using
packet tracer. Setup a network and configure IP addressing, subnetting, masking.
Steps:
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 8
Date of Performance :
Date of Submission :
The ns-3 simulator is a discrete-event network simulator targeted primarily for research and
educational use. The ns-3 project, started in 2006, is an open-source project developing ns-3.
The purpose of this tutorial is to introduce new ns-3 users to the system in a structured way. It is
sometimes difficult for new users to glean essential information from detailed manuals and to convert
this information into working simulations. In this tutorial, we will build several example simulations,
introducing and explaining key concepts and features as we go.
As the tutorial unfolds, we will introduce the full ns-3 documentation and provide pointers to source
code for those interested in delving deeper into the workings of the system.
● ns-3 is open-source, and the project strives to maintain an open environment for researchers to
contribute and share their software.
● ns-3 is not a backwards-compatible extension of ns-2; it is a new simulator. The two simulators
are both written in C++ but ns-3 is a new simulator that does not support the ns-2 APIs.
For the installation of NS3, VMware workstation is required to be installed, along with an
Ubuntu system.
1. Download VMWare workstation from the website:
https://my.vmware.com/en/web/vmware/downloads/info/slug/desktop_end_user_compu
ting/vmware_workstation_player/15_0
2. Download Ubuntu 20.04.01 Desktop AMD 64 from the website:
https://ubuntu.com/download/desktop
3. Install VMWare workstation onto the computer system and open it
4. Set up the VMware workstation: a. Create a new virtual machine by selecting “Create New
Virtual Machine.”
a. In the installer wizard, select installer disc image file(iso) and select the downloaded
Ubuntu 20.04.01 AMD 64 iso file by browsing through the computer download files.
9. Go to terminal and input these commands consecutively after each command finishes
executing:
cd
cd workspace
tar xjf <Name of Ns3 downloaded file name>
cd <Name of extracted Ns3>
./build.py --enable-examples --enable-tests
10. Test the NS3 build and installation success by running test.py in the ns directory
using the following commands: cd ns- ./test.py
11. If all of the tests were passed, Congratulations! NS3 has now been installed
successfully.
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 9
Date of Performance :
Date of Submission :
THEORY:
Wireshark, a network analysis tool formerly known as Ethereal, captures packets in real time and
display them in human-readable format. Wireshark includes filters, color coding, and other features
that let you dig deep into network traffic and inspect individual packets.
Capturing Packets
After downloading and installing Wireshark, you can launch it and double-click the name of a
network interface under Capture to start capturing packets on that interface. For example, if you
want to capture traffic on your wireless network, click your wireless interface. You can configure
advanced features by clicking Capture > Options, but this isn’t necessary for now.
As soon as you click the interface’s name, you’ll see the packets start to appear in real time.
Wireshark captures each packet sent to or from your system.
If you have promiscuous mode enabled—it’s enabled by default—you’ll also see all the other
packets on the network instead of only packets addressed to your network adapter. To check if
promiscuous mode is enabled, click Capture > Options and verify the “Enable promiscuous mode on
all interfaces” checkbox is activated at the bottom of this window.
Click the red “Stop” button near the top left corner of the window when you want to stop capturing
traffic.
Color Coding
You’ll probably see packets highlighted in a variety of different colors. Wireshark uses colors to help
you identify the types of traffic at a glance. By default, light purple is TCP traffic, light blue is UDP
traffic, and black identifies packets with errors—for example, they could have been delivered out of
order.
To view exactly what the color codes mean, click View > Coloring Rules. You can also customize
and modify the coloring rules from here, if you like.
Sample Captures
If there’s nothing interesting on your own network to inspect, Wireshark’s wiki has you covered.
The wiki contains a page of sample capture files that you can load and inspect. Click File > Open in
Wireshark and browse for your downloaded file to open one.
You can also save your own captures in Wireshark and open them later. Click File > Save to save
your captured packets.
Filtering Packets
If you’re trying to inspect something specific, such as the traffic a program sends when phoning
home, it helps to close down all other applications using the network so you can narrow down the
traffic. Still, you’ll likely have a large amount of packets to sift through. That’s where Wireshark’s
filters come in.
The most basic way to apply a filter is by typing it into the filter box at the top of the window and
clicking Apply (or pressing Enter). For example, type “dns” and you’ll see only DNS packets.
When you start typing, Wireshark will help you autocomplete your filter.
You can also click Analyze > Display Filters to choose a filter from among the default filters
included in Wireshark. From here, you can add your own custom filters and save them to easily
access them in the future.
For more information on Wireshark’s display filtering language, read the Building display filter
expressions page in the official Wireshark documentation.
Another interesting thing you can do is right-click a packet and select Follow > TCP Stream.
You’ll see the full TCP conversation between the client and the server. You can also click other
protocols in the Follow menu to see the full conversations for other protocols, if applicable.
Close the window and you’ll find a filter has been applied automatically. Wireshark is showing you
the packets that make up the conversation.
Inspecting Packets
Click a packet to select it and you can dig down to view its details.
You can also create filters from here — just right-click one of the details and use the Apply as Filter
submenu to create a filter based on it.
Wireshark is an extremely powerful tool, and this tutorial is just scratching the surface of what you
can do with it. Professionals use it to debug network protocol implementations, examine security
problems and inspect network protocol internals.
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)
EXPERIMENT No. 10
Date of Performance :
Date of Submission :
AIM:
a. Set up multiple IP addresses on a single LAN.
b. Using nestat and route commands of Linux, do the following:
● View current routing table
● Add and delete routes
● Change default gateway
Perform packet filtering by enabling IP forwarding using IPtables in Linux.
Theory:
First, let us find the IP address of the network card. In my Ubuntu 15.10 server, I use only one network
card.
Run the following command to find out the IP address:
sudo ip addr
Sample output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group
default qlen 1000
link/ether 08:00:27:2a:03:4b brd ff:ff:ff:ff:ff:ff
inet 192.168.1.103/24 brd 192.168.1.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe2a:34e/64 scope link
valid_lft forever preferred_lft forever
Or
sudo ifconfig
Sample output:
enp0s3 Link encap:Ethernet HWaddr 08:00:27:2a:03:4b
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe2a:34e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:186 errors:0 dropped:0 overruns:0 frame:0
TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21872 (21.8 KB) TX bytes:9666 (9.6 KB)
As you see in the above output, my network card name is enp0s3, and its IP address is 192.168.1.103.
Now let us add an additional IP address, for example 192.168.1.104, to the Interface card.
Open your Terminal and run the following command to add additional IP.
sudo ip addr add 192.168.1.104/24 dev enp0s3
Now, let us check if the IP is added using command:
sudo ip address show enp0s3
Sample output:
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group
default qlen 1000
link/ether 08:00:27:2a:03:4e brd ff:ff:ff:ff:ff:ff
inet 192.168.1.103/24 brd 192.168.1.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet 192.168.1.104/24 scope global secondary enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe2a:34e/64 scope link
valid_lft forever preferred_lft forever
Sample output:
PING 192.168.1.104 (192.168.1.104) 56(84) bytes of data.
64 bytes from 192.168.1.104: icmp_seq=1 ttl=64 time=0.901 ms
64 bytes from 192.168.1.104: icmp_seq=2 ttl=64 time=0.571 ms
64 bytes from 192.168.1.104: icmp_seq=3 ttl=64 time=0.521 ms
64 bytes from 192.168.1.104: icmp_seq=4 ttl=64 time=0.524 ms
R1 R2 R3 R4 R5 Total Signature
(3 Marks) (3 Marks) (3 Marks) (3 Mark) (3 Mark) (15 Marks)