IP stands for internet protocol and it powers the whole internet. In this small article we will see How Internet Protocol works for you and your software.
Internet Protocol basically powers the whole internet. IP works in network layer and each packet or say datagram or packet in the network need to interact to it in each hop, yes each hop to reach its destination. Have a look a the below diagram.
How Packets Move in Network.
1.Now the data transfer happens in below steps. Application creates data packet to send. In this article we are not taking care what happens in application layer and how application layer forwards packet to application.
2. Next application layer gives packet to transport layer which puts its headers which again depends on what protocol you are using like UDP or TCP.
3. Now packet moves to network layer where it attaches the IP headers which consist source and destination ip address.
4. Next it is forwarded to link layer which attaches its headers which consist of MAC address of the next hop and forward it to the next hop. Link layer only takes care of the next hop delivery. The whole path is not defined by link layer.
5. Now packet moves to the link layer of intermediate node. Link layer forwards the packet to network layer. Which reads the source and destination headers and based on its routing tables or forwarding tables to decides what is the next hop it should go to. Again packet is send back to link layer.
6. Link layer then sends the packet to next hop.
7. This process continues until the packet reaches the destination. There network layer forward the packet to transport layer and then it is forwarded to application layer.
Internet protocol is very simple and does this only. It does not take care of things like error detection, reliable delivery etc.
So in short internet protocol tries best effort to deliver the packet in connection less manner where reliability is not ensured.
In next articles we will see other protocols in other layers like TCP and UDP in transport layer.
If you like the article please share and subscribe. Want me to write article on other topics please write to me and I will try to write one.
Also read about working on scale series