3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery...

42
3 Het IP-Protocol

Transcript of 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery...

Page 1: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Het IP-Protocol

Page 2: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

IP-protocol Services

Routing

Multiple client protocols

Datagram delivery

Independant from the Network Interface Layer

Fragmentation and reassembly

Extensible through IP options

Packet switching technology

Page 3: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

IP Header

20 bytes

4-bitversion

4-bit hea-der length

8-bit type of service(TOS)

16-bit total length (in bytes)

16-bit identification3-bitflag 13-bit fragment offset

8-bit time to live (TTL)

8-bit protocol 16-bit header checksum

32-bit source IP address

32-bit destination IP address

Options (if any)

data

0 15 16 31

Page 4: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Wat is een IP Address?

133.120.75.8

86

131.107.0.0131.107.0.0

131.107.3.27

133.120.0.0133.120.0.0

129.102.12.7

129.102.0.0

129.102.16.2

90

94

MARIA AVEMARIA AVE

Page 5: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Conversie IP Adres van Binair naar Decimaal Formaat

11 11 11 11 11 11 11 11

128128 6464 3232 1616 88 44 22 11

8 Bits

255 Decimal Value

Page 6: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Netwerk ID en Host ID

Network ID Host ID

32 Bits

w. x. y. z.

131.107.3.24Example:

Class B

Page 7: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Address Classes

Class C

w x y z

Class ANetwork

IDHost ID

0

Class BNetwork ID Host ID

1 0

Network ID Host ID

1 1 0

Numberof Networks

126

16,384

2,097,152

Number of Hosts

per Network

16,777,214

65,534

254

Page 8: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Address Class Summary

NumberNumberof Networksof Networks

NumberNumberof Networksof Networks

126126

16,38416,384

2,097,1522,097,152

Number of HostsNumber of Hostsper Networkper Network

Number of HostsNumber of Hostsper Networkper Network

16,777,21416,777,214

65,53465,534

254254

Class AClass AClass AClass A

Class BClass BClass BClass B

Class CClass CClass CClass C

Range ofRange ofNetwork IDs Network IDs (First Octet)(First Octet)

Range ofRange ofNetwork IDs Network IDs (First Octet)(First Octet)

1 – 1261 – 126

128 – 191128 – 191

192 – 223192 – 223

Page 9: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Assigning Network IDs

Router

AA CC BB

124.x.y.z124.x.y.z 192.121.73.z192.121.73.z 131.107.y.z131.107.y.z

Router

Page 10: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Network Addressing Guidelines

Network ID Must Be Unique

127 Is Reserved for Diagnostic Loopback Functions

Network ID Cannot Be all 255 (All Bits Set to 1)

255 is a broadcast address

Network ID Cannot Be all 0 (All Bits Set to 0)

0 indicates a local network

Page 11: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Assigning Host IDs

Router Router

124.0.0.27124.0.0.27

124.0.0.28124.0.0.28

124.0.0.29124.0.0.29

131.107.24.27131.107.24.27

131.107.24.28131.107.24.28

131.107.24.29131.107.24.29

192.121.73.1192.121.73.1

124.0.0.1124.0.0.1 192.121.73.2192.121.73.2

131.107.24.1131.107.24.1

124.x.y.z124.x.y.z 192.121.73.z192.121.73.z 131.107.24.z131.107.24.z

AA CC BB

Page 12: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Host Addressing Guidelines

Host ID Must Be Unique to the Network ID

Host ID Cannot Be 255 (All Bits Set to 1)

255 is a broadcast address

Host ID Cannot Be 0 (All Bits Set to 0)

0 means “this network only”

Page 13: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Common Addressing Problems

Network IDs on the Local Network Don’t Match

Local hosts cannot communicate

Host IDs on the Local Network Are Duplicate

Windows NT–based hosts cannot initialize

Other TCP/IP-based hosts may not be able to communicate

Other TCP/IP-based hosts could hang

Page 14: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

How to choose/assign IP-addresses ?

Internet Service Provider

ICANN - Internet Corporation for Assigned Names and Number

RIPE – ARIN – APNIC – LACNIC - AfriNIC

Private Address Space (RFC 1918)

10.0.0.0 - 10.255.255.255

172.16.0.0 - 172.31.255.255

192.168.0.0 - 192.168.255.255

Page 15: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Loopback interface

127.0.0.1

name localhostIP outputfunction

IP inputfunction

Place on IPinput queue

Loopback driver

Ethernet driver

Dest. IP = broadcast ormulticast ?

Place on IPinput queue

yes

Dest. IP = interfaceaddress ?

noyes

Ethernet

IP driver

Page 16: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Exercise

Page 17: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Excercise

Connect two pc’s to a hub and assign an ip-address from the same network. Issue a ping command from one to the other. Do the same with ip-addresses from different networks

Find the public address space assigned to your company (or any company that you know)

Page 18: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

The Domain Name System

An Alias Used to Reference a TCP/IP Host

A Fully Qualified Domain Name (FQDN)

Example: ftp.microsoft.com

