Posts

Throughput, Goodput And Latency

Image
To define Throughput, Goodput and Latency, we need to understand some terms first such as the propagation delay, the packetization delay, the queueing delay, etc. Propagation Delay The propagation delay can be calculated with the following formula: Propagation delay = distance / speed of the signal where “distance” is the length of the media The propagation delay can be expressed in terms of RTT of a packet. On a point to point link, when we transmit a series of packets from point A to point B: the propagation delay of all the packets equals the propagation delay of a single packet. This is important to know when we will later calculate the end-to-end delay. Transmission time (Packetization delay) Transmission time is the time elapsed from the first bit put on the link till the last bit is put on the link. Transmission time is also known as Transmission Delay or Packetization Delay in packet switching networks. Why did I say packetization delay in packet switching networks? Because i...

Error Detection And Correction

The transmission media is not 100% reliable. It introduces modification of the signal such as distortion, attenuation noise and interference. This introduces errors in transmitted data, in the form of bit errors. The bigger the frame size and the higher the probability of single-bit error, the lower the probability of receiving an error-free frame. → we need an error detection and correction scheme Errors can be : single-bit error: only one bit is corrupted. They are common in parallel communications 2-bit errors burst error: more than one bit is corrupted, because the duration of the noise is longer than the duration of the transmission of one bit. Burst errors are common in serial communication. A burst error is a sequence of bits between two error bits. The sequence in between may or may not contain error bits. – Commonly used error detection schemes: Checksum, CRC and Message Authentication Code (MAC) Some Error detection and correction techniques are based on adding redundanc...

Network Design: The End-To-End Principle Explained

The network was designed with two principles in mind: the End-to-End principle and the Strong End-to-End . End-to-end principle The End-to-End principle states that end-to-end applications are solely responsible for the correctness of the data transferred. It also states that the network can implement some features -or incomplete versions of the features- in the middle of the communication channel to enhance the performance, but it’s not its job. For example, Applications can benefit from TCP segment retransmission mechanism and from link layer error detection. But this must not substitute for their own mechanisms. Let’s take the error detection mechanism implemented at the link layer. This mechanism is executed on a per link basis and does not guarantee that there won’t be any storage errors. In fact, even if the link does not inserts errors, the memory of one intermediate host may be buggy and invert bits. The link layer error detection won’t detect that, and frames will be transmit...

Introduction To ICMP

Image
ICMP is a Transport layer protocol. When encapsulated into IP, the protocol field of the IP header = 1 to mean “ICMP”.   ICMP Header ICMP header fields: Types Code Checksum Message-specific information – header size is 8 Bytes: the first 4 Bytes are fixed in size (Type, Code and Checksum) and the last 4 Bytes have a variable size. – performs error reporting and congestion notification (with ICMP Source Quench messages, which are deprecated) – is used by two popular networking tools: Traceroute and Ping – ICMP Echo Request is Type 8 Code 0 – ICMP Echo Reply is Type 0 Code 0 – At the receiver side, an ICMP error message (such as Destination Unreachable ) contain the IP datagram of the sender, in the payload, plus the first 8 Bytes of data originally sent by the sender. The ICMP error message is then encapsulated in a new IP datagram in order to be sent back to the sender. The following ICMP error messages are sent by routers: ICMP Network Unreachable (...

The Keyboard Banger Guide To The TCP Protocol

Image
I have gathered my study notes on the TCP protocol in one big blog post. I hope you are going to enjoy it! TCP Protocol service model TCP used by 95% Internet applications. A TCP segment contains one or more bytes of data. The 4-PDU at the source system is not inspected by the routers on the network path. Once it reaches the destination system, the latter reads the 4-PDU header and passes the data to the application layer. For each application, there is a process running in memory. TCP application multiplexing and demultiplexing The transport layer, and more precisely the TCP protocol, at the source system inserts data from different application processes into segments. This mechanism is called “ application multiplexing ”. The target application process is determined by the following triplet: source port, destination port, destination IP address. The source system generates a unique source port number . The transport layer (again here the TCP protocol) at the end system reassembles re...

IP Addresses And Classless Interdomain Routing (CIDR)

Each IP address is composed of two portions: the network prefix: defines the administrative domain (e.g. MIT, Princeton) the host portion Before CIDR: ip addresses were allocated in blocks of /8 (class A blocks), /16 (class B blocks) or /24 (class C blocks). Class A ip addresses : begin with binary 0 Class B ip addresses begin with binary 10 Class C ip addresses begin with binary 110 Classless InterDomain Routing (or simply CIDR ) allows to create blocks of any number of bits and not be restricted to /8, /16 or /24 blocks. When we talk about a CIDR block, we refer to its netmask. For example, a CIDR block of /20 means we have 20 bits set to binary “1” for the netmask and 212 host addresses. The shorter the CIDR block, the larger the block of host IP addresses Today, IPv4 addresses are managed in CIDR blocks IPv4 address allocation is delegated by ICANN to IANA. IANA is a department in ICANN. IANA assigns a /8 CIDR block to each RIR ( Regional Internet Registry ). Examples of RIRs: ARI...

Network Byte Order

We need to know two of the basic data types in C language: char : smallest data type. Its size is at least 8 bits integer : Each basic data type (aka Arithmetic type specifier) can be further classified with one of these optional specifiers: Short Long Signed Unsigned for example, a type of Integer can be: Short Unsigned Int: written on 16 bits Short Signed Int: written on 16 bits Long Unsigned Int: written on 32 bits Long Signed Int: written on 32 bits For computers to communicate, they need to have the same endianness. Each computer has its own Host Byte Order , which is how they represent multibyte words in memory.. x86 processors are Little Endians. ARM processors (such as in Iphone) are Big Endians) The way network protocols represent multibyte words is called Network Byte Order . They use the Big Endian format. But what if the computer processor Host Byte Order is Little Endian and the computer wants to write data to the network? the computer can use specific network libraries (o...