Lesson 5 - Naming, Addressing, Forwarding Flashcards
Nuts and bolts that make routing possible
Naming, addressing, forwarding
IP stands for
Internet Protocol
Which version of IP is widely deployed on the internet today?
Version 4 (IPv4)
How many bits in an IPv4 address?
32
How is an IP address formatted?
Dotted notation
- Breaking it up with dots is just a convenient way of writing an 32-bit number. It’s made up of 4 8-bit numbers.
- It allows for 4^32 addresses (or about 4 billion)
Problems with pure IPv4
- We’re running out of addresses
- 4 billion is a lot to deal with. Can’t just have it in one table. Lookups would be slow. Need a way to group. Was much more inefficient pre-1994.
Classful addressing
-Addresses were divided into a network ID portion and a host ID portion
Class A address
- Starting with a 0 as the first bit is a class A address
- This picks half of all IP addresses
- Next 7 bits (combined with the first) represent the network ID for the network that owns this portion of address space
- Remaining portion (24 bits) is dedicated for hosts ON THAT NETWORK. This means that a class A address can support 2^24 IP addresses.
Class B address
- Starts with a 10
- First 16 bits signify network ID, remaining 16 bits signify host ID
- Each class B address SPACE represents about 1/65,000th of all internet address space
- Discounting the first 2 bits which indicate it’s a class B network we have about 2^14th class B’s
- Each of the class B networks can have 2^16 (65,000) hosts on each network
Class C address
- Use the first 24 bits for the NET ID and the remaining 8 for the host ID
- Each class C network essentially can only have 255 hosts on it
BGP routing table from ’89-’94
- Grew slowly. By 1994, had around 1500 IP addresses.
- Growth rates were exceeding hw/sw capabilities, and in particular we began to run out of the class C address allocation, because only a certain range of the IP address space could be used for class C addresses
- Began to accelerate around 1994
- There began to be a need for more flexible allocation. The solution to this problem was something called Classless Interdomain Routing or “CIDR” (pronounced like cider)
IANA
“eye-ana”
- The top of the hierarchy, allocates IP address space to ISP’s
- has authority to allocate address space to what are called regional routing registries
IANA regional routing registries
- AfriNIC (Africa)
- APNIC (Asia and Australia)
- ARIN (North America)
- LACNIC (Latin America)
- RIPE (Europe)
- A regional routing registry, ARIN for example, allocates address space to individual networks like GaTech
- Address space across regions is far from even
/8 address space means
IPv4 address
What does it mean to say we’re running out of IPv4 addresses?
It doesn’t mean you can’t get a new device on the internet. There are various ways of coping with it. It just means that IANA no longer has anymore /8 blocks to give to these regional registries
whois
- Querying an IP address using whois and a routing registry such as ra.net will tell you the owner of that particular prefix
- Also gives the autonomous system number
- Routing registry entry also gives us more information such as who to contact if we need to contact the owner of this address space.
CIDR
- Classless Interdomain Routing
- Instead of having fixed network ID and host ID portions of the 32 bits, we’d simply have an IP address, plus what’s known as a mask, which is variable length and indicates the length of the network ID.
- For example, suppose we have an IP address like 64.14.248.0/22. The “/22” indicates the mask length, which says that the first 22 bits should represent the network ID.
- The key is that the mask length is variable, and no longer depends on the range of IP addresses that are being used.
- This allows those allocating IP address ranges to both allocate a range that’s more fitting to the size of the network, and also not have to be constrained about how big the network ID should be depending on where in the IP address space the prefix is being allocated from.
Complications of CIDR
- it’s possible to have overlapping address prefixes.
- For example: 64.14.248.0/24 is a subset of 64.14.248.0/22
- What do you do when they both show up in a routing table?
Longest prefix match
- Suppose overlapping address prefixes show up in a routing table
- The solution is to forward on what’s called the “longest prefix match”. Meaning that if a routing table has 2 overlapping entries, it should forward according to the entry that has the longest prefix or the longest mask length.
- Intuitively that makes sense because the prefix with the longer mask length is more specific than the prefix with the shorter mask (aka the larger prefix).
Benefits of CIDR and Longest prefix match
- Efficiency: prefix blocks can be allocated on a much finer granularity than with classful interdomain routing
- Hierarchy/organization: opportunity for aggregation if 2 downstream networks with more specific/longer prefixes should be treated in the same way by an upstream network, who might simply aggregate 2 contiguous shorter prefixes into 1 forwarding table entry with a shorter prefix
- If the rest of the internet only reached A and B via C, then the rest of the internet need only know about C’s address space which might be 12/8. This would allow the upstream network to simply aggregate or not announce these more specific prefixes since they’re already covered by the less specific upstream prefix
CIDR’s effect on growth of internet routing table
- Significant slowing from 1994 to 1998
- We see roughly linear growth during that time
- Fast growth resumed around 2000 because of multihoming, which can make it difficult for upstream providers to aggregate IP prefixes together, often requiring an upstream provider to store multiple IP prefixes for a single autonomous system. Sometimes those IP prefixes are contiguous and sometimes they aren’t.
Multihoming
- AS (30308 for example) wants to be reachable via 2 upstream internet service providers
- To do so, it needs to advertise its prefix which it received from AT&T via both AT&T and Verizon.
- The problem occurs when AT&T and Verizon want to advertise that prefix to the rest of the internet.
- AT&T would like to aggregate this prefix, but it can’t. If it did, Verizon would still be advertising the longer /24 via its upstream link, and because of longest prefix match, all of the traffic would then arrive via the Verizon link, regardless of what AS 30308 wanted to have happen to that incoming traffic.
- As a result, both AT&T and Verizon must advertise the same /24 to the rest of the internet. This results in an explosion of /24’s in the global internet routing table.
- If a lot of “Stub” AS’s wanted to be multihomed, then suddenly we’ve got a lot more /24’s in the global routing table than might not otherwise exist without multihoming
AS path pre-pending
- Can be used to control inbound traffic
- Longest prefix match can too! Re-watch video on this.
CIDR Report
- Released weekly
- Shows AS’s who are advertising IP prefixes that, at least according to observation, are contiguous and could be aggregated
- Top offender for the week shown below was advertising more than 3,000 unique IP prefixes. The CIDER Report’s analysis suggests that with appropriate aggregation, this AS could instead advertise only 56 unique IP prefixes.
- This might be overly optimistic (sometimes deaggregating necessary), but altogether the CIDR Report shows that there are a lot more IP prefixes in the global internet routing table than there could be if AS’s took full advantage of aggregation.
How many IP addresses in a /22 prefix?
2^10
LPM can be implemented in different ways
- Radix trie
- Compressed trie
- Binary search on prefix intervals
What lookup algorithm does a router use
Depends on the protocol that it’s using to forward packets
IPv4 and IPv6 use which protocol to forward packets?
Longest prefix match
-Some protocols use exact match