The Network or Internet layer in the TCP/IP model is for internetworking. This layer has a group of methods, functions, and protocols to facilitate communication between different networks. The communication between networks is achieved through a mechanism known as gateways.
The protocols in this layer primarily carry out the following functions:
They pass the outgoing packets to the next layer (datalink) through the gateway
They pass the incoming packets to the transport layer
They provide error detection and diagnostics for the incoming and outgoing packets
Some of the important protocols in this layer are Internet Protocol (IP), Internet Communication Message Protocol (ICMP), Internet Group Management Protocol (IGMP), and Internet Protocol security (IPsec).
The ICMP is used for error and diagnostic functions, and IGMP is used in multicasting.