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

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

?? dynamicschedulerimpl.java.svn-base

?? 網絡模擬器
?? SVN-BASE
?? 第 1 頁 / 共 2 頁
字號:
package jns.dynamic;

/**
 * dynamic.DynamicSchedulerImpl.java
 *
 * This class allows for simple creation of a network of interconnected JNS nodes
 * with duplex links between them. It also allows for scheduling events dynamically
 * with the JNS simulator, through RMI calls. The main purpose of this class is to
 * be an RMI gateway for the fake.net.MulticastSocket classes used to test java implementations
 * of network protocols.
 *
 * @author Einar Vollset <einar.vollset@ncl.ac.uk>
 *
 */

import jns.Simulator;
import jns.agent.Agent;
import jns.command.StopCommand;
import jns.element.*;
import jns.trace.JavisTrace;
import jns.trace.Trace;
import jns.util.IPAddr;
import jns.util.Protocols;
import jns.util.Queue;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;
import java.util.Enumeration;
import java.util.Set;

/**
 * This is the main class used to dynamically schedule events to the JNS
 * network simulator.
 * It will start the *modified* simulator, and then any event that gets
 * passed to it will be scheduled with it.
 * This will allow (hopefully) for "real" implementations of network protocols
 * to be simulated for correctness.
 *
 * To use this class, you need to add the nodes and links to the scheduler in the
 * main() function below, alternatively you can write your own main()..
 * (Remember to rmic the class!)
 *
 * Beware! This class has a narrow functionality, as I have implemented it for
 * my own purposes... :-D
 *
 *
 */
public class DynamicSchedulerImpl extends UnicastRemoteObject implements DynamicScheduler, Agent
{

    /**
     * This is a reference to the JNS simulator instance. This needs to
     * get passed to the
     */
    private Simulator m_simulator = null;

    /**
     * This is the Trace used to write the JVS file for use with Javis (or NAM)
     */
    private Trace m_trace = null;

    /**
     * This is a hashmap of message queues mapped onto the IP address of the
     * node which sent it.
     */
    private HashMap m_msgQueues = null;

    /**
     * This is a hashmap of the nodes in the simulator
     */
    private HashMap m_nodes = null;

    /**
     * The bandwidth of the links in this simulation
     */
    private int m_bandwidth;

    /**
     * The error rate of the links in this simulation
     */
    private double m_errorRate;

    /**
     * The link delay in this simulation
     */
    private double m_delay;

    /**
     * This holds a hashmap of all the links created.
     */
    private HashMap m_links = null;

    /**
     * This is the subnet mask used.
     */
    private IPAddr m_subnetMask = null;

    /**
     * This is the time the simulator was started
     */
    private double m_startTime;

    /**
     * This determines if the simulation has started, in which no more nodes can be
     * added to the simulation run
     */
    private boolean m_started = false;


    /**
     * Constructs a new dynamic.DynamicSchedulerImpl
     *
     * @param nameOfRun The name of this simulation run. Gives name to the JVS file.
     * @param linkBandwidth The bandwidth of all the links between the nodes (could change this to set it for each link added)
     * @param linkDelay The link delay of all the links between the nodes (could change this to set it for each link added)
     * @param linkErrorRate The link error rate of all the links between the nodes (could change this to set it for each link added)
     * @param subnetMask The subnet mask of all the routes given to the nodes (could change this to set it for each link added)
     */
    public DynamicSchedulerImpl(String nameOfRun, int linkBandwidth, double linkDelay, double linkErrorRate, IPAddr subnetMask) throws RemoteException
    {
        m_simulator = Simulator.getInstance();
        try
        {
            m_trace = new JavisTrace(nameOfRun + ".jvs");
        }
        catch(IOException e)
        {
            System.err.println("Could not create " + nameOfRun + ".jvs!");
            e.printStackTrace();
            System.exit(-1);
        }
        m_simulator.setTrace(m_trace);
        m_msgQueues = new HashMap();
        m_nodes = new HashMap();
        m_bandwidth = linkBandwidth;
        m_delay = linkDelay;
        m_errorRate = linkErrorRate;
        m_links = new HashMap();
        m_subnetMask = subnetMask;


    }

    /**
     * Adds a node to the simulator. The IP address is used as both
     * name and IP address.
     * This method can currently not be called remotely
     */
    public void addNode(IPAddr IPAddress)
    {
        if(m_started)
        {
            System.err.println("Can't add nodes after the simulation has started..");
            return;
        }
        //Create the node
        Node node = new Node(IPAddress.toString());
        //Attach to the simulator
        m_simulator.attachWithTrace(node, m_trace);
        //Create a queue of messages destined for the external node
        Queue incoming = new Queue();
        //Add the queue to the hashmap of incoming quueues
        m_msgQueues.put(IPAddress.toString(), incoming);
        //Attach the dynamic Scheduler (this) as the "higher level agent", so messages
        //can be passed up to it.
        node.attach(this, Protocols.UDP);
         //Add to hashmap of nodes
        m_nodes.put(IPAddress.toString(), node);

    }

