Did you get that Signal ?


This is going to be about signals, Linux signals.

33477682-great-western-railways-lower-quadrant-semaphore-signal-in-the-stop-danger-position-severn-valley-raiThe signal construct has been with linux since the very start and as much hasn’t changed since the start. So what I am trying here is an excerpt (although just an humble attempt) to summarize the subject. Let me know how I did.

They are a type of IPC. And thus can be sent from one process to another or can be invoked from the shell using the kill utility.

Each system has its own supported set of signals. Each signal would have a number associated with it.

 

 1) SIGHUP	 2) SIGINT	 3) SIGQUIT	 4) SIGILL
 5) SIGTRAP	 6) SIGIOT	 7) SIGBUS	 8) SIGFPE
 9) SIGKILL	10) SIGUSR1	11) SIGSEGV	12) SIGUSR2
13) SIGPIPE	14) SIGALRM	15) SIGTERM	17) SIGCHLD
18) SIGCONT	19) SIGSTOP	20) SIGTSTP	21) SIGTTIN
22) SIGTTOU	23) SIGURG	24) SIGXCPU	25) SIGXFSZ
26) SIGVTALRM	27) SIGPROF	28) SIGWINCH	29) SIGIO
30) SIGPWR
  1. The numbers can differ as per implementation.  A system with a larger word size would/could support more number of signals than one with a smaller word size.
  2. Process can only send signals to other processes which belong to the same uid and gid (This is not applicable for kernel and super user, where there is no such limitation)
  3. Signals are implemented using the task_struct of the process. So the maximum number of signals supported by the system is limited to the word size of the machine(os).
  4. Processes can mask signals, and none of the masked signals are delivered to the process until they are unmasked/unblocked. (exception would be SIGSTOP and SIGKILL, we can’t mask them)
  5. Signals can only be delivered when a process is in running state.
  6. When the signal is issue to a process which is not running, the signal is enqueued in the signal pending word. To check the pending signals look a the /proc/pid/status file under signal field. each bit indicates a pending signal to be serviced.
  7. Now since there is only one bit for each signal, only one instance of a type of signal can be in pending.
  8. When pending signals are handled the usual order would be smaller signal Id to the larger signal Id (signal id is the numeral associated with any signal)
  9. The task_struct contains the information if the signal is masked or needs to be handled as default kernel. If a particular signal needs to have a special handling a system call to sigaction needs to be made.
  10. A process can define signal handlers, these signal handler are piece of code (function). The processes’ task_struct contains information of the address of the handler function. This way the system is aware of the address where the PC needs to jump if a signal is handler to the process and a handler is mentioned for it.
  11. A Process has to be in interruptible state before it starts to handle a signal. So whenever the context is switched back to user space from kernel space (what I am saying here is when control returns back to the process from a system call) it checks for the pending signals. At this stage if a (not blocked) signal is pending (with a defined signal handler) then the programs Stack pointer and registers are modified such that after the kernel routine the signal handler is the next routine.
  12. User defined signal handlers execute in user space.

 

more later….

Remove Write Protection from SD Cards in Windows


download

While working with image copiers and SD card writer programs, at some point, you find your disk is write protected. No further writes are possible in windows from there on.

Usually a google search would land you up in traps of one or the other software trial etc. Don’t fall for it. Try the following

  1. insert the write protected SD Card in your card slot (use appropriate HW necessary for this)
  2. open command prompt in windows.
  3. type the command diskpart (provide permissions if needed)
    1. it would open the disk program in a new cmd terminal,
      prompt chars –>”DISKPART
  4. type the command “list disk
    1. show show you the disks that are detected currently.
      sample output
      * Disk 0 Online 298 GB 0 B
      Disk 1 Online 14 GB 0 B
  5. to pick your card type command “select disk 1” (use the appropriate disk number)
    1. it provides a clear message that the requested disk is selected.
  6. to ensure the actual disk you want is selected “list disk
    1. make sure the “*” is placed in front of the disk that you want to operate on
  7. to remove the read only attribute type command “ attributes disk clear readonly
    1. usually provides a message”Disk attributes cleared successfully.”

That’s all. Go ahead and get back to using the SD card like before. I did this in windows 7 and it works.

Some Cute Linux Shell Commands


This is actually a cheat sheet which I have kept coming back to I’d be happy to include more.

File Editing

  1. Add a line in a file at a specific location
    linux-user]$ sed ' i' 
    
    example
    
    linux-user]$ sed '3 inew line inserted in this location' dummyTextFile

