What is piggybacking in the computer network?
Piggybacking means to ride over something. In a real example, if someone already traveling towards a destination, with his bike where you also need to reach, you just take the lift over the bike. If someone not traveling, then you use your own bike for the ride. A similar concept is very common in computer networks called piggybacking. In piggybacking, the sender sends a data packet along with the acknowledgment, if any acknowledgment needs to send at the time of transmission of the data packet.
In reliable communication, each packet has an acknowledgment from the receiver. SCTP protocol is one of the examples of a reliable transport layer protocol in the OSI model. Piggybacking is an optimization method for the utilization of underlying network capacity. A user message is piggybacked over an acknowledge message. For example, in SCTP a single message may have two chunks one is for DATA and the other is ACK. After piggybacking, there is a single message over the wire in place of two.
How piggybacking is done?
Here we will explain the concept with an example. There are two network computers, computer A and computer B. Both are using reliable transport (e.g SCTP) protocol to communicate with each other in both directions. A sends a packet to B and then waits for the response, before sending the next packet. The node B does the same. If there is no piggybacking, then each packet has its response as an acknowledgment packet.
In piggybacking, if A sends the packet to B, and B has a user packet to send to A. B waits for a user packet before sending the ACK. Once the user packet is received B sends both ( acknowledge and user packet) in a single message. On A, the message is processed as two packets, one is ACK and the other is the user packet. This saves bandwidth for the network.
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, router, 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.