    /**
     * Adds a link between the two nodes. Beware that this is a
     * two way link, so there is no need to add a link "the other way"
     * This method can currently not be called remotely
     *
     * @param nodeA The IP address of the first node to connect
     * @param nodeB The IP address of the second node to connect
     */
    public void addLink(IPAddr nodeA, IPAddr nodeB)
    {

        String linkName = nodeA.toString() + "-" + nodeB.toString();
        String invLinkName = nodeB.toString() + "-" + nodeA.toString();
        Node a = (Node) m_nodes.get(nodeA.toString());
        Node b = (Node) m_nodes.get(nodeB.toString());

        //First check that the nodes are there
        if(a == null || b == null)
        {
            System.err.println("Trying to add a link between two nodes (" + linkName + "), one or more which does not exits.");
            return;
        }

        //Now check that the link does not already exist.
        if(m_links.get(linkName) != null || m_links.get(invLinkName) != null)
        {
            System.err.println("Duplicate link: " + linkName + ". Link not added.");
            return;
        }

        //Need to create an interface on either node.
        Interface a2b = new DuplexInterface(nodeA);
        a.attach(a2b);
        m_simulator.attachWithTrace(a2b, m_trace);

        Interface b2a = new DuplexInterface(nodeB);
        b.attach(b2a);
        m_simulator.attachWithTrace(b2a, m_trace);

        //Then create the link
        Link link = new DuplexLink(m_bandwidth, m_delay, m_errorRate);

        //Attach the link to either interface
        a2b.attach(link, true);
        b2a.attach(link, true);

        //attach the link to the simulator
        m_simulator.attachWithTrace(link, m_trace);

        //Add the link to m_links
        m_links.put(linkName, link);

        //And finally add route between the two.
        a.addRoute(nodeB, m_subnetMask, a2b);
        b.addRoute(nodeA, m_subnetMask, b2a);


    }


