---
title: "Project: designing a fiber link"
heading: Choose a wavelength, fiber and laser to meet a distance and a data rate
eyebrow: B8 · Lesson 27 · Project
xp: 80
---

::: hook
Two data centers 60 km apart need a 10 Gb/s connection, and a building needs 300 m links between floors at the same rate. Each design has to clear two separate hurdles: enough light must arrive for the receiver (the power budget), and the pulses must arrive sharp enough to tell apart (the dispersion budget). In this project you'll work through both for real designs, write a function that finds a link's reach, and use it to pick the cheapest design that meets a target.
:::

::: play
- The reach of a fiber link against bit rate, on log scales. The flat line is the **loss limit**: how far the power budget lasts. The falling line is the **dispersion limit**: how far before pulses spread by half a bit period.
- The link's actual reach is the lower of the two. At low bit rates loss sets it; at high rates, dispersion does.
- Narrow the laser's spectrum (Δλ) and watch the crossover move. Switch to 1310 nm-like numbers (higher loss, $D$ near zero) and compare.
:::
:::

```sim plot
view: graph
x: B = 0.1..100 Gb/s log
y: L = 1..1000 km log
slider: Pt = -5..5 step 0.5 = 0 dBm
slider: S = -35..-15 step 1 = -24 dBm
slider: o = 0..10 step 0.5 = 5 dB
slider: a = 0.15..1 step 0.01 = 0.2 dB/km
slider: D = 0.5..20 step 0.5 = 17
slider: dl = 0.01..1 = 0.1 nm log
plot: (Pt - S - o)/a + 0*B | label: loss limit | dashed | color: ch2
plot: (500/B)/(D*dl) | label: dispersion limit | dashed | color: ch3
plot: ((Pt - S - o)/a + (500/B)/(D*dl) - abs((Pt - S - o)/a - (500/B)/(D*dl)))/2 | label: reach | samples: 400
readout: loss-limited reach, km = (Pt - S - o)/a | digits: 3
readout: dispersion-limited reach at 10 Gb/s, km = 50/(D*dl) | digits: 3
```

::: predict
## A 10 Gb/s link at 1550 nm has a 0 dBm laser 0.1 nm wide, a −24 dBm receiver, 5 dB of connectors, splices and margin, and fiber with 0.2 dB/km and D = 17 ps/(nm·km). What limits its reach?

- [ ] Loss, at about 95 km
- [x] Dispersion, at about 29 km
- [ ] Both equally, at about 60 km
- [ ] Neither: fiber reach is unlimited at 10 Gb/s

::: reveal
Dispersion, at about 29 km. The power budget allows $\frac{0 + 24 - 5}{0.2} = 95$ km, but the pulses spread by $17 \times 0.1 = 1.7$ ps per km, and half a 100 ps bit period is used up after $\frac{50}{1.7} = 29$ km. The fix is a narrower source or dispersion compensation, not more power.
:::
:::

::: nameit
## The power budget

Start with the transmitter power and subtract every loss: fiber attenuation $\alpha L$, connectors (about 0.5 dB each), splices (about 0.1 dB each), and a **margin** of 3 dB or more for aging, repairs and temperature. What remains must be at or above the receiver's sensitivity:

$$P_t - \alpha L - L_\text{other} \ge S$$

so the loss-limited reach is $L_\text{loss} = \frac{P_t - S - L_\text{other}}{\alpha}$.

## The dispersion budget

With the rough rule that pulses may spread by half a bit period, $DL\Delta\lambda \le \frac{1}{2B}$, so

$$L_\text{disp} = \frac{1}{2BD\Delta\lambda}$$

Multimode fiber is rated instead by a **modal bandwidth-distance product**, such as 2000 MHz·km for OM3 fiber at 850 nm. A length $L$ offers a bandwidth of that product divided by $L$, which should be at least about $0.7B$ for on-off signaling.

## The design choices

| Choice | Strengths | Limits |
|---|---|---|
| 850 nm, multimode | cheap VCSEL lasers, silicon detectors, easy alignment | 2.5 dB/km or more, modal bandwidth: hundreds of meters at 10 Gb/s |
| 1310 nm, single-mode | dispersion near zero | about 0.35 dB/km |
| 1550 nm, single-mode | lowest loss, 0.2 dB/km; optical amplifiers work here | D ≈ 17 ps/(nm·km), so narrow sources or compensation |

A narrower source comes at a cost: a directly modulated laser's spectrum broadens as its current swings, while a laser left running steadily and switched by an external modulator (lesson 9) keeps a much narrower spectrum.
:::

::: example
## A 10 Gb/s link must reach 300 m over OM3 multimode fiber (2000 MHz·km). Does modal bandwidth allow it?

::: solution
1. **Bandwidth over 300 m.**
   $$\begin{aligned} B &= \frac{2000}{0.3}\ \text{MHz} \\ &= 6.7\ \text{GHz} \end{aligned}$$
