If you’re not sure how long you will need your broadband deal, most providers now offer monthly rolling contract options. However, it will definitely be more expensive, because you won’t benefit from introductory discounts and you’ll need to pay more to cover the costs of hardware and setup.
If you need a shorter contract because you’re planning to move house, bear in mind that providers will normally let you bring your contract with you, and if that’s not possible, some may let you out early. If not, it may still be cheaper to pay a few months more than you need.
There are special 9 month deals available for students, but they’re normally only advertised before the start of the academic year.