System Related Commands

  1. Get UUID of the machine
    linux-user]$ cat /proc/sys/kernal/random/uuid
  2. Get the type of Linux you are running (distribution)
    linux-user]$ cat /etc/*-release

    or

    linux-user]$ lsb_release -a

 

SIP OFFER ANWER Models in SIP

List of Offer ANswer pairs in SIP protocol.


Offer Answer Models in SIP picture
Offer Answer Model

SIP is a text-based transactional protocol which utilized the offer answer model to exchange Local description (SDP) to establish a media session. There exists different mechanisms through which this can be done. Here is a brief list of all of those offer answer pairs.

An interesting take-away from this writeup would be the fact that the offer answer model unlike the request response model can span over more than one SIP transaction.

  1. Type 1:
    Invite Request carries Offer SDP ———>
    <——— 200 OK response carries answer SDP
  2. Type 2:
    Invite Request carries Offer SDP ———>
    <——— 18x reliable response carries answer SDP
  3. Type 3:
    18x reliable response carries Offer SDP ———>
    <——— PRACK carries answer SDP
  4. Type 4:
    18x reliable response carries Offer SDP ———>
    <——— ACK carries answer SDP
  5. Type 5:
    Prack carries offer SDP ———>
    <———200 OK (prack) carries answer SDP
  6. Type 6:
    Update carries Offer SDP ———>
    <——— 200 OK (update) carries answer SDP

Well, there could be Re-Invite too but arguably, that just plain old Invite request and thus hasn’t been explicitly included in the above list.

Another important point which I must mention is that for Type 5: kind of offer answer to occur, it is a mandate that the Offer arriving in PRACK is not the initial offer, that means an earlier successful Offer-Answer must have occurred.

If this article can be improved in any way please let me know

Thanks for stopping by.

References:


Quote: It’s better to focus on why than how.

Mutex Wisdom Scrolls II


KONICA MINOLTA DIGITAL CAMERA

This article is in continuation with my previous post
          Mutex and Semaphore Deep Dive

In my earlier post I discussed about what Mutex and semaphore individually are and with their properties. We take a few more steps ahead from there.

Mutex Scroll

  1. Each mutex provide mutual exclusion for one and only one critical resource.
  2. The scope of a mutex can be process wide or system wide. pthread_mutexattr_setpshared() is used to set the shared attribute for a Mutex.
  3. If in a process a mutex is initialized with PTHREAD_PROCESS_PRIVATE then the mutex is usable by only those threads which are spawned by that process, where as if a mutex is initialized by PTHREAD_PROCESS_SHARED, then the mutex is usable by any thread/process where the id/identity/existence of the mutex is known.
  4. When a mutex is locked by one thread, all other threads waiting for the mutex are going to wait in a priority queue. However if the threads/processes have the same priority, then the thread/process which is woken up when the mutex becomes available, is going to be arbitrary.
  5. If a serialization is desired, then condition variables should be used along with mutex to achieve the need.
  6. Mutex should be used when the critical resources are unique and have a specific signature. In easier language, when one of two available critical resources and acquiring one critical resource is different from acquiring another we would prefer to use a mutex.

If there is any way in which this article can be improved, please let me know.

Thanks for stopping by.

Mutex and Semaphore Deep Dive


OLYMPUS DIGITAL CAMERA

Mutex and Semaphore Deep Dive !!

In a multi-threaded and multi-process environment to achieve synchronization among various chains of executions we use Mutex and/or Semaphore. Below is an investigation of what they individually are, their properties, similarities, differences and application.


 

Semaphore:

images-telephone-booths

Semaphore is an Operating-System resource, which is associated with a count ‘Cn’, such that Cn is never allowed to fall below zero. It is used to control the access to a common pool of resources by multiple processes.

Properties:

  1. Semaphores are (usually greater than ZERO) associated with a number which denotes the total number of resources controlled by the semaphore variable.
  2. Semaphores can’t distinguish between the resources which it is maintains and treat them as identical.
  3. Acquiring a semaphore Every time an access is granted the count parameter of the semaphore is decremented by 1.
  4.  Releasing the semaphore When the resource released the count is incremented by 1.
  5. Access is granted iff the count is non-zero. If the count is ZERO then all the processes requesting access would be blocked.
  6. Counting Semaphores A semaphore which controls  access to a number of resources (>1) is referred to as Counting Semaphores.
  7. Binary Semaphore A Semaphore which controls access to only one resources is also referred to as Binary Semaphore or LOCKS. (NOTHING ELSE)
  8. Semaphore are not associated with any ownership. So it is possible for a process to release a semaphore which is acquired by another process. For the same reason semaphores are a better choice where priority-inversion is likely.
  9. Semaphores are suitable for access control across independent processes as well as across multiple threads.
  10. POSIX offers two type of semaphores Named and un-named.
  11. Named semaphores start with a ‘/’ and end with a null character the neame can be 251 characters long. On linux usually mounted at /dev/shm.
  12. sem_open() system call is used to create a new named semaphore or open an already created semaphore. a single call to sem_open would create, initialize and set permissions on the named semaphore
  13. Un-named semaphores are process wide and gets cleaned up when process exits.
  14. unnamed semaphore is stored in a memory location, and must be initialized before it can be used. sem_init() system call is used to initialize an unnamed semaphore.
  15. Named semaphore if not explicitly removed using the sem_unlink(), the semaphore would persist till system reboot.
  16. sem_destroy is used to free the memory location of an un-named semaphore, when it is no longer needed.
  17. To lock a semaphore sem_wait() is used(it would decrements the count by 1 if the call succeeds) and to release it sem_post() is used (would increment the count by 1). sem_wait() is a blocking call and the process would block until the semaphore is available, if blocking is not desirable sem_trywait() or sem_timedwait() should be used.

 

Mutex:

OR more appropriately Mutual Exclusion.Lock_PD

(it is just a resource behind a locker )

Mutex stands for mutual exclusion and it's 
the most basic form of synchronization 
between processes. Mutexes guarantee that
only one thread can lock a given mutex. If
acode section is surrounded by a mutex 
locking and unlocking, it's guaranteed that 
only a thread at a time executes that section 
of code. When that thread unlocks the mutex, 
other threads can enter to that code region:

Properties:

  1. Mutex is generally used for thread synchronization, both threads within a single process or across threads of different processes.
  2. Ownership of a mutex is gained when a task first locks the mutex by acquiring it. Conversely, a task loses ownership of the mutex when it unlocks it by releasing it. When a task owns the mutex, it is not possible for any other task to lock or unlock that mutex (this is when we act according to rules not otherwise).
  3. For this reason mutex can create a situation of priority inversion, and not a very good choice if such conditions are expected in the program (as far as rules honored).
  4. By default Mutex have process cope, as soon as the process terminates the resources for the mutex are released.
  5. pthread_mutex_init() used to initialize a mutex.
  6. to lock a mutex pthread_mutex_lock() is used. it is a blocking call and if mutex isn’t available the calling thread would block. if blocking is not desireable, pthread_mutex_trylock() or pthread_mutex_timedlock() should be used.
  7. pthread_mutex_unlock () is used to release the mutex.
  8. pthread_mutex_destory() should be called to release the resources used for the mutex.

Recursive Mutex:

Some implementations provide constructs which allow a thread/process to recursively gain control of a single mutex. The mutex lock count would be incremented as many times as the process locks it. It is a prerequisite that a recursive mutex would need to be unlocked/released as many number of times as it was locked, failing which the mutex would be treated as locked and the resource gurded by it would be unavailable.

explanation: suppose a recursive function needs to perform certain task on  certain data which is mutex protected. Before the function can operate on the data it acquires a mutex lock, and before the lock could be released the same function is recursively called, so if a recursive mutex is not implemented a deadlock condition would arise. however in case of a recursive mutex, the same mutex is locked over and over again.

As far as i know, not every implementation offers support it. Win32, QNX library are among the few which offers this support.

For more about mutex read another post here


Mutex is not a binary semaphore. It is not even close.

 


References:
http://www.embeddedlinux.org.cn/RTConforEmbSys/5107final/LiB0037.htmlhttp://linux.die.net/
http://www.barrgroup.com/Embedded-Systems/How-To/RTOS-Mutex-Semaphore

Click to access threads-sema.pdf

http://www.linuxdevcenter.com/pub/a/linux/2007/05/24/semaphores-in-linux.html?page=6

If there is any way in which this article can be improved, please let me know.

Thanks for stopping by.

 

Dijkstra’s Algorithm (Shortest Path)


Graphs are Abstract Data Types which are used to solve problems in mathematics and computer science where the set of data can be arranged in a set of objects where pairs of objects are connected by links.

To know more about Graphs you could refer to Wikipedia or just Google it. Or Go through one of my favorite text-books “Introduction To Algorithms” by Thomas H Cormen. Or refer this fantastic link I found.

Dijstra’s Algorithm
by Edsger Wybe Dijkstra

A simple yet powerful greedy algorithm technique to identify shortest path in a graph from one source to every other connected node in the graph (with non negative weights).  It employs a breadth First Search technique .

routeGraph

General algorithm:

  1. Initially mark the weight of all the edges as infinite (a very large number)
    {v:infinite, x:infinite, y: infinite, w: infinite, x:infinite}
  2. Start form the source node (lets say U) and identify all the adjacent nodes along with the weight of the related edges.
    calculating for node –> (u)
    adjacent –> {v:2, x:1, w:5}
  3. If the weight of the edge between a source and the adjacent node is smaller than the previously known weight from source then, store the adjacent nodes in a Priority queue. and set the source node as a predecessor of all those nodes which are placed in the priority queue.
    priority queue –> {x:1, v:2, w:5}
    predecessor map –> (x:u, v:u, w:u)
    A priority queue is an ordered queue of nodes arranged in order of the weight of the related edges.
  4. In the next iteration pop the first node (that is x)  in the priority queue and find the adjacent nodes for it.
    calculating for node –> (x)
  5. Identify the adjacent nodes along with their weights.
    adjacent nodes –> {v:2, w:3, y:1}
  6. check for each vertex if the weight to that vertex is smaller than previously known weight, Insert the new adjacent node list with updated adjacent weights in the priority queue.
    priority queue –> {y:1, v:2, w:4}
  7. set x as the predecessor for only those nodes which are inserted/updated into the priority list in this iteration.
    predecessor map –> {y:x, v:u, w:x)
  8. repeat steps 4 to 7 till the priority queue is not empty.

At the end of the complete iteration we would have a graph like

dijkstraf

 

Assumptions that this algorithm makes.

  1. Must be a connected graph and complete graph.
  2. Graph must not contain negative weights

Practical implementations:

  1. OSPF (Open Shortest Path first)
  2. Travelling salesman problem

If this article can be improved in any way please let me know

Thanks for stopping by.

References:

http://Wikipedia.org

http://interactivepython.org/courselib/static/pythonds/Graphs/graphshortpath.html

 

Concepts of Hashing and collision resolution techniques


We have discussed about hashing in my previous post Direct Address Table.

hash_table_gewenst_resultaat

Hash Table:

It is a Data structure where the data elements are stored(inserted), searched, deleted based on the keys generated for each element, which is obtained from a hashing function. In a hashing system the keys are stored in an array which is called the Hash Table. A perfectly implemented hash table would always promise an average insert/delete/retrieval time of O(1).

Hashing Function:

A function which employs some algorithm to computes the key K for all the data elements in the set U, such that the key  which is of a fixed size.  The same key K can be used to map data to a hash table and all the operations like insertion,deletion and searching should be possible.  The values returned by a hash function are also referred to as hash values, hash codes, hash sums, or hashes.

Hash Collision: hash_table_ongewenst_collision

A situation when the resultant hashes for two or more  data elements in the data set U, maps to the same location in the has table, is called a hash collision. In such a situation two or more data elements would qualify to be stored/mapped to the same location in the hash table.

==> However simple it may sound, it is practically never
possible to find a hashing function which computes unique
hashes for each element in the data set U. Further a 
hash function should also be optimal w.r.t computing time 
and should offer adequate ease of implementation.
Read the material about Birth Day Paradox in Wikipedia for
more info about the possibility of finding a perfect hash
and why it is nearly impossible.

Hash collision resolution techniques:

Open Hashing (Separate chaining)

Open Hashing, is a technique in which the data is not directly stored at the hash key index (k) of the Hash table. Rather the data at the key index (k) in the hash table is a pointer to the head of the data structure where the data is actually stored. In the most simple and common implementations the data structure adopted for storing the element is a linked-list.download (2)

In this technique when a data needs to be searched, it might become necessary (worst case)  to traverse all the nodes in the linked list to retrieve the data.

Note that the order in which the data is stored in each of these linked lists (or other data structures) is completely based on implementation requirements. Some of the popular criteria are insertion order, frequency of access etc.

closed hashing (open Addressing)

In this technique a hash table with pre-identified size is considered. All items are stored in the hash table itself. In addition to the  data, each hash bucket also maintains the three states: EMPTY, OCCUPIED, DELETED. While inserting, if a collision occurs, alternative cells are tried until an empty bucket is found. For which one of the following technique is adopted.

  1. Liner Probing (this is prone to clustering of data + Some other constrains. Refer Wiki)
  2. Quadratic probing (for more detail refer Wiki)
  3. Double hashing (in short in case of collision another hashing function is used with the key value as an input to identify where in the open addressing scheme the data should actually be stored.)

A comparative analysis of Closed Hashing vs Open Hashing

Open Addressing Closed Addressing
All elements would be stored in the Hash table itself. No additional data structure is needed. Additional Data structure needs to be used to accommodate collision data.
In cases of collisions, a unique hash key must be obtained. Simple and effective approach to collision resolution. Key may or may not be unique.
Determining size of the hash table, adequate enough for storing all the data is difficult. Performance deterioration of closed addressing much slower as compared to Open addressing.
State needs be maintained for the data (additional work) No state data needs to be maintained (easier to maintain)
Uses space efficiently Expensive on space

If there is any way in which this article can be improved please let me know.

Thanks for stopping by.

References:

Wholeheartedly recommend textbook Introduction to Algorithms by Cormen, Leiserson, Rivest, Stein. 

  1. Wikipedia
  2. http://research.cs.vt.edu/AVresearch/hashing/introduction.php
  3. http://www.cs.cornell.edu/courses/cs312/2008sp/lectures/lec20.html
  4. Click to access Unit29_Hashing2.pdf

  5. Images are taken from Wikimedia commons.

Direct Address Table


dirAccTable

Direct Address Tables are also known as Direct address Hash tables

What are hash tables ?
Well, you could Google it or Wikipedia too has it explained in enough detail.

A Direct address table is a special Hash table where, the Key K obtained from the hashing Function F for the collection of X elements (where x is not too large) are unique integers for the given range of X. In other words a Hash table with a finite set of elements X, and blessed with a perfect hash function where each key can be treated as an index of an associative array.

There are few conditions which should be satisfied. (I’m not saying MUST)

  1. The Hash function should generate perfectly unique keys (K).
  2. All the generated keys should be within a strict boundary. (What it means is, the range for the integer value of K should  be small)

Analysis and Explanation:

Rule 1:

The Keys should be unique. Why? how practical is this rule?
Well it is. And i know that there are hash collision techniques available and can be employed.

Let’s investigate.So in principle a direct hash table is a supremely optimized data structure which should be able to provide a search efficiency of O(1).

In case of a collisions lets say we adopt a technique separate chaining with linked list. with a small number of collisions we could promise a search efficiency of O(1). However if the collisions tend to increase and approach close to the N (total number of elements in the set to which X belongs) then the search efficiency would tend to become O(N). And a Hash table would be useless, and probably a tree would start making more sense.

Rule 2:

Idea behind this kind of hash table is to be able to obtain an associative array which is as linear as possible, such that the array indices could be directly treated as Keys. If such a Data structure is obtained, then the size of the associative array could be directly identified by the largest Key value. Keeping Rule 1 in mind, it also becomes very important that the range of value for Key K, should be small, and as continuous as possible. Why so? Well,  the assumption we took was that the total number of elements would be small, and it would be impractical to have a small set of data stored in highly distributed address space.

What about problems of Direct Address Table Data Structure:

So are there no issues with Direct Address Tables and is it a perfect data structure?
The problem with Direct access tables is obvious and is apparent when we look at the assumptions made, while defining the Data structure.

In most practical scenarios, it is almost never possible to have a set of real world data which generates a sequential integer keys which are tightly bounded in a range. For this same reason, while storing keys generated from a fixed size data set the Direct access table itself might grow non-proportionately large, wasting space.

More about Hash tables in my next post concepts of hashing

 If there is any way in which this article can be improved, please let me know.

Thanks for stopping by.

References:
http://www.Wikipedia.org
http://www.science.auckland.ac.nz/en

SIP Trunk BandWidth Calculation


Bandwidth

Bandwidth as per Wikipedia is

A measurement of bit-rate of available or consumed data 
communication resources expressed in bits per second or 
multiples of it (bit/s, kbit/s, Mbit/s, Gbit/s, etc.). 
According to Hartley's law, the digital data rate limit 
(or channel capacity) of a physical communication link is 
proportional to its bandwidth in hertz.

Calculating the bandwidth requirement for a TDM network is easy. That is because they are based on either Multiplexing techniques like TDM,  Where each (Digital Signal) DS0 would correspond to one call, and depending on whether you are using T1 or E1 the number of simultaneous calls would be either 24 or 32 respectively. And at the end it boiled down to the number of connected circuits we have between two sites.

However the same isn’t applicable for a SIP network when it comes to identifying Bandwidth, as there are no TDM or FDM techniques employed to send data.

We’r going to use a century old telecom calculation technique called erlang.

An erlang calculator can be found at http://www.erlang.com/calculator/

Prior to determining the bandwidth requirement of a SIP network we’d need to

  1. Determine, maximum simultaneous calls we need to support at any given time.
  2. Busy Hour Traffic (BHT): BHT is the measure of the call traffic at the busiest operational hour. also known as erlang load
    the Calculation ofBHT = (Average Call Duration(s) * calls per hour )/ 3600

    For example if we have 4000 calls per hour, with an 
    average duration of 180 seconds then BHT would be 
    --> (360 x 180)/ 3600 = 200 Erlang
  3. Determining Blocking: Blocking is the measure of failure of call attempts due to insufficient available resources. (as per definition number of lines).
    For example, a Blocking of 0.05 indicates 5 calls 
    blocked per 100 calls attempted. These blocked 
    calls would hear a busy signal or re-order tone.

The resultant of feeding these numbers in the erlang calculator is the number of trunks required to support the number of calls we wanted at a certain desired Grade of Service.

Now if we had been working with TDM, then our calculation would have been complete with this resultant number from the erlang calculator. But since we are dealing with IP telephony and SIP there are a few more steps to be taken.

In the next steps we would be converting that number of trunks (which is also equal to the simultaneous calls had it been TDM) into bandwidth. Lets see how..

For doing that we need to identify what codecs we would use. Whether we would use g711, g729 etc.
Each codec has its own set of characteristics, which could include the codec’s sampling size, payload type, tolerance etc..

A short comparative list of capabilities of various codecs

Codec Bandwidth Sample
period                     Frame size                   Frames/ packet                Ethernet Bandwidth
G.711 (PCM)              64 kbps                         20 ms                                160 1 95.2 kbps
G.723.1A (ACELP) 5.3 kbps                         30 ms                               20 1 26.1 kbps
G.723.1A (MP-MLQ) 6.4 kbps                    30 ms                                24 1 27.2 kbps
G.726 (ADPCM)      32 kbps                          20 ms                                80 1 63.2 kbps
G.728 (LD-CELP)   16 kbps                           2.5 ms                               5 4 78.4 kbps
G.729A (CS-CELP) 8 kbps                            10 ms                                10 2 39.2 kbps
AMR (ACELP)          4.75 kbps                     20 ms                                12 1 36.0 kbps
AMR (ACELP)          7.4 kbps                        20 ms                                19 1 38.8 kbps
AMR (ACELP)          12.2 kbps                      20 ms                                31 1 43.6 kbps
AMR-WB/G.722.2(ACELP)6.6 kbps       20 ms                                17 1 38.0 kbps

Before moving ahead we would also need to know the following

Codec Bit Rate (Kbps) Based on the codec, this is the number of bits per second that need to be transmitted to deliver a voice call.
(codec bit rate = codec sample size / codec sample interval).
Codec Sample Size (Bytes) Based on the codec, this is the number of bytes captured by the Digital Signal Processor (DSP) at each codec sample interval. For example, the G.729 coder operates on sample intervals of
10 ms, corresponding to 10 bytes (80 bits) per sample at a bit rate of 8 Kbps.
(codec bit rate = codec sample size / codec sample interval).
Codec Sample Interval (ms) sample interval at which the codec operates. For example, the G.729 coder operates on sample intervals of 10 ms, corresponding to 10 bytes (80 bits) per sample at a bit rate of 8 Kbps.
(codec bit rate = codec sample size
/ codec sample interval).
MOS MOS is a system of grading the voice quality of telephone connections. With MOS, a wide range of listeners judge the quality of a voice sample on a scale of one (bad) to five (excellent). The scores are averaged to provide the MOS for the codec.
Voice Payload Size (Bytes) The voice payload size represents the number of bytes (or bits) that are filled into a packet. The voice payload size must be a multiple of the codec sample size. For example, G.729 packets can use 10, 20, 30, 40, 50, or 60 bytes of voice payload size.
Voice Payload Size (ms) The voice payload size can also be represented in terms of the codec samples. For example,a G.729 voice payload size of 20 ms (two 10 ms codec samples) represents a voice payload of 20 bytes
[ (20 bytes * 8) / (20 ms) = 8 Kbps ]
PPS PPS represents the number of packets that need to be transmitted every second in order to deliver the codec bit rate. For example, for a G.729 call with voice payload size per packet of 20 bytes (160 bits), 50 packets need to be transmitted every second
[50 pps = (8 Kbps) / (160 bits per packet) ]

Ok, The theater is all set now. Let’s jump into some calculations

Bandwidth Calculation

Total packet size = (L2 header) + (IP/UDP/RTP header) + (voice payload size)
PPS = (codec bit rate) / (voice payload size)
Bandwidth = total packet size * PPS

Sample Calculation

For example, the required bandwidth for a G.729 call (8 Kbps codec bit rate) with the default 20 bytes of voice payload is:
Total packet size (bytes) = (MP header of 6 bytes)
+ ( compressed IP/UDP/RTP header of 2 bytes)
+ (voice payload of 20 bytes) = 28 bytes

Total packet size (bits) = (28 bytes) * 8 bits per byte = 224 bits
PPS = (8 Kbps codec bit rate) / (160 bits) = 50 pps
=> Note: 160 bits = 20 bytes (default voice payload) * 8 bits per byte
Bandwidth per call = voice packet size (224 bits) * 50 pps = 11.2 Kbps

Now let’s say we would have received a number 200 From the the Erlang calculator, then the required bandwidth requirement scales up to (bandwidth per call * total number of trunks that are needed) = 11.2 * 200 = 2240 kbps.
On top of that there would be some percentage of additional (in a factor of 20-25%) bandwidth would be considered to compensate for factors like network re-transmissions, variance and collision. Which would eventually lead us to a figure of 28000 Kbps = 2.8 MegaBytes per second.

So the bandwidth requirement would be an approximate 3MBps. However since each codec offers an entirely different sampling size it would be possible to achieve the same call rate with the desired GOM.

Hope I was able to do some justice to the topic.

If there is any way in which this article can be improved, please let me know.

Thanks for stopping by.

References:

http://www.cisco.com/c/en/us/support/docs/voice/voice-quality/7934-bwidth-consume.html#formulae

http://www.wekipedia.org

Click to access 52-VoIP-Bandwidth.pdf

the image was taken from http://m.flikie.com/33582293/beautiful-night.html?cid=33554432&order=feellucky

SIP Weirdo Cheatsheet


A list of SIP protocol properties, rules and exceptions.

  1. From and To header fields of a registration request contain the same value.
  2. All the registration requests send from one UA to one registrar would always have the same Call-ID.
  3. As pre 3261(and 3261 alone) Invite is the only request which can initiate a dialog.
  4. Otherwise refer and subscribe requests can also start a Dialog.
  5. A calling UAC might receive any number of 1xx responses.
  6. An invite may or may not carry SDP.
  7. In case of forking, the calling UAC might receive multiple 1XX and 2xx.
  8. ACK is the only request without a response but still a complete transaction.
  9. ACK is a mandatory request in the same direction in which Invite was propagated.
  10. ACK is mandatory for an Invite, and doesn’t become part of any other transaction other than invite.
  11. ACK for all non-successful responses are considered within the Invite transaction.
    For more discussion on ACK visit : My Previous post on ACK
  12. Cancel request can’t be challenged for authentication, as these requests can’t be re-submitted.
  13. ACK and Cancel must have the same RR header field if RR was present in the Invite request.
  14. The request filed in CSEQ for ACK and CANCEL is always invite (3261)
  15. The CSEQ number of ACK and CANCEL is always equal to the CSEQ number of the INVITE request which they are bound with.
  16. Apart from INVITE (3261) the only other request which can be cancelled is an INFO request.
  17. As per 3261’s definition of transaction, the transaction is considered complete when a request is responded by any final response, still intermediate proxies would keep the transaction alive for a time equal to default transaction timer (if not configured otherwise).
  18. There can be no session without a Dialog, but this property is not orthogonal.
  19. you can not cancel the Invite transaction if at-least one 1xx response is not received.
  20. You can not cancel any invite transaction for which there are responses received other than 1xx.
  21. In any case (other than re-writing the complete Invite request) the To  and the From header fields never change in the entire life-time of a dialog.
  22. “z9hG4bk” is a weird string called as magic cookie. Nothing magical about it other than the name. It is used to by proxies to identify if the request complies to 3261 or its older brother 2543.
  23. 3261 doesn’t restrict 100 Trying for any request, so it can be practically issued for any request. Although it makes very little sense.
  24. According to 3261 and 3261 alone, Register is the only request which can be sent out of dialog.
  25. Option request is sent to query the far end of it’s capabilities.

slight deviation, Barging into other RFCs

  1. If offer is sent and no answer received another offer can’t be generated.
  2. if offer received but answer not sent, then another offer can’t be sent.
  3. SDP can be carried by Invite, 200 OK, 183, ACK none other.
  4. SDP answer must have equal number of m-lines.
  5. offer can be rejected but not ignored. 

Enough for now, will keep updating this list.

One Bonus.
If worried about SIP with NAT read the rport RFC. Just google.

 

if there is any way in which this article can be improved, please let me know.

Thanks for stopping by.

Timers in Session Initiation Protocol (RFC 3261)


Timers in SIP

Timer Default value Section Meaning
T1 500 ms 17.1.1.1 Round-trip time (RTT) estimate
T2 4 sec. 17.1.2.2 Maximum retransmission interval for non-INVITE requests and INVITE responses
T4 5 sec. 17.1.2.2 Maximum duration that a message can remain in the network
Timer A initially T1 17.1.1.2 INVITE request retransmission interval, for UDP only
Timer B 64*T1 17.1.1.2 INVITE transaction timeout timer
Timer D > 32 sec. for UDP 17.1.1.2 Wait time for response retransmissions
0 sec. for TCP and SCTP
Timer E initially T1 17.1.2.2 Non-INVITE request retransmission interval, UDP only
Timer F 64*T1 17.1.2.2 Non-INVITE transaction timeout timer
Timer G initially T1 17.2.1 INVITE response retransmission interval
Timer H 64*T1 17.2.1 Wait time for ACK receipt
Timer I T4 for UDP 17.2.1 Wait time for ACK retransmissions
0 sec. for TCP and SCTP
Timer J 64*T1 for UDP 17.2.2 Wait time for retransmissions of non-INVITE requests
0 sec. for TCP and SCTP
Timer K T4 for UDP 17.1.2.2 Wait time for response retransmi

 

Constant Pointer Vs Pointer to Constant


Lets understand the difference between constant pointers and pointer to a constant. One of the frequently discussed topics in the thorny world of pointers in C.


 Before we proceed, what is a pointer ? in shortest and simplest terms “a pointer is a variable which can store the address of another variable of same type”. 

The Void pointer is a special kind of a pointer and we won’t be talking about them here as of now.

Now all set to explore. First, let us see how does each of them look like

1  int temp_var = 10;
2  int term_var1 = 20;
3  // pointer to a constant
4  int const *c_ptr = &tmp_var; 
5  // constant pointer
6  int * const prt_to_c = &temp_var1;

let’s read the following lines from right to left


line#4: int const *c_ptr = &tmp_var

the address of integer tmp_ptr is being assigned to a variable named c_ptr which is a pointer type variable to a constant integer.

explanation:

c_ptr can be used to point to any other integer type variable later in the program. But, the value to which c_ptr points can’t be changed. Well, that is half the truth, or not entirely a correct statement. The completely correct statement would have been “the value at the address of tmp_var can’t be changed using the pointer variable as defined in line# 4.”

So later in the program

c_ptr = & tmp_var1; //allowed
*c_ptr = 12; //not-allowed
tmp_var = 11; //allowed

 Now read line#6: int * const ptr_to_c = &tmp_var1

The address of integer temp_var1 is being assigned to a variable named ptr_to_c which is a constant type pointer variable to an integer.

explanation:

The pointer type variable ptr_to_c would constantly point to the same address for the entire scope of the program. That means, the value of the variable tmp_var1 can be changed at will, but we won’t be able to make ptr_to_c to store the address of any other variable other than tmp_var1.

So:

tmp_var1 = 25; //allowed
*ptr_to_c = 26; //allowed
ptr_to_c = &tmp_var_some_new_variable; //not allowed

If there is any way in which this article can be improved, please let me know.

Thanks for stopping by.

Life span of a C program.


Program_life_cycle_IPL

step 1: write the program in a high level (easy to understand) language.

save it as “test.c” ==> this becomes the source code file

EXECUTE the command gcc -Wall -save-temps test.c -o test Step

2: Pre-processor

input: Source file written in high level language

output: pre-processed source file (test.i)

step 3:compile

input: pre-processed source file

output: assembly file (test.s)

  1. one very important thing to note here is that all the constant strings are stored in the RO data section of the program.

step 4: assembler input: assembly file output:object file (test.o) the assembly code is converted to binary code. Mostly human non readable. But as a matter of fact in the initial days programmers used to write code in this format alone. (some task !!)

step 5: linker input object file output: executable file (test) The object file is not ready for execution yet. as the links for the library function are not yet in place. So linker is a program which links the library functions like (printf, scanf) to the address of the function where they are defined in the header files. After this step all those library function calls (in the source file) would be replaced by the address of the actual implementation of the library functions (in the header files). The resultant file would be an executable file.

step 6: loader input executable file output: image of the program on physical memory The loader loads the executable file on to the system physical memory (RAM) and the program is all set to become a process.

source fie


int int_To_Zero;
# include <stdio.h>
# define STRING "HELLO WORLD"
int main()
{
char ptr[] = "ABCD";
char *ptr1 = "abcd";

printf("\n %s, \n%s",ptr, prt1);
/*using a macro to print "HELLO WORLD"*/

