Wednesday, 5 November 2014

Mystery of changing IP address on NIC interfaces in Linux

In our lab we  use Linux Server PC, Fedora core 14. It had 8 LAN Network interfaces card and is used as PPPoE server, DHCP server and Radius Server.  All interfaces have static IP addresses assigned to them, but we were facing below issues with it:

1) After  every reboot, one NIC card will take IP Address of another NIC card.

2) One NIC card if goes up and down the default IP address will become 0.0.0.0

So if there is any change of state or PC reboot, we need to again manually assign the IP address of the NIC cards.

We used both the methods to assign ip address:

1) ifconfig  Command  ( ifconfig eth0 8.1.1.1 netmask 255.255.255.0 up)

2)Right corner->Network Configuration-> Edit connection->


It took some time to figure out what was happening once we decided to solve this problem forever.

Analysis

For each interface the configuration files are stored in /etc/sysconfig/network-script/ifcfg-<name>. For example for eth1 we should have /etc/sysconfig/network-script/ifcfg-eth1.

We saw we had different names for the same interfaces in command prompt and config files .The name was eth1, but in config file it was stored as Auto-eth1. For the NIC which was taking IP address of other NIC, the HWADDR field was not present. The NIC which was taking none ip address after up/down was actually configured as DHCP in config files. Below is sample file :


DEVICE=eth1
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth1
UUID=9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04
USERCTL=yes
IPADDR0=25.1.1.1
PREFIX0=24
DEFROUTE=no

HWADDR=1C:6F:65:C6:4A:9C

Resolution

To make it work make sure the Edit connection have proper static ip address , no two interfaces should have default gateway. Now edit the /etc/sysconfig/network-script/ifcfg-<name> file and make sure it reflects same name and values as in Edit connections. Make sure below fields are matching properly between "Edit Connections" and config files :

DEVICE, NAME, HWADDR

IF these fields are not present in the config file, edit and give them properly.

After reboot everything worked fine !

Mystery solved.

Keep Trying , Keep Solving !

Tuesday, 4 November 2014

ICICI Prudential Website exceptions

Got below Exception while paying premium for ICICI prudential website. ICICI bank let your website be properly tested ???
================================================

 Compilation of JSP File '/customer/onlinepay/view/OnlinePaySuccessView.jsp' failed:

OnlinePaySuccessView.jsp:1:19: 'try' statement has neither 'catch' nor 'finally' clause
 <%@ page import="org.apache.log4j.Logger"%>
                  ^---------------------^
OnlinePaySuccessView.jsp:1589:25: This expression can throw an exception java.lang.Exception that is not caught by any enclosing try statement and is not allowed in this method, constructor, or initializer block.
                                    SMSFlagSplit = transactionDAO.insertToSmsPushLogSplit(EnterMobileNo,
                                                                                       ^----------------------------------------------------
                                            strPolicyNum, Transaction_id, strPendingAmt);
----------------------------------------------------------------------------------------------------^
OnlinePaySuccessView.jsp:2529:12: This expression can throw an exception java.lang.Exception that is not caught by any enclosing try statement and is not allowed in this method, constructor, or initializer block.
    Vector v1=cd.getMailDetails(policyViewBeanDataBean.getClientID());
                  ^-----------------------------------------------------^
OnlinePaySuccessView.jsp:2812:1: Expression expected (found 'catch' instead)
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Illegal use of an expression as a statement.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Syntax error: expected ) (found '__ee' instead)
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Illegal use of an expression as a statement.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Syntax error: expected ; (found ')' instead)
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Syntax error: expected } (found 'EOF' instead)
</body>
^------
</html>
------^

================================================
 

Monday, 8 September 2014

Fedora 20-Wireshark install by yum but not working

For Wireshark to work on Fedora we need two packages wireshark and wireshark-gnome.

Give below commands and it should start working.

yum install wireshark
yum install wireshark-gnome

Thursday, 4 September 2014

How to configure PPPoE client on Linux

 
Assuming you have pppoe package installed in PC

Steps:

1)  Run "pppoe-setup"script with default configuration and proper user name and password

2) Verify the user name and password given above is copied into /etc/ppp/pap-secrets

3) run "pppoe-connect"

If server is configured  properly the pppoe link should come up.

Sample pppoe.conf file

#***********************************************************************
#
# pppoe.conf
#
# Configuration file for rp-pppoe.  Edit as appropriate and install in
# /etc/ppp/pppoe.conf
#
# NOTE: This file is used by the pppoe-start, pppoe-stop, pppoe-connect and
#       pppoe-status shell scripts.  It is *not* used in any way by the
#       "pppoe" executable.
#
# Copyright (C) 2000 Roaring Penguin Software Inc.
#
# This file may be distributed under the terms of the GNU General
# Public License.
#
# LIC: GPL
# $Id$
#***********************************************************************

# When you configure a variable, DO NOT leave spaces around the "=" sign.

# Ethernet card connected to DSL modem
ETH='eth2'

# PPPoE user name.  You may have to supply "@provider.com"  Sympatico
# users in Canada do need to include "@sympatico.ca"
# Sympatico uses PAP authentication.  Make sure /etc/ppp/pap-secrets
# contains the right username/password combination.
# For Magma, use xxyyzz@magma.ca
USER='magma'

# Bring link up on demand?  Default is to leave link up all the time.
# If you want the link to come up on demand, set DEMAND to a number indicating
# the idle time after which the link is brought down.
DEMAND=no
#DEMAND=300

# DNS type: SERVER=obtain from server; SPECIFY=use DNS1 and DNS2;
# NOCHANGE=do not adjust.
DNSTYPE=SPECIFY

# Obtain DNS server addresses from the peer (recent versions of pppd only)
# In old config files, this used to be called USEPEERDNS.  Changed to
# PEERDNS for better Red Hat compatibility
PEERDNS=no

DNS1=
DNS2=

# Make the PPPoE connection your default route.  Set to
# DEFAULTROUTE=no if you don't want this.
DEFAULTROUTE=yes

### ONLY TOUCH THE FOLLOWING SETTINGS IF YOU'RE AN EXPERT

# How long pppoe-start waits for a new PPP interface to appear before
# concluding something went wrong.  If you use 0, then pppoe-start
# exits immediately with a successful status and does not wait for the
# link to come up.  Time is in seconds.
#
# WARNING WARNING WARNING:
#
# If you are using rp-pppoe on a physically-inaccessible host, set
# CONNECT_TIMEOUT to 0.  This makes SURE that the machine keeps trying
# to connect forever after pppoe-start is called.  Otherwise, it will
# give out after CONNECT_TIMEOUT seconds and will not attempt to
# connect again, making it impossible to reach.
CONNECT_TIMEOUT=30

# How often in seconds pppoe-start polls to check if link is up
CONNECT_POLL=2

# Specific desired AC Name
ACNAME=

# Specific desired service name
SERVICENAME=

# Character to echo at each poll.  Use PING="" if you don't want
# anything echoed
PING="."

# File where the pppoe-connect script writes its process-ID.
# Three files are actually used:
#   $PIDFILE       contains PID of pppoe-connect script
#   $PIDFILE.pppoe contains PID of pppoe process
#   $PIDFILE.pppd  contains PID of pppd process
CF_BASE=`basename $CONFIG`
PIDFILE="/var/run/$CF_BASE-pppoe.pid"

# Do you want to use synchronous PPP?  "yes" or "no".  "yes" is much
# easier on CPU usage, but may not work for you.  It is safer to use
# "no", but you may want to experiment with "yes".  "yes" is generally
# safe on Linux machines with the n_hdlc line discipline; unsafe on others.
SYNCHRONOUS=no

# Do you want to clamp the MSS?  Here's how to decide:
# - If you have only a SINGLE computer connected to the DSL modem, choose
#   "no".
# - If you have a computer acting as a gateway for a LAN, choose "1412".
#   The setting of 1412 is safe for either setup, but uses slightly more
#   CPU power.
CLAMPMSS=1412
#CLAMPMSS=no

# LCP echo interval and failure count.
LCP_INTERVAL=20
LCP_FAILURE=3

# PPPOE_TIMEOUT should be about 4*LCP_INTERVAL
PPPOE_TIMEOUT=80

# Firewalling: One of NONE, STANDALONE or MASQUERADE
FIREWALL=NONE

# Linux kernel-mode plugin for pppd.  If you want to try the kernel-mode
# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
LINUX_PLUGIN=

# Any extra arguments to pass to pppoe.  Normally, use a blank string
# like this:
PPPOE_EXTRA=""

# Rumour has it that "Citizen's Communications" with a 3Com
# HomeConnect DSL Modem DualLink requires these extra options:
# PPPOE_EXTRA="-f 3c12:3c13 -S ISP"

# Any extra arguments to pass to pppd.  Normally, use a blank string
# like this:
PPPD_EXTRA=" noauth "


########## DON'T CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
# If you wish to COMPLETELY overrride the pppd invocation:
# Example:
# OVERRIDE_PPPD_COMMAND="pppd call dsl"

# If you want pppoe-connect to exit when connection drops:
# RETRY_ON_FAILURE=no

Wireless client mode , can it work in bridge with Ethernet ?

Lets say we have below setup :


   PC1----Eth0-- (Linux-1)----Wifi client ~~~~~~~Wifi AP------(Linux-2)---Eth0--PC2


Setup details:

1) Linux-1 and Linux-2 are two devices with each having wireless interface and an ethernet interface.

2) Linux-1 wireless interface is defined as client and Linux-2 wireless interface as  AP

3) Create bridge in Linux devices and add both the interface to the bridge. For L-1 it is Client and eth0 and L-2 its AP interface and eth0.

4) Ping from PC1 to PC2 -> will it be successful , all ip address are in same subnet.

Note : Wifi client and Wifi AP are just wireless interfaces on which mode is configured as Client and AP with proper Bandwidth, channel etc to make wireless link between the two interfaces.

Refer below links and see if you can find any answer for this question.

 http://wiki.openwrt.org/doc/howto/clientmode
http://wiki.mikrotik.com/wiki/Manual:Wireless_Station_Modes

Answer:


Explanation-1 :

The 802.11 standard only uses three MAC addresses for frames transmitted between the Access Point and the Station. Frames transmitted from the Station to the AP don't include the ethernet source MAC of the requesting host and response frames are missing the destination ethernet MAC to address the target host behind the client bridge.
  1. Bridged Host sends a packet to the Target host
  2. Frame is relayed via the W-LAN Client and the MAC address of the transmitting wireless adapter is used as source MAC, the sending ethernet MAC is discarded
  3. W-LAN AP receives the frame and redirects it to the Target
  4. Target receives the frame and generates a response
  5. Target responds to the received frame using the (wrong) source MAC as destination
  6. W-LAN AP relays the frame to the W-LAN Client with the given destination MAC
  7. W-LAN Client receives the frame and assumes it is the final destination since it's wireless MAC is used in the frame, the packet is not forwarded
  8. Bridged Host never sees a response frame since the W-LAN Client became the destination, no connection is possible
 Explanation-2:

Historically 802.11 AP devices were supposed to be able to bridge frames between wired network segment and wireless, but station device was not supposed to do L2 bridging.

Consider the following network:
[X]---[AP]-(     )-[STA]---[Y]
 
where X-to-AP and STA-to-Y are Ethernet links, but AP-to-STA are connected using wireless. According to 802.11, AP can transparently bridge traffic between X and STA, but it is not possible to bridge traffic between AP and Y, or X and Y.
802.11 standard specifies that frames between station and AP device must be transmitted in so called 3 address frame format, meaning that header of frame contains 3 MAC addresses. Frame transmitted from AP to station has the following addresses:
  • destination address - address of station device, also radio receiver address
  • radio transmitter address - address of AP
  • source address - address of originator of particular frame
Frame transmitted from station to AP has the following addresses:
  • radio receiver address - address of AP
  • source address - address of station device, also radio transmitter address
  • destination address
Considering that every frame must include radio transmitter and receiver address, it is clear that 3 address frame format is not suitable for transparent L2 bridging over station, because station can not send frame with source address different from its address - e.g. frame from Y, and at the same time AP can not format frame in a way that would include address of Y.

Analysis:

As per above explanation it is clear that we cannot bridge the station device.

Solution:

  For this to work, both the client and the AP need to transmit 4-address frames, containing both source and destination MAC addresses.

"iwpriv ath0 wds 1"

From Madwifi Documentation 

# create and configure AP interface
wlanconfig ath0 create wlandev wifi0 wlanmode ap
iwconfig ath0 essid "my_ap_essid" channel <X>

# create first WDS interface, tell about WDS partner, enable WDS mode
wlanconfig wdsath10 create wlandev wifi0 wlanmode wds
iwpriv wdsath10 wds_add <mac_address_of_wds_partner_1>
iwpriv wdsath10 wds 1

# create second WDS interface, tell about WDS partner, enable WDS mode
wlanconfig wdsath11 create wlandev wifi0 wlanmode wds
iwpriv wdsath11 wds_add <mac_address_of_wds_partner_2>
iwpriv wdsath11 wds 1

# bring all interfaces up
# NOTE: Bringing up the AP interface first is important at this time
ifconfig ath0 up
ifconfig wdsath10 up
ifconfig wdsath11 up

# create the bridge and enslave all needed interfaces
brctl addbr br0
brctl addif br0 ath0
brctl addif br0 wdsath10
brctl addif br0 wdsath11

# bring up the bridge
ifconfig br0 up
}}}

Monday, 25 August 2014

How to compile iperf3 for Windows

I was able to compile the binary for iperf3.0.6 code-base. The procedure is almost same as described in above blog with few changes.

1) Install Cygwin on windows : Download http://cygwin.com/setup-x86.exe from http://cygwin.com/install.html.

2) Run setup-x86.exe -> On the page of package selection screen click on 'Devel' so that 'Default' changes to 'Install' . We need development tools for compiling the code.

3) Download iper3.0.6 from http://downloads.es.net/pub/iperf/iperf-3.0.6.tar.gz

4) Copy it in c:\cygwin directory , unzip the iperf folder and copy the main directory to this (c:\cygwin folder)

5) Open the cygwin shell prompt, go to c:\cygwin\iperf-3-0.6 directory

6) ./configure  -> it should work fine

6) make
============================================
Making all in src
make[1]: Entering directory '/cygdrive/c/cygwin/iperf-3.0.6/iperf-3.0.6/src'
make  all-am
make[2]: Entering directory '/cygdrive/c/cygwin/iperf-3.0.6/iperf-3.0.6/src'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -g -O2 -Wall -MT cjson.lo -MD -MP -MF .deps/cjson.Tpo -c -o cjson.lo cjson.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -MT cjson.lo -MD -MP -MF .deps/cjson.Tpo -c cjson.c  -DDLL_EXPORT -DPIC -o .libs/cjson.o
cjson.c: In function 'cJSON_strcasecmp':
cjson.c:58:2: warning: array subscript has type 'char' [-Wchar-subscripts]
  for ( ; tolower(*s1) == tolower(*s2); ++s1, ++s2)
  ^
