Monday, November 21, 2011

MTU of ipsec GRE

MTU from

The maximum transmission unit, i.e., the size of the
              largest packet that can be transmitted.

         The terms frame, packet, datagram, message, and segment are
         illustrated by the following schematic diagrams:

         A. Transmission on connected network:
          | LL hdr | IP hdr |         (data)              |

           <---------- Frame ----------------------------->
                    <----------Packet -------------------->

         B. Before IP fragmentation or after IP reassembly:
                   | IP hdr | transport| Application Data |

                    <--------  Datagram ------------------>
                             <-------- Message ----------->
           or, for TCP:
                   | IP hdr |  TCP hdr | Application Data |

                    <--------  Datagram ------------------>
                             <-------- Segment ----------->

MTU explaination copy from

Overhead calculation of GRE over IPSec (assume ESP-DES & ESP-MD5-HMAC):

ESP overhead (with authentication) : 31 ~ 38 bytes

GRE header: 24 bytes

IP header: 20 byes

 GRE over IPSec with tunnel mode introduces ~75 bytes overhead, GRE over IPSec with transport mode introduces ~55 bytes overhead

Solutions for the ipsec over GRE:

1. tunnel path-mtu-discovery on the tunnel interface
2. Use the ip tcp adjust-mss command on the tunnel interfaces
3. Use policy routing on the ingress interface of the router and configure a route map to clear the DF bit in the data IP header before it gets to the GRE tunnel interface.

route-map CLEAR-DF permit 10
 set ip df 0
interface <LAN>
 ip policy route-map CLEAR-DF

4. Increase the "ip mtu" on the GRE tunnel interface to be equal to the outbound interface MTU. This will allow the data IP packet to be GRE encapsulated without fragmenting it first. The GRE packet will then be IPsec encrypted and then fragmented to go out the physical outbound interface. In this case you would not configure tunnel path-mtu-discovery command on the GRE tunnel interface. This can dramatically reduce the throughput because IP packet reassembly on the IPsec peer is done in process-switching mode.   

No comments:

Post a Comment