Salta al contenuto
Note per Studenti Network Key Performance Indicators Report

Network Key Performance Indicators

In questa pagina 9

To know whether a network can sustain a streaming session or a video call one must be able to measure and compute its performance: how many bits per second it carries, how much delay it adds, how many packets are lost. This note defines the indicators precisely and uses them for the usual calculations. The layered model itself is in ISO-OSI Model and TCP-IP StackCommunication between two computers is too varied a problem (signals, errors, medium access, routing, flow control, data representation) for a single protocol, so it is divided into layers. The ISO/OSI model has 7 layers (physical, data link, network, transport, session, presentation, application); the TCP/IP stack merges the top three into one application layer, so it has 5. Each layer offers a service to the one above and talks only to its peer layer through PDUs; going down a header (PCI) is added: encapsulation. Addresses: MAC (link, local), IP (network, global), port (transport).ISO-OSI Model and TCP-IP Stack →, and a complementary treatment is in Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis →.

1. Layered architecture

A network must solve very different problems: generating physical signals from bits and recovering bits from signals; coping with channel disturbances; ensuring correct communication between two neighbouring hosts (single hop); finding a path through several hosts; handling incomplete or lost messages; offering high-level services (e-mail, the Web, streaming, cloud gaming). To master this complexity the network is organised as a stack of layers. The idea is common in computer science (abstract data types, operating systems with kernel and services, databases with physical, logical and view levels): services are offered while hiding implementation details.

Layer, service, protocol, interface.

  • A layer provides a set of services to the layers above while hiding the complexity of its implementation; it is defined by the services it offers.
  • A service is a set of primitives offered to the upper layer: it says what the layer can do, not how. It is delivered through the interface between provider (lower layer) and user (upper layer).
  • A protocol is a set of rules defining the format and meaning of the packets exchanged by peer entities of the same layer on different hosts.
  • A protocol can be replaced as long as services and interfaces stay the same (example: HTTP/3 runs over QUIC on UDP instead of TCP, keeping similar services to the upper layers).

Example: the physical layer (L1) performs modulation (creates an electromagnetic, optical or acoustic signal from bits) and demodulation (estimates the bits from the signal) and hides the analog channel from the upper layers: it offers the service of a digital bit channel. Upper protocols need not know whether the medium is fibre or radio.

Layer Service offered
L1 physical (PHY) digital bit channel, single hop, unreliable
L2 data link (DLL) packet channel, single hop, reliable
L3 network (NET) end-to-end, connectionless packet channel between hosts
L4 transport end-to-end channel between processes (bit stream)
L5 application (APP) services to users (multimedia services)

The definition of a layer's services is partly arbitrary (several models exist: ISO/OSI and TCP/IP), but the idea is that a layer deals with homogeneous problems.

2. Packetisation

The application produces data at some rate (not necessarily constant) and offers it to the layer below (L4), which splits it into smaller units adding control information (header). L4 offers the packets to L3, which decides the source-destination path; every layer may split data units and add further headers. At the destination the inverse process rebuilds the application data.

The bit stream is divided into blocks; a packet consists of a header (control data: block identifier, source, destination, and so on) and a payload. Each layer has its own protocol defining the syntax and meaning of its header, and the packet of one layer is the payload of the layer below.

Advantages of packet transmission over sending one single block:

  1. Efficiency: packets can follow different paths and the network is better used;
  2. Reliability: after an error only the damaged packets are retransmitted, not the whole message;
  3. Scalability: more devices and more traffic are handled without changing the infrastructure;
  4. Statistical multiplexing: several flows dynamically share the same resources; capacity is not reserved for a flow, as it is in circuit switching (see Circuit Switching and Packet SwitchingA switching node can connect input to output in three ways. Circuit switching sets up a dedicated physical connection first (telephone network), delivery time T = 3N t_p + N t_s + M/R. Datagram packet switching splits the message into K packets with a header, each routed independently with store-and-forward, T = N t_p + (N+K-1)(M/K+H)/R, with optimal K = sqrt((N-1)M/H). Virtual circuit has three phases (setup, data, teardown): a dedicated logical connection without dedicated resources, with a local identifier that changes at each hop.Circuit Switching and Packet Switching →).

A multimedia application should in principle ignore packetisation, but it can give hints: in modern compressed video (H.264, HEVC, AV1) packetisation often follows the coded units (each picture in one or more packets, and each packet carrying data of one picture only). At the receiver de-packetisation extracts the useful data and, using the control information, rebuilds the bitstream (ordering, error detection and correction).

3. PDU, SDU, overhead and efficiency

