-2

I know there are many similar questions to my question but I need a clear answer regarding my question. Since we all know, TCP is connection-oriented while UDP is connectionless. If on the same network, I make two UDP sockets (server, client) and two TCP sockets (server, client) then who will consume more bandwidth? I mean according to my knowledge, keeping in mind the connection-oriented term, I assume that TCP will consume more bandwidth all the time while UDP will consume bandwidth only when data is being sent.

Could you please help me out in clearing this issue?

Khubaib Ahmad
  • 141
  • 10
  • 1
    No. Both will only consume bandwidth when data is being transmitted, more or less. Off topic. – user207421 Jun 05 '20 at 08:02
  • apart of giving negative points to my question "MORE OR LESS". What does then connection-oriented mean in this case? It's related to socket programming and bandwidth optimization. If its connection-oriented does it mean that all the time a specific portion of bandwidth is occupied all the time..? it is not off-topic by the way. – Khubaib Ahmad Jun 05 '20 at 08:10
  • there are many descriptions of how these protocols work, google is your friend! see e.g. [here for TCP](http://intronetworks.cs.luc.edu/current/html/tcp.html), can you point out where the extra bandwidth is used when the connection is idle? note that it's the community that collectively decides what's on- or off-topic, I've posted things I thought were appropriate only to be pointed elsewhere – Sam Mason Jun 05 '20 at 17:07

1 Answers1

0

TCP will consume slightly more bandwidth than UDP.

Everything that is transmitted in TCP must be ack'ed to ensure integrity of the connection. UDP does not do that.

TCP has a slightly larger per-packet header than UDP.

TCP has optional keep-alives that can be turned on, which UDP does not have. So, there may small amounts of network traffic being used to keep TCP connections alive during idle periods when no application data is being transmitted.

But, these overheads are minimal, you are not likely to notice them, unless you are really looking for them.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Hi @Remy, Thanks a lot for the answer. Basically I am trying to make a protocol for congestion control in a VOIP application (Client-server architecture). I wanted to know what I asked in the question. Its clear now. – Khubaib Ahmad Jun 08 '20 at 11:30
  • @KhubaibAhmad most VoIP technologies are based on RTP, which itself runs on top of UDP only, as dropped audio packets are not critical to the overall conversations, so there is no need for the extra overhead of TCP's guarantees. – Remy Lebeau Jun 08 '20 at 17:46