printf("\n %s \n", STRING);
return 0;
}
Pre-processed file

int main(void)
{
char ptr[] = "ABCD";
char *ptr1 = "abcd";
printf ("\n %s, \n%s",ptr, ptr1);
printf("\n%s\n","Hello World");
return 0;
}
  • all the comments are gone.
  • all the macros are substituted.
  • all the header files are resolved.

Assembly File


bash-3.00$ cat test.s
.file "test.c"
.section .rodata
.LC0:
.string "ABCD"
.LC1:
.string "abcd"
.LC2:
.string "\n %s, \n%s"
.LC3:
.string "Hello World"
.LC4:
.string "\n%s\n"
.text
.globl main
.type main, @function
main:
.LFB2:
pushq %rbp
.LCFI0:
movq %rsp, %rbp
.LCFI1:
subq $32, %rsp
.LCFI2:movl 
.LC0(%rip), %eax
movl %eax, -16(%rbp)
movzbl .LC0+4(%rip), %eax
movb %al, -12(%rbp)
movq $.LC1, -24(%rbp)
movq -24(%rbp), %rdx
leaq -16(%rbp), %rsi
movl $.LC2, %edi
movl $0, %eax
call printf
movl $.LC3, %esi
movl $.LC4, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
ret
.LFE2:
.size main, .-main
.section .eh_frame,"a",@progbits
.Lframe1:
.long .LECIE1-.LSCIE1
.LSCIE1:
.long 0x0
.byte 0x1
.string ""
.uleb128 0x1
.sleb128 -8
.byte 0x10
.byte 0xc
.uleb128 0x7
.uleb128 0x8
.byte 0x90
.uleb128 0x1
.align 8
.LECIE1:
.LSFDE1:
.long .LEFDE1-.LASFDE1
.LASFDE1:
.long .LASFDE1-.Lframe1
.quad .LFB2
.quad .LFE2-.LFB2
.byte 0x4
.long .LCFI0-.LFB2
.byte 0xe
.uleb128 0x10
.byte 0x86
.uleb128 0x2
.byte 0x4
.long .LCFI1-.LCFI0
.byte 0xd
.uleb128 0x6
.align 8
.LEFDE1:
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-11)"

