Secure Tunneling IP Network Protocol IDs

Topics · Published 2019-12-02 · Revised 2026-11-23
Reviewed corrections applied locally; pre-review version preserved separately · Joomla source

5,735 Total views across this article’s versions; includes the historical baseline where available.

Tunnels in IT networking carry one protocol’s traffic inside another protocol between endpoints. They can connect hosts or networks, and do not require the endpoints to be on different subnets. A tunnel may protect against eavesdropping, tampering, or both, but encapsulation alone does not provide that protection. This article covers both secure VPN protocols and related encapsulation mechanisms.

Contents

This article explains the following concepts:

Quality of Service (QoS)

Quality of Service (QoS) covers traffic classification and forwarding treatment, including queueing, shaping and policing. A classifier can use addresses, protocol numbers, ports or other packet information. Differentiated Services uses a DS codepoint (DSCP) to select a per-hop forwarding behavior; it is not simply an IANA list of protocols ranked by priority. See RFC 2474 and RFC 2475.

What Does QoS Have to Do with an Article on Tunneling IP Protocols?

Tunnel headers add overhead, and encryption can add processing cost. Whether that matters depends on the traffic, equipment and bottleneck. QoS can help manage competing traffic, but does not create additional capacity.

Queueing and scheduling normally control packets leaving an interface; classification or policing can also occur on ingress. Encrypted tunnels may hide inner ports and application details from an intermediate router, so a policy may need to classify traffic before encapsulation or use appropriate outer-header markings. It should be based on actual traffic needs, not a blanket rule that every tunnel deserves priority. RFC 2475 describes the classification and forwarding model.

IP Protocols

IPv4 has an 8-bit Protocol field. IPv6 has an 8-bit Next Header field using the same IANA number registry. These identify the next protocol or header. In IPv6, an extension header may come before the transport header, so the base header need not point directly to TCP or UDP. See RFC 8200.

Protocol numbers are distinct from port numbers. TCP is IP protocol 6 and UDP is IP protocol 17; TCP port 443 is a field inside TCP, not IP protocol 443. A port is a useful configuration clue, but applications can use other ports and several protocols can share one.

Tunneling Protocols

Encapsulation and cryptographic protection are separate properties. GRE and IP-in-IP provide encapsulation without encryption; IPsec ESP can provide cryptographic protection as well as tunnel-mode encapsulation. The word tunnel alone does not tell you which security services are present.

The following values identify the immediately encapsulated protocol in the IANA registry. They are not TCP or UDP ports.

IP protocol numberNameWhat the number identifies
4IPv4An encapsulated IPv4 packet.
41IPv6An encapsulated IPv6 packet; this is also used for IPv6-in-IPv4 tunneling.
47GREGeneric Routing Encapsulation.
50ESPEncapsulating Security Payload; security services depend on the negotiated/configured SA.
51AHAuthentication Header; integrity/authentication, not payload encryption.
115L2TPDirect-IP L2TPv3. Ordinary L2TPv2 over UDP uses IP protocol 17 and starts at UDP destination port 1701.

IPsec does not require AH and ESP together. An individual IPsec Security Association uses AH or ESP; combining them requires separate SAs. ESP may also be carried over UDP for NAT traversal, so an observer then sees UDP in the outer IP header. See RFC 4301, RFC 4302, RFC 4303 and RFC 3948.

Common Tunneling Protocols

Certain tunneling protocols are more frequently used than others.

GRE (Generic Routing Encapsulation)

Generic Routing Encapsulation (GRE) carries a payload protocol inside a delivery protocol. It can carry network-layer packets and is not limited to Ethernet or Layer 2. When carried directly in IPv4, GRE uses IP protocol 47. Basic GRE provides neither encryption nor cryptographic authentication; calling the connection private does not establish confidentiality. See RFC 2784.

PPTP (Point-to-Point Tunneling Protocol)

