STUN屬性都滿足TLV編碼,其中0x0001代表MappedAddress屬性,這個(gè)屬性用來(lái)存儲(chǔ)ip地址,同時(shí)為了區(qū)分地址的類(lèi)型,后兩位用0x01代表IPV4,0x02代表IPV6。但是0x0002代表ResponseAddress屬性,這不就沖突了嗎?MappedAddress屬性怎么存儲(chǔ)ipv6的地址?
// 0 1 2 3 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // |0 0 0 0 0 0 0 0| Family | Port | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // | | // | Address (32 bits or 128 bits) | // | | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
光陰似箭催人老,日月如移越少年。
This attribute is used only by servers for achieving backwards compatibility with RFC 3489 [RFC3489] clients.服務(wù)端收到就解釋為ipv6地址,客戶端收到就解釋為ResponseAddress