# IPv4

## Header

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FZGb5Zxf5NvbuGXkUUXmp%2FIPv4_Packet-en.svg?alt=media&#x26;token=236ed613-a4dc-4f66-a9f6-17695303dd63" alt=""><figcaption></figcaption></figure>

IPv4 addresses are **32 bits** (4 bytes) in length.

## Classes

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FrX0OmGXGcD0FCPg2n9iO%2FIP-classes.webp?alt=media&#x26;token=fd1fe7c9-e861-4490-b24f-eb82d4e131af" alt=""><figcaption></figcaption></figure>

### Loopback Address

Address range

* 127.0.0.0
* 127.255.255.255

Used to test the 'network stack' (think OSI, TCP/IP model) on the local device.

### Network Adress

**Host portion** of the address is all **0's**.

The network address **cannot** be assigned to a host.

### Broadcast Address

**Host portion** of the address is all **1's**.

The broadcast address **cannot** be assigned to a host.

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FhtLwGtyYxS3jIBxFOMh0%2Fa.png?alt=media&#x26;token=9e6313ad-08e4-4520-bf8e-476f3869a858" alt=""><figcaption></figcaption></figure>

## Netmask

#### Class A

* /8
* 255.0.0.0

#### Class B

* /16
* 255.255.0.0

#### Class C

* /24
* 255.255.255.0
