Presentation is loading. Please wait.

Presentation is loading. Please wait.

Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

Similar presentations


Presentation on theme: "Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)"— Presentation transcript:

1 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Subnetting & CIDR Tahir Azim Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

2 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Announcements Participate in NASCON, FAST-NU Islamabad Assignment 1 deadline extended to Tuesday due to no BIT-7 classes on Monday From last time: Packet bursting: An approach to increasing the speed of g-based wireless networks by unwrapping short g packets and rebundling them into a larger packet to reduce the impact of mandatory gaps between packets (jwire.com) Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

3 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Subnetting Subnetting is a form of hierarchical routing. Subnets are usually represented via an address plus a subnet mask or “netmask”. e.g. > ifconfig hme0 hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500 inet netmask ffffff00 broadcast Netmask ffffff00: the first 24 bits are the subnet ID, and the last 8 bits are the host ID. Can also be represented by a “prefix + length”, e.g /24, or just /24. Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

4 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Subnetting CLASS “B” e.g. Company 2 14 16 10 Net ID Host-ID 2 14 16 2 14 16 e.g. Site 10 Net ID 0000 Host-ID 10 Net ID 1111 Host-ID Subnet ID (20) Subnet Host ID (12) Subnet ID (20) Subnet Host ID (12) 2 14 16 2 14 16 e.g. Dept 10 Net ID 000000 Host-ID 10 Net ID Host-ID Subnet ID (22) Subnet Host ID (10) Subnet ID (26) Subnet Host ID (6) Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

5 Routing in the presence of subnets
The rest of the Internet is not aware of subnets within a network Levels: site, subnet, host Routing now involves delivery to the site, then the subnet and finally the host Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

6 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Example of subnetting hpr1-rtr To: cenic.net /24 /30 Class B Address Gates-rtr bbr2-rtr /27 /16 AS 32 EndHost border2-rtr /28 To: cogentco.com Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

7 Classless Interdomain Routing (CIDR) Addressing
The IP address space is broken into line segments, or blocks e.g. Block of 2 addresses, block of 128 addresses etc. Each block is described by a prefix. A prefix is of the form x/y where x indicates the prefix of all addresses in the block, and y indicates the length of the prefix. e.g. The prefix 128.9/16 represents the block containing addresses in the range: … 142.12/19 65/8 128.9/16 232-1 216 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

8 Classless Interdomain Routing (CIDR) Addressing
/24 /24 /20 /20 Most specific route = “longest matching prefix” 128.9/16 232-1 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

9 Classless Interdomain Routing (CIDR) Addressing
Prefix aggregation: If a service provider serves two organizations with prefixes, it can (sometimes) aggregate them to form a shorter prefix. Other routers can refer to this shorter prefix, and so reduce the size of their address table. E.g. ISP serves /24 and /24, it can tell other routers to send it all packets belonging to the prefix /23. ISP Choice: In principle, an organization can keep its prefix if it changes service providers. Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

10 Size of the Routing Table at the core of the Internet
Source: Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

11 Prefix Length Distribution
Source: Geoff Huston, Jan 2006 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

12 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Examples Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

13 Finding the first address
What is the first address in the block if one of the addresses is /27? Solution: The prefix length is 27, which means that we must keep the first 27 bits as is and change the remaining bits (5) to 0s. The following shows the process: Address in binary: Keep the left 27 bits: Result in CIDR notation: /27 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

14 Finding the first address
What is the first address in the block if one of the addresses is /20? Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

15 Finding the last address in the block
To the first address, add the number of addresses, minus one OR Set all bits that are not part of the CIDR prefix to 1 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

16 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Example Find the number of addresses in the block if one of the addresses is /20. Solution: The prefix length is 20. The number of addresses in the block is 232−20 or 212 or Note that this is a large block with 4096 addresses. Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)

17 Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)
Example 2 Find the last address in the block if one of the addresses is /20. Solution We found in the previous examples that the first address is /20 and the number of addresses is To find the last address, we need to add 4095 (4096 − 1) to the first address. Or, set all bits that are not part of the CIDR prefix to 1 ( )2. ( )2 = Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)


Download ppt "Courtesy Nick McKeown (Stanford), Umar Kalim (NIIT)"

Similar presentations


Ads by Google