Let me know if there is any way in which this article could be improved.

References:

http://commons.wikimedia.org

Thanks for stopping by.

Thread safe and Reentrant Functions


Often mixed and misunderstood, Thread safe and re-entrant functions are considered to be the same. They are not. Both these concepts lay a foundation of good programming practice. Let us see, how they promise good code and what each of these concepts really are.

By default, when a functions is executed it has a fixed sequence of execution. No synchronization techniques are needed, as all the data would be used and modified by a single flow of control. This is  not the case with multithreaded applications, where a single function can be called by multiple threads with arbitrary execution sequence(execution sequence is not predetermined if thread synchronization is not taken care explicitly). In a multithreaded program, several threads execute simultaneously in a shared address space. Every thread has access to virtually all the memory of every other thread. In this scenario it becomes crucial to ensure data integrity. So when a function is executed via multiple threads we need to take care if they are thread-safe.

From Posix defination:

In POSIX.1c, a “reentrant function” is defined as a “function whose effect, when called by two or more threads, is guaranteed to be as if the threads each executed the function one after another in an undefined order, even if the actual execution is interleaved” (ISO/IEC 9945:1-1996, §2.2.2).

For a function to be thread safe the following should hold:

  1. should be reentrant.
  2. Shouldn’t call non-reentrant functions.
  3. thread should operate on local variables, so that each call of the function from a thread has local memory to operate on.
  4. If the  function operates on some shared resources then the critical section should accessed with synchronization tools like mutex.
  5. As per wikipedia:  “A piece of code is thread-safe if it functions correctly during simultaneous execution by multiple threads.” n particular, it must satisfy the need for multiple threads to access the same shared data.
  6. Also note that only using synchronization techniques to access the shared data alone is not enough. utmost care should be taken to ensure sequential execution of threads, Deadlock avoidance, no race conditions.

