tms encode, decode , id2ip, ip2id