Gasoline is composed of compounds with a much lower boiling point range. Chromatographically, gasoline is defined as the fraction of crude oil with boiling points between C-6 (hexane) adn C-10(decane). Incidentally, C-8 is octane…remind me in a short while.
Chromatographically, diesel is from C-10 to C-24, or sometimes C-10 to C-28. It’s rather arbitrary.
Diesel #1 overlaps kerosene and diesel #2. Per volume, it is a little heavier than kerosene and a bit lighter than diesel. It’s claim to fame is lower vapor pressure and lower flash point. In colder climates, as winter sets in, gas stations serving diesel will switch to diesel #1 so that diesel engines will start, because #2 will freeze at not that cold of a temperature, and slush doesn’t flow too well. And of course, you get lower mileage 'cuz of the lower energy density.
Also, if you live in an area with lots of heavy truck traffic, you may have seen special diesel pumps containing “truck diesel”. This is a heavier grade of diesel which will make ordinary engines run really rough because it is so hard to ignite. Somehow, big truck engines are stronger or tuned differently, and they can get some awesome mileage from this usually cheaper stuff.
Now, the octane and cetane index thing. Do you know how the octane rating is derived? Well, octane, C-8 was chosen as the “average” gasoline molecule. Halfway between C-6 and C-10, intermediate boiling point and flash point, and whatnot. Of all the many compounds found in gasoline, it does a fair job of representing the whole mix.
So what they do to test a new batch of gasoline, is run the gasoline on a Knock Engine in a lab. As the fuel is sustaining the engine, they tweak the engine so it is running perfectly smooth with that fuel. Then, they switch to a synthetic fuel made up of heptane (C-7) and octane in some ratio, say 80% octane and 20% heptane.
When the new synthetic fuel hits the engine, it begins to run really rough since it is still tweaked for the real gasoline under test. Then, they start to increase the octane/heptane ratio until the knock engine smooths out again. If the engine became smoothest with 90% octane and 10% heptane, it is given an octane rating of 90.
A Cetane index is used for diesel 'cuz cetane (C-16) is a good representative molecule for diesel fuel. I’m not sure what the other component of the synthetic fuel is, maybe C-15 or C-14. But the same type of test takes place: tune engine to mystery fuel, adjust ratios of synthetic fuel to obtain the same performance, and call it good.
The real beauty part of this, is that it doesn’t really matter what the fuel producer uses to make diesel with. As long as it passes the battery of tests, it can be called diesel. Tests like water content, sulfur content, boiling point, flash point, density, color, BTUs, vapor pressure and many others.