# Peer Management
One of the first things you'll need to do when building your own Lightning node is connect to a peer. In LDK this is handled by the
PeerManager (opens new window).
PeerManager has two dependencies:
ChannelManager(opens new window) that enables it to notify peers when it wants to do things such as open channels.
P2PGossipSync(opens new window) that understands when peers you are connected to send you gossip messages, enables you to forward messages, announce channel opens and more.
Since LDK knows nothing about your networking stack, you'll need to implement your own networking logic in order to connect to peers on the network. Provide LDK with raw TCP/IP socket data and the library will handle the rest for you.
LDK also handles a number of background tasks that need to happen periodically via
BackgroundProcessor (opens new window)