Internet & Networking

sonu kushwaha
8 min readDec 2, 2020

This blog will give you an basic intuition on how the internet and its networking takes place. Obviously, how the internet work ,and I will not be dealing all the technical defination,OSI model different types of layers, all these definition you can find online there are many resources available .

After completing the blog, you can imagine how the data is transfer from one computer to another,I will be talking about how the internet works in a simplified manner and what all things are available and how all the thing take place ,and their sequence.

What is an internet?

Internet is basically a network of computer network that are inter-connected hence known as internet. History of internet, I am not sure if many of you know, in 1957 a satellite was launched by Russia named “sputnik” which was the world first satellite, as we all already know that USA is a competitive country, so in order to stay ahead in the race they lunched ARPA(advance research project agency) which was for defence for which they created ARPANET which was a private internet which consist of only four nodes, and they were able to communicate b/w those four places only.After some year they felt the need of some rules, because if everyone have different rules to transmit data across internet then is not going to work for everyone hence they thought of making standardized set of rules and TCP (Transmission Control Protocol/Internet Protocol) was created. And communication was done using command line, so to share research papers and document was tough job, so for that Tim Berners-Lee in 1990 created www which was used to display HTML pages ,which also consist of hyperlinks. and during that time all these were maintained manually ,gradually when the no. of website increased it became the tough job to maintain it.then search engine was lunched(yahoo was the first one)

How does communication takes place over Internet?

all the data is traveling in the air,but literly country by country there are wire laid under oceans ,India physical internet wire is connected with Singapore which is maintained by tata, so all the data that comes to India it comes through that wire.

IP ADDRESS→each device that is connected to internet has an address suppose if you search for www.google.com but google also has its ip address (ie 172.217.27.196:)

ping www.google.com

you can also checkout ip address of yours pc ie by

$curl ifconfig.me

so, every device and every website has its own ip address ,there is need to memorize these ip address, everything will be taken care on its own. some ip address are reserve for some specific function.

PORTS → suppose you search for www.google.com ,so router will send the request to google via socket and router(what shocket does is provides the port dynamically with the help of DHCP to different application process)along with the IP address of local machine and google will send the data back , and after that how does ones router know that which application requested for that resource, by default your device is identified by your ip address and all the application that are running on your device are identified by port numbers and all these port are defined by internet organization ie by ICANN example nginx has its port 80 ,mongo has 27017 etc.

MODEL FOR COMPUTER NETWORK

  • OSI model → its just the hypothetical layer ,to understand how the network works .here by layers it means that how data is transferred from one application to another application .so that they can share resources from one computer to others such as files, videos, and pictures.

Client-Server model

  • client here means the one who initiates the request. and the server is one who is going to take the request .It consist of single server and multiple client. So the clients ask for service to the server and the server responds back with the service.The main focus is of sharing information which is stored only at server side ie Data management is centralized.hence more stable and scalable than peer to peer network.

P2P(peer to peer) Model

  • There is no dedicated server and clients. Each node acts as a server and as well as client.Each node in the network can request for a service and can provide a service.The main focus is to develop connectivity among the nodes.The main focus is to develop connectivity among the nodes.Each node store its own data.Stability reduces when the number of nodes increases.Each user has its own data and applications.

suppose consider a scenario, you have to send a mail to yours dear via postoffice ,so first of all you need to write the mail (ie application layer)then you will put that mail in the Envelope, then to the post box (ie presentation layer) then that mail will be handled by post office persons and then are sent for transportation purpose to receivers city(ie the session and the transport layer)then what it dose is it locate areas (ie the network layer),then its sent to your dear’s house ,verify to whom the mail is scheduled to.(ie the the data layer and the physical layer )

Application layer:- this layer is implemented by all the software like your facebook, whatsapp web browsing emails etc This is the one which the end user communicate to.., and provide data to the layers below as in picture above.

Presentation layer:-it presents the data,ie received from the application layer and converts its into a particular syntax,it is also encrypted, encoding and compression so that data could be transferred easily, all these are done to increase efficiency.

Session layer:-its responsibility is to take the services of the transport layer and build a service on top of it that will manage the user session

Transport layer:-this layer shows how HTTP works with TCP, before sending any data there is the need of establishing a connection and it is possible with TCP and UDP so this are the two protocol to maintain connection b/w client and server architecture here we also need to understand that TCP is connection-oriented and UDP is connectionless what dose it mean is that tcp will ensure that your data is transferred perfectly without any loss and errors are handled like in case of a chat application, emails websites, etc but in case of UDP there are losses of data and errors are also not handled like youtube, video conferencing, etc where we can clearly make out some pixels are lost .now your data can be transmitted into two ways ie TCP or UDP. If you choose TCP it will ensure all your data is transferred like Emails along with the error handling.

Network layer:-The network layer process are taking place at the router’s level what it does is it take your data(message) in terms of packets. here in the image below you can notice there is packages each of size 32 bytes. it facilitates the transportation of packet from one end system to another also determines the best route.

Data Link layer:-what it does is it allows the connected host to communicate ie your computer connected to someone else, or internet service provider, and transport all the data received by the router from the network server to your devices that are connected to your router as per the request received/sent.also takes care for the address allocation is proper and data collision does not take place.

Physical layer:-it the physical structure, optical fibers, signals ethernet cables, your computer, etc

How do we find things on the internet ie how IP address are located??

let first get familiar to basic terms

a)Switch:- it falls under second level of OSI model discussed above.and is used to connect different IP of same network .

b) Router :-It falls under the third level of OSI model .and is used to connect different network/s . like local area network (LAN) and wide area network (WAN)

NOTE:-the above two are physical device ,but there is an software for all these called SDN(in case of docker it is called bridge )

c) Gateway:-it is one of the service provided by DHCP that allows the flow of data from one discrete network to another.It is the one which allows you to get connected to the internet its the main path way from where yours request goes/pass on.

d)DNS/nameserver:-It converts the domain name into IP address ie if we ping www.google.com then what it does is convert it into IP address (8.8.8.8 which is googles IP ddress)

e)DHCP :-what it does is provide/allocates IP address,gateway, and DNS dynamically . and all its data is is managed by IPAM(IP address management) which is a data base that stores all the information of DHCP.

when we ping www.google.com it will give the IP address of google along with additional information .so our computer what is is going to do is, first it is going to check in its local repository ie in DHCP which provides IP address on its own dynamically(for local purpose),so DHCP will deny as it does not have IP address for www.google.com and sends the same request to ISP (internet service provider) ,what ISP is going to do is check in its own dictionary for the IP address of google which further sends request to the root dns servers(root dns server are the main organizations)which follows main root these are the maintainers of internet and top level domains like “.com”, ”.in”,”.org”,etc which have their own dictionaries and provide services accordingly. So to summarize it first search in DHCP, then ISP then root DNS servers for services if the IP address are not found it throws back 404 error ie there is no such IP available.

Now talking about Cookies

cookies are the values that the server sets on your web browser with the help of request headers and saves it to the browser/local system, as we all know HTTP is a state less,it mean that any time we run the program or web page every connection that we have is treated as a new connection ie all the request are re-sent as each request is treated as new fresh request.but we also encounter that if a webpage contains login credentials ,when we reach the same page again we are still logged in this is possible because of cookies

firewall

it’s just the network security system,what it dose is provide certain rule and restriction for people to make connection on your computer suppose you can restrict your computer ie not to allow the access for IP address starting with certain fixed id’s or the ttl(time to leave) is less.

--

--