Two entities of the same layer exchange PDUs (protocol data units). For example a PDU of a video-communication application (L5) can be an intra frame. The PDU is virtually sent to the peer entity but in practice it is passed to the lower layer, which treats it as an SDU (service data unit) and adds its own control information PCI (protocol control information, i.e. the header) to form its own PDU. For example L4 adds the port numbers and L3 the IP addresses.

PDUn=PCIn+SDUn,SDUn=PDUn+1.\mathrm{PDU}_n=\mathrm{PCI}_n+\mathrm{SDU}_n,\qquad \mathrm{SDU}_n=\mathrm{PDU}_{n+1}.

The overhead is the control data added to the payload. The maximum throughput that layer nn offers to the layer above is

Sn+1=Sn⋅∣SDUn∣∣PDUn∣=Sn⋅∣SDUn∣∣PCIn∣+∣SDUn∣.S_{n+1}=S_n\cdot\frac{|\mathrm{SDU}_n|}{|\mathrm{PDU}_n|}=S_n\cdot\frac{|\mathrm{SDU}_n|}{|\mathrm{PCI}_n|+|\mathrm{SDU}_n|}.

The efficiency of the layer-nn protocol is

η=Sn+1Sn=∣SDUn∣∣PDUn∣=11+∣PCIn∣∣SDUn∣∈(0,1].\eta=\frac{S_{n+1}}{S_n}=\frac{|\mathrm{SDU}_n|}{|\mathrm{PDU}_n|}=\frac1{1+\frac{|\mathrm{PCI}_n|}{|\mathrm{SDU}_n|}}\in(0,1].

It increases with the SDU size and decreases with the header size (so large SDUs and small headers are convenient). Other constraints prevent SDUs from being too large or headers too small: a long packet is more likely to be in error (see PER below) and occupies the link longer (transmission delay).

Example. Layer n+1n+1 creates PDUs of 1200 bytes; layer nn has throughput Sn=100S_n=100 Mbit/s and a 60-byte header. ∣PDUn∣=1260|\mathrm{PDU}_n|=1260 bytes, η=12001260=0.952\eta=\frac{1200}{1260}=0.952, hence Sn+1=100⋅12001260≈95.24S_{n+1}=100\cdot\frac{1200}{1260}\approx95.24 Mbit/s (if layer n+1n+1 produces data fast enough and the link is not shared).

4. Bit-rate, throughput and goodput

These are three similar concepts: a transfer rate between two peer entities; they differ in the layer considered.

Metric Meaning
Bit-rate R0R_0 nominal (maximum) speed of the physical link (L1), in bit/s
Throughput SS effective speed observed at a layer between 2 and 4 (bit/s, packets/s)
Goodput throughput useful to the application (L5), i.e. long-term throughput at application level

Units: 1 kbit/s=1031\ \text{kbit/s}=10^3 bit/s, 1 Mbit/s=1061\ \text{Mbit/s}=10^6, 1 Gbit/s=1091\ \text{Gbit/s}=10^9 (powers of 2 are not used); in bytes, 1 kB/s=81\ \text{kB/s}=8 kbit/s.

The bit-rate is the raw speed at which bits cross a single hop, with no reliability guarantee (bits may be altered or lost). It depends on bandwidth in Hz, modulation and signal-to-noise ratio.

Fundamental constraint: S≤R0S\le R_0. Upper layers cannot be faster than lower ones because: (1) part of the capacity is used by control signals (overhead); (2) the link may be congested or shared by several flows; (3) protocols (especially L2) may impose idle times (a host must not transmit at the same time as another). In real systems (Wi-Fi, 5G) throughput is often far below the nominal bit-rate. In general: bit-rate ≥\ge throughput ≥\ge goodput.

Throughput is the ratio between amount of data and elapsed time, so it depends on the time interval considered. Let bn(t)b_n(t) be the cumulative number of bits transmitted up to tt as seen by layer nn:

  • average over an interval TT: sn(t;T)=bn(t)−bn(t−T)Ts_n(t;T)=\dfrac{b_n(t)-b_n(t-T)}T;
  • instantaneous (T→0T\to0): sn(t)=dbn(t)dts_n(t)=\dfrac{db_n(t)}{dt} (the derivative of bnb_n);
  • long-term (asymptotic): Sn=lim⁡t→∞, T→∞sn(t;T)S_n=\lim_{t\to\infty,\,T\to\infty}s_n(t;T).

The long-term throughput at application level is the goodput.

