🦁 IP Animals
📋 References & Cheat Sheets

IP Protocol Numbers Reference

The IANA-assigned protocol numbers that live in the IP header's Protocol (IPv4) or Next Header (IPv6) field — 6 TCP, 17 UDP, 1 ICMP, 47 GRE and more. Filter by number, keyword or name.

NumberKeywordProtocol

Every IP packet carries a single byte that answers one question: what is inside me? In IPv4 this is the Protocol field; in IPv6 it is the Next Header field. Both use the same 8-bit number space (0–255), maintained by IANA, so a value of 6 always means TCP and 17 always means UDP, whichever IP version is carrying it.

This is a different concept from a port number, and mixing them up is a common source of confusion. The protocol number sits in the IP header and names the transport protocol itself. Port numbers sit inside the TCP or UDP header and name the application. Some protocols — ICMP, GRE, ESP — have a protocol number but no ports at all, which is exactly why you configure a firewall to "allow protocol 47" rather than "allow a port".

🛡️ Why VPNs need specific protocol numbers

IPsec and GRE tunnels do not ride on TCP or UDP ports, so a firewall that only understands ports will silently drop them. To pass an IPsec VPN you must permit ESP (50) and AH (51); for a GRE tunnel you must permit GRE (47). This is a frequent cause of "the VPN connects but no traffic flows".

The numbers below are the ones you will actually meet: the transport workhorses TCP and UDP, the control protocols ICMP and IGMP, the encapsulation and tunnelling protocols for VPNs, the two IPsec protocols, and the routing protocols OSPF and PIM. IANA's full registry lists all 256 values, but most are unassigned or reserved.

To understand the layer this sits in, read What is an IP address?, and to see how protocol numbers relate to the ports above them, browse our Common Ports reference. You can inspect real traffic destinations with the DNS Lookup tool.

Frequently asked questions

What is an IP protocol number?

It is an 8-bit value (0–255) in the Protocol field of an IPv4 header, or the Next Header field of an IPv6 header. It tells the receiving host which transport or upper-layer protocol the packet's payload contains — for example 6 for TCP or 17 for UDP.

How is a protocol number different from a port number?

They operate at different layers. The protocol number lives in the IP header and identifies the transport protocol itself (TCP 6, UDP 17). Port numbers live inside the TCP and UDP headers and identify the application (443 for HTTPS). Protocols like ICMP and GRE have a protocol number but no ports.

What protocol number does ICMP use?

ICMP for IPv4 uses protocol number 1. IPv6 uses a separate protocol, ICMPv6, which is protocol number 58. Ping and traceroute rely on ICMP, so a firewall blocking protocol 1 also blocks ping.

What are GRE, ESP and AH used for?

GRE (47) is a tunnelling protocol that wraps one packet inside another, common in VPNs. ESP (50) and AH (51) are the IPsec protocols: ESP encrypts and authenticates the payload, AH provides authentication only. Firewalls must permit these numbers for IPsec and GRE VPNs to work.

Want the theory? Read the guides → · Visit the zoo →