52
CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

  • View
    218

  • Download
    1

Embed Size (px)

Citation preview

Page 1: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

CSE452:Computer Networks

The Internet Protocol(IP)IPv4 & IPv6

CIDR, Subnet

Page 2: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-2

The Internet Network layer

routingtable

Host, router network layer functions:

Routing protocols•path selection•RIP, OSPF, BGP

IP protocol•addressing conventions•datagram format•packet handling conventions

ICMP protocol•error reporting•router “signaling”

Transport layer: TCP, UDP

Link layer

physical layer

Networklayer

Page 3: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-3

IP Addressing: introduction IP address: 32-bit

identifier for host, router interface

interface: connection between host, router and physical link router’s typically have

multiple interfaces host may have

multiple interfaces IP addresses

associated with interface, not host, router

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 11

Page 4: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-4

IP Addressing IP address:

network part (high order bits)

host part (low order bits)

What’s a network ? (from IP address perspective) device interfaces with

same network part of IP address

can physically reach each other without intervening router

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

network consisting of 3 IP networks(for IP addresses starting with 223, first 24 bits are network address)

LAN

Page 5: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-5

IP AddressingHow to find the

networks? Detach each

interface from router, host

create “islands of isolated networks

223.1.1.1

223.1.1.3

223.1.1.4

223.1.2.2223.1.2.1

223.1.2.6

223.1.3.2223.1.3.1

223.1.3.27

223.1.1.2

223.1.7.0

223.1.7.1223.1.8.0223.1.8.1

223.1.9.1

223.1.9.2

Interconnected system consisting

of six networks

Page 6: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-6

IP Addresses

0network host

10 network host

110 network host

1110 multicast address

A

B

C

D

class1.0.0.0 to127.255.255.255

128.0.0.0 to191.255.255.255

192.0.0.0 to223.255.255.255

224.0.0.0 to239.255.255.255

32 bits

given notion of “network”, let’s re-examine IP addresses:

“class-full” addressing:

Page 7: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-7

IP Addressing An IP address is a 32-bit sequence of 1s and 0s.

To make the IP address easier to use, the address is usually written as four decimal numbers separated by periods.

This way of writing the address is called the dotted decimal format.

Page 8: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-8

Decimal and Binary Conversion

Page 9: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-9

IPv4 Addressing

Page 10: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-10

Class A, B, C, D, and E IP Addresses

Page 11: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-11

Page 12: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-12

Reserved IP Addresses 1. Certain host addresses are reserved and cannot be assigned

to devices on a network. 2. An IP address that has binary 0s in all host bit positions

is reserved for the network address. 3. An IP address that has binary 1s in all host bit positions

is reserved for the broadcast address.

Page 13: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-13

Network Address

Page 14: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-14

Broadcast Address

Page 15: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-15

Public and Private IP Addresses 1. No two machines that connect to a public network can have the same IP

address because public IP addresses are global and standardized.

2. Procedure was needed to make sure that addresses were in fact unique.

3. Originally, an organization known as the Internet Network Information Center (InterNIC) handled this procedure. InterNIC no longer exists and has been succeeded by the Internet Assigned Numbers Authority (IANA).

4. IANA carefully manages the remaining supply of IP addresses to ensure that duplication of publicly used addresses does not occur.

5. However, private networks that are not connected to the Internet may use any host addresses, as long as each host within the private network is unique.

Page 16: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-16

Public and Private IP Addresses 1. RFC 1918 sets aside three blocks of IP addresses for private,

internal use.

2. Addresses that fall in these ranges are not routed on the Internet backbone. Internet router immediately discard private addresses.

3. Connecting a network using private addresses to the Internet requires translation of the private addresses to public addresses using Network Address Translation (NAT).

Page 17: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-17

IP addressing: CIDR Classful addressing:

inefficient use of address space, address space exhaustion

e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network

CIDR: Classless InterDomain Routing network portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in network

portion of address

11001000 00010111 00010000 00000000

networkpart

hostpart

200.23.16.0/23

Page 18: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-18

Millions of Addresses Available Over 16,000,000

Efficiency Non-subnetted networks are wasteful Division of networks not optimal