Example (point-to-point link, periodic traffic). PHY bit-rate R0=100R_0=100 Mbit/s. The application generates a 1200-byte PDU every T=10T=10 ms; the lower layers bring it to 1260 bytes at the PHY.

  • Traffic offered to the PHY: S=1260⋅810−2=1.008S=\frac{1260\cdot8}{10^{-2}}=1.008 Mbit/s. It is below the bit-rate: it can be sustained, so it is the long-term throughput of the PHY.
  • Instantaneous throughput: periodic with period 10 ms; a PDU occupies the link for 1260⋅8108≈0.1\frac{1260\cdot8}{10^8}\approx0.1 ms, during which s(t)=R0=100s(t)=R_0=100 Mbit/s, and for the remaining 9.9 ms it is zero.
  • APP goodput: G=SPHY⋅∣PDUAPP∣∣HDRtot∣+∣PDUAPP∣=1.008⋅12001260=960G=S_{\text{PHY}}\cdot\frac{|\mathrm{PDU}_{\text{APP}}|}{|\mathrm{HDR}_{\text{tot}}|+|\mathrm{PDU}_{\text{APP}}|}=1.008\cdot\frac{1200}{1260}=960 kbit/s; or, since the traffic is fully sustained, G=1200⋅810−2=960G=\frac{1200\cdot8}{10^{-2}}=960 kbit/s. Note G≪R0G\ll R_0 because the application produces little.
  • Overhead of the APP level (fraction of PHY traffic not useful to the APP): 601260≈4.76%\frac{60}{1260}\approx4.76\% (it is M−LM\frac{M-L}{M}, with MM the PHY PDU and LL the APP PDU).

5. Delays

5.1 Nodal delay, point-to-point delay, end-to-end delay, RTT

  • The point-to-point (or nodal) delay dp2pd_{p2p} is the time between the start of transmission of a packet at a node and its complete reception at the next node.
  • The end-to-end delay de2ed_{e2e} is the time between the start of transmission at the first node and complete reception at the final destination: the sum of the nodal delays along the path, de2e=∑i=1Kdnodal,id_{e2e}=\sum_{i=1}^Kd_{\text{nodal},i}; with KK identical links de2e=K dp2pd_{e2e}=K\,d_{p2p}.
  • The RTT (round-trip time) between A and B is the sum of the end-to-end delays from A to B and from B to A; often RTT≈2 de2e\mathrm{RTT}\approx2\,d_{e2e}.

The nodal delay has four components:

dnodal=dproc+dqueue+dtrans+dprop.d_{\text{nodal}}=d_{\text{proc}}+d_{\text{queue}}+d_{\text{trans}}+d_{\text{prop}}.

  1. Processing dprocd_{\text{proc}}: error checking and choice of the output link (routing). Typically constant and often negligible (modern routers do it in dedicated hardware: ASICs, SmartNICs, DPUs). Not to be confused with routing algorithms.
  2. Queueing dqueued_{\text{queue}}: time a message spends in a buffer waiting to be processed. It depends on the total traffic at the node; buffers that are too full cause packet loss. It is partly controlled with priorities, scheduling and admission control.
  3. Transmission (or forwarding) dtransd_{\text{trans}}: time between reception of the first and last bit of the message, i.e. the time to "put" all the bits on the link:

dtrans=LR\boxed{d_{\text{trans}}=\frac LR}

with LL packet length (bits) and RR link bit-rate. Example: 100 Mbit over a 100 Mbit/s link: dtrans=1d_{\text{trans}}=1 s. It can be reduced by increasing RR. It can also be computed at upper layers if the system works at full load (data always ready): dtrans=∣PDUMAC∣SMACd_{\text{trans}}=\frac{|\mathrm{PDU}_{\text{MAC}}|}{S_{\text{MAC}}}.

  1. Propagation dpropd_{\text{prop}}: time for the physical propagation of the signal from source to destination:

dprop=xc\boxed{d_{\text{prop}}=\frac xc}

with xx distance and cc propagation speed in the medium (about 2⋅1082\cdot10^8 m/s in cable and fibre, roughly two thirds of the speed of light in vacuum). It is often negligible, except in long-range communication (satellites, transoceanic: thousands of km →\to tens of ms) and with high bit-rate links. It cannot be reduced (it depends on quantities that cannot be changed). cc and RR are very different quantities: cc is a speed in m/s, RR is in bit/s.

Example. Packet of L=1000L=1000 bits on a 1 Gbit/s link 1 km long: dtrans=1000109=1 μsd_{\text{trans}}=\frac{1000}{10^9}=1\ \mu\text{s}, dprop=1 km2⋅105 km/s=5 μsd_{\text{prop}}=\frac{1\ \text{km}}{2\cdot10^5\ \text{km/s}}=5\ \mu\text{s}: here propagation dominates.

The minimum delay corresponds to empty queues and negligible processing: dp2p,min⁡=dprop+dtransd_{p2p,\min}=d_{\text{prop}}+d_{\text{trans}}.

5.2 Jitter

