zoukankan      html  css  js  c++  java
  • 云计算(9)--Gossip:multicast problem

    Gossip/Epidemic ptotocol 解决的问题是multicast problem

    Gossip 协议是电脑之间的通信协议,受启发与现实社会的流言蜚语。现代分布式系统通常用gossip协议来解决一些用其他方法难以解决的问题,可能是因为当前网络有一个不便的问题——过于庞大,或许是因为gossip协议有时候是最为行之有效的方法。

     “传染病协议”(epidemic protocol)有时也是gossip协议的同义词,因为gossip协议传播信息的方式,有时候很类似于生物体内的病毒传播。

    Multicast

    红色的node想要把自己的information发送给group里面的其它的node---multicast problem

    multicast与broadcast不同,broadcast是把消息发送给整个network,multicast是把消息发送给a particular group of nodes(a group of processes)

    multicast protocol的需求--fault tolerance, scalability

    multicast protocao需要具备有fault tolerance(nodes可能会crash,packet可能会丢失)和scalability(nodes进行扩展时不会导致费用的急剧增加)的要求

    multicast protocol在网络层中是属于application level的,即它不处理underlying network.但这不是一定的,multicast protocal也常常与underlying network通信(如IP multicast)。

    One of the simplest ways of doing multicast--centralized

    problems:  1,fault tolerance--当只发送了一部分nodes时,sender这时fail掉了就会出错

                    2,the overhead on the sender 非常高

                    3,延时较高,每个node接收到消息的时间是o(N),N为group的大小

    为了解决这些problems,我们提出了Tree-based multicast protocols

    protocol在nodes建立了一个生成树 

    这些包括network level protocol:如IP multicast,这儿的生成树是建立在router和switches上的(in the undrlying network)

    application level protocol: 如SRM,RMTP,TRAM,TMTP

    如果建立的是一棵平衡树,则这棵树的高度是o(logN),则意味着node接收到消息的时间是o(logN)

    group里面每个node(sender或者receive)的overhead(消费)是常数(因为children是常数,发送children数量的copies)

    problems: 当有node出现错误(如crash掉时),没有接收到information时,需要建立与维护这棵生成tree,这时你需要一些bandwidth和resources去维护这个tree

    在初始时可能使用IP multicast, 然后使用ACK或者NAK去修复没有接收到的multicasts

    SRM使用NAKs,当node没有接收到并且等待了一会multicast message时,它向上朝root发送a repair request,当这个request被接收到,临近root的node发送它们拥有的latest multicast或者receive node丢失的multicast message.

    Issue of SRM: the ACKs and NAKs 可能会implode(内爆),为了避免这个问题,SRM protocol在receiver端使用random delays,当receiver要发送NAKs,它们不是立即发送,而是等一段时间后再发送。如果需要多次发送NAKs时,可能会使用exponential backoff(指数退避),即等待的时间加倍。

    RMTP: 使用ACK, receivers 间断性的发送collection of acknowledgements for all multicasts they received so far.如果有acknowledgement没有接收到的话,则会向下朝receivers发送消息。

    也有可能会发生ACK storms,为了避免ACK storms,有一些特定的标记为designated receivers,ACK只会发送给这些designated receivers,然后这些designated receivers再向下发送它收到的multicast message

    但是这些protocols还是会引起O(N)的ACK/NAK的消费,所以这些protocols应用的规模并不是可以任意的扩展,所以我们引入了Gossip/Epidemic ptotocol

  • 相关阅读:
    为Internal页面添加一个Unit Test的运行入口
    使用 AWSTATS 来查看IIS/iisnode 日志
    用issnode+IIS来托管NodeJs Server之四:支持Debug
    Restify实践
    Mocha实践
    Graphite实战
    StatsD与Graphite联合作战
    单元测试
    NHibernate配置
    NHibernate概念
  • 原文地址:https://www.cnblogs.com/yan2015/p/4892724.html
Copyright © 2011-2022 走看看