# PoP Codes

Each Point of Presence (PoP) has a unique **3-digit code** used in community strings like `203314:120:XXX` and `203314:202:XXX`.

> **Usage**: These codes identify specific PoP locations in internal communities (`120:XXX`, `125:XXX`) and control communities (`202:XXX`).

## PoP Code Reference

| Location  | IATA | Generation | Type | PoP Code | Notes  |
| --------- | ---- | ---------- | ---- | -------- | ------ |
| Hong Kong | HKG1 | Gen2       | Core | 101      | Unique |
| Hong Kong | HKG2 | Gen2       | Core | 102      | Unique |
| Hong Kong | HKG3 | Gen2       | Core | 103      |        |
| Taiwan    | TPE1 | Gen2       | Core | 121      |        |
| Taiwan    | TPE2 | Gen2       | Core | 122      |        |
| Tokyo     | TYO1 | Gen2       | Edge | 111      |        |
| Tokyo     | TYO2 | Gen2       | Core | 131      | Unique |
| Singapore | SIN1 | Gen2       | Core | 151      | Unique |
| Seattle   | SEA  | Gen2       | Core | 301      |        |
| Ashburn   | IAD  | Gen2       | Core | 302      |        |
| San Jose  | SJC  | Gen2       | Edge | 303      |        |
| Toronto   | YYZ1 | Gen2       | Edge | 304      | Unique |
| Moscow    | MOW  | Gen2       | Core | 201      |        |
| Frankfurt | FRA  | Gen2       | Edge | 252      |        |
| Zurich    | ZRH  | Gen2       | Edge | 251      |        |
| Calais    | CQF1 | Gen2       | Edge | 253      | Unique |
| Berlin    | BER  | Gen2       | Edge | 254      | Unique |
| London    | LON  | Gen2       | Edge | 255      | Unique |
| Melbourne | MEL  | Gen2       | Edge | 451      |        |

## Type Definitions

* **Core PoP**: Major interconnection points with multiple upstream providers
* **Edge PoP**: Smaller presence focused on local connectivity

## Generation Definitions

* **Gen2**: Second-generation infrastructure (current deployment)

## Using PoP Codes

### In Internal Communities

Identify where a route was learned:

```bird2
# Learned-at tags (set by AS203314 on routes you receive):
# (203314, 120, 101) -> HKG1 (Hong Kong)
# (203314, 120, 131) -> TYO2 (Tokyo)
# (203314, 120, 302) -> IAD (Ashburn)

filter prefer_hkg1_routes_v4 {
  if (203314, 120, 101) ~ bgp_large_community then bgp_local_pref = 200;
  accept;
}
```

### In Control Communities

Exclude specific PoPs from receiving announcements:

```bird2
bgp_large_community.add((203314, 202, 301)); # Do not announce via Seattle
bgp_large_community.add((203314, 202, 131)); # Do not announce via Tokyo
bgp_large_community.add((203314, 202, 102)); # Do not announce via HKG2
```

### Configuration Snippets (JunOS / BIRD2)

Use PoP codes in the control community `203314:202:XXX` to exclude specific locations. For example,
Calais is `253`, so the large community is `203314:202:253`.

### Junos

```bash
set policy-options community HATS-NO-CQF members large:203314:202:253

set policy-options policy-statement EXPORT-TO-HATS term NO-CQF from route-filter 203.0.113.0/24 exact
set policy-options policy-statement EXPORT-TO-HATS term NO-CQF then community add HATS-NO-CQF
set policy-options policy-statement EXPORT-TO-HATS term NO-CQF then accept
set policy-options policy-statement EXPORT-TO-HATS term REJECT-ALL then reject
```

### Bird2

```bird2
filter export_to_hats_v4 {
  if net = 203.0.113.0/24 then {
    bgp_large_community.add((203314, 202, 253)); # no CQF
    accept;
  }
  reject; # Safety default
}
```

## Related Information

* **[Region Codes](/docs/community/region-codes)** - Geographic region groupings
* **[Internal Communities](/docs/community/internal-communities)** - Using PoP codes in location-based communities
* **[Control Communities](/docs/community/control-communities)** - Using PoP codes in traffic engineering

> **Tip**: PoP codes are primarily used for granular traffic engineering when you need to control route propagation at the location level.

---

## License and attribution

- **Canonical source:** [View the human-readable HTML page](https://hatsnet.io/docs/community/pop-codes).
- **Original documentation:** © Hats Network Inc., licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
- **Full terms:** [Content and Data License](https://hatsnet.io/docs/legal/content-and-data-license) — includes attribution requirements, third-party material, trademarks, source code and other exclusions.
