Iterated prisoner's dilemma with $n$ rounds, where both players know $n$, has a sub-game perfect equilibrium where both players always defect.
What if the number of rounds is not known though. Suppose that there is a random variable $N$, and we iterate prisoner's dilemma for $N$ rounds (both player's know $N$'s probability distribution, but not its value). How can we calculate the sub-game perfect equilibrium.
In particular, given a probability distribution on $\mathbb N$, how do we calculate the sub-game perfect equilibrium for iterated prisoner's dilemma, where the number of rounds is sampled from that distribution?
The obvious case is if a give number has a 100% chance of occurring, in which case the strategy is always defect.
As noted by mlc, both players always defecting will always be a subgame perfect equilibrium (since neither player can improve their outcomes by changing their strategy). So how do we calculate the other equilibrium?