Packet – a unit of data. Most traffic transported on a network is broken down into packets. Every message is automatically packaged up by the application/server and then divided into “pieces” according to the Transmission Control Protocol (TCP), so that it easy for each device in the network – switch, router, security gateway – to process and transport.
Every packet is numbered. It also contains a header that includes the Internet address of the destination, as well as other information the network devices need to make sure it is handled correctly and delivered to the right place. Each packet may travel a different path to get to the destination, so TCP collects all the pieces, reassembles them and then passes them off to the receiving application/server to make sense of the message.
A datagram is a “packet” created by the User Datagram Protocol (UDP) to transport messages. Unlike TCP packets, datagrams aren’t sequenced, which puts the burden on the application/server that receives the message to assemble the datagrams and make sure everything is there.