on 07-23-2011 04:41 AM
Network layer is layer 3 of OSI Model. Network layer adds support of connecting multiple networks with each other. Network layer uses its own unique addressing scheme for differentiating networks and hosts within that network. Internet widespread geography is possible only because of network layer and its addressing scheme. Network Layer provides services to upper layer which is Transport Layer and Layer 2 Data Link Layer provide services to Network Layer. In general layer 3 provide following services:
In this article we will study about all the functions of network layer in detail with examples and how communication is done at network layer. For this you must have understanding how layer 2 network works, for this, please refer - Overview of Layer 2 Networks and Communication.
For purpose of addressing network layer uses a specific kind of addressing scheme called IP Address (Logical Address). IP address is composed of 32 binary bits. Its’ written in decimal form using 4 octets (1 octet is of 8 bits) (32 / 8 = 4). Example of IP address version 4 – 192.168.5.10. IP address contains two part in them – Network part and Host part. Host part defines unique address of host and network part define network of that host (to which network host belongs). Network is kind of group and hosts are people in them. Two different networks cannot communicate with each other at layer 2 but can communicate using layer 3 Message Forwarding devices (Layer 3 Devices). To better understand host addressing please refer to DS Understanding IP Address
.
Single network at layer 3 means all those hosts whose network part is same in their IP address. For example all host with network 192.168.5.0 / 24. So in single network all hosts have same network address. Communication within a single network is done via switch. For details please refer Overview of Layer 2 Communication. In single network, inter-communication device is Switch which is a layer 2 device, so layer 3 addresses only plays role in ARP. Each packet sent to switch is complete packet, it contains layer 3 information also. At layer 3 source IP address and destination IP address is mentioned. But as Switch is layer 2 device, it reads only layer 2 information and does forwarding based on layer 2 information (MAC Address). Layer 3 information as mentioned above is used for connection between multiple networks, so let’s see how inter-communication is done between multiple networks and also how host machine connects to Internet.
When there are multiple networks, layer 2 device (Switch) cannot be used for inter-communication because switch works on MAC address and MAC addresses are obtained via broadcast, and we cannot send a broadcast in whole world to find a single machine. To solve this problem Layer 3 addressing was developed and Layer 3 device Router is used for inter-communication. When two hosts which are on different network want to communicate, Router is used for forwarding message from one network to another network. Router is connected to multiple networks and each interface which connects to a network is configured with IP Address and belongs to same network as to which it is connected. When we configure any host machine with Network Layer Addressing, there we mention IP Address, Subnet Mask, Default Gateway and DNS Servers. IP address and Subnet Mask are used for layer 3 addressing which you have understood from (this article); Default Gateway and DNS Server are used for inter-communication between two networks. Default Gateway – Default gateway is IP address of that device, to which machine forwards all those packets which are not in same network. Any packet which is out of network, machine forwards it to default gateway device. All unknown network packets are sent to default gateway. Routers act as default gateway. DNS Server – As we know internet works on IP addresses but we use names to open any websites. But behind the scenes DNS Servers convert site name into IP address. For example – we want to open Google, we simple type www.google.co.in and sites open, but at back end, first IP address of Google is obtained from DNS Server after that packet is formed with Google IP address as destination IP address and transmitted. Following is the process of communication between two networks:
Router internally has two tables one for layer 2 information (MAC Address / ARP Table) and layer 3 information (Routing Table). Routing table is used for inter-network communication. There are two types of routing protocol algorithms based on which routing table contains entries of other networks. These two algorithms are:
Router using Distance Vector algorithm contains information about networks through its neighbor router via frequent updates whereas in Link State Logic Algorithm each router maintain complete tree like structure of whole network keeping itself at root and get updates only when there is a change in network. Routing table contains network address (not hosts IP addresses) and port on which that network is available. Following is an example of routing table.
Configuration of Above Network is as below:
Suppose PC0 wants to send data to PC5, IP Address of PC0 is 192.168.5.10 /24 and IP Address of PC5 is 172.16.0.50 / 16, then following will be the series of operation:
.
I'm sure there's some great information supported by commensurate expertise embedded in the article but substandard grammar, organization, and expression demands an exhaustive amount of distillation. Sorry, but I gave up.
If you give up easily as you seems to do, you'll never be able to get a job or move up to a more interesting and challenging positions within the technology field. Think about it.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: