you will need to connect an ethernet controller to that. I think ENC28J60 is there. And you can use TCPIP stack from microchip. I'm not sure if you will be able to use 16f877, it doesn't have sufficient memory to accomodate the code, but may be with the latest stack you can atleast try pinging. Rather if you want to simulate ethernet, go for PIC18 or higher end controllers.