What is piggybacking in the computer network?


Piggybacking means to ride over something.  In a real example, if someone is about to start traveling towards a destination, with his bike. At the same time, you also have a plan to go to the same place. You can ask for the lift. If gets no one, then you need to use your own bike for the ride.

In the above example, there are many advantages of sharing resources, such as saving fuel, less traffic on the road, lesser pollution, etc.

A similar concept is used in computer networks for more optimized communication.  In piggybacking, a sender sends a user data packet with the acknowledgment (ACK), if an ACK is about to go to the same destination. 

Reliable communication has an acknowledgment from the receiver.  SCTP protocol is one of the examples of a reliable transport layer protocol in the OSI model. SCTP supports piggybacking by sending a DATA chunk with the ACK.  It optimizes the underlying network bandwidth.

 With piggybacking, you will see a single message (DATA + ACK)  over the wire in place of two separate messages. 


How piggybacking is done?

Here we will explain the concept with an example.

  • There are two computers, named A and B over an IP network.  They are communicating with each other using a reliable SCTP protocol. 
  • A sends a packet to B and waits for the response (ACK), before sending the next packet. 
  • Node B does the same to communicate in another direction.
  • If there is no piggybacking supported, then the response of a sent packet will contain an SCTP-ACK chunk only.
  • In piggybacking, if A sends the packet to B. B waits (for a small time) for a user DATA packet before sending the ACK. Once the user packet is received within a time frame,  B sends both ( ACK  and user DATA) in a single network message. 
  • On A, the message is processed as two separate chunks, one is ACK and the other is the user DATA.
  • This saves the bandwidth of the network but adds a little delay. 

What are the Advantages and disadvantages of piggybacking?

This network optimization technique has some advantages and disadvantages as similar to most of the other things. The main disadvantage is, blocking of ack for some time. This may cause a connection to go down or may cause a service problem if the delay is more than expected. To avoid problems, piggybacking uses a very small duration timer.

On the advantage side, better use of bandwidth.  The underlying cable and intermediate switches, routers, etc, will be less loaded.  If someone is paying the cost to utilize a network based on messages, then the cost will also be reduced.