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

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

?? riprouter.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 * * 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);        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人午夜电影网| 国产亚洲制服色| 韩国欧美国产1区| 一区二区三区在线播| 欧美一二三四在线| caoporm超碰国产精品| 日韩av中文在线观看| 国产精品毛片大码女人| 欧美一区二区黄色| 欧美高清在线精品一区| 欧美巨大另类极品videosbest | 激情综合色播五月| 一区二区三区在线高清| 国产欧美综合在线| 日韩免费高清av| 欧美视频第二页| 91麻豆精品一区二区三区| 紧缚奴在线一区二区三区| 亚洲午夜激情av| 亚洲男人天堂av| 中文字幕精品一区| 久久日韩精品一区二区五区| 91麻豆精品国产91久久久使用方法| 99久久伊人精品| 粉嫩高潮美女一区二区三区| 久久99国产精品久久| 亚洲大型综合色站| 一区二区日韩av| 亚洲日本电影在线| 中文字幕亚洲视频| 国产精品青草久久| 中文字幕第一区二区| 久久久久97国产精华液好用吗| 日韩欧美一二三区| 精品久久久久久久久久久久包黑料| 欧美日韩精品一区二区在线播放| 欧美专区亚洲专区| 91久久人澡人人添人人爽欧美 | 国产成人免费9x9x人网站视频| 久久精品国产亚洲一区二区三区| 爽好久久久欧美精品| 亚洲韩国一区二区三区| 亚洲自拍偷拍综合| av一区二区三区| 丁香桃色午夜亚洲一区二区三区| 精品一区二区日韩| 国产乱码一区二区三区| 国产精品99久久久久久似苏梦涵| 韩国女主播一区二区三区| 国产一区欧美一区| 国产成人综合亚洲网站| 成人免费视频一区二区| caoporn国产一区二区| 色婷婷久久久久swag精品| 在线国产电影不卡| 67194成人在线观看| 日韩欧美123| 亚洲精品在线一区二区| 国产午夜精品一区二区三区嫩草| 国产免费久久精品| 亚洲乱码国产乱码精品精可以看| 一区二区高清在线| 日韩二区三区四区| 国产一区二区三区黄视频 | 91丨九色丨国产丨porny| 97久久超碰国产精品电影| 在线亚洲一区二区| 91精品国产综合久久小美女| 久久先锋影音av| 中文字幕一区在线| 亚洲成人1区2区| 国产乱码精品一区二区三| 99久久99久久精品国产片果冻| 在线一区二区三区四区| 日韩欧美久久久| 成人免费一区二区三区视频| 香蕉av福利精品导航| 国模无码大尺度一区二区三区| 不卡一区二区在线| 91精品国产综合久久国产大片| www日韩大片| 一区二区三区在线视频观看58| 日本中文字幕不卡| 成人蜜臀av电影| 欧美日韩另类国产亚洲欧美一级| 精品国产一区二区国模嫣然| 亚洲色欲色欲www| 九九**精品视频免费播放| av资源网一区| 日韩免费电影一区| 亚洲美腿欧美偷拍| 国产精品18久久久久久久网站| 在线一区二区三区四区五区| 国产色产综合色产在线视频| 亚洲一二三四在线观看| 国产精品91一区二区| 欧美精品亚洲二区| 国产精品不卡在线| 美脚の诱脚舐め脚责91| 91婷婷韩国欧美一区二区| 久久综合五月天婷婷伊人| 亚洲一区二区三区四区在线| 国产suv精品一区二区6| 91精品国产一区二区三区| 波多野结衣一区二区三区| 91精品国产综合久久精品app | 精品国产网站在线观看| 一区二区三区在线视频播放| 国产激情视频一区二区三区欧美 | 久久婷婷色综合| 亚洲bdsm女犯bdsm网站| 91在线你懂得| 欧美国产综合色视频| 美日韩一区二区| 欧美日韩一区三区四区| 亚洲欧洲精品天堂一级| 国产尤物一区二区| 777xxx欧美| 性感美女久久精品| 在线观看精品一区| 亚洲精品乱码久久久久久 | 国产成人在线免费观看| 日韩久久久久久| 人禽交欧美网站| 欧美酷刑日本凌虐凌虐| 亚洲乱码一区二区三区在线观看| 国产成人精品影视| 欧美国产激情一区二区三区蜜月| 美女视频黄a大片欧美| 91麻豆精品国产91久久久资源速度 | 日韩高清不卡一区| 69久久99精品久久久久婷婷| 午夜亚洲国产au精品一区二区| 91国内精品野花午夜精品| 夜夜精品浪潮av一区二区三区| 99久久国产免费看| 综合久久久久综合| 99精品在线免费| 亚洲黄色av一区| 色婷婷激情一区二区三区| 中文字幕一区二区三区色视频| 成人h动漫精品一区二区| 国产精品成人一区二区三区夜夜夜| 福利电影一区二区| 一区在线观看视频| 99国产欧美另类久久久精品| 亚洲女同女同女同女同女同69| 91在线观看免费视频| 亚洲精品视频一区| 欧美日韩国产三级| 日本 国产 欧美色综合| 26uuu国产电影一区二区| 国产精品乡下勾搭老头1| 国产欧美精品一区aⅴ影院| jlzzjlzz国产精品久久| 一区二区免费在线播放| 91精品国产乱码| 国产综合久久久久久久久久久久| 国产午夜精品久久| 99re成人精品视频| 天天av天天翘天天综合网| 日韩精品最新网址| 国产91精品一区二区| 亚洲女同ⅹxx女同tv| 亚洲美女视频在线| 欧美电影一区二区| 国产一区二区在线看| 国产精品免费视频一区| 欧美性猛片xxxx免费看久爱| 久久av中文字幕片| 国产精品免费看片| 精品视频在线免费看| 韩国av一区二区三区四区| 亚洲欧洲精品一区二区精品久久久 | 久久国产精品72免费观看| 国产亲近乱来精品视频| 99精品视频一区二区三区| 午夜视频一区在线观看| 国产午夜精品久久久久久免费视 | 亚洲一区在线观看网站| 日韩一卡二卡三卡国产欧美| 风间由美性色一区二区三区| 亚洲国产精品久久人人爱| 精品99999| 欧美三日本三级三级在线播放| 九九精品视频在线看| 亚洲综合免费观看高清完整版| 日韩欧美综合一区| 91天堂素人约啪| 国内偷窥港台综合视频在线播放| 亚洲三级免费观看| 日韩一区二区三区观看| 99在线精品一区二区三区| 麻豆91免费看| 一区二区三区在线不卡| 国产精品色哟哟网站| 日韩欧美中文字幕公布| 色菇凉天天综合网| 国产a区久久久| 日本va欧美va精品|