9/28/2018

Nexthop Group (1)

为什么需要一个这样的功能?比方说,以下一个典型的JY网络

           [internet]<---- user: 200.1.1.1
           /        \
          /          \
   [borderLeaf]  [borderLeaf]
       |||          ||||
[...........spine nodes..........]
       |||          ||||
     [Leaf]        [Leaf  ]
     /    \        /      \
  [LB1]  [LB2] [SVR1]     [SVR2]
[customer.com] [10.1.1.1]
[100.1.1.1   ]            [10.1.1.1]
    
数据包流是这样的

  • 每个LB advertise 一组LB IP给用户,应该是internet public ip 
  • 用户的请求先到LB,LB再通过IP-in-IP,把数据包发给服务器,extDstIP = SvrIP
  • 服务器Decap pkts,处理完之后直接返回给用户
  • 所以数据流是: internet --> LB --> Svr --> internet
这个功能做啥哪?主要是switch offload SLB workload
  • 第一个是 IPinIP encap
    • 在LB上面的Leaf上,create static routes to Svr by NHG-IPinIP-tunnel。LB直接就转发native ip pkts, switch负责encap ip-in-ip tunnel header,因为是hw,比LB高速有效
  • Server LB - 上图里面的SVR1/2都有DstIP = 10.1.1.1,ECMP hashing会选一个final dest. 
  • 可以在NHG-IPinIP-tunnel增加 ECMP,从而达到network LB
需要啥?
  • T+ platform
  • LB using ECMP
  • v4-in-v4, v6-in-v6,以后的releae应该可以是v4-over-v6 or verse vice
  • Scale: 512 v4/256 v6 tunnels
  • EAPI: 1) config NHG; 2) config static route pointing to NHG
CLI:
  • size = # of NH entries in NHG, default = 256
  • entry <index> tunnel dest <dstIP>, dstIP = svrIP,这里在做LB!
    • index# = 0..size-1, 如果缺失就是drop, 注意!
    • 所以hashing很少啊,srcIP唯一, proto#=4(IPinIP)也是唯一,全靠dstIP
  • ip route 10.1.1.1/32 nexthop-group NHG
  • 如果route to dstIP本身就是multipath, 那么就选第一条
注意的几点
  • 这个NHG不是interface,什么意思哪?
    • 他不会像正常的interface去解析Nexthop
    • 正常的情况下,解析是ASIC fwd to software due to missing NH info. 在Tunnel情况,就是software自己去解析
    • 为啥有drop entry,主要就不会generate ICMP unreachable msg
  • multiple NHG可以share tunnels
  • 如果多个routes to host ip,gated show多个,但是hw里面只有NHG
  • 可以VRF吗?不知道
  • IP routing on/off,会重写hw,改变interface ip也是
  • MTU必须注意,增加了20B (v4) or 40B (v6), 需要config correct MTU on ALL interfaces
  • RPF: srcIP随意配置,所以注意不要被RPF给drop了
  • Linux Kernel has a drop entry for each IP, how to check?
为啥不叫IPinIP tunneling? 为啥取个新名字
  • NHG != tunnel interface, 3个区别:
    • 没有路由协议
    • 不会接受数据包
    • 而且NHG可以有不同种类的Encap: LSP/MPLS, GRE, IPinIP
  • 而且这是一个比interface更底层的概念,更像Adj/NHG = fib entry, 或者via = ECMP adj 

(Z1446)

No comments:

Post a Comment