---
title: "Capstone: a fiber link budget"
heading: Designing a 10 Gb/s fiber link end to end, the power budget that sets one length limit, the chromatic dispersion that sets another, choosing between 1310 and 1550 nm, and the Q factor a receiver needs for a target bit error rate, checked in Python
eyebrow: D11 · Lesson 6 · Capstone
xp: 80
---

::: hook
A carrier wants a 10 Gb/s link between two buildings 40 km apart, using a 0 dBm laser and a receiver that needs −28 dBm. Will it work, and at which wavelength? Two limits compete. The power budget (lesson 4) is kinder at 1550 nm, where the fiber loses least. Dispersion (lesson 3) is kinder at 1310 nm, where standard fiber barely spreads pulses at all. This capstone works out both limits for both wavelengths, decides which one governs, and finishes with the receiver's side: how clean its decision must be to get just one error in a trillion bits.
:::

::: play
- The two length limits of a link against bit rate: the power limit (flat, set by the budget and α) and the dispersion limit $1/(4BD\Delta\lambda)$, falling as the bit rate rises.
- Set the wavelength's loss and dispersion: 1550 nm is about 0.2 dB/km and 17 ps/(nm·km); 1310 nm about 0.35 dB/km and 0.5 ps/(nm·km).
- Below the crossover rate power limits the span; above it, dispersion does.
:::

```sim plot
view: graph
x: B = 0.1..100 log
y: L = 1..10000 log
slider: a = 0.15..0.5 step 0.01 = 0.2
slider: D = 0.1..20 step 0.1 = 17
slider: w = 0.01..1 = 0.1 log
plot: (0 + 28 - 3 - 2.2)/a + 0*B | dashed | color: ch3 | label: power limit, km (B in Gb/s)
plot: 1/(4*B*1e9*D*1e-12*w) | samples: 300 | label: dispersion limit, km
readout: span at 10 Gb/s, km = ((0 + 28 - 3 - 2.2)/a + 1/(4*10e9*D*1e-12*w) - abs((0 + 28 - 3 - 2.2)/a - 1/(4*10e9*D*1e-12*w)))/2 | digits: 4
```

::: predict
## The 10 Gb/s link uses a laser 0.1 nm wide on standard fiber at 1550 nm (17 ps/(nm·km)). How far before dispersion closes the eye, taking the limit as a quarter of a bit?

- [ ] About 114 km
- [x] About 15 km
- [ ] About 1.5 km
- [ ] Dispersion doesn't matter at 10 Gb/s

::: reveal
A quarter of a 100 ps bit is 25 ps, and the spread is 17 × 0.1 = 1.7 ps per km, so 25/1.7 = 14.7 km, far short of the 114 km the power budget allows. At 1310 nm the dispersion is about 0.5 ps/(nm·km), pushing that limit to 500 km, and the link becomes power-limited at 65 km: 1310 nm is the right choice for 40 km unless the dispersion is compensated.
:::
:::

::: nameit
## Two limits

- **Power**: $L_P = (P_\text{tx} - S - M - L_\text{fixed})/\alpha$, independent of bit rate (to first order: faster receivers need a little more power).
- **Dispersion**: with spreading $D L\Delta\lambda$ allowed up to a quarter of a bit period,
$$L_D = \frac{1}{4BD\,\Delta\lambda}$$
which falls as the bit rate rises.

The usable span is the smaller. Dispersion can be undone with compensating fiber or digital signal processing in coherent receivers, after which loss and amplifier noise set the limit.

## The receiver's Q

A receiver decides each bit by comparing the photocurrent with a threshold. With Gaussian noise, the **Q factor**, the distance from each level to the threshold in units of the noise's standard deviation, sets the error rate:

$$\text{BER} = \frac{1}{2}\operatorname{erfc}\left(\frac{Q}{\sqrt 2}\right) = Q_\text{fn}(Q)$$

