A D Script for Observing the Network - Take Two

About a year and a half ago I wrote about a nifty little D script I came across while working with the now defunct Crossbow Virtual Wire Demo Tool. However, the script stopped compiling somewhere between the release of OpenSolaris 2009.06 and Solaris 11 Express. 

Solaris 11 Express also included the addition of two new DTrace providers, TCP and UDP. These new providers make it possible to simplify the script and Solaris Systems Architect Andrew Gabriel did this, creating so2.d

bleonard@solaris:~$ sudo dtrace -s so2.d 
Tracing... Hit Ctrl-C to end.
^C
Process              Zone       Protocol   Destination      Port           Bits

dhcpagent            global     UDP        ff02::1:2         547             512
pidgin               global     TCP        141.146.118.10   5223             720
firefox-bin          global     TCP        148.87.67.151      80          279536

Trace ran for 8 seconds

The associated Chime display is useful when you want to monitor a system with lots of network traffic. In this example I'm using Netperf to simulate traffic between my global zone and a local zone, which has been configured to run at IP address 10.0.1.25:

In this example you can see we're achieving a throughput of 681,836,544 bits per second, or approximately 682 megabits per second. In my case the local zone is configured using a VNIC, myzone0:

bleonard@solaris:~$ dladm show-vnic myzone0
LINK         OVER         SPEED  MACADDRESS        MACADDRTYPE         VID
myzone0      e1000g0      1000   2:8:20:3f:cc:8a   random              0

Notice the link speed of myzone0 is 1000 megabits per second, and at the moment it's using a good chunk of that bandwidth, potentially starving other virtual NICs and the physical NIC itself from the network. Fortunately, network virtualization allows me to put some reigns on my virtual NICs. For example, if I do the following:

bleonard@solaris:~$ sudo dladm set-linkprop -p maxbw=200 myzone0

Above we can see we're now running just under 200 megabits per second. Or More ridiculously:

bleonard@solaris:~$ sudo dladm set-linkprop -p maxbw=2 myzone0

We're now under 2 megabits per second.

Now it is also possible to drill down on the Chime display, graphing throughput over time. The above scenario looks like so:

If you want to check this out on your own environment, you only need the D script, Chime and the Network display:

Note, you'll have to edit the programFileName property of Network.xml to the location you saved the D script:
 <void property="programFileName">
   <string>/export/home/bleonard/so2.d</string>
 </void>

To launch the Chime display:

chime -C ./Network.xml

To run the netperf test for an extended period of time:

netperf -H <ip address of netserver> -l <seconds to run>
Comments:

Just to inform you i like very much your blog full of info, but right now i'm running ubuntu, and trying to install the joynet OS,but keep it up mate,Ciao

Posted by guest on October 09, 2011 at 10:21 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today