PPTP establishes a control connection to TCP destination port 1723 and uses an enhanced GRE format to carry PPP packets. The data channel is not carried over TCP port 1723. RFC 2637 describes both channels.

PPP supplies framing, link negotiation and support for negotiated authentication; it is not itself a particular encryption algorithm. Weaknesses in a PPTP deployment’s authentication/encryption mechanisms are not grounds for declaring every use of PPP insecure. See RFC 1661.

PPTP is a legacy choice to avoid for a new security-sensitive deployment. Microsoft deprecated PPTP and L2TP in Windows Server in 2024 and announced their removal from releases after Windows Server 2025; they remain supported in Server 2025 during its lifecycle. This is dated product guidance, not a claim that every existing implementation has already disappeared.

IPsec

IPsec is a framework for protecting IP traffic, rather than one product or one mandatory stack of nested protocols. AH provides integrity and authentication without confidentiality. ESP can provide confidentiality and integrity/authentication. Both have transport and tunnel modes. RFC 4301 defines the architecture.

A Security Association (SA) is unidirectional security state, including the selected protection and associated keying information. It is distinct from the policy deciding which traffic to protect. Bidirectional protected communication normally needs an SA in each direction. SAs can be manually configured or established using a key-management protocol; negotiation is not an absolute prerequisite for every possible IPsec configuration.

IKEv2 authenticates peers and negotiates keying material and SAs. It is separate from the AH/ESP data protection. IKE uses UDP ports 500 and 4500; ESP-in-UDP NAT traversal also uses port 4500. The IPsec architecture allows host-to-host, host-to-gateway and gateway-to-gateway uses. See the IPsec article for more detail. Neither a protocol’s popularity nor its age establishes a universal security ranking.

GRE protected by IPsec

GRE encapsulation and IPsec protection are separate. For example, IPsec transport mode can protect GRE traffic between security gateways, as described in RFC 4301, Section 4.1. In that arrangement GRE provides the tunnel and IPsec protects its IP traffic; it does not make IPsec a Layer 2 protocol. RFC 2784 defines GRE, including its use of IP protocol number 47 when carried directly in IPv4.

L2TP

L2TPv2 carries PPP sessions across a packet network. Remote access is an important use case; it is not specifically a site-to-site-only mechanism. With the UDP transport described by RFC 2661, initiation uses destination port 1701. The specification allows the peers to select other source/reply ports, so a protocol description is not a complete firewall rule set.

L2TP does not itself encrypt the tunneled data. Tunnel authentication and PPP authentication are distinct from confidentiality. IPsec can protect L2TP traffic when authentication, integrity and encryption are required.

L2TP/IPsec Combo

In L2TP/IPsec, IPsec protects the L2TP traffic. RFC 3193 specifies ESP protection for L2TP control and data packets, requires transport-mode support, and permits tunnel mode. It does not put IPsec inside an already established L2TP tunnel to authenticate an IKE exchange.

A simplified transport-mode stack is outer IP → ESP → protected UDP/L2TP/PPP/inner packet. If ESP is encapsulated in UDP for NAT traversal, an additional outer UDP header appears before ESP. This describes the layering, rather than every field in the wire format.

RFC 3193’s Phase 1 and Phase 2 discussion concerns the earlier IKE protocol. IKEv2 instead uses named exchanges such as IKE_SA_INIT and IKE_AUTH. L2TP connectivity is not proof of peer identity; the configured authentication and cryptographic checks provide that assurance. See RFC 7296.

L2TPv3

L2TPv3 generalizes L2TP to carry Layer-2 connections, or pseudowires, beyond the PPP sessions of L2TPv2. It can run directly over IP using protocol 115 or over UDP. RFC 3931 defines the control and session mechanisms and their security considerations.

Providers can use pseudowires to connect Layer-2 services across an IP network. Establishing a session in advance does not reserve a faster physical route, eliminate congestion or guarantee lower latency. L2TPv3 is not an encrypted VPN merely because it creates a virtual Layer-2 connection.