cjson.c:58:2: warning: array subscript has type 'char' [-Wchar-subscripts]
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -MT cjson.lo -MD -MP -MF .deps/cjson.Tpo -c cjson.c -o cjson.o >/dev/null 2>&1
mv -f .deps/cjson.Tpo .deps/cjson.Plo
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -g -O2 -Wall -MT iperf_api.lo -MD -MP -MF .deps/iperf_api.Tpo -c -o iperf_api.lo iperf_api.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -MT iperf_api.lo -MD -MP -MF .deps/iperf_api.Tpo -c iperf_api.c  -DDLL_EXPORT -DPIC -o .libs/iperf_api.o
In file included from iperf_api.c:40:0:
iperf_api.h:227:5: error: conflicting types for 'iprintf'
 int iprintf(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3)));
     ^
In file included from /usr/include/stdio.h:29:0,
                 from iperf_api.c:13:
/usr/include/stdio.h:259:5: note: previous declaration of 'iprintf' was here
 int _EXFUN(iprintf, (const char *, ...)
     ^
iperf_api.c:2583:1: error: conflicting types for 'iprintf'
 iprintf(struct iperf_test *test, const char* format, ...)
 ^
In file included from /usr/include/stdio.h:29:0,
                 from iperf_api.c:13:
/usr/include/stdio.h:259:5: note: previous declaration of 'iprintf' was here
 int _EXFUN(iprintf, (const char *, ...)
     ^
Makefile:838: recipe for target 'iperf_api.lo' failed
make[2]: *** [iperf_api.lo] Error 1
make[2]: Leaving directory '/cygdrive/c/cygwin/iperf-3.0.6/iperf-3.0.6/src'
Makefile:615: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/cygdrive/c/cygwin/iperf-3.0.6/iperf-3.0.6/src'
Makefile:369: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

===================================

Got above error , looks like iprintf is defined at two places at /usr/include/stdio.h
and at iperf_api.c

Resolution :
search for declaration of iprintf in iperf_api.c files and replace it with another function name iiprintf. I have used Editplus for editing the files. Now search for the the same function iprintf in all files and replace it with iiprintf almost 3 files and 55 places need to be changed.

or use below command (not tested but got from above ref link)

cd ./src
find ./ -iname "*.[ch]" |xargs -n1 sed -i s'#iprintf#newprintf#g'

7) Again run make , it should pass this time

8) make install

9) copy /usr/local/bin/iperf3.exe -> to another folder where all files will be kept , lets name it as  "iperf306"

10) Now copy below files from C:\cygwin\bin into iperf306
  • cygwin1.dll
  • cyggcc_s-1.dll
  • cygstdc++-6.dll
11) copy the whole folder iperf306 to another pc and try running it

12) if while starting server or client you get below error , means ipv6 is not supported on the Windows machine.

 iperf3: error - unable to start listener for connections: Protocol not available

Try running with -4 option

iperf3.exe -4 -s

iperf3,exe -4 -c 198.173.1.1

13)  Now server is starting fine but below error came:

iperf3: error - unable to create a new stream: No such file or directory

Still trying to understand the issue , meanwhile if anyone can help , will be just GREAT  !

Will update if found solution.

Happy trying !

Updated : Sept 15, 2015

As per suggestions from Daniel in comments I did below changes and compiled the code again. Now it is working fine.

"C:\cygwin\iperf-3.0.7\src\iperf_api.c"(2264,24):

char template[] = "/tmp/iperf3.XXXXXX";

to

char template[] = "./iperf3.XXXXXX";

Thanks Daniel and Rion for your comments.

Free IEEE 802.11 WLAN Simulator -Pamvotis

A nice simulator to test 802.1e parameters and

Pamvotis is a Wireless LAN Simulator for all the current physical layer extentions of the IEEE 802.11 (IEEE 802.11 a/b/g) standard and for the IEEE 802.11e Draft for Quality of Service in WLANs.

http://www.pamvotis.org/

We can get below statistics from this tool:

  • Throughput (bits/sec): The number of bits that a node successfully transmitted in a specific time interval.
  • Throughput (packets/sec): The number of packets that a node successfully transmitted in a specific time interval.
  • Utilization: The percentage of the channel capacity the node occupied. The utilization is the node's throughput in bits per second divided by the node's data rate.
  • Retransmission Attempts: The mean number of retransmission attempts (collisions) until the packet is successfully transmitted.
  • Media access delay: The delay of a packet from the time it is picked up from the transmitter until it is successfully received from the receiver. This statistic contains the delay due to retransmission attempts and the transmission delay. Note: The statistic is relative to the packet length. Moreover, it does not depend on the node's packet generation rate, but only on the network load.
  • Queuing delay: The delay from the birth of a packet until the transmitter picks it up for transmission. It only contains the time a packet waits in the packet queue. It is relative to the packet generation rate and to the media access delay.
  • Total packet delay: The sum of the media access delay and the queuing delay. It is the total delay from the birth of a packet until its reception from the receiver.
  • Delay Jitter: The total delay jitter of each node. The delay jitter is the standard deviation of the total packet delay of each node.
  • Packet Queue Length: The mean number of packets that wait to be transmitted in the packet queue


Saturday, 23 August 2014

ISO/IEC/IEEE 29119 Software Testing -The International Software Testing Standard


The new standard 29119 on software testing is finalized and is evoking responses from various tester communities. If you don't know about this standard and its controversy read on ...

