packet duplication
Duplicate Packets
Duplicate packets are an often observed network behaviour.
A packet is duplicated somewhere on the network and received twice at the receiving host. It is very often not desireable to get these duplicates, as the receiving application might think that's "fresh" data (which it isn't).
If a sending host thinks a packet is not transmitted correctly because of a PacketLoss, it might Retransmit that packet. The receiving host might already got the first packet, and will receive a second one, which is a duplicated packet.
ConnectionOrientedProtocols such as TCP will detect duplicate packets, and will ignore them completely.
ConnectionlessProtocols such as UDP won't detect duplicate packets, because there's no information in, for example, the UDP header to identify a packet so that packets can be recognized as duplicates. The data from that packet will be indicated twice (or even more) to the application; it's the responsibility of the application to detect duplicates (perhaps by supplying enough information in its headers to do so) and process them appropriately, if necessary.
Reasons
There are two things you could mean be duplicate packets: duplication of the payload (the data being sent) or an exact duplicate of the payload and headers.
TCP will attempt to resend data that it doesn't receive an ACK (acknowledgement from the receiver that the packet arrived okay) for. However, this leads to the famous "two Generals" problem where you can never be sure of the data actually arrived, or if you just didn't get the ACK because the ACK packet was lost. The receiver could have gotten the packet, replied with an ACK, but the ACK was then lost. In this case, the sender will assume the packet was never received, and send another packet with the same payload duplicated. Because of this case, protocols like TCP need to handle getting the data sent multiple times.
The second thing duplicate packets could mean an actual 100% duplicate packet (payload and headers). This could happen because of errors in software, hardware, or routing problems or misconfigurations. In this case no, it's a somewhat different problem than TCP intentially sending new packets with duplicate payload from detection of packet loss. In this case the sender only sent one packet, but it was duplicated somewhere along the way by routers or hardware interfaces.
Solutions
TCP
handle duplicated IP
packets problem, so you don't care about them.
UDP
doesn't handle them. When you receive a datagram it's not guaranteed that you didn't have received the same datagram before. You should check it.