Q = 6 gives about $10^{-9}$, and Q = 7.03 gives $10^{-12}$. A receiver's sensitivity is the power at which it reaches the required Q.
:::

::: example
## Find both limits at 1310 nm for the same 10 Gb/s link.

::: solution
1. **Power limit.**
   $$\begin{aligned} L &= \frac{0 + 28 - 3 - 2.2}{0.35}\ \text{km} \\ &= 65.1\ \text{km} \end{aligned}$$
2. **Dispersion limit.**
   $$\begin{aligned} L_D &= \frac{1}{4BD\,\Delta\lambda} \\ &= \frac{1}{4 \times 10^{10} \times 0.5 \times 10^{-12} \times 0.1}\ \text{km} \\ &= 500\ \text{km} \end{aligned}$$
3. **Which limit governs.** The power budget governs: 65 km covers the 40 km link with 25 km to spare.

**Answer:** a power limit of 65.1 km and a dispersion limit of 500 km, so the power budget governs.
:::
:::

::: example
## What bit error rates do Q = 6 and Q = 7 give?

::: solution
1. **Q = 6.**
   $$\begin{aligned} \text{BER} &= \frac{1}{2}\operatorname{erfc}\left(\frac{6}{\sqrt 2}\right) \\ &= 9.9 \times 10^{-10} \end{aligned}$$
2. **Q = 7.**
   $$\begin{aligned} \text{BER} &= \frac{1}{2}\operatorname{erfc}\left(\frac{7}{\sqrt 2}\right) \\ &= 1.3 \times 10^{-12} \end{aligned}$$
3. **Compare.** Each extra unit of Q cuts the error rate about 770 times here.

**Answer:** Q = 6 gives a bit error rate of 9.9 × 10⁻¹⁰, and Q = 7 gives 1.3 × 10⁻¹².
:::
:::

::: example
## The 10 Gb/s link runs at 1550 nm instead, on fiber with 17 ps/(nm·km) of dispersion and a 0.1 nm source. Where is the dispersion limit?

::: solution
1. **Dispersion limit.**
   $$\begin{aligned} L_D &= \frac{1}{4BD\,\Delta\lambda} \\ &= \frac{1}{4 \times 10^{10} \times 17 \times 10^{-12} \times 0.1}\ \text{km} \\ &= 14.7\ \text{km} \end{aligned}$$
2. **What governs now.** At 1550 nm the loss is lower but dispersion now governs, which is why long 10 Gb/s links use narrow-linewidth lasers, dispersion compensation or coherent receivers.

**Answer:** the dispersion limit is 14.7 km, so dispersion governs at 1550 nm.
:::
:::

::: check
kind: python

## Compute both span limits, pick the governing one, and find the Q a receiver needs.

```python starter
import math

def power_limit(ptx_dbm, sens_dbm, margin_db, fixed_db, alpha_db_km):
    # Longest fiber (km) the power budget allows: (ptx - sens - margin - fixed)/alpha.
    return 0.0

def dispersion_limit(rate_gbps, d_ps_nm_km, width_nm):
    # Longest fiber (km) before chromatic spreading D*L*width reaches a quarter of a bit
    # period, 1/(4*rate).
    return 0.0

def max_span(ptx_dbm, sens_dbm, margin_db, fixed_db, alpha_db_km, rate_gbps, d_ps_nm_km, width_nm):
    # The usable span and what limits it: ("power" or "dispersion", km).
    return ("power", 0.0)

def ber(q):
    # Bit error rate for a receiver with Q factor q: 0.5*erfc(q/sqrt(2)).
    return 0.5

def q_needed(target):
    # The Q factor that gives a bit error rate of target, found by bisection between 0 and 20.
    return 0.0
```

