Subject: [Diffserv] APIs for diffserv

From: Thomas Narten <[email-masked]>
Date: Tue, 15 Oct 2002 09:42:15 -0400

The IPv6 basic and advanced APIs include placeholders/hooks for
specifying the Flow Label on outgoing IPv6 packets. But the way the
API is specified, the entire first 32 bits of the IP header can be
specified, which includes the Traffic Class field. Many of the details
are unspecified, however.

Questions:

1) What work has been done with regards to specifying an API for
   setting the Traffic Class fields? Anything other than the IPv6
   APIs?

2) Is it adequiate for the existing IPv6 APIs (basic and advanced)
   to simply allow the traffic class to be set via the flow label
   mechanism (without specifying the details much)?

3) What about APIs for IPv4? Aren't they needed too?

4) Or is there an assumption here that endpoint applications setting
   the traffic class themselves via an API is not particularly
   interesting or necessary?

Have a look at

    draft-ietf-ipngwg-rfc2553bis-07.txt and    
    draft-ietf-ipngwg-rfc2292bis-07.txt

for the details of what has been specified so far.

Thoughts of what (if anything more) should be done with APIs for
diffserv would be appreciated.

Thomas
_______________________________________________
diffserv mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/diffserv
Archive: http://www.ietf.org/mail-archive/working-groups/diffserv/current/maillist.html

---

From: Brian E Carpenter <[email-masked]>
Date: Tue, 15 Oct 2002 22:36:09 +0200

>    setting the Traffic Class fields? Anything other than the IPv6

There was draft-itojun-ipv6-flowlabel-api-01.txt (April 2001).
itojun may want to comment.
>    mechanism (without specifying the details much)?

It needs to be possible to set the 6 bits of the DSCP independently
of either the flow label or the ECN bits. Ditto the flow label. 
If the proposed APIs can't do that, they are inadequate.

> 3) What about APIs for IPv4? Aren't they needed too?

I thought that you could set the TOS byte in the v4 API. Again,
you have to avoid messing up the ECN bits, but I would expect the
TCP/IP stack to take over those bits.

>    interesting or necessary?

It's been debated, but in the general case it is desirable. The DSCP bits
may be set within the stack by a QOS manager, or downstream by a router,
but apps should have the ability in principle. The flow label may be set
within the stack, or in principle by the app.

   Brian

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Brian E Carpenter 
Distinguished Engineer, Internet Standards & Technology, IBM 
On assignment at the IBM Zurich Laboratory, Switzerland
_______________________________________________
diffserv mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/diffserv
Archive: http://www.ietf.org/mail-archive/working-groups/diffserv/current/maillist.html

---

From: Pekka Savola <[email-masked]>
Date: Wed, 16 Oct 2002 00:04:40 +0300 (EEST)

> itojun may want to comment.
[...]

And also draft-itojun-ipv6-tclass-api-03.txt (July 2001):

ftp://ftp.itojun.org/pub/paper/draft-itojun-ipv6-tclass-api-03.txt

-- 
Pekka Savola                 "Tell me of difficulties surmounted,
Netcore Oy                   not those you stumble over and fall"
Systems. Networks. Security.  -- Robert Jordan: A Crown of Swords

---

From: [email-masked]
Date: Wed, 16 Oct 2002 10:28:03 +0900

>itojun may want to comment.

	the API for traffic class field is merged into 2292bis.  see 2292bis
	for exact wording i've put in.  basically ECN bits specified by user
	can be overridden by the kernel, if the kernel implements ECN
	mechanism (like for TCP).

	i stopped updating draft-itojun-ipv6-flowlabel-api-01.txt as there were
	a lot of discussions on flowlabel semantics, like
	draft-ietf-ipv6-flow-label-03.txt.
	my plan was to re-start on the API side once the flowlabel semantics
	discussion gets completed.  btw, i don't think flowlabel relates to
	diffserv, am i right?

itojun

---

From: Jukka MJ Manner <[email-masked]>
Date: Wed, 16 Oct 2002 09:37:47 +0300 (EEST)

Hi, a quick answer, 

> 3) What about APIs for IPv4? Aren't they needed too?

  (On Linux) The application can use:

  setsockopt(fd,IPPROTO_IP,IP_TOS, &optval, sizeof(optval));

  where optval includes the DSCP value to be used. The "IPTOS_TOS_MASK"  
is used to mask bits out, eg. the ECN bits.

	Regards,

	Jukka

Research Scient
Department of Computer Science
University of Helsinki, Finland
http://www.cs.Helsinki.Fi/u/jmanner/

---

From: Brian E Carpenter <[email-masked]>
Date: Wed, 16 Oct 2002 16:24:02 +0200

>         discussion gets completed.  btw, i don't think flowlabel relates to

That is slightly contentious. The flow-label draft does not
define use cases, but if that draft is approved in its present
form I know how to define a diffserv use case for the
flow label (and there are several other use cases). However, it
shouldn't affect the socket API discussion.

   Brian

---

From: "Andreas Kassler" <[email-masked]>
Date: Thu, 17 Oct 2002 16:16:45 +0200

And finally on Win32 platforms, the code snippet looks like the following
(see the platform SDK):
   int tos, tos_len;
   tos_len = sizeof(tos);

   if (getsockopt(sock, IPPROTO_IP, IP_TOS, (char *)&tos,
                  &tos_len) == SOCKET_ERROR)
       printf("\nWarning: TCPIP stack does not support the "
              "IP_TOS option - %d\n", WSAGetLastError());

   if (setsockopt(sock, IPPROTO_IP, IP_TOS, (char *)&tos,
                  tos_len) == SOCKET_ERROR)
      printf("\nWarning: Fail to set TOS value: error - %d",
             WSAGetLastError());

You can also modify the following key in the Registry Editor to change the
TOS value set in the header of outgoing IP packets:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
   Value Name: DefaultTOS
   Value Type: REG_DWORD
   Valid Range: 0x00, 0x02, 0x04, 0x08, 0x10Regards, Andreas
----- Original Message -----
From: "Jukka MJ Manner" <[email-masked]>
To: "Thomas Narten" <[email-masked]>
Cc: <[email-masked]>; <[email-masked]>
Sent: Wednesday, October 16, 2002 8:37 AM
Subject: Re: [Diffserv] APIs for diffserv

> Archive:
http://www.ietf.org/mail-archive/working-groups/diffserv/current/maillist.ht
ml