Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Network Duplex speed test

by NetWallah (Canon)
on Sep 08, 2003 at 04:32 UTC ( #289675=note: print w/replies, xml ) Need Help??


in reply to Network Duplex speed test

Interesting little program - I'm curious - is there a reason you decided to use sockets and hand-craft packets, instead of using pcap ?

Also - I'm surprised you didn't build-in a subnet scanner into this. Perhaps you were trying to get basic functionality into this, and have a higher-level control program , which you could perhaps share ??

I'm thinking this would be useful to probe and discover the less-reliable parts of a switched network, and perhaps uncover faulty wiring, flaky switches, or even unauthorized network extensions. Perhaps even as an indicator of network segment performance at different times of the day.

Replies are listed 'Best First'.
Re: Re: Network Duplex speed test
by Preceptor (Deacon) on Sep 10, 2003 at 08:36 UTC
    I've used pcap in different programs, and essentially, the route I went to develop it didn't really go near pcap :). I've always thought of pcap as a way to write custom packet sniffing tools (I've got one that just logs host and service of machines that access a particular server. Used just prior to decommissioning it to check if anything would break horribly when we did)

    I started with a need to send pings, so started using Net::Ping. Then, when that proved no use for my needs, I started looking at the source code, and adapting from there.
    The reason I didn't include a subnet scanner, was partially because as is, this program fulfills my need, and partially because sending a large number of fragmented ICMP packets counts as a DOS. So hitting a whole subnet with them is a very rude thing to do.
    For subnet scanning, I use nmap. It's fairly easy to do a pingsweep in nmap, and feed the results through to this script :)

    I hadn't really considered using it as a network performance indicator. I suppose that as the network load drops, the quantity of returned packets will increase, but my primary aim was to track down the few machines that were slowing us down (backups primarily) by running half duplex.
      Looks like a handy bit of code. I'm trying to use it on our dinky LAN, just testing and hoping to do some benchmarking and learning more about network programming in Perl. However, I'm getting errors from the recv() calls - they are resulting in undefined $remote. I'm giving the program IP addresses on our local LAN (e.g. 10.0.0.20), ones that I can successfully ping. Where do I go from here? (ooh, I opened myself up that time). melora
        Never mind, I found it. The size (10240) used to make up a message was larger than the SIZE 1500 used to specify the maximum length of a message. Thanks for a handy piece of code! melora
Re: Re: Network Duplex speed test
by Anonymous Monk on Sep 08, 2003 at 05:08 UTC
    My guess would be because the pcap interface is severely broken/outdated/whatever.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://289675]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2023-12-03 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (20 votes). Check out past polls.

    Notices?