{"slug":"ip","title":"IP","summary":"Internet Protocol (IP) is the foundational communication protocol that enables data transmission across the internet by providing standardized packet formatting, addressing, and routing mechanisms that allow devices on different networks to communicate globally.","content_md":"# Internet Protocol (IP)\n\n**Internet Protocol (IP)** is the fundamental communication protocol that enables data transmission across the internet and other computer networks. IP defines how data packets are formatted, addressed, transmitted, routed, and received between devices on interconnected networks. It serves as the foundation layer that makes global internet communication possible by providing a standardized method for devices to find and communicate with each other across diverse network infrastructures.\n\nIP operates as a **connectionless protocol**, meaning it sends data packets independently without establishing a dedicated communication path between sender and receiver. Each packet contains addressing information that allows network routers to forward it toward its destination, even if packets take different routes or arrive out of order.\n\n## Core Functionality\n\nIP addresses serve as unique identifiers for devices on a network, similar to postal addresses for physical mail. When a device wants to send data to another device, it packages the information into packets that include the destination IP address, source IP address, and the actual data payload. Network routers examine these addresses and forward packets along the most efficient available path toward the destination.\n\nThe protocol handles **packet fragmentation** when data exceeds the maximum transmission unit of a network segment. Large packets are broken into smaller fragments that can be reassembled at the destination. IP also provides basic error detection through checksums, though it does not guarantee packet delivery or correct ordering—these functions are handled by higher-layer protocols like TCP.\n\n## IP Versions\n\n### IPv4\n\n**Internet Protocol version 4 (IPv4)** has been the dominant IP version since the 1980s. IPv4 uses 32-bit addresses, typically written in dotted decimal notation like 192.168.1.1. This addressing scheme provides approximately 4.3 billion unique addresses, which seemed abundant when the internet was smaller but has led to address exhaustion as billions of devices came online.\n\nIPv4 packets contain a 20-byte header with fields for version, header length, type of service, total length, identification, flags, fragment offset, time to live, protocol, header checksum, source address, and destination address. The time to live field prevents packets from circulating indefinitely by decrementing at each router hop.\n\n### IPv6\n\n**Internet Protocol version 6 (IPv6)** was developed to address IPv4's limitations, primarily address exhaustion. IPv6 uses 128-bit addresses, written in hexadecimal notation like 2001:0db8:85a3:0000:0000:8a2e:0370:7334. This provides approximately 340 undecillion unique addresses—enough to assign unique addresses to every atom on Earth's surface.\n\nIPv6 introduces several improvements beyond expanded addressing. It simplifies packet headers for more efficient processing, includes built-in security features through IPSec, and provides better support for mobile devices and real-time applications. IPv6 also eliminates the need for Network Address Translation (NAT) that became necessary with IPv4 address scarcity.\n\n## Routing and Network Architecture\n\nIP routing relies on **routing tables** maintained by routers throughout the internet. These tables contain information about network destinations and the best paths to reach them. Routers use protocols like Border Gateway Protocol (BGP), Open Shortest Path First (OSPF), and Routing Information Protocol (RIP) to share routing information and adapt to network changes.\n\nThe internet's hierarchical structure divides IP addresses into network and host portions. **Subnet masks** define this division, allowing networks to be subdivided into smaller segments. Classless Inter-Domain Routing (CIDR) provides flexible address allocation that doesn't conform to traditional class boundaries, enabling more efficient use of address space.\n\n```mermaid\nflowchart TD\n    A[Source Device] --> B[Local Router]\n    B --> C[ISP Router]\n    C --> D[Internet Backbone]\n    D --> E[Destination ISP]\n    E --> F[Destination Router]\n    F --> G[Destination Device]\n    B --> H[Routing Table Lookup]\n    H --> I[Next Hop Selection]\n    I --> C\n```\n\n## Private and Public Addressing\n\nIP addressing distinguishes between **public addresses** that are globally unique and routable on the internet, and **private addresses** used within local networks. Private address ranges (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 in IPv4) allow organizations to create internal networks without consuming public address space.\n\n**Network Address Translation (NAT)** enables devices with private addresses to communicate with the public internet by translating private addresses to public ones at the network boundary. This technique became essential as IPv4 addresses became scarce, though it introduces complexity and can interfere with certain applications.\n\n## Quality of Service and Traffic Management\n\nModern IP implementations include **Quality of Service (QoS)** mechanisms that prioritize different types of traffic. The Type of Service field in IPv4 and Traffic Class field in IPv6 allow routers to handle packets differently based on application requirements. Real-time applications like voice and video can receive priority over less time-sensitive data like email or file transfers.\n\n**Differentiated Services (DiffServ)** provides a scalable approach to QoS by marking packets with service class information. Network operators can configure routers to provide different levels of service based on these markings, enabling service level agreements and improved user experience for critical applications.\n\n## Security Considerations\n\nIP itself provides minimal security features, making it vulnerable to various attacks. **IP spoofing** allows attackers to forge source addresses, potentially bypassing access controls or launching denial-of-service attacks. **Packet sniffing** can intercept unencrypted data transmitted over networks.\n\nSecurity is typically implemented at higher protocol layers or through additional protocols. **IPSec** provides authentication and encryption for IP packets, while **Virtual Private Networks (VPNs)** create secure tunnels over public networks. Firewalls examine IP headers to filter traffic based on addresses, ports, and protocols.\n\n## Modern Developments\n\nThe transition from IPv4 to IPv6 continues gradually, with many networks running **dual-stack** configurations that support both protocols simultaneously. **IPv6 adoption** varies globally, with some regions showing higher deployment rates than others.\n\n**Software-Defined Networking (SDN)** and **Network Function Virtualization (NFV)** are changing how IP networks are managed and configured. These technologies allow more flexible and programmable network control, enabling rapid deployment of new services and more efficient resource utilization.\n\n## Related Topics\n\n- Transmission Control Protocol (TCP)\n- Domain Name System (DNS)\n- Border Gateway Protocol (BGP)\n- Network Address Translation (NAT)\n- Subnet Mask\n- Internet Service Provider (ISP)\n- Open Systems Interconnection (OSI) Model\n- Virtual Private Network (VPN)\n\n## Summary\n\nInternet Protocol (IP) is the foundational communication protocol that enables data transmission across the internet by providing standardized packet formatting, addressing, and routing mechanisms that allow devices on different networks to communicate globally.\n\n\n\n","sources":[],"infobox":{"Type":"Network Protocol","Layer":"Network Layer (Layer 3)","Address Space":"IPv4: 32-bit, IPv6: 128-bit","First Defined":"1974","Standards Body":"Internet Engineering Task Force (IETF)","Current Versions":"IPv4 (1981), IPv6 (1998)"},"metadata":{"tags":["internet-protocol","networking","ipv4","ipv6","routing","tcp-ip"],"quality":{"status":"generated","reviewed_by":[],"flagged_issues":[]},"category":"Technology","difficulty":"intermediate","subcategory":"Computer Networks"},"model_used":"anthropic/claude-sonnet-4","revision_number":1,"view_count":3,"related_topics":[],"sections":["Internet Protocol (IP)","Core Functionality","IP Versions","IPv4","IPv6","Routing and Network Architecture","Private and Public Addressing","Quality of Service and Traffic Management","Security Considerations","Modern Developments","Related Topics","Summary"]}