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 8130737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:49:54+00:00 2026-06-06T08:49:54+00:00

From what I understand, when a socket buffer (skb) is allocated by the kernel

  • 0

From what I understand, when a socket buffer (skb) is allocated by the kernel stack (on Tx path), the ‘head’ and ‘tail’ pointers point to the start & end of reserved memory space.

My qs is: what exactly determines this amount: (tail – head) octets?
Is it max MTU? Doesn’t seem like it as a little experimentation shows that the # of bytes (tail-head) can be quite small (320 bytes, etc). So is it the socket app that plays a role here?

Also, AFAIK, the idea is to reserve enough memory such that no further allocs are required further down the protocol stack, i.e., reserved space can be more than the payload. If so, what about cases where further encapsulation is done (like VoIP, SSL, etc?)?

Update:
Does this help answer the qs?

  1. Found in net/ipv4/tcp_output.c:

    …
    tcp_make_synack()
    { …
    skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC);
    …
    }

This seems to be the SYN-ACK part of the TCP state m/c.
So, by this, ‘size’ seems to work out to around 320.

  1. TCP segments data packets..
    default ‘mss’ is 512 ? <– based on tcp_base_mss ?

TIA!

  • 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-06T08:49:56+00:00Added an answer on June 6, 2026 at 8:49 am

    Small correction first – the buffer is between head and end, not tail (which is paired with data).

    Your basic idea is correct. TCP allocates according to the data it needs, plus room for lower layer headers. Since these headers are not really known in advance, TCP allocates according to the maximum possible (which is very likely to be much more than actually needed).

    If this ends up not enough, the packet can be reallocated (pskb_expand_head can be used).
    In most cases, code that adds data to the packet first checks if there’s enough headspace (which will hopefully be the case), and reallocates if not.

    The “default” MSS isn’t very important – it’s only used when no better value can be found. Normally, the MSS will be MTU-40, which is usually 1460.

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

Sidebar

Related Questions

i want to understand from the below code y the value of static variable
I found that Maven implies specific directory layout. But I don't understand from here:
From what I understand PRNG uses a seed that generates a sequence of numbers
From what I understand, using Wiki and this question I posted, Microsoft has its
From what I understand, it should automatically have it installed. What I have installed
From what I understand, if scope=prototype is given for a bean, a new instance
From what I understand of REST principles, URLs should represent a single resource, like
From what I understand, the best way to deal with dates in the Zend
From what I understand, the trade-off here is a matter of added complexity. Maybe?
From what I understand livequery is for maintaining your events after DOM changes. Does

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.