Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lesson 05

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

IP Addressing and Subnetting

IP Address Structure

• IPv4 Address: Consists of 32 bits, divided into four octets (e.g., 192.168.1.1).
• Subnet Mask: Defines the network and host portions of the IP address. Example:
255.255.255.0 (/24).
• CIDR Notation: Represents the subnet mask using a slash (/) followed by the number of bits
set to 1. Example: /24.

Subnetting

1. Determine Subnets: Identify the number of required subnets and round up to the nearest
power of 2.
2. Calculate Hosts per Subnet: Use the formula 2n−22^n - 22n−2, where nnn is the number of
host bits.
3. Subnet Mask Calculation: Add the number of subnet bits to the network prefix. Example: If
using a /16 network and needing 4 subnets, add 2 bits: /18.
4. Identify Subnet IDs: Calculate using the least significant octet. Example: For a /18 subnet
mask (255.255.192.0), the subnet IDs increment by 64: 172.30.0.0, 172.30.64.0, etc.
5. Determine Host Ranges: Subtract 1 from the next subnet ID for the broadcast address and
subtract 2 to find the last host address.

Layer 2 vs. Layer 3 Addressing

• Layer 2 (Data Link Layer):


o MAC Address: Unique identifier for network interfaces.
o Switching: Uses MAC addresses to forward frames within the same network
segment.
o Broadcast Domain: All devices in the same VLAN or switch are in the same
broadcast domain.
• Layer 3 (Network Layer):
o IP Address: Logical address for routing packets between networks.
o Routing: Uses IP addresses to forward packets between different networks.
o Routing Table: Contains routes for forwarding packets based on destination IP
addresses.

ARP (Address Resolution Protocol)

• Purpose: Resolves IP addresses to MAC addresses within the same subnet.


• Process:
o ARP Request: Broadcast message to find the MAC address associated with an IP
address.
o ARP Reply: The device with the matching IP address responds with its MAC address.

IPv4 Address Types

• Unicast: Single sender to a single receiver.


• Broadcast: Single sender to all devices in a subnet (address with all host bits set to 1).
• Multicast: Single sender to multiple interested receivers using a multicast group address.
• Anycast: Multiple devices share the same IP address; the nearest device receives the packet.

Private vs. Public IP Addresses

• Private IP Ranges (RFC 1918):


o Class A: 10.0.0.0 - 10.255.255.255
o Class B: 172.16.0.0 - 172.31.255.255
o Class C: 192.168.0.0 - 192.168.255.255
• Public IP Addresses: Routable on the Internet and allocated by IANA.
• NAT (Network Address Translation): Translates private IP addresses to public IP addresses
for Internet access.

Reserved and Special IP Address Ranges

• Loopback Addresses: 127.0.0.0 - 127.255.255.255 (commonly 127.0.0.1).


• Link Local Addresses (APIPA): 169.254.0.0 - 169.254.255.255 (used when no DHCP server is
available).
• Class D (Multicast): 224.0.0.0 - 239.255.255.255.
• Class E (Experimental): 240.0.0.0 - 255.255.255.255.
• Documentation Ranges: 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24.

VLANs and Subnet Design

• VLANs (Virtual LANs):


o Purpose: Segregate broadcast domains at Layer 2.
o Configuration: Each port on a managed switch can be assigned a VLAN ID.
• Subnets:
o Purpose: Logically divide a network at Layer 3.
o Subnetting: Aligns with VLAN design to represent distinct IP subnets.
o Example: VLAN 10 on Switch A might use subnet 10.0.1.0/24, VLAN 20 might use
10.0.2.0/24.

IP Addressing for IPv4

1. Identify the Address Class: Class A, B, C based on the first octet.


2. Default Subnet Masks:
o Class A: 255.0.0.0 (/8)
o Class B: 255.255.0.0 (/16)
o Class C: 255.255.255.0 (/24)
3. CIDR Notation: For flexible subnetting, use CIDR (e.g., 192.168.1.0/25).

Designing an IPv4 Address Scheme

• Considerations:
o Number of required subnets.
o Number of hosts per subnet.
o Use of valid public or private ranges.
o Avoid reserved ranges (e.g., loopback, link local).
o Ensure unique network and host IDs.
o Plan for future growth.
Subnet Calculation Example

1. Network Address: 172.30.0.0/16


2. Required Subnets: 12 (round up to 16, requiring 4 subnet bits: /20).
3. Subnet Mask: 255.255.240.0 (/20).
4. Hosts per Subnet: 212−2=40942^{12} - 2 = 4094212−2=4094 hosts.
5. First Subnet ID: 172.30.16.0/20.
6. Host Range: 172.30.16.1 to 172.30.31.254.

Key Terms and Concepts

