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协议项,不少朋友都觉得比较奇怪,询问编辑 ...
随机推荐
- 存储过程系列之调试存储过程 SQL Server 2005
在数据库中直接调试 在数据库中直接调试是调试SQL Server 2005的存储过程的最简单的方法. 在Visual Stuido的IDE中你可以选择单步执行存储过程,然后就可以一条语句一条语句地单 ...
- C#技术------垃圾回收机制(GC)
GC的前世与今生 虽然本文是以.NET作为目标来讲述GC,但是GC的概念并非才诞生不久.早在1958年,由鼎鼎大名的图林奖得主John McCarthy所实现的Lisp语言就已经提供了GC的功能,这是 ...
- WCF - IIS Hosting
WCF - IIS Hosting Hosting a WCF service in IIS (Internet Information Services) is a step-by-step pro ...
- Oracle系列之触发器
涉及到表的处理请参看原表结构与数据 Oracle建表插数据等等 创建一个触发器,使其可以修改tb_Department表的deptno. create or replace trigger upda ...
- hdu1501Zipper(记忆化搜索)
http://acm.hdu.edu.cn/showproblem.php?pid=1501 搜了下记忆化搜索是嘛 然后就看到这个题了 不过一不小心看到代码了 代码又那么短 一不小心给记住了 然后看了 ...
- C#微信公众号开发系列教程(接收事件推送与消息排重)
微信服务器在5秒内收不到响应会断掉连接,并且重新发起请求,总共重试三次.这样的话,问题就来了.有这样一个场景:当用户关注微信账号时,获取当前用户信息,然后将信息写到数据库中.类似于pc端网站的注册.可 ...
- 修改NGINX版本名称为任意WEB SERVER
下载好Nginx的安装文件nginx-1.6.0.tar.gz,并把它解压. wget http://nginx.org/download/nginx-1.6.0.tar.gz .tar.gz 然后我 ...
- 一例胜千言,详谈SQL Sever数据库锁
1 前言 数据库大并发操作要考虑死锁和锁的性能问题.看到网上大多语焉不详(尤其更新锁),所以这里做个简明解释,为下面描述方便,这里用T1代表一个数据库执行请求,T2代表另一个请求,也可以理解为T1为一 ...
- linux下安装
挂载 1.虚拟机里选择ios文件2.挂载光驱命令: cd / mount /mnt/cdrom/ cd /mnt/cdrom/ ls 卸载 cd /umount /mnt/cdrom/ 安装 XXX. ...
- UVA 1351 - String Compression
题意: 对于一个字符串中的重复部分可以进行缩写,例如"gogogo"可以写成"3(go)",从6个字符变成5个字符.."nowletsgogogole ...