473,748 Members | 5,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TCP Urgent Pointer Usage

I am attempting to receive a single TCP packet with some text ending with
carriage return and line feed characters. When the text is send and the
packet has the urgent flag set, the text read from the socket is missing the
last character (line feed). When the same text is sent without the urgent
flag set, all of the characters are read.

I'm reading the data using the blocking read call of the network stream
class. The .NET documentation does not discuss a special method needed to
support reading urgent data from a network stream.

I verified that in both cases the data is arriving correctly using a packet
sniffer (Ethereal). I also verified that both receiving and sending parties
are interpreting the urgent pointer according to the BSD implementation.

Is the urgent flag supported?
Jul 7 '06 #1
3 6471
Hi N. Spiker,

From MSDN for OOB data:
Arrival of a TCP segment with the URG (for urgent) flag set indicates the
existence of a single byte of OOB data within the TCP data stream. The "OOB
data block is one byte in size. The urgent pointer is a positive offset from
the current sequence number in the TCP header that indicates the location of
the "OOB data block (ambiguously, as noted in the preceding). It might,
therefore, point to data that has not yet been received.

If SO_OOBINLINE is disabled (the default) when the TCP segment containing
the byte pointed to by the urgent pointer arrives, the OOB data block (one
byte) is removed from the data stream and buffered. If a subsequent TCP
segment arrives with the urgent flag set (and a new urgent pointer), the OOB
byte currently queued can be lost as it is replaced by the new OOB data
block (as occurs in Berkeley Software Distribution). It is never replaced in
the data stream, however.

With SO_OOBINLINE enabled, the urgent data remains in the data stream. As a
result, the OOB data block is never lost when a new TCP segment arrives
containing urgent data. The existing OOB data "mark" is updated to the new
position.

Link to article that contains info about OOB and non-OOB data flaged as
urgent; watch for wrapping:

http://msdn.microsoft.com/library/de...and_data_2.asp

HTH

"N. Spiker" <N. Sp****@discussi ons.microsoft.c omwrote in message
news:DF******** *************** ***********@mic rosoft.com...
>I am attempting to receive a single TCP packet with some text ending with
carriage return and line feed characters. When the text is send and the
packet has the urgent flag set, the text read from the socket is missing
the
last character (line feed). When the same text is sent without the urgent
flag set, all of the characters are read.

I'm reading the data using the blocking read call of the network stream
class. The .NET documentation does not discuss a special method needed to
support reading urgent data from a network stream.

I verified that in both cases the data is arriving correctly using a
packet
sniffer (Ethereal). I also verified that both receiving and sending
parties
are interpreting the urgent pointer according to the BSD implementation.

Is the urgent flag supported?

Jul 8 '06 #2
Dave,

In my test app I am not setting the SO_OOBINLINE socket option. Because of
this, the byte indicated by the urgent pointer field in the packet is
removed. In the app, I am reading the network stream using the class
NetworkStream (System.IO.Stre am.NetworkStrea m) and the blocking read method.
Using this class, how would I read this removed byte of data or be notified
that an urgent byte of data is available?

As a follow-up, after reading the article you referenced, I am left
wondering whether the urgent flag is widely used. It appears that it would
not be. Is this an accurate statement?

Thanks again,
Nate

"Dave Sexton" wrote:
Hi N. Spiker,

From MSDN for OOB data:
Arrival of a TCP segment with the URG (for urgent) flag set indicates the
existence of a single byte of OOB data within the TCP data stream. The "OOB
data block is one byte in size. The urgent pointer is a positive offset from
the current sequence number in the TCP header that indicates the location of
the "OOB data block (ambiguously, as noted in the preceding). It might,
therefore, point to data that has not yet been received.

If SO_OOBINLINE is disabled (the default) when the TCP segment containing
the byte pointed to by the urgent pointer arrives, the OOB data block (one
byte) is removed from the data stream and buffered. If a subsequent TCP
segment arrives with the urgent flag set (and a new urgent pointer), the OOB
byte currently queued can be lost as it is replaced by the new OOB data
block (as occurs in Berkeley Software Distribution). It is never replaced in
the data stream, however.

With SO_OOBINLINE enabled, the urgent data remains in the data stream. As a
result, the OOB data block is never lost when a new TCP segment arrives
containing urgent data. The existing OOB data "mark" is updated to the new
position.

Link to article that contains info about OOB and non-OOB data flaged as
urgent; watch for wrapping:

http://msdn.microsoft.com/library/de...and_data_2.asp

HTH

"N. Spiker" <N. Sp****@discussi ons.microsoft.c omwrote in message
news:DF******** *************** ***********@mic rosoft.com...
I am attempting to receive a single TCP packet with some text ending with
carriage return and line feed characters. When the text is send and the
packet has the urgent flag set, the text read from the socket is missing
the
last character (line feed). When the same text is sent without the urgent
flag set, all of the characters are read.

I'm reading the data using the blocking read call of the network stream
class. The .NET documentation does not discuss a special method needed to
support reading urgent data from a network stream.

I verified that in both cases the data is arriving correctly using a
packet
sniffer (Ethereal). I also verified that both receiving and sending
parties
are interpreting the urgent pointer according to the BSD implementation.

Is the urgent flag supported?