```python solution
import math

def power_limit(ptx_dbm, sens_dbm, margin_db, fixed_db, alpha_db_km):
    return (ptx_dbm - sens_dbm - margin_db - fixed_db)/alpha_db_km

def dispersion_limit(rate_gbps, d_ps_nm_km, width_nm):
    return 1/(4*rate_gbps*1e9*d_ps_nm_km*1e-12*width_nm)

def max_span(ptx_dbm, sens_dbm, margin_db, fixed_db, alpha_db_km, rate_gbps, d_ps_nm_km, width_nm):
    p = power_limit(ptx_dbm, sens_dbm, margin_db, fixed_db, alpha_db_km)
    d = dispersion_limit(rate_gbps, d_ps_nm_km, width_nm)
    return ("power", p) if p <= d else ("dispersion", d)

def ber(q):
    return 0.5*math.erfc(q/math.sqrt(2))

def q_needed(target):
    lo, hi = 0.0, 20.0
    for _ in range(200):
        mid = (lo + hi)/2
        if ber(mid) > target:
            lo = mid
        else:
            hi = mid
    return (lo + hi)/2
```

```python tests
assert abs(power_limit(0, -28, 3, 2.2, 0.2) - 114) < 1e-9, "0 dBm into a -28 dBm receiver with 3 dB margin and 2.2 dB fixed loss reaches 114 km at 0.2 dB/km."
assert abs(dispersion_limit(10, 17, 0.1) - 14.706) < 0.01, f"At 10 Gb/s, D = 17 and a 0.1 nm source, dispersion limits the span to 14.7 km; got {dispersion_limit(10, 17, 0.1):.3f}."
_k, _L = max_span(0, -28, 3, 2.2, 0.2, 10, 17, 0.1)
assert _k == "dispersion" and abs(_L - 14.706) < 0.01, f"At 1550 nm the 10 Gb/s link is dispersion-limited at 14.7 km; got {_k}, {_L:.2f}."
_k2, _L2 = max_span(0, -28, 3, 2.2, 0.35, 10, 0.5, 0.1)
assert _k2 == "power" and abs(_L2 - 65.143) < 0.01, f"At 1310 nm (0.35 dB/km, D = 0.5) the same link is power-limited at 65.1 km; got {_k2}, {_L2:.2f}."
assert abs(ber(6) - 9.866e-10) < 1e-12, f"Q = 6 gives a bit error rate of 9.87e-10; got {ber(6):.4g}."
assert abs(q_needed(1e-12) - 7.034) < 0.001, f"An error rate of 1e-12 needs Q = 7.03; got {q_needed(1e-12):.4f}."
```

::: right
Right. At 1550 nm the 10 Gb/s link is dispersion-limited at 14.7 km; at 1310 nm it's power-limited at 65.1 km, and 10⁻¹² needs Q = 7.03.
:::
:::

::: check
given: B = 2.5 | 10 | 25; D = 0.5 | 17; w = 0.05 | 0.1 | 1
answer: 1/(4*B*1e9*D*1e-12*w)
unit: km
tolerance: 0.5%

## A {B} Gb/s link on fiber with D = {D} ps/(nm·km) uses a source {w} nm wide. How far can it reach before dispersion spreads pulses by a quarter of a bit?

::: right
Right. $1/(4BD\Delta\lambda)$ = {answer} km.
:::

::: misses
- [1/(B*1e9*D*1e-12*w)] That allows a whole bit of spreading; the criterion is a quarter.
- [any] Not yet. Spread equal to a quarter of the bit period.
:::
:::

::: check
given: p = -3 | 0 | 3; s = -24 | -28 | -32; a = 0.2 | 0.35
answer: (p - s - 3 - 2.2)/a
unit: km
tolerance: 0.5%

## A {p} dBm laser feeds a receiver needing {s} dBm, with 2.2 dB of connectors and splices and a 3 dB margin, over fiber losing {a} dB/km. What's the power-limited span?

::: right
Right. {answer} km.
:::

::: misses
- [(p - s)/a] Subtract the fixed losses and the margin first.
- [any] Not yet. Budget left for the fiber, over α.
:::
:::

