Question on HTTP transactions request-response - TCP-IP

This is a discussion on Question on HTTP transactions request-response - TCP-IP ; Hello Hope this is the right group for this since it is about the HTTP. If a we download 2 different contents (ex. 2 different images ) from the same web site using the same user agent at (almost if ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Question on HTTP transactions request-response

  1. Question on HTTP transactions request-response

    Hello
    Hope this is the right group for this since it is about the HTTP. If a
    we download 2 different contents (ex. 2 different images ) from the
    same web site using the same user agent at (almost if not exactly) the
    same time, is there a possibility that the response is not in order.
    Let's say:

    GET image1.gif
    Host: 10.10.2.1
    ....

    GET image2.gif
    Host: 10.10.2.1
    ....

    HTTP/1.x 200 OK (for image2.gif)
    Content-Length: 40
    ....

    HTTP/1.x 200 OK (for image1.gif)
    Content-Length: 45
    ....


    I'm talking about in the packet level. We're developing a program
    somewhat like a sniffer and wondering if this is possible. If it is,
    what would be the best solution to correlate that the first packet is
    related to the last packet and the 2nd packet to the third packet.
    We're reading RFC 2616 but unfortunately, we haven't found it yet or
    failed to understand it.

    Hopeful for a favorable response. Thanks in advance!

  2. Re: Question on HTTP transactions request-response

    tipidpc.ataman@gmail.com wrote:
    > Hello
    > Hope this is the right group for this since it is about the HTTP. If a
    > we download 2 different contents (ex. 2 different images ) from the
    > same web site using the same user agent at (almost if not exactly) the
    > same time, is there a possibility that the response is not in order.
    > Let's say:


    > GET image1.gif
    > Host: 10.10.2.1
    > ...


    > GET image2.gif
    > Host: 10.10.2.1
    > ...


    > HTTP/1.x 200 OK (for image2.gif)
    > Content-Length: 40
    > ...


    > HTTP/1.x 200 OK (for image1.gif)
    > Content-Length: 45
    > ...



    > I'm talking about in the packet level. We're developing a program
    > somewhat like a sniffer and wondering if this is possible. If it is,
    > what would be the best solution to correlate that the first packet is
    > related to the last packet and the 2nd packet to the third packet.
    > We're reading RFC 2616 but unfortunately, we haven't found it yet or
    > failed to understand it.


    As far as an application is concerned, that should only be possible if
    the two requests are sent on separate TCP connections. If they are on
    the same TCP connection, the combination of HTTP requiring the
    requests be responded-to in order, and TCP's maintaining order, means
    that they will arrive at the client application in order.

    Now, if you are sniffing the wire, it is a slightly different story...

    Since the network (IP) could lose or reorder packets at its whim, if
    you are sniffing the network, you might see some of the TCP segments
    for image2.gif arrive at the receiving _system_ before the TCP
    segments of image1.gif. TCP deals with this by checking the sequence
    numbers in the header(s) of the TCP segments and only presenting data
    "in order" once holes etc in the sequence space have been filled-in.

    rick jones
    --
    oxymoron n, Hummer H2 with California Save Our Coasts and Oceans plates
    these opinions are mine, all mine; HP might not want them anyway...
    feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...

  3. Re: Question on HTTP transactions request-response

    On Jan 8, 7:32 am, Rick Jones wrote:
    > tipidpc.ata...@gmail.com wrote:
    > > Hello
    > > Hope this is the right group for this since it is about the HTTP. If a
    > > we download 2 different contents (ex. 2 different images ) from the
    > > same web site using the same user agent at (almost if not exactly) the
    > > same time, is there a possibility that the response is not in order.
    > > Let's say:
    > > GET image1.gif
    > > Host: 10.10.2.1
    > > ...
    > > GET image2.gif
    > > Host: 10.10.2.1
    > > ...
    > > HTTP/1.x 200 OK (for image2.gif)
    > > Content-Length: 40
    > > ...
    > > HTTP/1.x 200 OK (for image1.gif)
    > > Content-Length: 45
    > > ...
    > > I'm talking about in the packet level. We're developing a program
    > > somewhat like a sniffer and wondering if this is possible. If it is,
    > > what would be the best solution to correlate that the first packet is
    > > related to the last packet and the 2nd packet to the third packet.
    > > We're reading RFC 2616 but unfortunately, we haven't found it yet or
    > > failed to understand it.

    >
    > As far as an application is concerned, that should only be possible if
    > the two requests are sent on separate TCP connections. If they are on
    > the same TCP connection, the combination of HTTP requiring the
    > requests be responded-to in order, and TCP's maintaining order, means
    > that they will arrive at the client application in order.
    >
    > Now, if you are sniffing the wire, it is a slightly different story...
    >
    > Since the network (IP) could lose or reorder packets at its whim, if
    > you are sniffing the network, you might see some of the TCP segments
    > for image2.gif arrive at the receiving _system_ before the TCP
    > segments of image1.gif. TCP deals with this by checking the sequence
    > numbers in the header(s) of the TCP segments and only presenting data
    > "in order" once holes etc in the sequence space have been filled-in.
    >
    > rick jones
    > --
    > oxymoron n, Hummer H2 with California Save Our Coasts and Oceans plates
    > these opinions are mine, all mine; HP might not want them anyway...
    > feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...


    Ok, thanks for the info sir

  4. Re: Question on HTTP transactions request-response

    On Jan 7, 3:22 pm, tipidpc.ata...@gmail.com wrote:

    > Hope this is the right group for this since it is about the HTTP. If a
    > we download 2 different contents (ex. 2 different images ) from the
    > same web site using the same user agent at (almost if not exactly) the
    > same time, is there a possibility that the response is not in order.

    [snip]
    > I'm talking about in the packet level. We're developing a program
    > somewhat like a sniffer and wondering if this is possible. If it is,
    > what would be the best solution to correlate that the first packet is
    > related to the last packet and the 2nd packet to the third packet.
    > We're reading RFC 2616 but unfortunately, we haven't found it yet or
    > failed to understand it.


    Use an existing tool or toolkit to reconstruct TCP sessions from the
    raw packets. Otherwise, you will rapidly get way beyond your apparent
    competency.

    Google for "sniffer TCP packet reconstruct" or something like that.

    DS

  5. Re: Question on HTTP transactions request-response

    On Jan 7, 6:22*pm, tipidpc.ata...@gmail.com wrote:
    > Hello
    > Hope this is the right group for this since it is about the HTTP. If a
    > we download 2 different contents (ex. 2 different images ) from the
    > same web site using the same user agent at (almost if not exactly) the
    > same time, is there a possibility that the response is not in order.
    > Let's say:
    >
    > GET image1.gif
    > Host: 10.10.2.1
    > ...
    >
    > GET image2.gif
    > Host: 10.10.2.1
    > ...
    >
    > HTTP/1.x 200 OK * * * * * * (for image2.gif)
    > Content-Length: 40
    > ...
    >
    > HTTP/1.x 200 OK * * * * * *(for image1.gif)
    > Content-Length: 45
    > ...
    >


    The responses can be out of order if the two HTTP gets were sent on
    different TCP connections.

    --
    VisualEther - http://www.eventhelix.com/VisualEther/
    Reverse engineer sequence diagrams from Wireshark logs


+ Reply to Thread