subnet design and ip addressing - kasetsart universitycpj/219321/slides/16-ipaddr.pdf · introduced...

36
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. © The McGraw-Hill Companies, Inc. Subnet Design and IP Addressing Asst. Prof. Chaiporn Jaikaeo, Ph.D. [email protected] http://www.cpe.ku.ac.th/~cpj Computer Engineering Department Kasetsart University, Bangkok, Thailand Adapted from the notes by Lami Kaya and lecture slides from Anan Phonphoem

Upload: others

Post on 02-Jan-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. © The McGraw-Hill Companies, Inc.

Subnet Design and IP Addressing

Asst. Prof. Chaiporn Jaikaeo, Ph.D. [email protected]

http://www.cpe.ku.ac.th/~cpj Computer Engineering Department

Kasetsart University, Bangkok, Thailand

Adapted from the notes by Lami Kaya and lecture slides from Anan Phonphoem

Page 2: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

2

Outline

IP Address

CIDR

Page 3: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

3

Internet Addresses

Internet protocol must hide physical network details

Application doesn’t care about physical

Need address to communicate without knowing underlying network of each other

Address should be

Unique

Uniform addressing scheme

Independent to physical networks

Page 4: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

Network

D.L.

P.L.

D.L.

P.L.

Network

D.L.

P.L.

D.L.

P.L.

4

Internet Model Revisited

Application

Transport

Network

Data Link

Physical

Application

Transport

Network

Data Link

Physical

Transmission medium

sender router

router

receiver

Page 5: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

Network Layer Revisited

Network 1

Network 6

Network 5

1.1 1.2

6.6

6.1

6.3

5.7

5.2

Network 3 3.8

3.3 Router

Data 1.1 5.7

1.1, 1.2, 6.1, 5.7, ... are logical addresses

R1

R3 R2

Page 6: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

6

IP Addressing Scheme

Unique 32-bit binary number (4 bytes)

Assigned to each network interface

Used for identify host and communicate

Two-level hierarchical address

prefix (network ID) – assigned globally

suffix (Node/host ID) – assigned locally

Address must be coordinated globally

Network ID Host ID

Prefix Suffix

Page 7: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

7

Internet Classes

Traditional addressing scheme

Classful Addressing

Page 8: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

9

IP Address Classes

A 50%

B 25%

C 12.5%

D E

Page 9: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

10

No. of Networks / Hosts

Page 10: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

11

IP address in decimal notation

27 26 25 24 23 22 21 20

0 0 0 0 1 0 1 1

8 + 2 + 1 = 11

x x x x x x x x

Page 11: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

13

Class ranges of Internet Address

Page 12: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

14

IP address in decimal notation

www.ku.ac.th

Page 13: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

15

Class A example

Page 14: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

16

Class C example

Page 15: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

17

Network Address

Page 16: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

18

Internet Example

Network and Host addresses

Page 17: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

A Network with Two Levels of Hierarchy

Network -> Host

19

Page 18: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

20

A Network with Three Levels of Hierarchy

Network -> Subnet -> Host

Page 19: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

21

Addresses with and without Subnetting

Page 20: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

22

Classful Subnet Masks

Class Binary Dotted-Decimal CIDR

Notation

A 11111111 00000000 00000000 00000000 255.0.0.0 /8

B 11111111 11111111 00000000 00000000 255.255.0.0 /16

C 11111111 11111111 11111111 00000000 255.255.255.0 /24

Page 21: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

23

Subnet Masks

Page 22: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

24

Example: Subnet Mask

Find the network ID of each of the following hosts with specified subnet masks:

IP: 192.168.5.3 Mask: 255.255.255.0

IP: 172.130.10.20 Mask: 255.255.255.0

IP: 192.168.10.5 Mask: 255.255.255.128

IP: 158.108.228.178 Mask: 255.255.240.0

Page 23: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

25

Outline

IP Address

CIDR

Page 24: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

26

Classless Inter-Domain Routing

CIDR - Classless Inter-Domain Routing

Introduced in 1993 to replace classful network design in the Internet

To slow the growth of routing tables on routers

To help slow the rapid exhaustion of IPv4 addresses

No longer restrict network addresses as one or more 8-bit groups

Page 25: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

27

CIDR Notation

Specifies mask with prefix size

More convenient than binary representation

Example:

NetID: 158.108.0.0 Subnet Mask: 255.255.0.0

CIDR notation: 158.108.0.0/16

Page 26: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

28

CIDR Host Address

Page 27: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

29

Example: CIDR Notation

Convert mask to corresponding prefix size

255.0.0.0

255.192.0.0

255.255.255.252

Convert prefix size to corresponding mask

/8

/12

/16

/20

/28

Page 28: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

30

Example: CIDR Notation

Find the network ID of each of the following hosts with specified prefix size:

IP: 192.168.5.3/24

IP: 172.130.10.20/18

Page 29: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

31

Special IP Addresses

Network Address all hosts = 0; e.g. 158.108.0.0/16

Directed Broadcast Address Broadcast to a specified network all hosts = 1; e.g. 158.108.255.255/16

Limited Broadcast Address Broadcast to local network all 1; e.g. 255.255.255.255

This computer Address all 0; e.g. 0.0.0.0

Loopback Address 127.0.0.0/8 127.x.x.x

Page 30: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

32

Loopback Addresses

Allow programmers to test the program logic quickly without needing two computers and without

sending packets across a network

During loopback testing no packets ever leave a computer the IP software forwards packets from one

application to another

The loopback address never appears in a packet traveling across a network

Page 31: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

33

Loopback Addresses

โปร เซส A โปร เซส A

/

Physical

127.0.0.1

โปร เซส A Process A

TCP/UDP

IP

Data Link

Loopback Interface

127.0.0.1

Other Addresses

Process B

Incoming packet to Loopback Interface

Outgoing packet from Loopback to Process

Page 32: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

34

Directed Broadcast Address

Use for sending to all nodes in class range

Class A broadcast example:

10.255.255.255

Class B broadcast example:

158.108.255.255

Class C broadcast example:

202.100.15.255

Page 33: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

35

Special IP Address

Page 34: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

36

Example: Subnet Design

You are given an IP address block

12.6.8.0/24

You want to divide this block into subnets

Subnet A to serve 28 hosts

Subnet B to serve 40 hosts

Subnet C to serve 70 hosts

List the designed subnets with the following information

(1) subnet ID, (2) mask, (3) first usable address, (4) last usable address, (5) directed broadcast address

Page 35: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

37

Example: Subnet Design

Design subnetting scheme

Subnet C (70 hosts)

Subnet A (28 hosts)

Subnet B (40 hosts)

Original /24 block

(256 addrs)

/25 block (128 addrs)

/26 block (64 addrs)

/26 block (64 addrs)

Page 36: Subnet Design and IP Addressing - Kasetsart Universitycpj/219321/slides/16-IpAddr.pdf · Introduced in 1993 to replace classful network design in the Internet To slow the growth of

38

Example: Subnet Design

Create summary table

Subnet SubNet ID Subnet Mask First Host IP Last Host IP Broadcast Addr

C 12.6.8.0 255.255.255.128 12.6.8.1 12.6.8.126 12.6.8.127

A 12.6.8.128 255.255.255.192 12.6.8.129 12.6.8.190 12.6.8.191

B 12.6.8.192 255.255.255.192 12.6.8.193 12.6.8.254 12.6.8.255