What is Internet Protocol ?

ยท

3 min read

The Internet Protocol (IP) is a protocol, or set of rules, for routing and addressing packets of data so that they can travel across networks and arrive at the correct destination. Data traversing the internet is divided into smaller pieces, called packets. IP information is attached to each packet, and this information helps routers to send packets to the right place. Every domain or device that connects to the internet is assigned an IP address, and as packets are directed to the IP address attached to them.

The most common transport protocols are TCP and UDP.

What is an IP address? How does IP addressing work?

An IP address is a unique identifier assigned to a device or domain that connects to the internet. Each IP address is a series of characters, such as 192.168.1.1. Via DNS resolvers, which translate human-readable domains into IP addresses, users can access websites without memorizing this complex series of characters. Each IP packet will contain both the IP address of the device or domain sending the packet and the IP address of the intended recipient, much like how both the destination address and the return address are included on a piece of mail.

IPv4 vs. IPv6

The main difference between IPv4 and IPv6 is the address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal address. IPv6 provides a larger address space, and it contains a simple header as compared to IPv4.

What is an IP packet?

IP packets are created by adding an IP header to each packet of data before it is sent on its way. An IP header is just a series of bits (ones and zeros), and it records several pieces of information about the packet, including the sending and receiving IP address. IP headers also report:

  • Header length

  • Packet length

  • Time To Live (TTL), or the number of network hops a packet can make before it is discarded.

  • Which transport protocol is being used (TCP, UDP, etc.)

In total there are 14 fields for information in IPv4 headers, although one of them is optional.

How does IP routing work?

The internet is made up of interconnected large networks that are each responsible for certain block of IP addresses, these large networks are known as Autonomous Systems (AS). A variety of routing protocols, including BGP, help route packets across ASes based on their destination IP address. Routers have routing tables that indicate which ASes the packets should travel through in order to reach the desired destination as quickly as possible. Packets travel from AS to AS until the reach one that claims responsibility for the target IP address. That AS then internally routes the packets to the destination.

Protocols attach packet headers at different layers of the OSI model.

Packets can take different routes to the same place if necessary.

What is TCP/IP?

The Transmission Control Protocol (TCP) is a transport protocol, meaning it dictates the way data is sent and received. A TCP header is included in the data portion of each packet that uses TCP/IP. Before transmitting data, TCP opens a connection with the recipient, TCP ensures that all packets arrive in order once transmission begins. The receipient will acknowledge receiving each packet that arrives. Missing packets will be sent again if receipt is not acknowledged.

TCP is designed for reliability, not speed. Because TCP has to make sure all packets arrive in order, loading data via TCP/IP can take longer if some packets are missing.

What is UDP/IP?

The User Datagram Protocol is another widely used transport protocol. It's faster than TCP, but it is also less reliable. UDP does not make sure all packets are delivered and in order, and it doesn't establish a connection before beginning or receiving transmission.

Did you find this article valuable?

Support Make api calls like a pro ๐Ÿ˜Ž by becoming a sponsor. Any amount is appreciated!

ย