Internet Protocol Version 4 (IPv4)
This section provides comprehensive documentation on Internet Protocol version 4 (IPv4) as implemented in Microsoft Windows. IPv4 remains the foundational protocol for network communication on the internet, enabling devices to communicate across diverse networks.
Core Concepts
IPv4 is a network layer protocol that provides a unique numerical address (IP address) to each device connected to a network. It is responsible for logical addressing and routing of data packets.
IP Addressing
An IPv4 address is a 32-bit number, typically represented in dotted-decimal notation (e.g., 192.168.1.1
). These addresses are divided into classes (A, B, C, D, E), although the use of Classless Inter-Domain Routing (CIDR) has become standard.
- Public vs. Private Addresses: Understanding the distinction between addresses routable on the public internet and those reserved for private networks (RFC 1918).
- Subnetting: Techniques for dividing a network into smaller, manageable subnetworks to improve efficiency and security.
- Address Resolution Protocol (ARP): How IPv4 addresses are mapped to physical MAC addresses on a local network.
Packet Structure
An IPv4 packet, also known as a datagram, consists of a header and a payload. The header contains crucial information for routing and delivery.
Field | Description |
---|---|
Version | Indicates the IP version (4 for IPv4). |
Internet Header Length (IHL) | The length of the IP header in 32-bit words. |
Type of Service (ToS) | Specifies desired handling of the datagram (e.g., priority). |
Total Length | The total length of the IP packet, including header and data. |
Identification | Used to identify fragments of a single IP datagram. |
Flags | Control bits for fragmentation. |
Fragment Offset | Specifies the position of a fragment in the original datagram. |
Time to Live (TTL) | Limits the lifespan of a datagram to prevent infinite loops. |
Protocol | Indicates the next-level protocol being carried (e.g., TCP, UDP). |
Header Checksum | Error detection for the header. |
Source IP Address | The IP address of the sender. |
Destination IP Address | The IP address of the intended recipient. |
Options | Optional fields for specialized routing or debugging. |
IPv4 in Windows Networking
Windows provides robust support for IPv4, including:
- DHCP client and server for automatic IP address assignment.
- Static IP configuration.
- NAT (Network Address Translation) for sharing a single public IP address among multiple private devices.
- Support for various routing protocols.
Key Tools and APIs
Developers can leverage several tools and APIs to manage and interact with IPv4 in Windows:
- ipconfig: Command-line utility to display current TCP/IP network configuration values and refresh DHCP and DNS settings.
- ping: Utility to test network connectivity by sending ICMP echo requests.
- tracert: Utility to trace the route that packets take to a destination.
- Winsock API: The standard Windows Sockets API for network programming.
- Netsh: A command-line scripting utility that allows you to display or modify the network configuration of a computer.
Note: While IPv4 is still widely used, IPv6 is the future of the internet. Understanding both protocols is essential for modern network development.