Peers communicate with each other using TCP or Torrent Transport Protocol. Information about the file to be downloaded (metainfo file) etc are communicated to peers using a peer protocol. As part of this protocol, when peers communicate, they use a single byte of packet type to indicate their state.
For data transfer, the (sending) peer that has the file should move to unchoked state from the initial choked state. On the other hand, the (receiving) peer should mtaintain an interested state during the file transfer.
Here is the BitTorrent specification: http://www.bittorrent.org/beps/bep_0003.html