4 IP Address (IPv4) A unique 32-bit number Identifies an interface (on a host, on a router, …) ...

59

Transcript of 4 IP Address (IPv4) A unique 32-bit number Identifies an interface (on a host, on a router, …) ...

Page 1: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 2: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 3: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 4: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

4

IP Address (IPv4) A unique 32-bit number Identifies an interface (on a host, on a

router, …) Represented in dotted-quad notation

00001100 00100010 10011110 00000101

12 34 158 5

Page 5: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 6: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 7: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 8: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 9: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 10: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 11: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 12: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 13: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 14: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 15: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 16: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 17: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 18: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 19: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 20: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 21: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 22: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Network ID, Host ID, Gateway

Page 23: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Netmask خط فرضی =

Page 24: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 25: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Network Layer Addressing

IP addresses

0network host

10 network host

110 network host

1110 multicast address

A

B

C

D

class

1.0.0.0 to127.255.255.255

128.0.0.0 to191.255.255.255

192.0.0.0 to239.255.255.255

240.0.0.0 to247.255.255.255

32 bits

Page 26: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Internet Classes

10011101 10001111 11111100 11001111 (Class B) 11011101 10001111 11111100 11001111 (Class C) 01111011 10001111 11111100 11001111 (Class A) 11101011 10001111 11111100 11001111 (Class D) 11110101 10001111 11111100 11001111 (Class E) Class A, B are full; class C still has available addresses; D is

reserved for multicasting and class E is reserved for future use

Page 27: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Network Layer Addressing

Subnetting class C address Only 8 bits are available for hosts :

possible subnet masks are: 10000000 = 128 11000000 = 192 11100000 = 224 11110000 = 240 11111000 = 248 11111100 = 252 11111110 = 254

Page 28: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

28

IP Address and a 24-bit Subnet Mask

00001100 00100010 10011110 00000101

12 34 158 5

11111111 11111111 11111111 00000000

255 255 255 0

Address

Mask

Page 29: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 30: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

30

Scalability Improved Number related hosts from a common

subnet 1.2.3.0/24 on the left LAN 5.6.7.0/24 on the right LAN

host host host

LAN 1

... host host host

LAN 2

...

router router routerWAN WAN

1.2.3.4 1.2.3.7 1.2.3.156 5.6.7.8 5.6.7.9 5.6.7.212

1.2.3.0/24

5.6.7.0/24

forwarding table

Page 31: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

31

Classless Inter-Domain Routing (CIDR)

IP Address : 12.4.0.0 IP Mask: 255.254.0.0

00001100 00000100 00000000 00000000

11111111 11111110 00000000 00000000

Address

Mask

for hosts Network Prefix

Use two 32-bit numbers to represent a network. Network number = IP address + Mask

Written as 12.4.0.0/15

Page 32: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

32

CIDR: Hierarchal Address Allocation

12.0.0.0/8

12.0.0.0/16

12.254.0.0/16

12.1.0.0/1612.2.0.0/1612.3.0.0/16

:::

12.3.0.0/2412.3.1.0/24

::

12.3.254.0/24

12.253.0.0/1912.253.32.0/1912.253.64.0/1912.253.96.0/1912.253.128.0/1912.253.160.0/19

:::

• Prefixes are key to Internet scalability– Address allocated in contiguous chunks (prefixes)– Routing protocols and packet forwarding based on prefixes– Today, routing tables contain ~150,000-200,000 prefixes

Page 33: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

33

Scalability: Address Aggregation

Provider is given 201.10.0.0/21

201.10.0.0/22 201.10.4.0/24 201.10.5.0/24 201.10.6.0/23

Provider

Routers in the rest of the Internet just need to know how to reach 201.10.0.0/21. The provider can direct the IP

packets to the appropriate customer.

Page 34: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Netmasks and IP addresses

The netmask splits the IP address into the network part and the host part.

The address is and-ed with the netmask to determine the two parts

E.g – 141.163.143.231 , netmask 255.255.192.0

IP: 10001101.10100011.10001111.11100111Mask: 11111111.11111111.11000000.00000000Net: 10001101.10100011.10000000.00000000Host: 00000000.00000000.00001111.11100111

Net: 141.163.128.0Host: 127.231 (less used)

Page 35: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

© 2000, Cisco Systems, Inc. www.cisco.com BSCN v1.0—3-35

Host AddressesHost Addresses

172.16.2.1

172.16.3.10

