Sunday, July 25, 2010

Protocol Analyzers

After JDSU acquiring Agilent testing unit solutions, the demand for engineers ready to provide telecom measuement equipment support, seems to have risen up in the air!

This post tries to provide insights in varied protocol analyzers' run time usage.

First what is a protocol analyzer?

It is a device analyzing granular details of  stream of  incoming high speed packets based on the programmed protocol. most commonly used protocol analyzers are ethereal, wireshark, RS-232 analyzers working on windows platform.

Figure below displays network packets captured on ethereal.




Ethereal is a freely available open source program that runs on almost any operating system.It is capable of dissecting 385 protocols including SMTP, ATM, IGRP, PPP, IPX, IP, UDP, TCP, MAC, Etherent. It also supports configurable filters that allow user to drill down on the particular data he is interested in. A snapshot of capturing options provided by ethereal can be seen below:




Wireshark is an enhanced version of ethereal; for details refer link:
http://en.wikipedia.org/wiki/Wireshark

Wednesday, July 21, 2010

Multi-Dimensional Arrays in C/C++

Use of multi-dimensional arrays in C/C++ is a little tricky especially after 2+ scale.

I have devised some tips to understand them better:

For a n-scale array, to calculate offset address for a particular element, use the formula:



Base address of array +  2(pow n-1) * (size of data type) (nth index) + 2(pow n-2) * (size of data type) (n-1th index)  till n is 1 + (size of data type) * last entryindex.

discussing scale 4:

i     j    k  l

0   0    0  0

0   0    0   1

0   0  1    0

0   0   1   1

0 1    0   0

0 1    0   1

0 1 1 0


0 1 1 1

1 0 0 0

1 0 0 1

1 0 1 0

1 0 1 1

1 1 0 0

1 1 0 1

1 1 1 0

1 1 1 1

For example, for second last entry, put values as:

BA + 2 (pow 4-1)* sizeof DT *(1) + 2(pow 2) * sizeof DT *(1) + 2(pow 1) * sizeof DT *(1) + sizeof DT *0

Tip 2:

To completely dereference a data value, total de-reference operators must be equal to the scale of array.


Tip 3:
(arr + index) =  &(arr[index) at any level.

Keeping these tips in mind, i have solved a complex code available at:

http://pastie.org/1053208

Output as seen on GNU compiler is pasted below:




Feel free to post multi-dimensional arrays questions in C/C++

Mindbox