Theoretical Background
1. Introduction to IPv4
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version deployed for production on SATNET in 1982 and on the ARPANET in January 1983.
- Connectionless protocol (No prior connection setup).
- Best-effort delivery (No guaranteed delivery).
- Media Independent (Operates on any underlying hardware).
2. Packet Header Structure
The IPv4 packet header consists of 14 fields, of which 13 are required. The 14th field is optional. The header length is typically 20 bytes (without options).
3. IPv4 Addressing & Classes
An IPv4 address is a 32-bit number that uniquely identifies a network interface on a machine. It is typically written in human-readable notation (Dotted Decimal).
Default Mask: 255.0.0.0 (/8)
Used for very large networks.
Default Mask: 255.255.0.0 (/16)
Used for medium-sized networks.
Default Mask: 255.255.255.0 (/24)
Used for small LANs.
Not for general host assignment.
4. Subnetting
Subnetting is the practice of dividing a network into two or more smaller networks. It increases routing efficiency and enhances network security.
Interactive Simulation
Subnet Calculator
Packet Header Lab
Construct a packet and visualize its binary representation.
Network Analysis Results
Binary Visualization (IP Address)
Packet Structure Visualization
Packet Anatomy
Hover over the fields in the diagram above to see their function. The Header contains routing information, while the Payload contains the actual data being sent.
Ready to Simulate
Use the controls on the left to calculate subnet details or construct a binary packet.
Lab Procedure
Understanding IPv4 Addressing
Start by examining the different classes of IPv4 addresses. Use the Subnet Calculator to input addresses from different classes (e.g., 10.0.0.1, 172.16.0.1, 192.168.1.1).
- Observe how the default subnet mask changes based on the class.
- Verify the binary representation of the first octet.
Subnetting Analysis
Select a Class C network (e.g., 192.168.1.0/24). Use the slider to change the CIDR prefix from /24 to /26.
- Record the new Subnet Mask.
- Calculate manually how many subnets are created (22 = 4).
- Verify the results in the simulation: Network Address, Broadcast, and Host Range.
Packet Construction
Navigate to the Packet Builder. Construct a packet from a local host (192.168.1.10) to a remote server (8.8.8.8).
- Set the protocol to TCP.
- Set the TTL to 64.
- Click "Build Packet" and observe the Header structure.
- Hover over the binary blocks in the visualization to identify fields.
Report Writing Guidelines
Structure of the Lab Report
Follow this standard format to document your findings.
1. Aim & Objectives
State the purpose: To understand the structure of the IPv4 packet header and the mechanism of subnetting.
2. Theory
Summarize the key concepts of IPv4 addressing, classes (A, B, C), and the function of the Header fields (Version, IHL, TTL, Protocol, Checksum).
3. Procedure & Simulation Data
Document the steps taken. Include tables for your subnetting calculations. Example table columns:
| IP Address | CIDR | Subnet Mask | Network Addr | Broadcast Addr | Usable Hosts |
|---|---|---|---|---|---|
| 192.168.1.0 | /26 | ... | ... | ... | ... |
4. Analysis & Conclusion
Explain the relationship between the CIDR prefix and the number of available hosts. Discuss why the Network and Broadcast addresses are reserved. Conclude with your understanding of how IPv4 facilitates internetworking.