Smaller Network Easier to manage Smaller broadcast domains

So Make the network as small as possible Divide the network into subnetworks Borrow some bits from the host add.

Why Subnet?

Page 19: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-19

What You Need Understand Address System Understand Classes of Networks “Two-Tums” Table

Formulas Magic Numbers Subnet Mask

“ANDing” Process

Page 20: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-20

Dissecting the Address> Classes <

CLASS RANGES: A: 0 – 127 N . H . H . H

B: 128 – 191 N . N . H . H

C: 192 – 223 N . N . N . H

_ _ _ _ _ _ _ _ ._ _ _ _ _ _ _ _ ._ _ _ _ _ _ _ _ ._ _ _ _ _ _ _ _ 1 0 0 0 0 0 0 0 .0 0 0 1 0 0 0 0 .0 0 1 0 0 0 0 0. 0 0 0 0 1 1 0 1 (Digital)

128 . 16 . 32 . 13 (Decimal)

CLASSB

Page 21: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-21

TWO-TUMS

27 26 25 24 23 22 21 20

128 192 224 240 248 252 254 255

128 64 32 16 8 4 2 1

MAGIC NUMBERS:

SUBNET MASK:

Page 22: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-22

Magic Formulas

Number of Usable Subnets

2n – 220 - 2 = 1 - 2 = -121 - 2 = 2 - 2 = 022 - 2 = 4 - 2 = 223 - 2 = 8 - 2 = 6

Number of Usable Hosts/Subnet

2h-n – 228-0- 2 = 256 - 2 = 254

28-1- 2 =? 28-2- 2 = ?28-3- 2 =?

n = # borrowed bitsh = # bits available in host address

Page 23: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-23

Subnet Mask

What is a Subnet Mask?“Extended Network Prefix”Indicates extent of the Network numbers1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . _ _ _ _ _ _ _ _

Why is it needed?Used by router to determine Network

AddressHow?

Uses “ANDing” to compare Mask to IP Address

Page 24: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-24

ANDing Process

MASK: 11111111.11111111.11111111.00000000

255 . 255 . 255 . 0

IP: 11001000.11001000.11001000.00001010

200 . 200 . 200 . 10

Network Address: 11001000.11001000.11001000.00000000

200 . 200 . 200 . 0

Page 25: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-25

How to Subnet?* Subnet: Borrow

_ _ _ _ _ _ _ _ ._ _ _ _ _ _ _ _ ._ _ _ _ _ _ _ _ ._ _ _ _ _ _ _ _ 1 0 0 0 0 0 0 0 .0 0 0 1 0 0 0 0 .0 0 1 0 0 0 0 0. 0 0 0 0 1 1 0 1 (Digital)

128 . 16 . 32 . 13 (Decimal)

Page 26: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-26

Easy Example

Page 27: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-27

Set Up Subnets

200.200.200.10

5 Subnets

•What is the Subnet Mask?•What are the Network Addresses?•What is the Broadcast Domain•What IP Addresses are available?

Page 28: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-28

Steps….

1. What is the CLASS?2. How many BITS do we

need to borrow?3. Determine Subnet Mask

4. Determine “Magic Number”

5. Set up Table for IP Address (“Wire”), Range & Broadcast Domain

6. Fill in Table

1. C [Range: 192 – 223]]2. 5 Subnets 3 [23-2 =

6]

3. 255.255.255.224• Use Subnet Mask #• Borrow 3 Bits

4. 32

5. Wire Range BC

6.

Page 29: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-29

Table200.200.200.10

WIRE RANGE BC

Page 30: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-30

Table200.200.200.10

WIRE RANGE BC200.200.200.0

Class C

Borrow 5 Bits

Page 31: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-31

Table200.200.200.10

WIRE RANGE BC200.200.200.0

200.200.200.32

200.200.200.64

200.200.200.96

+.32

+.32

Magic Number

Page 32: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-32

Table200.200.200.10

WIRE RANGE BC200.200.200.0

200.200.200.32

200.200.200.64

200.200.200.96

200.200.200.128

200.200.200.160

200.200.200.192

