Shimano's Ultegra Di2 electronic shifting system includes many improvements relative to its Dura-Ace 7970 predecessor. Key among these is that Ultegra Di2 utilizes the same connectors for each component making wiring far easier. The system requires four runs of wire that all start at the junction box that is typically mounted on the downtube near the bottom bracket. From the junction box the wires connect to the front derailleur, rear derailleur, battery, and the front wiring kit (which is connected to the shifters).
All you need to do is determine what length wire you need for your specific frame and the chosen location for your battery and junction box. The wires are available in 13 different lengths ranging from 300mm to 1400mm. All connections are waterproofed for reliability in inclement weather and are designed to be run externally or internally.
Remember the old days when you had to connect steel cables between the shifter and derailleurs and then stretch them before tuning them to the proper tension? How quaint.