A packet is a formatted block of information carried by a computer network. Computer communications links that do not support packets, such as traditional point-to-point telecommunications links, simply transmit data as a series of bytes, characters, or bits alone. When data is formatted into a packet, the network can transmit longer messages more efficiently and reliably.
A packet consists of three elements: the first element is a header, which marks the beginning of the packet, and the second element is a data area, which contains the information to be carried in the packet. The third element of packet is a trailer, which marks the end of the packet. If more data is being sent on the network's communications medium, then another header will appear; otherwise the medium is not carrying data at that moment.
Different communications protocols use different conventions for distinguishing between the header, data, and footer elements and for formatting the data. In Binary Synchronous Transmission, the packet is formatted in 8-bit bytes, and special characters are used to delimit the different elements. Other protocols, like Ethernet, establish the start of the header and data elements by their location relative to the start of the packet. Some protocols format the information at a bit level instead of a byte level.
A good analogy is to consider a packet to be like a letter: the header is like the envelope, and the data area is whatever the person puts inside the envelope. A difference, however, is that some networks can break a larger packet into smaller packets when necessary (note that these smaller data elements are still formatted as packets).
A network design can achieve two major results by using packets: error detection and multiple host addressing.
It is more efficient and reliable to calculate a checksum or cyclic redundancy check over the contents of a packet than to check errors using character-by-character parity bit checking.
The packet trailer often contains error checking data to detect errors that occur during transmission.
Modern networks usually connect three or more host computers together; in such cases the packet header generally contains addressing information so that the packet is received by the correct host computer.
In complex networks constructed of multiple routing and switching nodes, like the ARPANET and the modern Internet, a series of packets sent from one host computer to another may follow different routes to reach the same destination. This technology is called packet switching.
In general, the term packet applies to any message formatted as a packet, while the term datagram is generally reserved for packets that are not transmitted reliably. Reliable delivery is independent of whether or not the network can detect transmission errors in packets: in a datagram network, damaged packets could be discarded without notifying the sender or receiver.
When the ARPANET pioneered packet switching, it provided a reliable packet delivery procedure to its connected hosts via its 1822 interface. A host computer simply arranged the data in the correct packet format, inserted the address of the destination host computer, and sent the message across the interface to its connected IMP. Once the message was delivered to the destination host, an acknowledgement was delivered to the sending host. If the network could not deliver the message, it would send an error message back to the sending host.
Meanwhile, the developers of ALOHAnet demonstrated that it was possible to build an effective computer network without providing reliable packet transmission. This lesson was later embraced by the designers of Ethernet.
If a network does not guarantee packet delivery, then it becomes the host's responsibility to provide reliability by detecting and retransmitting lost packets. Subsequent experience on the ARPANET indicated that the network itself could not reliably detect all packet delivery failures, and this pushed responsibility for error detection onto the sending host in any case. This led to the development of the end-to-end principle, which is one of the Internet's fundamental design assumptions.
After those, optional flags can be added of varied length, which can change based on the protocol used, then the data that packet carries is added, and finally the trailer..
The header of a packet specifies the data type, packet number, total number of packets, and the sender's and receiver's IP addresses.
The term frame is sometimes used to refer to a packet exactly as transmitted over the wire or radio.
Thus, frames with detected errors would be essentially unusable even if they were not deleted by the frame processor.
This data loss can be compensated for with the following mechanisms.
Units of information | Packets
Paket | Datapakke | Datenpaket | Datagrama | Paquet (réseau) | Paquete | חבילת מידע | Pacchetto (reti) | パケット | Pakiet telekomunikacyjny | Pacote | 分组