networking

I need a tool to log Linux network traffic by IP address

I know that there are tools for this, but I cannot seem to find what I am looking for. It should capture the number of bytes of network traffic transferred between the host machine and other machines. I am not looking for a packet capture tool like wireshark but an auditing tool that will log the number of bytes periodically (every min...

UserHostAddress gives wrong IPs

I collect statistics on IP addresses from where users visit my site and I have noticed what there are only two IP addresses presented, 172.16.16.1 and 172.16.16.248. The property I use to determine IP address is Request.UserHostAddress What could be a reason of IP address information losing? All the users are from around the world, so...

Using telnet in a C Program

Hi, I am working on a robot automation project and I have run into a road block. To control the robot, one needs to connect with it wirelessly via telnet and send commands through the tcp/ip protocol. (ex. The 'Mabc' command moves it forward based on the left wheel speed (a), the right wheel speed (b) and time (c)). What I am trying to ...

Windows networking name resolution

This is not yet particularly programing related but, I am very interested in how Vista and XP resolve network names in a home LAN situation. With Windows 2000, network name resolution was either done via the netbeui protocol - tcp/ip networks needes a wins server. XP and Vista no longer install netbeui by default, so its entirely unclea...

What's a tcpdump one-liner to dump a TCP stream that matches a given substring?

Is there a quick tcpdump one-liner to print out a TCP stream that matches a particular substring -- or, if that's not easy, how about printing out just the single TCP packet that matches the substring? ...

List of IP addresses/hostnames from local network in Python

How can I get a list of the IP addresses or host names from a local network easily in Python? It would be best if it was multi-platform, but it needs to work on Mac OS X first, then others follow. Edit: By local I mean all active addresses within a local network, such as 192.168.xxx.xxx. So, if the IP address of my computer (within th...

Pocket PC emulator with network access without Virtual PC?

In developing software for the Pocket PC platform, I have been happily using the Pocket PC emulator that Microsoft provides with Visual Studio (and as a free download). It provides for much faster develop/deploy/test cycles. (Of course, I do still final testing on real hardware). I have also found that providing the emulator to other ...

How can you change Network settings (IP Address, DNS, WINS, Host Name) with code in C#

I am developing a wizard for a machine that is to be used as a backup of other machines. When it replaces an existing machine, it needs to set its IP address, DNS, WINS, and host name to match the machine being replaced. Is there a library in .net (C#) which allows me to do this programatically? There are multiple NICs, each which nee...

networking in .net/C#

Could somebody please point me in the right direction for learning how to do networking in C#/.net 3.5? Code samples and explanations are welcome. Basically I am looking for how to do asynchronous/multithreaded server/client models. I am fairly comfortable with the basics in how to accomplish this in C++ with WinSock but though all of m...

How does traceroute work?

It seems almost magical. What is the traceroute command doing in order to map out the entire path to some other node on the Internet? ...

Buffered Multipart Form Posts in Ruby

I am currently using Net::HTTP in a Ruby script to post files to a website via a multipart form post. It works great for small files, but I frequently have to send very large files using this script, and HTTP#post only seems to accept post data as a String object, which means that the file I'm sending has to be read into memory before a...

How can I write a wrapper around ngrep that highlights matches?

I just learned about ngrep, a cool program that lets you easily sniff packets that match a particular string. The only problem is that it can be hard to see the match in the big blob of output. I'd like to write a wrapper script to highlight these matches -- it could use ANSI escape sequences: echo -e 'This is \e[31mRED\e[0m.' I'm mo...

SYN packets dropped occasionally on Linux

We're running a Debian with a 2.6.16 kernel, with iptables enabled. The system is running a custom made HTTP proxy, which is subjected to a mild load (it works fine with the same load on other sites). The system comprises of 4 servers that are preceded by a load balancer with virtual IP, which is preceded by an array of 4 ISA 2004 machin...

Emulating a UPnP router

I want to add the option of automatic port forwarding (NAT Traversal) to an application. I know this can be done using UPnP (specifically the part that communicates with the device presenting itself as an IGD - Internet Gateway Device). I need to be able to test this port forwarding feature while developing it. And whatever big router ...

What's the best way to convert from network bitcount to netmask?

For example, if I have a network spec like 172.20.10.0/24, "24" is the bitcount. What's the best way to convert that to a netmask like 0xffffff00 ? ...

Is it possible to set a timeout on a socket in Twisted?

I realize I'm probably just dumb and missing something big and important, but I can't figure out how to specify a timeout in twisted using reactor.listenUDP. My goal is to be able to specify a timeout, and after said amount of time, if DatagramProtocol.datagramReceived has not been executed, have it execute a callback or something that I...

UdpClient, Receive() right after Send() does not work?

Hi, Consider the following code: client.Send(data, data.Length, endpoint); byte[] response = client.Receive(ref endpoint); While, according to WireShark (network sniffer), the remote host does reply with data, the application here just waits for data forever... it does not receive the answer from the remote host for some reason. Any...

How do you diagnose network issues on Windows?

I often run into problems where I can't get something to connect to something else. I usually forget to check something obvious. Can you help with: A tip/technique for diagnosing a connection issue The name of a tool or application that can help (and the situation in which it's useful) I know the question is a little non-specific, bu...

Provide password using Shell script

I had setup my clients & server for passwordless login. Like passwordless login by copying RSA key of server to all client's /root/.ssh/id-rsa.pub. but this, I have done manually. I like to automate this process using shell script and providing password to the machines through script. If this problem is solved then I also want to use rsy...

How to get the system HTTP proxy configuration in Java

Is it possible to get the system proxy configuration in Java? In the Java Control Panel, you can set a proxy configuration. How can I access to that proxy configuration in order to open URL connections behind a proxy? ...