Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSS432 Subnetting and CIDR Textbook Ch3. 2

Similar presentations


Presentation on theme: "CSS432 Subnetting and CIDR Textbook Ch3. 2"— Presentation transcript:

1 CSS432 Subnetting and CIDR Textbook Ch3. 2
CSS432 Subnetting and CIDR Textbook Ch Global Internet Textbook Ch4.1 Prof. Athirai Irissappane CSS 432: Subnetting, CIDR, and Global Internet

2 CSS 432: Subnetting, CIDR, and Global Internet
Internet Structure NSFNET backbone Stanford BARRNET regional Berkeley P ARC NCAR UA UNM Westnet UNL KU ISU MidNet Autonomous System (AS): Administered independently of other AS Have a different routing protocol and metrics Do we really need to give an independent class A/B/C network number to every single AS? CSS 432: Subnetting, CIDR, and Global Internet

3 Global Addresses IP address Class
Network Host 7 24 A: 14 16 1 B: 21 8 C: Global Addresses IP address Class Identified using first few bits as shown in fig Class A (previously reserved for small number of WAN) 7 bits for network, 24 bits for host 2^7 – 2 different networks (1st bit is 0, 127… is reserved for loopback IP address) Each network 2^24 -2 hosts (all zeros in host bits represent network ID, all 1s broadcast Id) (2^24 – 2 = 16,777,214) Class B (previously reserved for medium sized campus networks) 14 bits for network, 16 bits for host 2^14 networks Each network 2^ hosts ( = 65534) Class C (previously reserved for large number of LANs) 21 bits for network, 8 bits for host (2^8 -2) = (256-2=254) But convention not followed anymore – Classless addresses are used now MAC address – 6 bytes 48 bits long

4 Scaling Issues in Routing
Class C address 21 bits for network and 8 bits for host Each network 2^8 -2 hosts? What happens if we need to sub-divide the network and manage groups of computers individually ? Should each group be given a different class A address? Exhaust IP addresses faster, inefficient use of IP addresses Group 1 – 2 hosts 2/2^8-2 = 2/ ~ .7% efficiency CSS 432: Subnetting, CIDR, and Global Internet

5 Scaling Issues in Routing
Inefficient use of IP Address Space Class C with 2 hosts (2/254 = 0.78% efficient) Class B with 256 hosts (256/65534 = 0.39% efficient) IP address space gets consumed too quickly Too Many Networks Routing tables do not scale (more networks, more entries) Route propagation protocols do not scale Router gets slower to scan a big forwarding table Hierarchy CSS 432: Subnetting, CIDR, and Global Internet

6 CSS 432: Subnetting, CIDR, and Global Internet
Efficiently use IP addresses, especially for autonomous systems The practice of dividing a network into two or more networks is called subnetting. A subnet is a way of taking a single IP network address (A/B/C) and locally splitting it up Given 1 IP address how can different subnets be identified? Computers that belong to a subnet are addressed with a common, identical, most-significant bit-group in their IP address. Depends on how you split the network and host part CSS 432: Subnetting, CIDR, and Global Internet

7 SubNetted Networks Define subnetwork by using some bits of host address to identify the subnetwork Borrowing 1 or more bits from the host bit portion

8 Example: Subnet Network Part
Dividing a network into 2 subnets requires to borrow 1 bit Class C address: Network Portion/Subnet Mask (Class C address 24 bits network) Define new subnet , Borrow 1 bit from host address (borrow from the right most bit) No. of. Subnetworks = 2^ number of bits for sub network = 2^1 = 2 subnetworks No.of hosts per subnetwork = 2^number of host bits -2 = 2^7 -2= = 126 All host bits are 1’s are reserved for broadcast ID All host bits 0’s are reserved for network ID 2^7 Subnet Network Part

9 Subnet Mask 2nd subnet: Class C address: 172.16.25.0
What is the network address of the subnets? (each subnet has hosts) 1st subnet: 0 to hosts to hosts is the subnetwork ID, is broadcast IP, hosts can be to belongs to this subnet 2nd subnet: 128 to hosts to hosts is the subnetwork ID, is broadcast IP, hosts can be to