2. **What the signal needs.**
   $$0.7 \times 10 = 7\ \text{GHz}$$
   It's right at the limit, which is why the standard 10 Gb/s multimode links are specified for 300 m on this fiber.
3. **Loss.** Loss is no issue:
   $$0.3 \times 3 = 0.9\ \text{dB}$$

**Answer:** only just: 300 m gives 6.7 GHz against the 7 GHz the signal needs, and the loss is only 0.9 dB.
:::
:::

::: example
## Design the 60 km, 10 Gb/s link: 0 dBm laser, −24 dBm receiver, two connectors (0.5 dB each), a splice every 5 km (0.1 dB each), 3 dB margin.

::: solution
1. **Losses at 1550 nm.** The 12 reels of 5 km need 11 splices, 1.1 dB:
   $$\begin{aligned} \text{loss} &= 0.2 \times 60 + 1 + 1.1 + 3 \\ &= 17.1\ \text{dB} \end{aligned}$$
   leaving 6.9 dB to spare.
2. **Dispersion at 1550 nm.** With a 0.1 nm source,
   $$17 \times 60 \times 0.1 = 102\ \text{ps}$$
   double the 50 ps allowed.
3. **Try 1310 nm.** Dispersion vanishes, but losses become
   $$\begin{aligned} \text{loss} &= 0.35 \times 60 + 5.1 \\ &= 26.1\ \text{dB} \end{aligned}$$
   over budget.
4. **A narrower source at 1550 nm.** An externally modulated laser 0.02 nm wide gives
   $$17 \times 60 \times 0.02 = 20\ \text{ps}$$
   comfortably inside.

**Answer:** use 1550 nm with an externally modulated laser 0.02 nm wide: 17.1 dB of losses leaves 6.9 dB to spare, and dispersion is only 20 ps.
:::
:::

::: check
kind: parts
given: Pt = -2 | 2; S = -22 | -28; a = 0.2 | 0.35; L = 40 | 70; n = 8 | 15

## A link sends {Pt} dBm over {L} km of fiber losing {a} dB/km, with two 0.5 dB connectors, {n} splices of 0.1 dB, and a {S} dBm receiver.

::: part
answer: a*L + 1 + 0.1*n
unit: dB
tolerance: 0.5%

### What are the total losses, before any margin?

::: misses
- [any] Fiber, connectors and splices.
:::
:::

::: part
answer: Pt - S - (a*L + 1 + 0.1*n)
unit: dB
tolerance: 0.5%

### How much margin is left? (A negative answer means the link fails.)

::: misses
- [any] The budget $P_t - S$ minus the losses.
:::
:::
:::

::: check
kind: parts
given: B = 2.5 | 10 | 25; D = 3 | 17; dl = 0.02 | 0.2

## A {B} Gb/s link uses fiber with D = {D} ps/(nm·km) and a source {dl} nm wide.

::: part
answer: 500/B
unit: ps
tolerance: 0.5%

### How much spread does the half-bit rule allow?

::: misses
- [any] Half of $1/B$.
:::
:::

::: part
answer: 500/B/(D*dl)
unit: km
tolerance: 0.5%

### What is the dispersion-limited reach?

::: misses
- [any] Solve $DL\Delta\lambda = 1/2B$.
:::
:::
:::

::: check
kind: parts
given: BL = 500 | 2000 | 4700; B = 1 | 10

## A multimode fiber has a modal bandwidth-distance product of {BL} MHz·km and carries {B} Gb/s.

::: part
answer: 0.7*B*1000
unit: MHz
tolerance: 0.5%

### What bandwidth does the signal need, by the 0.7B rule?

::: misses
- [any] $0.7B$.
:::
:::

::: part
answer: BL/(0.7*B*1000)*1000
unit: m
tolerance: 0.5%

### How long can the fiber be?

::: misses
- [any] The product divided by the bandwidth needed.
:::
:::
:::

::: check
kind: python

## Write `reach(p_tx, sens, other, alpha, B, D, dl)`: the reach of a link in km, the lower of the loss limit $\frac{P_t - S - L_\text{other}}{\alpha}$ and the dispersion limit $\frac{1}{2BD\Delta\lambda}$. Units: dBm, dBm, dB, dB/km, Gb/s, ps/(nm·km), nm.

```python starter
def reach(p_tx, sens, other, alpha, B, D, dl):
    return (p_tx - sens - other) / alpha

print(reach(0, -24, 5, 0.2, 10, 17, 0.1))
```

```python solution
def reach(p_tx, sens, other, alpha, B, D, dl):
    loss_km = (p_tx - sens - other) / alpha
    half_bit_ps = 1000 / B / 2
    disp_km = half_bit_ps / (D * dl)
    return min(loss_km, disp_km)

print(reach(0, -24, 5, 0.2, 10, 17, 0.1))
```

