0% found this document useful (0 votes)
29 views16 pages

2.5 IPv4

The document provides an introduction to TCP/IP and IPv4 networking concepts. It defines key terminology like octets, words, flags, and MTU. It describes the structure of an IPv4 packet including the header and fields like version, total length, identification, flags, fragment offset, TTL, protocol, and checksum. It also explains IPv4 addressing including Classful and CIDR addressing and how addresses are assigned by organizations like IANA and RIRs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views16 pages

2.5 IPv4

The document provides an introduction to TCP/IP and IPv4 networking concepts. It defines key terminology like octets, words, flags, and MTU. It describes the structure of an IPv4 packet including the header and fields like version, total length, identification, flags, fragment offset, TTL, protocol, and checksum. It also explains IPv4 addressing including Classful and CIDR addressing and how addresses are assigned by organizations like IANA and RIRs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Yonsei University

Introduction to TCP/IP

IPv4
IPv4 Protocol

Network Protocol Terminology

Protocol Terminology
− 1 Octet = 1 Byte = 8 bits

− Word = Group of multiple bits


• 16 bit word, 32 bit word, etc.

− Flag = 1 bit Control Function


:

:

Copyright © Prof. Jong-Moon Chung 1


Yonsei University

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 Essential Functions


• Inter-Networking
• Routing

Copyright © Prof. Jong-Moon Chung 2


Yonsei University

IPv4

IPv4 Packet Header


− IPv4 packet header contains all required
functionalities to deliver an IPv4 packet
to its destination

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

Copyright © Prof. Jong-Moon Chung 3


Yonsei University

IPv4

IHL (Internet Header Length) (4 bits)


− Length of an IPv4 header in words
• 1 word = 4 octets = 4 bytes = 32 bits

− Minimum value is five, so the minimum header


length is (5 x 4 octets) = 20 octets

IPv4 Header

DS & ECN (8 bits)


− DS (Differentiated Services) field
• First 6 bits
• Distinguishes service priority assignments

Copyright © Prof. Jong-Moon Chung 4


Yonsei University

IPv4

DS & ECN (8 bits)


− ECN (Explicit Congestion Notification) field
• 2 bits following the DS field
• Used for explicit signaling of congestion in the
network to slow down the speed of packets being
transmitted when delay/congestion is detected

IPv4

Total Length (16 bits)


− Total length of the IP packet in units of octets
(includes the whole packet)
− Maximum IP packet length is
(216–1)= 65,535 octets = 524,280 bits
− IPv4 packet size is limited by Layer 2’s frame size

Copyright © Prof. Jong-Moon Chung 5


Yonsei University

MTU (Maximum Transfer Unit)

MTU
• Maximum size of an IP packet that can be transmitted without
fragmentation over a medium

Ethernet (IEEE 802.3 standard)


• 1500 octets of MTU
• 18~22 octets of additional overhead added when transmitted
46  1500 octets

MTU (Maximum Transfer Unit)

Wi-Fi (IEEE 802.11 WLAN standard)


• 2304 octet maximum size MSDU (MAC Service Data Unit)
MTU
• MPDU (MAC Protocol Data Unit) includes
• FC (Frame Control), Duration ID, Addresses, MSDU, and FCS
0  2304 octets

Copyright © Prof. Jong-Moon Chung 6


Yonsei University

IPv4

Identification (16 bits)


− Identification is a sequence number used to
uniquely identify the IPv4 packet
− Used together with the Source Address,
Destination Address, and Protocol field

IPv4 Header

Flags & Fragment Offset


− Used in Packet Fragmentation
− Used to divide a packet if the packet is
too large to pass through a certain network

Copyright © Prof. Jong-Moon Chung 7


Yonsei University

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

Fragment Offset (13 bits)


− Indicates where in the original datagram
does this fragment belong to (in 64 bit units)
− Fragments other than the last fragment must contain
a data field that is a multiple of 64 bits in length

Copyright © Prof. Jong-Moon Chung 8


Yonsei University

IPv4

Time to Live (8 bits)


− TTL (Time to Live) specifies the time length
(in seconds) that a datagram is allowed to
remain in the Internet

IPv4 Header

Time to Live (8 bits)


− Every router that the IP packet passes through
should decrease the TTL by at least one
 TTL is similar to a hop count

Copyright © Prof. Jong-Moon Chung 9


Yonsei University

IPv4

Protocol (8 bits)
− Identifies the type of the next header in the
packet directly following the IPv4 header

IPv4

Protocol (8 bits)

Protocol Number Protocol Name Abbreviation


1 00000001 Internet Control Message Protocol ICMP
2 00000010 Internet Group Management Protocol IGMP
6 00000110 Transmission Control Protocol TCP
17 00010001 User Datagram Protocol UDP
41 00101001 IPv6 encapsulation ENCAP
89 01011001 Open Shortest Path First OSPF
132 10000100 Stream Control Transmission Protocol SCTP

There are many more

Copyright © Prof. Jong-Moon Chung 10


Yonsei University

IPv4

Header Checksum (16 bits)


− Error Detection code added to protect the IPv4
packet header from errors
− Does not protect the payload (data) part

IPv4

Header Checksum (16 bits)


− Errors are checked by the Header Checksum at
each router
− Checking is needed because IP header fields
may change when the packet is sent out a router
(e.g., TTL, Flags, Fragmentation, etc.)

Copyright © Prof. Jong-Moon Chung 11


Yonsei University

IPv4 Header

Source & Destination Addresses


− Each address is 32 bits
− Classful Addresses: Class A, B, C, D, E
− CIDR (Classless Inter-Domain Routing)

CIDR (Classless Inter-Domain Routing)

― Method to efficiently allocate IP addresses and


enable IP routing
― Introduced by IETF (Internet Engineering Task
Force) in 1993
― Replaces former Classful IP addressing used in
the Internet
• Class A, B, C based subnet sizes were too large
 Many unused (wasted) IP addresses

― Makes the Internet more scalable, because


networks can be assigned proper subnet sizes

Copyright © Prof. Jong-Moon Chung 12


Yonsei University

CIDR

― CIDR enables IPv4 & IPv6 address block


allocation to organizations based on
actual network size (number of PCs,
Servers) and short-term predicted needs

― CIDR can allocate IPv4 or IPv6


address spaces for ISPs and end users

― CIDR uses VLSM (Variable-Length


Subnet Masking)

CIDR VLSM Example

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

Copyright © Prof. Jong-Moon Chung 13


Yonsei University

CIDR IPv4/IPv6 Address Assignment

― IANA (Internet Assigned Numbers Authority)


assigns RIR (Regional Internet Registry)
CIDR blocks to countries or territories
(e.g. Europe, North America, etc.)

― RIRs are subdivided in to LIR (Local


Internet Registry) subnets, which are
further subdivided in to subnets to
fit local network sizes

IPv4

Options (variable)
− Includes the options requested by the sending
host computer (e.g., H1)

Copyright © Prof. Jong-Moon Chung 14


Yonsei University

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

Copyright © Prof. Jong-Moon Chung 15


Yonsei University

References

• J. Postel, “Internet Protocol DARPA Internet Program Protocol Specification,”


IETF RFC 791, Sep. 1981.
• D. Clark, “IP Datagram Reassembly Algorithms,” IETF RFC 815, Jul. 1982.
• Wikipedia, http://www.wikipedia.org
• William Stallings, Data and Computer Communications, 10th Ed. Prentice Hall,
2014.

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

Copyright © Prof. Jong-Moon Chung 16

You might also like