Jitter is the variance of the delay (in the course material; in practice the standard deviation is often used). Delay is a random phenomenon: the mean value matters, but so does the deviation from the mean. It is critical for cloud gaming, videoconferencing, VR/AR, teleoperation. In streaming a constant delay is not a big problem; but if the delay suddenly grows, playback has to stop: freezing, which greatly reduces perceived quality. Jitter is countered with a playout buffer: the larger it is, the more jitter it absorbs, but it has a cost (memory and start-up delay). High jitter requires long playout delays and produces longer queues on average.

6. Bandwidth-delay product (BDP)

If the sender wants to be sure that packet mm was received it must wait for the ACK; if it does not arrive within a timeout the packet is assumed lost and retransmitted. So the sender cannot discard mm before the ACK: packets sent and not yet acknowledged stay in the transmission buffer. How many are they? It depends on the BDP.

Definition (BDP). Number of bits (or packets) that can be "in transit" simultaneously in the connection: also the number of bits received (in steady state) in a time equal to the RTT. BDPbit=S⋅RTT,BDPpkt=BDPbit∣PDU∣.\mathrm{BDP}_{\text{bit}}=S\cdot\mathrm{RTT},\qquad\mathrm{BDP}_{\text{pkt}}=\frac{\mathrm{BDP}_{\text{bit}}}{|\mathrm{PDU}|}.

The steady-state throughput is used. In the course example, between sending the first packet and receiving its ACK, 8 packets are transmitted. The BDP matters in Long Fat Networks (high capacity and high latency: transcontinental backbones, interconnected data centres, satellites).

Multi-hop connections. The bit-rate to use is the minimum over all links. Reason: if the source produces a packet of LL bits every T0T_0 s, the first link with R1<LT0R_1<\frac L{T_0} cannot transmit at rate T0T_0 and has to wait T1=LR1>T0T_1=\frac L{R_1}>T_0 before the next packet; the links downstream cannot increase the arrival rate. So the link with minimum bit-rate sets the packet period, and hence how many are "in flight".

If the transmission buffer is smaller than the BDP, continuous transmission is impossible:

Example (buffer smaller than the BDP). Transmission buffer 300 kbit, RTT 10 ms, R=100R=100 Mbit/s, negligible processing and propagation delays; retransmission protocol Go-Back-N (if the ACK does not arrive within the RTT, transmission restarts from the first unacknowledged packet). The BDP is 100⋅106⋅10−2=1100\cdot10^6\cdot10^{-2}=1 Mbit, larger than the buffer. Transmitting 300 kbit takes 300⋅103100⋅106=3\frac{300\cdot10^3}{100\cdot10^6}=3 ms; then the sender waits another 7 ms (it cannot know whether the first packet arrived). Long-term throughput: 300 kbit every 10 ms =30=30 Mbit/s (one third of the bit-rate). If retransmission is not guaranteed, the whole channel throughput can be used.

Worked example (10 identical links). k=10k=10 links, each x=10x=10 km long; PHY packets of L=10L=10 kbit; R=100R=100 Mbit/s; c=2⋅108c=2\cdot10^8 m/s; negligible processing. Propagation delay of one hop: 1042⋅108=5⋅10−5\frac{10^4}{2\cdot10^8}=5\cdot10^{-5} s =50 μ=50\ \mus. Transmission delay: 104108=100 μ\frac{10^4}{10^8}=100\ \mus. Minimum point-to-point delay: 150 μ150\ \mus. Minimum end-to-end: k⋅150=1500 μk\cdot150=1500\ \mus. BDPbit=R⋅2de2e=108⋅2⋅1.5⋅10−3=300\mathrm{BDP}_{\text{bit}}=R\cdot2d_{e2e}=10^8\cdot2\cdot1.5\cdot10^{-3}=300 kbit =30=30 packets.

A geostationary satellite link gives an example of a very large BDP: RTT=2⋅35.8⋅1063⋅108≈240\mathrm{RTT}=\frac{2\cdot35.8\cdot10^6}{3\cdot10^8}\approx240 ms and BDP≈24\mathrm{BDP}\approx24 Mbit.

7. Reliability: bit errors and packet losses

Received packets can be affected by errors: one or more bits different from those sent (typical causes: low SNR, interference, fading). Indicators:

  • bit error probability (bit error rate, BER);
  • packet loss probability: a packet may never arrive, or arrive too late to be useful; causes: congestion (a node receives more packets than it can store) and errors (a packet recognised as wrong may be discarded);
  • order of reception: some technologies guarantee order, but then a late packet delays all the following ones; for some services it is better to ignore a packet that cannot arrive before its deadline.

7.1 The binary symmetric channel (BSC)

The simplest model of a point-to-point channel with bit errors is the BSC: it takes a bit sequence in input and returns a sequence of the same number of bits (no insertions or deletions); each bit is flipped with probability ε\varepsilon, the same whether 0 or 1 is sent (hence "symmetric"); errors are independent and identically distributed (i.i.d.).

