IAE Academy

The whole Computer Networks formula sheet, to print

59 formulas in 7 topics, each with when to use it. Each is explained in the topic notes.

Layering and switching: circuit, packet and virtual circuit

Read the notes

HEADER EFFICIENCY

Fraction of transmitted bits that is useful data; with several layers, add up the headers of all layers that wrap the payload.

MESSAGE DELAY IN A CIRCUIT-SWITCHED NETWORK

L = message size in bits, R = rate of the reserved circuit in bits per second (R/n of the link rate when n circuits share it); T_setup is the set-up time given in the question (teardown ignored); T_prop,path is the sum of the propagation delays of all links. Switch processing is ignored unless stated.

ONE PACKET OVER K LINKS (STORE-AND-FORWARD)

The whole packet is transmitted again on every link, so transmission delay is counted k times; all links at rate R, no queueing or processing. If the links have different propagation delays, add the delays given.

A MESSAGE SENT AS N EQUAL PACKETS OVER K LINKS

Each packet has p bits including its header, all links at rate R, no queueing, and the packets go back to back. The first packet needs k transmission times; each later packet arrives one transmission time after the one before it (pipelining). T is the time from the first bit leaving the source until the last bit of the last packet reaches the destination.

N EQUAL PACKETS OVER LINKS OF DIFFERENT RATES

R_i = rate of link i, R_min = rate of the slowest link (the bottleneck). The first packet crosses every link once; the later packets leave the bottleneck one p/R_min apart and keep that spacing. With all rates equal this reduces to the previous formula. No other traffic, no queueing apart from waiting for the packet ahead.

PAYLOAD SIZE THAT MINIMISES TOTAL DELAY

M = message bits, h = header bits per packet, k >= 2 links of equal rate, ignoring the rounding of M/x to a whole number. Derivation: delay times R is (k-1+M/x)(x+h) = (k-1)x + (k-1)h + M + Mh/x; setting its derivative with respect to x to zero gives (k-1) = Mh/x^2. Propagation does not depend on x.

Performance metrics: delay, throughput and link utilisation

Read the notes

TRANSMISSION DELAY

L = packet size in bits, R = link rate in bits per second. Depends on the packet and the rate, not on the length of the wire.

PROPAGATION DELAY

d = length of the link, v = propagation speed in the medium. Independent of the packet size and the link rate.

ROUND-TRIP TIME (NEGLIGIBLE ACK SIZE)

For a short probe or acknowledgement whose transmission delay is negligible. If transmission delays matter, add them explicitly.

ONE PACKET OVER N LINKS, STORE-AND-FORWARD

Each router receives the whole packet before forwarding it. Queuing and processing delays are zero unless given. With equal links this is .

P PACKETS BACK TO BACK OVER N EQUAL LINKS

All packets have the same size L, are sent without gaps, and no queuing occurs other than waiting behind earlier packets. The first packet needs N transmission times; each later packet finishes one transmission time after the one before.

THROUGHPUT OF A PATH

Steady transfer of a long stream over links in series with no other traffic, and a sender window large enough not to be the limit. Delays do not change this rate; they only shift when the stream starts and ends.

FILE OF F BITS IN PACKETS OF L BITS, LINKS IN SERIES

Store-and-forward; is the bottleneck rate (link ); F is a whole number of packets of L bits sent back to back; no other traffic, no processing delay. Every link other than the bottleneck adds one packet transmission time. With equal links and this is . For a very large F the first term dominates.

BANDWIDTH-DELAY PRODUCT

Number of bits that fill the link from one end to the other (bits in flight in one direction). Using gives the bits that can be in flight during one round trip.

WINDOW-LIMITED THROUGHPUT

W = sender window in bits (a TCP window is given in bytes, so multiply by 8). = time from sending the first bit of a window to receiving its acknowledgement: for frames of transmission time , or simply RTT when transmission time is negligible. With this gives , as below.

STOP-AND-WAIT UTILISATION

No errors, acknowledgement transmission time and processing time negligible. If the ACK has a non-negligible transmission time , the cycle is .

