In Information technology, a packet is a collection of data that can be used by computers which need to communicate with each other, usually as part of a network. Some computers and networks do not use packets to communicate. But most currently do, including nearly all computers on the Internet. Packets allow many computers on a network to communicate more quickly and easily.
A packet consists of two kinds of data: packet information and packet data (or payload). If you think of a packet like a letter in the mail, the control information is like the outside of the envelope. There's an address that says where to send the letter, and a stamp that says how to send it (fast or slow). Similarly, the computer uses the control information in the packet to decide where, and how, to send the data. People aren't usually interested in the control information.
The user data is like the inside of the envelope. It is the actual information the computer is trying to send. This might be any kind of digital data, such as words, pictures, music, or computer programs. It's generally for people or computers to use, but not for the packet system to use.
Different communication protocols put the control information and user information in different places, or make it look different. But they still do the same thing.
Sometimes the computers make mistakes while transmitting data, or have trouble "hearing" each other. So many packets use a checksum or cyclic redundancy check to make sure they have the right information. This is usually one component of the control information. This helps to make sure the packets themselves have the right information. But then computers also need to get the right packets.
Designing computer networks can be difficult. Even though today's computers are very advanced, sometimes information doesn't arrive where it's supposed to. Sometimes computers try to fix this and end up sending it twice. And sometimes the information doesn't arrive in the right order. The Transmission Control Protocol, or TCP, was invented to fix these problems. But since it is complex, some computers use the User Datagram Protocol, or UDP, instead.