是ipv6向下兼容ipv4? [英] is ipv6 backward compatable with ipv4?

查看:942
本文介绍了是ipv6向下兼容ipv4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用ipv4编写的一个udp示例程序。如果我改变代码为ipv6我仍然能够与任何人使用监听器与ipv4地址通信?我正在查看移植示例

I've got a little udp example program written using ipv4. If I alter the code to ipv6 would I still be able to communicate with anyone using the listener with an ipv4 address? I was looking at porting examples at

http://ou800doc.caldera.com/en/SDK_netapi/sockC.PortIPv4appIPv6.html

我不确定是否改变代码将确保它工作,或者如果我必须写在决斗栈模式。

I'm not sure if simply altering the code would ensure that it worked or if I'd have to write it in duel-stack mode.

推荐答案

是和否... IPv6包含完全不同的地址,因此您必须重新编码您的应用程序,

Yes and no... IPv6 does contain completely different addressing, so you'll have to recode your app to use the alternative headers and structure sizes.

但是,IPv4地址范围在IPv6中可用,语法是在标准地址之前添加两个冒号(例如:: 10.11.12.13 )。您还可以在IPv6数据包中嵌入IPv4地址

However, the IPv4 address range is available within IPv6, the syntax is to add two colons before the standard address (eg ::10.11.12.13). You can also embed IPv4 addresses within IPv6 packets.

这篇关于是ipv6向下兼容ipv4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