1. ni306 cm addressing
TRANSCRIPT
-
7/31/2019 1. NI306 CM Addressing
1/14
AddressingRoutage et routeurs
Promthe Spathis
Chargs de TD : Timur Freidman et Mohamed Diallo
{promethee.spathis, tim ur.freidman, mohamed.diallo}
@{lip6,upmc}.fr
http://www-rp.lip6.fr/~spathis/rout
What is Addressing?
Providing suitable identifiers to nodes
So you can direct data to a node
So you know which node sent the data and how to send data back to that node
Addressing in the French mail
Zip code: 94110
Street: place Jussieu
Building on street: 4
Room in building: 109
Name of occupant: Promthe Spathis
???
4
What is Routing?
A famous quotation from RFC 791A nameindicates what we seek.An addressindicates where it is.A routeindicates how we get there.
-- Jon Postel
5
Forwarding vs. Routing
Forwarding:data planeDirecting a data packet to an outgoing link
Individual router usinga forwarding table
Routing: control planeComputing paths the packets wil l follow
Routers talking amongst themselves
Individual router creatinga forwardingtable
-
7/31/2019 1. NI306 CM Addressing
2/14
6
Why Does Routing Matter?
End-to-end performance
Quality of the path affects user performance
Propagation delay, throughput, and packet loss Use of network resources
Balance of the traff ic over the routers and links
Avoiding congestion by directing traffic to lightly-
loaded links
Transient disruptions during changes
Failures, maintenance, and load balancing
Limiting packet loss and delay during changes
Overview of Todays Lecture
Two widely-used addressing schemes Medium Access Control (MAC) addresses
Internet Protocol (IP) addresses
Key concepts in addressing Number of unique addresses
Allocating addresses to nodes
Flat vs. hierarchical structure
Persistent vs. temporary identifiers
Handling diminishing address space
Spoof ing of source addresses
Some Questions
Could every host on the Internet have anarbitrary, unique numerical address? Would it scale?
If hierarchy is necessary, how to do it?
Tying the addressing to the topology & routing? What about mobile hosts? Temporary addresses?
Who sh ould allocate the addresses? Network provider? Device manufacturer?
Does the sender of the traffic need toauthenticate itself? The destination? What about spoofing and impersonation?
Comparing MAC and IP Addresses
MAC IP
Assignment Hard-coded inthe adaptor
Configured orlearned
Size 48 bits 32 bits (in v4)
Structure Flat Hierarchical
Portability Constant over lifeof the adapter
Changes withtime and location
Purpose Delivery within asingle network
Delivery acrossan inter-network
E.g., social security number vs. postal address
-
7/31/2019 1. NI306 CM Addressing
3/14
MAC Addresses
MAC Addresses
Flat name space of 48 bitsTypically written in six octets in hex
E.g., 00-15-C5-49-04-A9 for my Ethernet Organizationally unique identifier
Assigned by IEEE Registration Authority
Determines the first 24 bits of the address
E.g., 00-15-C5 corresponds to Dell Inc
Remainder of the MAC addressAllocated by the manufacturer
E.g., 49-04-A9 for my Ethernet card
Scalability Challenges
MAC addresses are flat
Multiple hosts on the same network
No relationship between MAC addresses
Data planeForwarding based on MAC address
Table size? Look-up overhead?
Control plane
Determining where the host is located
Keeping the information up-to-date
Forwarding Frames to Destination Adapter
Shared media
Forward all frames on the shared media
Adapter grabs frames with matching dest address
Multi-hop switched networks
Flood every frame over every link?
Learn where the MAC address is located?
host host host...
host host
host host
-
7/31/2019 1. NI306 CM Addressing
4/14
When to Learn?
When the adapter connects to the network?
Requires adaptor to register its presence
Overhead even when not sending/receiving Leading to control messages and large tables
When the adapter sends a frame?
Source MAC address is in the f rame
Allows switch to learn about the adapter
When the adapter needs to receive a frame?
Destination MAC address is in the f rame
Switch needs to f igure out how to get there
Motivation For Self Learning
Switches forward frames selectively
Forward f rames only on segments that need them
Switch table Maps dest MAC address to outgoing interface
Goal: construct the switch table automatically
switch
A
B
C
D
Self Learning: Building the Table
When a frame arrives
Inspect the sourceMAC address
Associate the address with the incominginterface
Store the mapping in the switch table Use a TTL f ield to eventually forget the mapping
A
B
C
D
Switch learnshow to reach A.
Self Learning: Handling Misses
When frame arrives with unfamiliar dest
Forward the f rame out all of the interfaces
except for the one where the frame arrived
Hopefully, this case wont happen very often
A
B
C
D
Switch floods framethat is destined to C.
-
7/31/2019 1. NI306 CM Addressing
5/14
Switch Filtering/Forwarding
When switch receives a frame:
index switch table using MAC dest addressif entry found for destination
then {
if dest on segment f rom which frame arrivedthen drop the frame
else forward the frame on interface indicated
}
else floodforward on all but the interface
on which the frame arrived20
Flooding Can Lead to Loops
Switches sometimes need to broadcast frames
Upon receiving a frame with an unfamiliar destination
Upon receiving a frame sent to the broadcast address Broadcasting is implemented by f looding
Transmi tting frame out every interface
except the one where the fram e arrived
Flooding can lead to forwarding loops
E.g., if the network contains a cycle of switches
Either accidentally, or by design for higher reliability
21
Solution: Spanning Trees
Ensure the topology has no loops
Avoid using som e of the links when f looding
to avoid forming a loop Spanning tree
Sub-graph that covers all vertices but contains nocycles
Links not in the spanning tree do not forward frames
22
Constructing a Spanning Tree
Need a distributed algorithm
Switches cooperate to build the spanning tree
and adapt automatically when failures occur
Key ingredients of the algorithm
Switches need to elect a root The switch with the smallest identifier
Each switch identifies if its interfaceis on the shortest path from the root
And it exclude from the tree if not
Messages (Y, d, X)
From node X
Claiming Y is th e root
And the distance is d
root
One hop
Three hops
-
7/31/2019 1. NI306 CM Addressing
6/14
23
Steps in Spanning Tree Algorithm
Initially, each switch thinks it is the root
Switch sends a message out every interface
identif ying itself as the root with distance 0
Example: switch X announces (X, 0, X)
Switches update their view of the root
Upon receiving a message, check the root id
If the new id is smaller, start viewing that switch as root
Switches compute their distance from the root
Add 1 to the distance received from a neighbor
Identify interfaces not on a shortest path to the root
and exclude them from the spanning tree
24
Example From Switch #4s Viewpoint
Switch #4 thinks it is the root
Sends (4, 0 , 4) message to 2 and 7
Then, switch #4 hears from #2
Receives (2, 0 , 2) message from 2
and thinks that #2 is the root
And realizes it is just one hop away
Then, switch #4 hears from #7 Receives (2, 1 , 7) from 7
And realizes this is a longer path
So, prefe rs its own one-hop path
And removes 4-7 link from the tree
1
2
3
4
5
67
25
Example From Switch #4s Viewpoint
Switch #2 hears about switch #1
Switch 2 hears (1, 1, 3) from 3
Switch 2 starts treating 1 as root
And send s (1, 2, 2 ) to neighbors
Switch #4 hears from switch #2 Switch 4 starts treating 1 as root And send s (1, 3, 4 ) to neighbors
Switch #4 hears from switch #7 Switch 4 receives (1, 3, 7) from 7
And realizes this is a long er path
So, prefe rs its own three-hop path
And removes 4 -7 Iink from the tree
1
2
3
4
5
67
26
Robust Spanning Tree Algorithm
Algorithm must react to failures
Failure of the root node
Need to e lect a ne w root, with the next lowest identifier
Failure of other switches and links
Need to recompute the spanning tree
Root switch continues sending messages
Periodically reannouncing itself as the root (1, 0, 1)
Other switches continue forwarding messages
Detecting f ailures through timeout (soft state!)
Switch waits to hear from others
Eventually times out and claims to be the root
-
7/31/2019 1. NI306 CM Addressing
7/14
-
7/31/2019 1. NI306 CM Addressing
8/14
IP Addressing: Scalability Through Hierarchy
Hierarchy through IP prefixes
Routing between networks
Allocation of address blocks Non-uniform h ierarchy
More ef ficient address allocation
More complex packet forwarding
Dealing with limited address space
Larger address space (IPv6 with 128 bits)
Sharing a small set of addresses (NAT)
Dynamic assignment of addresses (DHCP)
Grouping Related Hosts
The Internet is an inter-network
Used to connect networkstogether, not hosts
Needs a way to address a group of hosts
host host host
LAN 1
...host host host
LAN 2
...
router router routerWAN WAN
LAN = Local Area NetworkWAN = Wide Area Network
Scalability Challenge
Suppose hosts had arbitrary IP addresses
Then every router would need a lot of information
to know how to direct packets toward the host
host host host
LAN 1
...host host host
LAN 2
...
router router routerWAN WAN
1.2.3.4 5.6.7.8 2.4.6.8 1.2.3.5 5.6.7.9 2.4.6.9
1.2.3.4
1.2.3.5
forwarding table
Hierarchy Through Prefixes
Divided into network and host portions
12.34.158.0/24 is 24-bit prefix (28 addresses)
00001100 00100010 10011110 00000101
Network (24 bits) Host (8 bits)
12 34 158 5
-
7/31/2019 1. NI306 CM Addressing
9/14
Example IP Address and Subnet Mask
00001100 00100010 10011110 00000101
12 34 158 5
11111111 11111111 11111111 00000000
255 255 255 0
Address
Mask
Scalability Improved
Number related hosts from a common su bnet
1.2.3.0/24 on the left LAN
5.6.7.0/24 on the right LAN
host host host
LAN 1
...host host host
LAN 2
...
router router routerWAN WAN
1.2.3.4 1.2.3.7 1.2.3.156 5.6.7.8 5.6.7.9 5.6.7.212
1.2.3.0/24
5.6.7.0/24
forwarding table
Easy to Add New Hosts
No need to update the routers
E.g., adding a new host 5.6.7.213 on the right
Doesnt require adding a new forwarding entry
host host host
LAN 1
...host host host
LAN 2
...
router router routerWAN WAN
1.2.3.4 1.2.3.7 1.2.3.156 5.6.7.8 5.6.7.9 5.6.7.212
1.2.3.0/24
5.6.7.0/24
forwarding table
host
5.6.7.213
Classful Addressing (and Dotted Quad Notation)
In the olden days Class A: 0*
Very large /8 blocks (e.g., MIT has 18.0.0.0/8)
Class B: 10*
Large /16 blocks (e.g,. Princeton has 128.112.0.0/16) Class C: 110*
Small /24 blocks (e.g., AT&T Labs has 192.20.225.0/24)
Class D: 1110* Multicast groups
Class E: 11110* Reserved for future use (sounds a bit scary)
And then, address space became scarce
-
7/31/2019 1. NI306 CM Addressing
10/14
Classless Inter-Domain Routing (CIDR)
IP Address : 12.4.0.0 IP Mask: 255.254.0.0
00001100 00000100 00000000 00000000
11111111 11111110 00000000 00000000
Address
Mask
for hostsNetwork Prefix
Use two 32-bit numbers to represent a network.Network number = IP address + Mask
Usually written as 12.4.0.0/15
CIDR = Hierarchy in Address Allocation
12.0.0.0/8
12.0.0.0/16
12.254.0.0/16
12.1.0.0/1612.2.0.0/1612.3.0.0/16
:::
12.253.0.0/16
12.3.0.0/2412.3.1.0/24
::
12.3.254.0/24
12.253.0.0/1912.253.32.0/1912.253.64.0/1912.253.96.0/1912.253.128.0/1912.253.160.0/1912.253.192.0/19
:::
Prefixes are key to Internet scalability
Routing protocols and packet forwarding based on prefixes
Today, routing tables contain ~150,000-200,000 prefixes
41
Scalability: Address Aggregation
Provider is given 201.10.0.0/21
201.10.0.0/22 201.10 .4 .0/24 201 .10.5.0/24 201.10 .6.0/23
Provider
Routers in the rest of the Internet just need to know how toreach 201.10.0.0/21. The provider can direct the IP
packets to the appropriate customer. 42
But, Aggregation Not Always Possible
201.10.0.0/21
201.10.0.0/22 201.10.4.0/24 201.10.5.0/24 201.10.6.0/23
Provider 1 Provider 2
Multi-homedcustomer with 201.10.6.0/23 has twoproviders. Other parts of the Internet need to know how to
reach these destina tions through bothproviders.
-
7/31/2019 1. NI306 CM Addressing
11/14
43
Scalability Through Hierarchy
Hierarchical addressing
Critical for scalab le system
Dont require everyone to know everyone else
Reduces amount of updating when something changes
Non-unif orm hierarchy
Usefu l for heterogeneous networks of dif ferent sizes
Initial class-based addressing was far too coarse
Classless InterDomain Routing (CIDR) helps
Next few slides Plots are # of prefixes vs. time
44Growth faster than improvements in equipment capability
Pre-CIDR (1988-1994): Steep Growth
45Efforts to aggregate (even decreases after IETF meetings!)
CIDR Deployed (1994-1996): Much Flatter
46Good use of aggregation, and peer pressure in CIDR report
CIDR Growth (1996-1998): Roughly Linear
-
7/31/2019 1. NI306 CM Addressing
12/14
47 Internet boom and increased multi-homing
Boom Period (1998-2001): Steep Growth
48
Long-Term View (1989-2005): Post-Boom
Obtaining a Block of Addresses
Separation of control
Prefix: assigned toan institution
Addresses: assigned to nodes bythe institution
Who assigns prefixes?
Internet Corp. for Assigned Names and Numbers
Allocates large blocks to Regional Internet Registries
Regional Internet Registries (RIRs)
E.g., ARIN (American Registry for Internet Numbers)
Allocated to ISPs and large institutions in a region
Internet Service Providers (ISPs)
Allocate address blocks to their customers
Who may, in turn, allocate to their customers
Longest Prefix Match Forwarding
Forwarding tables in IP routers
Maps each IP pref ix to next-hop link(s)
Destination-based forwarding
Packet has a destination address
Router identifies longest-matching prefix
Pushing complexity into f orwarding decisions
4.0.0.0/84.83.128.0/17
12.0.0.0/8
12.34.158.0/24126.255.103.0/24
12.34.158.5
destination
forwarding table
Serial0/0.1
outgoing link
-
7/31/2019 1. NI306 CM Addressing
13/14
Are 32-bit Addresses Enough?
Not all that many unique addresses 232 = 4,294,967,296 (just over four billion)
Plus, some are reserved for special purposes
And, addresses are allocated in larger blocks
And, many devices need IP addresses Computers, PDAs, routers, tanks, toasters,
Long-term solution: a larger address space IPv6 has 128-bit addresses (2128 = 3.403 1038)
53
Are 32-bit Addresses Enough?
Not all that many unique addresses 232 = 4,294,967,296 (just over four billion)
Plus, some are reserved for special purposes
And, addresses are allocated in larger blocks
And, many devices need IP addresses Computers, PDAs, routers, tanks, toasters,
Long-term solution: a larger address space IPv6 has 128-bit addresses (2128 = 3.403 1038)
Short-term solutions: limping along with IPv4 Private addresses
Network address translation (NAT)
Dynamically-assigned addresses (DHCP)
Short-Term Solutions: Limping Along
Network Address Translation (ARES) Allowing multiple hosts to share an IP address
IP addresses not unique and not end-to-end
NAT
inside
outside
10.0.0.1
10.0.0.2
138.76.29.7
Short-Term Solutions: Limping Along
Dynamic Host Configuration Protocol Share a pool of addresses among many hosts
Dynamically assign an IP address upon request
arrivingclient
DHCP se rver233.1.2.5
-
7/31/2019 1. NI306 CM Addressing
14/14
56
Hard Policy Questions
How much address space per geographic region?
Equal am ount per country?
Proportional to the population?
What about addresses already allocated?
Address space portability?
Keep your address block when you change providers?
Pro: avoid having to renumber your equipment
Con: reduces the effectiveness of address aggregation
Keeping the address registries up to date? What about mergers and acquisitions?
Delegation of address blocks to customers?
As a result, the registries are horribly out of date70
Conclusions
IP address
A 32-bit number
Allocated in pref ixes
Non-uniform hierarchy for scalability and flexibility
Packet forwarding
Based on IP prefixes
Longest-prefix-match forwarding
Next lecture
IP routers
Well cover some topics later
Routing protocols, DHCP, and ARP
Growth in the Number of IP Prefixes
CIDR
pre-CIDR
Internet
boom
Internetbust
recovery?