Cloud Native应用交付

  • 首页
  • 关于本站
  • 个人介绍
  • Downloads
  • Repo
    • Github
    • Container
  • F5
    • F5 Python SDK
    • F5-container
    • F5-LBaaS
  • 社交
    • 联系我
    • 微信/微博
    • 公众号
    • 打赏赞助
行至水穷处 坐看云起时
Cloud Native Application Services: cnadn.net
  1. 首页
  2. 协议原理
  3. 正文

Fragmentation ,MTU,MSS in GRE

2006年11月4日 9219点热度 0人点赞 0条评论

Packet Fragmentation and ICMP Messages

This document uses the following network diagram as an example:

56a.gif

In the diagram above, when the Client wants to access a page on the Internet, it establishes a TCP session with the Web Server. During this process, the Client and Web Server announce their maximum segment size (MSS), indicating to each other that they can accept TCP segments up to this size. Upon receiving the MSS option, each device calculates the size of the segment that can be sent. This is called the Send Max Segment Size (SMSS), and it equals the smaller of the two MSSs. For more information about TCP Maximum Segment Size, see RFC 879 leavingcisco.com.

For the sake of argument, let's say the Web Server in the example above determines that it can send packets up to 1500 bytes in length. It therefore sends a 1500 byte packet to the Client, and, in the IP header, it sets the "don't fragment" (DF) bit. When the packet arrives at R2, the router tries encapsulating it into the tunnel packet. In the case of the GRE tunnel interface, the IP maximum transmission unit (MTU) is 24 bytes less than the IP MTU of the real outgoing interface. For an Ethernet outgoing interface that means the IP MTU on the tunnel interface would be 1500 minus 24, or 1476 bytes.

R2 is trying to send a 1500 byte IP packet into a 1476 byte IP MTU interface. Since this is not possible, R2 needs to fragment the packet, creating one packet of 1476 bytes (data and IP header) and one packet of 44 bytes (24 bytes of data and a new IP header of 20 bytes). R2 then GRE encapsulates both of these packets to get 1500 and 68 byte packets, respectively. These packets can now be sent out the real outbound interface, which has a 1500 byte IP MTU.

However, remember that the packet received by R2 has the DF bit set. Therefore, R2 can't fragment the packet, and instead, it needs to instruct the Web Server to send smaller packets. It does this by sending an Internet Control Message Protocol (ICMP) type 3 code 4 packet (Destination Unreachable; Fragmentation Needed and DF set). This ICMP message contains the correct MTU to be used by the Web Server, which should receive this message and adjust the packet size accordingly.

Note:  Refer to Important Information on Debug Commands before you use debug commands.

We can view the ICMP messages sent by R2 by enabling the debug ip icmp command:

1
ICMP: dst (10.10.10.10) frag. needed and DF set unreachable sent to 10.1.3.4

Blocked ICMP Messages

A common problem occurs when ICMP messages are blocked along the path to the Web server. When this happens, the ICMP packet never reaches the Web server, thereby preventing data from passing between client and server..

Solutions

One of these four solutions should solve the problem.

  • Find out where along the path the ICMP message is blocked, and see if you can get it allowed.

  • Set the MTU on the Client's network interface to 1476 bytes, forcing the SMSS to be smaller, so packets won't have to be fragmented when they reach R2. However, if you change the MTU for the Client, you should also change the MTU for all devices that share the network with this Client. On an Ethernet segment, this could be a large number of devices.

  • Use a proxy-server (or, even better, a Web cache engine) between R2 and the Gateway router, and let the proxy-server request all the Internet pages.

  • If the GRE tunnel runs over links that can have an MTU greater than 1500 bytes plus the tunnel header, then another solution is to increase the MTU to 1524 (1500 plus 24 for the GRE overhead) on all interfaces and links between the GRE endpoint routers.

Further Solutions

