Logical Addressing: Every device that needs to communicate over the network is assigned a logical address also known as the Layer 3 address. When using Internet Protocol as the layer 3 protocol this address is known as the IP address
Routing: Routing is also one of the main functions of the Network Layer, routing is the process of selecting paths in a network over which to send packets. At the Network Layer is a device known as the Router that perform this job, a Router connects multiple networks together and perform routing on incoming packets that is to select the best path based on the routing algorithm and send it towards the destination.
Error Handling, Diagnostics and QOS: Internet Control Message Protocol (ICMP) is network layer protocol and one of the main protocols of the Internet Protocol suite and is used for error handling and diagnostic purposes. Quality of Service (QOS) although not the primary function of the network layer is available in network layer protocols such as the Internet Protocol which allows certain traffic to be prioritized over other giving it preferential treatment.
Connection Model: The Network Layer protocol can be either connection-oriented or connectionless. In connection-oriented communication the devices must first establish and end-to-end connection before data exchange. Whereas connectionless communication does not require a connection establishment procedure prior to data exchange, data can be sent from the source to destination without any connection established. The Internet Layer in TCP/IP model only supports connectionless protocols such as the IP Protocol, connection oriented protocols such as Transmission Control Protocol (TCP) work at layers above the Internet layer in the TCP/IP model.
TCP/IP Data Encapsulation with respect to Network Layer
Application, Transport, Network and Data-Link layers add their own header information as the data travels from the Application Layer down through the other layers. At the Data-Link layer a trailer is also added. The encapsulation process can be express as follows
- Data is created and the Application Layer encapsulates the data in an application layer header.
- The data supplied by the Application Layer is encapsulated by a Transport Layer header which is either TCP or UDP
- At the Network Layer the data passed down by Transport Layer is encapsulated in a Network Layer protocol header which is Internet Protocol (IP) header when using the TCP/IP protocol suite.
- Data-Link layer encapsulates the data passed down by the upper layer using a data-link protocol header and trailer.
Finally at the physical layer the data in bits is transmitted which encodes the signal onto the medium to transmit the data.
When a destination node receives the data it carries out the de-encapsulation process which is exactly the reverse. From a Network Layer perspective when intermediate devices such as Routers receive the packet they perform routing and forwarding based on the information in the Network Layer header. As the packet is routed at every hop only the contents of Data-Link changes while upper layer headers remain intact. For example as shown in the picture below a Router is connected to two different networks, on one side is Ethernet and on the other side is Frame Relay WAN connection. When a Router receives a packet on its Ethernet interface it will perform a routing lookup on the destination IP address and if it can find a route and an exit interface it will route the packet to that interface, the router will not modify anything in the packet header but it will change the Layer 2 header. So if the exit interface is the frame-relay interface the router will remove the Ethernet header and replace that with a frame-relay header. Likewise at every hop the layer 2 header is modified until the packet reaches its destination.
Some important Network layer Protocols are mentioned below which will be the center of our studies in the networking field especially in Cisco certifications
- Internet Protocol Version 4 and 6 (IPv4/6)
- Internet Control and Message protocol (ICMP)
- PIM-SM and PIM-DM (Multicast Routing Protocols)
- Routing Information Protocol (RIP)
- Open Shortest Path Protocol (OSPF)
Internet Control Message Protocol (ICMP) is one of the core network layer protocols. It is extensively my network administrators for network diagnostics. ICMP is defined in RFC 792 and it has several messages that are typically generated in response to errors in IP datagrams. For example Packet InterNet Groper (Ping) is a utility that uses ICMP echo request packets to check the reachability of any device attached to the network. By using the Ping utility a device attached to the network such as computer can send ICMP echo request packets to a target host and wait for the ICMP response, if it receives the ICMP response then reachablility is confirmed.
Shown below is an example of the usage of Ping utility.
A windows system using the ping utility has sent four ICMP echo requests to the target host 192.168.1.1 and has successfully received the replies of all four packets as shown. Ping utility also shows the round-trip time which in this case is less than 1 ms.
However if the target host is not reachable ICMP will send a destination unreachable message back as shown below
This brings us to the end of this lesson in which we discussed the functions of network layer and also covered Internet Message Control Protocol. As we move ahead with our studies we will focus much more on network layer protocols so understanding the function of network layer is very important.