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

  • Home
  • SEARCH
  • 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 4341906
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:32:50+00:00 2026-05-21T11:32:50+00:00

I want to attempt to calculate how much data (bytes) I send/receive over the

  • 0

I want to attempt to calculate how much data (bytes) I send/receive over the network. I send/receive both TCP and UDP packets, so I need to be able to calculate the size of these packets including their respective headers. I looked at this questions: Size of empty UDP and TCP packet and it lists the minimum size of the header, but is that libel to change? Should I just add the number of bytes I send in the packet, but the size of the minimum header? Also, I know at some point (n bytes) the data would be too big to fit in just one packet.

One other thing, the client is a mobile device, so it may receive over cellular or wifi. I am not sure if there is a difference in the packet size between the two, but I would probably just want to assume what ever is larger.

So my questions are, assuming the data is n bytes long:

1) How big would the TCP packet be, assuming it all fits in one packet?

2) How big would the UDP packet be, assuming it all fits in one packet?

3) Is there an easy way to determine the number of bytes it would take to overrun one packet? For both TCP and UDP.

  • 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-05-21T11:32:51+00:00Added an answer on May 21, 2026 at 11:32 am

    Lets assume we’re only talking about ethernet and IPv4

    Look at your interface MTU, which has already subtracted 
        the size of the ethernet headers for the OS I can 
        remember (linux and FreeBSD)
    
    Subtract 20 bytes for a normal IP header (no IP options)
    
    Subtract 20 bytes for a normal TCP header
    
    Or
    
    Subtract 8 bytes for a UDP header
    

    That is how much data you can pack into one IPv4 packet. So, if your TCP data is n bytes long, your total ethernet payload is (n + 20 + 20); your ethernet payload for UDP is (n + 20 + 8).

    EDIT FOR QUESTIONS

    RE: MTU

    Your interface MTU is the largest ethernet payload that your drivers will let you encapsulate onto the wire. I subtract because we’re assuming we start from the MTU and work up the encapsulation chain (i.e. eth -> ip -> tcp|udp); you cant send TCP or UDP without an IP header, so that must be accounted for as well..

    RE: Calculating application overhead

    Theoretical calculations about the overhead your application will generate are fine, but I suggest lab testing if you want meaningful numbers. Usage factors like average data transfer per client session, client hit rate per minute and concurrent clients can make a difference in some (unusual) cases.

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

Sidebar

Related Questions

I want to share a data with multiple processes. My first attempt is to
I want to calculate x power y and both x,y are double values. Why
I want to write an Exception to an MS Message Queue. When I attempt
I'm looking at the Double Metaphone algorithm. I just want to calculate the efficiency
I have an IPhone application that I want to attempt login and do some
Iv'e been working with objective-c for while and I want to attempt to build
I want to calculate the total size of all .mobi files from this link
I'm working on a application in C# in which I want to calculate an
I need to probabilistically select a sample from a set of data. Say I
I want to copy the parameters foo(bar).baz in the following code: function(foo(bar).baz) First attempt:

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.