Ensuring all the above becomes increasingly challenging when the level of multithreading increases in the system. Nonetheless it is doable.

For a function to be reentrant the following should hold:

  1. A re-entrant function mustn’t hold static data or return pointer to a static data.
  2. shouldn’t modify its own code.
  3. shouldn’t call non-reentrant functions.

usually a reenterant function is recursion safe.

I have learnt that it is possible to have thread-safe functions which are not reenterant but never really got an example. If anyone has come across such an example please provide reference.

Will shortly provide examples for each of these.

references:

http://www.thinkingparallel.com/2006/10/15/a-short-guide-to-mastering-thread-safety/

wikipedia

http://blogs.msdn.com/b/ericlippert/archive/2009/10/19/what-is-this-thing-you-call-thread-safe.aspx

I’m not an expert in this area of programming. So if you find something which is not correct, please let m know.

 

thanks for stopping by.

 

 

Jump tables


A quick look.
In computing, Jump Tables are programming constructs using which control can be switched to another part of the program dynamically. Also referred to as branch table, Dispatch Table, Virtual method table,

The common way of implementation consists an array of function pointers, where each index of the array is assigned the starting address of a function (using the name of the function). So putting it simply they are an array of functions.

Example:

/* The functions */
void func3 (void) { printf( “3\n” ); }
void func2 (void) { printf( “2\n” ); }
void func1 (void) { printf( “1\n” ); }
void func0 (void) { printf( “0\n” ); }
void func    (void) {printf(“you didn’t enter nothing\n”);}

Handler jump_table[5] = {func0, func1, func2, func3,func};

int main (int argc, char **argv)
{
int value;
 /* Convert first argument to 0-3 integer (Hash) */
value = atoi(argv[1]) % 4;
if (value < 0) { value = 4; }

/* Call appropriate function (func thru func3) */
jump_table[value]();
}

Many compilers (like GCC ) implements this Technic to internally store a SWITCH statement.

Advantages:

  1. Helps in writing compact code.

Disadvantages:

  1. Increase code complexity and make debugging cumbersome.
  2. Only similar events or functions can be accommodated in a  Jump table.

If you see actual implementations they often tend to get maniacal, and tedious to maintain. But still I have always found certain affinity towards this topic.

References:
http://manueljoaosilva.com/2011/10/jump-tables-explained/
http://staff.ustc.edu.cn/~han/CS152CD/Content/COD3e/InMoreDepth/IMD2-Jump-Tables.pdf
http://www.rmbconsulting.us/jump-tables-via-function-pointer-arrays-in-cc
http://en.wikipedia.org/wiki/Dispatch_table

If there are any other properties about Jump tables please drop your comments below.
Thanks for stopping by.

-Abhishek

Memory segments of a c-program


When a c-program is loaded into memory (RAM) the available space is shared between the following sections.

  • text segmanet
  • data segment
  • stack segment
  • heap segment

Text Segment  :
contains all the instructions of the object file. Also referred to as “code segment”

Data Segment   :

  • contains all the variables used in the object files.
  • It is possible to let the linker know where the data segment would start from by using the -Wl, -Tdata attributes)

This is subdivided into two further types of segments

  1. initialized data:  All the initialized variables of the program are stored in this area.
  2. un-initialized data(.bss): 
  • All the un-initialized variables of the program (declared at file scope)are stored in this area. (also called .BSS)
  • In C, statically-allocated objects without an explicit initializer are initialized to zero (for arithmetic types) or a null pointer (for pointer types). 

Stack Segment :

  • Memory in this section is used to store local variables, passing arguments, and return values and the address to which the program counter must return when the execution of a function block is completed.
  • Stacks are accessed in a Last-In-First-Out manner.
  • The kernel while starting a program creates a thread for it and allocates a stack for it. The size is usually pre-decided by the OS.
  • Pointers are not needed to access values stored in stack.
  • in C programming, using a system call alloca memory can be obtained from the stack, as opposed by the alloc system call which reserves memory from heap. The scope of this memory would be local and will be reclaimed after the scope terminates.
  • The stack size is usually fixed unless an explicit command is provided to change it (using the system call setrlimit)

Heap Segment : 

  • When the program allocates memory at run-time, memory is allocated from the Heap section.
  • Heap usually is a linked-list implementation having a linked-list each for both allocated and unallocated memory.
  • variables stored in the heap are never destroyed automatically and never goes out of scope. programmer must take measures to free the address obtained from heap when they are no longer needed.

Stack and heap both are placed in the RAM.

let us consider an example and identify various type of variables and their storage segement

int int_To_Zero;
static float float_To_Zero;
FILE * file_To_Zero; 
/* Since none of them are explicitly allocated a value all are 
stored in initialized data segment (BSS) and are initialized 
to ZERO (int and float) and NULL(FILE *)
*/
double double_variable = 20.0;
// double_variable is explicitly assigned a value 20, and so 
// is stored in initialized data segment
 
