TCP MCC and MTU and PMTU
来源:互联网 发布:达内java培训机构 编辑:程序博客网 时间:2024/06/03 16:41
TCP MCC and MTU and PMTU
1. Circumventing(包围) Path MTU Discovery issues with MSS Clamping (for ADSL, cable, PPPoE & PPtP users)
As explained above, Path MTU Discovery doesn't work as well as it should anymore. If you know for a fact that a hop somewhere in your network has a limited (<1500) MTU, you cannot rely on PMTU Discovery finding this out.Besides MTU, there is yet another way to set the maximum packet size, the so called Maximum Segment Size. This is a field in the TCP Options part of a SYN packet.Recent Linux kernels, and a few PPPoE drivers (notably, the excellent Roaring Penguin one), feature the possibility to 'clamp the MSS'.The good thing about this is that by setting the MSS value, you are telling the remote side unequivocally(明确的) 'do not ever try to send me packets bigger than this value'. No ICMP traffic is needed to get this to work.The bad thing is that it's an obvious hack - it breaks 'end to end' by modifying packets. Having said that, we use this trick in many places and it works like a charm.In order for this to work you need at least iptables-1.2.1a and Linux 2.4.3 or higher. The basic command line is:# iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtuThis calculates the proper MSS for your link. If you are feeling brave, or think that you know best, you can also do something like this:# iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 128This sets the MSS of passing SYN packets to 128. Use this if you have VoIP with tiny packets, and huge http packets which are causing chopping in your voice calls.
2. IP MTU and TCP MSS Missmatch – an evil for network performance
When we conduct a technical workshop, a common query from the participants relates to the Maximum Transmission Unit (MTU) size manipulation on a router interface and its relationship with the TCP Maximum Segment Size (MSS). I will try to discuss this in detail from a network engineers point of view.
The Maximum Transmission Unit (MTU) is the maximum length of data that can be transmitted by a protocol in one instance. If we take the Ethernet interface as an example, the MTU size of an Ethernet interface is 1500 bytes by default, which excludes the Ethernet frame header and trailer. It means that the interface cannot carry any frame larger then 1500 bytes. If we look inside the frame, we have a 20 byte IP header + 20 byte TCP header, leaving a 1460 byte of the payload that can be transmitted in one frame. This is what we refer to as TCP MSS. The diagram below visualizes this concept:
In a normal transmission case, if there is no additional encapsulation (that is, IPsec, MPLS and so forth) carried out on a transiting router, the source device may use the maximum payload length of 1460 bytes without any potential risk of packet fragmentation/drop. This is negotiated during the TCP three-way handshake stage between the source and destination host.
Now in a likely case where a router in transit is carrying out additional encapsulation, that is, MPLS label swapping, this will add an additional label header as below:
- TCP MCC and MTU and PMTU
- PMTU (Path MTU) Discovery
- mss and mtu relations
- MTU and MSS
- MTU and MSS
- MSS and MTU
- TCP MSS PMTU PING
- IP MTU and TCP MSS Missmatch – an evil for network performance
- 【OpenStack】OpenVswitch GRE MTU problem and solution
- Tuning PPP over 2G GPRS: MRU and MTU
- tcp and udp
- TCP-establishment and termination
- tcp client and server
- HTTP AND TCP小记
- socketserver TCP and UDP and synchronous
- TCP/IP - MTU/MSS
- tcp-ip MTU
- TCP MTU 问题
- 基于反射的Excel动态上传下载
- zookeeper-端口说明
- SQL练习题,MySQL数据库查询语句经典例题练习,附带答案和运行效果截图以供参考
- Hive 3、Hive 的安装配置(本地derby模式)
- (二)JNI学习之C语言基础,控制语句
- TCP MCC and MTU and PMTU
- Android自动化测试学习路线
- idea注册码
- 代码走读之 硬件时间戳
- Hive 4、Hive 的安装配置(远端MyMql模式)
- Android Vendor Test Suite (VTS) 的概念、作用及测试方法
- js 将图片连接转换称base64格式
- Ringbuffer在实时流缓冲的demo
- ros 自定义数据格式 头文件的问题