Internet Protocol version 4 facts for kids
Protocol stack | |
![]() IPv4 packet
|
|
Abbreviation | IPv4 |
---|---|
Purpose | internetworking protocol |
Developer(s) | DARPA |
Introduction | 1981 |
Influenced | IPv6 |
OSI layer | Network layer |
RFC(s) | 791 |
Top - 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). Think of it as a set of rules that helps computers talk to each other over the Internet. It's one of the main ways information travels across the web.
IPv4 was first used in 1982 and 1983. Even though a newer version, IPv6, exists, IPv4 is still used for most Internet traffic today. It uses a special system of 32-bit numbers to give each device a unique address. This allows for about 4.3 billion different addresses.
How IPv4 Works
History of IPv4
The Internet Protocol version 4 was first described in 1981. It was created by DARPA, a US government agency. In 1982, the US Department of Defense decided to use IPv4 as the standard for all its computer networks. This helped make IPv4 very important for the early Internet.
What is IPv4's Job?
IPv4's main job is to connect different computer networks together. It helps create the Internet as we know it. It uses a system of logical addresses, like a street address for your computer.
IPv4 also performs routing. This means it figures out the best path for data to travel from one computer to another. When you send an email or visit a website, IPv4 helps guide that information.
IPv4 sends data in a "connectionless" way. This means it sends information without first setting up a dedicated connection. It tries its "best effort" to deliver the data. However, it doesn't guarantee that the data will arrive, or that it will arrive in the correct order. Other rules, like the Transmission Control Protocol (TCP), handle these guarantees.
Understanding IPv4 Addresses
IPv4 addresses are 32 bits long. This means there are about 4.3 billion possible unique addresses. However, some of these addresses are set aside for special uses. For example, some are for private networks, like your home network. Others are for sending data to many devices at once (multicast).
How Addresses Look
IPv4 addresses are usually written as four numbers separated by dots. Each number can range from 0 to 255. This is called "dot-decimal notation."
For example, an IP address might look like 192.0.2.235. This is just a simpler way to write a long 32-bit binary number.
Sometimes, you'll see an address followed by a slash and another number, like 192.0.2.235/24. This is called CIDR notation. The number after the slash tells you how many bits are used for the network part of the address. It helps define the size of a network.
How Addresses Are Given Out
When IPv4 was first designed, addresses were given out in large blocks called "classes." This system quickly ran out of addresses.
To fix this, a new system called Classless Inter-Domain Routing (CIDR) was created. CIDR allows addresses to be given out in much more flexible ways. This helps manage the available addresses better.
Organizations like the Internet Assigned Numbers Authority (IANA) and regional Internet registries (RIRs) manage how IP addresses are given out around the world.
Special Addresses
Some IPv4 addresses are reserved for special purposes. They are not used for regular devices on the public Internet.
- Private networks: About 18 million addresses are set aside for private networks. These are used inside homes, schools, or businesses. For example, your home Wi-Fi network likely uses private IP addresses like 192.168.1.1. These addresses cannot be seen directly from the public Internet.
- Loopback: The address range 127.0.0.0/8 is used for "loopback." This means a device can send data to itself using this address. It's often used for testing. The most common loopback address is 127.0.0.1.
- Link-local addresses: Addresses like 169.254.0.0/16 are used when a device can't get a regular IP address. For example, if your computer can't connect to a DHCP server, it might assign itself a link-local address. These addresses only work on the local network segment.
- Network and Broadcast Addresses: In any network, the very first address is used to identify the network itself. The very last address is used to send a message to all devices on that network at once. These special addresses are usually not given to individual devices.
Private Networks
Here are the main ranges of addresses reserved for private networks:
Name | CIDR block | Address range | Number of addresses |
---|---|---|---|
24-bit block | 10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 | 16777216 |
20-bit block | 172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 | 1048576 |
16-bit block | 192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 | 65536 |
Since private networks can't talk directly over the public Internet, they often use a virtual private network (VPN). A VPN creates a secure "tunnel" over the Internet, allowing private networks to communicate safely.
Translating Names to Addresses
When you type a website name like "www.example.com" into your browser, your computer doesn't use that name to find the website. It needs an IP address. The Domain Name System (DNS) acts like a phone book for the Internet. It translates website names into their corresponding IP addresses.
Running Out of Addresses
In the 1980s, people realized that IPv4 addresses were running out faster than expected. More and more people were using the Internet, and devices like smart phones and always-on Internet connections needed their own addresses.
To slow down the exhaustion, several solutions were developed:
- Classless Inter-Domain Routing (CIDR): This allowed for more flexible and smaller allocations of IP addresses.
- network address translation (NAT): This lets many devices on a private network share a single public IP address. Your home router uses NAT so all your devices can access the Internet with one public IP.
Despite these efforts, the main pool of IPv4 addresses ran out in 2011. This means there are no new large blocks of IPv4 addresses to give out.
The long-term solution is IPv6. IPv6 has a much, much larger address space – enough for practically every device on Earth. However, IPv4 and IPv6 don't directly understand each other. So, special technologies are needed to help devices using different versions communicate.
How IPv4 Packets Are Built
When information travels over the Internet, it's broken down into small pieces called "packets." An IPv4 packet has two main parts: a header and data.
- Header: This is like the envelope of a letter. It contains important information about the packet, such as where it came from, where it's going, and how big it is.
- Data: This is the actual information you are sending, like part of a web page or an email.
Packet Header Details
The IPv4 header has several fields, each with a specific job:
- Version: This field always shows "4" for IPv4.
- Header Length (IHL): This tells you how long the header is. It can change if there are optional settings.
- Total Length: This field tells you the total size of the entire packet (header + data) in bytes. The maximum size is about 65,535 bytes.
- Identification: This helps identify all the pieces (fragments) that belong to the same original large packet.
- Flags: These are special bits that control how packets are handled. One important flag is "Don't Fragment." If this flag is set, the packet won't be broken into smaller pieces.
- Fragment Offset: If a packet is broken into pieces, this field tells you where each piece fits in the original packet.
- Time To Live (TTL): This field prevents packets from endlessly circling the Internet. Each time a packet passes through a router, the TTL decreases by one. If it reaches zero, the packet is thrown away. This is how tools like "traceroute" work, showing you the path a packet takes.
- Protocol: This tells the computer what kind of data is inside the packet (e.g., web data, email data).
- Header Checksum: This is a simple error-checking code for the header. If the checksum doesn't match, the packet is usually discarded.
- Source IP Address: This is the IP address of the computer that sent the packet.
- Destination IP Address: This is the IP address of the computer the packet is going to.
- Options: This is an optional field for special instructions, but it's not used very often.
Packet Data
The data part of the packet carries the actual information. The "Protocol" field in the header tells the receiving computer how to understand this data. Common types of data include:
Protocol Number | Protocol Name | Abbreviation |
---|---|---|
1 | Internet Control Message Protocol | ICMP |
2 | Internet Group Management Protocol | IGMP |
6 | Transmission Control Protocol | TCP |
17 | User Datagram Protocol | UDP |
41 | IPv6 encapsulation | ENCAP |
89 | Open Shortest Path First | OSPF |
132 | Stream Control Transmission Protocol | SCTP |
Breaking and Rebuilding Packets
Fragmentation
The Internet connects many different types of networks. These networks can have different "Maximum Transmission Units" (MTUs), which is the largest packet size they can handle. If a packet is too big for a network, it needs to be broken into smaller pieces, a process called "fragmentation."
In IPv4, routers (devices that guide traffic) can break packets into fragments. Each fragment then becomes its own smaller packet with its own header. The "More Fragments" flag and "Fragment Offset" field in the header help the receiving computer put the pieces back together.
For example, a large packet might be split into two or more smaller packets to fit through a network link. Each smaller packet will have updated header information to show it's a fragment and where it belongs.
Reassembly
When a computer receives fragmented packets, it knows they are fragments if the "more fragments" flag is set or the "fragment offset" is not zero. The computer uses the "Identification" field to group all the fragments that belong to the same original packet.
Once all the fragments arrive, the computer uses the "fragment offset" to put them back in the correct order. This rebuilds the original, larger packet.
Helper Protocols
IP addresses are not permanently linked to network hardware. To make sure IP packets get to the right device, other protocols help out:
- Address Resolution Protocol (ARP): This protocol helps translate an IP address into a physical hardware address (like a MAC address) on a local network.
- Dynamic Host Configuration Protocol (DHCP): When your computer connects to a network, DHCP automatically gives it an IP address. This means you don't have to manually set an IP address for every device.