Internet Protocol (IP) is a standard for routing and addressing packets of data across networks so that they arrive at their intended destinations. Internet traffic is divided into smaller pieces, called packets. Each packet contains IP information, which helps routers send packets to the right locations. A device or domain that connects to the Internet is assigned an IP address, and as packets are directed to the IP address attached to them, data is sent to its destination.
Once packets arrive at their destination, they are handled differently depending on which transport protocol is combined with IP. Typically, TCP and UDP are used.
Protocols are standardized ways of doing certain actions and formatting data so that two or more devices can communicate and understand each other in networking.
Think of the process of mailing a letter to understand why protocols are important. Addresses on envelopes are written in the following order: name, street address, city, state, and zip code. Post offices will not deliver an envelope if the zip code is written first, followed by the street address, followed by the state, and so on. The postal system requires an agreed-upon protocol for writing addresses. A standardized format is also used for IP data packets and IP addresses.
IP addresses are unique identifiers assigned to devices or domains that connect to the Internet. The IP address is a set of characters, for example, 192.168.1.1. Users can access websites with the help of DNS resolvers, which translate human-readable domain names into IP addresses. Like a piece of mail, every IP packet contains both the IP address of the device or domain sending the packet and the IP address of the intended recipient.
The fourth version of IP (IPv4 for short) was introduced in 1983. Nevertheless, just as there are only so many permutations of license plates for automobiles, and they have to be reformatted periodically, there is a limited number of IPv4 addresses available. Despite the fact that IPv6 addresses have many more characters and thus more permutations, IPv6 is not yet widely adopted, and most domains and devices still use IPv4 addresses. See What is my IP address? for more information on IPv4 and IPv6.
IP packets are created by adding an IP header to each packet of data before it is sent. An IP header is just a series of bits (ones and zeros), which records several pieces of information about the packet, including its sending and receiving IP addresses. They also report:
There are 14 fields for information in IPv4 headers, although one of them is optional.
The Internet is made up of interconnected large networks, each of which is responsible for some blocks of IP addresses; these large networks are known as autonomous systems (AS). Packets are routed across ASes using different routing protocols, such as BGP. Routing tables tell routers which ASes packets should travel through in order to reach their destination as quickly as possible. A packet travels from one AS to another until it reaches one that claims responsibility for the targeted IP address. The packet is then internally routed to the destination by the AS that claims responsibility.
OSI layers attach packet headers:
Packages can take different routes to the same place if necessary, just as a group of people driving to an agreed-upon destination can take different routes.
Data is sent and received using Transmission Control Protocol (TCP), a transport protocol. Each TCP/IP packet includes a TCP header. The connection is established before data can be sent. Once transmission begins, each packet arrives in order. Each packet will be acknowledged by the recipient via TCP. If a packet is not acknowledged, it will be sent again.
TCP is designed to be reliable, not fast. TCP ensures that all packets arrive in order, so if some packets are missing, loading data can take longer via TCP/IP.
TCP and IP were originally designed to be used together, and together they are often referred to as the TCP/IP suite. IP can also be used with other transport protocols.
Another widely used protocol is User Datagram Protocol, or UDP. Although UDP is faster than TCP, it is also less reliable. It does not ensure all packets are delivered and in order, nor does it establish a connection before sending or receiving data.