This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

TCP urgent pointer and urgent data

0

Hi,

In the TCP header, the urgent pointer points to the last byte of the urgent data, if present.

I couldn't understand what's the idea behind this. What could this be possibly used for? I think that beginning of the urgent data might be more useful as it would help TCP (on the receiving end) know where exactly the urgent data begins and ends.

Thanks.

asked 11 Oct '13, 22:56

hdnivara's gravatar image

hdnivara
16226
accept rate: 0%


One Answer:

3

There is a recent survey of the urgent mechanism and the current implementations. Actually there seems to exist some 'confusion' about the urgent mechanism, because of 'errors' in RFCs and different implementations. Especially the definition of the urgent pointer (how to interpret it) has been unclear in several RFCs. See RFC6093 On the Implementation of the TCP Urgent Mechanism.

I couldn't understand what's the idea behind this.

The urgent flag and the urgent pointer simply tells the receiver when to enter "urgent data mode" and when to leave it. Enter it, when you receiver a segment with urgent flag set and leave it, when the segment with SEQ+urgent pointer has been received (see 2.1. Semantics of Urgent Indications in RFC 6093).

From RFC793

  TCP also provides a means to communicate to the receiver of data that
  at some point further along in the data stream than the receiver is
  currently reading there is urgent data.  TCP does not attempt to
  define what the user specifically does upon being notified of pending
  urgent data, but the general notion is that the receiving process will
  take action to process the urgent data quickly.

So, we define that there might be a thing called "urgent data", but we don't tell you why and what to do whit them. What exactly is meant by "take action" and "process quickly"? Well..., the early RFCs are sometimes more like a philosophical statement than a clear technical description ;-).

So, what is it good for? Apparently some applications use the urgent mechanism to send out-of-band data. TCP itself defines no control channel mechanism for a connection. So, if you need a control channel you either have two connections like FTP (control and data channel) or you add control data by the use of the urgent mechanism to implement out-of-band data (like a control channel). See: http://alas.matf.bg.ac.rs/manuals/lspe/snode=126.html

However RFC6093 states:

   It should be reinforced that the aforementioned implementations are
   broken.  The TCP urgent mechanism is not a mechanism for delivering
   "out-of-band" data.

So, yes it can be used as an out-of-band mechanism and it is used (e.g. telnet), however RFC6093 mandates not to do it.

RFC6093 is more clear on the whole thing.

5. Advice to New Applications Employing TCP

As a result of the issues discussed in Section 3.2 and Section 3.4, new applications SHOULD NOT employ the TCP urgent mechanism. However, TCP implementations MUST still include support for the urgent mechanism such that existing applications can still use it.

In simple words. Don’t use it.

Now it’s up to the reader to decide: Follow the latest RFC or the “best practice approach”? ;-)

Regards
Kurt

answered 12 Oct ‘13, 03:45

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 14 Oct ‘13, 09:06