basic packet parsing & logic