172.16.12.12

10.1.1.1

10.250.8.11

10.180.30.118

E1

172.16 12 12

Network Host

. . Network Interface

172.16.0.0

10.0.0.0

E0

E1

Routing Table

172.16.2.1

10.6.24.2

E0

Page 36: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

© 2000, Cisco Systems, Inc. www.cisco.com BSCN v1.0—3-36

IP AddressingIP Addressing223.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 37: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

© 2000, Cisco Systems, Inc. www.cisco.com BSCN v1.0—3-37

IP AddressingIP Addressing

How 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 38: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

© 2000, Cisco Systems, Inc. www.cisco.com BSCN v1.0—3-38

Getting a datagram from source to dest.Getting a datagram from source to dest.

IP datagram:

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

A

BE

miscfields

sourceIP addr

destIP addr data

datagram remains unchanged, as it travels source to destination

addr fields of interest here

Dest. Net. next router Nhops

223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2

routing table in A:

Page 39: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

© 2000, Cisco Systems, Inc. www.cisco.com BSCN v1.0—3-39

Getting a datagram from source to dest.Getting a datagram from source to dest.

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

A

BE

Starting at A, given IP datagram addressed to B:

look up net. address of B find B is on same net. as A link layer will send datagram

directly to B inside link-layer frame B and A are directly

connected

Dest. Net. next router Nhops

223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2

miscfields223.1.1.1223.1.1.3data

Page 40: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

© 2000, Cisco Systems, Inc. www.cisco.com BSCN v1.0—3-40

Getting a datagram from source to dest.Getting a datagram from source to dest.

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

A

BE

Dest. Net. next router Nhops

223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2Starting at A, dest. E:

look up network address of E E on different network

A, E not directly attached routing table: next hop router to

E is 223.1.1.4 link layer sends datagram to

router 223.1.1.4 inside link-layer frame

datagram arrives at 223.1.1.4 continued…..

miscfields223.1.1.1223.1.2.2 data

Page 41: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

© 2000, Cisco Systems, Inc. www.cisco.com BSCN v1.0—3-41

Getting a datagram from source to dest.Getting a datagram from source to dest.

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

A

BE

Arriving at 223.1.4, destined for 223.1.2.2 look up network address of E E on same network as router’s interface

223.1.2.9 router, E directly attached

link layer sends datagram to 223.1.2.2 inside link-layer frame via interface 223.1.2.9

datagram arrives at 223.1.2.2!!! (hooray!)

miscfields223.1.1.1223.1.2.2 data network router Nhops interface

223.1.1 - 1 223.1.1.4 223.1.2 - 1 223.1.2.9

223.1.3 - 1 223.1.3.27

Dest. next

Page 42: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Netmasks - the easy way

The scope of a network is defined by the network mask:

Class B network exampleAddress: 137.17.0.0 Mask: 255.255.0.0

Class C network exampleAddress: 196.14.37.0Mask: 255.255.255.0

Scope:

137.17.0.1 - 137.17.254.254

Scope:

196.14.37.1 - 196.14.37.254

Page 43: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

Router’s operations

At each hop the data link layer frame is changed but the packets above never change

Page 44: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

44

Are 32-bit Addresses Enough? Not all that many unique addresses

232 = 4,294,967,296 (just over four billion) Plus, some are reserved for special purposes And, addresses are allocated in larger blocks

And, many devices need IP addresses Computers, PDAs, routers, tanks, toasters, …

Long-term solution: a larger address space IPv6 has 128-bit addresses (2128 = 3.403 × 1038)

Short-term solutions: limping along with IPv4 Private addresses Network address translation (NAT) Dynamically-assigned addresses (DHCP)

Page 45: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 46: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.

46

IPv6 Header compared to IPv4 Header

Ver.

Time toLive

Source Address

Total LengthType ofService

HdrLen

Identification FragmentOffsetFlg

Protocol HeaderChecksum

Destination Address

Options...

Ver. TrafficClass

Source Address

Payload Length NextHeader

HopLimit

Destination Address

HdrLen

Identification FragmentOffsetFlg

HeaderChecksum

Options...

shaded fields have no equivalent in theother version

IPv6 header is twice as long (40 bytes) asIPv4 header without options (20 bytes)

Flow LabelFlow Label

Page 47: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 48: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 49: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 50: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 51: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 52: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 53: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 54: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 55: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 56: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 57: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 58: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.
Page 59: 4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation 0000110000100010.