1

I want to calculate the network(in & out) bytes.

I used nettop but it's not working as expected like mentioned here.

So, I moved to top. The output shows total number of packets and total size.

What is the size of each network packet displayed in the output of top command?

OS: macOS Sierra

3
  • 2
    no version of top I've ever seen displays network info on that level. perhaps iftop would be a better fit, but you won't get per packet information from anything short of a packet analyzer like pcap or wireshark, or whatever. Mar 22, 2017 at 12:36
  • 3
    Also, network packets are not a specific size, the size varies based on payload... You can't just take XXXX packets times XXXX bytes.
    – acejavelin
    Mar 22, 2017 at 12:38
  • @FrankThomas is there a command(in-built) to know the incoming and outgoing bytes? Mar 22, 2017 at 12:40

1 Answer 1

0

B = Bytes which is 8 bits. Kib = Kilobytes. MiB = Megabytes. Gib = Gigabytes. Have you tried just using the activity monitor set to network?That works pretty well for network monitoring as well.

2
  • I want to use the code in my app. So I cant use activity monitor. And my other options are mentioned in the question. Jul 10, 2017 at 22:05
  • 1
    If you use binary prefixes then it's "kibibytes", "mebibytes". Also B is for byte, b is for bit. So Kib is actually a kibibit. Your examples of units are a mess. Jul 10, 2017 at 22:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .