Upstream and downstream companies

What is the difference between oil marketing companies like HPCL, BPCL (Upstream companies

and

ONGC, OIL INDIA LIMITED (Down stream)

It is seen that upstrem companies benefits when crude oil price goes up and downstream companies benefits when crude oil prices goes down.

So my question is what is the difference between their business models as all the above mentioned companies deals with crude oil

Everything Explained clearly in the above Thread post.