The standard's description can be found at below site, as its "Standard" it will be paid, so after paying fees only you will be able to get the actual standard.

http://softwaretestingstandard.org/

It says :

========================================================
ISO/IEC/IEEE 29119 Software Testing is an internationally agreed set of standards for software testing that can be used within any software development life cycle or organisation. By implementing these standards, you will be adopting the only internationally-recognised and agreed standards for software testing, which will provide your organisation with a high-quality approach to testing that can be communicated throughout the world. There are currently five standards:

    ISO/IEC 29119-1: Concepts & Definitions (published September 2013)
    ISO/IEC 29119-2: Test Processes (published September 2013)
    ISO/IEC 29119-3: Test Documentation (published September 2013)
    ISO/IEC 29119-4: Test Techniques (at DIS stage, anticipating publiation in late 2014)
    ISO/IEC 29119-5: Keyword Driven Testing (at CD stage, anticipating publication in 2015)

Plus, based on the processes defined in ISO/IEC/IEEE 29119-2:

    ISO/IEC 33063: Process Assessment Model (at DIS stage)

The ISO/IEC/IEEE 29119 standards replace a number of existing software testing standards:

    IEEE 829 Test Documentation
    IEEE 1008 Unit Testing
    BS 7925-1 Vocabulary of Terms in Software Testing
    BS 7925-2 Software Component Testing Standard

===========================================================

People who are opposing this says:

1) Costly

2) Will be seen as mandatory skill for testers (may harm individuality and freedom)

3) May loose ability to experiment and try non-conventional ways

4) Once standard is accepted, testers can be held responsible for project failures ( non-compliance)

5) Effort will be more on documentation and process rather than testing


What you can do : Learn/Share/Write/Sign the below Petition for stopping it:

http://www.ipetitions.com/petition/stop29119


Ref:
Keep Trying, Keep Analyzing !



OSI/ISO network management model- FCAPS

We know about OSI seven layer model and  TCP/IP layers, but only few knows about another model which is known as OSI/ISO network management model or the FCAPS model.

FCAPS stands for fault, configuration, accounting, performance and security. These are the five management areas and were initially defined as ISO standard which later got changed into ITU-T standard known as TMN recommendation on Management Functions (M.3400) and can be found at

http://www.itu.int/rec/T-REC-M.3400-200002-I/en

Brief explanation on these functions :

Fault management— Detect, isolate, notify, and correct faults encountered in the network.

 Configuration management— Configure aspects of network devices, such as configuration file management, inventory management, and software management.

 Accounting management— Collect usage information of network resources.

  Performance management— Monitor and measure various aspects of performance so that overall performance can be maintained at a defined level.

    Security management— Secure access to network devices, network resources, and services to authorized individuals.



Ref : Wiki, etutorials.org

Sunday, 20 July 2014

How to enable DHCP RELAY option 82 on Cisco DHCP Server ?


Option 82 is defined in RFC : 3046 (https://tools.ietf.org/rfc/rfc3046.txt) . It is DHCP Relay Agent Information Option, which includes sub-options "Agent Circuit ID Sub-option" and "Agent Remote ID Sub-option" .

How DHCP Relay works


DHCP Server -----DHCP Relay -------DHCP Client

1) DHCP Client send DHCPOFFER as broadcast packet to DHCP Relay.

2) DHCP Relay knows DHCP Server Ip address, it increments HOP=1, and add DHCP Relay agent address ( its own LAN side IP) and send Unicast packet to DHCP Server

3) DHCP Server understands that its a packet from Relay , sends DHCPOFFER back to Relay agent as unicast packet.

4) DHCP OFFER is forwarded to DHCP Client by Relay.

5) DHCPREQUEST from Client and DHCP-ACK from Server follows the same path as above.

6) DHCP Client is not aware of any DHCP-RELAY in between and the relay acts as if it is DHCP Server.

7) DHCP-Relay is in routing mode , so the interfaces ip address are different.


Option 82

Option 82 is required if there are multiple DHCP Relay in between and each relay is to be assigned from a different pool of IP address. The IP address will be assigned based on Agent id and Circuit id which is to be defined properly in Server.

How to enable option 82 in Cisco DHCP Server

192.168.7.1 192.168.7.2 10.0.0.1
Cisco DHCP Server -----Fedora 11 Linux DHCP Relay -----Windows XP DHCP Client

In this setup we will see how we can enable option 82 in both Linux DHCP Relay agent and CISCO DHCP Server.

Linux DHCP Relay Configuration

1) Download and install latest dhcrelay rpm, I have used isc-dhcrelay-4.2.2rc1

2) Start dhcrelay be giving below command

dhcrelay -a -d -i eth1 -i eth2 192.168.7.1

The -a option enable option 82 in Linux DHCPRelay, open Wireshark and note down the value of Option 82.

Cisco DHCP Server Configuration for option 82

configure t
ip dhcp use class

ip dhcp class relay1
  relay agent information
     relay-information hex 01060240234*

ip dhcp pool pool1
  network 10.0.0.0 255.0.0.0
  default-gateway 10.0.0.1
  class relay1

     address range 10.0.0.10 10.0.0.20

