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

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

?? riprouter.java

?? 中間件開發詳細說明:清華大學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);        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区二区电影| 香蕉影视欧美成人| 国产又黄又大久久| 日韩欧美国产综合一区| 毛片一区二区三区| 久久精品视频免费| 国产成人啪免费观看软件| 国产精品亲子乱子伦xxxx裸| 99视频在线观看一区三区| 国产精品久久久久7777按摩 | 欧美午夜精品免费| 亚洲成av人片观看| 欧美一级搡bbbb搡bbbb| 国产一区二区三区综合| 亚洲欧洲精品一区二区三区不卡| 91亚洲精品久久久蜜桃| 亚洲第一会所有码转帖| 欧美va在线播放| www.性欧美| 性久久久久久久久| 国产调教视频一区| 欧美亚洲另类激情小说| 看片的网站亚洲| 国产精品久久久久久久蜜臀| 在线免费观看视频一区| 久久精品噜噜噜成人av农村| 国产欧美1区2区3区| 欧美色图在线观看| 国产在线播放一区| 亚洲激情第一区| 精品三级在线看| 色综合天天综合给合国产| 日韩黄色片在线观看| 国产精品私房写真福利视频| 在线观看91精品国产入口| 国内精品伊人久久久久av影院| 亚洲欧美成aⅴ人在线观看| 日韩免费视频线观看| 色噜噜久久综合| 久久 天天综合| 亚洲综合在线第一页| 欧美精品一区二区三| 欧美日韩和欧美的一区二区| 国产成都精品91一区二区三| 午夜视频在线观看一区| 国产精品久久网站| 日韩美女视频一区二区在线观看| 91女神在线视频| 韩国一区二区在线观看| 午夜精品一区二区三区免费视频| 中文字幕第一区综合| 日韩视频一区在线观看| 色素色在线综合| 国产69精品久久久久777| 日韩精品一级中文字幕精品视频免费观看 | 久久青草国产手机看片福利盒子 | 久久亚洲一级片| 欧美群妇大交群中文字幕| av在线不卡观看免费观看| 久久不见久久见免费视频7| 午夜精品视频一区| 午夜影院在线观看欧美| 亚洲猫色日本管| 欧美国产在线观看| 久久欧美中文字幕| 精品久久久久久久人人人人传媒 | 91亚洲精品乱码久久久久久蜜桃| 国产精品一区免费在线观看| 美女一区二区视频| 日韩av不卡一区二区| 亚洲成av人片在www色猫咪| 亚洲午夜精品久久久久久久久| 国产精品国产三级国产aⅴ中文| 久久伊99综合婷婷久久伊| 欧美一级淫片007| 欧美丰满少妇xxxbbb| 欧美日韩高清一区二区| 欧美人妖巨大在线| 在线播放视频一区| 欧美一级黄色片| 欧美一级理论片| 久久久久亚洲综合| 亚洲国产精品黑人久久久| 中文字幕国产一区| 国产精品久久777777| 亚洲日本欧美天堂| 亚洲精品视频在线| 亚洲国产欧美日韩另类综合 | 欧美一区二区久久| 日韩欧美国产综合一区| 久久免费视频色| 亚洲国产精品ⅴa在线观看| 亚洲视频一区在线| 亚洲综合色丁香婷婷六月图片| 亚洲一区二区三区四区的| 亚洲18女电影在线观看| 美美哒免费高清在线观看视频一区二区| 另类小说视频一区二区| 国产一区二区精品久久| av一区二区三区黑人| 欧洲在线/亚洲| 欧美tk丨vk视频| 国产精品久久久久影院老司| 亚洲一级片在线观看| 日韩在线一二三区| 国产河南妇女毛片精品久久久| 丁香桃色午夜亚洲一区二区三区| 91老司机福利 在线| 9191久久久久久久久久久| 亚洲一区二区成人在线观看| 日韩在线一区二区| 国产91精品精华液一区二区三区 | 欧美精品1区2区| 日韩免费在线观看| 亚洲视频小说图片| 毛片av一区二区| 91蝌蚪porny成人天涯| 欧美一区二区人人喊爽| 中文字幕国产精品一区二区| 亚洲国产精品久久艾草纯爱 | 亚洲欧洲成人自拍| 日韩精品一二三区| 高清免费成人av| 欧美日本韩国一区| 国产夜色精品一区二区av| 亚洲精品美国一| 国产一区二区调教| 欧美日韩精品一区二区三区四区| 亚洲国产成人91porn| 日韩欧美一区在线| 一区二区三区四区乱视频| 亚洲激情av在线| 亚洲欧美偷拍三级| 久久精品免费观看| 欧美视频在线播放| 欧美亚洲综合另类| 亚洲成人激情综合网| 欧美在线一区二区| 亚洲国产日韩一级| 91精品国产综合久久香蕉麻豆| 亚洲一级二级三级在线免费观看| 欧美三级在线看| 天天操天天色综合| 日韩亚洲欧美成人一区| 伦理电影国产精品| 精品国产成人系列| 国产成人激情av| 1000部国产精品成人观看| 色综合天天天天做夜夜夜夜做| 亚洲乱码一区二区三区在线观看| 日本高清不卡视频| 亚洲在线视频网站| 777欧美精品| 制服丝袜亚洲播放| 秋霞国产午夜精品免费视频| 欧美电影免费观看高清完整版在 | 久久99精品国产麻豆婷婷洗澡| 日韩一区二区三区在线| 国产一区二区中文字幕| 国产精品视频免费看| 91在线观看下载| 亚洲mv大片欧洲mv大片精品| 日韩一卡二卡三卡国产欧美| 国产九九视频一区二区三区| 国产精品入口麻豆原神| 91成人免费在线| 日本视频一区二区| 国产精品女主播av| 欧美午夜电影在线播放| 老汉av免费一区二区三区| 国产精品国产三级国产三级人妇 | 亚洲综合999| 精品少妇一区二区三区免费观看| 成人av动漫在线| 一个色妞综合视频在线观看| 日韩一区二区三区观看| 国产精品69毛片高清亚洲| 亚洲欧美日韩在线| 欧美一区二区三区四区久久| 国产精品一区二区视频| 亚洲精品视频在线观看网站| 精品美女被调教视频大全网站| av资源站一区| 青青草伊人久久| 亚洲图片激情小说| 日韩片之四级片| 91浏览器入口在线观看| 美日韩一区二区| 亚洲蜜臀av乱码久久精品蜜桃| 日韩午夜激情电影| 色域天天综合网| 国产一区二区看久久| 婷婷久久综合九色综合伊人色| 国产午夜亚洲精品午夜鲁丝片 | 成人免费高清在线| 手机精品视频在线观看| 国产精品久久三区| 久久香蕉国产线看观看99| 欧美日韩专区在线| jlzzjlzz亚洲日本少妇|