Documentation ¶
Overview ¶
Package mtu is a library for tracking and configuring MTU for devices and routes.
Index ¶
Constants ¶
View Source
const ( // MaxMTU is the highest MTU that can be used for devices and routes // handled by Cilium. It will typically be used to configure inbound // paths towards containers where it is guaranteed that the packet will // not be rerouted to another node, and therefore will not lead to // any form of IP fragmentation. // One might expect this to be 65535, however Linux seems to cap the // MTU of routes at 65520, so we use this value below. MaxMTU = 65520 // EthernetMTU is the standard MTU for Ethernet devices. It is used // as the MTU for container devices when running direct routing mode. EthernetMTU = 1500 // TunnelOverhead is an approximation for bytes used for tunnel // encapsulation. It accounts for: // (Outer ethernet is not accounted against MTU size) // Outer IPv4 header: 20B // Outer UDP header: 8B // Outer VXLAN header: 8B // Original Ethernet: 14B // --- // Total extra bytes: 50B TunnelOverhead = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration is an MTU configuration as returned by NewConfiguration
func NewConfiguration ¶
func NewConfiguration(encapEnabled bool, mtu int) Configuration
NewConfiguration returns a new MTU configuration. The MTU can be manually specified, otherwise it will be automatically detected. if encapEnabled is true, the MTU is adjusted to account for encapsulation overhead for all routes involved in node to node communication.
func (*Configuration) GetDeviceMTU ¶
func (c *Configuration) GetDeviceMTU() int
GetDeviceMTU returns the MTU to be used on workload facing devices.
func (*Configuration) GetRouteMTU ¶
func (c *Configuration) GetRouteMTU() int
GetRouteMTU returns the MTU to be used on the network. When running in tunneling mode, this will have tunnel overhead accounted for.
Click to show internal directories.
Click to hide internal directories.