How do data packets work?

When you send an email, watch a video on Facebook, or shop online, you’re actually sending and receiving information digitally. It may seem like you’re sending the entire photo of your new cat to your cousin across the other side of the world, however, your cat is actually divided up and transmitted via segments of electronic data and then reassembled when it reaches the destination device or computer. You can see the effects of a slow internet connection when this picture loads, as parts of the image appear one after the other. 

Each unit of data, or piece of your cat photo, is segmented into a single package referred to as a ‘data packet’. The structure of data packets depends on the types of packets they are and on the protocol. Every data packet contains a header and a payload. The payload makes up the majority of the packet and contains the data being carried (eg. the cat photo itself). 

The packet headers can be thought of as envelopes, in that they contain the destination IP address and source IP address just like a traditional envelope. Headers contain overhead or descriptive information about the packet, the service, and other transmission-related data. Data transfer over the internet requires breaking down the data into IP packets, which are defined in Internet Protocol (IP). 

Diagram – how data travels across the internet

Internet Protocol

If you imagine your cat photo broken up into puzzle pieces, you can thank Internet Protocol (IP) for tagging each piece with the source and destination address to ensure your packets are delivered to their intended location. An IP address works like a return address on a letter in the mail. When your computer sends the cat photo to your friend, it is tagged with your IP address so that your friend’s computer knows where to send a smiley face in response, which will also be tagged with the unique IP Address of your friend’s computer. 

The primary version of IP used today is the Internet Protocol Version 4 (IPv4). With the ever increasing number of people using the internet and a finite number of total possible addresses in IPv4, a newer protocol was developed. This newer internet protocol is called IPv6 and it makes many more IP addresses available, and many ISPs are adopting it. RISE includes a static public IPv4 address with every Enterprise Plan. IPv6 is also allocated free of charge in block sizes of /56 and /48. One thing to note is that devices with only an IPv6 address can’t talk to devices on IPv4.

Now that we understand IP is responsible for defining IP addresses and how computers send data packets to each other, we can discuss how data packets are divided and reassembled over the internet via Transmission Control Protocol. 

Transmission Control Protocol

Using our cat photo/puzzle analogy, Transmission Control Protocol (TCP) is an additional connection-based protocol that is responsible for dividing up and assembling the puzzle pieces of your cat photo back together. TCP also makes sure the pieces are put together in the right order and without duplicates or missing pieces, and notifies the sending computer that your cat puzzle has been received and completely assembled. 

As TCP is a connection based protocol, it is also responsible for maintaining the connection between the sending and receiving computers from before the first piece of the cat photo until after the final piece is sent. 

Certain networks can demonstrate unpredictable behavior, resulting in IP packets being lost or delivered in a different order. TCP is known for reliability and accuracy when dividing and reassembling data packets, and so it reduces these issues by reordering the packet data or requesting redelivery. This accuracy means that there can be a tradeoff in speed, sometimes with a delay of several seconds. 

If you are experiencing packet loss or a slow internet connection, please see RISE’s support article on reporting packet loss to find out what we can help you with.  

TCP/IP

TCP and IP are the basic protocols or rules which define the internet and allow two or more devices (eg. phones, tablets and computers) to communicate and share data packets with each other. TCP/IP can also be used as communication protocols in a private network (eg. an intranet or an extranet). Given that it is compatible with all operating systems, it can communicate with any other system and is also highly scalable.

UDP (User Datagram Protocol) 

UDP is an alternative protocol to TCP and is used to establish low latency and loss-tolerating connections between applications on the internet. UDP is considered a connectionless protocol because it doesn’t require a virtual circuit to be established before any data transfer occurs. Unlike TCP, UDP does not guarantee that data packets will get to their correct destinations. It simply sends the data out and relies on the devices in between the origin and destination to route the data where it is supposed to go. 

To illustrate, think of a package that is to be delivered by a courier with a tracking system versus one without.  With a tracking system or a tracking number, you would be able to see if the package you sent arrived at its destination.  This is how TCP works.  UDP, on the other hand, is like sending the package without a tracking number – you wouldn’t be able to confirm delivery unless the receiver informs you about it.

The next article in our series will look at latency or the speed at which your data can travel to its destination and back again. We will also examine how you can use a tool called a traceroute in order to track the path that your data takes.

RECOMMENDED ARTICLES