2.5 IPv4
2.5 IPv4
Introduction to TCP/IP
IPv4
IPv4 Protocol
Protocol Terminology
− 1 Octet = 1 Byte = 8 bits
IPv4
IPv4 Packet
− IP Packet is called a Datagram
− Datagram definition
• In Internet standards RFC 1594 a Datagram is
defined as “A self-contained, independent
entity of data carrying sufficient information
to be routed from the source to the
destination computer without reliance on
earlier exchanges between this source and
destination computer and the transporting
network.”
IPv4
IPv4 Packet
− IPv4 Packet = Header + Payload
• Header = IPv4 Header
• Payload = TCP/UDP Header + Data (Payload Segment)
IPv4
IPv4
Version (4 bits)
− Used to distinguish different IP packet versions
− IPv4 packets include the version value 4
• Currently in the Internet IPv4 and IPv6 are used
IPv4
IPv4 Header
IPv4
IPv4
MTU
• Maximum size of an IP packet that can be transmitted without
fragmentation over a medium
IPv4
IPv4 Header
IPv4
Flags (3 bits)
− Only two of the three bits are used (RFC 791)
− Bit 0: Reserved, Set to 0
− Bit 1: DF (Don't Fragment)
• 1 = Don't Fragment, 0 = May Fragment
− Bit 2: MF (More Fragments)
• 1 = More Fragments, 0 = Last Fragment
IPv4
IPv4
IPv4 Header
IPv4
Protocol (8 bits)
− Identifies the type of the next header in the
packet directly following the IPv4 header
IPv4
Protocol (8 bits)
IPv4
IPv4
IPv4 Header
CIDR
123.234.100.56/24 represents
• IPv4 address (32 bits) 123.234.100.56
• Subnet mask with 24 ones
= 11111111.11111111.11111111.00000000
= 255 . 255 . 255 . 0
• Subnet size = 2(32-24) = 28 = 256 IPv4 addrs.
in this subnet
• Routing prefix 123.234.100.0 can be
obtained from IPv4 address 123.234.100.56
and Subnet mask 255.255.255.0
IPv4
Options (variable)
− Includes the options requested by the sending
host computer (e.g., H1)
IPv4
Padding (variable)
− Used to make sure that the IPv4 packet header is
a multiple of 32 bit word units in length
− IHL is in 32 bit word units, and padding will help
to match the length
Introduction to TCP/IP
IPv4
References
References
Image sources
• Farm-Fresh router, By FatCow Web Hosting (http://www.fatcow.com/free-
icons/) [CC BY 3.0 us
(http://creativecommons.org/licenses/by/3.0/us/deed.en)], via Wikimedia
Commons