    /**
     * This method schedules a sending of a given packet of data (an object) from
     * one node to the other. The sending is scheduled to happen at
     * (System.currentTimeMillis() - Time of start of simulator)
     */
    public synchronized void scheduleUnicast(InetAddress senderIPAddress, InetAddress receiverIPAddress, byte[] data) throws RemoteException
    {

        IPAddr senderIPAddr = new IPAddr(senderIPAddress);
        IPAddr receiverIPAddr = new IPAddr(receiverIPAddress);

        // Firsy check that the two nodes exist in the simulator..
        Node sender = (Node) m_nodes.get(senderIPAddr.toString());
        Node receiver = (Node) m_nodes.get(receiverIPAddr.toString());

        if(sender == null)
        {
            System.err.println("Trying to send a packet FROM a non-existant node: " + senderIPAddr);
            return;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
thepron国产精品| 久久精品国产免费看久久精品| av不卡一区二区三区| 国产欧美一区二区精品性色| eeuss国产一区二区三区| 亚洲日本va午夜在线影院| 一本到不卡精品视频在线观看| 一级中文字幕一区二区| 51精品久久久久久久蜜臀| 免费一级片91| 亚洲天堂免费在线观看视频| 色婷婷激情久久| 午夜视频在线观看一区二区三区| 日韩欧美一区二区免费| 国产麻豆精品视频| 亚洲欧美乱综合| 91精品国产色综合久久不卡电影 | 国产视频一区二区在线观看| 国产成人精品aa毛片| 一区二区免费在线播放| 3atv一区二区三区| 国产二区国产一区在线观看| 日韩毛片高清在线播放| 这里只有精品视频在线观看| 国内精品嫩模私拍在线| 亚洲欧洲精品成人久久奇米网| 91成人国产精品| 国产一区二区女| 亚洲第一成年网| 中文一区二区完整视频在线观看| 欧美体内she精视频| 国产一区视频网站| 亚洲不卡av一区二区三区| 国产亚洲自拍一区| 欧美日本韩国一区| 99re这里只有精品6| 久久激五月天综合精品| 一区二区三区四区国产精品| 精品欧美一区二区久久| 在线视频欧美精品| 福利一区在线观看| 青青草视频一区| 亚洲女同ⅹxx女同tv| 久久久久久电影| 欧美一卡2卡三卡4卡5免费| 91年精品国产| 豆国产96在线|亚洲| 久88久久88久久久| 天堂成人免费av电影一区| 国产精品视频看| 精品电影一区二区三区 | 99久久精品免费看国产| 精品一区二区三区香蕉蜜桃| 日一区二区三区| 一区二区三区中文在线观看| 国产精品乱码一区二三区小蝌蚪| 精品毛片乱码1区2区3区 | 欧美综合亚洲图片综合区| 国产成人精品免费| 韩国午夜理伦三级不卡影院| 日本三级韩国三级欧美三级| 亚洲一区二区三区四区五区中文| 国产精品美女久久久久久久| 日韩美女久久久| 久久女同精品一区二区| 精品免费国产一区二区三区四区| 欧美福利一区二区| 欧美日韩在线观看一区二区| 色偷偷一区二区三区| 成人免费高清视频在线观看| 国产风韵犹存在线视精品| 国产精品一卡二卡在线观看| 国产真实乱偷精品视频免| 久久成人综合网| 免费观看成人av| 狠狠色丁香九九婷婷综合五月| 免费国产亚洲视频| 全部av―极品视觉盛宴亚洲| 麻豆精品新av中文字幕| 捆绑变态av一区二区三区| 久久99精品国产麻豆婷婷| 久久国产精品无码网站| 美女视频第一区二区三区免费观看网站| 偷窥少妇高潮呻吟av久久免费| 婷婷丁香激情综合| 麻豆精品新av中文字幕| 国产一区二区导航在线播放| 国产99一区视频免费| 99免费精品在线观看| 欧美午夜宅男影院| 日韩一级免费观看| 337p粉嫩大胆色噜噜噜噜亚洲| 国产日韩精品一区二区三区 | 国产乱人伦精品一区二区在线观看 | 色婷婷久久久综合中文字幕| 91美女片黄在线观看| 欧美日韩一区二区三区在线 | 国产综合成人久久大片91| 国产成人99久久亚洲综合精品| 北条麻妃国产九九精品视频| 91国内精品野花午夜精品| 欧美二区三区91| 久久婷婷国产综合精品青草| 中文成人av在线| 亚洲va韩国va欧美va| 国产在线精品一区二区不卡了| 国产69精品久久久久777| 在线观看视频91| 精品女同一区二区| 亚洲激情一二三区| 美腿丝袜一区二区三区| 99久久久无码国产精品| 欧美精品精品一区| 中文成人av在线| 日韩激情视频网站| av在线不卡网| 国产精品五月天| 亚洲成人中文在线| 久久国产剧场电影| 在线观看亚洲一区| 国产情人综合久久777777| 亚洲精品水蜜桃| 九九**精品视频免费播放| 91精品1区2区| 国产欧美久久久精品影院| 亚洲成va人在线观看| 成人一区二区三区视频在线观看| 欧美亚洲一区三区| 国产欧美精品一区二区色综合| 亚洲成人av一区二区三区| 国产成人午夜电影网| 欧美高清视频不卡网| 国产精品色哟哟网站| 免费成人在线网站| 在线观看国产精品网站| 国产视频一区不卡| 日韩二区在线观看| 欧美综合色免费| 中文字幕中文字幕一区二区| 久久91精品久久久久久秒播| 欧美日韩免费一区二区三区视频| 国产精品久久一卡二卡| 国产在线观看一区二区| 欧美一区二区视频网站| 一区二区三区在线免费播放| 粉嫩绯色av一区二区在线观看| 欧美军同video69gay| 综合中文字幕亚洲| 国产精品影视天天线| 日韩小视频在线观看专区| 亚洲自拍偷拍九九九| 99精品视频在线播放观看| 日本一区二区三区视频视频| 黄色日韩三级电影| 欧美一级精品大片| 日韩精品欧美成人高清一区二区| 色拍拍在线精品视频8848| 中文字幕一区二区三区乱码在线 | 日韩精品一区二区三区swag| 午夜av一区二区三区| 欧美日韩精品免费观看视频 | 日韩视频在线一区二区| 丝袜亚洲另类欧美综合| 欧美手机在线视频| 亚洲国产精品影院| 欧美日韩精品福利| 免费在线观看精品| 精品国产一区二区在线观看| 国产一区二区三区久久悠悠色av| 精品国产乱码久久久久久免费| 美女久久久精品| 亚洲精品一区二区三区99 | 波多野结衣在线一区| 亚洲成人免费观看| 欧美中文字幕一区二区三区| 一区二区三区鲁丝不卡| 欧美系列在线观看| 天使萌一区二区三区免费观看| 欧美一区二区三区四区久久| 美日韩一级片在线观看| 精品成人一区二区| 懂色av中文字幕一区二区三区 | 日韩精品一区二区三区四区视频| 精品午夜久久福利影院| 久久久久国产一区二区三区四区| 国产一区二区不卡在线| 亚洲欧美综合在线精品| 欧美三级在线播放| 裸体健美xxxx欧美裸体表演| 久久精品人人做人人综合| 成人av电影免费在线播放| 亚洲精品va在线观看| 日韩天堂在线观看| 国产91色综合久久免费分享| 一区二区在线观看视频在线观看| 91精品国产乱| 成人动漫中文字幕| 亚洲成人午夜影院| 国产午夜亚洲精品羞羞网站| 91激情五月电影|