::: check
given: q = 4 | 5 | 6 | 7
answer: Q(q)
tolerance: 0.5%

## A receiver's Q factor is {q}. What's its bit error rate?

::: right
Right. $\frac{1}{2}\operatorname{erfc}(Q/\sqrt 2)$ = {answer}.
:::

::: misses
- [Q(q/sqrt(2))] The Gaussian tail function takes Q itself: ½ erfc(Q/√2) = $Q_\text{fn}$(Q).
- [any] Not yet. The Gaussian tail beyond Q standard deviations.
:::
:::

::: check
kind: parts
given: B = 2.5 | 10 | 25; D = 17 | 3; w = 0.01 | 0.1 | 1

## A link runs at {B} Gb/s on fiber with {D} ps/(nm·km) of dispersion, with a {w} nm source.

::: part
answer: 1/(4*B*1e9*D*1e-12*w)
unit: km
tolerance: 0.5%

### Where is the dispersion limit, $1/(4BD\Delta\lambda)$?

::: misses
- [any] $1/(4BD\Delta\lambda)$.
:::
:::

::: part
answer: 1/(4*2*B*1e9*D*1e-12*w)
unit: km
tolerance: 0.5%

### And at twice the bit rate?

::: misses
- [any] Half as far.
:::
:::
:::

::: check
kind: parts
given: Q = 4 | 5 | 6 | 7

## A receiver works at Q = {Q}.

::: part
answer: 0.5*erfc(Q/sqrt(2))
tolerance: 1%

### What bit error rate does it give?

::: misses
- [any] $\tfrac12\operatorname{erfc}(Q/\sqrt2)$.
:::
:::

::: part
answer: 20*log(Q)
unit: dB
tolerance: 0.5%

### What is Q in decibels ($20\log_{10}Q$)?

::: misses
- [any] $20\log_{10}Q$.
:::
:::
:::

::: check
kind: parts
given: P = 0 | 3; S = -28 | -20; a = 0.2 | 0.35; c = 2 | 3; m = 3 | 6

## A link launches {P} dBm into fiber of {a} dB/km with {c} dB of connector and splice loss; the receiver needs {S} dBm and the design keeps {m} dB of margin.

::: part
answer: (P - S - c - m)/a
unit: km
tolerance: 0.5%

### What is the power-limited reach?

::: misses
- [any] Budget ÷ loss per km.
:::
:::

::: part
answer: (P - S - c - m - 3)/a
unit: km
tolerance: 0.5%

### How far could it reach with a 3 dB splitter added to the path?

::: misses
- [any] Take 3 dB from the budget.
:::
:::
:::

::: explain
## Why can the same fiber link be power-limited at one wavelength and dispersion-limited at another?

::: model
The two limits depend on different properties of the glass. Loss sets how far the light can travel before it falls below what the receiver needs, and standard fiber is clearest near 1550 nanometers, so the power limit is longest there. Dispersion sets how far a pulse can travel before its spread of wavelengths, arriving at slightly different times, smears it into its neighbors, and standard fiber's dispersion passes through zero near 1310 nanometers and is large at 1550. At high bit rates the dispersion limit at 1550 nanometers can be shorter than the power limit, while at 1310 nanometers the dispersion limit is so long that loss governs instead.
:::
:::

::: practice

::: check
given: B = 1 | 100; D = 0.1 | 20; w = 0.01 | 2
answer: 1/(4*B*1e9*D*1e-12*w)
unit: km
tolerance: 0.5%

## Dispersion limit: {B} Gb/s, D = {D}, Δλ = {w} nm?

::: misses
- [any] $1/(4BD\Delta\lambda)$.
:::
:::

::: check
given: q = 3 | 4 | 5 | 6 | 7 | 8
answer: Q(q)
tolerance: 0.5%

## BER for Q = {q}?

::: misses
- [any] $Q_\text{fn}(Q)$.
:::
:::
:::