200.200.200.224

Subnet Mask

Page 33: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-33

Table200.200.200.10

WIRE RANGE BC200.200.200.0 200.200.200.31

200.200.200.32 200.200.200.63

200.200.200.64

200.200.200.96

200.200.200.128

200.200.200.160

200.200.200.192

200.200.200.224

Page 34: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-34

Table200.200.200.10

WIRE RANGE BC200.200.200.0 200.200.200.31

200.200.200.32 200.200.200.63

200.200.200.64 200.200.200.95

200.200.200.96 200.200.200.127

200.200.200.128 200.200.200.159

200.200.200.160 200.200.200.191

200.200.200.192 200.200.200.223

200.200.200.224 200.200.200.255

Broadcast Domain

Page 35: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-35

Table200.200.200.10

WIRE RANGE BC200.200.200.0 200.200.200.31

200.200.200.32 200.200.200.63

200.200.200.64 200.200.200.95

200.200.200.96 200.200.200.127

200.200.200.128 200.200.200.159

200.200.200.160 200.200.200.191

200.200.200.192 200.200.200.223

200.200.200.224 200.200.200.225

Page 36: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-36

Table200.200.200.10

WIRE RANGE BC200.200.200.0 200.200.200.1 –

200.200.200.30200.200.200.31

200.200.200.32 200.200.200.33 – 200.200.200.62

200.200.200.63

200.200.200.64 200.200.200.65 – 200.200.200.94

200.200.200.95

200.200.200.96 200.200.200.97 - 200.200.200.126

200.200.200.127

200.200.200.128 200.200.200.129 – 200.200.200.158

200.200.200.159

200.200.200.160 200.200.200.161 – 200.200.200.190

200.200.200.191

200.200.200.192 200.200.200.193 – 200.200.200.222

200.200.200.223

200.200.200.224 200.200.200.225 – 200.200.200.254

200.200.200.255

Page 37: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-37

Table200.200.200.10

WIRE RANGE BC200.200.200.0 200.200.200.1 –

200.200.200.30200.200.200.31

200.200.200.32 200.200.200.33 – 200.200.200.62

200.200.200.63

200.200.200.64 200.200.200.65 – 200.200.200.94

200.200.200.95

200.200.200.96 200.200.200.97 - 200.200.200.126

200.200.200.127

200.200.200.128 200.200.200.129 – 200.200.200.158

200.200.200.159

200.200.200.160 200.200.200.161 – 200.200.200.190

200.200.200.191

200.200.200.192 200.200.200.193 – 200.200.200.222

200.200.200.223

200.200.200.224 200.200.200.225 – 200.200.200.254

200.200.200.255

Reserved forNetwork Addresses

Reserved forBroadcastAddresses

Page 38: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-38

Table200.200.200.10

WIRE RANGE BC

200.200.200.33 – 200.200.200.62

200.200.200.65 – 200.200.200.94

200.200.200.97 - 200.200.200.126

200.200.200.129 – 200.200.200.158

200.200.200.161 – 200.200.200.190

200.200.200.193 – 200.200.200.222

Page 39: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-39

Set Up Subnets

200.200.200.0

200.200.200.33 - .62

200.200.200.161 - .190

Page 40: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-40

Page 41: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-41

Obtaining an Internet Address

1.Static addressing Each individual device must be configured

with an IP address.

2.Dynamic addressing Reverse Address Resolution Protocol (RARP) Bootstrap Protocol (BOOTP) Dynamic Host Configuration Protocol (DHCP) DHCP initialization sequence Function of the Address Resolution Protocol ARP operation within a subnet

Page 42: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

Obtaining an IP Address1. A network host needs to obtain a globally unique address in

order to function on the Internet.

2. MAC has only significance only in LAN to identify host.

3. Router does not use MAC address(?) to forward packets outside LAN.

4. IP addresses are used for Internet communication.

5. IP is hierarchical addressing Scheme that allows individual addresses to be associated together and treated together.

Page 43: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-43

Obtaining an IP AddressRegardless of the method chosen no two interfaces can have the same IP

address.

Page 44: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-44

