When a Packet arrive on the interface of a router the router take several logical decisions base on the data plane to process the packet.
The packet arrive encapsulated inside the data link frame , so the router check the incoming Frame Check Sequence ( FCS ) and discard the frame if errors occurred in transmission.
If the FCS passes the router discard the frame errors .It it passes the router discard the data link header and trailer leaving the layer 3 packet .
Then the router compare the destination IP address of the packet with the IP routing table matching the longest-prefix route that match the destination IP address.