calculate ip.ihl when encoding