The first imperfection of the network layer is that segments may be corrupted by transmission errors. The simplest error detection scheme is the checksum.
A checksum can be based on a number of schemes. One possible scheme is an arithmetic sum of all the bytes of a segment. Checksums are computed by the sender and attached with the segment. The receiver verifies it upon reception and can choose what to do in case it is not valid. Quite often, the segments received with an invalid checksum are discarded.