Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8109625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:28:50+00:00 2026-06-06T01:28:50+00:00

My application needs to send video data frame by frame from Server to Client.

  • 0

My application needs to send video data frame by frame from Server to Client.
I’m wavering between using TCP or UDP.

From my test, I found out some following results:

TCP: Very easy to implement.

UDP: To send a frame (about 50KB) to Client, if I create 1 UDP package for each frame then the sending always loses frames. So I must divide each frame into many UDP packages. This makes my algorithm much more sophisticated because UDP protocol can lose packages and the packages can be delivered out of order.
In addition, if the length of data in each UDP package is large then it is easily lost.

I have some questions:

  1. Should I use TCP or UDP for this type of application.

  2. If I want to use UDP for faster transmission, how to determine the suitable length of data in each package that won’t be lost easily while transmission? (this maybe belong to network bandwidth)?

  3. From your experiences, can you estimate how much percent is TCP faster UDP?

Sorry for so many questions in a post, but I need to know more details before deciding whether to use TCP or UDP in my application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:28:51+00:00Added an answer on June 6, 2026 at 1:28 am

    In your case I’d use TCP unless you actually have hands-on experience with fragmenting and re-assembling UDP packets manually, and you’re willing to maintain the overhead introduced in your code (like having a re-assembling buffer and controlling the latency that this implies).

    Furtherly, you should take the targetted network into consideration. Is it localhost only, a LAN, a WAN or even the internet. The less control you have over the network the higher the impact of favouring TCP in terms of roundtrip times, latency, packet loss, etc. By control I mean upper bounds or estimates of the number of crossed network segments (#routers), the number of different configurations (QoS, bandwidth-limiter, MTU, …), and so on.

    As a rule of thumb, UDP is great when all data necessary for an instant (defined below) fits in one packet (MTU is guaranteed to be 1280 in IPv6). An instant is a short snapshot in time, something that typically has a life-span of a round trip time. UDP is also great for conversations where both the query and the response are small entities.

    So in this sense, I‘d use UDP for something like DNS (short query, short answer), or financial transaction data (there’s only so many within the life-span of 1 round trip time), or protocol meta data such as the number or identity hashes of participating clients (query/response short and there’s only a handful within the roundtrip time).

    Hope this helps.

    Edit:
    To answer your questions

    1. UDP (restrictions listed above)
    2. IPv6 offers path mtu detection, you’d simply use the PMTU, for IPv4 you’d have to roll your own:
      • set the IP_DONTFRAG socket option
      • send a packet that you would assume goes through
      • think of a simple protocol to allow the receiver to tell you whether the packet has been received completely
      • if no -> reduce the size, if yes -> increase the size
      • after a few ping-pongs you have a safe estimate for the PMTU (of course you can send payload data along already)
    3. UDP will outperform TCP substantially if the nature of the network is stable and remains stable.
      (Conversely) TCP will not win when the nature of the network keeps changing (latency variations, changing probability of packet loss, etc.)
      But, on the same note, UDP will not win when the network segments are very far apart and QoS is used in some of the intermediate segments (QoS that is configured to favour more or less known TCP services over “other” stuff.

    For some figures and inspiration you should check out udt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a client application that needs to send messages to a server for
My application needs to send/receive xml data via a tcp socket. There is no
I have an application that needs to send messages, repeatedly to the server. I'm
My application needs to send emails on an ad hoc basis. I'm using javamail's
I am writing an iPhone application that needs to send and receive data over
I have a time critical application that needs to send a UDP datagram on
I want to be able to send video stream from my application to a
I have a niche application that needs to send a server its location every
My iPhone application needs to dial a phone number and send some data to
I am currently working on an application which needs to send MultiMap from .Net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.