Overview
This lecture covers how IP addresses are divided into network IDs, subnet IDs, and host IDs, with a focus on subnetting, subnet masks, and their binary representation.
IP Address Structure and Subnetting
- An IP address is a 32-bit number divided into network ID and host ID.
- Subnetting takes bits from the host ID and assigns them to the subnet ID.
- All three IDs (network, subnet, host) are represented within the same 32-bit IP address.
- Core routers use the network ID for routing datagrams to the correct network.
Subnet Masks and Their Role
- Subnet IDs are determined using a subnet mask, a 32-bit number like an IP address.
- A subnet mask contains a sequence of ones (masking the network and subnet ID) followed by zeros (for the host ID).
- Comparing an IP address and subnet mask in binary reveals which bits belong to each section.
- Example: The subnet mask 255.255.255.0 translates to 24 ones and 8 zeros.
Calculating Subnets and Hosts
- The part of the address corresponding to mask ones is for the subnet ID; zeros indicate host ID bits.
- Subnet size is dictated by the number of zero bits in the subnet mask.
- With 255.255.255.0, the last octet (8 bits) is for host IDs, supporting 256 values (0-255).
- Typically, 0 is not used (network address), and 255 is reserved for broadcast, so only 1-254 can be assigned to hosts.
Subnet Mask Short Notation
- Subnet masks can also be written in slash notation (e.g., /27 for 27 ones).
- Example: 255.255.255.224 equals /27, providing 5 host ID bits (32 addresses).
- Both decimal and slash notations are common and should be understood.
Key Terms & Definitions
- IP Address — A 32-bit number uniquely identifying a device on a network.
- Network ID — The part of the IP address identifying the network.
- Host ID — The part of the IP address identifying the device within a network.
- Subnet ID — Identifies a subnetwork within a main network, taking bits from host ID.
- Subnet Mask — A 32-bit mask showing which bits are network/subnet and which are host.
- Broadcast Address — The highest address in a subnet, used for sending to all hosts.
Action Items / Next Steps
- Practice converting IP addresses and subnet masks to binary.
- Learn how to identify network, subnet, and host IDs from given IP and subnet mask.
- Review how to calculate available hosts per subnet for different mask lengths.