If the above options are not feasible then the following options may be useful.

  • Use policy routing to clear and set the DF bit in the data IP packet (available in Cisco IOS® release 12.1(6) and higher).

    1
    interface ethernet0  <br />...  <br /><strong>ip policy route-map clear-df</strong>  <br /><em><font color="#0000ff">!--- This command is used to identify a route map</font></em>  <br /><em><font color="#0000ff">!--- to use for policy routing on an interface,</font></em>  <br /><em><font color="#0000ff">!--- use the <strong>ip policy route-map</strong> command in</font></em>  <br /><em><font color="#0000ff">!--- interface configuration mode.</font></em> <br />route-map clear-df permit 10  <br />match ip address 101  <br /><strong>set ip df 0</strong> <br /><em><font color="#0000ff">!--- This command is used to change the Don't Fragment (DF)</font></em>  <br /><em><font color="#0000ff">!--- bit value in the IP header, use this command</font></em>  <br /><em><font color="#0000ff">!--- in route-map configuration mode.<br /></font></em>access-list 101 permit tcp 10.1.3.0 0.0.0.255 any

    This will allow the data IP packet to be fragmented before it is GRE encapsulated. The receiving end host must then reassemble the data IP packets. This is usually not a problem.

  • Change the TCP MSS option value on SYN packets that traverse through the router (available in IOS 12.2(4)T and higher). This reduces the MSS option value in the TCP SYN packet so that it's smaller than the value in the ip tcp adjust-mss value command, in this case 1436 (MTU minus the size of the IP, TCP, and GRE headers). The end hosts now send TCP/IP packets no larger than this value.

    1
    interface tunnel0  <br />...  <br /><strong>ip tcp adjust-mss 1436</strong> <br /><em><font color="#0000ff">!--- This command is used to adjust the maximum segment size (MSS)</font></em> <br /><em><font color="#0000ff">!--- value of TCP SYN packets going through the router.</font></em> <br /><em><font color="#0000ff">!--- The maximum segment size is in the range from 500 to 1460.</font></em>

  • A final option is to increase the IP MTU on the tunnel interface to 1500 (available in IOS 12.0 and higher). However, increasing the tunnel IP MTU causes the tunnel packets to be fragmented because the DF bit of the original packet is not copied to the tunnel packet header. In this scenario, the router on the other end of the GRE tunnel must reassemble the GRE tunnel packet before it can remove the GRE header and forward the inner packet. IP packet reassembly is done in process-switch mode and uses memory. Therefore, this option can significantly reduce the packet throughput through the GRE tunnel.

    1
    2
    3
    4
    interface tunnel0   ...  <strong>ip mtu 1500<br /></strong><em><font color="#0000ff">!--- This command is used to set the maximum transmission unit (MTU)<br /></font></em><em><font color="#0000ff">!--- size of IP packets sent on an interface. The minimum size</font></em> <br /><em><f
     
    ont color="#0000ff">!--- y
    ou can configure is 128 bytes; the maximum depends on the interface medium.</font></em>

In conclusion, the most common cause of not being able to browse the Internet over a GRE tunnel is due to the above mentioned fragmentation issue. The solution is to allow the ICMP packets or work around the ICMP problem with any of the above solutions.


Related Information

  • IP Fragmentation and PMTUD
  • Which VPN Solution is Right for You?
  • GRE Support Pages
  • GRE Configuration Examples
  • IP Routing Support Page
  • Technical Support - Cisco Systems

相关文章

  • 注意:2019/2/1即将实施的DNS Flag Day带来的影响
  • 支持 edns client subnet dig下载
  • HTTP2 explained
  • OSPF grace-restart
  • 林夏写的DNS DOS防范文档,比较落地哦
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: MTU MSS
最后更新:2006年11月4日

纳米

linjing.io

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

页面AI聊天助手
文章目录
  • Packet Fragmentation and ICMP Messages
  • Blocked ICMP Messages
    • Solutions
    • Further Solutions
  • Related Information

纳米

linjing.io

☁️迈向Cloud Native ADC ☁️

认证获得:
TOGAF: ID 152743
Kubernetes: CKA #664
Microsoft: MCSE MCDBA
Cisco: CCNP
Juniper: JNCIS
F5:
F5 Certified Solution Expert, Security
F5 Certified Technology Specialist, LTM/GTM/APM/ASM
F5 Certified BIG-IP Administrator
  • 点击查看本博技术要素列表
  • 归档
    分类
    • AI
    • Automation
    • Avi Networks
    • Cisco ACI
    • CISCO资源
    • F5 with ELK
    • F5-Tech tips
    • F5技术
    • Juniper
    • Linux
    • NGINX
    • SDN
    • ServiceMesh
    • WEB编程
    • WINDOWS相关
    • 业界文章
    • 交换机技术
    • 化云为雨/Openstack
    • 协议原理
    • 容器/k8s
    • 我的工作
    • 我的生活
    • 网站技术
    • 路由器技术
    • 项目案例
    标签聚合
    network flannel DNS gtm k8s nginx istio api envoy F5 openstack irule neutron docker bigip
    最近评论
    汤姆 发布于 8 个月前(09月10日) 嗨,楼主,里面的json怎么下载啊,怎么收费啊?
    汤姆 发布于 8 个月前(09月09日) 大佬,kib的页面可以分享下吗?谢谢
    zhangsha 发布于 1 年前(05月12日) 资料发给我下,谢谢纳米同志!!!!lyx895@qq.com
    李成才 发布于 1 年前(01月02日) 麻烦了,谢谢大佬
    纳米 发布于 1 年前(01月02日) 你好。是的,因为以前下载系统插件在一次升级后将所有的下载生成信息全弄丢了。所以不少文件无法下载。DN...
    浏览次数
    • Downloads - 183,779 views
    • 联系我 - 118,966 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 116,521 views
    • Github - 103,669 views
    • F5常见log日志解释 - 79,775 views
    • 从传统ADC迈向CLOUD NATIVE ADC - 下载 - 74,627 views
    • Sniffer Pro 4 70 530抓包软件 中文版+视频教程 - 74,320 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 67,770 views
    • 关于本站 - 60,917 views
    • 这篇文档您是否感兴趣 - 55,498 views
    链接表
    • F5SE创新
    • Jimmy Song‘s Blog
    • SDNlab
    • Service Mesh社区
    • 三斗室
    • 个人profile
    • 云原生社区

    COPYRIGHT © 2023 Cloud Native 应用交付. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    京ICP备14048088号-1

    京公网安备 11010502041506号