Posts

Showing posts from July, 2015

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...

Memory, Byte Order, Little Endian and Big Endian

Image
When a computer wants to send a packet to the network, the computer software copies the packet into the memory, then the packet is copied from memory to the NIC. Similarly, when a computer wants to receive a packet from the network, the computer software copies the packet from the NIC into memory, then retrieves the packet from memory. A CPU has a set of registers . The size of the register determines how much memory it can address at one time. For example,  a 64-bits CPU means that the processor registers can handle 64-bit chunks of memory at a time. Also, this number determines the number of addressable memory locations, i.e. a 64-bits CPU has 264 addressable memory locations. There are three types of memory in a computer: Cache memory, Main memory (RAM) and Disk memory. For the sake of simplicity, we will confuse all types and talk about “memory” in general. The memory contains memory cells. Each memory cell contains a “ word ”. The word can be 1, 2, or 4-byte long, depending on the...

The TCP IP Model

Image
In this TCP IP tutorial we start by understanding the layering principle, then we examine the most popular protocols that make the TCP IP stack. TCP IP layering concept – Each layer delivers a service to the layer above. – Each layer performs what it is meant to do and does not care about the layers below. – Each layer on the source host communicates with its peer layer on the destination host → this is called Peer-layer communication – Communication between layers of a same host is vertical in both directions – We can change the implementation of a layer, as long as we preserve the inputs and outputs with the upper and lower layers – A cross-layer implementation is a protocol definition that spans more than one layer. Cross-layer implementations reduce the flexibility of Internet. Advantage of layering Layering reduces the complexity of communication by breaking it into smaller pieces. E.g: computer programming (programming language, compiler, linker...

The Principle of Packet Switching

I am going to define in this post some principles of packet switching. Definitions for Packet Switching packet = self containing unit of information Switching = forwarding packets very quickly and efficiently. When the link is free, the packet is forwarded. When the link is busy, the forwarding is delayed. Flow = a collection of datagrams that belong to the same end-to-end communication Principle of Packet Switching In the old switching model, the SRC inserts the path in each packet. Each switch on the path reads the next hop within the packet and forwards the packet. The process continues until the packet is delivered to the final destination. This process is called source routing . Nowadays it is abandoned for security purposes. In the new switching model, each switch conserves a little bit of state. Each switch builds a table that associates addresses with next hops. However, packet switches do not maintain per-flow state. If a flow dies, packet switches are simply not aware of it. ...

Troubleshooting Solarwinds Network Paths

Image
I attended a Webinar recently that explained how to troubleshoot Solarwinds network paths. The following is a summary of my notes. In this session, Solarwinds exposes a new concept: Network Path troubleshooting. Here are my notes: Without an NMS, the Mean Time To Repair (MTTR) a networking issue is about 4.6hr. 2hr of them is dedicated to finding what component is guilty The network evolved from having the datacenter in the center of our network to having the Internet in the middle. Legacy network architecture – copyright by Solarwinds New network architecture. The red lines are the network paths- copyright by Solarwinds The network devices form many paths. But when an issue occurs, how can we determine the critical path? Monitoring is an ongoing collection of metrics. It’s not a task you do when a trouble ticket is raised. Solarwinds is working on an application project called Network Path Troubleshooting. It is an app built for each network path. For each network path, the...

Fitness quotes

Following up with my previous post on exercise and cognitive functions , here is a list of fitness quotes to help you keep working out like a monster: I don’t want to lose my fitness. I’m 45. I have two babies. I’ve got a long way to go and I want to keep in tiptop shape. There’s no magic bullet. – Marcia Cross I know some people who are like, ‘I love fitness,’ and I feel like if you have to say that, you’re still in the romance stage. I’m in the stage where I’ve been married to it for 60 years, and I don’t think I’ll ever get a divorce. – Matt McGorry I’m an athlete, so I can get up one day and run and it wouldn’t bother me. I don’t get the time because I work for long hours every day. Being constantly on the move itself helps me stay fit. I don’t go to a gym. I use the stairs, not the lift. I’m not into fitness, but I feel I should start ,as it’s healthy. – Genelia ...