{"record":{"id":"dbf38be0e87de51a","repo":"XTLS/Xray-core","slug":"brutalup-must-be-at-least-65536-bytes-per-second","errorCode":null,"errorMessage":"BrutalUp must be at least 65536 bytes per second","messagePattern":"BrutalUp must be at least 65536 bytes per second","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_internet.go","lineNumber":239,"sourceCode":"\t\t\tcase \"\", string(bbr.ProfileConservative), string(bbr.ProfileStandard), string(bbr.ProfileAggressive):\n\t\t\t\tif profile == \"\" {\n\t\t\t\t\tprofile = string(bbr.ProfileStandard)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn nil, errors.New(\"unknown bbr profile\")\n\t\t\t}\n\n\t\t\tup, err := c.FinalMask.QuicParams.BrutalUp.Bps()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdown, err := c.FinalMask.QuicParams.BrutalDown.Bps()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif up > 0 && up < 65536 {\n\t\t\t\treturn nil, errors.New(\"BrutalUp must be at least 65536 bytes per second\")\n\t\t\t}\n\t\t\tif down > 0 && down < 65536 {\n\t\t\t\treturn nil, errors.New(\"BrutalDown must be at least 65536 bytes per second\")\n\t\t\t}\n\n\t\t\tc.FinalMask.QuicParams.Congestion = strings.ToLower(c.FinalMask.QuicParams.Congestion)\n\t\t\tswitch c.FinalMask.QuicParams.Congestion {\n\t\t\tcase \"\", \"brutal\", \"reno\", \"bbr\":\n\t\t\tcase \"force-brutal\":\n\t\t\t\tif up == 0 {\n\t\t\t\t\treturn nil, errors.New(\"force-brutal requires up\")\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn nil, errors.New(\"unknown congestion control: \", c.FinalMask.QuicParams.Congestion, \", valid values: reno, bbr, brutal, force-brutal\")\n\t\t\t}\n\n\t\t\tif (c.FinalMask.QuicParams.UdpHop.Interval.From != 0 && c.FinalMask.QuicParams.UdpHop.Interval.From < 5) || (c.FinalMask.QuicParams.UdpHop.Interval.To != 0 && c.FinalMask.QuicParams.UdpHop.Interval.To < 5) {\n\t\t\t\treturn nil, errors.New(\"Interval must be at least 5\")","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_internet.go#L221-L257","documentation":"Validates the BrutalUp bandwidth under finalMask.quicParams: a positive value that parses to fewer than 65536 bytes/second is rejected. 65536 B/s is the floor Brutal CC needs for meaningful rate control. Zero (unset) is allowed and skips the check. The value is parsed by BrutalUp.Bps() which accepts bandwidth strings; a parse error there surfaces as a bare err instead.","triggerScenarios":"\"quicParams\": { \"brutalUp\": \"32 kBps\" } (or any positive value < 65536 B/s), e.g. \"512 kbps\" = 64000 B/s also fails.","commonSituations":"Confusing bits and bytes (65536 B/s = 524288 bps; \"512 kbps\" is below it); testing with tiny artificial bandwidth numbers; migrating values tuned for other proxies.","solutions":["Raise brutalUp to at least 65536 bytes/second, e.g. \"512 kBps\" or higher.","Or leave brutalUp unset (0) if you do not intend to pin upstream Brutal rate.","Double-check bit-vs-byte units: 65536 B/s equals 524288 bits/s."],"exampleFix":"// before\n\"quicParams\": { \"brutalUp\": \"100 kbps\" }\n// after\n\"quicParams\": { \"brutalUp\": \"512 kBps\" }","handlingStrategy":"validation","validationCode":"// parse bandwidth strings like \"512 kBps\" and enforce the floor\nfunc brutalUpOK(raw any) bool {\n    s, _ := raw.(string)\n    if s == \"\" { return true } // unset\n    bps, err := parseBandwidthToBytesPerSec(s)\n    return err == nil && (bps == 0 || bps >= 65536)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Think in bytes per second: the floor is 65536 B/s (512 kbps is 64000 B/s and FAILS).","Keep bandwidth strings in the documented format (number + unit like 'MBps', 'kBps').","Add a pre-deploy lint rule for brutalUp/brutalDown >= 65536."],"tags":["go","xray","config","quic","brutal","bandwidth","validation"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}