ip route 10.0.0.0 255.0.0.0 192.168.7.2


The hex "01060240234*" information is the Value seen in option 82 of Client DHCPDISCOVER , bootp options. if you have multiple dhcp-relay in network you can add the  class, pool and static route to reach the specific relay and the DHCP server will assign the IP address range as per the RELAY agent configured range.

DHCP Client

ipconfig /release

ipconfig /renew

Client should get IP address 10.0.0.10


In Windows 2012 Server the option 82 can be matched against the option 82 value or with sub-options 
Agent id or Remote Circuit id.

Keep Learning , Keep Sharing!

Tuesday, 1 July 2014

Which parameter defines wireless client max idle timeout ?

Question : Once the wireless client is connected (authenticated and associated) to Access Point, if no data is passed between Client and AP, after how much time the connection will break or which parameter defines it?

Answer : This parameter is known as BSS Max Idle Period and is defined in 802.11 standard, 802.11-2012.pdf as:

The BSS Max Idle Period element contains the time period a non-AP STA can refrain from transmitting frames to the AP before the AP disassociates the STA due to inactivity.


The Max Idle Period field indicates the time period during which a STA can refrain from transmitting frames to its associated AP without being disassociated. The Max Idle Period field is a 16-bit unsigned integer. The time period is specified in units of 1000 TUs. The value of 0 is reserved. A non-AP STA is considered inactive if the AP has not received a data frame or management frame of a frame exchange sequence initiated by the STA for a time period equal to or greater than the time specified by the Max Idle Period field value.

The Idle Options field indicates the options associated with the BSS Idle capability.


The Protected Keep-Alive Required bit set to 1 indicates that the STA sends an RSN protected frame to the AP to reset the Idle Timer at the AP for the STA, as defined in 10.23.12. If the Protected Keep-Alive  Required bit is 0, the STA sends either an unprotected or a protected frame to the AP to reset the Idle Timer  at the AP.


The BSS Max Idle Period element is included in Association Response frames and  Re-association Response frames.


For hostapd we can define it using parameter  ap_max_inactivity=300


# Station inactivity limit

#
# If a station does not send anything in ap_max_inactivity seconds, an
# empty data frame is sent to it in order to verify whether it is
# still in range. If this frame is not ACKed, the station will be
# disassociated and then deauthenticated. This feature is used to
# clear station table of old entries when the STAs move out of the
# range.
#
# The station can associate again with the AP if it is still in range;
# this inactivity poll is just used as a nicer way of verifying
# inactivity; i.e., client will not report broken connection because
# disassociation frame is not sent immediately without first polling
# the STA with a data frame.
# default: 300 (i.e., 5 minutes)
#ap_max_inactivity=300


In Cisco Wireless LAN controller , this field is "User idle Timeout"

The User Idle Timeout: When a user is idle without any communication with the LAP for the amount of time set as User Idle Timeout, the client is de-authenticated by the WLC. The client has to reauthenticate and  reassociate to the WLC. It is used in situations where a client can drop out from its associated LAP without notifying the LAP. This can occur if the battery goes dead on the client or the client associates move away.

Monday, 23 June 2014

Short Introduction of IETF/IEEE/ITU/FCC/Wi-fi

IETF :

The IETF's official products are documents, published free of charge as RFCs. "RFC" stands for Request for Comments, and this name (used since 1969, before the IETF existed) expresses something important: the Internet is a constantly changing technical system, and any document that we write today may need to be updated tomorrow.

One way to look at the IETF is as the group of people who work together to improve the technology of the Internet on a daily basis. As well as producing RFCs, the IETF is a forum where network operators, hardware and software implementers, and researchers talk to each other to ensure that future protocols, standards and products will be even better. This is not the only technical forum for the Internet, of course. But it is the forum where the basic technical standards for Internet protocols are set and maintained.

The IETF does not standardize transmission hardware (we leave that to organizations like the IEEE and the ITU) and does not standardize specialized application layer protocols. For example, we leave HTML and XML standards to the World-Wide Web Consortium. But the IETF does standardize all the protocol layers in between, from IP itself up to general applications like email and HTTP.

http://www.ietf.org/newcomers.html

List of RFC created by IETF:

http://www.rfc-editor.org/rfc-index2.html

ITU (International Telecommunication Union)

The ITU comprises three sectors, each managing a different aspect of the matters handled by the Union, as well as ITU Telecom. The sectors were created during the  restructuring of ITU at its 1992 Plenipotentiary Conference. Radiocommunication (ITU-R) managing the international radio-frequency spectrum and satellite orbit resources is at the heart of the work of the ITU Radiocommunication Sector (ITU-R).

Standardization (ITU-T)
Standardization was the original purpose of ITU when it was founded. This sector remains responsible global telecommunications standards, except for radio.Prior to 1992 it was known as the International Telephone and Telegraph Consultative Committee or CCITT (from its French name "Comité consultatif international téléphonique et télégraphique").

Development (ITU-D)
Established to help spread equitable, sustainable and affordable access to information and communication technologies (ICT).

ITU TELECOM

ITU Telecom organizes major events for the world's ICT community.

Search  List of ITU-T standards:

