The Internet protocol (IP) is the network layer communications protocol in the Internet protocol suite for relaying datagrams across network boundaries.
It has the task of delivering packets from the source host to the destination host solely based on the IP addresses in the packet headers. For this purpose, it defines packet structures that encapsulate the data to be delivered. It also defines addressing methods that are used to label the datagram with source and destination information.