Whatever it is you plan on doing, you need to start doing it in training as soon as you can - otherwise you might come a cropper on race day! Gastro problems (cramps and diarrohea mainly) are not uncommon if you aren't used to taking on fuel during a race - the change in blood flow and efficiency of the gut during high intensity activity is altered, so you do need to be careful about what/how you fuel and also put in the practice!
If you can start taking on board some fluid and carbs from the outset, you'll be doing yourself a favour. Using exogenous (external to the body - so food/gels/etc.) sources of carbs helps your body to reserve the glycogen stored in your muscles, and so gives you the potential for increased endurance. Also, the longer you are active, the less well the gut functions. So getting things in early on means your more likely to be able to utilise the energy.
As to what and how much - that really is a matter of personal tolerance. The recommendation is to have 30-60g of carbs per hour, with fluid requirements varying hugely between people depending on their own sweat rates, environmental conditions, type of activity, etc. 500ml - 1 litre per hour is probably a minimum, and should ideally be a water/electrolye solution to help replace lost fluids and electrolytes.
This isn't aimed at an ultramarathon, but the principles are the same - you just might need a little more - link
And this one is aimed at Ironman, which again isn't quite what you want - but does give you some idea as to what is required for ultra-endurance events.