Suppose I have a Vanilla machine and this is the first time I am connecting it to Internet. There is no Cache at any level. I access a website through browser by typing example.com (no http//: or https//:). The first thing that will happen is that machine will resolve the domain name to IP and then a TCP Handshake will take place. There is no port negotiation that has happened yet then how does the browser knows which port to connect to?
I have gone through some articles on the web which states that HSTS will tell the browser which port to use as per the HTTP directive. But this does not explains how the browser decides on the port that it needs to connect to initially? How does the machine's OS knows which traffic is this (ICMP or HTTP). Is it always going to connect on port 80 or some other port first and then the sever would be able to tell which port it will listen on?