MTU of IPV4 and IPV6
通信术语 最大传输单元(Maximum Transmission Unit,MTU)是指一种通信协议的某一层上面所能通过的最大数据包大小(以字节为单位)。最大传输单元这个参数通常与通信接口有关(网络接口卡、串口等)。
awang@awangdevpc:/tmp$ sudo tcpdump -ni eth0 -evvv icmp6
09:22:22.394905 f0:de:f1:fb:98:8b > 00:21:27:ac:f1:53, ethertype IPv6 (0x86dd), length 3110: (hlim 64, next-header Fragment (44) payload length: 3056) 1234::60ef:4cde:b1a1:d87e > 1234::2: frag (0xe5fc7cc4:0|3048) ICMP6, echo request, length 3048, seq 1
09:22:22.394934 f0:de:f1:fb:98:8b > 00:21:27:ac:f1:53, ethertype IPv6 (0x86dd), length 2022: (hlim 64, next-header Fragment (44) payload length: 1968) 1234::60ef:4cde:b1a1:d87e > 1234::2: frag (0xe5fc7cc4:3048|1960)
09:22:22.396538 00:21:27:ac:f1:53 > f0:de:f1:fb:98:8b, ethertype IPv6 (0x86dd), length 3110: (hlim 64, next-header Fragment (44) payload length: 3056) 1234::2 > 1234::60ef:4cde:b1a1:d87e: frag (0x249da4f6:0|3048) ICMP6, echo reply, length 3048, seq 1
09:22:22.396544 00:21:27:ac:f1:53 > f0:de:f1:fb:98:8b, ethertype IPv6 (0x86dd), length 2022: (hlim 64, next-header Fragment (44) payload length: 1968) 1234::2 > 1234::60ef:4cde:b1a1:d87e: frag (0x249da4f6:3048|1960)
1. Algorithm:
1> Is the biggest integer which is smaller than 3100.
2> could be devided by 8.
Since "3096" match the rule, so use it in IP layer to fragment.
2. Then use the "3096" to caculate other length:
3> Ethernet layer length : add the ethernet header length "14", the total length which is printed in ethernet layer is "3110".
4> IP layber payload: Since the IP layber of IPV4 is 40, so the printed payload is 3056.
5> ICMP length : And the ICMP tyoe of IPV6 is 8, so the printed ICMP payload is 3048.
------------------------------------------------------
ipv4 mtu:
If set the ipv4 mtu of interface 0 to "1500", then ping an IP address whihc is directlly connected, then use tcpdump:
awang@awangdevpc:/tmp$ sudo tcpdump -ni eth0 -evvv icmp
09:39:53.721760 00:21:9b:58:ca:8f > 00:90:7f:95:70:98, ethertype IPv4 (0x0800), length 1514: (tos 0x0, ttl 64, id 8113, offset 0, flags [+], proto ICMP (1), length 1500)
172.26.0.183 > 172.26.0.1: ICMP echo request, id 4321, seq 1, length 1480
09:39:53.721778 00:21:9b:58:ca:8f > 00:90:7f:95:70:98, ethertype IPv4 (0x0800), length 1514: (tos 0x0, ttl 64, id 8113, offset 1480, flags [+], proto ICMP (1), length 1500)
172.26.0.183 > 172.26.0.1: icmp
09:39:53.721781 00:21:9b:58:ca:8f > 00:90:7f:95:70:98, ethertype IPv4 (0x0800), length 1514: (tos 0x0, ttl 64, id 8113, offset 2960, flags [+], proto ICMP (1), length 1500)
172.26.0.183 > 172.26.0.1: icmp
09:39:53.721784 00:21:9b:58:ca:8f > 00:90:7f:95:70:98, ethertype IPv4 (0x0800), length 602: (tos 0x0, ttl 64, id 8113, offset 4440, flags [none], proto ICMP (1), length 588)
172.26.0.183 > 172.26.0.1: icmp
09:39:53.722909 00:90:7f:95:70:98 > 00:21:9b:58:ca:8f, ethertype IPv4 (0x0800), length 1514: (tos 0x0, ttl 64, id 10621, offset 0, flags [+], proto ICMP (1), length 1500)
172.26.0.1 > 172.26.0.183: ICMP echo reply, id 4321, seq 1, length 1480
09:39:53.723153 00:90:7f:95:70:98 > 00:21:9b:58:ca:8f, ethertype IPv4 (0x0800), length 1514: (tos 0x0, ttl 64, id 10621, offset 1480, flags [+], proto ICMP (1), length 1500)
172.26.0.1 > 172.26.0.183: icmp
09:39:53.723161 00:90:7f:95:70:98 > 00:21:9b:58:ca:8f, ethertype IPv4 (0x0800), length 1514: (tos 0x0, ttl 64, id 10621, offset 2960, flags [+], proto ICMP (1), length 1500)
172.26.0.1 > 172.26.0.183: icmp
09:39:53.723402 00:90:7f:95:70:98 > 00:21:9b:58:ca:8f, ethertype IPv4 (0x0800), length 602: (tos 0x0, ttl 64, id 10621, offset 4440, flags [none], proto ICMP (1), length 588)
172.26.0.1 > 172.26.0.183: icmp
1. Algorithm:
1> Is the biggest integer which is smaller than 1500.
2> could be devided by 4.
Since "1500" match the rule, so use it in IP layer to fragment.
2. Then use the "3096" to caculate other length:
Ethernet layer length : Add the ethernet header length "14", the total length which is printed in ethernet layer is "1514".
MTU of IPV4 and IPV6的更多相关文章
- TCP/IP读书笔记(4) IPv4和IPv6 路由选择
TCP/IP读书笔记(4) IPv4和IPv6 路由选择 网络层是位于链路层之上,TCP/IP模型中网络层的核心协议是IP协议(Internet protocol). 目前主流的IP协议是IPv4(I ...
- IPv6下网络编程socket, TCP和UDP例子,以及兼容IPV4和IPV6的类
一.TCP socket ipv6与ipv4的区别 服务器端源代码如下: #include <stdio.h> #include <stdlib.h> #include < ...
- 计算机网络-网络层(1)IPv4和IPv6
IPv4数据报格式: 版本号 这4比特规定了数据报的IP 协议版本.通过查看版本号,路由器能够确定如何解释IP数据报的剩余部分. 首部长度 以4字节为单位,没有选项的首部长度为5*4=20字节 服务类 ...
- IP地址(IPv4)/IPv6地址的正则表达式
原地址:http://pfeishao.blog.163.com/blog/static/18162337020112113130453/ Pv4地址正则表达式:^((25[0-5]|2[0-4]\d ...
- ipv4、ipv6的socket同时监听“bind: Address already in use”的解决方法
创建ipv4和ipv6的socket,同时监听某个端口的ipv4和ipv6报文,运行时bind函数执行失败,提示“bind: Address already in use”.原因:ipv6的socke ...
- ios 兼容IPV4和IPV6网络通信
前言: 苹果官方出了新的规定,要求新上架的app都必须单独支持ipv6-only的网络. 准备工作: 搭建IPV6测试环境:http://blog.csdn.net/potato512/article ...
- VLC测试IPv4 IGMP/IPv6 MLD协议
1 简述 VLC既可以充当流客户端,又可以充当流服务器,并且可以跨平台使用,是一款开源.免费的软件,基于GNU GPL许可证. 2 搭建组播服务器 第一步:运行程序后选择“媒体 串流”:第二步:通过 ...
- IPv4和IPv6简单对比介绍(转载)
原链接:https://baijiahao.baidu.com/s?id=1570208896149974&wfr=spider&for=pc 在配置计算机网络,特别是内网的时候,有时 ...
- 网络类型IPv4和IPv6什么意思?区别?
在windows 7以上系统中,在设置本地IP地址的时候经常会看到同事含有IPV4协议项与IPV6协议项,并不同于以往windows xp系统中仅有TCP/IP协议项,不少朋友都觉得比较奇怪,询问编辑 ...
随机推荐
- 虚函数表以及RTTI阅读(阅后焚)
http://blog.csdn.net/haoel/article/details/1948051/ http://www.cnblogs.com/ustc11wj/archive/2012/08/ ...
- java的异常处理机制(try…catch…finally)
1 引子try…catch…finally恐怕是大家再熟悉不过的语句了,而且感觉用起来也是很简单,逻辑上似乎也是很容易理解.不过,我亲自体验的“教训”告诉我,这个东西可不是想象中的那么简单.听话.不信 ...
- rebuild过程
/** The class defining a handle to an Innodb table */ class ha_innobase: public handler { row_prebui ...
- a++与=++a的区别
//a++;//a=a+1; // ++a;//a=a+1; //Console.WriteLine(a++);// Console.WriteL ...
- WCF 第五章 会话级别的实例
会话在分布式应用程序中广泛用于维护每个用户的状态.在站点或者基于站点的应用中,将每个用户的状态存储于会话中很常见.这这些情况中,用户和会话间有一个1:1比例.WCF以一个类似的概念支持服务.使用Ins ...
- Tomcat工作原理详解
一.Tomcat背景 自从JSP发布之后,推出了各式各样的JSP引擎.Apache Group在完成GNUJSP1.0的开发以后,开始考虑在SUN的JSWDK基础上开发一个可以直接提供Web服务的JS ...
- [Raobin] Ext.net在页面中以窗体的形式打开另外的页面
public ActionResult NewPartWindow(string id, string copy, string code) { var vm = new VM(this); var ...
- Linux查看系统性能命令
性能调优的第一步是性能分析,下面从性能分析着手进行一些介绍,尤其对linux性能分析工具vmstat的用法和实践进行详细介绍. ———————————————————————————————————— ...
- [JCWC2005]Draw
Einstein学起了画画,此人比较懒--,他希望用最少的笔画画出一张画...给定一个无向图,包含 n 个顶点(编号1~n),m 条边,求最少用多少笔可以画出图中所有的边 Input (draw.in ...
- 【JS】Intermediate8:jQuery:AJAX
1.$.ajax is the main method, allowing you to manually construct your AJAX request 2.eg: gets some da ...