message parsing into length/type