Jul 10 '06 #3
Hi N. Spiker,
Using this class, how would I read this removed byte of data or be
notified
that an urgent byte of data is available?
Try reading the out-of-band data using the managed Socket class by passing
SocketFlags.Out OfBand to one of the overloaded Socket.Read methods. You can
use Socket.Poll(tim eout, SelectMode.Erro r) to detect the presence of OOB
data. (Note that you can specify Timeout.Infinit e in place of the timeout
variable and Poll will block until OOB data is received)
As a follow-up, after reading the article you referenced, I am left
wondering whether the urgent flag is widely used. It appears that it
would
not be. Is this an accurate statement?
I'm not sure of its use, statistically speaking, but I am sure that
BsdUrgent flag does not provide something that you couldn't do without if
you have control over the source. In other words use proprietary encoding
or byte marks that you can detect while reading the stream to flag urgency
and transmit all data in-line so you don't have to worry about out-of-band
data, although OOB data could be used as well without the BsdUrgent flag.

HTH

"N. Spiker" <NS*****@discus sions.microsoft .comwrote in message
news:04******** *************** ***********@mic rosoft.com...
Dave,

In my test app I am not setting the SO_OOBINLINE socket option. Because
of
this, the byte indicated by the urgent pointer field in the packet is
removed. In the app, I am reading the network stream using the class
NetworkStream (System.IO.Stre am.NetworkStrea m) and the blocking read
method.
Using this class, how would I read this removed byte of data or be
notified
that an urgent byte of data is available?

As a follow-up, after reading the article you referenced, I am left
wondering whether the urgent flag is widely used. It appears that it
would
not be. Is this an accurate statement?

Thanks again,
Nate

"Dave Sexton" wrote:
>Hi N. Spiker,

From MSDN for OOB data:
Arrival of a TCP segment with the URG (for urgent) flag set indicates the
existence of a single byte of OOB data within the TCP data stream. The
"OOB
data block is one byte in size. The urgent pointer is a positive offset
from
the current sequence number in the TCP header that indicates the location
of
the "OOB data block (ambiguously, as noted in the preceding). It might,
therefore, point to data that has not yet been received.

If SO_OOBINLINE is disabled (the default) when the TCP segment containing
the byte pointed to by the urgent pointer arrives, the OOB data block
(one
byte) is removed from the data stream and buffered. If a subsequent TCP
segment arrives with the urgent flag set (and a new urgent pointer), the
OOB
byte currently queued can be lost as it is replaced by the new OOB data
block (as occurs in Berkeley Software Distribution). It is never replaced
in
the data stream, however.

With SO_OOBINLINE enabled, the urgent data remains in the data stream. As
a
result, the OOB data block is never lost when a new TCP segment arrives
containing urgent data. The existing OOB data "mark" is updated to the
new
position.

Link to article that contains info about OOB and non-OOB data flaged as
urgent; watch for wrapping:

http://msdn.microsoft.com/library/de...and_data_2.asp

HTH

"N. Spiker" <N. Sp****@discussi ons.microsoft.c omwrote in message
news:DF******* *************** ************@mi crosoft.com...
>I am attempting to receive a single TCP packet with some text ending
with
carriage return and line feed characters. When the text is send and
the
packet has the urgent flag set, the text read from the socket is
missing
the
last character (line feed). When the same text is sent without the
urgent
flag set, all of the characters are read.

I'm reading the data using the blocking read call of the network stream
class. The .NET documentation does not discuss a special method needed
to
support reading urgent data from a network stream.

I verified that in both cases the data is arriving correctly using a
packet
sniffer (Ethereal). I also verified that both receiving and sending
parties
are interpreting the urgent pointer according to the BSD
implementation.

Is the urgent flag supported?



Jul 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2344
by: abhilash agarwal | last post by:
hi all!! pl help me i m getting a run time error "memory address .... refer to this location....... memory could not be written at this location....." ..... means some memory address when i m trying to run a programme in which i m setting line style to any color except "0" which is for BLACK
3
6707
by: Liu Ju | last post by:
Dear members: I want to use the multithread in my program which is developed in Visual C++ platform (version 6). I created a controlling function: UINT CCOMM1Dlg::WritingThreadFunc(LPVOID pParam) for a thread The reason that I want it to belong to the class CCOMM1Dlg is that in this function I need to process some member variables of the class.
7
1479
by: Dave | last post by:
Hello all, In the code below, I use a pointer to an object under construction. Is the usage below legal? I have come across similar code at work. It compiles, but I'm not sure it's really legal... Thanks, Dave struct D;
8
5260
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The _summary_ history table will have the following fields: ServiceName, Date, User-Ref1, User-Ref2,...
42
5619
by: baumann | last post by:
hi all, typedef int (*pfunc)(int , int); pfunc a_func; i know it's ok, but how can define a_func without typedef statement? thanks .
204
13060
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 = {0,1,2,4,9};
41
10049
by: Alexei A. Frounze | last post by:
Seems like, to make sure that a pointer doesn't point to an object/function, NULL (or simply 0) is good enough for both kind of pointers, data pointers and function pointers as per 6.3.2.3: 3 An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.55) If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed...
1
2181
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include <string>
50
4493
by: Juha Nieminen | last post by:
I asked a long time ago in this group how to make a smart pointer which works with incomplete types. I got this answer (only relevant parts included): //------------------------------------------------------------------ template<typename Data_t> class SmartPointer { Data_t* data; void(*deleterFunc)(Data_t*);
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.