Benford's law states that the leading digit d (d ∈ {1, …, b − 1} ) in base b (b ≥ 2) occurs with probability proportional to logb(d + 1) − logbd = logb((d + 1)/d). This quantity is exactly the space between d and d + 1 in a log scale.

In base 10, the leading digits have the following distribution by Benford's law, where d is the leading digit and p the probability:

dp
130.1%
217.6%
312.5%
49.7%
57.9%
66.7%
75.8%
85.1%
94.6%

Using the example given is the TCP/IP guide, I made a comparison of normal PPP and Multilink PPP (just to have some fun).

Original frame size = 32 bytes = 256 bits

Stripped down frame size = 24 bytes = 192 bits

MP Frame size = 158 bits X 3

Size difference = |256 bits - 474 bits| = 218 bits

Time to transfer orginal on 64,000bps = 0.004s .....(1)

Time to transfer MP in 64,000bps X 2 = [(158X2)bits over 128kbps = 0.00246875s] + [158bits over 64,000bps = 0.00246875s] = 0.0049375s .....(2)

From (1) and (2), time taken my MP is more.
mrgreen

However, the Information field of PPP frames is variable. So when a larger amount of data is to be carried, MP is obviously more efficient.

A PPP frame starts and ends with a Flag with value 0x7E. The Flag (start) is followed by Address and Control fields, with are not needed for PPP, but are present for compatibility with High Level Data Link Control Protocol (HDLC). Default values are 0xFF for Address (broadcast) and 3 for Control. The fields are suppressed when using Field compression. (0xFF03 is not a valid Protocol field, and thus the difference is made).

The Protocol field ranges from 0x0000 to 0xFFFF, each used for a particular protocol. Some values are not used (see above). The first octet is even and the second octet is odd. The value when encapsulating an IP packet is 0x0021. When using IPCP, the value is 0x8021. (Add 8 to first digit for getting corresponding NCP value).

The Information Field has the Network Layer data encapsulated. It may be followed by Padding.

This is followed by FSC (Frame Check Sequence), which is a CRC code of the data. It is 2(default) or 4 bytes in size.

The last byte is, ofcourse, the Flag, 0x7E.

Link dead -> Link Establishment -> (Authentication) -> Network Layer Protocol -> Link Open -> Link Termination.

SLIP Data Framing

IP Datagram broken into bytes. Each packet starts and ends with END character (C0h).

If END character is present in data, it is converted into DB-DC (DBh is escape character)

If ESC character is present in data, it is converted into DB-DD

Baud and Bitrate

Named for telegraphy pioneer Jean Maurice Emile Baudot (1845-1903), this is a unit that measures the number of changes, or transitions, that occur in a signal in each second. So, if the signal changes from a “one” value to a “zero” value (or vice-versa) one hundred times per second, that is a rate of 100 baud.

Modern modems use advanced modulation techniques that encode more than one bit of data into each transition. A 28,800 bps modem typically encodes nine bits into each transition; it runs at 3,200 baud, not 28,800 baud (the latter number being the product of 3,200 and 9)

Source

Russell's Paradox



The problem arises when it is considered whether M is an element of itself. If M is an element of M, then according to the definition M is not an element of M. If M is not an element of M, then M has to be an element of M, again by its very definition. The statements "M is an element of M" and "M is not an element of M" cannot both be true, thus the contradiction

malloc - allocates memory.

calloc - allocates memory of n blocks of size. initializes values to zero.

realloc - reallocates (expands/shrinks) memory allocation.

free - releases allocation



void *malloc ( unsigned int size )

Usage: pnt = (type *)malloc(size)


void *calloc ( unsigned int number, unsigned int size )

Usage: pnt = (type *)calloc(number, size)


void *realloc ( void *old_pnt, unsigned int new_size )

Usage: new_pnt = (type *)realloc(old_pnt, new_size)


void free ( void *pnt )

Usage: free(pnt)

Character Encoding

A character encoding or character set (sometimes referred to as code page) consists of a code that pairs a sequence of characters from a given set with something else, such as a sequence of natural numbers, octets or electrical pulses, in order to facilitate the storage of text in computers and the transmission of text through telecommunication networks. Common examples include Morse code, which encodes letters of the Latin alphabet as series of long and short depressions of a telegraph key; and ASCII,

A character repertoire is the full set of abstract characters that a system supports.


A coded character set specifies how to represent a repertoire of characters using a number of non-negative integer codes called code points. For example, in a given repertoire, a character representing the capital letter "A" in the Latin alphabet might be assigned to the integer 65

A character encoding form (CEF) specifies the conversion of a coded character set's integer codes into a set of limited-size integer code values that facilitate storage in a system that represents numbers in binary form using a fixed number of bits

a character encoding scheme (CES) specifies how the fixed-size integer codes should be mapped into an octet sequence suitable for saving on an octet-based file system or transmitting over an octet-based network.

Source

Newer Posts Home