Patterns in network system design (1)

Sina WeiboBaiduLinkedInQQGoogle+RedditEvernote分享




Pattern是系统设计过程中,重复出现的结构或者原则。不同的设计层次或者领域,有不同的pattern,比如analysis pattern, architecture pattern, design pattern, debug pattern, bug pattern等,甚至还有很多anti-pattern。Pattern是对已有知识的总结和优化,它对现有系统的维护,以及未来系统的设计都有帮助。

在这里,我要总结的是在网络系统设计里面出现的pattern,这只是经验的总结,每一个pattern并没有经过深思熟虑,所以pattern的描述可能是不完整的。而且这些pattern还不能形成一个完整的pattern language,也就是说,它们还可以提炼和扩展。如果能够形成一个pattern language,它将是我写这些文字最大的收获。

Pattern描述需要一定的格式,这里使用的是我自己简化过的描述方式,只保留了最基本的东西。复杂,详细的描述要花费时间和精力,有时间再慢慢扩充。下面就按顺序来描述这些pattern,大概有十多个,将会分几个部分发出来。

 1) control plane/data plane

Pattern Name and Classification: control plane/ data plane
Intent: 把转发和协议分离,隔离错误,提高性能
Also Known As: control plane/ forwarding plane
Motivation (Forces):

  在网络设备里面,最重要的工作就是转发,大部分流量都是在数据平面处理的。控制平面处理协议。一般来说,数据平面需要处理的是需要转发的流量,而控制平面处理的是终结在本机的流量。可能还需要加一个管理平面(management plane),用于配置,管理设备。  很明显,数据平面需要高性能的处理器,而控制平面就稍差一点。但控制平面往往会成为被攻击的重点,所以控制平面更关心协议实现的正确性和安全性。 
Known Uses: 网关设备
Related Patterns: service plane

References:

  1: Requirements for Separation of IP Control and Forwarding

 2) first path/ fast path

Pattern Name and Classification:  first path/ fast path
Intent: 把慢速路径和快速路径分离,隔离错误,提高性能
Also Known As: slow path/ fast path; exception path/ fast path
Motivation (Forces):

  在session-based的网络设备里面,创建session的过程比较复杂,而根据session进行转发的工作则比较简单。所以把创建session的path分离出来,可以只针对这个部分进行优化。一般来说,在connection rate测试,考验的是first path的能力,而throughput 测试考验的是fast path的能力。
Known Uses: session-based gateway
Related Patterns: service plane
References:
1: How to choose the best router switching path for your network

(4个打分, 平均:5.00 / 5)

雁过留声

“Patterns in network system design (1)”有19个回复

  1. 胡不才 于 2010-12-27 8:09 下午

    是您的文章引导我找到这本书《How to Solve It: Modern Heuristics》
    http://www.amazon.com/exec/obidos/ASIN/3540660615/codecomplete-20/104-2051616-6348733

    Code complete 2 在第5章资源中有如下评价:
    olya, G. How to Solve It: A New Aspect of Mathematical Method, 2d ed. Princeton, N.J.: Princeton University Press, 1957. This discussion of heuristics and problem solving focuses on mathematics but is applicable to software development. Polya’s book was the first written about the use of heuristics in mathematical problem solving. It draws a clear distinction between the messy heuristics used to discover solutions and the tidier techniques used to present them once they’ve been discovered. It’s not easy reading, but if you’re interested in heuristics, you’ll eventually read it whether you want to or not. Polya’s book makes it clear that problem solving isn’t a deterministic activity and that adherence to any single methodology is like walking with your feet in chains. At one time Microsoft gave this book to all its new programmers. Buy from Amazon.com

    Michalewicz, Zbigniew, and David B. Fogel. How to Solve It: Modern Heuristics. Berlin: Springer-Verlag, 2000. This is an updated treatment of Polya’s book that’s quite a bit easier to read and that also contains some non-mathematical examples. Buy from Amazon.com

    也许,寻找pattern的过程就是总结问题和解法的过程,然后应用找到的算法/pattern去解决新的问题

  2. magic 于 2010-12-28 12:43 上午

    V期待陆续的系列

  3. magic 于 2010-12-28 12:44 上午

    参考文档国内打不开,河蟹了吗
    Requirements for Separation of IP Control and Forwarding

  4. magic 于 2010-12-28 12:51 上午

    能用的链接
    Requirements for Separation of IP Control and Forwarding
    http://www.ietf.org/rfc/rfc3654.txt

  5. slopover 于 2010-12-28 1:06 上午

    这个系列很期待

  6. zedware 于 2010-12-28 2:24 上午

    Very good.

  7. 加菲猫 于 2010-12-28 3:01 上午

    后期会讲Qos?

  8. 打酱油的 于 2010-12-28 5:53 上午

    还有十几种!!!哥哥你真强!!!佩服

  9. bneliao 于 2010-12-28 8:04 上午

    期待后续大作

  10. metal1011 于 2010-12-29 2:52 上午

    很好 非常期待

  11. bigrong 于 2011-01-25 10:30 下午

    文章不错!继续看。

  12. harden 于 2011-02-11 11:16 下午

    不错,果然是做系统设计的,一开篇思路就很新,很大气。

  13. xie 于 2011-03-12 4:48 上午

    能否详细讨论下first path/fast path模式。
    如果每个session都要走fast path,这样应付测试是挺好的,但是在真实网络中,短连接非常多,这样会不会反而降低效率,毕竟first path/fast path通信也是有代价的。

  14. kernelchina 于 2011-03-12 5:52 上午

    没明白你说的是什么意思。一般first path是对first packet来说的,对于first path,要查policy, route, arp等等。session建好了,就可以直接使用session里面保存的信息。有些路由器或者交换机有fast forwarding(我看见过思科,港湾有些介绍资料,主要是在software based router/switch里面用)。在stateful的实现里面,session相当于一个cache,除了第一个packet,其他都需要match session,其实就相当于查policy/route/arp等等。

  15. xie 于 2011-03-12 6:30 上午

    我碰到个芯片,有硬件的fastpath,但是add session到fastpath的代价貌似比较高。
    如果为把每个连接都add到fastpath,实际网络中反而会增加短链接的延时。

  16. 陈怀临 于 2011-03-12 9:59 上午

    老鸟都喜欢玩术语。号称“术语党”, compared to “胶片党”。。。:-)。也算一个毛病。通常能把一大堆术语整清楚,基本上就算高手了:-)

    first path更多是session based系统的一个东东。其实就是指first packet的处理。big bang嘛。fast path就是指session install之后,session match了,就通过binded policy,干干嘛干嘛的事情。所以这部分通常可以硬件加速了。。。

    忘掉术语,看生活。才是高手。例如,首席的公厕理论:-)

  17. kernelchina 于 2011-03-12 8:47 下午

    @xie 硬件的fastpath是怎么做的?如果不加session也可以快速转发,那也可以,不过就是stateless的转发,和stateful是两回事。

  18. Will Chie 于 2011-03-15 12:22 上午

    连接有多短?相信>=3个包,FP就是有意义的。

    芯片这个问题就得找芯片设计师了,个例。

  19. Will Chie 于 2011-03-15 12:23 上午

    当然也要看SP的规模了,如果只是路由一下,自然无需FP。