In data processing, a data packet is a compilation of related digital data, precisely defined by the communication protocol, which is sent through a data network during data transmission. This packet transmission is common in all forms of the Internet and is the basis for the functioning of the networks. Internet data packets have a 24-byte header.
A data packet has a prescribed number of bits. In addition to the actual payload, data packets also contain control data for addressing, sending sequence, data flow control, and error correction at all protocol levels.
The data is processed sequentially by a network protocol of the protocol stack. When sent, each protocol adds certain control data to the data before it is passed to the next deeper network protocol – in other words, a message carries all the headers of the layers above it on the line.
The Transmission Control Protocol (TCP) breaks down a file to be sent (e.g. audio file, image file, text file, video file) into individual smaller data packets and sends them separately from each other over the Internet. These data packets can pass through different nodes on the Internet (such as host computers, servers) because the optimal path for the packet is determined anew at each node. Since the original sequence does not have to be followed while on the road, the TCP also has the task of restoring the original order to the receiving endpoint. The Internet Protocol (IP) regulates the correct addressing of data packets so that computers connected to the Internet can be uniquely identified.
In contrast to a data stream, a data packet has a well-defined length and shape, so it can be checked for completeness and usability. The data packet is therefore a stock quantity, the data stream a flow quantity. Usually, the term datagram is used interchangeably with data packet, but sometimes they are differentiated from each other. For example, a datagram is often considered to be a data packet whose additional information contains, among other things, sender and receiver addresses, but also serial numbers and error correction keys, whereas a data packet is generally considered to be any unit of data transmitted over packet-switching networks. Unlike Protocol Data Unit and Service Data Unit, the term data packet is not precisely defined.
Especially in the case of serial transmission, instead of a data packet, it is also referred to as a (data) telegram.