1

I was using SAR for monitoring bandwidth in one of my projects and I was not sure if it is reporting correct data. So I wrote a very simple dummy program (in java) for testing it which opens a server socket, opens a client connection to that server socket. The server socket upon accepting that client connection, starts writing bytebuffer (of size 1) in a while(true) loop with 1 sec sleep between each iteration. Ideally, I would expect 1 byte transfer every second on the loopback interface in the "SAR -n DEV 1 100" output but what I see is following:

10:54:53    IFACE    Ipkts/s      Ibytes/s     Opkts/s      Obytes/s 

10:54:56    lo0            2           113           2           113
10:54:56    gif0           0             0           0             0
10:54:56    stf0           0             0           0             0
10:54:56    en0            0             0           0             0
10:54:56    en1            0             0           0             0
10:54:56    fw0            0             0           0             0
10:54:56    vmnet1         0             0           0             0
10:54:56    vmnet8         0             0           0             0

Anyone who can explain this output ?

thanks, sandeep

schauhan
  • 531
  • 1
  • 5
  • 17
  • please edit your post to add the column headers - hard to tell what these numbers mean without that. – Mat Jun 23 '11 at 05:47

1 Answers1

0

If you're using a TCP connection, you don't transfer just the bytes, you also transfer some header information for each packet. Also, the client will have to acknowledge each packet received.

Jack Edmonds
  • 31,931
  • 18
  • 65
  • 77