IP Protocols and Traffic Types
TCP/IP Protocols and Traffic Types
Generic Routing Encapsulation (GRE)
Generic Routing Encapsulation (GRE) is a tunneling protocol that encapsulates network-layer packets inside other packets so they can travel across an IP network. GRE was developed by Cisco and can carry a wide variety of network-layer protocols.
A GRE tunnel creates a virtual point-to-point connection between two endpoints across a network such as the public internet. The endpoints treat the tunnel as though they were directly connected, even though the traffic is traveling through an intermediate network.
GRE does not provide encryption by itself. Encapsulation creates a tunnel, but it does not make the contents confidential.
GRE can carry multicast traffic and different network-layer protocols, making it useful when a tunnel must transport more than ordinary unicast IP traffic.
GRE is often paired with IPsec: GRE provides flexible encapsulation, while IPsec supplies security.
GRE overhead and jumbo frames
GRE adds approximately 24 bytes of overhead to a packet. This extra header space can reduce the room available for the original payload when the network’s maximum transmission unit (MTU) is fixed.
A standard Ethernet MTU is commonly 1,500 bytes. A jumbo frame is an Ethernet frame that supports a payload larger than the standard MTU. Jumbo frames can commonly carry payloads of up to 9,000 bytes, although the maximum depends on the network hardware and configuration.
Using jumbo frames can provide room for GRE’s added headers without reducing the intended payload size. All devices along the relevant network path must support the configured frame size.
Virtual Private Networks (VPNs)
A virtual private network (VPN) creates a protected connection over a public network, such as the internet. It allows a device to communicate with a private network as though it were locally connected to that network.
A VPN tunnel is the protected pathway between a device and a VPN endpoint. Traffic travels through this pathway rather than as unprotected traffic across the public network. Depending on the VPN design, a user may connect to a server directly or use that server as a jump point to reach other servers and devices.
Main VPN functions
Encryption: Protects data in transit so that third parties cannot readily read it.
Privacy: Helps conceal a user’s IP address and online activity from an internet service provider and other observers.
Remote access: Allows users outside an organization’s premises to securely reach internal systems and resources.
Access to restricted services: Masking the user’s apparent IP address can help bypass some geographic restrictions or censorship.
VPNs can be implemented using specialized cryptographic hardware, software, or both.
VPN concentrators
A VPN concentrator is a specialized network device, often functioning like a router or firewall, that manages many simultaneous VPN connections. Organizations use concentrators to let multiple remote users connect securely to a corporate network.
Always-on VPN
An always-on VPN automatically establishes and maintains a VPN connection, often in response to a user logging in or a change in network state. Unlike a traditional VPN connection that users manually start and stop, it requires little ongoing user management.
An always-on connection can help ensure that internet traffic remains encrypted and that remote devices can receive updates, software installations, and configuration changes whenever they are powered on and connected.
Common VPN types
Remote-access VPN
A remote-access VPN connects an individual user’s device to a private network from a remote location. It is commonly used by employees working from home, traveling, or otherwise accessing company resources away from the office.
Site-to-site VPN
A site-to-site VPN securely connects separate networks, often linking different physical locations belonging to the same organization. Devices at one location can communicate with devices at another through the protected connection.
Intranet and extranet VPNs
Intranet VPN: Provides secure connectivity among an organization’s own sites or internal networks.
Extranet VPN: Provides controlled, secure access for external parties, such as clients or business partners, to selected organizational resources.
Cloud VPN
A cloud VPN provides secure connectivity involving cloud-based networks.
Client-to-cloud VPN: Allows remote users to connect to an organization’s cloud network.
Network-to-network cloud VPN: Connects separate cloud networks or environments.
SSL/TLS VPN
An SSL/TLS VPN uses Secure Sockets Layer (SSL) or Transport Layer Security (TLS) to create a protected tunnel over the internet. Some implementations can be accessed without installing specialized client software, which can make them easier to deploy.
Double VPN
A double VPN routes traffic through two separate VPN servers. This adds another layer between the user and the destination and can make it harder to associate traffic with the user’s location or activity.
Internet Protocol Security (IPsec)
Internet Protocol Security (IPsec) is a framework and suite of protocols for securing communications over IP networks. It operates at Layer 3, the network layer, and can provide authentication, integrity, and confidentiality for IP traffic.
IPsec is widely used for VPNs, but it can also secure communications between devices or networks, including traffic within a local area network. It is also used to secure remote access and communications in software-defined wide-area networks (SD-WANs).
IPsec can be used to:
Encrypt data carried by applications.
Authenticate the source of data, helping verify that it came from a known sender.
Protect routing information sent across a public network.
Create protected tunnels between endpoints, encrypting traffic sent through the tunnel.
IPsec modes
Transport mode
Transport mode is typically used for end-to-end communication, such as between a client and a server. It protects the packet’s data payload, while the original IP header remains in place and is not encrypted.
Tunnel mode
Tunnel mode is commonly used for gateway-to-gateway, server-to-gateway, or server-to-server communication. It protects the entire original IP packet by encapsulating it inside a new packet. The outer header is used to route the protected packet between tunnel endpoints.
Tunnel mode therefore creates a virtual path through which packets travel. At the receiving gateway, the original packet is recovered and forwarded toward its destination.
IPsec protocols
Encapsulating Security Payload (ESP)
Encapsulating Security Payload (ESP) can provide:
Confidentiality through encryption.
Data integrity, allowing the receiver to detect modification.
Authentication of the data’s source.
Anti-replay protection, which helps prevent attackers from capturing and retransmitting valid packets.
ESP is commonly used when the contents of a packet must be encrypted.
Authentication Header (AH)
Authentication Header (AH) provides data integrity, source authentication, and anti-replay protection, but does not encrypt data. It does not provide confidentiality, so packet contents remain readable.
AH is used less often than ESP when confidentiality is required.
ESP and AH can be combined to provide authentication, integrity, and anti-replay protection for packet information, while ESP supplies confidentiality for the payload. For encryption of the transport-layer header and data, ESP must be used. The precise portions protected depend on the selected protocol and mode.
Security Associations, ISAKMP, and IKE
Security associations
A security association (SA) is an agreement that defines how two entities will communicate securely. It specifies security parameters such as the algorithms and keys used for encryption and authentication.
IPsec SAs are unidirectional: each one defines protection for traffic moving in one direction. Therefore, a bidirectional IPsec communication requires a pair of IPsec SAs—one for each direction.
Two kinds of associations are involved in IPsec communication:
IKE SA: Establishes a protected channel used to negotiate security settings.
IPsec SAs: Define the protection applied to the actual data traffic.
ISAKMP
The Internet Security Association and Key Management Protocol (ISAKMP) provides a general structure for managing security associations and key exchange. It defines procedures and message formats for establishing, negotiating, modifying, and deleting SAs between peers.
ISAKMP is commonly used in VPN and other secure communications systems to set up the arrangements needed for a protected channel.
Internet Key Exchange (IKE)
Internet Key Exchange (IKE) dynamically negotiates security settings and exchanges cryptographic key material to establish secure communications. The keys themselves are not simply sent across the network in readable form.
IKE performs several important tasks:
Negotiation: Selects the security policies and algorithms for the connection.
Identification and authentication: Allows each peer to verify the identity of the other.
Key exchange: Establishes cryptographic keys for secure communication.
IKE commonly uses the Diffie–Hellman key exchange. Each peer combines exchanged public information with its own private information to calculate shared secret material; the private keys themselves are not transmitted.
A useful distinction is that ISAKMP defines the framework and structure, while IKE describes how the negotiation and key exchange are carried out.
IKE version 2 (IKEv2) is commonly preferred because of improvements in speed, security, and efficiency. Microsoft also implemented an IKEv2-based VPN solution with features such as support for Active Directory, smart cards, Azure Active Directory extensions, always-on VPN, automatic connections, and transitions between networks. This Microsoft implementation is related to IPsec IKEv2 but should not be confused with the general IPsec IKEv2 protocol itself.
IPsec connection sequence
IKE Phase 1: Security Association negotiation
The two peers establish a protected negotiation channel and create an IKE SA.
IKE uses UDP port 500.
IKE Phase 2: IPsec SA setup
The peers negotiate the parameters that will protect the data, including cryptographic settings and keys.
They create a pair of unidirectional IPsec SAs and select ESP, AH, or both, along with the relevant IPsec mode.
Protected information exchange
Data travels through the IPsec tunnel according to the negotiated protocol and mode.
Rekeying and SA expiration
IPsec SAs expire after a specified time or amount of data.
IKE negotiates replacement keys and SAs when needed.
Tunnel termination
The protected connection is ended and its security associations are removed.
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP) is part of the Internet Protocol suite. It supports network diagnostics, error reporting, and operational queries. Routers, firewalls, and other network devices use ICMP messages to report problems or provide information about IP packet delivery.
Common diagnostic tools use ICMP:
Ping uses ICMP messages to test whether a destination can be reached and to assess response time.
Traceroute uses network responses, including ICMP messages, to help identify the route taken toward a destination.
ICMP helps diagnose connectivity and routing issues, but it is not itself a transport protocol for application data.
IP Traffic Types
IP traffic can be classified by how many destinations receive a transmission and how the network selects those destinations.
Unicast
Unicast is one-to-one communication: one host sends data directly to one other host. Connecting to a single server or pinging one server are common examples.
Broadcast
Broadcast is one-to-all communication within a broadcast domain: one host sends information to all nodes on the local network. It is similar to a public-address system announcing a message to everyone in an area.
Broadcast traffic generally does not pass through routers, which limit the spread of broadcasts between networks.
Multicast
Multicast is one-to-many communication in which one host sends traffic to a selected group of hosts simultaneously. It avoids sending a separate copy of the same data to every recipient.
The Internet Group Management Protocol (IGMP) is associated with managing multicast group membership in IP networks. Multicast is useful for applications such as internet television, real-time streaming media, and video conferencing.
Anycast
Anycast uses one IP address at multiple network locations. The network routes a request to one of the available hosts, usually the nearest or most suitable according to routing costs, distance, latency, congestion, or other network conditions.
Anycast is used in load balancing, high-availability services, and globally distributed systems. For example, a DNS service using anycast can direct a query to a nearby server; if that server is unavailable, routing can direct traffic to another available location.
Anycast is one-to-one-of-many: a sender targets a shared address, and the network chooses one of the hosts advertising that address.
Key Applications and Distinctions
GRE creates a flexible tunnel and can carry multicast traffic, but does not encrypt the traffic by itself.
Jumbo frames can accommodate GRE overhead when supported across the relevant network path.
IPsec is a secure way to protect site-to-site connectivity.
ESP is the IPsec protocol that provides encryption; AH provides authentication and integrity but not confidentiality.
Ping uses ICMP.
A destination service that directs users to an appropriate nearby server can use anycast.
Direct communication from one host to another is unicast.
One host sending to all local nodes is broadcast, while sending to a selected group is multicast.

Ask anything
We've read this whole study set, so questions about it get the best answers.