private synchronized void receiveAd(Sim_event ev)
    {
        if (super.reportWriter_ != null) {
            super.write("receive router ad from, " +
                GridSim.getEntityName(ev.get_src()) );
        }

        // what to do when an ad is received
        FloodAdPack ad = (FloodAdPack) ev.get_data();

        // prevent count-to-infinity
        if (ad.getHopCount() > 15) {
            return;
        }

        String sender = ad.getSender();
        Iterator it = ad.getHosts().iterator();
        while ( it.hasNext() )
        {
            String host = (String) it.next();

            if ( host.equals(super.get_name()) ) {
                continue;
            }

            if (hostTable_.containsValue(host)) { // direct connection
                continue;
            }

            if (forwardTable_.containsKey(host))
            {
                Object[] data = (Object[])forwardTable_.get(host);
                int hop = ((Integer)data[1]).intValue();

                if ((hop) > ad.getHopCount())
                {
                    Object[] toPut = { sender, new Integer(ad.getHopCount()) };
                    forwardTable_.put(host, toPut);
                }
            }
            else
            {
                Object[] toPut = { sender, new Integer(ad.getHopCount()) };
                forwardTable_.put(host, toPut);
            }
        }

        forwardAd(ad);
    }