Pages

Tuesday, June 28, 2011

Calculating Subnets in Linux

Here are some Linux tools that can calculate subnets

 ipcalc
~$ ipcalc 192.168.2.1/28
Address:   192.168.2.1          11000000.10101000.00000010.0000 0001
Netmask:   255.255.255.240 = 28 11111111.11111111.11111111.1111 0000
Wildcard:  0.0.0.15             00000000.00000000.00000000.0000 1111
=>
Network:   192.168.2.0/28       11000000.10101000.00000010.0000 0000
HostMin:   192.168.2.1          11000000.10101000.00000010.0000 0001
HostMax:   192.168.2.14         11000000.10101000.00000010.0000 1110
Broadcast: 192.168.2.15         11000000.10101000.00000010.0000 1111
Hosts/Net: 14                    Class C, Private Internet


sipcalc
~$ sipcalc 192.168.2.1/28
-[ipv4 : 192.168.2.1/28] - 0

[CIDR]
Host address        - 192.168.2.1
Host address (decimal)    - 3232236033
Host address (hex)    - C0A80201
Network address        - 192.168.2.0
Network mask        - 255.255.255.240
Network mask (bits)    - 28
Network mask (hex)    - FFFFFFF0
Broadcast address    - 192.168.2.15
Cisco wildcard        - 0.0.0.15
Addresses in network    - 16
Network range        - 192.168.2.0 - 192.168.2.15
Usable range        - 192.168.2.1 - 192.168.2.14


-

Sunday, June 26, 2011

Measure network performance with Iperf/JPerf

Iperf is open source network performance tool developed by NLANR/DAST. It measures maximum TCP and UDP bandwidth performance and reports bandwidth, delay jitter, datagram loss. (Jperf the graphical front end written in Java). So it can be used to solve speed and throughput issues.

Available for windows and Linux


Setup



Tuesday, June 21, 2011

Conky for system monitoring

I wanted a tool to show system monitoring for my desktop but not to consume a lot of resources. Goggling around I found Conky.
Conky is a free, light-weight system monitor for X, that displays any information on your desktop. Conky can display just about anything, either on your root desktop or in its own window by using scripts and other external programs. Conky has more than 250 built in objects, including support for a plethora of OS stats  Conky can display this info either as text, or using simple progress bars and graph widgets, with different fonts and colours.
Internet is full of examples as well as a wiki page

Below the system monitoring I created based on my needs.




Monday, June 20, 2011

Ethernet card speed and duplex settings

Using ethtool

ethtool is the standard Linux utility for controlling network drivers and hardware, particularly for wired Ethernet devices. Among others it can be used to get identification and diagnostic information, extended device statistics , control speed, duplex, autonegotiation and flow control for Ethernet devices
Check the complete syntax of the commands here

To see some information in Ubuntu of your Ethernet adapter
 ~$ lspci | grep -i eth   
 00:0a.0 Ethernet controller: nVidia Corporation MCP77 Ethernet (rev a2)  
 ~$ ethtool -i eth0  
 driver: forcedeth  
 version: 0.64  
 firmware-version:   
 bus-info: 0000:00:0a.0  
How to determine Ethernet connection speed in Ubuntu

 ~$ sudo ethtool eth0  
 Settings for eth0:  
   Supported ports: [ MII ]  
   Supported link modes:  10baseT/Half 10baseT/Full   
               100baseT/Half 100baseT/Full   
               1000baseT/Full   
   Supports auto-negotiation: Yes  
   Advertised link modes: 10baseT/Half 10baseT/Full   
               100baseT/Half 100baseT/Full   
               1000baseT/Full   
   Advertised pause frame use: No  
   Advertised auto-negotiation: Yes  
   Link partner advertised link modes: Not reported  
   Link partner advertised pause frame use: No  
   Link partner advertised auto-negotiation: No  
   Speed: 100Mb/s  
   Duplex: Full  
   Port: MII  
   PHYAD: 1  
   Transceiver: external  
   Auto-negotiation: on  
   Supports Wake-on: g  
   Wake-on: d  
   Link detected: yes  

 You can filter the output using grep , to show the needed parameter
 sudo ethtool eth0 | grep -i speed  
   Speed: 100Mb/s  


How to change Ethernet card speed and duplex settings  in Ubuntu
To Turn off Auto-Negotiate feature
 sudo ethtool -s eth0 autoneg off  
To setup your Ethernet network card speed 100 and full duplex
 sudo ethtool -s eth0 speed 100 duplex full  
To setup your Ethernet network card speed 10 and half duplex
 sudo ethtool -s eth0 speed 10 duplex half  

For permanent settings see  this page


Using mii-tool 
Deprecated and replaced by the newer ethtool command,
I have tried with mii-tool but my Ethernet card does not support it

 sudo mii-tool eth0  
 SIOCGMIIPHY on 'eth0' failed: Operation not supported  

Friday, June 17, 2011

Wireless throughput from Notebook

Having similar setup as before I decided to check now, how much throughput I can get from my wireless on notebook.

SETUP


RESULTS
It seems that throughput increases when notebook is running on AC, and drops when running on batteries, most probably because of the Power Saving mode.

Monday, June 13, 2011

How to check release version in Ubuntu

There are many ways to check from Ubuntu the release version.

~$ cat /etc/issue.net
Ubuntu 8.04.4 LTS
~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04.4 LTS"
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 8.04.4 LTS
Release:        8.04
Codename:       hardy
~$ cat /etc/issue
Ubuntu 8.04.4 LTS \n \l

Sunday, June 12, 2011

Wireless throughput from Sony Ericsson XPERIA X8

I wanted to test the wireless throughput from my mobile device.
One tool that can do this is Iperf.

Setup



Results
Best throughput I could get was 17.4 Mbits/sec.
See the tests carried out in detail below.