EFFECTIVE THROUGHPUT

R = link rate. Equivalently, one frame of bits is delivered per cycle: .

STOP-AND-WAIT WITH FRAME LOSS

Each frame is lost independently with probability p, acknowledgements are never lost, and every failed attempt costs one full cycle (timeout equal to the cycle). The expected number of transmissions per frame is .

USEFUL THROUGHPUT WITH HEADER OVERHEAD

L = whole frame in bits including the header, H = header bits. Use this only when the question asks for data (payload) throughput; otherwise headers count as transmitted bits.

SLIDING-WINDOW UTILISATION

N = sender window in frames, , no errors, ACK transmission negligible. Applies to Go-Back-N and Selective Repeat alike when there are no losses. gives stop-and-wait.

WINDOW NEEDED TO KEEP THE LINK BUSY

Smallest window giving . Equivalently, the window must cover one full cycle: .

GENERAL RULE FOR SEQUENCE NUMBERS

= sender window, = receiver window, both in frames; k = bits in the sequence number. Go-Back-N has , giving ; Selective Repeat with gives .

MAXIMUM WINDOW, GO-BACK-N

k = bits in the sequence number. A window of would make a whole new window look like a retransmission of the old one.

MAXIMUM WINDOW, SELECTIVE REPEAT

Sender and receiver windows are equal; the two windows together must not exceed the numbers.

SEQUENCE BITS FOR A GIVEN WINDOW

N = sender window size in frames. Use from the utilisation formula when the question asks for the field that keeps the link fully busy.

Data link layer: error detection, medium access control and Ethernet

Read the notes

DETECTION WITH MINIMUM DISTANCE D

A code of minimum distance d detects every pattern of up to d - 1 bit errors.

CORRECTION WITH MINIMUM DISTANCE D

Decoding to the nearest codeword corrects up to this many bit errors.

CRC FRAME LENGTH

m data bits plus an r-bit remainder give an n-bit frame; the generator has r + 1 bits.

NUMBER OF HAMMING CHECK BITS

The smallest r for which the syndrome can point to any single-bit error in an (m + r)-bit codeword.

TRANSMISSION TIME AND THE RATIO A

L = frame length in bits, B = bandwidth in bits per second, T_p = one-way propagation delay. A small a means a station hears another's frame early in its transmission, so carrier sensing works well.

PURE ALOHA THROUGHPUT

S is the fraction of time that carries a successful frame; the maximum is about 18.4% at G = 0.5.

SLOTTED ALOHA THROUGHPUT

The maximum is about 36.8% at G = 1.

MINIMUM FRAME SIZE FOR CSMA/CD

L = frame length in bits, T_p = one-way propagation delay (distance divided by propagation speed), B = bandwidth in bits per second. Put another way, the transmission time must be at least 2 T_p.

Routing: distance vector and link state

Read the notes

BELLMAN-FORD (DISTANCE-VECTOR) UPDATE

For y not equal to x (D_x(x) = 0). x is the router, N(x) its neighbours, c(x,v) the (positive) link cost to neighbour v, D_v(y) the cost to destination y that v advertised. The neighbour v giving the minimum is the next hop.

DIJKSTRA RELAXATION

Applied to every neighbour v of the node u just made permanent (only tentative neighbours can improve). Requires all link costs to be non-negative.

DIJKSTRA RUNNING TIME

n routers, e links; a straightforward implementation scans for the minimum, a heap makes extraction logarithmic.

IPv4: addressing, CIDR, fragmentation and NAT

Read the notes

ADDRESSES IN A BLOCK

For a block with prefix length p, counting the network and broadcast addresses.

USABLE HOSTS IN A BLOCK

For a block with prefix length p. The two subtracted addresses are the network and broadcast addresses. Valid for p up to 30.

NUMBER OF SUBNETS (CIDR CONVENTION)

s is the number of host bits borrowed (new prefix length minus old prefix length). All-zeros and all-ones subnets are allowed.

