CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    54

    Counting Overhead On A Socket

    I want to include some built-in performance monitoring in my Winsock-based server program. I can easily keep track of the number of bytes that I send through Winsock functions, but I'm also interested in keeping track of how many bytes are sent out over the network. The difference is that the number of bytes sent out over the network will include the TCP/IP protocol header. This way I can see what sort of overhead I'm experiencing, which may be significant for my application.

    Is there an easy way to get how many bytes have been sent over a socket, including all protocol headers or other overhead?

  2. #2
    Join Date
    Dec 2007
    Posts
    30

    Re: Counting Overhead On A Socket

    you can use ethereal tool get the bytes over your network card and if you are using TCP protocol,TCP protocol header size plus IP protocol header size should be 54 bytes.please refer to TCP/IP book,you can get TCP protocol or IP protocol header size.
    Best,
    Kevin Jo
    http://www.upredsun.com
    **Easily and automatically build tcp-based or udp-based network protocol source code**

  3. #3
    Join Date
    Nov 2004
    Posts
    54

    Re: Counting Overhead On A Socket

    I was hoping for a way of doing this in my program rather than using an external program, but as far as I know there's no way for my program to know how many packets winsock sends as a result of me sending data through my sockets.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured