Skip to content

smartcontract: enforce 9000-byte MTU on links and device interfaces #3411

@elitegreg

Description

@elitegreg

Summary

Change the enforced MTU for links and non-CYOA/non-DIA device interfaces from 2048 to 9000 bytes. CYOA/DIA interfaces remain at 1500. Add onchain validation using the existing InvalidMtu error code, and make the CLI --mtu flag optional with correct defaults.

Motivation

The network should use jumbo frames (9000 bytes) by default for all fabric-facing links and interfaces. The previous 2048-byte MTU was a placeholder that does not reflect the intended production configuration. Enforcing this at both the CLI and onchain level prevents misconfigured links and interfaces from being registered.

Changes

Onchain (smartcontract program)

  • Validate MTU in link create/update processors: must be 9000, else return InvalidMtu (error 46)
  • Validate MTU in device interface create/update processors: must be 9000 for non-CYOA/non-DIA interfaces, 1500 for CYOA/DIA interfaces

CLI

  • doublezero link create wan/dzx: --mtu becomes optional, defaults to 9000, rejects other values
  • doublezero link update: --mtu validates 9000 if provided
  • doublezero device interface create: defaults to 9000 (non-CYOA/DIA) or 1500 (CYOA/DIA), rejects other values
  • doublezero device interface update: same validation rules
  • Remove validate_parse_mtu range validator (no longer meaningful)

Tests

  • Update all test fixtures from 2048/1500 to 9000 for non-CYOA interfaces and links
  • Add onchain tests for InvalidMtu rejection
  • Update test script (start-test.sh) MTU values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions