1

We would like to develop a desktop tool for checking the packet loss between server and client. Tool will be running on client machine. The client has port 4172 TCP and UDP open and can communicate on that port. Is it possible to identify data transfer in both direction? Are there any .net api to do this?

I have checked some tools like Pcap.Net and WinPcap

1 Answers1

3

.Net has some Ping classes that make this pretty easy. This guy has some sample code that should get you started: http://forum.codecall.net/topic/37643-c-packet-lossping-program/

jackmott
  • 1,112
  • 8
  • 16
  • Thanks Jackmott. This is very helpful. Can you please tell me more about this, like does this solution work for all protocols (TCP/UDP)? And I also wants to measure roundtrip time. – Prashant Hatte Jan 11 '16 at 14:05
  • 1
    The Ping class uses it'd own protocol - ICMP which is distinct from TCP and UDP. If you wanted to get specific metrics on TCP and UDP you would need to roll your own code that sends messages and times them and counts lost packets. I'm not sure if C# will let you measure lost TCP packets, since the protocol will hide them by resending. – jackmott Jan 12 '16 at 02:08
  • I know this is an old thread, but as a complement to @jackmott comment and a cross-reference for people reading this thread, refer to https://stackoverflow.com/questions/1338006/handling-dropped-tcp-packets-in-c-sharp – Mahdad Baghani Dec 03 '20 at 13:44