int main()
{
    size_t (*size)(const char *) = strlen;
    // size is an auto variable that is allocated a location
    // in stack
    // but it points to code segment where code of strlen()
    // is stored
 
    char *dynamic_memory = (char *)malloc(100);
    // dynamic_memory is again a auto variable which is
    // stored in stack, and points to a memory whose 
    // allocation is on on the heap */
 
    int str_Len;
    // str_Len is an auto variable that is allocated 
    // in stack

    char *charptr = "ABCD";
    // auto variable stored in stack, points to a 
    // memory location in the RO segment

    char char_array[] = "abcd";
    //auto variable stored in stack, initialized with
    // a string "abcd"
 
    static int static_integer; 
    // stored in BSS
 
    static int static_int2 = 10; 
    // stored in initialized data segment   
 
    strcpy(dynamic_memory,”your text goes here”);    
    // function call, uses stack
 
    stringLength = size(dynamic); 
    // again a function call 

    printf("\n   charptr is [%s], and char_array is 
           [%s]\n", charptr, char_array);
}

IMPORTANT: Apart from the above, there is a RO segment
of the program where all the constant string literals 
are stored. In the above program constant strings like
  1. “ABCD”
  2. “abcd”
  3. “your text goes here” and even the format specifiers in the printf() function call
  4. “\n charptr is [%s], and char_array is [%s]\n”

are stored in the RO segment of the program.

refer

https://abhishekchattopadhyay.wordpress.com/2014/05/31/life-span-of-a-c-program/
to go through the assembly file of a compiled program
to see more about RO data.

References:

http://inf.udec.cl/~leo/teoX.pdf
http://en.wikipedia.org/wiki/.bss

Function Pointers in C


These are confusing so I have tried to put together a summary at one place.  someday helping me and others 🙂
It  might help to remember: Every function in C is just an address where some instruction sets are written and the beginning of this address is referred with the name of the function.

A function to which a pointer variable would point to
int compare_function (int a, int b);

Now We want a pointer to point to the function compare_function.
Lets call the function pointer as compare_fn

we won’t (can’t) use a usual integer pointer for this purpose. Because pointers usually are of the same type as the data they are pointing to.

I think the following is not recommended in any textbook. But this is my hack to remember.
step1
: take the original function to which a pointer needs to be declared
int compare_function (int a, int b);
step2
: replace the name of the function by the pointer representation of a function name
int (* compare_function) (int a, int b);
step3
: replace the name of the function in step2 by the pointer’s name.
int (* compare_fn) (int a, int b);

Till now only compare_fn has been declared. but not initialized.
(a)compare_fn = compare_function
(b)compare_fn = &compare_function;
(c)int (*compare_fn) (int a, int b) = compare_function;

All the above does the same thing. Makes the function pointer compare_fn to point to function compare_function.

the way we would read the pointer is :
compare_fn  is a pointer to a function which accepts two integer arguments and returns an integer.

now the function calls compare_function(int a, int b) can be replaced by compare_fn(int a,int b) or (*compare_fn)(int a, int b)

There is another way:
Using the typedef construct

using the same example above, the pointer to the function can be declared as below
typedef int (*function_pointer) (int, int);
int compare_function (int a,  int b);
function_pointer compare_fn = compare_function;
—————————————————————————————————–
What we can do with function pointers and how?
1. Passing the function pointer to another function as an input.

int * compare_digits(int*, int *,int (*compare_fn)(int *, int *));

Compare_digits is a function which returns a pointer to an integer and accepts two integer pointers and a pointer to a function which  returns an integer and accepts two integer arguments.

The typedef way

typedef int (*compare_fn) (int *, int *)
compare_fn ptr2fun;
int *compare_digits(int *, int *, prt2fun);

2. Returning a function pointer
Again two ways of doing it:

a function which accepts a pointer to an integer and returns a pointer to a function which accepts two integer pointers and returns an integer.
int (*function_ptr(int * a))(int *, int *)

The typedef way
define a type of function pointer which points to a function which takes in two
(a) integer pointers and returns an integer
typedef int (*function_ptr) (int *, int *);

(b) define a function which takes in a integer pointer and returns a pointer to a function which takes in two integer pointers and returns an integer.
function_ptr compare_function (int);

3. Comparing two function pointers.
It is possible to compare two function pointers in C and C++ using logical operators.

if (function_pointer1 == function_pointer2){
                      //Do some operation
}
4. Defining array of function pointers

let’s make an array of function pointers which take in two integer pointers, and returns a float.

typedef  float (*pointer2function) (int *, int *);
pointer2function fun_point_array[10];

now each index of the array fun_point_array[10] can point to a function which accepts two integer pointers and returns a float.

References:
http://oopweb.com/CPP/Documents/FunctionPointers/VolumeFrames.html
Let-us-C (Yashavant P. Kanetkar)

The Student Who Slapped His Teacher.


Ramanna 17, a class 11th student, this time he had slapped his teacher. The School Board is discussing this shocking incident. He was known to be a problem child ever since he was admitted in the Don Benep Boarding School six years ago. Since then Ramanna and the school authorities have been meeting regularly. Although Ramanna’s previous misdeeds were serious violations of the rules of this boarding school but this incident has been the most serious. In the beginning he was a loner but his group was quickly and rapidly picking numbers.

Father John Jr. has been the principle of Don Benep Boarding school since last twenty years. He was a dedicated catholic and a kind man. It was him who constantly worked to improve this school and today, Don Benep Boarding school constantly makes it among the top boarding schools in the country. During the last twenty years this school has produced numerous scholars, successful scientists, doctors and bureaucrats. It was father John who kept refining the school for good. “I had achieved my goal, I should move on” he thought. And just when father John Jr. was thinking about retiring from his role as Principal, it was Ramanna who made him skeptical about his achievements.

Don Benep Boarding school was unique in many ways. Majorly in the way in which the school treated the defaulters. The main focus has always been to find the reason due to which a student became a defaulter or miscreant. Each time a cause was found, the reason was addressed. Each time there was a defaulted case, the teachers and school authorities worked hard to find the reason. It was not easy, neither on effort nor on time. But It was Father John who kept things moving. Most of the cases reported were addressed however after best of the efforts there were still few cases which couldn’t be addressed and John Jr. took them as normal exceptions.

In last twenty years there has never been a case when a student is expelled from the school. As a matter of fact Father John believed in his methods of human improvement so strongly that he promised himself that Don Benep won’t expel its students. But this time it was different. The teachers have requested to expel Ramanna from the school; The board has left the final decision to their old and trusted principal. The decision is now Father John’s to make.

He was forced to pull out Ramanna’s conduct report. The Principal was going to spend the entire night reading the file. What he found was going to keep him up not only for this night but many more to come. While in class 6th Ramanna had violently attacked a student for some reason, for which he was sent for church services for a week. After a week the everyone from the church reported positively about him. While in class 7th there were reports of cheating in exams. As earlier, Ramanna underwent some moral lessons. while In std. 9 Ramanna was not found in the dormitory for more than once. This time too there were some actions taken for his betterment. He was explained the good and bad and Do’s and Don’ts. While in 10th std, he had taken to Drinking, for which he served restraining orders for 15 days and was under counseling. Although the counselling was scheduled for 15 days but during the session the counselor was so satisfied with Ramanna’s conduct that he declared him fit after the 8th day. Ramanna was as free as ever and was back in action. There has been sporadic reports from pupil who saw him indulge, but Ramanna always managed to slip by. Like Father John Jr. others also took it as a small exception in their books. By the time father John Jr. had finished reading Ramanna’s file it was already dawn. He noticed that Ramanna was the student who received the most number of counselling and have received the best of the reformation cares that the school had to offer. Yet despite of improving, Ramanna was always found to be in the defaulter list for a new reason. Since the beginning of this academic year, there has been reports about the harsh and rude behavior of Ramanna. He had developed a habit of abusing and talking foul of others.

The Day when this shocking incident happened, Mrs. Gupta, the physics teacher of std 11 (Ramanna’s class) had refused to accept his entry for this year’s science project. Ramanna was a week late to submit his entry. He was about to loose 10 marks in his final exams for which he was upset. Although he couldn’t provide any convincing reason for overshooting his target date, he expected the teacher to unconditionally accept the entry. He thought since he has worked hard to complete the assignment, he deserves little acknowledgement and not rejection.

Father John Jr. was puzzled. The efforts to reform Ramanna as a better person has proved to be a disaster. He was skeptical if more counselling would do any good. Amidst of his grand success to develop human behavior, where most of the students were found to improve, Ramann’s case was a clear exception. Later that afternoon in the staff meeting, Father John Jr. saw quite a number of teachers talking about his policies in a way he never expected they would.
They didn’t challange the old veteran, but suggested modifications in them.
It was clear that Ramanna had always found holes in the system, and used them to create trouble. He has always been involved in serious violations but always received some restrains or counselling. But bottom line was Ramanna was not afraid of the punishments neither was he ashamed of his deeds. He knew that the school would not expel him. He thought that the school couldn’t. Father John was in a fix. There had been numerous occasions when Father John Jr. was recognized for his methods.There was a Tug-of-war going on within him. The war was between what was right and Father John’s pride. He after all had never expelled any student.
If Ramanna was expelled Father John’s Pride of never expelling a student would shatter. A reputation would be lost which he holds very dear to his heart. However is he is not expelled then it would be setting a bad example to other students. Other teachers like Mrs Gupta can loose there respect to others like Ramanna, which ultimately will jeopardize the reputation of the elite institution. In either way Father John was going to loose something. The decision was not an easy one to make.

The Indian legal and political system, you and I depict Father John Jr. and his inability to take a strong decision, Ramanna is a reflection of the criminals and the miscreants of our society and Mrs.Gupta plays the Victim.
What do you think The experienced principal should do? Is this not the time to keep his pride aside, keep those achievements aside and address the issue currently at hand? If Ramanna is not punished how to ensure justice to Mrs Gupta?
Ramanns will never stop findings loop-holes and use them to get better off the system. It is not necessarily the ineffectivity of the system which make a student “Ramanna”. Rather the reality is even the most developed of the societies with mature governance have their own shortcomings. A prefect system is not possible and exists no where. But that doesn’t mean justice would be denied.

Fear is an important factor of civilization. As said if you want peace you should prepare for war. similarly the Legal system which targets to make the accused a better man should always work with retrospection, and find out if the measures taken, actually are working in a way they are designed to. If not then they must be addressed. If there is a need to make an exception then the time is now.

Aalsi* India


I am an Indian and like million others, sometimes proud and sometimes not. Proud when we win or talk about the cricket world-cup or Tendulkar, and not so much when we talk about honor killings, inland regionalism and Libyan evacuation etc.

Like any other country, the number of short comings that this country has, has no limit. Most of them are so deep rooted and effort-fully twisted that any one stop solution seems miles away.  Believe me; This state is fine, and the path any country takes towards resolving these, makes it a better nation. But there is one more; which unlike others is more unique in nature, and I am not sure how many Indians are proud of this uniqueness.

Introducing the Aalsi* India.

India has a tropical climate. More hot then cold and little more dry then wet. It always makes you feel more tired then you actually are, and of-course a napping Indian in the afternoon is not a rare sight. But I am not talking about this state of Alsipanti*. Because, a nap can be out of tiredness, or boredom and frustration due to absence of work (The job hunt in this country is one of the biggest among all other hunts on the planet, that you watch on National-Geographic).

Here I am talking about the ignorant look and Aalsi* bogus reaction of this generation of Indians, be it towards social issues or civic responsibilities.

Most of the times we’d just pass by a corrupt officer and wouldn’t report. See an environmental violation in progress but won’t respond. See something unruly and unethical happening but keep quite. Most of the fraud cases never reach the consumer court and we don’t vote.  There would be endless instances if we look around. For Example lets just talk about the road you took to your office today, how many pot holes and other such inconveniences we face everyday and never give feedback when asked. In all these instances most people react as if these were something very unrelated and something they don’t have time to respond to. More interestingly from few of my chit-chats I came across quite a lot of people who think that if they respond then it doesn’t make a difference. Briefly I can say, “we have stopped complaining and we have seized to speak out our minds”. We have become socially Aalsi*.

This attitude is not completely unreasonable and not something we can’t find reason for. India has been developing since it won it’s independence and has never looked back. The pace of its development today is as it was never before. The door to the world has opened a bit more, throwing more challenges, the Indian youth now has an opportunity to prove something to the world and also do something worthwhile for themselves (as in every developing country the insecurity takes a while to fade off). It is a time when there are limited opportunities and talent is pouring in. There is no time to waste and there is no forgiving. Alarmingly every young individual is in great hurry to finish something. This is a pure survival of the fittest scenario. (Darwin might not have had a slightest idea that his theory can be applied to young nations too).

The youth is becoming more focused towards results and less towards responsibility. Side effects of this evolution race is that the country becomes more numb and less reactive. A nation is like a body where every organ works for just one cause, survival. Assume a condition where the stomach keeps all the nutrition for itself; the result is co-lateral damage and the body collapses. Same happens with the county where individual responses, feedback and youth reactions fades off.

The feedback of a service is as important as paying the bills in time. Sadly, most of the consumers in India have just payed their bills in time and huge due of feedback is pending. Gradually as the pending feedback keep adding up, the quality of service would start to  declining. For this none other than the consumer would be responsible.

The Reaction of the young India is becoming rare.  All the sincere appreciation and criticism chain is lost.  The constructively reactive nature of people is slowly becoming an extinct characteristics like the Indian Tigers.

Probably it is the time when the young generation of this growing nation needs to go back to the history books and realize that it was the complaining Mangal Pandey, and frankly speaking Bhagat Singh that brought all the steer, and made such a great difference. This is not the time to put those attributes to the trunk, rather they are now needed more than they ever did.

I am a software guy. Means I earn my living from writing long strings of zeros and ones.I hope you understand what I mean.
Next, I can tell you that I am a telecommunication engineer for a multinational client. My work has great reliance with the feeling that has made me to write this blog. One night at around 2:00 am, I got a call in one of my contact numbers. I picked up the phone only to hear “Hi, we have a problem here! some of our clients who are doctor’s are not able to access their voice-mails. The call goes through your product, can you please assist me over this?”. I worked for next three hours to solve the issue. I don’t like being woken up in the mid of the night. As a part of my job I’ve been detained and delayed in office for long hours and suffered inconvenience for someone Else’s inconvenience. [:-) ] I don’t like that either.
These events definitely made me think “how prompt and aware people in the western part of the globe are, to receive the service they have paid for”. Sincerely when services are poorly delivered to us, how many actually complain. The answer is evident from the quality of service each one of us get. Starting from tax on roads to Value Added Tax,  and ticket for a bus to parking ticket, we all need to speak up when we find the satisfaction level low. In absolute terms the amount of money paid has already been detached from the quality of service, long ago.

