<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Amount of network I/O from C++ in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668964#M658482</link>
    <description>You may have some "complications" if there is an APA aggregate - I've not checked, but suspect you will find both the aggregate and its component ppas and as such may end-up with duplicate stats...</description>
    <pubDate>Wed, 04 Aug 2010 16:14:03 GMT</pubDate>
    <dc:creator>rick jones</dc:creator>
    <dc:date>2010-08-04T16:14:03Z</dc:date>
    <item>
      <title>Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668954#M658472</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Is there a way to determine the amount of network I/O (number of bytes sent and received by each network interface) from a C/C++ program similar to what pstat_getlv returns for each logical volume? This information should not be process-specific but global for the entire machine.&lt;BR /&gt;&lt;BR /&gt;There do not seem to be pstat functions which return information about network interfaces. Glance has the option "network by interface" to show this data but I have not found a way to get the data from a program.&lt;BR /&gt;&lt;BR /&gt;netstat -i and netstat -s only show the packets but I do not see a way to calculate the number of bytes from this, even if I found out how netstat obtains this information.&lt;BR /&gt;&lt;BR /&gt;Could the Data Link Provider Interface be useful for this purpose?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Martin Jerabek</description>
      <pubDate>Mon, 02 Aug 2010 09:34:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668954#M658472</guid>
      <dc:creator>Martin Jerabek</dc:creator>
      <dc:date>2010-08-02T09:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668955#M658473</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;wireshark or creative grep of tcpdump output can in combination with netstat give you a clear picture.&lt;BR /&gt;&lt;BR /&gt;If your distribution supports it glance/gpm from HP does have the ability to drill into a process and see how much network bandwidth is being used.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 02 Aug 2010 11:34:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668955#M658473</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2010-08-02T11:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668956#M658474</link>
      <description>Scratch the distribution part. My brain was stuck in Linux land.&lt;BR /&gt;&lt;BR /&gt;HP-UX ships with a glance/gpm 60 day trial that will let you drill into a process and see how much band width it is using.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 02 Aug 2010 11:37:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668956#M658474</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2010-08-02T11:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668957#M658475</link>
      <description>Thanks but I need a way to collect the data from a C++ program. The program should be able to react to different load scenarios, so it needs to know how "busy" the network interfaces (and other resources) are.</description>
      <pubDate>Mon, 02 Aug 2010 11:49:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668957#M658475</guid>
      <dc:creator>Martin Jerabek</dc:creator>
      <dc:date>2010-08-02T11:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668958#M658476</link>
      <description>&amp;gt;The program should be able to react to different load scenarios, so it needs to know how "busy" the network interfaces are.&lt;BR /&gt;&lt;BR /&gt;Wouldn't using APA be better judge of load scenarios?&lt;BR /&gt;And lets your program handle the business logic and leave the networking and OS stuff to somebody smarter?</description>
      <pubDate>Mon, 02 Aug 2010 11:54:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668958#M658476</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-08-02T11:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668959#M658477</link>
      <description>Unfortunately our system should be able to play this role, too. It is a networked system running on many different platforms, so we want it to work automatically rather than having to rely on different platform-specific tools.&lt;BR /&gt;&lt;BR /&gt;I managed to get the necessary information on Windows, Linux, Solaris, AIX, and Mac OS X. The network interface information on HP-UX is the only missing piece. Since Glance is able to get it (obviously via the midaemon) it must be available but I just do not see it from where.&lt;BR /&gt;&lt;BR /&gt;I ran truss on netstat to see how it does it but I am not familiar enough with the ioctls and STREAMS messages to understand it. It seems to involve /dev/ip but I have not found any documentation about it.</description>
      <pubDate>Mon, 02 Aug 2010 12:12:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668959#M658477</guid>
      <dc:creator>Martin Jerabek</dc:creator>
      <dc:date>2010-08-02T12:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668960#M658478</link>
      <description>What HP-UX version are you using?</description>
      <pubDate>Mon, 02 Aug 2010 12:28:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668960#M658478</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-08-02T12:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668961#M658479</link>
      <description>HP-UX 11.23. It only needs to work on Itanium, not on PA-RISC.&lt;BR /&gt;&lt;BR /&gt;If the necessary interfaces are only available in later versions, this would also be acceptable but of course we would prefer it not to force our customers to update their machines.</description>
      <pubDate>Mon, 02 Aug 2010 12:35:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668961#M658479</guid>
      <dc:creator>Martin Jerabek</dc:creator>
      <dc:date>2010-08-02T12:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668962#M658480</link>
      <description>If all else fails, I suppose there is system() and netstat the command and the joy of parsing its output.&lt;BR /&gt;&lt;BR /&gt;Another possiblity would be SNMP queries of the MIB(s).&lt;BR /&gt;&lt;BR /&gt;I seem to recall there being DLPI stats calls to retrieve link-level stats on a per-PPA basis, so yes, you might look into the DLPI manuals - at one time at least they would have been on docs.hp.com.</description>
      <pubDate>Tue, 03 Aug 2010 15:41:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668962#M658480</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2010-08-03T15:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668963#M658481</link>
      <description>Thanks for pointing me in the right direction! With the DLPI Programmer's Guide from &lt;A href="http://docs.hp.com/en/5992-0554/5992-0554.pdf" target="_blank"&gt;http://docs.hp.com/en/5992-0554/5992-0554.pdf&lt;/A&gt; I was able to piece together the following way to get the data:&lt;BR /&gt;&lt;BR /&gt;- Open /dev/dlpi. All the following STREAMS messages use this file descriptor.&lt;BR /&gt;&lt;BR /&gt;- Using putmsg/getmsg get the information about all network interfaces with DL_HP_PPA_REQ (I actually used DL_HP_EXT_PPA_REQ so that I can use the dl_hp_ext_ppa_info_t::dl_link_state member to check if an interface is up).&lt;BR /&gt;&lt;BR /&gt;- Attach each interface (PPA) with DL_ATTACH_REQ using the dl_ppa of the DL_HP_PPA_ACK.&lt;BR /&gt;&lt;BR /&gt;- Get its statistics with DL_GET_STATISTICS_REQ. The documentation is not clear about the returned data but it is obviously Ext_mib_t from &lt;SYS&gt;.&lt;BR /&gt;BTW, DL_HP_GET_64BIT_STATS_REQ only returned DL_NOTSUPPORTED on my machine.&lt;BR /&gt;&lt;BR /&gt;- Detach the PPA again with DL_DETACH_REQ and repeat with the next one (using dl_next_offset to find the next dl_hp_ppa_info_t).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks again to all who replied!&lt;/SYS&gt;</description>
      <pubDate>Wed, 04 Aug 2010 11:44:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668963#M658481</guid>
      <dc:creator>Martin Jerabek</dc:creator>
      <dc:date>2010-08-04T11:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668964#M658482</link>
      <description>You may have some "complications" if there is an APA aggregate - I've not checked, but suspect you will find both the aggregate and its component ppas and as such may end-up with duplicate stats...</description>
      <pubDate>Wed, 04 Aug 2010 16:14:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668964#M658482</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2010-08-04T16:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668965#M658483</link>
      <description>Thanks for the hint. I see two possibilities:&lt;BR /&gt;&lt;BR /&gt;1. The DLPI Programmer's Guide says that APA PPA numbers are in the 900 to 949 range, so I could simple ignore such PPAs.&lt;BR /&gt;&lt;BR /&gt;2. dl_hp_ext_ppa_info_t contains a field called dl_iface_type which has the bits DL_HP_CLAIMED_BY_APA and DL_HP_IS_LINKAGG. However, there is no comment for them in the system header file nor did either Google or Bing find anything for these flags, so I do not know their exact meaning. I could ignore a PPA if either bit is set but this seems a bit arbitrary.&lt;BR /&gt;&lt;BR /&gt;Do you happen to have more information?</description>
      <pubDate>Thu, 05 Aug 2010 05:07:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668965#M658483</guid>
      <dc:creator>Martin Jerabek</dc:creator>
      <dc:date>2010-08-05T05:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of network I/O from C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668966#M658484</link>
      <description>Sorry, no, no more information - the last time I looked at DLPI in any detail was when I was adding DLPI tests to netperf *many* years ago.</description>
      <pubDate>Thu, 05 Aug 2010 15:56:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/amount-of-network-i-o-from-c/m-p/4668966#M658484</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2010-08-05T15:56:30Z</dc:date>
    </item>
  </channel>
</rss>

