IP connectionless and HTTP use TCP

Sachin Jain

Sachin Jain

@sachin-0wuUmc Oct 23, 2024
Guys,
I did not get the concept that IP datagrams that are used over internet to transfer messages is connectionless service and HTTP use TCP(connection oriented) service.

My confusion is
Does HTTP use IP datagrams or not ?
If yes, then it is using connection-less service.

If no, then which packets does it use ?

Please reply...thanx in advance

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • silverscorpion

    silverscorpion

    @silverscorpion-iJKtdQ Oct 22, 2010

    Well, it's all about layers. There are different layers in a network, and each of the above protocols work in a different layer.

    So, HTTP works on the application layer, TCP in the transport layer and IP in the network layer or the internet layer.

    Each layer passes data to its adjacent layer. So, HTTP packets are sent to the transport layer, and TCP sends that data to the internet layer.

    It can also happen in the reverse order, viz., from internet layer to transport layer to application layer. ie., ip => tcp => http.

    In effect, HTTP is a connectionless service, even though TCP is connection-oriented.

    It can be confusing at first.. But, try to get the big picture. I hope the answer is clear. Do ask any doubts you might have.
  • Munguti

    Munguti

    @munguti-MnxkmE Oct 22, 2010

    Each layer in the osi model has a name for its data otherwise called a PDU(Protocal Data Unit). The names for this are
    Physical-Bits
    Data-Frames
    Network-packets or datagrams
    Transport-segment
    all the remaining upper layers have their PDU's refered to as simply data. Hope this clears the problem.

    since PDU for layer 3 are also called packets/datagrams so HTTP may use packets or datagrams since that is the same thing but it uses TCP and not UDP for its layer 4 protocol
  • Sachin Jain

    Sachin Jain

    @sachin-0wuUmc Oct 22, 2010

    silverscorpion
    In effect, HTTP is a connectionless service, even though TCP is connection-oriented.
    I think i should study more about these theoretically and then i will ask.
    Can you please suggest me some website or book name to refer to for clearing this doubt.
  • Munguti

    Munguti

    @munguti-MnxkmE Oct 25, 2010

    silverscorpion
    In effect, HTTP is a connectionless service, even though TCP is connection-oriented.
    silverscorpion a service is connectionless or connection oriented based on the layer 4 protocol used i.e whether it use UDP or TCP at the transport layer. Since HTTP uses TCP port 80 it is therefore necessarily conection-oriented.
  • silverscorpion

    silverscorpion

    @silverscorpion-iJKtdQ Oct 25, 2010

    Munguti
    silverscorpion a service is connectionless or connection oriented based on the layer 4 protocol used i.e whether it use UDP or TCP at the transport layer. Since HTTP uses TCP port 80 it is therefore necessarily conection-oriented.
    Well, I didnt know that. But in that case, I have a doubt. HTTP uses TCP alright.. But HTTP doesn't establish dedicated connections between client and server for the whole session, right? For each file to be transferred, new requests are made to the server, right?

    So, just because HTTP uses a connection-oriented service, does that make http too connection-oriented?
  • Munguti

    Munguti

    @munguti-MnxkmE Oct 25, 2010

    silverscorpion
    Well, I didnt know that. But in that case, I have a doubt. HTTP uses TCP alright.. But HTTP doesn't establish dedicated connections between client and server for the whole session, right? For each file to be transferred, new requests are made to the server, right?

    So, just because HTTP uses a connection-oriented service, does that make http too connection-oriented?
    But if there is an error in the data received doesnt HTTP request retransmission. If it were connectionless errors would be dropped by the receiver as is the case when streaming live tv or radio and you see glitches in your screen or static in the voice. This means its reliable

    And doesnt HTTP use sequences on the packets received, such that though they may travel through various paths they will eventually be put in their correct order and presented to the receiver as they were in the sender

    silverscorpion
    dedicated connections between client and server for the whole session, right?
    I think dedicated connections would be used in UDP since all packets must arrive in order and as they were sent, again using the example of the live streaming, if packets were to travel different paths wouldnt that mean they might arrive at different times, and who would have the time to arrange them in their correct order without delaying and distorting the live broadcast.