Day 4 - Refresh
Day 4 - Refresh
CIDR (Classless Inter-Domain Routing) notation is used to define IP addresses and their associated
routing prefixes. It is expressed as an IP address, followed by a slash (/) and a number that indicates
how many bits in the IP address are used for the network portion.
Key Concepts:
1. IP Address Structure:
IPv4 addresses are 32 bits long, divided into 4 octets (each 8 bits).
Example: 192.168.1.0 is a 32-bit address that looks like this in binary:
11000000.10101000.00000001.00000000.
2. CIDR Notation:
In CIDR, the IP address is followed by a slash (/) and a number, which specifies the number
of bits used for the network portion.
Example: 192.168.1.0/24 means the first 24 bits represent the network portion, and the
remaining 8 bits represent the host portion.
3. Subnet Mask:
The number after the slash represents the subnet mask. It is used to divide an IP address
into two parts: the network portion and the host portion.
A /24 means that the first 24 bits are "1"s (network portion), and the remaining bits (8 bits)
are "0"s (host portion), i.e., 255.255.255.0.
Calculating CIDR:
Example:
If you have 192.168.10.0/26, the /26 means the first 26 bits are for the network:
Network Portion: 192.168.10.0 (26 bits)
Subnet Mask: 255.255.255.192
Number of Hosts: 2^{32-26} - 2 = 62
While Classful Addressing is largely obsolete today (replaced by CIDR or Classless Inter-Domain
Routing), understanding the classes helps explain the history of how IP address allocation worked.
Here's an overview of the IP address classes:
1. Class A:
Range: 1.0.0.0 to 126.255.255.255 (the first octet is between 1 and 126).
Default Subnet Mask: 255.0.0.0.
CIDR Notation: /8.
Network-Host Bits: First 8 bits are for the network portion, remaining 24 bits for the host
portion.
Number of Networks: 128 networks.
Hosts per Network: ~16.7 million (2^24 - 2).
Use Case: Designed for large networks, like multinational companies or ISPs, where many
devices need unique IP addresses.
2. Class B:
Range: 128.0.0.0 to 191.255.255.255.
Default Subnet Mask: 255.255.0.0.
CIDR Notation: /16.
Network-Host Bits: First 16 bits for the network, remaining 16 bits for the host.
Number of Networks: ~16,384 networks.
Hosts per Network: ~65,534 hosts.
Use Case: Suitable for medium-sized networks, like large organizations or universities.
3. Class C:
Range: 192.0.0.0 to 223.255.255.255.
Default Subnet Mask: 255.255.255.0.
CIDR Notation: /24.
Network-Host Bits: First 24 bits for the network, last 8 bits for the host.
Number of Networks: ~2 million networks.
Hosts per Network: 254 hosts.
Use Case: Designed for small networks, such as small businesses or local offices.
4. Class D (Multicast):
Range: 224.0.0.0 to 239.255.255.255.
Use Case: Reserved for multicasting, where a message or packet is sent to multiple devices
at once. Used in specialized applications like streaming video or real-time data distribution.
5. Class E (Experimental):
Range: 240.0.0.0 to 255.255.255.255.
Use Case: Reserved for experimental purposes and future use. Not used for standard IP
addressing.
Deals with the physical connection between devices and the transmission of raw binary
data over the network medium.
Cables (Ethernet, fiber optic), Hubs, Network Interface Cards (NIC)
Establishes and maintains the physical connection; defines the hardware responsible for
transmitting raw bits over the medium.
Manages node-to-node data transfer and error detection. It handles data packets called
frames and provides error-checking through MAC (Media Access Control) addresses.
Switches, Bridges, MAC Addresses, Ethernet.
Ensures data is transmitted error-free between nodes on the same network segment.
Handles the logical addressing and routing of data across different networks. Data packets
here are called packets.
Routers, IP Addresses, IPv4/IPv6, ARP (Address Resolution Protocol).
Ensures data is routed correctly between devices on different networks.
Closest to the user, this layer provides services that directly interface with the end-user or
application. It facilitates network services such as email, file transfer, and web browsing.
HTTP, FTP, SMTP, DNS, SNMP, Telnet.
Provides network services directly to the end-user's application.
A web developer ensuring that HTTP requests and responses between browsers and
servers are functioning properly would work at Layer 7.