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协议项,不少朋友都觉得比较奇怪,询问编辑 ...
随机推荐
- S3C2410 实验三——跑马灯实验
http://www.evernote.com/shard/s307/sh/f2a748e7-34c4-4ce6-acac-82a756cc9e82/ad5813188d655e504857970db ...
- 卸载Visual Studio Code后删除右键Open with Code…
Win+R,输入 regedit ,点击确认,进入注册表编辑器 Ctrl+F,搜索 Ticino ,将搜索出来的Ticino都删除就行了
- 【转】Beyond Compare for Mac中文版震撼来袭!-- 不错
原文网址:http://mt.sohu.com/20160329/n442685522.shtml Beyond Compare想必大家都知道,它是一个专业级的一个文件对比工具,由于工作原因,我们会经 ...
- mat之一--eclipse安装Memory Analyzer
工欲善其事必先利其器,先开始更新下eclipse,顺便装下工具软件.那么简要的写写怎么从头安装Memory Analyzer Memory Analyzer (Eclipse MAT)是一个跨平台的开 ...
- 12款有助于简化CSS3开发的工具
网站开发者能通过CSS3为网站设计增添很多时尚元素,CSS3 对CSS规范做了很大的改进.现在,本文将介绍12款有助于简化CSS3开发的工具. 1.CSS3 Pie: 允许在IE上使用CSS3绝大部 ...
- Exception in thread "main" java.lang.IllegalArgumentException:解决方法
使用fileSystem的delete方法无法删除文件或目录 Exception in thread "main" java.lang.IllegalArgumentExcepti ...
- Find longest contiguous sub array
It's still an Amazon interview question. Given an array containing only stars '*' and hashes '#' . F ...
- Windows Server 2008 R2 配置AD(Active Directory)域控制器 -zhai zi wangluo
http://files.cnblogs.com/zhongweiv/Windows_Server_2008_R2_%E9%85%8D%E7%BD%AEActive_Directory%E5%9F%9 ...
- poj3101
不难,结果: 程序: import java.math.*; import java.util.*; public class Main { public static void main(Strin ...
- svn2git使用小记
Github强烈推荐使用svn2git工具将svn repository转成git repository: https://help.github.com/articles/importing-fro ...