How to transfer IP traffic

Hi,
We have developed a custom hardware to transfer some information over serial port.
Currently we use TCP sockets and works well. PC1 as client opens TCP socket with “A.B.C.x” and
transmit data. In other hand PC2 received from socket in “D.E.F.x”. This simple data transfer works
well.

Now we are considering transferring IP traffic through our hardware. For example PC1 ping PC2 and communicate directly with it. In this mode TCP/UDP packets and other protocols should be possible.
Is this possible? How we can transfer IP traffic through our custom hardware? Is it require to implement some sort of router in our hardware?

Regards,