شرح مفصل لل IP Address وال Subnet Mask, الفرق بين Public IP Vs Private IP

3 min read 18 days ago
Published on May 20, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Introduction

This tutorial provides a detailed overview of IP addresses, subnet masks, and the differences between public and private IP addresses. Understanding these concepts is essential for anyone interested in networking, whether for personal knowledge or professional development.

Step 1: Understanding IP Addresses

  • Definition: An IP address is a unique identifier assigned to each device connected to a network.
  • Structure: An IP address consists of four numbers (in IPv4), each ranging from 0 to 255, separated by dots (e.g., 192.168.1.1).
  • Types
    • IPv4: The most commonly used format, consisting of 32 bits.
    • IPv6: A newer format designed to address the limitations of IPv4, consisting of 128 bits.

Step 2: Finding Your IP Address

  • Windows
    • Open Command Prompt.
    • Type ipconfig and press Enter.
    • Look for "IPv4 Address."

  • Mac
    • Go to System Preferences.
    • Click on Network.
    • Select your network and find the IP address displayed.

Step 3: Understanding Subnet Masks

  • Definition: A subnet mask divides an IP address into network and host portions, determining which part identifies the network and which part identifies the device.
  • Common Subnet Masks
    • 255.255.255.0: Allows for 256 addresses within the subnet.
    • CIDR Notation: For example, /24 indicates a subnet mask of 255.255.255.0.

Step 4: IP Address Classes

  • Class A
    • IPs from 1.0.0.0 to 126.0.0.0; used for large networks.

  • Class B
    • IPs from 128.0.0.0 to 191.255.0.0; suitable for medium-sized networks.

  • Class C
    • IPs from 192.0.0.0 to 223.255.255.0; typically used for small networks.

Step 5: Distribution of IP Addresses in Networks

  • Dynamic Allocation: Most devices receive IP addresses dynamically through DHCP (Dynamic Host Configuration Protocol).
  • Static Allocation: Some devices, like servers, are assigned static IP addresses for consistent identification.

Step 6: Public IP vs Private IP

  • Public IP Address
    • Assigned by ISPs and accessible from the internet.
    • Example: 203.0.113.1.

  • Private IP Address
    • Used within a local network and not routable on the internet.
    • Common ranges
      • 10.0.0.0 to 10.255.255.255
      • 172.16.0.0 to 172.31.255.255
      • 192.168.0.0 to 192.168.255.255.

Step 7: Understanding NAT (Network Address Translation)

  • Definition: NAT allows multiple devices on a local network to share a single public IP address.
  • Function: When data is sent out from the local network to the internet, NAT translates the private IP addresses into the public IP address.

Step 8: Differences Between IPv4 and IPv6

  • IPv4: Limited to approximately 4 billion addresses.
  • IPv6: Vastly larger address space, allowing for a virtually infinite number of devices.

Conclusion

In this tutorial, we covered the fundamental concepts of IP addresses, subnet masks, and the distinction between public and private IP addresses. Understanding these concepts is crucial for managing networks effectively. For further learning, consider exploring more about DHCP, NAT configurations, and the transition from IPv4 to IPv6 in networking.