java - 关于STUN协议中属性的一点问题
PHP中文网
PHP中文网 2017-04-18 10:14:04
0
1
340

STUN属性都满足TLV编码,其中0x0001代表MappedAddress属性,这个属性用来存储ip地址,同时为了区分地址的类型,后两位用0x01代表IPV4,0x02代表IPV6。但是0x0002代表ResponseAddress属性,这不就冲突了吗?MappedAddress属性怎么存储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)                 |
//      |                                                               |
//      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
迷茫

This attribute is used only by servers for achieving backwards
compatibility with RFC 3489 [RFC3489] clients. When the server receives it, it is interpreted as an ipv6 address, and when the client receives it, it is interpreted as a ResponseAddress

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!