IP Addressing Study Notes
IP Addressing
Lesson Objectives
Explain the use of IPv4 addresses
Convert between binary and decimal numbering systems
Describe the structure of an IPv4 address including the network portion, host portion, and the subnet mask.
Binary and Decimal Conversion
Numbering Systems
Binary Number System: Consists of the numbers 0 and 1, called bits.
IPv4 Addresses: Expressed in 32 binary bits divided into 4 octets (8 bits each).
IPv4 Addresses Expressed in Binary
Example of a binary IPv4 address: 11010001.10100101.11001000.11100001
Example of LAN A Network Address: 11000000.10101000.00001010.00000000/24
PC Addressing Examples:
PC1: 11000000.10101000.00001010.00000001
PC2: 11000000.10101000.00001010.00001010
Positional Value in Binary
Illustrated as:
128 64 32 16 8 4 2 1
Binary Number
1 0 1 0 0 0 0 0
Calculation example: 128 + 64 + 0 + 0 + 0 + 0 + 0 + 0 = 192
Result in Dotted Decimal Notation: 192.
Structure of IPv4 Address
Hierarchical Structure: Composed of a Network portion and Host portion.
All devices on the same network must have the same network portion.
Subnet Mask: Helps devices identify the network and host portions.
Example of IPv4 Address Structure
IPv4 Address Example: 192.168.10.10
Network Portion: 192.168.10
Host Portion: 10
Binary Representation: 11000000.10101000.00001010.00001010
Address Classes and Subnet Masks
Classful Addressing
Addresses classes are defined by the first octet:
Class A: 1-126 (Subnet Mask: 255.0.0.0)
Class B: 128-191 (Subnet Mask: 255.255.0.0)
Class C: 192-223 (Subnet Mask: 255.255.255.0)
Class D: 224-239 (Multicast)
Class E: 240-255 (Reserved for future use, research and development)
Details of Classful Addressing
Class | Address Range | Network and Host Parts | Default Subnet Mask | Number of Hosts |
|---|---|---|---|---|
A | 1.0.0.0 - 126.255.255.255 | N.H.H.H | 255.0.0.0 | 16 million |
B | 128.0.0.0 - 191.255.255.255 | N.N.H.H | 255.255.0.0 | 65,534 |
C | 192.0.0.0 - 223.255.255.255 | N.N.N.H | 255.255.255.0 | 254 |
D | 224.0.0.0 - 239.255.255.255 | Multicast address | n/a | n/a |
E | 240.0.0.0 - 255.255.255.255 | Reserved | n/a | n/a |
Note: Class A addresses 127.0.0.0 to 127.255.255.255 are reserved for loopback, localhost, and diagnostic functions.
Subnet Mask
Three IPv4 addresses must be configured on a host:
Unique IPv4 address of the host.
Subnet mask, which identifies the network/host portion of the IPv4 address.
Default gateway, the IP address of the local router interface.
Obtaining IP settings
Automatic Assignment: Obtain an IP address automatically.
Static Assignment: Use specific IP address, subnet mask, and default gateway.
Types of IPv4 Addresses
Public and Private IPv4 Addresses
Public IPv4 Addresses: Globally routed between ISP routers. However, not all available IPv4 addresses can be used on the internet.
Private IPv4 Addresses: Blocks of addresses used by organizations to assign IPv4 addresses to internal hosts, introduced due to the depletion of IPv4 address space in the mid-1990s.
Not routable, must be translated to a public IPv4 to be routed.
Defined by RFC 1918.
Private Address Blocks
10.0.0.0/8: 10.0.0.0 to 10.255.255.255
172.16.0.0/12: 172.16.0.0 to 172.31.255.255
192.168.0.0/16: 192.168.0.0 to 192.168.255.255
IANA Structure for IPv4 Address Distribution
Major regions managed by:
AfriNIC
APNIC
ARIN
LACNIC
RIPE NCC
VLAN Overview
Benefits of VLANs
Improved security
Better performance
Smaller broadcast domains
Reduced costs
Increased IT efficiency
Enhanced management efficiency
Types of VLANs
Default VLAN (also known as VLAN 1): All switch ports are members of VLAN 1 by default.
Data VLAN: Created for specific user groups or devices, carrying user-generated traffic.
Native VLAN: Carries untagged traffic, default is VLAN 1.
Management VLAN: Created for network management traffic, typically VLAN 1.
VLAN Assignment Example
Assigning a VLAN ID:
S1#configure terminal S1(config)# vlan [vlan-id] S1(config-vlan) name [vlan-name] S1(config-vlan) endAssigning Ports to VLANs:
S1#configure terminal S1(config)# interface [interface-id] S1(config-if)# switchport mode access S1(config-if)# switchport access [vlan-id] S1(config-if)# end
Inter-VLAN Routing Operation
Definition
Inter-VLAN Routing: The process for forwarding network traffic from one VLAN to another using a router.
Methods of Inter-VLAN Routing
Legacy Inter-VLAN Routing
Router-on-a-Stick: Uses a router’s single physical interface configured as an 802.1Q trunk port.
Layer 3 Switching using SVIs: Switch virtual interfaces are used to route traffic.
Router-on-a-Stick Configuration Example
Create a trunk link
Configure subinterfaces for each VLAN:
R1(config)# interface g0/0.10 R1(config-subif)# encapsulation dot1Q 10 R1(config-subif)# ip address 172.17.10.1 255.255.255.0Enable the physical interface:
R1(config)# interface g0/0 R1(config-if)# no shutdown
DHCP Operation
Overview
Dynamic Host Configuration Protocol (DHCP): Automates assignment of IP addresses and other networking parameters.
Two types of addressing: Dynamic (DHCP-managed) and Static (manual entry).
DHCP Message Flow
DHCPDISCOVER: Client broadcasts to find DHCP servers.
DHCPOFFER: Server offers a lease to the client.
DHCPREQUEST: Client requests the specific lease.
DHCPACK: Server confirms the lease.
DHCPNAK: If the offer is invalid, this message is sent, prompting a new discovery.