PER. A packet of LL bits is received correctly if and only if all its bits are correct. A bit is correct with probability 1−ε1-\varepsilon; with independent errors the packet is correct with probability (1−ε)L(1-\varepsilon)^L. So the packet error rate (fraction of packets with one or more errors, equivalent to the probability that a packet has at least one error) is

PER=1−(1−ε)L≈Lε  (if Lε≪1).\boxed{\mathrm{PER}=1-(1-\varepsilon)^L\approx L\varepsilon\ \ (\text{if }L\varepsilon\ll1)}.

Probability of ℓ\ell wrong bits out of LL: there are (Lℓ)\binom L\ell ways of choosing the ℓ\ell errors, each with probability εℓ(1−ε)L−ℓ\varepsilon^\ell(1-\varepsilon)^{L-\ell}:

P(ℓ)=(Lℓ) εℓ (1−ε)L−ℓ.P(\ell)=\binom L\ell\,\varepsilon^\ell\,(1-\varepsilon)^{L-\ell}.

A message of NN packets is received without errors with probability (1−PER)N(1-\mathrm{PER})^N.

Example. L=1000L=1000 bits, ε=10−6\varepsilon=10^{-6}: PER=1−(1−10−6)1000≈0.0999%≈10−3\mathrm{PER}=1-(1-10^{-6})^{1000}\approx0.0999\%\approx10^{-3} (not 1%: being off by a factor of 10 is a typical mistake). A message of 750 packets arrives intact with probability (1−10−3)750≈47.2%(1-10^{-3})^{750}\approx47.2\%. With L=2000L=2000 and ε=10−5\varepsilon=10^{-5}: PER≈2%\mathrm{PER}\approx2\%.

7.2 Error detection and correction, channel coding

An error detection (ED) technique recognises whether a packet has errors; an error correction (EC) technique detects and corrects. Both add redundancy bits: they are channel coding, to be distinguished from source coding (compression). The latter removes "uncontrolled" redundancy from signals; channel coding adds "controlled" redundancy to detect or correct errors.

Two families: block codes (a block of kk input symbols produces a block of n>kn>k symbols) and convolutional codes (a stream of symbols, nn output symbols for every kk input symbols, with memory: the output also depends on the past). Code rate R=kn<1R=\frac kn<1; overhead (fraction of symbols that carry no information) n−kn\frac{n-k}n.

Parity check. Blocks of k=7k=7 bits; one adds the bit b8=∑i=17bib_8=\sum_{i=1}^7b_i (modulo-2 sum): the coded block always has an even number of 1s. At the receiver, if the sum of the 8 bits is ≠0\ne0 there is at least one error. With n=k+1n=k+1, R=kk+1R=\frac k{k+1}: a single error is detected, but two errors are not (an odd number of errors is always detected, an even number never). The overhead is 1k+1\frac1{k+1}: increasing kk reduces overhead but also the detection capability.

Hamming code (seven bits, four data bits, rate R=47R=\frac47). Three parity bits, each checking a subset of the bits: bit 5 checks positions {1,2,4,5}\{1,2,4,5\}, bit 6 checks {1,3,4,6}\{1,3,4,6\}, bit 7 checks {2,3,4,7}\{2,3,4,7\}. For x=0110x=0110: b5=0⊕1⊕0=1b_5=0\oplus1\oplus0=1, b6=0⊕1⊕0=1b_6=0\oplus1\oplus0=1, b7=1⊕1⊕0=0b_7=1\oplus1\oplus0=0, so y=0110 110y=0110\,110. If y^=0010 110\hat y=0010\,110 is received (error on bit 2):

  • check {1,2,4,5}\{1,2,4,5\}: sum 0+0+0+1=10+0+0+1=1: not OK;
  • check {1,3,4,6}\{1,3,4,6\}: 0+1+0+1=00+1+0+1=0: OK;
  • check {2,3,4,7}\{2,3,4,7\}: 0+1+0+0=10+1+0+0=1: not OK.

The wrong bit lies in the intersection of the two failing sets: {1,2,4,5}∩{2,3,4,7}={2,4}\{1,2,4,5\}\cap\{2,3,4,7\}=\{2,4\}; it cannot be 4 because the second check (which contains 4) is OK; so it is bit 2, which is corrected. The code corrects all single errors or detects all single and double errors; with three or more errors it may fail.

Bursts and interleaving. A code of this kind corrects one error every seven bits. But some physical phenomena concentrate errors in time: bursts (for example 10 wrong bits out of 70, all consecutive): the code would fail even with one error out of seven on average. Interleaving spreads consecutive errors over several blocks: before transmission the bits are written into the rows of a matrix and read by columns; the receiver does the inverse operation.

