Understanding /proc/meminfo – Analysing Linux memory utilisation

/proc/meminfo Provides valuable information about the system’s RAM usage. (utilization of run time memory).  This varies by architecture and compile options.  The following is from a 4GB RAM, 64bit Ubuntu Desktop MemTotal: Total usable ram (i.e. physical ram minus a few reserved bits and the kernel binary code) MemTotal is the sum of HighTotal and … Read more

Understanding Linux page cache memory

If data is written, it is first written to the Page Cache and managed as one of its dirty pages. Dirty means that the data is stored in the Page Cache, but needs to be written to the underlying storage device first. The content of these dirty pages is periodically transferred (as well as with … Read more

Sending ARP request and receiving ARP Reply using C code

This post is in continuation of our previous post “Understanding ARP (Address Resolution Protocol) basics“ To visualise what ARP reply we are getting from arping command, we need to write an ARP reply receiver code as below, compile this code as, So, as we can see “arping” sent above ARP reply to broadcast destination mac … Read more

Understanding Linux Signals with simple C program

Signals are a limited form of inter-process communication (IPC), typically used in Unix, Unix-like, and other POSIX-compliant operating systems. A signal is an asynchronous notification sent to a process or to a specific thread within the same process in order to notify it of an event that occurred. Signals originated in 1970s Bell Labs Unix … Read more

Identify / Test file types in Linux using C program stat API

The file mode, stored in the st_mode field of the file attributes, contains two kinds of information: the file type code, and the access permission bits. This section discusses only the type code, which you can use to tell whether the file is a directory, socket, symbolic link, and so on. There are two ways … Read more

Capture and analyze network packets using tcpdump and tshark

We can use tcpdump to capture the packets whereas tshark to analyse the packets. Using above help, lets capture the packets and try to write it to a file name captured_packets.pcap as, Lets do some network operations, like browse website etc, for testing ( you could already be getting packaets flowing in network even if … Read more

C Program to check Little or Big Endian machine

Endianness is the order or sequence of bytes of a word data. Endianness is of two types Big-Endian (BE) – stores the most significant byte of a word at the smallest memory address and the least significant byte at the largest Little-Endian (LE) – stores the least-significant byte at the smallest address

Subscribe for New Post Updates

Join 211 other subscribers