Few days ago I read a quot.
why don’t someone do something about this, then I realized that someone was me.
(I didn’t put them in quotes because I don’t remember who said that so well, and if I have been able to reproduce it here ‘as is’.)

After all the Aalsi* India is actually about the Aalsi* Indian which would be me and you. Lets Do something about it.

Thanks For Reading.

* For those of my friends who have mother-tongue other than ‘Hindi’, the word “Aalsi” = “Lazy”, and “aalsipanti” = “laziness”.

The Bikini Presentation.



I found myself applying a technique in my presentations which I thought I never believe in. Let me share it with you.

A couple of days ago I was required to make a presentation for a meeting; concealing a few details and exposing other important facts. The intention was to wrap up the related meeting as soon as possible which was based on this presentation I was preparing. After investing an hour of effort I found the final presentation was not quite, up to the requirement. It actually exposed all the information which could have made the meeting longer then planned. I tried few more times but I couldn’t shape it in the required way. More bored then helpless with redundant results I approached  my peer. Instead of a direct help (as the time was short) he came back with a fantastic giggle and said, “a presentation should be like a Bikini, short enough to keep the interest alive and big enough to hide what is necessary. Only then it will be beautiful.
Although even after the great thought he still had to come down to my desk for rescue, but yeah he was right.

In our day-to-day work we learn so many new things.  I really found the approach for explaining the mundane stuff very interesting and true and more importantly very applicable.
I learned two things (1)  often an indirect approach to attack a problem comes back with great results and (2) the bikini presentation.

Thanks for reading.

The Newbie whose combination worked.


Welcome Accident Effect

Confusing; that is how I seem to understand it. A pure paradox of thoughts and knowledge of how you know things, how you know people, how you know situations and how you know so many other things that must behave in some way in given circumstances, but they don’t and you reason, as a human always does. You try to find patterns, logic, reason for something you merely understand.

Lets begin with a habitual incident. My dad would seldom take over the kitchen from my mom, with various, seeming logical reasons. Most of the times, to understand his logical reasoning, a highly intellectual mind would be required, so sadly enough, since years our family have not been able to be at par with him in this area. I think it is love. None other than this can be so logical unreasonable. He would capture all the already processed ingredients as a master chef and start off with. Even before starting to cook he would go around the house several times, calling  a very fancy name, which is supposed to be the name of the future Dish, which is to arrive on your plates in time relatively ahead to this.

Once the name is made known to us he’d start, and take hours in the kitchen before he is seen again. The time taken, strangely surpasses all that is known to us, that can be cooked from the set of ingredients he has. To everyone’s surprise though, when we’d get ready to dine with our much anticipated dish in our plates, we almost every-time found a great taste and a dish which we had not tasted before. The side effect is that you’d hear the name of the newly invented dish for some days to come.

Surprising is the fact, that my dad had no prior  idea of what would his final recipe be, rather there was no recipe at all, in the first place. It is all on-the-fly. Still; these experiments have been fairly successful and have helped my dad to get himself recognized of possessing great cooking skills. But demands of the same dish has not been made often and dad never came back with the same dish in history, although stunning new results every-time.

Take another case,

A few days ago I was asked for my point and shoot, super zoom camera. Purpose was wedding photography. Here it would be worth mentioning that I constantly keep researching on cameras and photographic techniques to get better and better results. The person who borrowed my camera didn’t know about the details of photography like, rule of thirds, lighting, composition, direction, post processing and for that matter didn’t even know how to work with one of the most basic functionality of the camera and had a pretty tough time handling the semi automatics.  Knowing all these I already knew what results to expect.

Three weeks later, the pictures were shared and I was surprised with the accuracy and skill with which each and every emotion was captured. All the photographs were great piece of work. Most compositions were perfect and I was wrong with my intuitions.

I call this the “welcome accident effect”.  I am not sure how many have witnessed similar things. I have faced it a lot many times. believe or not a lot of our decisions gets influenced by this strange phenomenon. This human behavior is among one the most difficult to judge. Results that throws existing knowledge and understanding from experience out of picture. I had to think for causes, and also did a retrospective.

I took unrelated directions and found that the final result can arrive after a series of coincidences which fit exactly one after the other to make up something great. Something personally and incidentally so great that it even possibly can’t be recreated. Which is perfectly fine. However when we witness such a perfect execution we applaud, and then there are those weak moments  when we begin to flow (most of us do) and deem this result and this achiever greater than one who can achieve one result everyday and every time like a perfectionist.  The dilemma is what you allow to happen to your thoughts.
I am talking about first impression, and the extent to which one might get the intuitions wrong. In one hand you have a fantastic performance which you can’t neglect but possibly won’t get again (or may be you can but not sure about it). The set of information available is enough to rate the performance higher than all at that moment and make a choice. However the paradox is, that the same set of information is not enough in any extent, to help you make your decision. You can just hope to get things right such that you expect continuous performance or flawless results or re-creation of the same result.

In the example of my DAD cooking a fantastic dish just leaves me confused where I know I can’t place his cooking skill  above that of my mom’s , but also can’t deem him less.  Similarly the photographic outcomes from some one very new to this field with just one performance can lead you to a state where you cant ignore the existing performance but also can’t trust the same for further chances (or may be a lot of us can). But surely it is a personal call.

I find it uncomfortable. All our interviews and selection procedures are influenced with this “welcome accident” effect. The outcomes of such picks can’t guarantee any quality. The criteria we evaluate any candidate on might not reveal a big set of positive and negative attributes of one’s personality. Which can be crucial to the environment for which the candidate is being tested for.  I couldn’t find any selection procedure free from this effect. An interview outcome is predictable by the extent by which the “welcome accident effect” has worked for you and in which direction. But the fact that it is a paradox remains true and  Confusing,  is how I seem to understand it.

Aperture, Shutter-speed and ISO do HoW ???


Hi all,

This the first Blog which would discuss the various aspects of different Control of a DSLR camera.

namely Aperture, Shutter-speed and ISO.

Every shift of one unit change in any of the values in any of the above control is called a ‘stop’. This is the least count unit of the camera. Depending upon the camera, and lens you choose there might be opportunity to configure your camera to intermediate values between two stops for better control. However there are definite space separation between two stops, which is pretty much like a standard and we would be considering the same for this current discussion.

Aperture:
This is denoted by the letter f/F in all the DSLR cameras screen /lenses specs. This is the ratio of the focal length to the effective opening of the lens. With every one stop increase in the F-number you cut down the light entering the camera into half.
A typical lineup of the f-stops are, f1, f1.4, f2, f2.8, f4, f5.6……………..f22 and so on. Between these stops the light is either doubled or halved.  (default F-stops are incremental powers of \sqrt{2} )
Bottom line:  a smaller number is a bigger aperture and brighter image, where as a larger aperture number a smaller aperture and a darker image. In a DSLR this is the property majorly governed by what lens you choose irrespective of your camera body.

Shutter-speed:
This number denotes how long the photographic film of your camera is exposed to light. A faster shutter speed would keep the shutter exposed for smaller time and would yield into a darker image, where as the smaller shutter speed would keep the photographic place exposed for a relatively longer time and allow more light to enter the camera and there-by resulting into a brighter image.
The shutter speed too can be measured in term of  ”stops”, and the standard stop values result in a similar result of either doubling the amount of light captured or reducing it to half.
In technical terms shutter speed is entirely a property of your camera body and not the lens. your camera spec should tell you about the maximum FPS (frames per second). In advanced camera there might be an improvement in this number with a optional battery pack.

ISO:
This is the measurement of how sensitive your camera is towards light. If you set the ISO to a lower value the sensor captures/reacts only to bright light. On the contrary if the ISO value if increased the camera starts responding to very dim lights too. In terms of “stop” the same effect can be seen as above. Doubling the ISO value makes the image twice as brighter then before, and can be termed as a one full stop increment of the ISO.
so an image with ISO200 will be twice as brighter then the image taken with ISO100. (this result is of-course keeping the shutter and the aperture values unchanged).

