When I started my development journey to build Web & Mobile Apps, there were always corners of the topic that made me clueless about how things work under the hood in real-world applications. There is so much going on in the background that we miss as developers, and I personally think it's way better to know the concepts than to just be a code junky.
In this writeup, you will be learning a lot about how Networking plays a crucial role in hosting and running real-world applications. Also, you will be able to understand things from a security standpoint as we go deeper into the concepts of each node of this writeup.
IP Address
There can't be a better topic to start with than IP addresses when we talk about networking; IPs are the first & last thing that you will see while maintaining an application’s environment. There is a lot to know about each topic, so I have covered just enough points that can raise your confidence in front of a Network dude.
When we talk about an IP Address, think of it as a phone number, i.e. unique in an environment & can be used as a communication address. Almost every machine connected to a network is having and IP address, but we can't just randomly assign any IP address to any machine.
Types of IPs are used to build a fault-tolerant network environment that can scale up & down depending on the demand & usage.
IP Classes
IP addresses are divided into multiple classes & knowing which class it belongs to is necessary when you are deploying apps that run between multiple environments.
A great example would be music streaming apps that are available on multiple devices for the same user, such as Spotify and Amazon Music, where you can access the same stream over the Web, Mobile, and Smart Home Devices. We’ll go more deeply into a real-life example later.
The diagram above shows a drill-down view of IP Classes in Public & Private IPs. Please note that you don't have to remember these classes, divided further into Public and Private.
It's easier to remember once you know the difference between the IP Ranges they fall into.
IP Classes for Private Range are something that you have seen mostly in your Personal Devices, Smart Home Devices, and Home Network Devices.
-Private Range having Class A is used mostly in Big Corporate Networks, as it can easily manage a high number of network devices for building a personal scalable network.
Private ranges having Class B are also used in Corporate Networks, but these can also be used in a Isolated Network Envirement to keep things clean.
Private ranges having Class C are the most common range of IPs; these are used in devices that are sitting at the bottom of the private network structure. Such as your Laptop and Smartphone connected to your Home Broadband Router, which is later connected to the ISP Network environment. In this whole mesh of structure, personal devices always fall at the last as they are the last point of packet flow.
That's why you always see IPs starting from 192.168.x.x in your Laptop, Smartphones, smart TVs, etc.
- Now, if we talk about the Public IP range, things get a bit different as we have a limited reserved range of Public IP addresses; hence, these are used where the network mesh needs external network exposure, or you can say Internet Connectivity.
-A Great example would be a Cloud KVM instance; the user will be accessing that KVM from anywhere in the world. For that to be possible, KVM will be given a Public IP, which will be an Internet address for that KVM and its users.
You can also look up your Public IP, which is given by your ISP.
-Please note that the Public IP is assigned to your home Router and not your personal machine. However, it doesn't mean that the Public IP will be reserved forever for that machine or your home router; it will be dynamic in 99% of cases and will change in the next 10–15 minutes.
Dynamic & Public IPs
The above example covers a scenario where the Public IP keeps changing; that is because owning a static Public IP includes charges that are paid to keep the IP static. The same thing is configured in Private networks as well to maintain security standards. The more frequently something is accessed by users, the higher the chances of Risk; however, the ratio of Private Dynamic IPs will always be low, as they are already plenty enough and they don't cost anything to use.
Domain Name System
Once IP Addresses are assigned to devices, it is hard to remember the whole IP address that belongs to a certain device; this is where DNS comes into action. The way DNS works is quite simple; think of it as a service that converts a request into a different readable format.
In our case, it can be a Webpage request that comes from a browser requested by a user, which is later resolved by many possible DNS services sitting in between the network.
In most cases, if you visit a Webpage very often, the resolved DNS for a webpage is stored in the browser cache for a fast response.If the request is fresh, DNS services sitting in possible places such as your home router and the ISP’s DNS itself help in resolving the DNS. Please note that these DNS services are spread over multiple points in the network.
Let's say you are on a Cellular Network on your phone; the DNS servers sitting in your Network Service Provider get activated; these are real physical DNS servers that are doing their job for multiple requests in that same Network Service Provider.
-Apart from these DNS services, we also have some famous DNS service providers such as Cloudflare and Google DNS. Big tech uses a set of providers to tackle high user activity.
Ports
There are a total of 65,536 ports that exist, but you don't have to worry about remembering each port and which services it belongs to. In practice, you will be dealing with a bunch of ports that are used for standard services, mainly in Applications & Microservices, where the port enables us to separate the flow of data in the existing entity.
-For example, if an application needs to handle user data & Web requests through the webpage, it will need to separate those requests in order to redirect that request to a related service.
-That webpage request will be handled by port 443, where HTTPS requests will pass through, and data fetching from SQL tables will be done through the standard MySQL port 3306.
Think of it as an office building with multiple floors; if a parcel has to be delivered to a guy sitting on the 4th floor, the delivery guy needs the floor number, else he will have to search the entire building to deliver.
Read the full blog for free here : https://medium.com/javascript-in-plain-english/networking-concepts-for-software-developers-101-c6d9c0ecb9af




Top comments (0)