You are on page 1of 24

Data Communication and Networks

Muhammad Adan Abid


FAST National University of Computer and Emerging
Sciences
muhammad.adan@nu.edu.pk
Monday, September 05, 2016

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

Lab 4

Packets and Header Structure

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

Lab Contents

Introduction to Packets
OSI and TCP/IP Models
Layers and Headers
Introduction to IPv4 Header in detail

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

Understanding of Network Layers

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

OSI Model

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

Exchange Using OSI Model

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

TCP/IP and OSI Models

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

Addresses

Three different levels of addresses are used


in internet using typical TCP/IP protocols
Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

Layering

Muhammad Adan Abid (FAST-NUCES)

Layering

EL 317

05-Sep-16

Physical Addresses

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

100

Example

The node with physical address 10 sends


a frame to a node with physical address
87 connected by a link.

At data link level, this frame contains


physical (link) addresses in the header

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

111

IPv4 Header IPv4 Header

4500
003c
1c46
4000 4006
0a63
ac10
0a0c
Muhammad Adan Abid (FAST-NUCES)

EL 317

b1e6
05-Sep-16

ac10
122

IPv4 Datagram Format

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

133

Version
Current IP Protocol Version is 4,
called IPv4

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

144

Header Length
Length of IP Header in number of 32 bit words
including options. Maximum header size is 60
bytes.

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

155

Type of Service
The type-of-service field (8-bit) is used to differentiate the packets based
on the services they need. (It is largely ignored in current routers)

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

166

Length
Total length of IP datagram (including header) in bytes. It is a 16 bit
field. Largest size of an IP datagram thus is 65,535 bytes. Maximum
header size is 60 bytes.

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

177

Identification

Identification field uniquely identifies each datagram sent by a host. It


is normally incremented by one each time a host sends a datagram.
Very useful for fragmentation and reassembly.

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

188

Flags
flags field also used for fragmentation and
reassembly.

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

199

Fragment Offset
Fragmentation offset used for fragmentation
and reassembly.

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

20

TTL

Time-to-live or TTL field sets an upper limit on how many routers a


datagram can go through. Every router decrements TTL by 1 before
sending it forward. If TTL reaches 0 the datagram is dropped.

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

221

Protocol
Identifies the protocol that sent the datagram. The protocol
(today) can be TCP, UDP, ICMP, IGMP etc.

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Pad (variable)

22
Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

22

Header Checksum
The header checksum is calculated over the IP header only.
TCP, UDP etc protect their own data and header by a
checksum.
0

4
Version

16
TOS

HLen
Identification

TTL

19

Protocol

31
Length

Flags

Fragment
Offset
IP Header Checksum

Source IP Address
Destination IP Address
Options (variable)

Muhammad Adan Abid (FAST-NUCES)

Pad (variable)

EL 317

05-Sep-16

23

Packet Sniffer Structure

Muhammad Adan Abid (FAST-NUCES)

EL 317

05-Sep-16

24

You might also like