ipv6 向后兼容 ipv4 吗?

is ipv6 backward compatible with ipv4?(ipv6 向后兼容 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 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)