Provides a Simplified Way to Access a TCP/IP Host

Used by Ping and Other TCP/IP Utilities

Entries Are Stored in the HOSTS File or DNS

Viewed with the nslookup Utility

Page 19: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

IP addressing summary

Network part: all host bits 0

193.58.9.0

First ip address :

193.58.9.1

Broadcast address: all host bits 1

193.58.9.255

Page 20: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Overview Subnetting

What Is a Subnet?

Subnet Addressing

What Is a Subnet Mask?

Defining a Subnet Mask

Defining Network IDs for an Internetwork

Defining Host IDs for Subnets

Page 21: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

What Is a Subnet Mask?

Distinguishes the Network ID from the Host ID

Used to Specify Whether the Destination Host is Local or Remote

Page 22: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Default Subnet Masks (No Subnetting)

Bits Used for Subnet MaskBits Used for Subnet MaskAddressAddressClassClass

Dotted DecimalDotted DecimalNotationNotation

Dotted DecimalDotted DecimalNotationNotation

Class A

Class B

Class C

Class A

Class B

Class C

11111111 00000000 00000000 00000000

11111111 11111111 00000000 00000000

11111111 11111111 11111111 00000000

11111111 00000000 00000000 00000000

11111111 11111111 00000000 00000000

11111111 11111111 11111111 00000000

255.0.0.0

255.255.0.0

255.255.255.0

255.0.0.0

255.255.0.0

255.255.255.0

Class B ExampleClass B Example

16.200131.107.

0.0255.255.

131.107.

w.x.

IP Address

Subnet Mask

Network ID

Host ID 16.200

y.z

Page 23: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

10011111 11100000 00000111 10000001

11111111 11111111 00000000 00000000

10011111 11100000 00000111 10000001

11111111 11111111 00000000 00000000

10011111 11100000 00000000 0000000010011111 11100000 00000000 00000000

IP Address

Subnet Mask

IP Address

Subnet Mask

ResultResult

How IP Determines If a Packet Is Destined Locally or Remotely

Local IP and Destination IP are ANDed with Mask 1 AND 1 = 1 Other combinations = 0

If ANDed results of source and destination hosts match, the destination is local

Page 24: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Problem : Waste of address space !

Inefficient use of address space

193.107.8.z193.107.8.z

193.107.16.z193.107.16.z

193.107.24.z193.107.24.z

193.107.8.1193.107.8.1 193.107.16.2193.107.16.2 193.107.16.1193.107.16.1 193.107.24.1193.107.24.1

A BWe only use 2 address out of

254

We only use 2 address out of

254

Page 25: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

How is subnetting done?131.107.3.27131.107.3.27

Subnet 1Subnet 1131.107.131.107.1010.0.0

255.255.255.255.255255.0.0

Subnet 1Subnet 1131.107.131.107.1010.0.0

255.255.255.255.255255.0.0

131.107.10.12131.107.10.12

Subnet 2Subnet 2131.107.131.107.33.0.0

255.255.255.255.255255.0.0

Subnet 2Subnet 2131.107.131.107.33.0.0

255.255.255.255.255255.0.0

131.107.12.7131.107.12.7

131.107.12.0

131.107.12.31131.107.12.31

Main Network

Borrow bits from host part

All hosts on same segment have same subnet number

Subnet 3Subnet 3131.107.131.107.1212.0.0

255.255.255.255.255.255.00

Subnet 3Subnet 3131.107.131.107.1212.0.0

255.255.255.255.255.255.00

Page 26: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Examples of a Custom Subnet Mask (Subnetting)

Bits Used for Subnet MaskBits Used for Subnet MaskAddressAddressClassClass

Dotted DecimalDotted DecimalNotationNotation

Dotted DecimalDotted DecimalNotationNotation

Class ?

Class ?

Class ?

Class ?

11111111 11111111 00000000 00000000 11111111 11110000 00000000 00000000

11111111 11111111 11111111 0000000011111111 11111111 11110000 00000000

11111111 11111111 00000000 00000000 11111111 11110000 00000000 00000000

11111111 11111111 11111111 0000000011111111 11111111 11110000 00000000

255.255.0.0255.240.0.0

255.255.255.0255.255.240.0

255.255.0.0255.240.0.0

255.255.255.0255.255.240.0

Class B ExampleClass B Example

131.107.16.

255.255.255.

131.107.

w.x.

IP Address

Subnet Mask

Network ID

Subnet ID

Host ID w.x.y.

200

0

y.z

16.

200

z

Page 27: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

IP Addresses

131.107.35.200131.107.61.26

Subnet Mask

Using the Subnet Mask to Determine If a Host Is Local or Remote

Comparing Two Network IDs Does Not Always Indicate a Local or Remote Host

Example 1

153.170.37.16217.170.172.233

Example 2

131.107.35.200131.107.61.26

Compare Both Addresses to a Subnet Mask to Determine Location

255.255.0.0, or255.255.255.0

Same Network?

YesNo

Page 28: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Determining the Number of Subnet Mask Bits

Class BNetwork ID Host ID

1

SubnetMask

