An address looks like dotted text, but routers compare it as a fixed-width integer. This lesson starts from the bytes and shows how each octet becomes part of the number.

highlighted = computed this step

Why addresses are numbers

An IP address is written with dots for humans, but the wire carries a fixed-width integer. The strip shows the bytes that make the arithmetic possible.

address bits=32\text{address bits}=32

Four bytes make one address

The address 192.168.1.130 is 32 bits wide. Each dotted part is one 8-bit byte.

0xc0a80182192.168.1.1300xc0a80182\leftrightarrow192.168.1.130
Address bitsThe address is decoded from four exact bytes.Host address32 bits / 4 bytes0xc0a80182byte 0byte 1byte 2byte 311000000101010000000000110000010address192.168.1.130

Decode it again

The same rule reads 8.8.8.8 from the bytes 0x08080808. The dots are display punctuation; the bytes are the source.

0x080808088.8.8.80x08080808\leftrightarrow8.8.8.8
Address bits againThe same dotted-quad rule is applied again.DNS address32 bits / 4 bytes0x08080808byte 0byte 1byte 2byte 300001000000010000000100000001000address8.8.8.8

Summary

A dotted address is a four-byte integer, so later mask arithmetic can operate bit by bit. Address arithmetic only; timing/throughput is not modeled here.

address bits=32\text{address bits}=32
Address bitsThe address is decoded from four exact bytes.Host address32 bits / 4 bytes0xc0a80182byte 0byte 1byte 2byte 311000000101010000000000110000010address192.168.1.130