http://www.itu.int/ITU-T/recommendations/index.aspx

H.323

http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=H.323


IEEE


IEEE's Constitution defines the purposes of the organization as "scientific and educational, directed toward the advancement of the theory and practice of Electrical, Electronics, Communications and Computer Engineering, as well as Computer Science, the allied branches of engineering and the related arts and sciences."

 In pursuing these goals, the IEEE serves as a major publisher of scientific journals and organizer of conferences, workshops, and symposia (many of which have associated published proceedings).

It is also a leading standards development organization for the development of industrial standards (having developed over 900 active industry technical standards) in a broad range of disciplines, including electric power and energy, biomedical technology and healthcare, information technology, information assurance, telecommunications, consumer electronics, transportation, aerospace, and nanotechnology.

IEEE develops and participates in educational activities such as accreditation of electrical engineering programs in institutes of higher learning.

All 802 standard are IEEE stadard and you can download it free through IEEE get program:

http://standards.ieee.org/about/get/802/802.11.html

FCC:

The Federal Communications Commission regulates interstate and international communications by radio, television, wire, satellite and cable in all 50 states,the District of Columbia and U.S. territories.

The FCC's rules and regulations are in Title 47 of the Code of Federal Regulations (CFR), which are published and maintained by the Government Printing Office. Title 47 Rules & Regulations are also available on the web in a searchable format. Part 15 of it defines rules and regulation for "RADIO FREQUENCY DEVICES". It covers regulations related to frequency, BW, max power of the intentional radiator, Max EIRP and type of devices (indoor and outdoor).

Rules and regulation can be found at:

http://www.ecfr.gov/cgi-bin/text-idx?

SID=5b4b39ebc249c57af9bcefbd1ca86fba&tpl=/ecfrbrowse/Title47/47cfr15_main_02.tpl



Wi-fi Alliance :

http://www.wi-fi.org/who-we-are

Wi-Fi Alliance Mission:

    Provide a highly-effective collaboration forum
    Grow the Wi-Fi industry
    Lead industry growth with new technology specifications and programs
    Support industry-agreed standards
    Deliver great product connectivity through testing and certification

About Wi-Fi Alliance®

Wi-Fi Alliance is a global non-profit industry association – our members are the worldwide network of companies that brings you Wi-Fi®. The members of our collaboration forum come from across the Wi-Fi ecosystem and share a vision of seamless connectivity. Since 2000, the Wi-Fi CERTIFIED™ seal of approval designates products with proven interoperability, industry-standard security
protections, and the latest technology. Wi-Fi Alliance has certified more than 18,000 products, delivering the best user experience and encouraging the expanded use of Wi-Fi products and services in new and established markets. Today, billions of Wi-Fi products carry a significant portion of the world’s data traffic in an ever-expanding variety of applications.


List of wifi certified products:

http://www.wi-fi.org/certified-products-results?category=3&ga_category=Access

+Point+for+Home+or+Small+Office+%28Wireless+Router%29

Reference: Respective official sites

Tuesday, 15 April 2014

How to untar/extract a tar.bz2/tar/tar.gz file

To untar/extract a file with different type of extensions , we need to use slightly different options:

1) .tar.bz2
 
            tar -jxvf xyz.tar.bz2
 
2) .tar
 
           tar -xf xyz.tar
 
3) .tar.gz
 
           tar -xzvf archive.tar.gz
 
4) .tar.bz
 
            tar -xzvf archive.tar.bz

 

Thursday, 10 April 2014

CALM, DSRC (Dedicated short-range communications) Standards-short Info

CALM: CALM stands for Communication Access for Land Mobile

CALM enables the following communication modes:

  • Vehicle-to-Infrastructure (V2I)
  • Vehicle-to-Vehicle (V2V)
  • Infrastructure-to-Infrastructure (I2I)

Methods of transmission used by CALM can be any one of these :      

·         Infrared

·         GSM

·         DSRC 5.8-5.9 GHz (legacy systems)

·         IEEE 802.11 standard

·         Bluetooth

·         RFID

DSRC:  Dedicated short-range communications

DSRC :One-way or two-way short-range to medium-range wireless communication channels specifically designed for automotive use, it consists of a collection of standards for all OSI layers and still some are in review phase


    EN 12253:2004 :Physical layer using microwave at 5.8 GHz
    EN 12795:2002 :DSRC Data link layer: Medium Access and Logical Link Control
    EN 12834:2002 :Application layer
    EN 13372:2004 :DSRC profiles for RTTT applications
    EN ISO 14906:2004:Application interface


Background:
In October 1999: FCC: allocated 75 MHz of spectrum in the 5.9 GHz band to be used by intelligent transportation systems (ITS).
In August 2008: ETSI allocated 30 MHz of spectrum in the 5.9 GHz band for ITS.

V2I (Vehicle-to-Infrastructure)

·         Two intersection RSE messages enable a suite of intersection-related safety applications.

·         SPaT message - Signal Phase and Timing

·         MAP message – Intersection geometry

·         Other RSEs can send Traveler Information message on curve speed, height restriction, icy roads, etc.

·         IP data exchange with servers in the Internet – RSE acts as forwarder

V2V(Vehicle-to-Vehicle)