Static Assignment of an IP Address 1. Static assignment works best on small, infrequently changing

networks. 2. The system administrator manually assigns and tracks IP addresses

for each computer, printer, or server on the intranet. 3. Servers should be assigned a static IP address so workstations and

other devices will always know how to access needed services. 4. Other devices that should be assigned static IP addresses are network

printers, application servers, and routers.

Page 45: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-45

IP addresses: how to get one?

hard-coded by system admin in a file Wintel: control-panel->network->configuration->tcp/ip->properties

UNIX: /etc/rc.config

DHCP: Dynamic Host Configuration Protocol: dynamically get address: “plug-and-play” host broadcasts “DHCP discover” msg DHCP server responds with “DHCP offer” msg host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ack” msg

Page 46: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-46

DHCP client-server scenario

DHCP server

arriving DHCP client

223.1.2.5

Figure 4.4.2-N1: DHCP client-server scenario

Page 47: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-47

DHCP client-server scenario

DHCP server: 223.1.2.5 arriving client

time

DHCP discoversrc : 0.0.0.0, 68 dest.: 255.255.255.255,67DHCPDISCOVERyiaddr: 0.0.0.0transaction ID: 654

DHCP offersrc: 223.1.2.5, 67 dest: 223.1.2.4, 68DHCPOFFERyiaddrr: 223.1.2.4transaction ID: 654DHCP server ID: 223.1.2.5Lifetime: 3600 secs

DHCP requestsrc: 0.0.0.0, 68 dest:: 255.255.255.255, 67DHCPREQUESTyiaddrr: 223.1.2.4transaction ID: 655DHCP server ID: 223.1.2.5Lifetime: 3600 secs

DHCP ACKsrc: 223.1.2.5, 67 dest: 223.1.2.4, 68DHCPACKyiaddrr: 223.1.2.4transaction ID: 655DHCP server ID: 223.1.2.5Lifetime: 3600 secs

Page 48: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-48

DHCP IP Address Management • DHCP allows a host to obtain an IP address dynamically without the

network administrator having to set up an individual profile for each device.

• All that is required when using DHCP is a defined range of IP addresses on a DHCP server.

• As hosts come online, they contact the DHCP server and request an address.

• The DHCP server chooses an address and leases it to that host. • With DHCP, the entire network configuration of a computer can be

obtained in one message. • The major advantage that DHCP has over BOOTP is that it allows users to

be mobile. • This mobility allows the users to freely change network connections from

location to location. • The importance to this DHCP advancement is its ability to lease an IP

address to a device and then reclaim that IP address for another user after the first user releases it.

• This means that DHCP offers a one to many ratio of IP addresses and that an address is available to anyone who connects to the network.

Page 49: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-49

IP addresses: how to get one?

Network (network portion): get allocated portion of ISP’s address

space:ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23

Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23

Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23 ... ….. …. ….

Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

Page 50: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-50

Hierarchical addressing: route aggregation

“Send me anythingwith addresses beginning 200.23.16.0/20”

200.23.16.0/23

200.23.18.0/23

200.23.30.0/23

Fly-By-Night-ISP

Organization 0

Organization 7Internet

Organization 1

ISPs-R-Us“Send me anythingwith addresses beginning 199.31.0.0/16”

200.23.20.0/23Organization 2

...

...

Hierarchical addressing allows efficient advertisement of routing information:

Page 51: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-51

Hierarchical addressing: more specific routes

ISPs-R-Us has a more specific route to Organization 1

“Send me anythingwith addresses beginning 200.23.16.0/20”

200.23.16.0/23

200.23.18.0/23

200.23.30.0/23

Fly-By-Night-ISP

Organization 0

Organization 7Internet

Organization 1

ISPs-R-Us“Send me anythingwith addresses beginning 199.31.0.0/16or 200.23.18.0/23”

200.23.20.0/23Organization 2

...

...

Page 52: CSE452:Computer Networks The Internet Protocol(IP) IPv4 & IPv6 CIDR, Subnet

04/18/234a-52

IP addressing: the last word...

Q: How does an ISP get block of addresses?

A: ICANN: Internet Corporation for Assigned

Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes