It is my understanding that when you open a tcp connection to send data the tcp layer on the receiving end holds on to all the packet until the transmission is complete, then sends all the data up to the application.
From wikipedia on tcp:
Due to network congestion, traffic load balancing, or other unpredictable network behavior, IP packets can be lost, duplicated, or delivered out of order. TCP detects these problems, requests retransmission of lost data, rearranges out-of-order data, and even helps minimize network congestion to reduce the occurrence of the other problems. Once the TCP receiver has reassembled the sequence of octets originally transmitted, it passes them to the receiving application. Thus, TCP abstracts the application's communication from the underlying networking details.
But, when you download a large file, the browser keeps track, knows how much data has been sent, knows how fast it is being transmitted, etc. How does it know all of that if the transfer hasn't been completed and therefore hasn't been passed to the receiving application?
What am I missing here?