is ipv6 backward compatible with ipv4?(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 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ipv6 向后兼容 ipv4 吗?
基础教程推荐
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