Example. 21 bits numbered 1,…,211,\dots,21, written by rows into a 3×73\times7 matrix (rows: 1..71..7, 8..148..14, 15..2115..21) and read by columns: one transmits 1,8,15,2,9,16,3,10,17,…1,8,15,2,9,16,3,10,17,\dots A burst of 3 consecutive errors hits 1,8,151,8,15 (or other triples): one per row. After de-interleaving each row (each code block) has only one error, which is correctable. Without interleaving the three consecutive errors would all be in the same block: not correctable.

Trade-offs of channel coding.

  • Bit-rate: increasing R=knR=\frac kn reduces overhead but also the ED and EC capability.
  • Complexity: more sophisticated codes improve ED/EC but cost computation and memory: turbo codes (convolutional) have high correction capability; LDPC codes (block codes with very large kk) give similar performance with high memory cost but not computational cost; Reed-Solomon and cyclic codes in general (CRC) are efficient in hardware but less performant. State of the art: LDPC for high-speed payload (5G, Wi-Fi), polar codes for control channels and short packets, Reed-Solomon for burst errors (optical links, storage).
  • Delay: interleaving improves robustness to bursts but adds delay; convolutional codes also require additional latency.

7.3 Losses from congestion

Packets to be forwarded on a busy link wait in the output buffer of the node, which has finite capacity: when it is full there is buffer overflow and something has to be dropped. Policies: drop tail (new arrivals are dropped when the buffer is full); random early dropping (above a critical threshold, for instance 2/3 of the capacity, random packets in the queue are dropped). A dropped packet may be retransmitted by the previous node, by the source, or never (it depends on the protocols).

Packet loss rate PLOSSP_{\text{LOSS}}: overall fraction of transmitted packets not delivered, for any reason (errors or overflow). The terms packet error, drop and loss rate are often used as synonyms. Packet delivery ratio PDR=1−PLOSS\mathrm{PDR}=1-P_{\text{LOSS}}: fraction successfully delivered.

The PDR can differ at the various layers, according to the recovery mechanisms: an L2 with an unreliable PHY can reduce the PLOSSP_{\text{LOSS}} seen by L3 by means of error detection and correction, retransmissions and interleaving.

8. Measuring performance: the ping command

ping uses the ICMP protocol (directly over IP, without transport; see ICMP, Ping and TracerouteICMP adds to IP the error reporting and queries it lacks; its messages travel inside IP datagrams with Protocol 1 and are either errors (destination unreachable type 3, time exceeded 11, redirect 5, parameter problem 12), always sent to the original source with the original IP header plus 8 bytes of data, or queries (echo request 8 and reply 0, timestamp 13 and 14); ICMP only reports and never corrects errors, and it supports ping (RTT), path MTU discovery with the D bit (maximum payload 1500-20-8=1472 bytes) and traceroute (TTL increasing, n+1 probes for n routers), but also attacks such as smurf and fake redirects.ICMP, Ping and Traceroute →) to send packets of LL bits to a destination that answers with packets of the same size; it measures the RTT of each. Repeating KK times for each LL, the observed RTT is the sum of the delays over all the outward and return links (nn links in total): di=di,queue+di,proc+di,prop+LSid_i=d_{i,\text{queue}}+d_{i,\text{proc}}+d_{i,\text{prop}}+\frac L{S_i}, so

RTT(L,k)=(∑i=1n1Si)L+∑iqi(k)+∑iτi=aL+Q(k)+T,\mathrm{RTT}(L,k)=\Bigl(\sum_{i=1}^n\frac1{S_i}\Bigr)L+\sum_iq_i(k)+\sum_i\tau_i=aL+Q(k)+T,

with a=∑i1Sia=\sum_i\frac1{S_i} the coefficient of LL, Q(k)=∑iqi(k)Q(k)=\sum_iq_i(k) the sum of queueing delays (varying with the repetition kk) and T=∑iτiT=\sum_i\tau_i the propagation delays (constant; processing is neglected). The RTT grows with LL, but queueing Q(k)Q(k) masks the relation. To remove it one takes the minimum over the KK measurements at constant LL: sooner or later a packet finds all queues empty, so RTTmin⁡(L)=min⁡kRTT(L,k)≈aL+T\mathrm{RTT}_{\min}(L)=\min_k\mathrm{RTT}(L,k)\approx aL+T is a straight line. From the slope aa (for instance by least squares) the throughput is estimated:

  • if all nn links (outward and return) have the same throughput SS: a=nSa=\frac nS, so S=naS=\frac na;
  • if there is a bottleneck much slower than the others, equal in both directions: a≈2Sbna\approx\frac2{S_{\text{bn}}}, so Sbn≈2aS_{\text{bn}}\approx\frac2a.

