Several options exists and can be used to achieve this.
The decentralized one
What you could do is broadcasting a request from your application that asks every hosts on the network if they are currently available for a game (sending the request on 255.255.255.255
for instance, will cause your router to retransmit the datagrams you sent to every host on a LAN).
This will ensure that only the hosts that have the game launched and which are ready to play will respond to this request.
Several broadcasting protocols are today heavily used on a LAN. One of them is SSDP (Simple Service Discovery Protocol) which is used with the UPnP protocol for service discovery. There are certainly better suited protocols used over broadcast/multicast for multiplayer games though.
The centralized one
One of the commonest way to discover players on a multiplayer game remains in the presence of a central server on which both requester (people who are looking for a game) and hosters (people who are hosting a game) are connected.
This method has the disadvantage of having a single point of failure, which is the server, but has the advantage, unlike the decentralized solution, of being both suitable for a LAN and for Internet (or every IP based protocol).
If I had to develop a multiplayer game this is where I would start digging regarding the host discovery feature you are required to implement.