Previous Post | Top | Next Post |
TOC
Here is a memo of me trying to understand typical IP address usages on typical desktop systems.
IPv4 and IPv6 basics
-
IPv4
- 8 bit * 4 = 32 bit address space (2^32 addresses)
- Loopback: IP block=
127.0.0.0/8
(2^24 addresses) for localhost. - Multicast IPv4 address block =
224.0.0.0/4
- mDNS: IP=
224.0.0.251
, UDP, port=5353
- mDNS: IP=
- Link-local address: IP block=
169.254.0.0/16
(2^16 addresses) - Private IPv4 network
10.0.0.0/8
–1
x Class A network with2^24=16777216
addresses172.16.0.0/12
–2**4=16
x Class B networks, each with2^16=65536
addresses192.168.0.0/16
–2**8=256
x Class C networks, each with2^8=256
addresses
-
IPv6
- 16 bit * 8 = 128 bit address space (2^128 addresses)
- Loopback: IP=
::1
for localhost. - Multicast IPv6 address block =
ff00::/8
- mDNS: IP=
ff02::fb
, UDP, port=5353
- mDNS: IP=
- Link-local address: IP block=
fe80::/10
(high 10 bits are IANA global ID, mid 54 bits are 0, low 64 bits are interface ID) - Private IPv6 network
fc00::/7
–2^16
bits for subnet ID x subnet with2^64
addresses
For more, read zero-configuration networking.
My /etc/hosts
on hostname goofy
has:
127.0.0.1 localhost
127.0.1.1 goofy
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Corresponding binary, hexadecimal, and decimal numbers
- Notable even numbers
0b00000000 = 0x00 = 0
0b00010000 = 0x10 = 16
0b00100000 = 0x20 = 32
0b01000000 = 0x40 = 64
0b10000000 = 0x80 = 128
0b10101000 = 0xa8 = 168
0b11000000 = 0xc0 = 192
0b100000000 = 0x100 = 256
- Notable odd numbers (above even number -1)
0b00001111 = 0x0f = 15
0b00011111 = 0x1f = 31
0b00111111 = 0x3f = 63
0b01111111 = 0x7f = 127
0b10100111 = 0xa7 = 167
0b10111111 = 0xbf = 191
0b11111111 = 0xff = 255
- Notable negative numbers
0b11111100 = 0xfc = 252
=-4
0b11111101 = 0xfd = 253
=-3
0b11111110 = 0xfe = 254
=-2
0b11111111 = 0xff = 255
=-1
Previous Post | Top | Next Post |