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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:40:59+00:00 2026-05-29T17:40:59+00:00

I’m trying to understand the difference between a TCP segment with the flag PSH

  • 0

I’m trying to understand the difference between a TCP segment with the flag PSH and with the flag URG.
I read the RFC but still couldn’t get it, does one of them buffer the data before it sends it to the process and the other doesn’t ?

  • 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-29T17:41:14+00:00Added an answer on May 29, 2026 at 5:41 pm

    They are two vastly different mechanisms.

    PSH and the PUSH function

    When you send data, your TCP buffers it. So if you send a character it won’t send it immediately but wait to see if you’ve got more. But maybe you want it to go straight on the wire: this is where the PUSH function comes in. If you PUSH data your TCP will immediately create a segment (or a few segments) and push them.

    But the story doesn’t stop here. When the peer TCP receives the data, it will naturally buffer them it won’t disturb the application for each and every byte. Here’s where the PSH flag kicks in. If a receiving TCP sees the PSH flag it will immediately push the data to the application.

    There’s no API to set the PSH flag. Typically it is set by the kernel when it empties the buffer. From TCP/IP Illustrated:

    This flag is conventionally used to indicate that the buffer at the side sending the packet has been
    emptied in conjunction with sending the packet. In other words, when the packet with the PSH bit field set left the sender, the sender had no more data to send.

    But be aware Stevens also says:

    Push (the receiver should pass this data to the application as soon as
    possible—not reliably implemented or used)

    URG and OOB data

    TCP is a stream-oriented protocol. So if you push 64K bytes on one side, you’ll eventually get 64k bytes on the other. So imagine you push a lot of data and then have some message that says "Hey, you know all that data I just sent ? Yeah, throw that away". The gist of the matter is that once you push data on a connection you have to wait for the receiver to get all of it before it gets to the new data.

    This is where the URG flag kicks in. When you send urgent data, your TCP creates a special segment in which it sets the URG flag and also the urgent pointer field. This causes the receiving TCP to forward the urgent data on a separate channel to the application (for instance on Unix your process gets a SIGURG). This allows the application to process the data out of band¹.


    As a side note, it’s important to be aware that urgent data is rarely used today and not very well implemented. It’s far easier to use a separate channel or a different approach altogether.


    ¹: RFC 6093 disagrees with this use of "out of band" and states:

    The TCP urgent mechanism is NOT a mechanism for sending "out-of-band"
    data: the so-called "urgent data" should be delivered "in-line" to the
    TCP user.

    But then it goes on to admit:

    By default, the last byte of "urgent data" is delivered "out of band"
    to the application. That is, it is not delivered as part of the
    normal data stream.

    An application has to go out of its way and specify e.g. SO_OOBINLINE to get standards-conforming urgent semantics.

    If all this sounds complicated just don’t use urgent data.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to construct a data frame in an Rcpp function, but when I

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.