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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? riprouter.java

?? 實現(xiàn)網(wǎng)格環(huán)境下資源調(diào)度和分配的仿真
?? 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 * * RIPRouter.java - Simulates a network router with RIP as the advertising * protocol * */package gridsim.net;import eduni.simjava.*;import gridsim.*;import gridsim.util.*;import java.util.*;/** * 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 3.1 * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore */public class RIPRouter extends Router{    private Hashtable linkTable;    private Hashtable schedTable; // table of schedulers    private Hashtable hostTable;    private Hashtable routerTable;    private Hashtable forwardTable;    private int id;    private static final int BITS = 8;     // 1 byte in bits    /**     * Creates a new RIPRouter 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 #RIPRouter(String, boolean)}.     *     * @param name Name of this router     * @throws NullPointerException This happens when name is empty or null     * @see #RIPRouter(String, boolean)     * @pre name != null     * @post $none     */    public RIPRouter(String name) throws NullPointerException {        this(name, false);    }    /**     * Creates a new RIPRouter object with logging facility if it is turned on.     * <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     * @pre name != null     * @post $none     */    public RIPRouter(String name, boolean trace) throws NullPointerException    {        super(name, trace);        init();    }    /**     * Initialises all variables     * @pre $none     * @post $none     */    private void init()    {        this.id = super.get_id();        linkTable = new Hashtable();        hostTable = new Hashtable();        routerTable = new Hashtable();        forwardTable = new Hashtable();        schedTable = new Hashtable();    }    /**     * Informs the registered entities regarding to the end of a simulation.     * @pre $none     * @post $none     */    protected void processEndSimulation() {        // ... empty - maybe need to clean up all the hashtables    }    /**     * 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() );        // 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() );        link.attach(this, entity);        linkTable.put( entity.get_name(), link.get_name() );        if (!schedTable.containsKey( link.get_name() )) {            schedTable.put(link.get_name(), sched);        }        hostTable.put( link.get_name(), entity.get_name() );        // 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.INSIGNIFICANT:                processInternalEvent(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(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));        // if no packets at the moment        if (sched.size() == 0)        {            if (numPackets == 1) {                nextTime = (pkt.getSize() * BITS) / sched.getBaudRate();            }            else {                nextTime = (MTU * BITS * 1.0) / sched.getBaudRate();            }            sendInternalEvent(nextTime, sched);        }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品区一区二区三| 精品国产91洋老外米糕| 久久成人久久爱| 亚洲视频一区二区在线观看| 欧美一级xxx| 91激情在线视频| 国产精品69毛片高清亚洲| 亚洲国产精品麻豆| 国产精品亲子乱子伦xxxx裸| 欧美一区二区三区精品| 91视频com| 成人综合婷婷国产精品久久蜜臀 | 亚洲精品一区二区三区香蕉| 色天使久久综合网天天| 国产大陆精品国产| 极品瑜伽女神91| 婷婷六月综合网| 一区二区三区国产精华| 国产精品国产a| 久久色.com| 精品剧情v国产在线观看在线| 欧美日韩久久不卡| 91豆麻精品91久久久久久| www.视频一区| 丁香激情综合国产| 国产成人精品综合在线观看| 久久99精品久久久久久国产越南| 亚洲成人黄色小说| 亚洲在线中文字幕| 亚洲男同性视频| 一级精品视频在线观看宜春院 | 国产91精品在线观看| 美女mm1313爽爽久久久蜜臀| 偷窥国产亚洲免费视频| 亚洲电影第三页| 亚洲国产精品自拍| 午夜天堂影视香蕉久久| 亚洲午夜精品网| 亚洲图片一区二区| 亚洲线精品一区二区三区| 一区二区三区四区不卡在线| 亚洲免费电影在线| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲美女区一区| 亚洲一二三区在线观看| 偷拍日韩校园综合在线| 蜜乳av一区二区三区| 国产主播一区二区三区| 国产精品小仙女| 91在线视频网址| 在线免费观看日本欧美| 欧美日韩你懂得| 欧美一区二区三区的| 精品久久国产老人久久综合| 精品久久国产老人久久综合| 中文子幕无线码一区tr| 亚洲视频一二三| 亚洲乱码国产乱码精品精的特点| 亚洲色图视频网站| 亚洲一区二区免费视频| 奇米888四色在线精品| 精品一区二区在线免费观看| 国产精品一区二区久激情瑜伽| 丁香五精品蜜臀久久久久99网站| 91在线免费看| 欧美福利视频导航| 欧美精品一区二区三区四区| 亚洲欧洲精品天堂一级| 午夜电影网一区| 国产精品一区在线| 91免费视频网| 欧美一区二视频| 国产精品久久久久影院老司| 亚洲午夜免费福利视频| 国产乱人伦精品一区二区在线观看| 91网站视频在线观看| 51精品久久久久久久蜜臀| 久久久久久久久久电影| 亚洲三级在线免费观看| 喷水一区二区三区| 不卡的看片网站| 欧美一区2区视频在线观看| 亚洲一级二级三级| 国模无码大尺度一区二区三区| 99r国产精品| 精品精品欲导航| 亚洲女厕所小便bbb| 精品一区二区三区视频 | 欧美视频精品在线| 精品国产髙清在线看国产毛片| 中文字幕一区二区三区在线观看| 青椒成人免费视频| 色国产精品一区在线观看| 精品国产成人系列| 一区二区三区精品久久久| 国产成人亚洲综合a∨婷婷图片| 欧美日韩精品一二三区| 亚洲欧洲精品一区二区精品久久久 | 亚洲成人av在线电影| 国产成人免费视| 欧美一区二区播放| 亚洲一本大道在线| av资源网一区| 国产拍揄自揄精品视频麻豆| 日韩av一区二区三区| 色国产精品一区在线观看| 国产欧美综合色| 男男成人高潮片免费网站| 在线视频观看一区| 亚洲欧美中日韩| 国产成人免费在线| 精品福利在线导航| 麻豆国产欧美一区二区三区| 欧美性感一区二区三区| 亚洲色大成网站www久久九九| 国产成人免费视频| 久久日韩精品一区二区五区| 久久精品99久久久| 欧美久久久久久蜜桃| 亚洲成人高清在线| 91福利在线导航| 亚洲精品免费电影| 91在线视频免费观看| 亚洲天堂网中文字| 波多野洁衣一区| 中文字幕第一区| 不卡电影一区二区三区| 国产精品伦理在线| 成人一区二区三区视频在线观看| 久久久精品日韩欧美| 国产原创一区二区三区| 精品少妇一区二区三区免费观看| 奇米在线7777在线精品| 日韩小视频在线观看专区| 麻豆精品在线看| 欧美大片在线观看一区二区| 精品中文字幕一区二区| 久久综合一区二区| 国产美女视频91| 国产亚洲自拍一区| 高潮精品一区videoshd| 国产精品女同一区二区三区| 7777精品伊人久久久大香线蕉完整版| 亚洲精品国产精华液| 在线视频国内自拍亚洲视频| 亚洲高清在线视频| 日韩午夜精品视频| 国产主播一区二区| 国产精品久久777777| 一本色道久久加勒比精品| 亚洲一区二区三区免费视频| 欧美精品黑人性xxxx| 久久精品国产一区二区三区免费看| 日韩精品一区二区在线观看| 国产一区二区三区精品视频| 国产精品热久久久久夜色精品三区| 99国产精品视频免费观看| 亚洲福利视频一区二区| 日韩欧美精品在线视频| 国产成人精品亚洲777人妖| 亚洲欧美另类久久久精品| 欧美日韩国产三级| 国产一区视频网站| 最新国产成人在线观看| 欧美日本乱大交xxxxx| 极品美女销魂一区二区三区| 国产精品免费久久久久| 欧美精品视频www在线观看| 国产剧情一区二区三区| 亚洲欧美日本在线| 欧美一级夜夜爽| 成人av先锋影音| 日本三级韩国三级欧美三级| 久久精品男人天堂av| 色噜噜狠狠成人网p站| 蜜桃精品视频在线| 亚洲色图丝袜美腿| 精品免费视频一区二区| 99久久精品99国产精品 | 午夜视频在线观看一区| 久久久久国产精品厨房| 在线欧美日韩国产| 国产精品99久久久久久似苏梦涵| 亚洲精品乱码久久久久久黑人| 日韩欧美一级特黄在线播放| 一本色道久久综合精品竹菊 | 欧美性大战久久久| 国产一区二区导航在线播放| 亚洲综合图片区| 国产亚洲女人久久久久毛片| 欧美日韩小视频| 大陆成人av片| 久久er99精品| 亚洲电影视频在线| 国产精品超碰97尤物18| 精品福利一二区| 在线播放视频一区| 99精品在线免费| 国产精品亚洲综合一区在线观看| 亚洲va欧美va天堂v国产综合|