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
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.

2
  • For UDP, does it have to arrange it at the application layer? Sep 26 '17 at 17:23
  • Yes, if you care about sequencing it would need to be done entirely by the application. Sep 26 '17 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.