Operating System - HP-UX
1823064 Members
3307 Online
109645 Solutions
New Discussion юеВ

Type of Service (ToS) Precedence

 
SOLVED
Go to solution
Jerry Kreger
New Member

Type of Service (ToS) Precedence

Hi Folks,

I am looking for infomation on how to set the ToS precedence. In an IP packet there is an IP header. In this header there is a ToS (Type of Service) byte:

------------------------------------
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
------------------------------------
| | ToS |
^
L Precedence

There is documentation on how to set the ToS portion of the ToS byte (setsockopt; see man ip) but I don't know how to set the precedence portion of the ToS byte. Does anyone know how to do this?

Thanks for any help you can give.

OS=HP-UX 11.00


Jerry

What hath Babbage wrought?
3 REPLIES 3
Ceesjan van Hattum
Esteemed Contributor

Re: Type of Service (ToS) Precedence

The precedence-bits have not been changed since RFC791:

Packets can be filtered by precedence level, as specified by a number from
0 to 7, or by name.
The following is a list of precedence names:
bits name
--- -------------
111 network (network control)
110 internet (internetwork control)
101 critical (CRITIC/ECP)
100 flash-override
011 flash
010 immediate
001 priority
000 routine

Regards,
Ceesjan
Steven Gillard_2
Honored Contributor
Solution

Re: Type of Service (ToS) Precedence

Have you tried setting the high order bits in the unsigned char argument to setsockopt(IP_TOS)? Eg the value 0xb0 (binary 11100000) will set all the precedence bits in the TOS header to 1.

The man page only specifies three allowable values but states that no error will be returned for the other possibilities.

Regards,
Steve
Steven Gillard_2
Honored Contributor

Re: Type of Service (ToS) Precedence

Sorry, that should read 'the value 0xe0 (binary 11100000) will set all the precedence bits in the TOS header to 1'.

Regards,
Steve