p64381
V2EX  ›  问与答

ipset hash:ip 查询 和 路由表查询 哪个快一些呢

  •  
  •   p64381 · Mar 14, 2018 · 2280 views
    This topic created in 3184 days ago, the information mentioned may be changed or developed.
    路由表中的 ip 不许额外设置就能分流,ipset 里面的 ip 还要转好几圈才能分流。
    ipset 是为了把大量 ip 的流量定向到某个端口而产生的。

    直接用路由表的缺陷:
    dnsmasq 没有能操作路由表的设置, 需要自己 patch。
    路由表没有 ipset 那种超时机制, 需要自己维护。
    2 replies  •  2018-03-15 10:23:21 +08:00
    LGA1150
    LGA1150
    Mar 15, 2018 via Android
    1
    时间复杂度 路由表 O(n),哈希表 O(1)
    p64381
    p64381
    OP
    Mar 15, 2018
    2
    @LGA1150 linux 路由表要是 O(n) 就没法活了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4161 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 07:46 · PVG 15:46 · LAX 23:46 · JFK 02:46
    ♥ Do have faith in what you're doing.