NUMBER OF SUBNETS (OLDER CLASSFUL CONVENTION)

Only when the question excludes the all-zeros and all-ones subnet numbers.

BLOCK SIZE IN THE INTERESTING OCTET

The interesting octet is the one where the mask is neither 255 nor 0. Subnets start at multiples of the block size in that octet. If p is a multiple of 8 there is no such octet: the host part is whole octets.

MAXIMUM DATA PER FRAGMENT

H is the header length in bytes (20 without options). Data in every fragment except the last must be a multiple of 8 bytes.

NUMBER OF FRAGMENTS

L is the original total length in bytes, H the header length. Assumes a single fragmentation at one link and the same header length H in every fragment.

FRAGMENT OFFSET FIELD

Measured from the start of the original datagram's data. MF = 1 for every fragment except the last.

DATA BYTES CARRIED BY A FRAGMENT

Byte positions in the original data, numbered from 0. Total length is in bytes; HLEN is in 4-byte words.

TCP: flow control, congestion control and sockets

Read the notes

ACKNOWLEDGEMENT NUMBER

For a segment that arrives in order, with sequence number seq and L data bytes. Because the ACK is cumulative, an out-of-order segment brings back the previous ack number again (a duplicate ACK).

SENDER'S EFFECTIVE WINDOW

rwnd is the receiver's flow-control limit; cwnd is the congestion window from the next section.

MAXIMUM THROUGHPUT WITH WINDOW W

W is in bits when the rate is in bits per second. Assumes no loss, header overhead ignored and ACK transmission time negligible. When the window equals the bandwidth-delay product, the pipe is exactly full. If a question defines one cycle as RTT plus the transmission time of the window (or of a segment), use that cycle in place of RTT.

LINK UTILISATION (SLIDING WINDOW, CONTINUOUS)

Link rate times RTT is the bandwidth-delay product. Keep it in the same unit as W (bits or bytes).

SEQUENCE-NUMBER WRAP-AROUND TIME

The sequence field is 32 bits and counts bytes, so bytes pass before numbers repeat, if the sender sends continuously at the full rate.

MINIMUM SEQUENCE-NUMBER BITS

The condition is that sequence numbers (counting bytes) must not wrap around while a segment can still be alive in the network. The lifetime is the maximum segment lifetime given in the question. Convert the rate from bits to bytes per second by dividing by 8.

RETRANSMISSION TIMEOUT (STANDARD ESTIMATOR)

SRTT and RTTVAR , where R is a new RTT sample. RTTVAR is updated first, using the old SRTT. On the first sample, SRTT = R and RTTVAR = R/2, so RTO = 3R.

MULTIPLICATIVE DECREASE

cwnd is the window at the moment the loss is detected. Unless the question says otherwise, take cwnd/2 in whole MSS (rounded down for an odd window).

Application layer: DNS and HTTP

Read the notes

TIME FOR AN ITERATIVE RESOLUTION BY THE RESOLVER

R_host is the RTT from host to local resolver and R_i the RTT from the resolver to each server it queries in turn. Assumes processing time is negligible and each query and its reply is one UDP exchange costing one RTT (no losses or retransmissions). With a cached TLD referral, drop the root term; with a cached final answer, only R_host remains.

AVERAGE ACCESS TIME WITH A WEB CACHE

h is the hit ratio (fraction of requests the cache answers), T_hit the time to get an object from the cache and T_miss the time to get it through the cache from the origin server. Assumes every request takes one of these two times.

NON-PERSISTENT, SERIAL

Each of the n+1 files costs 1 RTT for the handshake and 1 RTT for request and response.

NON-PERSISTENT, M PARALLEL CONNECTIONS

Base file fetched alone first; objects then go in batches of m. Assumes equal object times and negligible transmission time.

PERSISTENT WITHOUT PIPELINING

One handshake, one RTT for the base file, one RTT for each object.

PERSISTENT WITH PIPELINING

One handshake, one RTT for the base file, one RTT for all objects together (requests sent without waiting). Transmission time is ignored.