亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? kelips.h

?? 這是一個P2P協議仿真軟件
?? H
字號:
#ifndef __KELIPS_H#define __KELIPS_H// To Do:// OOPS short gossip intervals don't work right since gossip() blocks// there is something wrong with proximity routing, not fast enuf// log timeouts' contribution to rtt// need to parameterize number of nodes to ping per gossip round// Differences from Kelips as described in IPTPS 2003 paper:// I look up IDs, not files.// When/how do you learn RTT to a new node? So you know whether to//   keep it in your contacts list.// How often does a node generate a new heartbeat value?// When does a node send Info for itself? random? every gossip?// For how many rounds do they gossip a new item? (1 seems to work best)// Do existing items with new heartbeats count as new for gossip?// How big are the rations mentions in 2.1? In the eval.//   For group vs contact, and also new vs old.// Pull at join and then all push often leaves isolated nodes,//   since maybe nobody pushes to me. So what happens at join?// ***// What heartbeat timeout values?// The contacts tend to time out a lot...// Replacing contacts with newer heartbeat helps convergence a lot.//   As well as reducing contact timeout dramatically.// Are lookups iterative or recursive? Who controls various retries?// To do:// why does one-hop (k=1) w/ n=1024 suck so much?//   should be fabulous if you gossip enough!// gossip to nearby nodes preferentially?// hmm, we get a LOT of lookup failures in kx.pl runs, like 1/2 of lookups//   any way to make it more persistent?// why doesn't 1024 get down to 1 RTT?//   not moving info fast enough?// examine effect of each paramter individually// maybe try parameters that move more info?// is there an explicit "dead" flag on gossip entries?// Does it stabilize after the expected number of rounds?// Gossip w/o favoring new nodes (nnodes: avg median)://   100: 10 10//   400: 27 27// With gossiping new nodes first for 1 round://   100: 10 11//   400: 25 29// Replacing contacts with newer heartbeat, _item_rounds = 1://   100:  6  5//   400: 13 14// Oy, _item_rounds=0 beats this by a lot.#include "p2psim/p2protocol.h"#include "consistenthash.h"#include "p2psim/p2psim.h"#include "p2psim/condvar.h"#include "p2psim/network.h"#include <map>#include <vector>#include <set>#ifdef HAVE_LIBGBextern "C" {  #include "gb_graph.h"   #include <gb_dijk.h>}#endifclass Kelips : public P2Protocol {public:  typedef u_int ID;  struct lookup_args{    ID key;    Time start;    u_int retrytimes;    vector<IPAddress> history;    Time total_to;    u_int num_to;  };  struct lookup1_args{    ID key;    IPAddress dst_ip;  };  Kelips(IPAddress i, Args a);  virtual ~Kelips();  string proto_name() { return "Kelips"; }  // Functions callable from events file.  virtual void join(Args*);  virtual void leave(Args*);  virtual void crash(Args*);  virtual void lookup(Args*);  virtual void insert(Args*);  virtual void nodeevent (Args *) {};  void lookup_internal(lookup_args *a);  void add_edge(int *matrix, int sz); private:  // typedef ConsistentHash::CHID ID;  // Parameters, with defaults from Kelips paper.  int _round_interval;    // (2000) inter-gossip interval.  u_int _group_targets;   // (3) gossip to X targets in group.  u_int _contact_targets; // (3) gossip to X contacts.  u_int _group_ration;    // (4) group items per gossip packet.  u_int _contact_ration;  // (2) contact items per gossip packet.  int _n_contacts;        // (2) contacts to remember per foreign group.  int _item_rounds;       // (1???) how many times to gossip a new item.  Time _max_lookup_time;  u_int _purge_time;      // period the purge timer is run  u_int _track_conncomp_timer;   u_int _to_multiplier; //a retransmit timer  u_int _to_cheat;    int _timeout;           // (25000???) milliseconds to group item timeout.  // hearbeat timeouts. XXX not specified in paper.  /*  static const int _group_timeout = 25000;  static const int _contact_timeout = 50000;  */  int _k; // number of affinity groups, should be sqrt(n)  bool _started; // are our timers ticking?  bool _live;    // are we joined but not crashed?  // global statistics  static double _rpc_bytes; // total traffic  static double _good_latency; // successful lookups  static double _good_hops;  static int _good_lookups;  static int _ok_failures;  static int _bad_failures;  // Information about one other node.  class Info {  public:    IPAddress _ip;    Time _heartbeat; // when _ip last spoke to anyone.    int _rounds;     // how many rounds to send for.    int _rtt;        // measured by us, -1 if not valid    Info(IPAddress ip, Time hb) {       _ip = ip; _heartbeat = hb; _rounds = 0; _rtt = -1;    }    Info() { _ip = 0; _heartbeat = 0; _rounds = 0; _rtt = -1; }    int age() const { return now() - _heartbeat; }  };  // Set of nodes that this node knows about.  // This is the paper's Affinity Group View and Contacts.  map<IPAddress, Info *> _info;  void gotinfo(Info i, int rtt);  ID ip2id(IPAddress xip) {    return xip;    // return ConsistentHash::ip2chid(xip);  }  int id2group(ID id) { return(id % _k); }  int ip2group(IPAddress xip) { return(id2group(ip2id(xip))); }  ID id() { return ip2id(ip()); }  int group() { return ip2group(ip()); }  void gossip(void *);  void handle_gossip(vector<Info> *, void *);  void purge(void *);  vector<IPAddress> all();  vector<IPAddress> grouplist(int g);  vector<IPAddress> notgrouplist(int g);  void check(bool doprint);  void handle_join(IPAddress *caller, vector<Info> *ret);  vector<Info> gossip_msg(int g, u_int, u_int);  vector<IPAddress> randomize(vector<IPAddress> a);  vector<IPAddress> newold(vector<IPAddress> a, bool xnew);  void newold_msg(vector<Info> &msg, vector<IPAddress> l, u_int ration);  void handle_lookup_final(ID *kp, bool *done);  void handle_lookup1(lookup1_args *kp, IPAddress *res);  bool lookup1(lookup_args *a);  bool lookupvia(lookup_args *a, IPAddress via);  bool lookup2(lookup_args *a);  bool lookup_loop(lookup_args *a);  void handle_lookup2(ID *kp, IPAddress *res);  IPAddress find_by_id(ID key);  void init_state(const set<Node*>*);  bool stabilized(vector<ID> lid);  void rpcstat(bool ok, IPAddress dst, int latency, int nitems, uint type);  IPAddress victim(int g);  void handle_ping(void *, void *);  inline int contact_score(const Info &i);  IPAddress closest_contact(int g);  bool node_key_alive(ID key);  // RPC that records RTT.  template<class AT, class RT>    bool xRPC(IPAddress dst, int nitems, void (Kelips::* fn)(AT *, RT *),              AT *args, RT *ret, uint type=1, Time *total_to=NULL, uint *num_to=NULL){    Time t1 = now();    Time timeout = 1000;    if (_to_cheat) {      timeout = _to_multiplier * 2 * (Network::Instance()->gettopology())->latency(ip(),dst);    }else if ((_info.find(dst) == _info.end())       || (_info[dst]->_rtt == 9999) || 	(_info[dst]->_rtt == -1)) {      timeout = 1000; //1 second timeout    } else {      timeout = _to_multiplier * _info[dst]->_rtt;    }    bool ok = doRPC(dst, fn, args, ret, timeout);    rpcstat(ok, dst, now() - t1, nitems,type);    if (!ok) {      if (total_to) *total_to += timeout; //record the timeout incurred      if (num_to) *num_to += 1;    }    return ok;  };  friend class KelipsObserver;};#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品一二三区| 91免费在线视频观看| 99久久免费精品高清特色大片| 欧美视频中文一区二区三区在线观看| 欧美精品一区二区三区在线播放| 夜夜操天天操亚洲| 不卡一区二区三区四区| 日韩精品一区二区三区在线观看| 亚洲最色的网站| 成人av动漫网站| 久久久精品蜜桃| 日韩中文字幕不卡| 欧美亚洲日本一区| 亚洲欧美精品午睡沙发| 成人视屏免费看| 2020国产精品自拍| 激情久久五月天| 日韩三级av在线播放| 亚洲va韩国va欧美va精品| 日本韩国精品在线| 亚洲天堂成人网| 99久久婷婷国产综合精品| 国产精品―色哟哟| 懂色av噜噜一区二区三区av| 久久精品一区二区三区不卡| 激情综合亚洲精品| 精品国产免费视频| 国产精品综合二区| 欧美激情一区二区三区蜜桃视频 | 亚洲欧美成人一区二区三区| 成人在线综合网| 国产欧美日韩精品一区| 国产suv一区二区三区88区| 日本一区二区成人在线| jlzzjlzz亚洲女人18| 18涩涩午夜精品.www| 一本色道久久加勒比精品 | 日本中文字幕一区二区有限公司| 欧美在线免费视屏| 日韩av在线免费观看不卡| 欧美美女激情18p| 久久精品二区亚洲w码| 精品国产一区二区三区不卡| 国产精品资源在线看| 国产精品女主播在线观看| a4yy欧美一区二区三区| 亚洲激情五月婷婷| 日韩一区二区三区精品视频| 国产一区二区网址| 亚洲免费在线视频一区 二区| 欧美色电影在线| 精品一二三四区| 国产精品美女久久久久久久久久久| 99久久伊人久久99| 五月综合激情日本mⅴ| 精品国产一区二区在线观看| 成人av网站在线观看免费| 亚洲一区二区三区中文字幕 | 视频在线在亚洲| 久久久久久久久久久电影| 91视频你懂的| 日韩av不卡在线观看| 久久精品欧美日韩精品| 欧美日韩免费一区二区三区视频| 美女在线一区二区| 亚洲色图.com| 日韩精品一区二| 一本一道久久a久久精品| 美国十次综合导航| 亚洲女子a中天字幕| 91麻豆精品国产91久久久使用方法 | 亚洲国产欧美在线| 久久老女人爱爱| 欧美三级日本三级少妇99| 国精产品一区一区三区mba视频 | 欧美一区二区二区| 99免费精品在线观看| 日本成人在线看| 亚洲精品中文字幕在线观看| 日韩欧美一二三区| 色综合中文字幕| 国产乱子伦视频一区二区三区| 亚洲影视在线播放| 中文字幕在线播放不卡一区| 精品欧美久久久| 欧美日韩中字一区| 成人免费看视频| 久久99蜜桃精品| 亚洲18色成人| 亚洲综合色婷婷| 中文字幕一区二区不卡| 26uuu久久天堂性欧美| 欧美三级电影网站| 色综合久久久久网| 99久久精品国产麻豆演员表| 国产精品888| 久久成人免费电影| 麻豆精品在线看| 免费不卡在线视频| 婷婷丁香激情综合| 偷拍日韩校园综合在线| 一区二区三区资源| 亚洲欧美日韩一区二区三区在线观看| 欧美极品xxx| 久久精品视频一区二区三区| 日韩精品一区二区三区四区视频 | 欧美视频一区二区三区在线观看| 成人免费高清视频在线观看| 国产综合色产在线精品| 狠狠色综合日日| 国产专区欧美精品| 国产成人综合精品三级| 国产·精品毛片| 成人国产一区二区三区精品| 成人黄色在线网站| 一本色道久久综合精品竹菊| 91女神在线视频| 欧美午夜一区二区三区免费大片| 在线亚洲一区观看| 欧美日韩国产成人在线免费| 欧美日韩综合不卡| 日韩午夜三级在线| 欧美精品一区二区三区很污很色的| 精品免费国产二区三区 | 欧美xxxxxxxx| 久久久久久久久免费| 日本一区二区动态图| 亚洲三级在线播放| 日日夜夜精品视频免费| 久久国产精品色| 成人午夜视频福利| 精品视频在线免费观看| 91精品国模一区二区三区| 亚洲精品一区二区三区福利| 国产精品久久久久久久久免费樱桃| 亚洲免费成人av| 免费观看一级欧美片| 激情综合网天天干| 成人av电影免费观看| 欧美四级电影在线观看| 精品国产成人系列| 亚洲精品国久久99热| 美女一区二区视频| 94色蜜桃网一区二区三区| 欧美精品少妇一区二区三区| 精品免费国产一区二区三区四区| 国产精品国产三级国产aⅴ中文| 亚洲尤物在线视频观看| 精品中文字幕一区二区| 色综合av在线| 精品久久久久99| 亚洲一区二区免费视频| 国产真实乱对白精彩久久| 欧美专区亚洲专区| 亚洲国产精品精华液ab| 视频一区二区中文字幕| 成人国产亚洲欧美成人综合网| 欧美日韩电影一区| 国产精品免费人成网站| 免费在线观看成人| 欧美色图片你懂的| 国产精品毛片高清在线完整版| 日韩高清中文字幕一区| 91麻豆免费看片| 久久久91精品国产一区二区三区| 亚洲成人综合网站| a在线欧美一区| 久久久国产综合精品女国产盗摄| 亚洲sss视频在线视频| av电影天堂一区二区在线观看| 精品国产亚洲一区二区三区在线观看| 综合在线观看色| 国产91精品精华液一区二区三区| 欧美一区二区三区在线观看| 亚洲精品日日夜夜| 国产成人高清视频| 精品久久久久99| 精品一区免费av| 日韩欧美亚洲国产另类| 日韩精品视频网| 日本精品一区二区三区四区的功能| 久久免费午夜影院| 另类成人小视频在线| 91精品国产手机| 香蕉影视欧美成人| 欧美三级中文字幕| 午夜成人免费电影| 欧美福利电影网| 偷拍亚洲欧洲综合| 555www色欧美视频| 日韩国产欧美在线视频| 欧美丰满一区二区免费视频| 亚洲一区av在线| 欧美丝袜第三区| 偷拍一区二区三区| 欧美一区二区三区四区在线观看| 视频一区在线视频| 日韩一区二区视频| 国产一区二三区好的| 国产偷v国产偷v亚洲高清|