0

Let's say you sit on your home computer and request https://google.com through your browser of choice. The TCP Handshake completes and google's server sends out the HTML/JS pages (and whatever other resources it uses).

The pages are too large to send in one packet, so it splits the page into multiple parts... hence packets

Would the payload (data) come sequentailly?

Like:

Packet 1 - received first

<html>
     <head>
            <script src='./blah/blah.js'</script>
     </head>

Packet 2 -received second

     <body>
     <h4> Hi I'm Google.com </h4>

Packet 3 -received third

      </body>
 </html>

I'm just talking about the data in the packets (payload) at the application layer. I want to know is there a structure to the order in which the packets are received. How does the browser reassemble it if it doesn't come in order?

1 Answers1

3

With HTTP the data would be received sequentially at the application layer. This is because HTTP uses the TCP protocol at the transport layer. One of the services provided by TCP is sequential segment ordering. This is done by having a packet sequence number field in the TCP header.

This does not mean that the packets actually arrived at the system in order though. Also, other transport protocols (such as UDP) do not provide segment ordering so segments are delivered to the application in the order they are received.

Ben Franske
  • 511
  • 2
  • 10