2

I send a video and an audio stream between 2 devices with the UDP protocol. The 2 streams are sent through a single port.

My question is: Is there any advantage (speed, throughput, risk of congestion, ...) in sending the video stream through one port and the audio stream through another? (Each of the ports being assigned to an independent thread)

Or in other words: Can we transmit more data through two ports instead of just one? Or it will not change anything because the speed and the throughput are limited by the CPUs, the OS, the network cards, ...

1
  • ALL of your answers were really precise, clear and helpful. They fully answered my question. It is impossible for me to choose one over the other. Thank you to all of you!
    – Greelings
    Commented Sep 8, 2021 at 12:21

5 Answers 5

2

Is there any advantage (speed, throughput, risk of congestion, ...) in sending the video stream through one port and the audio stream through another?

Answer: No. The audio part is minuscule compared with the video part, so no point in going through the work of separating and combining the two.

Can we transmit more data through two ports instead of just one?

If the one port is already bombarding the (one) network at its top speed, a second port will only add network conflicts and waits. The gains are small (and doubtful) for one network.

Note that the full network speed will tax the ability of the receiving hard disk, which might become the actual bottleneck. Increasing the network throughput will not gain any improvement when the disk is the one that is throttling it.

1

You have one network connection. I think that can be readily assumed from your post.

As you point out, your CPU and OS are fixed at this point.

So adding a port and using two ports will not speed things up at all. No advantage. There is only one "pipe" (Network Connection) for packets to go through.

Just use your setup as it is and make sure everything is functioning correctly.

1

Can we transmit more data through two ports instead of just one?

Generally speaking: yes. But in the case you described, probably not. An AV stream consists of an audio and a video stream. But the audio stream consumes less than 1/10 (or even less) of the amount of data of the video stream.

So splitting (and rejoining) the streams is not worth the effort.
If you'd transmit several AV streams at the same time, distributing streams among several ports would be a sensible option.

My question is: Is there any advantage (speed, throughput, risk of congestion, ...) in sending the video stream through one port and the audio stream through another?

Not for a single stream. But, as mentioned above, with several streams it would be useful, if not even mandatory.

But a useful scenario I can think of is translation:

  • Transmit the video stream through one port
  • Transmit the audio part through another port to different end-points for translation (to different languages) - and rejoin the translated audio streams with the original video stream at the destination (by using the time stamps).
1

Processes/programs that want to receive network TCP/IP traffic will tell the operating system one of the following: "listen" on one IP+specific port, "listen" on more than one IP+specific port, or "listen" on any IP+specific port (the IP address 0.0.0.0 is usually used to tell the OS to receive traffic from any IP).

And that's the whole point of ports: so that the TCP/IP stack on the receiving system can decide which process/program gets the traffic. Without ports you'd have to have one process listening to the NIC, receiving all traffic and then distributing it to programs, which is slower than if simply done by the OS.

Normally speed and throughput are limited by hardware and the capability/reliability of any network medium between source and destination. TCP adapts to unknown/unpredictable conditions by use of the sliding window algorithm. UDP (a thin layer on top of plain IP) offloads that responsibility to the processes/programs if they want anything like that.

Anyway, modern OSes (especially Linux) and things like firewalls/management devices have ways to limit traffic speed on specific criteria, and ports can be one of those criteria.

So if there is something limiting traffic per port, such as some type of traffic control policy or software, then using more than one port can break through that limit, assuming nothing else is interfering.

Most people smart enough to set up a speed limit per port will also do it per IP address so you're unlikely to bypass anything there.

1

No.

You specifically mentioned the UDP protocol. This is "fire and forget", so using additional ports makes the network side of things more complex without any gain.

(Were you using tcp, the answer would be yes - and indeed many programs do open multiple connections to download multiple parts of the file in parellell and stitch them together for greater speed. This works because tcp is designed to slow down if it looses packets, and also because, unlike udp its bound by round trip times and packet acknowledgements.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .