Networking basic

IPv4 Addressing

Each device is assigned a 4-octet (32-bit long) address which actually defines 2 things: the network the device belongs to and the host address within this network. Inside the LAN the host address could be sufficient, the routers use the network address.

IANA defined 5 different classes of addresses and the grouping was done based on the first few bits of the first octet:

The address is called Class A when the first bit is 0 (the octet itself in the range 0 -127). This class correspondingly has 128 networks with approx. 16 bln. hosts in each. With one octet representing the network address, the rest is used for the host address.

The special address 127.0.0.1 (localhost) (and generally talking any in the range from 127.0.0.1 to 127.255.255.255) is reserved for the loopback that enables a device to communicate with itself.

In Class B addresses, the first two bits of the first octet are equal to 10, i.e. the octet itself falls in the range 128-191. The first 2 octets represent the network number and the remaining two represent the host number.

Class C addresses start with 110. Thus, when the IPv4 address is from 192 to 223 in the first octet, it is called a Class C address. The first 3 octets are used for network identification and only the last octet is used for the host number. These addresses are reserved for small networks.

If the first bits of the first octet start with 1110 (host numbers from 224 to 239), they are identifiable as Class D addresses. These addresses are reserved for multicasting.

The last group of addresses is called Class E (1111 in the first bits, 240-255 in the first octet). They are not available for use and are meant for experimental purposes.

classful cidr flsm vlsm - Classful IP addresses table

CIDR

CIDR stands for Classless Inter-Domain Routing. A CIDR black is a collection of IP addresses that share the same network prefix.

Master CIDR Block 10.10.0.0/16

Subnet 1: 10.10.1.0/24 etc.

IPv6 addresses can be aggregated with prefixes of arbitrary bit length, similar to IPv4 addresses. For example, 2001:0db8/32 is an IPv6 CIDR address with the first 32 bits or 2001:db8 as the network address.

export SSLKEYLOGFILE=<WSL to Windows path>