Working of Network Layers

The Internet is now becoming our basic need. We are using Internet for different purposes. We all know different layers of computer network, but one question always comes in mind how all these layers are helpful for communication? This article gives you detailed explanation about, how all network layers work together for sending messages from one system to another system.


There are two cases:
1) All communicating host  are in the same network.
2) All communicating host are in different network.
Whenever two system are communicating with each other then there is always process to process communication. 

For process to process communication requires port number, host to host communication requires hostid, and network to network communication requires netid. Port range is from 0 to 65536. Port no 80 is used for web services.

Case 1:
All host are in the same network, then there is no need of router. 

How you can decide where are you(host A) and where is host B? For that subnetmask is important.


Default subnetmask for different classes:
Class A : 255.0.0.0
Class B : 255.255.0.0
Class C : 255.255.255.0

How you can identify the ip address of your system? open terminal and type ifconfig in linux or ipconfig in windows. Suppose you are searching something on google then google server is your another host(host B). Then how you can find the ip addresse of google server? Its very simple just open terminal(cmd) and type "nslookup google.com" you will get an ip addresse of the google server.
Perform AND (boolean) operation:
IP(Host A) AND Subnet mask (Host A) = Netid (Host A)
IP(Host B) AND Subnet mask (Host A) = Netid (Host B)
If both NetID are equal, then Host A and Host B are in the same network.
If both NetID are different then Host A and Host B are on different network.
Following diagram shows different layer and corresponding details:
Both IP addresses are mentioned at the network layer so MSG directly sends from host A to host B.  





Case 2:
Host A and B are on different network, so it requires the router to connect to networks.
Following diagram shows how msg is transfered from host A, router1 and router2 to host B.   













At data link layer it requires mac address of A and mac address of router 1. At router only 3 layers are present PL, DLL, and NL. Whenever msg is transfered from router 1 to router 2 only change in packet format is "MA replaced by MR1 and MR1 is replaced by MR2". When msg is reached at router 2. From router2 again there is change in packet format "MR1 is replaced by MR2 and MR2 is replaced by MB(MAC of host B)".
Now the question is how you can identify mac address? For that Address Resolving Protocol(ARP) is used. ARP converts the IP address to physical address.

That's all for this tutorial. Please do let me know about your views about this article in the comment section below, and stay tuned for more articles.

4 comments:

Post a Comment