Add netbw option to systat

Bryan Venteicher bryanv at daemoninthecloset.org
Fri Jul 11 05:30:06 UTC 2014


On Wed, Jul 2, 2014 at 7:54 PM, hiren panchasara <hiren.panchasara at gmail.com
> wrote:

> On Wed, Jul 2, 2014 at 4:50 PM, Bryan Venteicher
> <bryanv at daemoninthecloset.org> wrote:
> > Awhile back, DragonlyFlyBSD added a netbw option to systat that I've
> ported
> > to FreeBSD and found handy at various times:
> >
> >    netbw      Display aggregate and per-connection TCP receive and
> transmit
> >                       rates.  Only active TCP connections are shown.
> >
> > Leading to output such as:
> >
> > tcp accepts        connects                 rcv 1.192G snd 15.77K rexmit
> >
> >   192.168.10.80:22      192.168.10.20:23103 rcv        snd 415.7  [
>  NTSX ]
> >   192.168.10.80:22      192.168.10.20:46560 rcv 19.80M snd 14.47K [
>  NTSX ]
> >   192.168.10.80:22      192.168.10.20:60699 rcv        snd 886.3  [
>  NTSX ]
> >   192.168.10.81:5201    192.168.10.51:60844 rcv 293.2M snd        [R
>  TSX ]
> >   192.168.10.81:5201    192.168.10.51:60845 rcv 293.5M snd        [R
>  TSX ]
> >   192.168.10.81:5201    192.168.10.51:60846 rcv 293.2M snd        [R
>  TSX ]
> >   192.168.10.81:5201    192.168.10.51:60847 rcv 292.9M snd        [R
>  TSX ]
> >
> > It uses the sequences number from the 'struct tcpcb' to derive the rates,
> > which is usually good but certainly not perfect (i.e., don't set the
> > interval too long).
> >
> > I'd like to commit this if anybody else thinks they'd find it useful.
> >
> > http://people.freebsd.org/~bryanv/patches/systat-netbw.patch
>
> I like the idea.
>
> A few things about the patch:
> 1) You may want to remove the code hidden behind "#if 0" at 2 places.
>


​That's inherited as is from the ​DragonflyBSD code, and I was trying to
keep the diff relativity small with upstream. I'll remove it the hidden
code.



> 2) I am not entirely clear on why/if we need the last column with
> flags but if we keep it (for compatibility of any other reason), It
> would be nice to have those flags explained in the manpage:
>
> + mvwprintw(wnd, LINES-2, 0,
> +  "Rate/sec, "
> +  "R=rxpend T=txpend N=nodelay T=tstmp "
> +  "S=sack X=winscale F=fastrec");
>

​Yes, I'll document them.​


> 3) I feel that the header line for o/p (specially 'tcp accepts and
> connects' terminology) can be improved but I do not have a better
> suggestion :-)
>
> It looks okay me otherwise and thanks for your work.
>
> cheers,
> Hiren
>


More information about the freebsd-net mailing list