private void getDataFromLink(Sim_event ev)
    {
        Object obj = ev.get_data();
        if (obj instanceof Packet)
        {
            // decrypt the packet into original format
            Packet pkt = (Packet) ev.get_data();

            if (pkt instanceof InfoPacket)
            {
                processPingRequest( (InfoPacket) pkt);
                return;
            }

            // all except last packet in a data session are null packets
            if (pkt instanceof NetPacket)
            {
                NetPacket np = (NetPacket) pkt;
                int tag = np.getTag();

                // ignore incoming junk packets
                if (tag == GridSimTags.JUNK_PKT) {
                    np = null;
                    return;
                }

                // ignore incoming null dummy packets
                if (tag == GridSimTags.EMPTY_PKT && np.getData() == null) {
                    np = null;
                    return;
                }

                // convert the packets into IO_data
                Object data = np.getData();
                IO_data io = new IO_data( data, np.getSize(),
                                          inPort_.get_dest() );

                // send the data into entity input port
                super.sim_schedule(inPort_, GridSimTags.SCHEDULE_NOW, tag,
                                   io.getData() );
            }
        }
    }