Foundations — BGP — path vector, AS, policy routing
Before you can read a single BGP advertisement you must own a small toolkit of ideas. We build each one from nothing — plain words, then a picture, then why the topic needs it. Nothing later uses a thing that came earlier only as a name.
1. An IP address — a house number for a machine
Picture it as a single dot on an enormous map of all machines. On its own it is just one house.
Why the topic needs it: BGP never talks about single houses — that would be billions of entries. It talks about streets (the next idea). But you must know the house exists first.
2. A prefix / CIDR block — a whole street of addresses
The slash-number is called the prefix length: bigger number → fewer fixed-free bits → smaller block.

Look at the figure: the whole address space is the board; a prefix is a boxed rectangle covering one contiguous run of houses. /24 boxes 256 houses; /25 boxes half that.
Related reading: IP addressing and CIDR prefixes.
Why the topic needs it: every BGP message is about a prefix. When you later see "advertises who can reach which prefix", this is that prefix.
3. An Autonomous System (AS) — one owner's whole neighbourhood
Picture it as a walled district on the map: inside, one owner decides everything (which internal protocol, which links). Outside, it is a single labelled blob.

In the figure each coloured blob is one AS; the number on it is its ASN; the small boxes inside are the prefixes it owns.
Related reading: Autonomous Systems and ASN allocation.
Why the topic needs it: BGP is the protocol between ASes. The AS is the atom of the whole story — every path is a list of these blobs.
4. eBGP vs iBGP — talking outside vs inside the wall
Picture it: eBGP is a handshake over the wall between two districts; iBGP is a group chat inside one district so everyone hears news that arrived at one gate.
Why the topic needs it: the loop rule and the "prepend your ASN" step happen on eBGP (crossing walls). Inside an AS, iBGP moves the news without changing the AS path. Keeping the two straight prevents confusion later.
5. An attribute — a labelled sticky-note on a route
Picture it as a route being an envelope, with coloured sticky-notes on it: one lists the districts it visited, one is my personal ranking score.
Why the topic needs it: every rule in the parent note ("highest LOCAL_PREF", "shortest AS_PATH") is really "compare this sticky-note across the competing envelopes". You must know an envelope has notes before you compare them.
6. The AS_PATH — the trail of breadcrumbs
The square brackets just mean "an ordered list". The symbol is "the AS whose number is 2". The whole thing is a trail.

Follow the arrows in the figure: the prefix starts at the far-right blob and each AS that forwards it writes its own number on the front (the left end). So the list grows leftward as the news travels.
Why the topic needs it: this list is the heart of "path vector". Loop prevention, hop-count tie-breaking, and valley-free policy all read this one attribute.
7. The set-membership symbols and
Picture it: you scan the breadcrumb trail with your finger; if you spot your own number, that's .
Why the topic needs it: the entire loop rule is one line — . The symbol means if and only if: accept exactly when you are not already in the path — no other condition.
8. Business relationships — the reason paths aren't shortest
Picture it as arrows of money: down to a customer (money flows up to you), up to a provider (money flows up from you), sideways to a peer (no money).

In the figure the vertical arrows are provider/customer links and the flat arrow is a peer link. A valley-free path climbs up these arrows, takes at most one flat step, then climbs down — it never dips back up after coming down.
Related reading: Internet topology — Tier-1, transit, peering and Hot-potato vs Cold-potato routing.
Why the topic needs it: these relationships set the LOCAL_PREF sticky-note (customer > peer > provider) and the Gao–Rexford export rules. Without them BGP would just be shortest-path — the money is why it isn't.
9. LOCAL_PREF and the tie-break ladder — how one route wins
Why the topic needs it: BGP picks the winning route down a ladder of comparisons — LOCAL_PREF first, AS_PATH length only second. This is why "BGP = shortest path" is wrong: policy sits above distance. You will see this ladder in full in the parent note; here you just need to know the top rung is money, not hops.
How it all feeds the topic
Read top-to-bottom: addresses group into prefixes, prefixes live inside ASes, ASes are numbered, numbers form paths, paths enable loop-detection, relationships set policy — and both loop-freedom and policy meet in BGP.
Equipment checklist
An IP address identifies what?
What does 200.0.0.0/24 mean?
200.0.0; a prefix (CIDR block).