Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is overhead, payload, and header [closed]

Tags:

Can someone please explain me what is overhead, payload, header and packet. As far as I know a packet is the whole data that is to be transmitted. This packet consists of the actual data which I think is the payload and the source/destination information of the packet is in the header. So a packet consists of header and payload. So what is this overhead? Is overhead a part of the header? I got this from the internet "Packet overheard includes all the extra bytes of information that are stored in the packet header". The header already contains source/destination info. What are the extra bytes of information that this packet overhead has? I'm confused.

like image 426
Priti16 Avatar asked Jul 22 '14 05:07

Priti16


People also ask

What is a header and payload?

General Structure of Messages First, the headers contain information that allows, for example, routing packets from an origin to a destination and delivering it to the proper application. The payload, however, is the message content that the origin expects that the destination receives and consumes.

What is header overhead?

The overhead of a packet type is the amount of wasted bandwidth that is required to transmit the payload. The packet header is extra information put on top of the payload of the packet to ensure it gets to its destination.

What is payload in IP header?

The payload of an IP packet is typically a datagram or segment of the higher-level transport layer protocol, but may be data for an internet layer (e.g., ICMP or ICMPv6) or link layer (e.g., OSPF) instead. Two different versions of IP are used in practice today: IPv4 and IPv6.

What is meant by payload in networking?

In computing, a payload is the carrying capacity of a packet or other transmission data unit. The term has its roots in the military and is often associated with the capacity of executable malicious code to do damage.


1 Answers

The packet like you said, have the "payload" which is the data itself it needs to transfer (usually the user's data), the "header" contains various things depends on the protocol you are using, for example UDP contains just simple things in the header like Destination and Source IP/PORT, TCP on the other end contains more things like the sequence number of the packet to ensure ordered delivery, a lot of flags to ensure the packet actually received in it's destination and checksum of the data to make sure it didn't get corrupted and received correctly in its detination.

Now, the "overhead" part is actually the additional data that you need in order to send your payload. In the cases I talked about above it's the header part, because you need to add it to every payload that you want to send over the internet. TCP has bigger overhead than UDP because it needs to add more data to your payload, but you are guaranteed that your data will be received in it's destination, in the order you sent it and not corrupted. UDP does not have this features so it can't guarantee that.

Sometimes you will read/hear discussions on what protocol to use according to the data you want to send. For example, let's say you have a game, and you want to update the player's position everytime he moves, the payload it self will contain this:

int playerID;
float posX;
float posY;

The payload's size is 12 byte, and let's say we send it using TCP, now the whole packet will look like this:

-------------
TCP_HEADER
-------------
int playedID;
float posX;
float posY;

Now the whole packet's size is payload + TCP_HEADER which is 12 bytes + (32 bytes to 72 bytes), you now have 32 to 72 bytes overhead for your data. You can read about TCP's header here. Notice that the overhead is even bigger than the data itself!

Now you need to decide if it is the protocol you want to use for your game, if you don't need the features TCP offers you better of using UDP because it have smaller overhead and therefore less data to be sent.

like image 127
UnTraDe Avatar answered Oct 16 '22 09:10

UnTraDe