As presented. The palette is light on request of the reviewer; code blocks and byte dumps keep a dark ground so the byte colours still work. The OPEN walk lights the hovered bytes as an inverted block and its table cells are dark text on a tint of their group colour. build.py inlines reveal.js, the stylesheets, scripts and Markdown sections into slides/dist/hands-on-bgp.html for uploading. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
171 lines
8.8 KiB
Markdown
171 lines
8.8 KiB
Markdown
# Internet Numbering Resources
|
||
|
||
Notes:
|
||
Before we look at what's going on in the internet, let's refresh on how the Internet is even addressed.
|
||
|
||
---
|
||
|
||
## Packets are sent to IP addresses
|
||
|
||
<form class="dns-lookup" autocomplete="off">
|
||
<input name="domain" value="ethz.ch" spellcheck="false" aria-label="domain name"><button type="submit">lookup AAAA</button>
|
||
<div class="dns-result"><span class="dim">Ask a resolver which IPv6 address this name stands for.</span></div>
|
||
</form>
|
||
|
||
IP packets are sent to IP addresses, not domain names. Every time you use a domain name, it is resolved into an IP address via DNS.
|
||
|
||
<!-- .element: class="note" -->
|
||
|
||
Notes:
|
||
Live: type a few names the students use. ethz.ch has an AAAA record;
|
||
github.com has none (only A), which shows that the two address families
|
||
are separate. The answer comes from Google Public DNS over HTTPS
|
||
(dns.google), so it needs the lecture-hall network.
|
||
|
||
---
|
||
|
||
## Who does the address belong to?
|
||
|
||
<form class="ripe-lookup" autocomplete="off">
|
||
<input name="query" value="2001:67c:10ec:254::216" spellcheck="false" aria-label="address, prefix or AS number"><button type="submit">whois</button>
|
||
<div class="ripe-result"><div class="ripe-msg">Paste the address from the last slide.</div></div>
|
||
</form>
|
||
|
||
The **inet6num** says who was assigned the block; the **route6** says which AS is allowed to originate it.
|
||
|
||
<!-- .element: class="note" -->
|
||
|
||
Notes:
|
||
Paste the AAAA answer from the previous slide. ETH's /48 is ASSIGNED PI
|
||
(provider independent, sponsored by SWITCH) and its route6 names AS559,
|
||
SWITCH. Try 2a0d:d741:1::1 as well: the lab prefix, origin AS210036. The
|
||
box takes AS numbers too (AS559). Same source as whois -h whois.ripe.net,
|
||
over the database's REST API.
|
||
|
||
---
|
||
|
||
## An IPv6 address is 128 bits
|
||
|
||
```text
|
||
2001:0db8:0001:0000:0000:0000:0000:0001 eight groups of 16 bits, in hex
|
||
2001:db8:1:0:0:0:0:1 drop leading zeros in a group
|
||
2001:db8:1::1 one run of zero groups becomes ::
|
||
```
|
||
|
||
`::` may appear once, or the address would be ambiguous. `2001:db8::/32` is reserved for documentation, so it never appears on the real Internet.
|
||
|
||
<!-- .element: class="note" -->
|
||
|
||
Notes:
|
||
Ask: why only once? Because 2001::1::1 could put the zeros in several places.
|
||
2001:db8::/32 is RFC 3849: set aside for examples, never routed.
|
||
|
||
---
|
||
|
||
## A prefix is a range of addresses
|
||
|
||
In BGP, the control plane for the internet, it's not viable to talk about single addresses, so we use prefix ranges.
|
||
|
||
<form class="prefix-explorer" autocomplete="off">
|
||
<input name="prefix" value="2001:db8:1::/48" spellcheck="false" aria-label="IPv6 prefix"><input type="range" name="len" min="0" max="128" value="48" aria-label="prefix length">
|
||
<p class="bits px-bits"></p>
|
||
<div class="px-range"></div>
|
||
<p class="note px-facts"></p>
|
||
</form>
|
||
|
||
Notes:
|
||
Live. Drag the slider: the fixed part grows and the range shrinks by half per
|
||
bit. Try /47 or /50 to see a hex digit split in two. The three rows above the
|
||
bar are three of the shorter prefixes that contain it, with its position and
|
||
share in each: there is no such thing as "the" parent prefix, only whatever
|
||
someone chose to allocate from.
|
||
2^80 addresses in one /48, about 1.2 million billion billion. The /n is a
|
||
count of leading bits, nothing more.
|
||
|
||
---
|
||
|
||
## The global IPv6 address space
|
||
|
||
<svg class="diagram" viewBox="0 0 1000 470" role="img" aria-label="Nested boxes: all of IPv6, inside it global unicast 2000::/3, inside that the documentation prefix 2001:db8::/32, inside that one /64 LAN with its hosts">
|
||
<g class="nest l0"><rect x="8" y="8" width="984" height="454"/></g>
|
||
<text x="28" y="42" class="left accent nest-label">::/0</text><text x="112" y="42" class="left nest-desc">every IPv6 address there is: 2¹²⁸ of them</text>
|
||
<g class="nest l1"><rect x="80" y="70" width="880" height="366"/></g>
|
||
<text x="100" y="104" class="left accent nest-label">2000::/3</text><text x="230" y="104" class="left nest-desc">global unicast: the eighth of the space that is routed on the Internet</text>
|
||
<g class="nest l2"><rect x="160" y="134" width="760" height="278"/></g>
|
||
<text x="180" y="168" class="left accent nest-label">2001:db8::/32</text><text x="376" y="168" class="left nest-desc">one provider's allocation (this one is reserved for documentation)</text>
|
||
<g class="nest l3"><rect x="260" y="200" width="580" height="188"/></g>
|
||
<text x="280" y="234" class="left accent nest-label">2001:db8:1:2::/64</text><text x="530" y="234" class="left nest-desc">one LAN: 2⁶⁴ addresses for its hosts</text>
|
||
<circle class="host" cx="330" cy="310" r="12"/><text x="330" y="352" class="host-addr">::1</text>
|
||
<circle class="host" cx="430" cy="310" r="12"/><text x="430" y="352" class="host-addr">::2</text>
|
||
<circle class="host" cx="530" cy="310" r="12"/><text x="530" y="352" class="host-addr">::3</text>
|
||
<text x="630" y="318" class="host-addr">…</text>
|
||
<circle class="host" cx="740" cy="310" r="12"/><text x="740" y="352" class="host-addr">::ffff:ffff:ffff:ffff</text>
|
||
<text x="976" y="452" class="small" style="text-anchor:end">not to scale</text>
|
||
</svg>
|
||
|
||
Notes:
|
||
Not to scale: a /64 is 2^-64 of the space. Only the first ring matters for
|
||
routing; the others are how the space is handed down, which is next.
|
||
|
||
---
|
||
|
||
## Who hands out the addresses
|
||
|
||
<svg class="diagram" viewBox="0 0 1000 470" role="img" aria-label="IANA at the top hands blocks to five regional registries; RIPE NCC hands smaller blocks to local registries such as SWITCH and an ISP, which assign to end users such as ETH Zurich and their customers">
|
||
<g class="hot"><rect x="400" y="14" width="200" height="56" rx="8"/></g><text x="500" y="48">IANA</text>
|
||
<text x="30" y="48" class="left small">the root: one pool for the whole world</text>
|
||
<line class="link" x1="500" y1="70" x2="96" y2="130"/><line class="link" x1="500" y1="70" x2="298" y2="130"/><line class="link" x1="500" y1="70" x2="500" y2="130"/><line class="link" x1="500" y1="70" x2="702" y2="130"/><line class="link" x1="500" y1="70" x2="904" y2="130"/>
|
||
<text x="30" y="108" class="left small">a /12 to each region</text>
|
||
<rect x="16" y="130" width="160" height="56" rx="8"/><text x="96" y="164">AFRINIC</text>
|
||
<rect x="218" y="130" width="160" height="56" rx="8"/><text x="298" y="164">APNIC</text>
|
||
<rect x="420" y="130" width="160" height="56" rx="8"/><text x="500" y="164">ARIN</text>
|
||
<rect x="622" y="130" width="160" height="56" rx="8"/><text x="702" y="164">LACNIC</text>
|
||
<g class="hot"><rect x="824" y="130" width="160" height="56" rx="8"/></g><text x="904" y="164" class="accent">RIPE NCC</text>
|
||
<text x="30" y="222" class="left small">RIRs: five regional registries, one per part of the world</text>
|
||
<line class="link" x1="904" y1="186" x2="690" y2="256"/><line class="link" x1="904" y1="186" x2="904" y2="256"/>
|
||
<text x="700" y="238" class="left small">/29 and up to a member</text>
|
||
<rect x="600" y="256" width="180" height="56" rx="8"/><text x="690" y="290">SWITCH</text>
|
||
<rect x="814" y="256" width="180" height="56" rx="8"/><text x="904" y="290">an ISP</text>
|
||
<text x="30" y="298" class="left small">LIRs: members of an RIR, usually providers</text>
|
||
<line class="link" x1="690" y1="312" x2="690" y2="382"/><line class="link" x1="904" y1="312" x2="904" y2="382"/>
|
||
<text x="700" y="360" class="left small">a /48 to a site</text>
|
||
<rect x="600" y="382" width="180" height="56" rx="8"/><text x="690" y="416">ETH Zürich</text>
|
||
<rect x="814" y="382" width="180" height="56" rx="8"/><text x="904" y="416">its customers</text>
|
||
<text x="30" y="424" class="left small">end users: companies, universities, you</text>
|
||
</svg>
|
||
|
||
Notes:
|
||
|
||
- The Internet Assigned Numbers Authority comes up with allocations of IP
|
||
addresses from the global space
|
||
- Blocks are assigned to Regional Internet Registries (RIRs), which allocate
|
||
them to Local Internet Registries (LIRs), who assign to end users
|
||
- The RIPE lookup two slides back showed exactly this chain: ETH's /48 is
|
||
ASSIGNED PI, sponsored by SWITCH (the LIR), registered at RIPE NCC (the
|
||
RIR). Nobody owns addresses; they are registered to you.
|
||
|
||
---
|
||
|
||
## AS numbers
|
||
|
||
- Used to identify networks under a single oeprator, and required for exchanging BGP traffic
|
||
- Managed by IANA and the RIRs
|
||
- 16 bits at first: `1` to `65535`
|
||
- 32 bits since RFC 6793: up to `4294967295`
|
||
- In order to have a smooth transition, `AS23456` is used as a placeholder when the AS number is > 16 bits
|
||
- 32 bit AS numbers are then exchanged using a BGP capability message to be backwards compatible
|
||
- Private use: `64512–65534` and `4200000000–4294967294`
|
||
|
||
AS numbers come down the same chain: IANA to the RIRs, an RIR to whoever runs a network. The lab daemon is `AS4200000001`, a private one, stripped before the Internet sees your route.
|
||
|
||
<!-- .element: class="note" -->
|
||
|
||
Notes:
|
||
Nobody "owns" numbers or addresses; they are registered to you. RFC 6996
|
||
reserves the private ranges. The upstream router removes the private AS from
|
||
the path, so the origin everybody else sees is AS210036.
|
||
|
||
---
|
||
|
||
## Handout Part 1
|