OpenVPN

OpenVPN is a configurable VPN implementation supporting routed IP tunnels and Ethernet bridging. It can use UDP or TCP; the standard default port is 1194, and the transport and port are configurable. In TLS mode, it uses TLS for the control channel and negotiates protection for the separate data channel.

OpenVPN depends on cryptographic libraries; it is not entirely self-contained in contrast to IPsec. The OpenVPN 2.6 manual documents OpenSSL integration and options specific to supported library builds. Security and performance depend on the software version, authentication, algorithms, configuration and hardware. A protocol name alone does not guarantee privacy or establish that it is always superior to another properly configured VPN.

SSTP

SSTP (Secure Socket Tunneling Protocol) carries PPP frames over HTTPS, normally using TCP port 443. The Microsoft specification describes TCP and TLS setup, HTTPS, SSTP negotiation and PPP negotiation. TLS provides channel protection; PPP authentication and SSTP’s cryptographic binding tie the relevant authentication to that channel.

Using HTTPS can help traverse firewalls and web proxies, but it does not make the VPN undetectable or guarantee passage through every proxy policy. Authentication capabilities and performance depend on the deployment; the protocol description does not support a blanket claim that SSTP has no endpoint authentication or is always less secure than another VPN.

WireGuard

The original article described WireGuard as experimental. That needs a date: WireGuard 1.0.0 for Linux 5.6 was announced on March 30, 2020, shortly after this article’s original publication and update. The earlier prediction that it would remain experimental for the foreseeable future is obsolete.

WireGuard uses a deliberately fixed cryptographic design and sends its protocol packets over UDP. Its listening port is configurable; if unspecified or zero, a port is selected randomly when the interface comes up. A commonly chosen port is not a unique IP protocol number or a guarantee that traffic using it is WireGuard. Deployment still requires peer keys, routing and access policy.

Honorable Mentions

The following technologies serve different purposes. OpenConnect is a VPN client, Teredo supplies an IPv6 transition mechanism, and VXLAN provides a Layer-2 overlay. They are not interchangeable consumer VPN services.

OpenConnect

OpenConnect is an open-source VPN client, initially for Cisco AnyConnect-compatible servers and now supporting several VPN protocols. A separate project, ocserv, supplies an AnyConnect-compatible VPN server.

The transport depends on the selected protocol. In the AnyConnect-compatible case, HTTPS/TLS handles authentication and the control/backup data channel, while DTLS can provide a UDP data channel. DTLS means Datagram Transport Layer Security. Other supported protocols can use different arrangements, including UDP-encapsulated ESP. OpenConnect documents IPv4/IPv6 and proxy options; support should be checked for the selected server protocol rather than inferred from the client name.

Teredo Tunneling

Teredo carries actual IPv6 packets over UDP/IPv4, including through some NAT devices. It does not simulate IPv6. RFC 4380 defines servers that help clients establish connectivity and relays that forward between Teredo and native IPv6 networks.

UDP port 3544 is the Teredo server’s well-known port. A client’s service port and its NAT mapping are separate, so not every Teredo data packet necessarily has destination port 3544. Teredo provides encapsulation and transition functions, not VPN encryption.

VXLAN

Virtual Extensible LAN (VXLAN) carries Ethernet frames inside a VXLAN header and UDP/IP. This is another encapsulation approach, not the opposite of tunneling. It uses a 24-bit VXLAN Network Identifier (VNI) to distinguish overlay segments.

RFC 7348 assigns UDP destination port 4789 as the default while permitting configuration for interoperability with older implementations. VXLAN does not itself provide encryption or cryptographic peer authentication; those require protection elsewhere in the design.

Footnotes

1 Assigned Internet Protocol Numbers, Internet Assigned Numbers Authority, checked November 23, 2026. The protocol numbers above are separate from the TCP/UDP service ports described in the individual sections.