Tuesday, March 11, 2008

Profiling utility

http://irl.eecs.umich.edu/jamin/pointers/gprof_quick.html

Wednesday, January 16, 2008

VPN into buggy Microsoft VPN servers with Ubuntu

http://ubuntuforums.org/showthread.php?t=610599

Thursday, January 10, 2008

Ubuntu and Seagate usb disk trouble

http://ubuntuforums.org/showthread.php?t=494673

yeah, it's solved!

ns2 on Ubuntu Gutsy Gibbon

To install ns2 on Gutsy Gibbon, install the development files for X Windows plus the g++ compiler:
sudo apt-get install xlibs-static-dev xorg-dev g++

Thursday, October 25, 2007

Save your harddrive

sudo hdparm -B 255 /dev/sda

root@linux-hero.com writes:
A recent bug report for Ubuntu Linux has confirmed that both the Feisty and Gutsy versions of Ubuntu cause some unnecessary wear and tear on a hard drive. The bug report...


ref: http://www.linux-hero.com/...

Wednesday, October 24, 2007

Problems with DNS in Linux?

sudo ethtool -K eth1 rx off tx off

Eric writes: (https://bugs.launchpad.net/ubuntu/...)

I found this problem on a new server I built. This system acts as a local router and DNS server, and also runs vmware-server. VMware is configured with vmnet0 as a bridge to eth1, which physically links to a 10/100Mbps switch for the local LAN.
VMware instances could communicate with the host system's IP over TCP but not UDP, so DNS queries would fail. Other systems on the physical LAN can query DNS just fine.

A tcpdump capture and subsequent wireshark analysis revealed that all UDP replies coming from the host server system included a bad UDP checksum. Even UDP replies going to other systems on the physical LAN show bad checksums, but I assume those systems ignore it. VMware Server's vmnet-bridge driver might silently drop these packets.

After turning off hardware checksum offloading (ethtool -K eth1 rx off tx off), everything worked perfectly. Wireshark revealed the reply packets from the host server include a correct UDP checksum.

Tuesday, October 16, 2007

Make nodes in ns-2 go for the nearest gw

This has only been tested with the UM-OLSR routing protocol.
We change our script so that the addresses of the receiving nodes to be identical, and not equal to either of the nodes:

set node_(40) [$ns_ node 42]
$node_(40) random-motion 0
set node_(41) [$ns_ node 42]
$node_(41) random-motion 0

Now we can establish a flow to one of the nodes 40 or 41, and the packets will reach the nearer of the two, based on the routing table of each node.

To avoid ns-2 error, we need to comment two lines in the ns2/classifier/classifier.cc and ns2/classifier/classifier-addr.cc files (Changes in bold face):
classifier.cc:

NsObject* Classifier::find(Packet* p)
{
NsObject* node = NULL;
int cl = classify(p);
if (cl < 0 || cl >= nslot_ || (node = slot_[cl]) == 0) {
if (default_target_)
return default_target_;
/*
* Sigh. Can't pass the pkt out to tcl because it's
* not an object.
*/

// Tcl::instance().evalf("%s no-slot %ld", name(), cl);
if (cl == TWICE) {
/*
* Try again. Maybe callback patched up the table.
*/
cl = classify(p);
if (cl < 0 || cl >= nslot_ || (node = slot_[cl]) == 0)
return (NULL);
}
}
return (node);
}

classifier-addr.cc:

NsObject* BcastAddressClassifier::find(Packet* p)
{
NsObject* node = NULL;
int cl = classify(p);
if (cl < 0 || cl >= nslot_ || (node = slot_[cl]) == 0) {
if (cl == BCAST_ADDR_MASK) {
// limited broadcast; assuming no such packet
// would be delivered back to sender
return bcast_recver_;
}
if (default_target_)
return default_target_;

/*
* Sigh. Can't pass the pkt out to tcl because it's
* not an object.
*/

// Tcl::instance().evalf("%s no-slot %d", name(), cl);
/*
* Try again. Maybe callback patched up the table.
*/
cl = classify(p);
if (cl < 0 || cl >= nslot_ || (node = slot_[cl]) == 0)
return (NULL);
}

return (node);
}