public void body()
    {
        // get the destination entity ID
        this.destID_ = GridSim.getEntityId(destName_);

        int packetSize = 500;   // packet size in bytes
        Sim_event ev = new Sim_event();     // an event
        
        // a loop waiting for incoming events
        while ( Sim_system.running() )
        {
            // get the next event from the Input buffer
            super.sim_get_next(ev);
            
            // if an event denotes end of simulation
            if (ev.get_tag() == GridSimTags.END_OF_SIMULATION)
            {
                System.out.println();
                write(super.get_name() + ".body(): exiting ...");
                break;
            }
            
            // if an event denotes another event type
            else if (ev.get_tag() == NetUser.SEND_MSG)
            {
                System.out.println();
                write(super.get_name() + ".body(): receive " +
                      ev.get_data() + ", at time = " + GridSim.clock());

                // sends back an ack
                IO_data data = new IO_data(ev.get_data(), packetSize, destID_);
                write(name_ + ".body(): Sending back " +
                      ev.get_data() + ", at time = " + GridSim.clock() );

                // sends through Output buffer of this entity
                super.send(super.output, GridSimTags.SCHEDULE_NOW,
                           NetUser.SEND_MSG, data);
            }
            
            // handle a ping requests. You need to write the below code
            // for every class that extends from GridSim or GridSimCore.
            // Otherwise, the ping functionality is not working.
            else if (ev.get_tag() ==  GridSimTags.INFOPKT_SUBMIT)
            {
                processPingRequest(ev);                
            }
        }

        ////////////////////////////////////////////////////////
        // shut down I/O ports
        shutdownUserEntity();
        terminateIOEntities();

        // don't forget to close the file
        if (report_ != null) {
            report_.finalWrite();
        }
        
        System.out.println(this.name_ + ":%%%% Exiting body() at time " +
                           GridSim.clock() );
    }