• Broadcast Domain: Network segment where a broadcast packet is forwarded to all devices.
• Collision Domain: Network segment where data packets can collide with each other.
• Switch: Network device that forwards frames based on MAC addresses.
• Router: Network device that forwards packets based on IP addresses, used to connect
different networks.
• Default Gateway: The router's IP address that acts as an access point for traffic
destined for other networks.
• Dynamic Host Configuration Protocol (DHCP): Protocol for automatically assigning
IP addresses to devices on a network.

2. Calculate the Subnet Mask:


o Original network prefix: /16
o Add subnet bits: /16 + 4 = /20
o Subnet mask: 255.255.240.0 (/20)
3. Calculate Hosts per Subnet:
o Total bits for hosts in a /20 subnet: 32 - 20 = 12
o Number of hosts per subnet: 212−2=40942^{12} - 2 = 4094212−2=4094
(subtracting 2 for the network and broadcast addresses)
4. Identify Subnet IDs:
o Increment for subnets: 212=40962^{12} = 4096212=4096 addresses per
subnet
o Subnet IDs (increasing by increments of 4096):
▪ 172.30.0.0/20
▪ 172.30.16.0/20
▪ 172.30.32.0/20
▪ 172.30.48.0/20
▪ 172.30.64.0/20
▪ 172.30.80.0/20
▪ 172.30.96.0/20
▪ 172.30.112.0/20
▪ 172.30.128.0/20
▪ 172.30.144.0/20
▪ 172.30.160.0/20
▪ 172.30.176.0/20
▪ 172.30.192.0/20
▪ 172.30.208.0/20
▪ 172.30.224.0/20
▪ 172.30.240.0/20
5. Determine Host Ranges:
o For each subnet, the first usable IP address is the subnet ID + 1, and the last
usable IP address is the address before the next subnet ID - 1.
o Example for the first subnet (172.30.0.0/20):
▪ Network address: 172.30.0.0
▪ First usable IP: 172.30.0.1
▪ Last usable IP: 172.30.15.254
▪ Broadcast address: 172.30.15.255

Summary of Subnet Design

• Network Address: 172.30.0.0/16


• Subnet Mask: 255.255.240.0 (/20)
• Number of Subnets: 16
• Hosts per Subnet: 4094
• Example Subnet:
o Subnet ID: 172.30.0.0/20
o Host Range: 172.30.0.1 - 172.30.15.254
o Broadcast Address: 172.30.15.255

Key Terms and Concepts (Continued)

Broadcast Domain:

• Definition: A network segment in which any broadcast sent by a device is heard by all
other devices in the same segment.
• Example: All devices in the same VLAN or connected to the same switch.

Collision Domain:

• Definition: A network segment where data packets can collide with each other if sent
simultaneously.
• Example: All devices connected to a single Ethernet hub.

Switch:

• Definition: A network device that uses MAC addresses to forward frames at the data
link layer (Layer 2).
• Function: Reduces collision domains by creating a separate collision domain per
switch port.

Router:

• Definition: A network device that forwards packets based on IP addresses at the


network layer (Layer 3).
• Function: Connects different networks and routes traffic between them.

Default Gateway:

• Definition: The IP address of a router that acts as an access point for traffic to exit the
local network.
• Function: Provides a way for devices in a network to communicate with devices in
other networks.

Dynamic Host Configuration Protocol (DHCP):

• Definition: A protocol for dynamically assigning IP addresses to devices on a


network.
• Function: Simplifies IP address management by automatically assigning and
managing IP addresses.

Network Address Translation (NAT):

• Definition: A method used by routers to translate private IP addresses to a public IP


address for accessing the Internet.
• Function: Conserves public IP addresses and provides an additional layer of security
by hiding internal IP addresses.

IP Addressing for IPv4:

• Identify the Address Class:


o Class A: 1.0.0.0 to 126.0.0.0 (8-bit network prefix)
o Class B: 128.0.0.0 to 191.255.0.0 (16-bit network prefix)
o Class C: 192.0.0.0 to 223.255.255.0 (24-bit network prefix)
• Default Subnet Masks:
o Class A: 255.0.0.0 (/8)
o Class B: 255.255.0.0 (/16)
o Class C: 255.255.255.0 (/24)
• CIDR Notation:
o For flexible subnetting, use CIDR (e.g., 192.168.1.0/25).

Designing an IPv4 Address Scheme

Considerations:

1. Number of required subnets.


2. Number of hosts per subnet.
3. Use of valid public or private ranges.
4. Avoidance of reserved ranges (e.g., loopback, link-local).
5. Ensuring unique network and host IDs.
6. Planning for future growth.

• Network Address Translation (NAT): Method used by routers to translate private IP


addresses to a public IP address for Internet access. Subnetting Example

Scenario: You need to design a subnetting scheme for a network with the address
172.30.0.0/16, requiring 12 subnets.

1. Determine the Number of Required Subnets:


o Required subnets: 12
o Round up to the nearest power of 2: 16 (2^4)
o Number of subnet bits required: 4
2.

You might also like