Internet Protocol (IP)
1
© 2021 C-DAC, Hyderabad
Table of Contents
Objective 3
Prerequisites 3
Problem Statement/Case 3
Summary 3
Fundamental Concepts 3
Template for each step 4
Step-1: Capture the real time network traffic using Wireshark 4
Open Wireshark Application 4
Select the Network Interface 6
Browse a Website 7
Save Network Traffic 9
Step 2: Analyze Internet Protocol (IP) Header 12
References 14
2
© 2021 C-DAC, Hyderabad
1. Objective
Understanding the structure of IP packets using Packet Analyzer tools.
2. Prerequisites
Prerequisites Version
Tools required Wireshark
Operating System Linux/ Windows
3. Problem Statement/Case
An IP header is a prefix to an IP packet that contains information about the IP
version, length of the packet, source and destination IP addresses, flags, frames,
fragment offset.
4. Summary
Steps Description
Step-1 Capture the real time network traffic using Wireshark
● Open the wireshark
● Select the network interface
● Browse a Website
● Save Network Traffic
Step-2 Analyze Internet Protocol (IP) Header
5. Fundamental Concepts
Introduction of IP:
IP stands for Internet protocol, which is a third layer protocol (Network Layer) in OSI
model. It is used for communicating data across a packet-switched internetwork. It
delivers the packets from the source host to the destination host based on their
addresses.
IP Header format :
3
© 2021 C-DAC, Hyderabad
IP Header Type of
Version Length Service(TOS)/
Total Length (16 bits)
(4 (4 bits) Differential Service
bits) &
ECN (8 bits)
Identification (Fragment ID) (16 bits) R D M Fragment Offset
F F (13 bits)
Time To Live(TTL) Protocol
(8 bits)
(8 bits) Header Checksum (16 bits)
Source IP Address(32 bits)
Destination IP Address(32 bits)
Options
Data
6. Template for each step
1. Step-1: Capture the real time network traffic using Wireshark
a. Open Wireshark Application
To open the wireshark go to the top left corner, click on the icon to open the list of
the tools available.
4
© 2021 C-DAC, Hyderabad
Then type wireshark in the search bar and click on the launch button.
5
© 2021 C-DAC, Hyderabad
b. Select the Network Interface
Select eth0 interface to start capturing the data and Click on this option to
capture the N packets. This screen is shown below.
6
© 2021 C-DAC, Hyderabad
Once you click on the capture button, packet capturing will start. The packet
capturing screen is shown below.
c. Browse a Website
To open the Browser go to the top left corner, click on the “Application” icon to
open the list of the tools available and select the web browser.
7
© 2021 C-DAC, Hyderabad
Browse any website in the web browser. For instance www.cdac.in.
8
© 2021 C-DAC, Hyderabad
d. Save Network Traffic
Before saving Network traffic, stop the wireshark packet capturing by selecting
the symbol
In order to save the captured network packets, go to the top left corner and click on
“File” followed by “save”.
9
© 2021 C-DAC, Hyderabad
Give any name to your file . Here, we have given Traffic1 which is shown below:
10
© 2021 C-DAC, Hyderabad
Now, select the extension as pcap by clicking on the drop down beside the “save as”.
Choose the “wireshark/tcpdump- pcap” option and click on the “save” button.
11
© 2021 C-DAC, Hyderabad
2. Step 2: Analyze Internet Protocol (IP) Header
Type “tcp” in the Filter box to get all the TCP packets. Try to observe the IP header.
12
© 2021 C-DAC, Hyderabad
Select any TCP packet and observe the packet details in the middle Wireshark packet
details pane. Notice that it is an Ethernet II/ Internet Protocol Version 4/ Transmission
Control Protocol frame.
Expand Internet protocol header to view further details and observe the following:
● Observe the IP version number, 4. Notice that if it is mentioned as 4 then it’s a
IPV4 header and if it is mentioned as 6 then it’s a IPV6 header..
● Observe the Header length , Total Length, Identification
● Observe the Flags which specify if a packet can be fragmented and if so, whether
or not the current packet contains the final fragment.
● Observe Time to live and identify how many number of jumps that a packet can
pass through before being dropped.
● Observe protocol and determine the type of traffic encapsulated within the IPv4
packet.
● Observe the source and destination and identify the IPv4 address of sender and
recipient.
13
© 2021 C-DAC, Hyderabad
14
© 2021 C-DAC, Hyderabad
7. References
● https://www.wireshark.org/
15
© 2021 C-DAC, Hyderabad