RE: not supporing -S for TOS bits setting on client
Ok I have looked into this a little more. Windows 2k gets really confused
when setting the TOS bits with IP_TOS on a UDP connection. All calls to
getpeername on a socket which has modified IP_TOS settings will result in
a unconnected socket error. Even though the connect call is made _after_
the setsockopt call, and completes with no error. If you remove all the
calls to getpeername and as a result all printed information about the
connection then it will work. This means that the socket is in fact
connected since even for UDP we use send instead of sendto calls which
require the socket to be connected. Since send does not fail with
unconnected socket on the UDP socket then all I can say is that
getpeername is implemented poorly. Since Microsoft is not at all for the
setting of TOS bits by programs (hence the need for registry editing, and
the DO NOT USE in the platform SDK), I do not see them fixing or caring
much about this problem.
Kevin
On Thu, 27 Mar 2003, Zafar Khan wrote:
> Thanks Kevin for taking time to help with this issue.
> The test with Ping works. Please attached GIF file
> that I caputueed using Ethereal , I set the TOS valaue
> to 0x10 and it showed up.
>
>
> Best Regards
> Zafar
>
>
> --- Kevin Gibbs <kgibbs --at-- ncsa.uiuc.edu> wrote:
> > Ok that looks ok. Have you tested the setting of
> > bits with ping? Can you
> > verify that works elsewhere? I have used this
> > several times with no
> > problems so I am having a hard time helping you out
> > here.
> >
> > Kevin
> >
> > On Wed, 26 Mar 2003, Zafar Khan wrote:
> >
> > > Hi Kevin,
> > >
> > > The server end is configured and listening. This
> > is
> > > how I confirmed. (with and without "-S 0x10")
> > > 1-
> > > I configured the server with this config:
> > >
> > > C:\tools\iperf>iperf -s -u -i 1
> > >
> >
> ------------------------------------------------------------
> > > Server listening on UDP port 5001
> > > Receiving 1470 byte datagrams
> > > UDP buffer size: 8.00 KByte (default)
> > >
> >
> ------------------------------------------------------------
> > > [136] local 171.69.101.62 port 5001 connected with
> > > 171.69.100.44 port 1764
> > > [ ID] Interval Transfer Bandwidth
> > > Jitter Lost/Total Datagrams
> > > [136] 0.0- 1.0 sec 118 KBytes 949 Kbits/sec
> > > 8.026 ms 1128613960/ 87 (1.3
> > > --------------------------------------------
> > >
> > >
> > >
> > > 2-
> > > I configured the client with following config
> > (without
> > > "-S" switch frist time)
> > >
> > > D:\Documents and Settings\zafkhan\My
> > > Documents\ios\tg\iperf>iperf -c 171.69.101.62 -u
> > -b 1m
> > >
> >
> ------------------------------------------------------------
> > > Client connecting to 171.69.101.62, UDP port 5001
> > > Sending 1470 byte datagrams
> > > UDP buffer size: 8.00 KByte (default)
> > >
> >
> ------------------------------------------------------------
> > > [136] local 171.69.100.44 port 1764 connected with
> > > 171.69.101.62 port 5001
> > > [ ID] Interval Transfer Bandwidth
> > > [136] 0.0-10.0 sec 1.19 MBytes 999 Kbits/sec
> > > [136] Sent 851 datagrams
> > >
> > > The data for transfered WITHOUT any problem.
> > >
> > > 3- I left the sever running and change the config
> > of
> > > client as below (just added the "-S 0x10" , rest
> > > remain same.
> > >
> > >
> > > D:\Documents and Settings\zafkhan\My
> > > Documents\ios\tg\iperf>iperf -c 171.69.101.62 -u
> > -S
> > > 0x10 -b 1m
> > >
> >
> ------------------------------------------------------------
> > > Client connecting to 171.69.101.62, UDP port 5001
> > > Sending 1470 byte datagrams
> > > getpeername failed: Socket is not connected
> > >
> > > Am I missing something ?
> > >
> > > Best Regards
> > > Zafar
> > >
> > >
> > >
> > >
> > >
> > > --- Kevin Gibbs <kgibbs --at-- ncsa.uiuc.edu> wrote:
> > > > Are you getting the connection on the server
> > side?
> > > > This client is working
> > > > fine, but if you are not running the server in
> > UDP
> > > > mode then you will get
> > > > this error.
> > > >
> > > > Kevin
> > > >
> > > > On Tue, 25 Mar 2003, Zafar Khan wrote:
> > > >
> > > > > Thanks Kevin for prompt reponse. I appreciate
> > your
> > > > > help. I am running 1.6.5 and have tweaked the
> > > > registry
> > > > > to allow TOS bit settting on widnows as
> > mentioned
> > > > on
> > > > > the microsoft site. But the problem,is that
> > Iperf
> > > > does
> > > > > not start in client mode , when I define the
> > "-S"
> > > > > swtich , as shown below :- (Seem like it try
> > to
> > > > start
> > > > > server ). can you please help with this ?
> > > > >
> > > > >
> > > > >
> > --------------------------------------------------
> > > > > D:>iperf -c 192.168.1.2 -u -b 1m -S 0x10
> > > > >
> > > >
> > >
> >
> ------------------------------------------------------------
> > > > > Client connecting to 192.168.1.2, UDP port
> > 5001
> > > > > Sending 1470 byte datagrams
> > > > > getpeername failed: Socket is not connected
> > > > >
> > > > >
> > > > > D:>iperf -v
> > > > > iperf version 1.6.5 (13 Jan 2003) win32
> > threads
> > > > >
> > > > > --------------------------------------------
> > > > >
> > > > > Her the link on Microsoft site that says to
> > how to
> > > > > change this value in registry (search on "TOS"
> > in
> > > > this
> > > > > document)
> > > > >
> > > > >
> > > >
> > >
> >
> http://www.microsoft.com/technet/treeview/default.asp?url=/technet/itsolutions/network/deploy/depovg/tcpip2k.asp
> > > > >
> > > > > ----------------Snip--------------
> > > > > DisableUserTOSSetting
> > > > >
> > > > > Key: Tcpip\Parameters
> > > > >
> > > > > Value Type: REG_DWORD—Boolean
> > > > >
> > > > > Valid Range: 0, 1 (false, true)
> > > > >
> > > > > Default: 1 (true)
> > > > >
> > > > > Description: This parameter can be used to
> > allow
> > > > > programs to manipulate the Type Of Service
> > (TOS)
> > > > bits
> > > > > in the header of outgoing IP packets. In
> > Windows
> > > > 2000,
> > > > > this defaults to True. In general, individual
> > > > > applications should not be allowed to
> > manipulate
> > > > TOS
> > > > > bits, because this can defeat system policy
> > > > mechanisms
> > > > > such as those described in the "Quality of
> > Service
> > > > > (QoS) and Resource Reservation Protocol
> > (RSVP)"
> > > > > section of this paper.
> > > > > ----------------------------------------
> > > > >
> > > > >
> > > > > Best Regards
> > > > > Zafar
> > > > >
> > > > >
> > > > > --- Kevin Gibbs <kgibbs --at-- ncsa.uiuc.edu> wrote:
> > > > > > You are going to have to use a newer iperf
> > > > version.
> > > > > > We are currently at
> > > > > > 1.6.5 which should set the TOS bits for you.
> > > > Also
> > > > > > WinXP and possibly Win2K
> > > > > > do not let you set the TOS bits unless you
> > edit
> > > > the
> > > > > > registry to allow it.
> > > > > > Please see the Windows Knowledge Base for
> > more
> > > > > > information.
> > > > > >
> > > > > > Kevin
> > > > > >
> > > > > > > >Date: Sat, 22 Mar 2003 22:04:38 -0800
> > (PST)
> > > > > > > >From: Zafar Khan <zafkhan70 --at-- yahoo.com>
> > > > > > > >Subject: Iprerf : not supporing -S for
> > TOS
> > > > bits
> > > > > > setting on client
> > > > > > > >To: dast --at-- nlanr.net
> > > > > > > >
> > > > > > > >Hi there,
> > > > > > > >
> > > > > > > >I am trying to generate traffic with
> > > > different
> > > > > > TOS
> > > > > > > >bits for my MS Project, but iperf (ver
> > > > 1.1.1)for
> > > > > > > >Windows does not accept this option ,
> > instead
> > > > > > gives an
> > > > > > > >error
> > > > > > > > "Socket is not conneted" and program
> > > > terminates.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >D:\Documents and Settings\zafkhan\My
> > > > > > > >Documents\ios\tg\iperf>iperf -c
> > 192.168.1.2
> > > > -u
> > > > > > -S
> > > > > > > >0x10 -p 2000 -t 1000
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >------------------------------------------------------------
> > > > > > > >Client connecting to 192.168.1.2, UDP
> > port
> > > > 2000
> > > > > > > >Sending 1470 byte datagrams
> > > > > > > >getpeername failed: Socket is not
> > connected
> > > > > > > >
> > > > > > > >
> > > > > > > >Please advise.
> > > > > > > >
> > > > > > > >Zafar