public static void main(String[] args) {

        DataGIS gis = null;
        TopRegionalRC rc = null;
        DataGridUser user = null;

        // FIRST STEP---------------------------------------------
        // Initialize the GridSim package
        int num_user = 1; // number of grid users
        Calendar calendar = Calendar.getInstance();
        boolean trace_flag = false; // means trace GridSim events
        boolean gisFlag = false;    // means using DataGIS instead
        GridSim.init(num_user, calendar, trace_flag, gisFlag);

        // set the GIS into DataGIS that handles specifically for data grid
        // scenarios
        try {
            gis = new DataGIS();
            GridSim.setGIS(gis);
        } catch (Exception e) {
            e.printStackTrace();
        }

        // SECOND STEP---------------------------------------------
        // Create a top level Replica Catalogue
        double baud_rate = 1000000; // bits/sec
        double propDelay = 10; // propagation delay in millisecond
        int mtu = 1500; // max. transmission unit in byte
        try {
            SimpleLink l = new SimpleLink("rc_link", baud_rate, propDelay, mtu);
            rc = new TopRegionalRC(l);
        } catch (Exception e1) {
            e1.printStackTrace();
        }

        // THIRD STEP---------------------------------------------
        // Create resources
        int i = 0;
        int totalResource = 3;
        ArrayList resList = new ArrayList(totalResource);
        for (i = 0; i < totalResource; i++) {
            DataGridResource res = createGridResource("Res_" + i, baud_rate,
                    propDelay, mtu);
            resList.add(res);
        }

        // FOURTH STEP---------------------------------------------
        // Create user(s)
        try {
            user = new FileUser("File_User", baud_rate, propDelay, mtu);
            user.setReplicaCatalogue(TopRegionalRC.DEFAULT_NAME);
        } catch (Exception e2) {
            e2.printStackTrace();
        }

        // FIFTH STEP---------------------------------------------
        // Create network
        Router r1 = new RIPRouter("router1"); // router 1
        Router r2 = new RIPRouter("router2"); // router 2

        try {
            // connect the routers
            baud_rate = 10000000;
            Link link = new SimpleLink("r1_r2_link", baud_rate, propDelay, mtu);
            FIFOScheduler r1Sched = new FIFOScheduler();
            FIFOScheduler r2Sched = new FIFOScheduler();

            // attach r2 to r1
            r1.attachRouter(r2, link, r1Sched, r2Sched);
        } catch (Exception e3) {
            e3.printStackTrace();
        }

        // FIFTH STEP---------------------------------------------
        // Connect resources, users and catalogues to the network
        try {
            // connect resources
            GridResource resObj = null;
            for (i = 0; i < resList.size(); i++) {
                FIFOScheduler resSched = new FIFOScheduler();
                resObj = (GridResource) resList.get(i);
                r2.attachHost(resObj, resSched);// attach resource to router
            }
            // connect user
            FIFOScheduler userSched = new FIFOScheduler();
            r1.attachHost(user, userSched); // atach the user to router r1

            // connect rc
            FIFOScheduler rcSched = new FIFOScheduler();
            r2.attachHost(rc, rcSched); // attach RC

        } catch (ParameterException e4) {
            e4.printStackTrace();
        }

        // SIXTH STEP---------------------------------------------
        // Finally start the simulation
        GridSim.startGridSimulation();
    }