Skip to content

Instantly share code, notes, and snippets.

@changtimwu
Created September 22, 2012 05:33
Show Gist options
  • Save changtimwu/3765240 to your computer and use it in GitHub Desktop.
Save changtimwu/3765240 to your computer and use it in GitHub Desktop.
modeling ping as a measurement for link-change takeover

RTT and ping interval

   +--RTT -+------------------------- ping interval -----------------------+-----+
  ping   pong                                                               ping pong   

recovery time:

   +---------------------+
 link down             link up

case 1: fail-over before ping-pong 不會掉

+------+-------+------+---
down   up     ping   pong

case 2: fail-over after ping-pong -> 不會掉

---+------+-------+------+
   ping   pong   down    up

case 3: hardly! fail-over in the middle of ping-pong, recovery_time < RTT, 不會Request timeout

---+--------+------+------------+--
   ping    down    up         pong   

case 4: ping in the middle of recovery, ping dropped, 會 Request timeout

-------+--------+------+------------+--
     down      ping    up         pong   

case 5: pong in the middle of recovery, pong dropped, 會 Request timeout

-------+--------+------+------------+--
     ping      down    pong        up

結論:

  • recovery time 除非為0, 否則無法保證不發生 Request timeout , 除非switch 能先把packet buffer起來
  • 用 ping -W 增加RTT容忍度沒用, 因為掉了就是掉了, 不會等久一點就回來.
  • recovery time / ping interval 越小, Request timeout 機率越低
  • 想要縮短 recovery time, 仰賴實作
  • 想要加長 ping interval, 可以用ping -i, 但是user會有明顯感受
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment