private static void createTopology(ArrayList gisList, ArrayList resList,
                                       ArrayList userList) throws Exception
    {
        int i = 0;
        double baud_rate = 1e8;  // 100 Mbps
        double propDelay = 10;   // propagation delay in millisecond
        int mtu = 1500;          // max. transmission unit in byte

        // create the routers
        Router r1 = new RIPRouter("router1");   // router 1
        Router r2 = new RIPRouter("router2");   // router 2
        Router r3 = new RIPRouter("router3");   // router 3

        // connect all user entities with r1 router
        // For each host, specify which PacketScheduler entity to use.
        NetUserGIS obj = null;
        for (i = 0; i < userList.size(); i++)
        {
            FIFOScheduler userSched = new FIFOScheduler("NetUserSched_"+i);
            obj = (NetUserGIS) userList.get(i);
            r1.attachHost(obj, userSched);
        }

        // connect all resource entities with r2 router
        // For each host, specify which PacketScheduler entity to use.
        GridResource resObj = null;
        for (i = 0; i < resList.size(); i++)
        {
            FIFOScheduler resSched = new FIFOScheduler("GridResSched_"+i);
            resObj = (GridResource) resList.get(i);
            r2.attachHost(resObj, resSched);
        }

        // then connect r1 to r2
        // For each host, specify which PacketScheduler entity to use.
        Link link = new SimpleLink("r1_r2_link", baud_rate, propDelay, mtu);
        FIFOScheduler r1Sched = new FIFOScheduler("r1_Sched");
        FIFOScheduler r2Sched = new FIFOScheduler("r2_Sched");

        // attach r2 to r1
        r1.attachRouter(r2, link, r1Sched, r2Sched);

        // attach r3 to r2
        FIFOScheduler r3Sched = new FIFOScheduler("r3_Sched");
        link = new SimpleLink("r2_r3_link", baud_rate, propDelay, mtu);
        r2.attachRouter(r3, link, r2Sched, r3Sched);

        // attach regional GIS entities to r3 router
        RegionalGIS gis = null;
        for (i = 0; i < gisList.size(); i++)
        {
            FIFOScheduler gisSched = new FIFOScheduler("gis_Sched" + i);
            gis = (RegionalGIS) gisList.get(i);
            r3.attachHost(gis, gisSched);
        }
    }