Friday, March 27, 2009

Routing/NATing on windows (XP, Vista)

A little known feature on most windows machine
is that they allowing network address translation
for other connections. Say, if you have
two wired connections an eth0 and eth1. If eth0
is connected to the internet, you can enable
eth1 to have the internet connection and windows
does this by running NAT for eth1.


This is done by going to the network connections
window. Right clicking on the interface that
has the internet connection (outbound connection)
i.e. eth0 in our case and check the box for
sharing the connection with other users on the
sharing tab. This will allow the connection to do
NATing for other users while putting them on a
default network like 192.168.0.1/24. It is a
good idea either to configure DHCP on other network
clients which could be connected to this machine
through a hub or by a cross over cable (wired case).
Static IPs on the same subnet can
also be assigned.

Fore more details lookup information on ICS on windows

Rename interface eth in linux

It is possible to change the name of the device E.g. eth0 to something like eth-intel if your machine is using udev to populate the device entries in sysfs.


Edit the file -
vi /etc/udev/rules.d/70-persistent-net.rules

as root or a power user and change entries with eth0 to whatever
you desire.

udev support is available for most kernels in the 2.6 generation.
For older kernel versions there might be tools such as hwconfig or mii-tools
available which could do the job.

If you are using a Gnome/KDE desktop, the networking/management tools
on the GUI provides a mechanism to change the name of the interface
from ethX to ethY. This facility allows direct renaming of the
interfaces while changing the udev rules itself.

Wednesday, March 25, 2009

Difference between sockets and RPC calls

Both mechanisms are intended for doing similar stuff. There is a difference in the way they are invoked and the way they operate (which can be found in tons of individual tutorials).

However the key point to note is that both mechanisms are still similar. RPC's can be thought of as an abstraction running over sockets. Sockets in turn are a crude transport mechanism (like UDP or TCP) which can be used to send just about anything. RPCs can be thought of as sending formatted information over sockets.

Check out our other post for differences

Tuesday, March 24, 2009

Break column in latex references

Latex has a beautiful tag which goes as -
\vfill\eject

This tag is to be inserted in to the .bbl file
that is generated (bibliography).
The tag is to be added before the reference entry where
you desire to end the current column and start from the
top of the second column.

Ensure that you do not re-generate your bibliography
as this will wipe out the tag entry. Please post a comment
if you have questions regarding the use of this and we will
try to reply at the earliest.

Run wireshark from command line (Linux)

A nice alternative to running wireshark in a GUI environment is to run tshark. This feature provides similar functionality to the conventional wireshark tool, but can be run like tcpdump on the console. This eliminates the need to separately sniff and make sense of packets seen on the interface.

A simplest example could be to write a binary file
$> tshark -i interface -w file.bin

or to write a plain text as -
$> tshark -i interface > file.txt

Difference short and long retry limit in wlan (802.11)

The limits define the number of MAC retries for different
types of packets. The short retries are incremented
whenever a control frame or a short frame smaller than the
rts threshold) is retransmitted. Similarly long retries are
incremented when a long packet frame is retransmitted. If
either of these retries reach their respective limits (short
or long depending on the size of the data frame), the frame
is automatically discarded.

Madwifi drivers allow to set the retry limit for frames
with the command -
iwconfig ath0 retry XX


With the Atheros family of wireless cards, *nix based machines support a
nice utility by the name athstats. Athstats
allows you to measure both the short and the long retries for a node
on a per second basis.
Typical usage -
athstats duration

The duration value is in secs.

Check out our other post for differences