·         Each vehicle broadcasts its core state information in a “Basic Safety Message” (BSM) nominally 10 times/sec.

·         BSM is sent in 360o pattern using IEEE 802.11p technology.

·         Upon receipt of BSM, vehicle safety host builds model of each neighbor’s trajectory, assesses threat to host vehicle, warns driver (or takes control) if threat becomes acute.



Ref:      

http://en.wikipedia.org/wiki/Dedicated_short-range_communications

http://en.wikipedia.org/wiki/Communications,_Air-interface,_Long_and_Medium_range

DSRC ppt from https://mentor.ieee.org

Saturday, 8 February 2014

Powerful Ping command (Linux and Windows Ping)

Ping command is the first step or basic command in networking. It has many options which many people are not aware.

Also the ping command options differ in Linux and Windows.

To ping host 10.0.0.1 , 100 packets with packet size 1100 bytes ,DF bit set, TTL value 32, TOS value as 252, timeout to wait for each reply= 2 sec

we have to use the commands as :


=============================================================================
Windows : ping 10.0.0.1 -n count -l size -f -i TTL -v TOS -w timeout-in-msec

Linux : ping 10.0.0.1 -c count -s size -m dont -t ttl -Q tos -W timeout-in-sec

==============================================================================
Windows : ping 10.0.0.1 -n 100 -l 1100 -f -i 32 -v 252 -w 2000

Linux : ping 10.0.0.1 -c 100 -s 1100 -m dont -t 32 -Q 252 -W 2
=============================================================================






Other options in Windows:


   -t             Ping the specified host until stopped.
                  To see statistics and continue - type Control-Break;
                  To stop - type Control-C.

   -a             Resolve addresses to hostnames.
   -r count       Record route for count hops (IPv4-only).
   -s count       Timestamp for count hops (IPv4-only).
   -j host-list   Loose source route along host-list (IPv4-only).
   -k host-list   Strict source route along host-list (IPv4-only).
   -R             Use routing header to test reverse route also (IPv6-only).
   -S srcaddr     Source address to use.
   -4             Force using IPv4.
   -6             Force using IPv6.


Other options in Linux:

-a
    Audible ping.
-A
    Adaptive ping.
-b
    Allow pinging a broadcast address.
-B
    Do not allow ping to change source address of probes.
-d
    Set the SO_DEBUG option on the socket being used.

-F flow label
    Allocate and set 20 bit flow label on echo request packets.
-f
    Flood ping. For every ECHO_REQUEST sent a period ''.'' is printed, while for ever ECHO_REPLY received a backspace is printed.

-I interface address
    Set source address to specified interface address.

-l preload
    If preload is specified, ping sends that many packets not waiting for reply.
-L
    Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.
-n
    Numeric output only. No attempt will be made to lookup symbolic names for host addresses.

-p pattern
    You may specify up to 16 ''pad'' bytes to fill out the packet you send.
-q
    Quiet output. only summary lines at startup time and when finished.
-R
    Record route.
-r
    Bypass the normal routing tables and send directly to a host on an attached interface.

-S sndbuf
    Set socket sndbuf. If not specified, it is selected to buffer not more than one packet.

-T timestamp option
    Set special IP timestamp options.

-M hint
    Select Path MTU Discovery strategy. hint may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).
-U
    Print full user-to-user latency (the old behaviour).
-v
    Verbose output.
-V
    Show version and exit.

-w deadline
    Specify a timeout, in seconds, before ping exits regardless of how many packets have been sent or received.

Wednesday, 8 January 2014

Driving in India , Hyderabad

My experience with car driving and lessons :

1) Main Aim of Driving: Reaching destinations safe and sound and in the process not getting hurt or hurting other people.

and its "NOT"

 Showing driving skill to unknown people
 Making world record for fastest driving
 

2) Don't Panic, if car stops in between.

3) Put hand brake, if it stopped in between and you or on uneven roads. The car should not go back.

4) Maintain safe distance with other vehicles including deadly combination of "L" vehicles and women drivers.

5) Night time, if car stops, put off the light and again start. Don't try switching on vehicle while its lights are on.

6) Try to drive in your lane , and check mirror , if changing lane.

7) Do not try to cross road in front of bus, they will not stop for you.

8) Parking time , be more careful not to hit other parked vehicles.

9) IF you can not see some (behind) vehicle means they are trying to overtake you, reduce your speed and let them go.

10) Motorcyclists and auto-wallas are like unwanted blessings, from where they will come its difficult to know so keep your ears and eyes open all the time.

11) Consider people crossing the road as people walking in the garden, either honk them to listen to you and allow you to cross, or reduce speed to let them cross.

12) Try not to use mobile, loud speaker music while driving, you will miss few living people, who are trying to get your attention in either provoking you to drive
fast or trying to overtake you.

13) Let other people go if they are impatient and honking continuously, you have more important work in your life than getting mad at these people.

14) If people indicator are still on while they are driving in straight road, judge on case to case basis, they forgot to switch it off or they actually want to get to the side.

15) Its a skill , master it, keep practicing.

16) Keep learning, Keep driving and never forget the "AIM" of driving.



Related Posts Plugin for WordPress, Blogger...