Universal Plug and Play (UPnP) is a set of computer protocols promulgated by the UPnP Forum. The goals of UPnP are to allow devices to connect seamlessly and to simplify the implementation of networks in the home (data sharing, communications, and entertainment) and in corporate environments for simplified installation of computer components. UPnP achieves this by defining and publishing UPnP device control protocols built upon open, Internet-based communication standards.
The term UPnP is derived from plug-and-play, a technology for dynamically attaching devices directly to a computer.
Usage of UPnP in KTorrent
A lot of people, have a router so they can share one internet connection with all of the computers and internet capable devices in their home. These routers use network address translation to achieve this. When talking about the bittorrent world, Network address translation (NAT in short), is helping external peers from connecting to your own bittorrent client. If you do not use NAT or UPnP, you might get slower download speeds (this depends on the healthy of the swarm you are currently in), this is because only outgoing connections can be established when you do not port forward.
In order to solve this very known problem, UPnP or NAT is used. Most routers sold today support both this protocols. KTorrent will use UPnP to forward the ports which are in use. This is done by UPnP because UPnP needs no configuration when your LAN in assigned with Dynamic Host Configuration Protocol (DHCP).
When a port is forwarded, the NAT router (or UPnP) will forward all incoming connection requests on this port to KTorrent, so that it can accept the connection and start sharing data with the newly connected peer.