Internet Protocol

On this page 7

The Internet Protocol (IP) is the network-layer protocol that gives every host a numeric address and moves self-contained units of data, called packets or datagrams, from a source to a destination across interconnected networks. It is the common layer beneath all other Internet protocols: HTTP, QUIC, SSH, NTP and MQTT all ride on IP, whether through TCP or UDP. Two versions are in use, IPv4 defined in RFC 791 and IPv6 defined in RFC 8200.

IP deliberately offers a best-effort, connectionless service. It does not guarantee delivery, ordering or freedom from duplication, and it leaves those duties to transport protocols and applications. This minimal design, often called the end-to-end principle, is the main reason the Internet scaled to billions of devices.

How the Internet Protocol delivers packets

The Internet Protocol delivers data by hop-by-hop forwarding. A sending host wraps a transport segment in an IP header that carries the source and destination addresses, then hands the packet to the next router. Each router looks up the destination in its forwarding table using longest-prefix match, decrements a hop counter, and passes the packet on until it reaches the destination network.

Routers keep no per-connection state, so packets of the same conversation may take different paths and arrive out of order. If a router cannot forward a packet, it discards it and may send an error message through ICMP. The hop counter, called TTL in IPv4 and Hop Limit in IPv6, prevents packets from circulating forever in a routing loop.

The table shows how responsibilities are divided between IP and the layers around it.

LayerExample protocolsResponsibility
ApplicationHTTP, SSH, NTPMeaning of the data
TransportTCP, UDP, QUICPorts, reliability, ordering
InternetIPv4, IPv6, ICMPAddressing and routing
LinkEthernet, Wi-FiDelivery on one local segment
Division of duties around the Internet Protocol

IPv4 and IPv6 header structure

Both versions place a fixed set of control fields in front of the payload, but IPv6 simplified the header to speed up forwarding. The IPv4 header is 20 to 60 bytes long because of optional fields, while the IPv6 base header is a constant 40 bytes, with optional features moved into extension headers.

FunctionIPv4 fieldIPv6 field
VersionVersion = 4Version = 6
Loop protectionTime to LiveHop Limit
Payload typeProtocolNext Header
Traffic classDSCP and ECNTraffic Class and ECN
IntegrityHeader checksumNone, left to other layers
FragmentationIdentification, flags, offsetFragment extension header
Flow handlingNot available20-bit Flow Label
Key header fields in IPv4 and IPv6

Removing the header checksum in IPv6 spares every router a recalculation at each hop, since link layers and transport protocols already detect corruption. The Next Header chain lets IPv6 add routing, fragmentation or security options without changing the base format.

Addressing, prefixes and fragmentation

An IP address identifies a network interface, not a person or device as a whole. Addresses are split into a network prefix and a host part, written in CIDR notation such as 192.0.2.0/24 or 2001:db8::/32. Routers advertise prefixes, not individual addresses, which keeps global routing tables manageable.

PropertyIPv4IPv6
Address length32 bits128 bits
Address spaceAbout 4.3 billionAbout 3.4 × 10^38
NotationDotted decimalHexadecimal groups with colons
Typical subnet/24 or smaller/64 per link
ConfigurationDHCP or manualSLAAC, DHCPv6 or manual
Address sharingNAT is commonGlobal addresses are normal
Address characteristics of the two IP versions

Every link has a maximum transmission unit (MTU), commonly 1,500 bytes on Ethernet. IPv4 routers may fragment oversized packets unless the DF (do not fragment) flag is set, while IPv6 routers never fragment and only the sender may do so. Senders therefore rely on Path MTU Discovery, which depends on ICMP Packet Too Big messages reaching them; filtering those messages causes the familiar black-hole connection symptom.

How IP relates to neighboring protocols

IP is often confused with the protocols that run on top of it or alongside it. The comparison below clarifies what each one adds and why IP remains intentionally minimal.

ProtocolLayerWhat it adds to IP
ICMPInternetError reporting and diagnostics
TCPTransportReliable ordered byte stream
UDPTransportPorts and an optional checksum only
QUICTransport over UDPEncrypted multiplexed streams
TLSAbove transportAuthentication and encryption
IPsecInternetPacket-level security for IP itself
Internet Protocol compared with related protocols

The common shorthand TCP/IP names the whole suite, not a single protocol. Tools such as ping and traceroute work at the IP and ICMP level, which is why they can reveal routing problems even when no application is running.

Limitations and common misconceptions

Because IP is best effort, many expectations attached to it are incorrect. The most frequent misconceptions and their corrections are:

  • An IP address is not a precise location. Geolocation databases estimate it and are often wrong at city level.
  • IP does not guarantee delivery. Loss, reordering and duplication are normal and handled above IP.
  • NAT is not a security control. It hides addresses as a side effect, while a firewall enforces policy.
  • IPv6 is not an extension of IPv4. The versions are not wire-compatible and need dual stack, translation or tunneling.
  • The source address is not authenticated. Spoofing is possible unless networks apply ingress filtering.

Operationally, the biggest challenge remains the long IPv4 to IPv6 transition. Most networks run dual stack for years, and clients use Happy Eyeballs logic to try both versions and keep the faster connection.

In everyday language

The Internet Protocol works like the address system of a postal service. Every device gets an address, and data is cut into small envelopes that each carry the sender and recipient addresses.

Sorting centers, which are routers, read only the destination and pass each envelope one step closer. They do not promise that every envelope arrives or arrives in order; other protocols check that later. That simple job is what lets the whole Internet work.

Seen in the real world

A mid-sized university enables IPv6 on its campus network, which already uses IPv4 with NAT for about 18,000 students and staff. The network team assigns a /48 prefix from its provider, gives every building a /56 and every VLAN a /64, and lets laptops configure themselves through SLAAC while servers keep static addresses.

Shortly after rollout, some users report that large file downloads stall while small web pages load. The team traces the problem to a firewall that drops ICMPv6 Packet Too Big messages on a tunneled link with a 1,480-byte MTU, so Path MTU Discovery fails. Allowing those ICMPv6 messages resolves the stalls immediately.

After six months, more than half of campus traffic runs over IPv6, mostly to large content and cloud providers, and the load on the IPv4 NAT gateways drops accordingly.