The traceroute tool and the use of wireshark to observe packets, headers and timings are covered in ICMP, Ping and TracerouteICMP adds to IP the error reporting and queries it lacks; its messages travel inside IP datagrams with Protocol 1 and are either errors (destination unreachable type 3, time exceeded 11, redirect 5, parameter problem 12), always sent to the original source with the original IP header plus 8 bytes of data, or queries (echo request 8 and reply 0, timestamp 13 and 14); ICMP only reports and never corrects errors, and it supports ping (RTT), path MTU discovery with the D bit (maximum payload 1500-20-8=1472 bytes) and traceroute (TTL increasing, n+1 probes for n routers), but also attacks such as smurf and fake redirects.ICMP, Ping and Traceroute → and Static Routing and Diagnostic Tools in KatharàLab 2 builds by hand the routing tables of two LANs (195.11.14.0/24 and 200.1.1.0/24) joined by routers r1 and r2 over 100.0.0.8/30: an active interface adds only its directly connected network, hosts use a default route, routers need static routes in both directions, and ping, route -n, tcpdump and traceroute diagnose the result (ttl=62 after two routers).Static Routing and Diagnostic Tools in Katharà →. The program also mentions iperf for measuring throughput; no certified source describes it, so it is not covered here.

Typical mistakes

  • Confusing bandwidth (Hz) and bit-rate.
  • Using the bit-rate of the first link in the BDP instead of the minimum.
  • Forgetting the two directions (outward and return) in BDP=S⋅RTT\mathrm{BDP}=S\cdot\mathrm{RTT}.
  • Computing goodput from the PHY traffic without removing the headers.
  • Saying that a parity code also detects even numbers of errors.
  • Evaluating the PER as 1−εL1-\varepsilon^L.

Versione ripasso

Layers. A layer offers a service (primitives: what, not how) to the layer above through an interface and talks to its peer with a protocol; a protocol can change if services and interfaces stay (HTTP/3 over QUIC). L1: digital bit channel, single hop, unreliable; L2: single hop, reliable; L3: end-to-end, connectionless, between hosts; L4: end-to-end between processes; L5: services. Packet = header + payload; the packet of a layer is the payload of the layer below. Advantages: efficiency, reliability (only the wrong packet is resent), scalability, statistical multiplexing.

PDU, SDU, PCI. PDUn=PCIn+SDUn\mathrm{PDU}_n=\mathrm{PCI}_n+\mathrm{SDU}_n, SDUn=PDUn+1\mathrm{SDU}_n=\mathrm{PDU}_{n+1}. Sn+1=Sn∣SDUn∣∣PDUn∣S_{n+1}=S_n\frac{|\mathrm{SDU}_n|}{|\mathrm{PDU}_n|}; efficiency η=∣SDUn∣∣PCIn∣+∣SDUn∣∈(0,1]\eta=\frac{|\mathrm{SDU}_n|}{|\mathrm{PCI}_n|+|\mathrm{SDU}_n|}\in(0,1]. Example: SDU 1200 B, header 60 B, Sn=100S_n=100 Mbit/s: Sn+1=95.24S_{n+1}=95.24 Mbit/s.

Bit-rate, throughput, goodput. R0R_0 (L1, nominal) ≥S\ge S (layers 2-4) ≥\ge goodput (L5), because of overhead, sharing and protocol idle times. Average s(t;T)=b(t)−b(t−T)Ts(t;T)=\frac{b(t)-b(t-T)}T, instantaneous =dbdt=\frac{db}{dt}, long-term =lim⁡=\lim. Example: APP PDU 1200 B every 10 ms, PHY 1260 B, R0=100R_0=100 Mbit/s: SPHY=1.008S_{\text{PHY}}=1.008 Mbit/s; instantaneous =100=100 Mbit/s for 0.1 ms and 0 for 9.9 ms; goodput 960 kbit/s; overhead 601260=4.76%\frac{60}{1260}=4.76\%.

Delays. dnodal=dproc+dqueue+dtrans+dpropd_{\text{nodal}}=d_{\text{proc}}+d_{\text{queue}}+d_{\text{trans}}+d_{\text{prop}}; dtrans=LRd_{\text{trans}}=\frac LR (reduced by raising RR), dprop=xcd_{\text{prop}}=\frac xc with c≈2⋅108c\approx2\cdot10^8 m/s (not reducible; dominates on satellites and long paths); queueing depends on traffic (overflow means loss). Minimum point-to-point =dprop+dtrans=d_{\text{prop}}+d_{\text{trans}}; end-to-end =∑=\sum of nodal (K dp2pK\,d_{p2p} if equal); RTT≈2de2e\mathrm{RTT}\approx2d_{e2e}. Example: 1000 bit, 1 Gbit/s, 1 km: dtrans=1 μd_{\text{trans}}=1\ \mus, dprop=5 μd_{\text{prop}}=5\ \mus. Jitter = delay variability; a constant delay is harmless, a delay spike causes freezing; the playout buffer absorbs it at the cost of memory and start-up delay.

