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协议项,不少朋友都觉得比较奇怪,询问编辑 ...
随机推荐
- Android 滑动菜单SlidingMenu
首先我们看下面视图: 这种效果大家都不陌生,网上好多都说是仿人人网的,估计人家牛逼出来的早吧,我也参考了一一些例子,实现起来有三种方法,我下面简单介绍下: 方法一:其实就是对GestureDetect ...
- C# :XML和JSON互转
我们一般在用JSON或者XML作为数据交换的时候,可能定义一个没有真正意义方法的类,其实就是一个关于属性的数据结构,如果对于这种情况,可以将这个类对象作为中介,然后利用C#提供的序列化和反序列化的方法 ...
- C# Json处理日期和Table
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Ru ...
- OSFM Tables
OSFM - Oracle Shop Floor Management 1. (N) Shop Floor Manager > Lot Based Jobs (B: New) Status: U ...
- javascript 中concat与push的区别
1. push 遇到数组参数时,把整个数组参数作为一个元素:而 concat 则是拆开数组参数,一个元素一个元素地加进去. 2. push 直接改变当前数组:concat 不改变当前数组. 总结:如果 ...
- 18款 非常实用 jquery幻灯片图片切换
1.jquery图片滚动仿QQ商城带左右按钮控制焦点图片切换滚动 jquery图片特效制作仿腾讯QQ商城首页banner焦点图片轮播切换效果,带索引按钮控制和左右按钮控制图片切换. 查看演示>& ...
- MVC3.0 中Razor 学习
随着MVC3.0RTM版本的发布,最近将公司的项目从MVC2.0升级到MVC3.0.同时打算在MVC3中全面使用Razor模板引擎.现将Razor学习拿出来和大家分享,如果存在不足的地方欢迎您指出. ...
- nginx的优缺点
1.nginx相对于apache优点: 轻量级同样起web 服务比apache占用更少内存及资源 抗并发nginx 处理请求异步非阻塞而apache 则阻塞型高并发下nginx 能保持低资源低消耗高性 ...
- win7下安装 WINDRIVER.TORNADO.V2.2.FOR.ARM
[风河VxWorks].WINDRIVER.TORNADO.V2.2.FOR.ARM下载 http://115.com/file/dlfo8zpy http://115.com/file/c4r01l ...
- Hadoop中java.lang.ClassCastException: partition解决方法
java.lang.ClassCastException: partition.KpiWritable cannot be cast to org.apache.hadoop.io.LongWrita ...