Packets and Reassembly
Part of: Computer Systems & Networks
Breaking Data into Packets When you send a file over the internet, it is not sent as one big chunk. It is split into small pieces called packets . Each packet carries: - A piece of the data (the payload) - The destination address - A sequence number so the pieces can be reassembled in order This is called packet switching . Packets from the same message can take different paths across the network and still arrive correctly. Why Packets Can Arrive Out of Order Because packets travel independently, packet 5 might arrive before packet 3. The receiving computer uses the sequence numbers to reassemble them correctly. If a packet is lost, the protocol can request that it be resent. Reassembling a Message The receiver collects all packets, sorts them by sequence number, then joins their payloads back into the original message: Why Packet Switching Is Efficient - Sharing : many messages share the same links instead of reserving a private circuit. - Resilience : if one path is congested, individual packets can take another route. - Granularity : only the lost packets must be resent, not the whole file. The Big Picture Splitting data into independently addressed packets is the core idea that
Challenge: Reassemble a Packetized Message