private void initNetwork(String name, double baudRate, Link link)
    {
        // Every GridSim entity with network has its own input/output channels.
        // Connect this entity "input" port to its input buffer "in_port"
        NetIO in = null;

        // Packet Level networking
        if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_PACKET_LEVEL)
        {
            in = new Input("Input_" + name, baudRate);
            out_ = new Output("Output_" + name, baudRate);
        }
        // Flow Level networking
        else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_FLOW_LEVEL)
        {
            in = new FlowInput("Input_" + name, baudRate);
            out_ = new FlowOutput("Output_" + name, baudRate);
        }
        // Use Finite network buffer
        else if (GridSimCore.NETWORK_TYPE == GridSimTags.NET_BUFFER_PACKET_LEVEL)
        {   
            in = new FnbInput("Input_" + name, baudRate);
            out_ = new FnbOutput("Output_" + name, baudRate);
        }

        Sim_system.link_ports(name, "input", "Input_" + name, "input_buffer");
        Sim_system.link_ports(name, "output", "Output_" + name, "output_buffer");
        if (link != null)
        {
            in.addLink(link);
            out_.addLink(link);
        }
    }