Subnet Masking

IPV4 Address & Subnet Masks

  • IP addresses:

    • Example IP Addresses:

    • 135.68.2.0 (Internet)

    • 135.68.2.1 (Marketing)

    • 135.68.1.0

    • 135.68.3.0

    • 135.68.2.2

    • 135.68.3.1

    • 135.68.3.2 (Engineering)

Understanding IPv4 Addressing

  • myIP address: 72.35.208.20

  • IPv4 Address:

    • Binary Representation:

    • 01001000.00100011.11010000.00010100

    • Binary structure: 8 bits per octet resulting in a total of 32 bits (8 * 4 bits).

    • Address Components:

    • Street

    • City

    • State

    • Zipcode

Conversion from Binary to Decimal

For Each Octet

  • First octet: [See YouTube for details]

  • Second octet: [Conversion Methodology]

  • Third octet: [Conversion Methodology]

  • Fourth octet: [Conversion Methodology]

Converting Decimal IP Addresses to Binary

  • Example IP Address: 165.58.199.43

  • Conversion Steps:

    • 128 ≤ 165 → 128 64 32 16 8 4 2 1

    • Calculation Steps for 165:

    • 165 - 128 = 37

    • Calculation Steps for next values:

    • 37 - 32 = 5

    • 5 - 4 = 1

IPv4 Address Structure

  • Definition: An IP address is a 32-bit long value represented in binary as a string of zeros and ones (e.g., 11000000.10101000.00000100.00000010).

  • Octets:

    • Consists of 4 octets (each octet being 8-bits).

    • Each octet is represented in binary as 00000000 to 11111111.

  • Decimal Representation:

    • IP addresses in decimal notation are 4 decimal numbers separated by dots (e.g., 192.168.4.2).

Subnet Masks

  • Subnet Mask Example:

    • In decimal: 255.255.255.0

    • Binary format: 11111111.11111111.11111111.00000000

    • CIDR notation: /24

  • Subnetting:

    • Represents the practice of dividing a network into two or more networks.

Understanding Subnetting

  • Subnetwork:

    • Definition: A logical subdivision of an IP network.

    • Addressing: Computers within a subnet share the same most-significant bit-group in their IP addresses, creating a division into a network number and a host identifier.

    • CIDR Example:

    • Notation: 198.51.100.0/24

    • At this address, 24 bits are allocated for the network prefix, while 8 bits are for host addressing.

Subnetting Process

  • Before Subnetting:

    • Network identifier, IP address, host identifier.

  • After Subnetting:

    • Network identifier, subnet identifier, host identifier.

Subnet Masks Variations

  • Subnet Mask Examples:

    • /18 → 255.0.0.0 (binary: 11111111.00000000.00000000.00000000)

    • /16 → 255.255.0.0 (binary: 11111111.11111111.00000000.00000000)

    • /15 → 248.0.0.0 (binary: 11111000.00000000.00000000.00000000)

Communication Process in Networking

Local Communication

  • Devices Involved:

    • Switch: Layer 2 device used for local communication

    • MAC Address: Used for local communication

    • IP Address: Used for remote communication

    • Default Gateway: Layer 3 device used for remote communications.

Remote Communication

  • Step 1: Computer A uses ARP protocol to obtain the MAC address of the Default Gateway.

  • Step 2: Default Gateway replies with its MAC address.

  • Step 3: Computer A sends IP packets to the Default Gateway for delivery.

Example of Subnetting Tasks

  • Example Subnet Task: Set up 3 separate subnets for the department based on a provided network ID of 125.23.200.64/26

  • Network IDs:

    • 125.23.200.64/28 ranges from 125.23.200.65-125.23.200.78 (Broadcast: 125.23.200.79)

    • 125.23.200.80/28 ranges from 125.23.200.81-125.23.200.94 (Broadcast: 125.23.200.95)

    • 125.23.200.96/28 ranges from 125.23.200.97-125.23.200.110 (Broadcast: 125.23.200.111)

Network Classifications

Each class divined by the first octet ranges from IP 0-255:

  • Class A: 0-127

  • Class B: 128-191

  • Class C: 192-223

  • Class D (Multicast): 224-239

  • Class E (Experimental): 240-255

Subnet Masks for each class

  • Across classes, subnet masks dictate how many usable hosts per network can exist.

Additional Addresses

  • Broadcast Address: An address used to communicate to all systems in a subnet rather than a single host.

Host Calculation
  • Formula for calculating usable hosts per network:

    • h=2x2h = 2^{x} - 2 (where xx = number of zeros).

  • Formula for calculating number of networks:

    • n=2yn = 2^{y} (where yy = number of ones).