10 Subnet Mask Determines the way an IP address is split into network and hosts portions Class A - 0nnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh Subnet Mask = Class B - 10nnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh Subnet Mask = Class C - 100nnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh Subnet Mask =

11 Class C Subnetting # of Subnets # of Hosts/Subnet NetMask 4th Octet
# of Subnets # of Hosts/Subnet NetMask 4th Octet CIDR Notation 2 126 /25 4 62 /26 8 30 /27 16 14 /28 32 6 /29 64 /30

12 Subnet Mask IP address & subnet mask = subnet number
How to identify if a host is within a given subnet, given the subnet Id, subnet mask and IP address of host IP address & subnet mask = subnet number Example: destination IP= ; subnet mask= ; Subnet ID = & =

13 Routing with simple IP [Note: NetworkNum values would typically be more like ] CSS 432: Subnetting & CIDR

14 Routing with subnetting
IP address & subnet mask = subnet number Example: & & = Forwarding Table for R1 CSS 432: Subnetting & CIDR

15 CSS 432: Subnetting, CIDR, and Global Internet
Forwarding Algorithm D = destination IP address for each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 = SubnetNum if NextHop is an interface deliver datagram directly to destination else deliver datagram to NextHop (a router) Use a default router if nothing matches Not necessary for all 1s in subnet mask to be contiguous But should be avoided Can put multiple subnets on one physical network Ex. Two or more departments want to have their own subnet and to allocate IP addresses in it while sharing just one physical network Subnets not visible from the rest of the Internet CSS 432: Subnetting, CIDR, and Global Internet

16 Supernetting Supernetting Subnetting
Purpose: given a class C address -> helps to divide into sub network numbers → helps assign addresses efficiently Problem: an AS with more than 254 hosts still needs class B (65535 hosts), e.g., 256 hosts class B address still inefficient Supernetting Solution: assign block of contiguous network numbers to an institution. Ex. Assign two class C network numbers instead of one class B network. Side effect: The information that routers store and exchange increases dramatically Ex. If an AS has 16 class C network numbers, every Internet router needs 16 entries for this AS. CIDR: Classless Inter-Domain Routing

17 The University of Adelaide, School of Computer Science
22 October 2017 SuperNetting Class C address: Block1 ( ) Block2 ( ) Use this Mask instead of If we take 1 bit for subnetwork Number of host bits = 9 ~ 2^9 hosts; each subnetwork can have more number of hosts Chapter 2 — Instructions: Language of the Computer

18 The University of Adelaide, School of Computer Science
22 October 2017 Classless Addressing Exhaustion of IP address space centers on exhaustion of the class B network numbers Solution Say “NO” to any Autonomous System (AS) that requests a class B address unless they can show a need for something close to 64K addresses Instead give them an appropriate number of class C addresses For any AS with at least 256 hosts, we can guarantee an address space utilization of at least 50% What is the problem with this solution? Chapter 2 — Instructions: Language of the Computer

19 The University of Adelaide, School of Computer Science
22 October 2017 Classless Addressing Problem with this solution Excessive storage requirement at the routers. If a single AS has, say 16 class C network numbers assigned to it, Every Internet backbone router needs 16 entries in its routing tables for that AS This is true, even if the path to every one of these networks is the same If we had assigned a class B address to the AS The same routing information can be stored in one entry Efficiency = 16 × 255 / 65, 536 = 6.2% Chapter 2 — Instructions: Language of the Computer

20 The University of Adelaide, School of Computer Science
22 October 2017 CIDR CIDR tries to balance the desire to minimize the number of routes that a router needs to know against the need to hand out addresses efficiently. CIDR uses aggregate routes Uses a single entry in the forwarding table to tell the router how to reach a lot of different networks Breaks the rigid boundaries between address classes Chapter 2 — Instructions: Language of the Computer

21 The University of Adelaide, School of Computer Science
22 October 2017 CIDR NOTATION Instead of having multiple entries for each contiguous block of class C address in the routing table, just specify 1 entry The contiguous blocks have the same prefix Example /20 First 20 bits is network part and next 12 bits is for the host Contiguous subnets need not have different entries in the routing table but just one entry due to CIDR CIDR Blocks Contiguous IP addresses Block size in power of 2 Chapter 2 — Instructions: Language of the Computer

