Receive file, typcast into message type and output the humber of hops