IPv4
What
A way to address devices across networks (L3)
Why
L2 Mac addresses do not contain topological information, making them harder to route with
If we would route based on MAC instead of IP, route tables would be huge, since every host is 1 entry
Concepts
-
IP Address: e.g. 10.1.2.3
-
Subnet: e.g. 192.168.1.0/24
- Indicating that the first 24 bits are the subnet mask
- And the last 8 bits are within the subnet
-
Variable Length Subnet Mask (VLSM):
- Subnets used to be constrained to certain sizes by classful subnetting, wasting IP addresses (if you needed slightly more, you'd have to 20x your IP range)
- VLSM allows subnets of any size
-
Classless Inter-Domain Routing (CIDR):
- Routing prefixes also used to be fixed length due to classful subnetting
- CIDR allows prefixes of any length, making routing tables more efficient
-
VLSM is for subnetting, while CIDR is for routing
How
Routing algorithms are used to determine where to find IP ranges
Inside a domain: RIP, OSPF, IS-IS, ...
Between domains: BGP
Usually hosts within a network have a default gateway configured, to which they will send traffic to which they do not know the destination
Autonomous Systems cannot have default gateways, since that would leave packets floating around uselessly. They either have a prefix match, or they drop/deny