Lecture 15: Addressing and Routing Architecture › ~halos072 › CEG4190_files ›...
Transcript of Lecture 15: Addressing and Routing Architecture › ~halos072 › CEG4190_files ›...
Lecture 15:Addressing and Routing Architecture
Hussein Al Osman CEG4190 15-1
Instructor: Hussein Al Osman
Based on Slides by: Prof Shirmohammadi
Addressing & Routing
• Addressing is assigning identifiersto devices. These identifiers can be local or global, private or public, temporary or persistent.
• Routing consists of learning about the reachability within and between networks and applying this
Hussein Al Osman CEG4190 15-2
within and between networks and applying this reachability to forward packets in the network.
• Together, they form a complete picture of network connectivity.
Addressing Fundamentals
• IP Addressing uses a combination of Address Identifier and Mask– The mask is used to separate the address into a network
and host function.
– This is very important in the distinction between local and remote parts of the network.
Hussein Al Osman CEG4190 15-3
and remote parts of the network.
– E.g.:
Which means 129.99.30.4 is on subnet 129.99.16.0
129.99.30.4 255.255.240.0
Address Identifier MaskAND ==
129.99.16.0
Subnet
Type of Addresses• Localor Global
– Local communication addresses like link-layer (MAC Address).
– Not advertised outside of the local network: there's no point since there is no link-layer connectivity between non-local devices.
– Global addresses are required for devices outside of the local broadcast region like IP addresses.
• Privateor Public
Hussein Al Osman CEG4190 15-4
• Privateor Public– Both are global addresses, but private addresses are not advertised
and forwarded (on purpose) while public addresses are.
• Temporaryof Persistent– Temporary are usually assigned using DHCP while persistent
addresses are assigned either manually or are hardcoded (like Ethernet address “carved” into an Ethernet network card.
Local vs. Remote Network
Network Other Network
129.99.0.100
136.178.0.100
136.178.0.0/16129.99.0.0/16
Hussein Al Osman CEG4190 15-5
.0.1 .0.2 .0.3136.178.0.1
Devices on the same subnet are directly connected and therefore, for IP, address resolution is done at different layer (MAC) than that done at the routing layer (IP).
In communicating to devices on other networks there must be a router connecting the networks
Explicit Routing
Company A129.99.64.0
255.255.192.0
Company B129.99.128.0
255.255.192.0
ISP X ISP Y
Hussein Al Osman CEG4190 15-6
ISP X
Routing Table129.99.64.0/255.255.192.0 � I/F 1129.99.128.0/255.255.192.0 � I/F 2
Internet
Route to129.99.64.0
Route to129.99.128.0
Destination IP:129.99.66.2
I/F 1 I/F 2
Explicit Routing
Company A129.99.64.0
255.255.192.0
Company B129.99.128.0
255.255.192.0
ISP X ISP Y
Hussein Al Osman CEG4190 15-7
ISP X
Routing Table129.99.64.0/255.255.192.0 � I/F 1129.99.128.0/255.255.192.0 � I/F 2
Internet
Route to129.99.64.0
Route to129.99.128.0
Destination IP:129.99.136.2
I/F 1 I/F 2
Addressing Mechanisms• Classfuladdressing
– older style of addressing
• Subnetting– A better way to distribute addresses
• Supernettingand Classless interdomain routing (CIDR).– An efficient way to advertise addresses, and currently used on
Hussein Al Osman CEG4190 15-8
– An efficient way to advertise addresses, and currently used on the Internet.
• Private addressingand Network Address Translation (NAT).– A way to re-use certain IP addresses without collision with
the rest of Internet
Classful Addressing• Outdated form of addressing offers a simplistic solution
for addressing schemes.• Based on pre-determined mask lengths where:
– Class A = Mask 255.0.0.0 (27 or128 Networks & over 224 or 16M Addresses/Network), First Octet Range 1-127
– Class B = Mask 255.255.0.0 (214 or 16K Networks & 216 or
0 7 bits 24 bits
Hussein Al Osman CEG4190 15-9
– Class B = Mask 255.255.0.0 (214 or 16K Networks & 216 or 64K Addresses/Network), First Octet Range 128-191
– Class C = Mask 255. 255. 255.0 (221 or 2M Networks & 28 or 256 Addresses/Network), First Octet Range 192-223
– Class D = Multicast address (start with 1110).– Class E is reserved (start with 1111).
14 bits1 0
21 bits1 1 0
16 bits
8 bits
Limits to Classful Addressing
• Very fewClass A and B addresses, and all have already been allocated.– That leaves class C to allocate new addresses
• Many networks require more addressesthan class C but fewer addressesthan B offers.
Hussein Al Osman CEG4190 15-10
class C but fewer addressesthan B offers.– On the other hand many organizations with A or B
cannot use all of the addresses offered by class A or B.
• That has led to variable-length subnets
Subnetting• Allows a classful network address to be segmented into
smaller sectionsby using part of the device address to create another level of hierarchy.
• Useful forInternaladdressing and routing– Allows you to assign subnets to specific buildings, or specific
Hussein Al Osman CEG4190 15-11
– Allows you to assign subnets to specific buildings, or specific groups, hence localizing traffic and simplifying routing.
129.99.30.4 255.255.240.0
Address Identifier MaskAND ==
129.99.16.0
Subnet
Subnetting for Class B Network2-Bit Mask
255.255.192.0
3-Bit Mask255.255.224.0
4-Bit Mask255.255.240. 0
5-Bit Mask255.255.248. 0
Class B255.255.0.01 Network
64K Devices
3 Subnets16382 Devices/Subnet
7 Subnets8190 Devices/Subnet
15 Subnets4094 Devices/Subnet
31 Subnets2046 Devices/Subnet
Hussein Al Osman CEG4190 15-12
6-Bit Mask255.255.252. 0
7-Bit Mask255.255.254. 0
8-Bit Mask255.255.255. 0
64K Devices
63 Subnets1022 Devices/Subnet
127 Subnets510 Devices/Subnet
255 Subnets254 Devices/Subnet
Notice that all zerosare not allowed as either subnet part or as host part. Also, all onesare not allowed for the host part.
Example• A company has bought IP class address 136.178.0.0. It has 14
departments and it wants to give each its own subnet. What will be each of the subnets, and their subnet mask?
• This is a class “B” address so we subnet into the 3rd octet. To have 14 subnets, we require 24 -1= 15 subnet divisions, so we play with the first 4 bits in the third octet. The mask will be 255.255.240.0, and subnets are:
Hussein Al Osman CEG4190 15-13
255.255.240.0, and subnets are:
1. 136.178.0.0 10001000.10110010.0000 0000.000000002. 136.178.16.0 10001000.10110010.0001 0000.00000000
3. 136.178.32.0 10001000.10110010.0010 0000.00000000
4. 136.178.48.0 10001000.10110010.0011 0000.00000000
5. 136.178.64.0 10001000.10110010.0100 0000.00000000
6. 136.178.80.0 10001000.10110010.0101 0000.00000000
7. 136.178.96.0 10001000.10110010.0110 0000.00000000
8. 136.178.112.0 10001000.10110010.0111 0000.00000000
9. 136.178.128.0 10001000.10110010.1000 0000.00000000
10. 136.178.144.0 10001000.10110010.1001 0000.00000000
11. 136.178.160.0 10001000.10110010.1010 0000.00000000
12. 136.178.176.0 10001000.10110010.1011 0000.00000000
13. 136.178.192.0 10001000.10110010.1100 0000.00000000
14. 136.178.208.0 10001000.10110010.1101 0000.00000000
15. 136.178.224.0 10001000.10110010.1110 0000.00000000
16. 136.178.240.0 10001000.10110010.1111 0000.00000000
Traditionally not allocated
Variable-length Subnetting• Subnetting divides the network into a number of equal-sized
subnets which is often inefficient.
• Variable-length subnettingis subnetting in which non-equal or variable lengthsubnets are used.
• E.g., an organization with Class B address 136.178.0.0 has a number of workgroups divided as shown below:
Workgroup Groups Size/Group (Devices)
Hussein Al Osman CEG4190 15-14
Workgroup Groups Size/Group (Devices)
Engineering 3 400 (1200)
Marketing 1 1950
Administration 1 200
Sales 15 35-90 (1350)
R&D 1 150
Support 22 10-40
Total 43 5730
Classful and Subnetting Solution
• Classfulsolution gives us 65,534 devices. That’s enough devices, but putting all departments (i.e., 5730 devices) in the same “subnet” is neither scalable nor manageable.
• Subnettingsolution:– let’s have 1 subnet per group. We have 43 groups, so we
Hussein Al Osman CEG4190 15-15
– let’s have 1 subnet per group. We have 43 groups, so we need 26 -1= 63 subnets, which means we can use 6 bits for the subnet part, and the remaining 10 bits for hosts.
– But 10 bits for hosts part gives us 210 – 2 = 1022 devices, and marketing has 1950 devices.
– What to do?
• Use variable length subnetting.
Variable-length Subnetting Solution• We can resolve this by using a combination of 4-bit and 8-bit masks.
• 4-bit mask 255.255.240.0 gives us 15 subnets each with 4094 (or 212 -2) devices. That’s enough for Engineering and Marketing. We use the first five subnets as follows:– Engineering (3 subnets) -> 136.178.16.0, 136.178.32.0, 136.178.48.0
– Marketing (1subnet) -> 136.178.64.0
Hussein Al Osman CEG4190 15-16
– Marketing (1subnet) -> 136.178.64.0
– Administration (1 subnet) -> 136.178.80.0
• 8-bit mask 255.255.255.0 gives us (255 – 15) subnets and 254 devices. That’s fine for Sales, R&D, & Support.
Why Admin?
Why substitute 15??
�Longest prefix match
Supernetting• Supernettingis the concept of aggregating network addresses by
changing the network mask to decrease the number of bitsrecognized as the network part.
• Millions of Class C addresses can be allocated in lieu of Class A & B.– The result is that too many Class C address groups need to be allocated
to an organization and advertised among all the Internet routers.
Hussein Al Osman CEG4190 15-17
to an organization and advertised among all the Internet routers.
– The number of routes would grow exponentially such that “some experts” had predicted that the Internet would collapse by 1996.
– Obviously this did not happen, supernetting helped
• Say a company needs to support 10,000 devices.– A class C address supports up to 254 devices, so 40 class C networks
are needed.
– How are we to advertise these 40 class C addresses?
Supernetting Technique
• If we take a set of 16 contiguousaddresses from a Class C address like 192.92.240.0 we can see that the first 4 digits of the subnet octet do not change.
Hussein Al Osman CEG4190 15-18
• This range of values can be represented as192.92.240.0 with a subnet mask of255.255.240.0 where the last 4 bitsin the third octet are ignored.
• This then can be used to advertise a group of addresses as 192.92.240.0/20 which means addresses from 192.92.240.0 -> 192.92.255.0
Classless InterDomain Routing (CIDR)
• The concept of supernetting suggested that indeed we do not need class boundaries, since each “group” can advertise its own subnet mask too.
• This in effect lead to Classless InterDomain Routing (CIDR).• Addresses must be assigned in contiguousblocks following logical
topology.• The number of addresses in a CIDR block are powers of 2.• Network Prefix can be anything, and need not be a power of 2. It is
transmitted along with address
Hussein Al Osman CEG4190 15-19
transmitted along with address• Used in conjunction with classless routing protocols (e. g. EIGRP, OSPF)• E.g. (if we want to leave 8 bits for the host):
– 192.92.240/22 advertises 4 networks: 240, 241, 242, and 243– 192.92.240/23 advertises 2 networks: 240 and 241– 192.92.240/24 (this is the natural mask for class C) advertises 1 network: 240– 192.92.240/21 advertises 8 networks: 240 to 247
Classful vs. CIDR• Classful router must advertise all 4 nets
• Classless router only advertises one
172.16.0.0172.16.0.0
172.17.0.0172.17.0.0
172.18.0.0172.18.0.0
172.19.0.0172.19.0.0
Rtr 1
I’m router 1 andI know how to get to
networks:
172.16.0.0172.17.0.0172.18.0.0172.19.0.0
Hussein Al Osman CEG4190 15-20
• Classless router only advertises one
172.16.0.0172.16.0.0
172.17.0.0172.17.0.0
172.18.0.0172.18.0.0
172.19.0.0172.19.0.0
Rtr 1
I’m router 1 and I know how to get to networks:
172.16.0.0/14
172.16172.16 10101100 00010010101100 0001000000
172.17172.17 10101100 00010010101100 0001000101
172.18172.18 10101100 00010010101100 0001001010
172.19172.19 10101100 00010010101100 0001001111
14 bits14 bits
Private Addresses and NATs
• Private IP Addressesare reserved addresses that can’t be forwarded to the Internet
10.0.0.0 -> 10.255.255.255 (10/8 prefix)172.16.0.0 -> 172.31.255.255 (172.16/12 prefix)192.168.0.0 -> 192.168.255.255 (192.168/16 prefix)
• Network Address Translation: translates private addresses <-> public addresses
Hussein Al Osman CEG4190 15-21
public addresses
• Can be implemented in Router, Firewall, or Specialized device.
Routing• Staticrouting
– The reachability is entered manually to the router. Method we commonly use for our small networking labs.
• Dynamicrouting– More typical of a real network. Typical routing protocols are:
RIP/RIPv2, OSPF, and BGP4
Hussein Al Osman CEG4190 15-22
– Destination is determined by looking at the network portion of the packets destination address and choose the best destination (one with the more explicit route. i.e. the more specific).
As a Network Designer…We now consider a routing mechanism that consists of:
• Establishing routing flows• Identifying and classifying routing boundaries
Hussein Al Osman CEG4190 15-23
Establishing Routing Flows
• Segment the network into functional areasand workgroups.• Identify boundaries between these areas.• Form relationships between boundaries and routing flows.• A functional area consists of groups within the system that
share a similar function.– These may consist of users (workgroups), applications, devices, or
Hussein Al Osman CEG4190 15-24
– These may consist of users (workgroups), applications, devices, or combinations of these and they may share similar jobs, locations, functions within the network (backbone routing).
• Workgroups are groups of users that have common locations, applications, and requirements, or that belong to the same organization.
Example of Workgroups & FAs
Hussein Al Osman CEG4190 15-25
Routing Boundaries
• These are physical or logical separations of a network based on requirements or administration of the network.
• Physical Boundariescan de identified by isolated LANs, DMZs, physical interfaces on network equipment, physical security.
Hussein Al Osman CEG4190 15-26
equipment, physical security.
• Logical Boundariescan be identified by the FAs, WGs, administrative domains (Autonomous Systems AS), and routing management domains.
Hard Boundaries• These boundaries are routing boundaries in which EGPs are
predominantly used:– Exterior Gateway Protocols (EGPs) communicate between AS’s or AS
and external network. DMZs and interfaces to ISP.
– Interior Gateway Protocols (IGPs) communicate within an AS.
Hussein Al Osman CEG4190 15-27
Your AS/Administrative Domain Internet
DM
Z
Hard Boundary
Soft Boundaries
• Typically found within a single AS and are usually placed at the junction of FAs and WGs
FA3
Your AS / Administrative Domain
Hussein Al Osman CEG4190 15-28
FA1
WG2
WG1 WG1 WG1
WG1
WG1
WG1
FA2
FA3
FA4
Internet Routing
• The Internet uses hierarchical routing
• The Internet is split into AS’s– AS corresponds to an administrative domain
• Within an AS, the administrator chooses an Interior
Hussein Al Osman CEG4190 15-29
• Within an AS, the administrator chooses an Interior Gateway Protocol (IGP)
Why different Intra- and Inter-AS routing?
• Policy:– Inter-AS: admin wants control over how its traffic is routed
• who routes through its net.
– Intra-AS: single admin, so no policy decisions needed
• Scale:
Hussein Al Osman CEG4190 15-30
– hierarchical routing saves table size, update traffic
• Performance:– Intra-AS: can focus on performance– Inter-AS: policy may dominate over performance
• Routing Flows are flows of routing information passed between FAs and ASs.
Boundaries & Routing Flows
FA1 FAb1 FAb2
FA4FA5
ExternalNetworks
Hard Boundary
Hussein Al Osman CEG4190 15-31
• These are important
for the architecture
and design because
routing flows can be
manipulated at routing
boundaries.
FA3
FA2Routing Flows
AS
Thank You!
Hussein Al Osman CEG4190 15-32