22 The University of Adelaide, School of Computer Science
22 October 2017 CIDR Consider an AS with 16 class C network numbers. Instead of handing out 16 addresses at random, hand out a block of contiguous class C addresses Suppose we assign the class C network numbers from through Observe that top 20 bits of all the addresses in this range are the same ( ) We have created a 20-bit network number (which is in between class B (14 bits) network number and class C number (21 bits) ) Requires to hand out blocks of class C addresses that share a common prefix Chapter 2 — Instructions: Language of the Computer

23 The University of Adelaide, School of Computer Science
22 October 2017 Classless Addressing Classless Inter-Domain Routing A technique that addresses two scaling concerns in the Internet The growth of backbone routing table as more and more network numbers need to be stored in them Potential exhaustion of the 32-bit address space Address assignment efficiency Arises because of the IP address structure with class A, B, and C addresses Forces us to hand out network address space in fixed-size chunks of three very different sizes A network with two hosts needs a class C address Address assignment efficiency = 2/255 = 0.78 A network with 256 hosts needs a class B address Address assignment efficiency = 256/65535 = 0.39 Chapter 2 — Instructions: Language of the Computer

24 Classless Addressing Examples
Given this routing table with CIDR notation To which of those two should we forward a packet destined to ? Prefix Next Hop /18 R2 /20 R3 /18 18 network bits, mask = & = (Matches!) /20 20 network bits, mask = & = (Matches!) Which one should I choose Principle of Longest Match  (Matches!) with 20 network bits Next hop is R3 2 power 1 4 8 3 16 32 5 64 6 128 7 CSS 432: Subnetting, CIDR, and Global Internet

25 Trie (Prefix Tree) Data structure for longest prefix match
Tree with child and parent nodes If this Trie represents a dictionary, find the longest word with prefix “The” Ans: There We will be considering a binary trie Every parent has only 2 children

26 Binary Trie Tree contains path to network address
Bits before * represents the network portion Each leaf contains a possible address Prefixes in the table are marked (dark) Binary Trie Search: Traverse the tree according to destination address Most recent shaded node is the current longest prefix Search ends when a leaf node is reached

27 Binary Trie Update: Search for the new entry
1 h 1010* h Update: Search for the new entry Search ends when a leaf node is reached If there is no branch to take, insert new node(s)

28 Constructing a Binary Trie for lookup
7 6 5 4 3 2 1 128 64 32 16 8 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0 /2 /2 10* /1 /1 0* /20 /20 * /18 /18 00* /2 interface0 /1 Router 2 /20 Interface1 /18 Router 3 CSS 432: Subnetting, CIDR, and Global Internet

29 Classless Lookup Binary Trie for IP Routing Compress 1-child branches
1 10 more zeros /20 /1 ; 10* /1 ; 0* 1 1 3 more zeros 1 /18 10* /2 interface0 0* /1 Router 2 * /20 Interface1 * /18 Router 3 CSS 432: Subnetting, CIDR, and Global Internet

30 CSS 432: Subnetting, CIDR, and Global Internet
Classless Lookup Patricia Tree for IP Routing /20 1 Skip 1 one 1 1 1 Skip 10 zeros Skip 3 zeros /1 ; 10* /18 /1 ; 0* Practical Algorithm To Retrieve Information Coded in Alphanumeric 10* /2 interface0 0* /1 Router 2 * /20 Interface1 * /18 Router 3 CSS 432: Subnetting, CIDR, and Global Internet

31 CSS 432: Subnetting, CIDR, and Global Internet
Classless Lookup Destination is /32  /20 1 Skip 1 one 1 1 1 Skip 10 zeros Skip 3 zeros /18 /1 ; 10* /1 ; 0* Destination ip Longest Matching prefix /32 /18 /20 10* /2 interface0 0* /1 Router 2 * /20 Interface1 * /18 Router 3 CSS 432: Subnetting, CIDR, and Global Internet

