Viewing and changing network device properties on Solaris hosts

Project brussels from the OpenSolaris project revamped how link properties are managed, and their push to get rid of ndd and device-specific properties is now well underway! Link properties are actually pretty cool, and they can be displayed with the dladm utilities “show-linkprop” option:

$ dladm show-linkprop e1000g0

LINK         PROPERTY        PERM VALUE          DEFAULT        POSSIBLE
e1000g0      speed           r-   0              0              --
e1000g0      autopush        --   --             --             --
e1000g0      zone            rw   --             --             --
e1000g0      duplex          r-   half           half           half,full
e1000g0      state           r-   down           up             up,down
e1000g0      adv_autoneg_cap rw   1              1              1,0
e1000g0      mtu             rw   1500           1500           --
e1000g0      flowctrl        rw   bi             bi             no,tx,rx,bi
e1000g0      adv_1000fdx_cap r-   1              1              1,0
e1000g0      en_1000fdx_cap  rw   1              1              1,0
e1000g0      adv_1000hdx_cap r-   0              1              1,0
e1000g0      en_1000hdx_cap  r-   0              1              1,0
e1000g0      adv_100fdx_cap  r-   1              1              1,0
e1000g0      en_100fdx_cap   rw   1              1              1,0
e1000g0      adv_100hdx_cap  r-   1              1              1,0
e1000g0      en_100hdx_cap   rw   1              1              1,0
e1000g0      adv_10fdx_cap   r-   1              1              1,0
e1000g0      en_10fdx_cap    rw   1              1              1,0
e1000g0      adv_10hdx_cap   r-   1              1              1,0
e1000g0      en_10hdx_cap    rw   1              1              1,0
e1000g0      maxbw           rw   --             --             --
e1000g0      cpus            rw   --             --             --
e1000g0      priority        rw   high           high           low,medium,high



As you can see in the above output, the typical speed, duplex, mtu and flowctrl properties are listed. In addition to those, the “maxbw” and “cpus” properties that were introduced with the recent crossbow putback are visible. The “maxbw” property is especially useful, since it allows you to limit how much bandwidth is available to an interface. Here is an example that caps bandwidth for an interface at 2Mb/s:

$ dladm set-linkprop -p maxbw=2m e1000g0

To see how this operates, you can use your favorite data transfer client:

$ scp techtalk1* 192.168.1.10:
Password:
techtalk1.mp3 5% 2128KB 147.0KB/s 04:08 ETA

The read/write link properties can be changed on the fly with dladm, so increasing the “maxbw” property will allow the interface to consume additional bandwidth:

$ dladm set-linkprop -p maxbw=10m e1000g0

Once the bandwidth is increased, you can immediately see this reflected in the data transfer progress:

techtalk1.mp3 45% 17MB 555.3KB/s 00:38 ETA

Clearview rocks, and it’s awesome to see that link properties are going to be managed in a standard uniform way going forward! Nice!

**** UPDATE ****

I incorrectly stated that the clearview project was responsible for this awesome work, when in fact network interface property unification is part of the brussels project. The original post was updated to reflect this.

2 Comments

Jason Nemecek  on March 16th, 2009

I can appreciate the move away from the cryptic ndd stuff but this doesn’t look that much better. You still have to deal with the clutter of the “[en|adv]_[10[0][0][f|h]dx_cap” variables. I wish that Sun could condense all of this into easier to read output. I’m no longer curious if my recent Sun equipment is capable of running 10Mbps half-duplex.

I’d rather see the “Possible” column put to good use and list 3 or 6 properties as “half, full” and “10, 100, 1000″ instead of 12 properties showing “0,1″.

I can’t tell from your example, but assume that you can set a property as:
dladm set-linkprop -p speed=1000 e1000g0

and

dladm set-linkprop -p duplex=full e1000g0

(btw, you switched interfaces mid-example to e1000g1.)

I like the ability to get at the data a tiny bit easier though. I’m still using ndd and dladm show-dev in the mean time.

Thanks for the write up.

rno  on March 17th, 2009

Nice one, been using dladm show-dev for a while and it’s so much better, than the good old script using ndd to get info!

I’m not sure about the bw limitation, why just not use QoS, works fine and you can tune it… could it be really usefull to limit the bw for a whole NIC ?

Leave a Comment