Number of Subnets

0

2 . . . 254

Number of Hosts

Subnet Mask

Host ID

16,382 . . . . . . 254

Page 29: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Defining a Subnet Mask

Determine the Number of Subnets

Convert the Number of Subnets to Binary

Convert the Required Number of Bits to Decimal (High Order)

11

22

33

Example of Class B Address

Number of SubnetsNumber of Subnets

Binary ValueBinary Value

Convert to DecimalConvert to Decimal

6

0 0 0 0 0 1 1 0

= 6

(3 Bits)

4+2

255 . 255 . 224 . 011111111 11111111 11100000 00000000

3

Page 30: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Shortcut to Defining Network IDs

List the Number of Bits (High Order) Used for Subnet Mask

Convert the Bit with the Lowest Value to Decimal

Increment the Value for Each Bit Combination

1110000011100000

3232

w.x.32.1 w.x.63.254

w.x.64.1 w.x.95.254

11

22

330+ 32= 32+ 32= 64+ 32= 96 + 32= 128+ 32= 160

w.x.96.1 w.x.127.254

w.x.128.1 w.x.159.254

w.x.160.1 w.x.192.254

Page 31: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Defining Host IDs for a Subnet

Subnet IDsSubnet IDs Host ID RangeHost ID Range

“Invalid”x.y.32.1 – x.y.63.254x.y.64.1 – x.y.95.254x.y.96.1 – x.y.127.254x.y.128.1 – x.y.159.254x.y.160.1 – x.y.191.254x.y.192.1 – x.y.223.254“Invalid”

“Invalid”x.y.32.1 – x.y.63.254x.y.64.1 – x.y.95.254x.y.96.1 – x.y.127.254x.y.128.1 – x.y.159.254x.y.160.1 – x.y.191.254x.y.192.1 – x.y.223.254“Invalid”

00000000 = 000100000 = 3201000000 = 6401100000 = 9610000000 = 12810100000 = 16011000000 = 19211100000 = 224

00000000 = 000100000 = 3201000000 = 6401100000 = 9610000000 = 12810100000 = 16011000000 = 19211100000 = 224

Each Subnet ID Indicates the Beginning Value in a Range

The Ending Value Is One Less Than the Beginning Value of the Next Subnet ID

Page 32: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Subnet Addressing

Determine the Number of Required Network IDs

One for each subnet

One for each wide area network connection

Determine the Number of Required Host IDs per Subnet

One for each TCP/IP host

One for each router interface

Define One Subnet Mask Based on Requirements

Define a Unique Network ID for Each Subnet Based on the Subnet Mask

Define Valid Host IDs for Each Subnet Based on the Network ID

Page 33: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Exercise: Subnetting

Page 34: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Example : Assign subnets

210.10.10.0/24

10

10

10

Page 35: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Excercise : Assign subnets (subnet zero is valid)

TokenRing

Internet

TokenRing

100100

100

193.58.2.0 / 24

28

505050

10

40

193.58.1.0 /24

6

193.58.3.0 / 24

2 2

40

Page 36: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Solution

Network #bits Mask #hosts First Last Broadcast

193.58.9.0 24 255.255.255.0 254 193.58.9.1 193.58.9.254 193.58.9.255

193.58.9.0 25 255.255.255.128 126 193.58.9.1 193.58.9.126 193.58.9.127

193.58.9.128 25 255.255.255.128 126 193.58.9.129 193.58.9.254 193.58.9.255

100100

193.58.2.0 / 24193.58.1.0 /24

193.58.3.0 / 24

11111111 11111111 11111111 10000000

255 . 255 . 255 . 128

Page 37: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Excercise : Assign subnets (subnet zero is valid)

TokenRing

Internet

TokenRing

193.58.1.0 /25

193.58.1.128 /25

193.58.2.0 /25

193.58.2.0 / 24

193.58.3.192 / 27

193.58.3.0 / 26

193.58.2.192 /26

193.58.2.128 /26

193.58.3.224 / 28

193.58.3.64 / 26

193.58.1.0 /24

193.58.3.240 / 29

193.58.3.0 / 24

193.58.3.248 / 30

193.58.3.252 / 30

193.58.3.128 / 26

Page 38: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

50

Internet

192.168.1.0 / 24

10

2030

40

Excercise : Assign subnets (subnet zero is valid)

Page 39: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Exercise

25.158.7.89/19

Define network mask

Define network

Define first ip address

Define last ip address

Define broadcast address

Page 40: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Review

What Is a Subnet?

Subnet Addressing

What Is a Subnet Mask?

Defining a Subnet Mask

Defining Network IDs for an Internetwork

Defining Host IDs for Subnets

Page 41: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Commands netstat

Network connections and routing table Unix - Windows NT

ifconfig

interface information Unix

winipcfg

Windows 95/98 ipconfig

Windows NT/2000

Page 42: 3 Het IP-Protocol. 3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation.

3

Classless Interdomain Routing (CIDR)

Exhaustion IP address space

No class A - B and C

w.x.y.z/s with 1 <= s < = 32

Route aggregation