BDP. BDPbit=S⋅RTT\mathrm{BDP}_{\text{bit}}=S\cdot\mathrm{RTT}, BDPpkt=BDPbit/∣PDU∣\mathrm{BDP}_{\text{pkt}}=\mathrm{BDP}_{\text{bit}}/|\mathrm{PDU}|: bits in transit while waiting for the ACK; multi-hop uses the minimum bit-rate; important in Long Fat Networks. With tx buffer << BDP continuous transmission is impossible: buffer 300 kbit, RTT 10 ms, 100 Mbit/s: BDP =1=1 Mbit, throughput 300 kbit10 ms=30\frac{300\text{ kbit}}{10\text{ ms}}=30 Mbit/s. Example 10 links of 10 km, 10 kbit, 100 Mbit/s: dprop=50 μd_{\text{prop}}=50\ \mus, dtrans=100 μd_{\text{trans}}=100\ \mus, de2e=1500 μd_{e2e}=1500\ \mus, BDP =300=300 kbit =30=30 packets. GEO satellite: RTT ≈240\approx240 ms, BDP ≈24\approx24 Mbit.

BSC. Each bit flipped with probability ε\varepsilon (symmetric, i.i.d.). PER=1−(1−ε)L≈Lε\mathrm{PER}=1-(1-\varepsilon)^L\approx L\varepsilon; P(ℓ)=(Lℓ)εℓ(1−ε)L−ℓP(\ell)=\binom L\ell\varepsilon^\ell(1-\varepsilon)^{L-\ell}; message of NN packets intact with (1−PER)N(1-\mathrm{PER})^N. L=1000L=1000, ε=10−6\varepsilon=10^{-6}: PER≈10−3\mathrm{PER}\approx10^{-3}, N=750N=750: 47.2%47.2\%. L=2000L=2000, ε=10−5\varepsilon=10^{-5}: about 2%2\%.

Channel codes. ED/EC with controlled redundancy (source coding removes uncontrolled redundancy). Block (k→nk\to n) or convolutional (with memory); R=knR=\frac kn, overhead n−kn\frac{n-k}n. Parity: b8=∑bib_8=\sum b_i mod 2; detects odd numbers of errors, never even; overhead 1k+1\frac1{k+1}. Hamming (7 bits, 4 data): b5=b1⊕b2⊕b4b_5=b_1\oplus b_2\oplus b_4, b6=b1⊕b3⊕b4b_6=b_1\oplus b_3\oplus b_4, b7=b2⊕b3⊕b4b_7=b_2\oplus b_3\oplus b_4; x=0110→0110 110x=0110\to0110\,110; received 0010 1100010\,110: checks {1,2,4,5}\{1,2,4,5\} and {2,3,4,7}\{2,3,4,7\} fail, intersection {2,4}\{2,4\}, bit 4 is excluded by the OK check {1,3,4,6}\{1,3,4,6\}, so bit 2. Corrects 1 error or detects 1-2; R=47R=\frac47. Interleaving: write by rows, read by columns (3×73\times7): a burst of 3 errors ends up one per row, correctable; cost: delay. Trade-offs: bit-rate, complexity (turbo, LDPC, Reed-Solomon, polar), delay.

Losses. Causes: errors and congestion (buffer overflow: drop tail, early dropping above a threshold). PLOSSP_{\text{LOSS}} = fraction not delivered; PDR=1−PLOSS\mathrm{PDR}=1-P_{\text{LOSS}}, different at each layer.

Ping. RTT(L,k)=aL+Q(k)+T\mathrm{RTT}(L,k)=aL+Q(k)+T, a=∑1Sia=\sum\frac1{S_i}; RTTmin⁡(L)≈aL+T\mathrm{RTT}_{\min}(L)\approx aL+T (a line, empty queues). Equal links: S=naS=\frac na; bottleneck: Sbn≈2aS_{\text{bn}}\approx\frac2a. The minimum over KK measurements at constant LL isolates deterministic delays; the slope gives the bandwidth.

Typical mistakes: bandwidth (Hz) vs bit-rate; first-link bit-rate in the BDP; forgetting both directions in S⋅RTTS\cdot\mathrm{RTT}; goodput from PHY traffic without removing headers; parity detecting even errors; PER as 1−εL1-\varepsilon^L.

More reminders.

Teoria collegata