As a developer, it is important to have a solid understanding of what the internet is and how it works. It is the foundation upon which most modern software applications are built. In order to build effective, secure, and scalable applications and services, you need to have a solid understanding of how the internet works and how to leverage its power and connectivity
How Internet works?🤔
At a high level ,the internet works by connecting networks together using standardize protocol
Now what is network ? A network is a group of computers or other devices which are connected to each other. and Internet connects multiple networks together .so Internet is network of networks
Now what is protocols? Protocol is the set of rules which defines how information is exchanged between devices and how connection is build .
Ex:- To ensure that packets are sent and received correctly, the internet uses a variety of protocols, including the Internet Protocol (IP) and the Transmission Control Protocol (TCP). IP is responsible for routing packets to their correct destination, while TCP ensures that packets are transmitted reliably and in the correct order.
Now you might have a question How they are connected?
They are not connected through clouds🥴 but via wires under the **sea .**U can check the cable map
Now let be familiar with basic concept before everything
Client server Architecture
The Client-server model is a distributed application structure that partitions task or workload between the providers of a resource or service, called servers, and service requesters called clients(can be phone, pc, browser ,another server)
How connection is build ?
So every computers ,servers this all have something by which they can be identified , So they all have specific IP Address. Its just a number looks like 👇
All devices are connected by this IP Addresses , Like U are watching my blog through a device (client) and making request to hashnode server (Server) .So your device have an IP Address (x.x.x.x) and you are requesting to hashnode server IP address(y.y.y.y) and they are giving data to your address as response. So Its like How you post and receive letter.
Now lets deep dive into IP Address
IP ADDRESS
This are unique identifying numbers assigned to every device connected to the internet .Every device with an internet connection has an IP Address .It can be computer , laptop , IOT devices ,even Toys.
IP Address helps:-
To talk to different devices
To find the source and retrieve data
identification of a host or a network or the location of the device
An IP address is not random. The creation of an IP address has the basis of math.
IANA(Internet Assigned Numbers Authority) allocates IP Address & Its creation
You can check own IP Address through command line
$ipconfig
IP addresses have two distinct version of standards -
IPv4:-
IPv4 is the fourth version of the IP. An IPv4 address uses 32-bit binary numbers to form a unique IP address. It takes the format of four sets of numbers, each of which ranges from 0 to 255 and represents an eight-digit binary number, separated by a period point.
So ,IPv4 address have range 0.0.0.0 to 255.255.255.255 ,means there can be 4.3 billion addresses.
Some IP addresses are reserved by the Internet Assigned Numbers Authority (IANA).
These are typically reserved for networks that carry a specific purpose ,which is used to interconnect devices
0.0.0.0: This IP address in IPv4 is also known as the default network. It is the non-routable meta address that designates an invalid, non-applicable, or unknown network target.
127.0.0.1 (also known as localhost): This IP address is known as the loopback address, which a computer uses to identify itself regardless of whether it has been assigned an IP address.
169.254.0.1 to 169.254.254.254: A range of addresses that are automatically assigned if a computer is unsuccessful in an attempt to receive an address from the DHCP.
255.255.255.255: An address dedicated to messages that need to be sent to every computer on a network or broadcasted across a network.
IPv6
IPv4 has not been able to cope with the massive explosion in the quantity and range of devices beyond simply mobile phones, desktop computers, and laptops. The original IP address format was not able to handle the number of IP addresses being created.
To address this problem, IPv6 was introduced. This new standard operates a hexadecimal format that means billions of unique IP addresses can now be created. As a result, the IPv4 system that could support up to around 4.3 billion unique numbers has been replaced by an alternative that, theoretically, offers upto unlimited IP addresses.
The router on a TCP/IP network can be configured to ensure it recognizes subnets, then route the traffic onto the appropriate network. IP addresses are reserved for the following subnets:
Class A: IP addresses between 10.0.0.0 and 10.255.255.255
Class B: IP addresses between 172.16.0.0 and 172.31.255.255
Class C: IP addresses between 192.186.0.0 and 192.168.255.255
Class D or multicast: IP addresses between 224.0.0.0 and 239.255.255.255
Class E, which are reserved for experimental usage: IP addresses between 240.0.0.0 and 254.255.255.254
IP addresses listed under Class A, Class B, and Class C are most commonly used in the creation of subnets. Addresses within the multicast or Class D have specific usage rules outlined in the Internet Engineering Task Force (IETF) guidelines, while the release of Class E addresses for public use was the cause of plenty of debate before the IPv6 standard was introduced.
Four types of IP Addresses
Public IP Address
A public IP address applies to the main device people use to connect their business or home internet network to their internet service provider (ISP). In most cases, this will be the router. All devices that connect to a router communicate with other IP addresses using the router’s IP address.
Private IP Address
A private IP address, or internal-facing IP address, is assigned by an office or home internet(or local area network) to devices, or by the internet service provider (ISP). The router manages the private IP addresses to the devices that connect to it from within that local network. Network devices are thus mapped from their private IP addresses to public IP addresses by the router.
Static IP Address
All public and private addresses are defined as static or dynamic. An IP address that a person manually configures and fixes to their device’s network is referred to as a static IP address. A static IP address cannot be changed automatically. An internet service provider may assign a static IP address to a user account. The same IP address will be assigned to that user for every session.
Dynamic IP Address
A dynamic IP address is automatically assigned to a network when a router is set up. The Dynamic Host Configuration Protocol (DHCP) assigns the distribution of this dynamic set of IP addresses. The DHCP can be the router that provides IP addresses to networks across a home or an organization.
Each time a user logs into the network, a fresh IP address is assigned from the pool of available (currently unassigned) IP addresses. A user may randomly cycle through several IP addresses across multiple sessions.
What is a subnet?
A subnet, or subnetwork, is anetwork inside a network. Subnets make networks more efficient. Through subnetting, network traffic can travel a shorter distance without passing through unnecessary routers to reach its destination
The IANA reserves specific IP address blocks for commercial organizations, government departments, and ISPs. When a user connects to the internet, their ISP assigns them an address from within one of the blocks assigned to it. If they only go online from one computer, then they can use the address assigned to it by their ISP.
However, most homes now use routers that share a network connection with multiple devices. So if a router is used to share the connection, then the ISP assigns the IP address to the router, and then a subnet is created for all computers that connect to it.