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

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

?? riprouter.java

?? 中間件開發(fā)詳細(xì)說明:清華大學(xué)J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會員下載此源碼] [成為VIP會
?? 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小视频在线观看| 免费人成黄页网站在线一区二区| 国产精品久久久久久久久晋中| 91麻豆精品国产自产在线| 成人av动漫网站| 蜜臀av一区二区在线免费观看| 自拍视频在线观看一区二区| 欧美精品一区二| 欧美午夜一区二区三区免费大片| 国产成人精品三级| 捆绑调教一区二区三区| 亚洲国产精品嫩草影院| 亚洲女爱视频在线| 国产精品欧美一区二区三区| 精品国产在天天线2019| 欧美一区二区精品久久911| 色婷婷久久一区二区三区麻豆| 成人自拍视频在线| 黄色成人免费在线| 日韩av网站在线观看| 亚洲成人1区2区| 亚洲高清一区二区三区| 亚洲另类色综合网站| 中文字幕一区二区三区蜜月| 久久嫩草精品久久久精品| 26uuu久久综合| 久久亚洲欧美国产精品乐播| 久久香蕉国产线看观看99| 日韩欧美一区二区免费| 欧美一区二区三级| 日韩一级大片在线观看| 日韩欧美中文字幕一区| 91精品欧美一区二区三区综合在 | 亚洲精品在线观| 日韩一区二区在线观看| 91精品久久久久久久久99蜜臂| 在线播放91灌醉迷j高跟美女 | 亚洲一区二区三区中文字幕在线| 亚洲色图19p| 亚洲女与黑人做爰| 亚洲观看高清完整版在线观看 | 麻豆国产精品一区二区三区| 亚洲电影一级黄| 天使萌一区二区三区免费观看| 亚洲v中文字幕| 日韩不卡一区二区三区| 激情综合网天天干| 国产激情一区二区三区| 成人爱爱电影网址| 欧美天天综合网| 91精品国产高清一区二区三区| 欧美一级日韩一级| 精品久久国产字幕高潮| 欧美国产视频在线| 亚洲欧美一区二区久久| 亚洲超碰97人人做人人爱| 日韩精品一二三四| 国产中文一区二区三区| 99精品桃花视频在线观看| 欧美优质美女网站| 日韩三级视频在线看| 中文字幕第一页久久| 亚洲激情图片qvod| 日韩国产精品久久久| 国产寡妇亲子伦一区二区| 91在线视频播放| 制服丝袜av成人在线看| 国产视频911| 亚洲国产欧美在线| 国产一区二区三区久久悠悠色av| 不卡视频在线观看| 欧美日韩免费电影| 久久色中文字幕| 亚洲午夜精品久久久久久久久| 毛片av一区二区三区| 99久久久精品免费观看国产蜜| 欧美猛男男办公室激情| 国产亚洲综合在线| 丝袜亚洲精品中文字幕一区| 国产成人亚洲综合a∨猫咪| 91国偷自产一区二区三区观看 | 欧美精品视频www在线观看| 久久婷婷一区二区三区| 亚洲一区二区在线播放相泽 | 精品一区二区免费| 色婷婷综合激情| 久久久av毛片精品| 婷婷综合五月天| 99精品黄色片免费大全| 精品乱人伦小说| 亚洲国产一区二区视频| 成人黄色网址在线观看| 制服视频三区第一页精品| 亚洲欧美aⅴ...| 成人亚洲一区二区一| 日韩欧美国产麻豆| 一卡二卡三卡日韩欧美| 成人免费黄色大片| 精品免费视频一区二区| 亚洲电影一级黄| 色视频成人在线观看免| 中文字幕成人av| 国内成人免费视频| 欧美二区乱c少妇| 一区二区日韩av| 97国产一区二区| 国产欧美日韩麻豆91| 激情图片小说一区| 欧美日韩电影一区| 一区二区三区日韩欧美| 99免费精品视频| 国产女人水真多18毛片18精品视频| 麻豆国产精品官网| 91精品国产综合久久福利软件| 亚洲精品水蜜桃| 91视频在线看| 综合婷婷亚洲小说| av电影在线观看一区| 中文字幕精品在线不卡| 国产成人亚洲综合色影视| 久久蜜桃一区二区| 国产一级精品在线| 久久午夜老司机| 国产精品一区在线| 国产亚洲人成网站| 国产69精品久久久久777| 国产喷白浆一区二区三区| 国产一区 二区 三区一级| 久久久噜噜噜久噜久久综合| 精品亚洲aⅴ乱码一区二区三区| 欧美大片顶级少妇| 国产一区二区在线观看视频| 精品久久久网站| 国产高清久久久久| 国产嫩草影院久久久久| av激情亚洲男人天堂| 亚洲精品成人精品456| 在线观看日韩电影| 亚洲成va人在线观看| 欧美一区二区日韩一区二区| 麻豆精品视频在线观看视频| 2023国产精品| 大胆欧美人体老妇| 亚洲美女淫视频| 欧美亚洲自拍偷拍| 青青草精品视频| 久久亚洲精品国产精品紫薇| 国产成人在线视频网址| 国产精品毛片无遮挡高清| 日本韩国欧美在线| 午夜精品久久久久久久99水蜜桃 | 亚洲欧美自拍偷拍| 在线免费不卡视频| 日本午夜一区二区| 精品久久一区二区三区| 成人综合日日夜夜| 亚洲高清免费视频| 欧美mv和日韩mv的网站| 成人av先锋影音| 亚洲一区二区影院| 精品福利在线导航| av在线不卡网| 日韩国产精品91| 中文av字幕一区| 欧美三级在线视频| 国产精品一二三区在线| 亚洲人成7777| 欧美电影免费观看高清完整版在 | 色国产综合视频| 免费人成黄页网站在线一区二区| 亚洲国产精品成人综合 | 国产成人av一区二区三区在线| 国产精品久久久久久久第一福利| 欧美日韩大陆一区二区| 国产一区二区三区高清播放| 亚洲精品日产精品乱码不卡| 欧美大片国产精品| 在线观看日韩av先锋影音电影院| 九九久久精品视频| 亚洲永久精品大片| 国产人伦精品一区二区| 在线成人高清不卡| eeuss鲁片一区二区三区在线观看| 日韩极品在线观看| 亚洲欧洲精品一区二区精品久久久| 欧美精品三级日韩久久| 99精品视频在线播放观看| 久久激五月天综合精品| 亚洲一二三四在线观看| 国产欧美一区二区精品性色| 欧美精品乱码久久久久久按摩| 成人激情免费视频| 精品一二三四区| 秋霞午夜av一区二区三区| 亚洲日本va在线观看| 欧美激情中文字幕一区二区| 91精品国产乱码久久蜜臀| 欧洲亚洲国产日韩|