So essentially till this time if only a brighter or a darker image is concerned then all the three controls above are independently capable of providing you the desired brightness in the image. However there are specific advantages and disadvantages with the use of these controls. Sometimes these limiting features of the above controls form the very soul of photography.

So the question remains when to choose what?

Here are the answers,

Aperture: Optics states that with a wider/bigger aperture only small amount of image would be in focus,and not the entire image. This effect is called “Depth Of field”. With a bigger aperture you can achieve shallow depth of field and the object near the lens can be in sharp focus where as the background can be seen as blurred. This sometimes a nice effect  and helps to convey a message as to which area you want the viewer to concentrate. This is useful while shooting macro and portrait.
With a smaller aperture more of your image would be in sharp focus, this is mostly used while shooting landscape where all the image is important. Better lens with wider aperture would produce better bokeh, which would enhance the effect of the image. You should consider Aperture as one of the major parameters before choosing you lens.

Shutter-speed: With a faster shutter speed you might be able to freeze motion. Greatly used in sports photography where a crisp image is of great value. A slower shutter would expose the camera to the motion which might lead to a frustrating motion blur.
There are other conditions where a higher shutter speed can be of great use. If the camera can’t be held stead a tripod or a faster shutter-speed can be handy. However if the subject (like an athlete) is in motion then only a fast shutter speed would help.
But faster shutter-speeds would keep cutting the light entering the camera so we may mix the shutter control with the aperture to obtain desired results.

ISO: In dim conditions (low light conditions)  a flash can produce desired lighting with proper sync speed,(we would talk about sync-speed later) but a flash takes away the natural look away from the resulting image. Also in dusty and foggy conditions a flash can spoil the entire look and feel of the shot. In such conditions where there is a need to capture minute detail of light then we might be dialing in a higher ISO value and take the image. However a higher ISO means making the camera very very sensitive to light. In such conditions the amount of electricity flowing in the camera increases and increases noise, that is why at higher ISO we get a grainier image. Also a prolonged usage of high ISO can result into heating of the sensor and can cause bleeding colors in the corners of the camera film. Again a sensitive sensor would capture even the slightest camera shake, so the use of tripod is a must.

Taking examples of various combination of the above controls:

1) If a portrait of flower is to be taken, we might dial the smaller aperture as possible,with a fast shutter speed (which would depend on motion) and the light conditions would govern the ISO value.

2) If the intention is to freeze motion of a distant object then a smaller aperture (for most part of the image to be in sharp focus) and higher shutter speed can be used. Again the ISO value would depend on the lighting conditions. (like if it is afternoon or morning or evening etc.)

3) If the intention is to blur motion (mostly used for waterfalls or light trails or the famous and fantastic imaging effect star-trails) then adjust the aperture according to your needs, choose a suitable ISO and choose a long exposure value but reducing the shutter speed. A star trail would need the use of exposures as long as 25 minutes. In longer exposures though a hand held usage is practically impossible.

This might have become little long, but so was the subject. I hope this section was useful for you to understand Aperture, shutter-speed and ISO and how they can be used together. If you have any questions please send me the queries to my e-mail chattopadhyaydotabhishekatgmaildotcom.

Thanks for reading.

My Photography.


I have always loved photographs and photography. I remember those days of my childhood, when we went on trips. Dad used to prepare his small film-roll camera, used to take few extra batteries and few rolls of film with him. It was one of those few gadgets, which  always wished  to have of my own.  In those days a camera used to be pretty costly and children were not always trusted for handling them. Still I always managed to get a few chances to get the camera and click few shots.  Most of the times they came well and were noticed, but alas that was not enough to convince my Dad to buy me one of my own. Anyway that was not a disappointment for me as long as I got those few chances in every trip.   As time passed I happened to get busy with a lot of things and the passion to click and the affinity to the shutter’s sound got lost in the ether.  Later it so happened that my Dad gifted me a very nice cell-phone with an integrated camera in it. That got me off the mark and I instantaneously started taking images of everything I could. It was mad time for a few days.

As I went on, with my experiments I started to realize the benefits of having a handy camera where-ever you go. It helps you to bring back memories and with the advent of technology you can very easily make it immortal for ever.  Also along the same lines I also craved for a better camera which was more capable technically.

I started to talk to photographers, understood various aspects of photography, various techniques and many other things. Once again Technology was up for my rescue, You tube videos were of great help. It would be hard to believe that before I bought my first camera (super-zoom Point & shoot) I practically knew all the controls of the device. It was a great experience in itself to get the piece out of the box and start changing and manipulating it like an expert.

I kept on going and taking more images, more experiments and more shots and growing on my hobby. But the number of places I could carry my camera were less so the opportunity of using that camera reduces and fell back as compared to the camera in my mobile, that is one reason why I think the ‘camera in a mobile ‘ concept is a million dollar idea. I kept learning and finally, I came to know about DSLR technology and what it was capable of. I was impressed, delighted and thrilled at the same time. I started to explore the world of SLR and DSLR photography. I read papers and researches, basically studied techniques and photos of great photographers.  Understood the basics and now went ahead to buy a new DSLR.

Budget is always a point to note but hobby comes first as this is not something you would spend on everyday. I framed the equation with millions of variables. And finally solved it with some brand and model in my mind.

I am happy to share this with everyone, and I’ll be putting a lot of more information in these pages. They would include photography techniques and other details, which I have learned from my work or from those around me. Learning is important and so is the source. You need to always cross-check it before passing it on. I strongly believe it this logic. As in this era of technology it is very difficult to judge the correctness of information. So it becomes a moral responsibility of each one of us to stop propagating any incorrect information.  So any thing I put here is exactly what I have tried or atleast cross-checked.

I hope it would help people and me to learn from here.

I don’t have a Title for this post.


Disappointed and a feeling of a great loss; that is what I feel today. But this is not what I feel about my entire life, rather actually about a very small part of it. In-fact it is all about the last two days.
It was last Friday when I was all jumping with joy as the traveler in me was calling. I along with my wife was going to visit Nainital. A place I waited long enough to visit. Everything was perfect in the plan and yes as it seemed till the end everything was going as we planned. We were happy. Two days well spent. Had a lot of fun exploring the place and enjoying local food and yes; clicking photographs of each other and whatever we thought could remind us of something.

Candles, I am very fond of them, and of-course when it comes to Nainital, you have to agree the craftsmen there have a very different taste of the art. I heard a lot about them and when I finally visited one of the local wax galleries, I just couldn’t stop myself spending a lot of time and money selecting and buying souvenirs.

Enjoyed Dassera and took our ride back to Delhi. It was a combination of a smooth and a bumpy ride.  Monday morning, we reached Delhi and got down from the bus. A bolt from nowhere hit us. The bus staff had misplaced our baggage. We stayed and everyone else walked back home with their part of happiness.
The bus staff and us did some inquiries and it seemed for a while that all this was worth doing, as for a while, it did seem to me that I am going to get my luggage back. But it was difficult that it was all in vain.
I wanted to be furious but wasn’t able to, I was emotionally stretched by the loss.
After a couple of hours of inquiry the bus staff settled down and started to negotiate. They offered lame excuses and offered a cheap deal of settling the entire thing with 5 grand. I couldn’t believe it.
Service providers while promising un-interrupted, flawless service never miss flaunting their expertise in doing that, but when it comes to actually doing that they don’t seem to be a mile close to what they claim. The compensation they offered was injustice to me and I deemed it insufficient. I refused it.

As an educated man I had full faith in the constitution of my country and I believed the system. Yes, that I say when i know so much about it. When I know how it works and how it doesn’t.
I went to the police and yes, I did forget, it was a mistake. They made me sit for an hour for filing my complaint. I asked for an F.I.R which they denied saying that I had no right to ask for one. I felt helpless and unattended. Suddenly I saw a board in the same police station which read “if you are unhappy with the police then contact the below given numbers”
Well, a ray hope I thought to myself. I tried the numbers and WOW!! None were reachable. So, I left with a carbon copy of my complaint.
Then like an educated and sincerely tax paying individual does, I went to the consumer court. I had to spend about 2 hours taking hops one after another to reach it. One of the most unknown places in the entire city. I found it sand I found in the entire court complex it was the most lonely one. I bet one will be scared and hate to even knock the doors when they see an empty table in the front room with food dirtily spilled all over.
Anyway I went in finding for anyone who belonged there. A face, totally unfriendly and reckless. A while later I explained my situation and he gave me a list of things so fast that it forced me to ask the same question thrice and make a fool of myself. I noted the required items and documents necessary and left.
As I was in a court complex I met a young lawyer and asked him a simple question regarding the F.I.R and my rights regarding the same. He confirmed that it’s my right to get one. Then he showed interest to listen to my problem and offered me help very cleverly. He strongly discouraged me to go to the consumer court.

Well I in the meanwhile called my manager and briefed him of the mess I was in and missed office, and when it was no more bearable I decided to go home. I considered my options and I found that most of the things required for even filing a case in the consumer forum are not present with me, and I was not looking forward for a criminal case as I’ll not be able to afford the indulgence. From the time I left the bus at 6:00 am in the morning, it was 9 hours of run which resulted in nothing, but a feeling of a defeated self.

I came back home, eat a little and slept for a while. Then I called up my wife to see if I should pick her up. We walked back our way back home, buying a few essentials we lost in our baggage. After reaching we both tried to be as cheerful as we could to avoid reminding the other of the incident, we were lying to ourselves.
Later that evening we decided that the best thing would be to move on and we promised not to discuss this thing again. Still I couldn’t stop myself writing this up.

I did a retrospect and just discovered that for the mistake of someone, sometimes how hard you pay.
I am feeling Disappointed and my loss is irreparable. I hope this never happens to anyone of you.