没有合适的资源?快使用搜索试试~ 我知道了~
首页探索IPv6网络编程的实战指南
"《IPv6网络编程》是一本专注于IPv6网络编程的专业教材,由Jun-ichiro Ito和Hagino合著,由Elsevier Digital Press出版。这本书在国际多个城市发行,如阿姆斯特丹、波士顿、海德堡、伦敦等地,版权信息注明了2004年Elsevier Inc.所有权利保留。未经书面许可,任何形式的复制、存储、传输都是被禁止的。 该书的标题明确表示其主题是针对IPv6,一种先进的互联网协议版本,旨在取代IPv4,提供更大的地址空间和改进的安全性。IPv6网络编程对于现代网络技术的发展至关重要,因为随着互联网设备数量的增长,IPv4地址空间的枯竭成为了严重问题。IPv6的引入使得能够支持更多的设备连接,并提供了更好的路由、多播和安全特性。 本书的内容可能包括但不限于IPv6基础知识、网络架构解析、协议栈工作原理、IP地址与路由配置、网络安全措施(如IPsec)、套接字编程、多播通信、IPv6网络服务开发等实用技术。此外,由于强调了编程实践,读者可以期待书中包含大量示例代码和案例分析,帮助读者深入理解并掌握IPv6网络编程的各个方面。 在版权方面,读者需通过Elsevier的科学和技术许可部门获得权限,可以通过电话、传真或电子邮件联系,或者在线访问Elsevier网站进行申请。为了保护原著的长期保存,Elsevier采用了酸性纸张印刷,确保书籍质量。 《IPv6网络编程》是一本对IT专业人士和网络开发人员极其有价值的参考资料,提供了全面而深入的IPv6网络编程教程,帮助读者适应和利用这一新兴技术趋势。"
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/4326155/bg10.jpg)
1.1.4 Simplified Header Structures
IPv6 has simpler packet header structures than IPv4. It will allow vendors to imple
-
ment hardware acceleration for IPv6 routers easier.
1.1.5 Allows Flexible Protocol Extensions
IPv6 allows more flexible protocol extensions than IPv4 by introducing a protocol
header chain. Even though IPv6 allows flexible protocol extensions, IPv6 does not
impose overhead to intermediate routers. It is achieved by splitting headers into two
flavors: the headers intermediate routers need to examine and the headers the final des
-
tination will examine. This also eases hardware acceleration for IPv6 routers.
1.1.6 Smooth Transition from IPv4
There were a number of transition considerations made during the IPv6 discussions.
Also, there is a large number of transition mechanisms available. You can pick the most
suitable one for your network during the transition period.
1.1.7 Follows the Key Design Principles of IPv4
IPv4 was a very successful design, as proven by the large-scale global deployment. IPv6
is a new version of IP, and it follows many of the design features that made IPv4 very
successful. This will also allow smooth transition from IPv4 to IPv6.
1.1.8 And More
There are number of good books available about IPv6. Be sure to check these if you are
interested.
Chapter 1
1.1 A History of IPv6 and Its Key Features 3
Protocol Header Chain
IPv6 defines a protocol header chain, which is a way to concatenate extension
headers repeatedly after the IPv6 base header. With IPv4, the IPv4 header is adja
-
cent to the final header (like TCP). With IPv6, the protocol header chain allows
various extension headers to be put between the IPv6 base header and the final
header.
IPv6 header
Next Header = Routing
Routing header
Next Header = Fragment
Fragment header
Next Header = TCP
Fragment of TCP
header + data
![](https://csdnimg.cn/release/download_crawler_static/4326155/bg11.jpg)
1.2 Transition from IPv4-Only Internet to IPv4/v6 Dual
Stack Internet
Today, most of the nodes on the Internet use IPv4. We will need to gradually intro
-
duce IPv6 to the Internet and hopefully make all nodes on the Internet IPv6-capable.
To do this, the IETF has carefully designed IPv6 migration to be seamless. This is
achieved by the following two key technologies:
■
Dual stack
■
Tunneling
With these technologies, we can transition to IPv6 even though IPv4 and IPv6 are
not compatible (IPv4-only devices and IPv6-only devices cannot talk with each other
directly). We will go into the details soon.
It is expected that we will have a long period of IPv4/v6 dual stack Internet, due to
the wide deployment of IPv4 devices. For instance, some of the existing devices, such
as IPv4-capable game machines, may not be able to be upgraded to IPv6.
Therefore, in this book, we would like to focus on the issues regarding the transi-
tion from IPv4-only Internet to IPv4/v6 dual stack Internet and the changes in socket
API programming.
1.2.1 Dual stack
At least in the early stage of IPv6 deployment, IPv6-capable nodes are assumed to be
IPv4-capable. They are called “IPv4/v6 dual stack nodes” or “dual stack nodes.” Dual
stack nodes will use IPv4 to communicate with IPv4 nodes, and use IPv6 to com-
municate with IPv6 nodes. It is just like a bilingual person—he or she will use English
when talking to people in the States, and will use Japanese when talking to Japanese
people.
The determination of protocol version is automatic, based on available DNS
records. Because this is based on DNS, and normal users would use fully qualified
domain name (FQDN) in email addresses and URLs, the transition from IPv4 to
IPv6 is invisible to normal users. For instance, assume that we have a dual stack
node, and we are to access http://www.example.com/. A dual stack node will behave as
follows:
■
If www.example.com resolves to an IPv4 address, connect to the IPv4 address.
In such a case, the DNS database record for www.example.com will be as
follows:
4 1.2 Transition from IPv4-Only Internet to IPv4/v6 Dual Stack Internet
![](https://csdnimg.cn/release/download_crawler_static/4326155/bg12.jpg)
www.example.com. IN A 10.1.1.1
■
If www.example.com resolves to an IPv6 address, connect to the IPv6 address.
www.example.com. IN AAAA 3ffe:501:ffff::1234
■
If www.example.com resolves to multiple IPv4/v6 addresses, IPv6 addresses
will be tried first, and then IPv4 addresses will be tried. For example, with the
following DNS records, we will try connecting to 3ffe:501:ffff::1234, then
3ffe:501:ffff::5678, and finally 10.1.1.1.
www.example.com. IN AAAA 3ffe:501:ffff::1234
www.example.com. IN AAAA 3ffe:501:ffff::5678
www.example.com. IN A 10.1.1.1
Since we assume that IPv6 nodes will be able to use IPv4 as well, the Internet will
be filled with IPv4/v6 dual stack nodes in the near future, and the use of IPv6 will
become dominant.
1.2.2 Tunneling
Even when we have IPv4/v6 dual stack nodes at two locations (e.g., home and office),
it may be possible that the intermediate network (ISPs) are not IPv6-ready yet. To
circumvent this situation, RFC 2893 defines ways to encapsulate an IPv6 packet into
an IPv4 packet. The encapsulated packet will travel IPv4 Internet with no trouble,
and then decapsulate at the other end. We call this technology “IPv6-over-IPv4
tunneling.”
For example, imagine the following situation (see Figure 1.1):
■
We have two networks: home and office.
■
We have an IPv4/v6 dual stack host and router at both locations.
■
However, we have IPv4-only connectivity to the upstream ISP.
In this case, we can configure an IPv6-over-IPv4 tunnel between X and Y. An IPv6
packet from A to B will be routed as follows (see Figure 1.2):
■
The IPv6 packet will be transmitted from A to X, as is.
■
X will encapsulate the packet into an IPv4 packet.
■
The IPv4 packet will travel the IPv4 Internet, to Y.
■
Y will decapsulate the packet and recover the original IPv6 packet.
■
The packet will reach B.
Chapter 1
1.2 Transition from IPv4-Only Internet to IPv4/v6 Dual Stack Internet 5
![](https://csdnimg.cn/release/download_crawler_static/4326155/bg13.jpg)
From a programmer’s point of view, tunneling is transparent: It can be viewed as a
simple IPv6 point-to-point link. Therefore, when writing IPv6-capable programs, you
can ignore tunneling.
1.3 UNIX Socket Programming
This section briefly describes how UNIX systems abstract network accesses via socket
interface. If you are familiar with UNIX sockets, you can skip this section. Also, the
6 1.3 UNIX Socket Programming
Figure 1.1
IPv4/v6 dual stack
network, separated
by IPv4-only
Internet.
Figure 1.2
IPv6-over-IPv4
tunnel.
![](https://csdnimg.cn/release/download_crawler_static/4326155/bg14.jpg)
section does not try to be complete—for the complete description, you may want to
check the reading material listed in the References.
With only a few exceptions, UNIX operating systems abstract system resources as
files. For instance, the hard disk device is abstracted as a file such as /dev/rwd0c. Even
physical memory on the machine is abstracted as a file, /dev/mem. You can open(2),
read(2), write(2), or close(2) files, and files already opened by a process are identified
by an integer file descriptor.
int fd; /* file descriptor */
char buf[128];
fd = open(“/tmp/foo”, O_RDONLY, 0);
if (fd < 0) {
perror(“open”);
exit(1);
/*NOTREACHED*/
}
if (read(fd, buf, sizeof(buf)) < 0) {
perror(“read”);
exit(1);
/*NOTREACHED*/
}
close(fd);
exit(0);
Accesses to the network are also abstracted as special kinds of files, called sockets.
Sockets are created by a socket(2) system call. Sockets are a special kind of file descrip-
tor, so they are represented as an integer and can be terminated by using close(2). On a
socket(2) call, you need to identify the following three parameters:
■
Protocol family—AF_INET identifies IPv4.
■
Type of socket—SOCK_STREAM means connetion-oriented socket model.
SOCK_DGRAM means datagram-oriented socket model.
■
Protocol type—such as IPPROTO_TCP or IPPROTO_UDP.
For the Internet protocol, there are two kinds of sockets: connection-oriented
and connectionless sockets. Connection-oriented sockets abstract TCP connections, and
connectionless sockets abstract communication over UDP. Type of socket and protocol
type has to be consistent; SOCK_STREAM has to be used with IPPROTO_TCP.
Note: There are transport layer protocols other than TCP/UDP proposed in the
IETF, such as SCTP or DCCP. They are also abstracted as connection-oriented or
connectionless sockets.
Chapter 1
1.3 UNIX Socket Programming 7
剩余373页未读,继续阅读
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/da9e6189022f483a95d269f8ae6885b3_libl05.jpg!1)
养牛专业户
- 粉丝: 1
- 资源: 9
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- Hadoop生态系统与MapReduce详解
- MDS系列三相整流桥模块技术规格与特性
- MFC编程:指针与句柄获取全面解析
- LM06:多模4G高速数据模块,支持GSM至TD-LTE
- 使用Gradle与Nexus构建私有仓库
- JAVA编程规范指南:命名规则与文件样式
- EMC VNX5500 存储系统日常维护指南
- 大数据驱动的互联网用户体验深度管理策略
- 改进型Booth算法:32位浮点阵列乘法器的高速设计与算法比较
- H3CNE网络认证重点知识整理
- Linux环境下MongoDB的详细安装教程
- 压缩文法的等价变换与多余规则删除
- BRMS入门指南:JBOSS安装与基础操作详解
- Win7环境下Android开发环境配置全攻略
- SHT10 C语言程序与LCD1602显示实例及精度校准
- 反垃圾邮件技术:现状与前景
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)