Movement Validation

How do I check if a player hasn’t modified the client’s movement speed/pixels per tick.
When the client moves it sends a UDP packet containing the updated position to the server. But doing this doesn’t allow me to check if the player is walking at normal speed because of packet loss.
I wanted to do this approach :
Client --> movement packet(newX,newY)
Server does Math.abs(oldx-newx) and checks if that number is greater than speed, if it is then send the correct position to that client.

But with UDP the server won’t receive all the packets so Math.abs(oldx-newx) can be bigger than speed while the client is not hacking.