At IP level, ARP can be used to find out if a remote peer is connected to the network. Example is in dhcpclnt.c
c:\Freescale\Freescale_MQX_4_0\rtcs\source\tcpip\dhcpclnt.c
two functions DHCPCLNT_probe_address() and DHCPCLNT_verify_address().
First functions sends an ARP_request(). After some time delay you may check ARP table by ARP_is_complete().
ARP_request() and ARP_is_complete() can't be called from an application directly, because they are private functions to RTCS library, but they can be made public in the RTCS build project. Just create some public functions in RTCS library as wrappers around calls to ARP_request() and ARP_is_complete().
For TCP level please read:
https://community.freescale.com/message/317209
means return codes from send() and recv() functions may help.