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

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

?? ratecontrolledrouter.java

?? 實現網格環境下資源調度和分配的仿真
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * ** Network and Service Differentiation Extensions to GridSim 3.0 ** * * Gokul Poduval & Chen-Khong Tham * Computer Communication Networks (CCN) Lab * Dept of Electrical & Computer Engineering * National University of Singapore * August 2004 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * RateControlledRouter.java - Simulates a network router with RIP as the * advertising protocol * */package gridsim.net;import gridsim.net.*;import eduni.simjava.*;import gridsim.*;import gridsim.util.*;import java.util.*;/** * Use this router only in conjunction with an active packet scheduler, such as * the {@link gridsim.net.RateControlledScheduler} entity. * <p> * This class implements a Router using a form of RIP for routing. The routing * protocol used here is similar to <a * href="http://www.ietf.org/rfc/rfc1058.txt">Routing Information Protocol * (RIP) </a>. The routing protocol is run before Gridlets etc. can be * submitted. * <p> * In case there are more than two routes to a destination, the * route with the lower hopcount is used. Since in this simulation routers * relay perfect information and links do not break down, RIP should be a * reliable protocol to use. * * @invariant $none * @since GridSim Toolkit 4.0 * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore */public class RateControlledRouter extends Router{    private Hashtable linkTable_;       // table of Link entities    private Hashtable schedTable_;      // table of schedulers    private Hashtable hostTable_;       // table of hosts, such as routers, etc    private Hashtable routerTable_;     // table of routers    private Hashtable forwardTable_;    // a routing table    private static final int BITS = 8;     // 1 byte in bits    /**     * Creates a new Router object. By default, <b>no recording or logging</b>     * is done for packets' activities. If you want to log operations of this     * entity, please use {@link #RateControlledRouter(String, boolean)}.     * <br>     * Use this router only in conjunction with an active packet scheduler,     * such as the {@link gridsim.net.RateControlledScheduler} entity.     *     * @param name Name of this router     * @throws NullPointerException This happens when name is empty or null     * @see #RateControlledRouter(String, boolean)     * @see gridsim.net.RateControlledScheduler     * @pre name != null     * @post $none     */    public RateControlledRouter(String name) throws NullPointerException {        this(name, false);    }    /**     * Creates a new Router object with logging facility if it is turned on.     * Use this router only in conjunction with an active packet scheduler,     * such as the {@link gridsim.net.RateControlledScheduler} entity.     * <br>     * NOTE: If logging facility is turned on, there are some overheads     * in terms of performance and memory consumption.     *     * @param name      Name of this router     * @param trace     <tt>true</tt> if you want to record this router's     *                  activity, <tt>false</tt> otherwise     * @throws NullPointerException This happens when name is empty or null     * @see gridsim.net.RateControlledScheduler     * @pre name != null     * @post $none     */    public RateControlledRouter(String name, boolean trace) throws NullPointerException    {        super(name, trace);        init();    }    /**     * Initialises all variables     * @pre $none     * @post $none     */    private void init()    {        linkTable_ = new Hashtable();        hostTable_ = new Hashtable();        routerTable_ = new Hashtable();        forwardTable_ = new Hashtable();        schedTable_ = new Hashtable();    }    /**     * Joins two routers with a Link.     * @param router    The router on the other side to which this one will     *                  be attached.     * @param link      This is the link that will be used to connect the two     *                  routers.     * @param thisSched The scheduling policy used on this routers egress port     *                  when sending data through it.     * @param otherSched    The scheduling policy that will be used on the     *                      egress port of the router being connected to when     *                      sending data to this router.     * @pre router != null     * @pre link != null     * @pre thisSched != null     * @pre otherSched != null     * @post $none     */    public void attachRouter(Router router, Link link,                    PacketScheduler thisSched, PacketScheduler otherSched)    {        String msg = super.get_name() + ".attachRouter(): Error - ";        if (router == null)        {            System.out.println(msg + "the router is null.");            return;        }        if (link == null)        {            System.out.println(msg + "the link is null.");            return;        }        if (thisSched == null || otherSched == null)        {            System.out.println(msg +                    "the one or more packet schedulers are null.");            return;        }        thisSched.setBaudRate( link.getBaudRate() );        otherSched.setBaudRate( link.getBaudRate() );        link.attach(this, router);        this.attachRouter(router, link, thisSched);        router.attachRouter(this, link, otherSched);    }    /**     * Joins two routers together. This is called by the routers themselves     * and should not be called by other entities.     *     * @param router    The Router to which this router will be connected.     * @param link      The Link that will be used to join these routers.     * @param sched     The scheduling policy used on the egress port of the     *                  router when sending data through this route.     * @pre router != null     * @pre link != null     * @pre sched != null     * @post $none     */    public void attachRouter(Router router, Link link, PacketScheduler sched)    {        String msg = super.get_name() + ".attachRouter(): Error - ";        if (router == null)        {            System.out.println(msg + "the router is null.");            return;        }        if (link == null)        {            System.out.println(msg + "the link is null.");            return;        }        if (sched == null)        {            System.out.println(msg + "the packet scheduler is null.");            return;        }        linkTable_.put(router.get_name(), link.get_name());        if (!schedTable_.containsKey( link.get_name()) ) {            schedTable_.put(link.get_name(), sched);        }        routerTable_.put( link.get_name(), router.get_name() );        hostTable_.put( link.get_name(), router.get_name() );        sched.setRouterID( super.get_id() );  // tells the pkt scheduler        // logging or recording ...        if (reportWriter_ != null)        {            StringBuffer sb = null;            sb = new StringBuffer("attach this ROUTER, with router, ");            sb.append( router.get_name() );            sb.append(", with link, ");            sb.append( link.get_name() );            sb.append(", with packet scheduler, ");            sb.append( sched.getSchedName() );            super.write( sb.toString() );        }    }    /**     * Attaches an entity to this router. The link between the router and the     * entity being attached is taken from     * {@link gridsim.GridSimCore#getLink()}.     *     * @param entity    The entity to be attached.     * @param sched     The scheduling policy that will be used on the egress     *                  port when the router sends data to the entity being     *                  joined.     * @see gridsim.GridSimCore#getLink()     * @pre entity != null     * @pre sched != null     * @post $none     */    public void attachHost(GridSimCore entity, PacketScheduler sched)    {        String msg = super.get_name() + ".attachHost(): Error - ";        if (entity == null)        {            System.out.println(msg + "the entity is null.");            return;        }        if (sched == null)        {            System.out.println(msg + "the packet scheduler is null.");            return;        }        Link link = entity.getLink();        sched.setBaudRate( link.getBaudRate() );        sched.setRouterID( super.get_id()) ;        link.attach(this, entity);        linkTable_.put( entity.get_name(), link.get_name() );        hostTable_.put( link.get_name(), entity.get_name() );        if (!schedTable_.containsKey( link.get_name() )) {            schedTable_.put(link.get_name(), sched);        }        // recording ...        if (reportWriter_ != null)        {            StringBuffer sb = null;            sb = new StringBuffer("attach this ROUTER, to entity, ");            sb.append( entity.get_name() );            sb.append(", with packet scheduler, ");            sb.append( sched.getSchedName() );            super.write( sb.toString() );        }    }    /**     * Processes incoming events     * @param ev    a Sim_event object     * @pre ev != null     * @post $none     */    protected synchronized void processEvent(Sim_event ev)    {        switch ( ev.get_tag() )        {            case GridSimTags.PKT_FORWARD:            case GridSimTags.JUNK_PKT:                processNetPacket( ev, ev.get_tag() );                break;            case GridSimTags.ROUTER_AD:                receiveAd(ev);                break;            case GridSimTags.SCHEDULER_DEQUE:                this.dequeue(ev);                break;            default:                System.out.println(super.get_name() + ".body(): Unable to " +                        "handle request from GridSimTags " +                        "with constant number " + ev.get_tag() );                break;        }    }    /**     * Processes incoming network packets, one at a time.     * The incoming packet will be split up into smaller pieces if     * the packet size > MTU of the other end.     *     * @param ev    a Sim_event object     * @pre ev != null     * @post $none     */    private synchronized void processNetPacket(Sim_event ev, int tag)    {        double nextTime = 0;        Packet pkt = (Packet) ev.get_data();        PacketScheduler sched = getScheduler(pkt);        // if a packet scheduler is not found, then try reschedule this packet        // in the future        if (sched == null)        {            System.out.println(super.get_name() + ".processNetPacket(): " +                "Warning - can't find a packet scheduler for " + pkt);            System.out.println("-> Will reschedule it again in the future.");            super.sim_schedule(super.get_id(), Router.DELAY, tag, pkt);            return;        }        // process ping() request        if (pkt instanceof InfoPacket)        {            ((InfoPacket) pkt).addHop( super.get_id() );            ((InfoPacket) pkt).addEntryTime( GridSim.clock() );            ((InfoPacket) pkt).addBaudRate(sched.getBaudRate());        }        // check downlink MTU, and split accordingly        String linkName = getLinkName( pkt.getDestID() );        Link downLink = (Link) Sim_system.get_entity(linkName);        int MTU = downLink.getMTU();        int numPackets = (int) Math.ceil(pkt.getSize() / (MTU * 1.0));        // log / record ....        if (super.reportWriter_ != null)        {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜久久久久久久久久久| 欧洲av在线精品| 国产亚洲综合在线| 国产乱淫av一区二区三区 | 色视频成人在线观看免| 亚洲情趣在线观看| 色伊人久久综合中文字幕| 亚洲视频一区在线| 欧美日韩在线播放三区四区| 性做久久久久久免费观看| 91精品国产综合久久久蜜臀图片| 日本亚洲三级在线| 久久精品在这里| 91视频国产资源| 天堂成人国产精品一区| 日韩精品中午字幕| 成人毛片老司机大片| 亚洲一区二区三区视频在线| 91精品国产乱| 国产69精品久久久久毛片| 亚洲欧洲中文日韩久久av乱码| 欧美剧在线免费观看网站| 老司机精品视频导航| 国产精品视频第一区| 欧洲另类一二三四区| 久久99国产精品尤物| 1区2区3区欧美| 日韩视频一区二区三区在线播放| 国产乱人伦偷精品视频免下载| 亚洲婷婷综合色高清在线| 91精品国产综合久久蜜臀| 国产二区国产一区在线观看| 亚洲男人天堂av网| 精品少妇一区二区三区日产乱码 | www.66久久| 香蕉av福利精品导航| 久久久久一区二区三区四区| 色综合久久久久综合体桃花网| 日本欧美在线观看| 日韩伦理av电影| 久久久久久久综合色一本| 在线观看日韩高清av| 国产精品香蕉一区二区三区| 亚洲第一精品在线| 中文字幕欧美一| 精品99久久久久久| 欧美日韩国产美女| 99久久精品一区二区| 精品一区二区三区av| 一区二区三区成人| 中文字幕高清不卡| 日韩欧美高清dvd碟片| 欧美亚洲一区三区| www.综合网.com| 国产美女一区二区三区| 偷拍亚洲欧洲综合| 亚洲综合一区二区| 亚洲视频电影在线| 男男gaygay亚洲| 亚洲一区二区av电影| 中文字幕一区二区在线播放| 久久久久97国产精华液好用吗| 69堂成人精品免费视频| 在线观看av不卡| 99精品视频在线免费观看| 国产99精品视频| 国产美女精品一区二区三区| 日本午夜一本久久久综合| 亚洲大片一区二区三区| 亚洲制服欧美中文字幕中文字幕| 一区精品在线播放| 国产精品福利一区| 国产精品久久久久7777按摩| 中文文精品字幕一区二区| 久久免费看少妇高潮| 精品成人佐山爱一区二区| 日韩一区二区不卡| 日韩一区二区三区观看| 日韩免费看的电影| 精品噜噜噜噜久久久久久久久试看 | 午夜精品久久久久| 亚洲va天堂va国产va久| 视频在线观看一区| 蜜臀av国产精品久久久久| 蜜臀av性久久久久蜜臀aⅴ流畅 | 亚洲另类春色国产| 最好看的中文字幕久久| 亚洲欧美自拍偷拍| 一区二区三区欧美| 亚洲第一狼人社区| 青青草97国产精品免费观看无弹窗版| 性欧美大战久久久久久久久| 丝袜美腿亚洲一区| 激情丁香综合五月| 国产精品91一区二区| 国产99久久精品| 色哟哟国产精品免费观看| 欧美日韩一区中文字幕| 91精品免费观看| 国产亚洲一区二区在线观看| 国产精品二三区| 亚洲一区电影777| 美女视频网站久久| 处破女av一区二区| 在线精品亚洲一区二区不卡| 欧美日韩成人综合天天影院| 日韩精品中文字幕在线一区| 国产清纯在线一区二区www| 亚洲免费观看高清完整版在线观看| 一区二区三区四区视频精品免费| 婷婷国产在线综合| 国产一区二区0| 91网站黄www| 欧美剧情片在线观看| 国产丝袜欧美中文另类| 一区二区三区中文字幕| 青椒成人免费视频| 成人黄色一级视频| 91精品国产黑色紧身裤美女| 欧美国产精品久久| 日韩专区在线视频| zzijzzij亚洲日本少妇熟睡| 777色狠狠一区二区三区| 国产亚洲自拍一区| 日本不卡一区二区| 91猫先生在线| 精品精品国产高清一毛片一天堂| 亚洲视频一区二区在线| 久久精品噜噜噜成人88aⅴ| 9l国产精品久久久久麻豆| 日韩欧美一级二级三级久久久| 成人免费小视频| 国产一区在线观看视频| 欧美日韩成人在线| 国产精品美女久久久久久久网站| 日产精品久久久久久久性色| 91麻豆视频网站| 精品在线一区二区| 欧美在线观看视频在线| 中文字幕精品一区二区精品绿巨人| 日韩国产成人精品| 91理论电影在线观看| 久久蜜桃av一区精品变态类天堂| 一区二区三区四区国产精品| 成人午夜视频福利| 亚洲精品一区二区三区四区高清| 亚洲综合一区在线| 91麻豆精品一区二区三区| 久久精品水蜜桃av综合天堂| 欧美aaaaaa午夜精品| 欧美色综合网站| 亚洲精品日韩综合观看成人91| 国产成人在线视频网址| 欧美成人福利视频| 蜜桃视频一区二区三区 | 五月综合激情婷婷六月色窝| 91片在线免费观看| 《视频一区视频二区| 粉嫩在线一区二区三区视频| 精品乱人伦小说| 久久不见久久见中文字幕免费| 欧美精品1区2区3区| 亚洲一区二区三区精品在线| 日本丶国产丶欧美色综合| 亚洲欧美激情小说另类| 99精品久久99久久久久| 国产精品夫妻自拍| 91在线丨porny丨国产| 亚洲啪啪综合av一区二区三区| av福利精品导航| 亚洲精品综合在线| 在线国产亚洲欧美| 视频一区欧美精品| 日韩欧美国产一区二区在线播放| 美国av一区二区| 亚洲精品一线二线三线无人区| 久久精品二区亚洲w码| 精品国产乱码久久久久久浪潮 | 精品国产亚洲一区二区三区在线观看| 日韩高清不卡一区二区三区| 欧美一区二区精品在线| 久久国产精品一区二区| 久久综合狠狠综合久久综合88| 日韩一区二区三区四区| 久久精品99久久久| 国产区在线观看成人精品| av一区二区三区| 亚洲一区二区三区四区在线| 9191精品国产综合久久久久久| 老司机精品视频线观看86| 久久久不卡网国产精品一区| av高清不卡在线| 午夜视频一区二区| 日韩欧美国产综合一区 | 麻豆精品蜜桃视频网站| 久久久99久久精品欧美| 成人av资源在线| 亚洲国产日产av| 久久综合精品国产一区二区三区 | 蜜乳av一区二区|