```python tests
r = reach(0, -24, 5, 0.2, 10, 17, 0.1)
assert abs(r - 50 / 1.7) < 1e-6, f"At 10 Gb/s with a 0.1 nm source, dispersion limits it to about 29.4 km; got {r:.2f}."
r = reach(0, -24, 5, 0.2, 1, 17, 0.1)
assert abs(r - 95) < 1e-6, f"At 1 Gb/s, loss limits it to 95 km; got {r:.2f}."
r = reach(-3, -30, 4, 0.35, 25, 1, 0.5)
assert abs(r - 40) < 1e-6, f"Half a 40 ps bit over 0.5 ps/km gives 40 km, below the 65.7 km loss limit; got {r:.2f}."
```

::: right
Right. Try a 0.01 nm source at 10 Gb/s: the dispersion limit moves to 294 km and loss takes over at 95 km.
:::
:::

::: check
kind: python

## Write `cheapest(designs, L, B)`: each design is a dict with keys `name`, `cost`, `p_tx`, `sens`, `other`, `alpha`, `D` and `dl`. Return the name of the cheapest design whose reach (use your `reach` from above, rewritten here) is at least `L` km at `B` Gb/s, or `None` if none works.

```python starter
def reach(p_tx, sens, other, alpha, B, D, dl):
    return min((p_tx - sens - other) / alpha, 500 / B / (D * dl))

def cheapest(designs, L, B):
    return designs[0]["name"]
```

```python solution
def reach(p_tx, sens, other, alpha, B, D, dl):
    return min((p_tx - sens - other) / alpha, 500 / B / (D * dl))

def cheapest(designs, L, B):
    ok = [d for d in designs
          if reach(d["p_tx"], d["sens"], d["other"], d["alpha"], B, d["D"], d["dl"]) >= L]
    if not ok:
        return None
    return min(ok, key=lambda d: d["cost"])["name"]
```

```python tests
designs = [
    {"name": "1550 DML", "cost": 300, "p_tx": 0, "sens": -24, "other": 5.2, "alpha": 0.2, "D": 17, "dl": 0.1},
    {"name": "1310 DFB", "cost": 200, "p_tx": 0, "sens": -24, "other": 5.2, "alpha": 0.35, "D": 1, "dl": 0.1},
    {"name": "1550 EML", "cost": 900, "p_tx": 0, "sens": -24, "other": 5.2, "alpha": 0.2, "D": 17, "dl": 0.02},
    {"name": "1550 EML + APD", "cost": 1500, "p_tx": 0, "sens": -30, "other": 5.2, "alpha": 0.2, "D": 17, "dl": 0.02},
]
assert cheapest(designs, 20, 10) == "1310 DFB", "At 20 km the cheap 1310 nm design works."
assert cheapest(designs, 60, 10) == "1550 EML", "At 60 km only the narrow 1550 nm sources clear dispersion, and the EML is cheaper."
assert cheapest(designs, 120, 10) == "1550 EML + APD", "At 120 km only the APD receiver has enough power budget."
assert cheapest(designs, 200, 10) is None, "Nothing reaches 200 km without an optical amplifier."
```

::: right
Right. That's a design search in miniature: real tools add amplifiers, many more parts and their prices, but the logic is the same filter, then minimize.
:::
:::

::: explain
## A link fails its dispersion budget. Why doesn't a more powerful laser fix it?

::: model
Dispersion and loss are separate problems. More power raises every pulse's height at the receiver, but the pulses are still smeared over more than half a bit period, so each one spills into its neighbors and the receiver still can't tell a 1 from a 0 reliably. What matters for dispersion is the spread of arrival times, which depends on the fiber's dispersion, the distance and the source's spectral width. Fixing it means a narrower source, a wavelength where the fiber's dispersion is low, compensating fiber or processing, or a shorter span.
:::
:::

::: practice

::: check
given: Pt = -3 | 3; S = -20 | -30; o = 3 | 6; a = 0.2 | 0.4
answer: (Pt - S - o)/a
unit: km
tolerance: 0.5%

## A link has {Pt} dBm out, a {S} dBm receiver, {o} dB of other losses and margin, and fiber losing {a} dB/km. What is its loss-limited reach?

::: misses
- [any] $(P_t - S - L_\text{other})/\alpha$.
:::
:::

::: check
given: n = 2 | 4 | 6; c = 0.3 | 0.75
answer: n*c
unit: dB
tolerance: 0.5%

## A link has {n} connectors of {c} dB each. What do they cost in total?

::: misses
- [any] Losses in dB add.
:::
:::

::: check
given: L = 30 | 80; s = 2 | 5
answer: L/s - 1
tolerance: 0.5%

## A {L} km cable comes in {s} km reels spliced end to end. How many splices does it need?

::: misses
- [any] One fewer than the number of reels, $L/s$.
:::
:::
:::