32 CSS 432: Subnetting, CIDR, and Global Internet
Route Propagation NSFNET backbone Stanford BARRNET regional Berkeley P ARC NCAR UA UNM Westnet UNL KU ISU MidNet Know a smarter router Hosts know local (default) routers Local routers know site routers Site routers know core router Core routers know everything Site routers are called border routers. Autonomous System (AS) Corresponds to an administrative domain Examples: University, company, backbone network Two-level route propagation hierarchy Interior gateway protocol (each AS selects its own) Exterior gateway protocol (Internet-wide standard) AS1 AS2 R2 R1 Interior Exterior CSS 432: Subnetting, CIDR, and Global Internet

33 Popular Interior Gateway Protocols
RIP: Route Information Protocol Distributed with Unix Distance-vector algorithm Based on hop-count OSPF: Open Shortest Path First Recent Internet standard Uses link-state algorithm Supports load balancing Supports authentication CSS 432: Subnetting, CIDR, and Global Internet

34 Well-known Exterior Gateway Protocol
Border Gateway Protocol – 4th Version (BGP-4) Assumption: Internet as an arbitrarily interconnected set of ASs Goal: Reachability than optimality Backbone service provider Peering point Large corporation Small corporation Consumer ISP Stub AS: A single connection to another AS Only carries local traffic. Multihomed AS: Connections to multi ASs Refuses to carry transit traffic Transit AS: Connections to multi-ASs Carries both transit and local traffic Local Traffic: traffic within AS Transit Traffic: traffic across AS

35 BGP-4 (Routing across AS)
Routing path is a vector of AS to reach a particular network Each AS has: 1 or more border routers (through which packet enter and leave AS) one BGP speaker that advertises (can be border router): local networks other reachable networks (transit AS only) gives complete path information Characteristics Inter-BGP speaker communication based on P2P and TCP Consistent maintenance on routing information among multiple BGP speakers Reachability-based information Policy Support to distinguish between intra- and inter-AS reachability information Incremental updates that sends only reachability change Route aggregation to send multiple routes in one message Authentication to allow a receiver to authenticate messages

36 BGP Example Speaker for AS2 advertises reachability to P and Q
network , , , and , can be reached directly from AS2 Speaker for backbone advertises networks , , , and can be reached along the path (AS1, AS2). Speaker can cancel previously advertised paths BGP prevents loops: Each received advertisement is a full path to reach a destination, AS in the path must be unique. Receiver discards it if it finds itself in the path. Backbone network (AS 1) Regional provider A (AS 2) Regional provider B (AS 3) Customer P (AS 4) Customer Q (AS 5) Customer R (AS 6) Customer S (AS 7) 128.96

37 CSS 432: Subnetting, CIDR, and Global Internet
Routing Areas AS divided into areas Area 0 Known as the backbone area and connected to the back bone Routers (R1, R2, R3) called ABR (Area Border Router) OSPF link states do not leave the area in which they originated if they are not ABRs. ABRs summarize routing information that they have learned from one area and make it available in their advertisements to other areas. R4 R5 R6 R2 R3 R1 R7 R8 R9 Area 0 Area 3 Area 2 Area 1 Virtual Link NO CSS 432: Subnetting, CIDR, and Global Internet

38 CSS 432: Subnetting, CIDR, and Global Internet
IP Version 6 Features 128-bit addresses (classless/CIDR) [IPv4 – 32 bit address] multicast real-time service authentication and security autoconfiguration end-to-end fragmentation protocol extensions Header 40-byte “base” header [IPv4 – 20 bytes w/o options] extension headers (fixed order, mostly fixed length, use when necessary) fragmentation source routing other options CSS 432: Subnetting, CIDR, and Global Internet

39 CSS 432: Subnetting, CIDR, and Global Internet
Reviews Subnetting: How to address and forwarding algorithm Supernetting: CIDR, principle of longest match, and classless lookup Exterior gateway protocol: BGP and routing areas Exercises in Chapter 3 Ex. 55 (Subnetting) Ex. 68 (CIDR) Ex. 72 (CIDR) Ex. 74 (CIDR) CSS 432: Subnetting, CIDR, and Global Internet


Download ppt "CSS432 Subnetting and CIDR Textbook Ch3. 2"

Similar presentations


Ads by Google