Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Friday, 31 October 2025

Difference between a Public IP address and a Private IP address ?

A public IP address is a unique identifier assigned by an Internet Service Provider (ISP) to a device, such as router or server, allowing it to communicate over the internet. These public IP addresses are globally unique and publicly accessible, enabling data exchange between your network and the external systems via TCP/IP protocol.

Because public IP address is exposed to the internet, they can be used to trace a device's approximate geographic location.

A private IP address, also known as local IP address, is assigned by a router to devices within a home, office or public WIFI network. Unlike a public IP address is exposed to internet, private IPs function only within the local network. Since they don't need to globally unique, the same private IP ranges can be used across different network without conflict.

However, each device on the network receive a different private IP address, allowing the router to manage the data transfers effectively. This enables the internal LAN connections between network devices and ensures that external traffic arriving via the public IP address is forwarded to the correct individual network device.

private IP address ranges:

  • 10.0.0.0 - 10.255.255.255 this range allows for 16 million IP addresses and is often used in large enterprise networks or large organizations that have thousands of devices in their local network.
  • 172.16.0.0 - 172.31.255.255, known as 172.16/12 block, this range allows one million IP addresses  and it is used in medium-sized networks such as schools, universities, and businesses.
  • 192.168.0.0 - 192.168.255.255 this range supports about 65000 IP addresses is primarily used in home and small office networks.

What is a DNS server ? What is the use of a DNS server ?

DNS server translates the human-readable domain names (www.google.com) into machine-readable IP addresses (142.250.70.196) which is required for navigating the internet. We can consider its like a Internet Phone Book.

How it works ?

  • When you type a URL in the browser, your device sends the query to DNS server.
  • The DNS server, known as recursive resolver, it checks in its cache if it has IP address for given domain name. Otherwise, it will searches for it by communicating with other DNS servers, including root name servers and authoritative name servers.
  • Once it finds the IP address, it will be sent back to your device, then your browser connect to that website.
We can see the DNS server in windows using ipconfig command ipconfig /all

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :

   Description . . . . . . . . . . . : Intel(R) Wi-Fi 6 AX201 160MHz

   Physical Address. . . . . . . . . : XXXXXXXXXXXXXXXX

   DHCP Enabled. . . . . . . . . . . : Yes

   Autoconfiguration Enabled . . . . : Yes

   IPv6 Address. . . . . . . . . . . : XXXXXXXXXXXXXXXX

   Temporary IPv6 Address. . . . . . : XXXXXXXXXXXXXXXX

   Link-local IPv6 Address . . . . . : XXXXXXXXXXXXXXXX

   IPv4 Address. . . . . . . . . . . : 192.168.1.10(Preferred)

   Subnet Mask . . . . . . . . . . . : 255.255.255.0

   Lease Obtained. . . . . . . . . . : Friday, October 31, 2025 9:36:25 AM

   Lease Expires . . . . . . . . . . : Saturday, November 1, 2025 1:21:33 PM

   Default Gateway . . . . . . . . . : fe80::1%13

                                       192.168.1.1

   DHCP Server . . . . . . . . . . . : 192.168.1.1

   DHCPv6 IAID . . . . . . . . . . . : XXXXXXXXXXXXXXXX

   DHCPv6 Client DUID. . . . . . . . : XXXXXXXXXXXXXXXX

   DNS Servers . . . . . . . . . . . : XXXXXXXXXXXXXXXX

                                       XXXXXXXXXXXXXXXX

                                       192.168.1.1

   Primary WINS Server . . . . . . . : 192.168.1.1

   NetBIOS over Tcpip. . . . . . . . : Disabled

Note: Here, the 192.168.1.1 is my router IP address, which is also acting as my DNS server, DHCP server. We can also use the google public DNS server 8.8.8.8 (alternative: 8.8.4.4)

How to trace all the routers from my computer to a website like www.google.com ?

tracert command is a windows based diagnostic tool that traces the each "hop" or router(s) to a destination along the way that route packets take.

How to use tracert command ?

  1. Open cmd prompt
  2. Type the command tracert followed by a destination
    • tracert www.google.com
  3. Press enter
  4. Review the results
Note:
  • tracert works for windows. use traceroute for Linux and MacOs.
  • Windows utility tracert uses Internet Control Message Packets (ICMP) packets to find the route.
  • By default, it will trace up to 30 hops. This can be changed using -h parameter.
    • tracert -h 40 www.google.com
  • Use -d parameter with tracert utility to speed up the trace, which prevents the command from IP addresses to hostnames.
  • Use -w parameter to specify the wait time for a reply in milliseconds.

C:\Users\Dinesh.Dontha>tracert www.google.com

Tracing route to www.google.com [2404:6800:4007:837::2004]

over a maximum of 30 hops:

  1    11 ms     1 ms     1 ms  2401:4900:1c27:f15b:8ea3:99ff:fefc:7fd0

  2     *        *        *     Request timed out.

  3     5 ms     5 ms     5 ms  2404:a800:3a00:2::209

  4     *        *        *     Request timed out.

  5    16 ms    15 ms    15 ms  2404:6800:8202:280::1

  6    21 ms    16 ms    16 ms  2404:6800:8202:280::1

  7    16 ms    16 ms    16 ms  2001:4860:0:1::5658

  8    15 ms    15 ms    15 ms  2001:4860:0:1::4878

  9    39 ms    16 ms    16 ms  2001:4860:0:1::880d

 10    16 ms    16 ms    16 ms  2001:4860:0:1::163f

 11    16 ms    15 ms    16 ms  lcmaaa-as-in-x04.1e100.net [2404:6800:4007:837::2004]

Trace complete.