Internet Addressing - Katedra za telekomunikacije

39
1 Internet Addressing ? Mr Nenad Krajnović E-mail: [email protected]

Transcript of Internet Addressing - Katedra za telekomunikacije

1

Internet Addressing

?Mr

Nenad Krajnović

E-mail: [email protected]

2

What is an IP Address?

• 32-bit number, defined by the Internet Protocol (IP) (RFC 791).• IP addresses must be unique within the network.• One IP address may point to:

– one and only one destination on the Internet (unicast), or:– one and only one group of destinations (multicast).

• IP addresses are 32-bit integers, oftenly written in 4-octet form:

147.91.8.6• IP address distribution is coordinated in hierarchical manner.• End users receive their address space from their ISP!

How many IP addresses exists?

• Since 32-bits are used for IP addresses, maximum number of IP addresses is:

4.294.967.296

• Complete address range can not be used for host addressing!

4

IP Address Structure

• IP address consists of two parts:

147.91.8.6

10010011 01011011 00001000 00000110Network prefix

(m bits)Host id

(32-m bits)

5

Network Address

• Addresses all hosts on a network segment:

147.91.8.0 /24

10010011 01011011 00001000 00000000Network prefix

(m bits)Host id

(32-m zeros)

/24 - denotes prefix length (m = 24)

6

Subnet mask

• Subnet mask - a way of keeping information about prefix length.

255.255.255.0

11111111 11111111 11111111 00000000Network prefix

(m ones)Host id

(32-m zeros)

7

Broadcast Address

• Used by IP to broadcast data to all hosts on a given subnet.

147.91.8.255 /24

10010011 01011011 00001000 11111111Network prefix

(m bits - network prefix)Host id

(32-m ones)

/24 - denotes the prefix length (m = 24)

8

IP Address Structure - a Review (Repetitio mater studiorum est)

• IP adress:

10010011 01011011 00001000 00000110 147.91.8.6

10010011 01011011 00001000 00000000 147.91.8.0 /24

• Network address:

11111111 11111111 11111111 00000000 255.255.255.0

• Subnet mask:

10010011 01011011 00001000 11111111 147.91.8.255 /24

• Broadcast address:

9

Another Example ...

• Prefix length does notdoes not have to be on octet boundaries:

147.91.9.65 /2610010011 01011011 00001001 01000001

Network prefix(m=26 bits)

Host id(6 bits)

/26 - denotes the prefix length (m = 26)

10

Another Example - Review

• IP adress:

10010011 01011011 00001001 01000001 147.91.9.65 /26

10010011 01011011 00001001 01000000 147.91.9.64 /26

• Network address:

11111111 11111111 11111111 11000000 255.255.255.192

• Subnet mask:

10010011 01011011 00001001 01111111 147.91.9.127 /26

• Broadcast address:

Addressing in the LAN

147.91.9.64/26

147.91.9.66147.91.9.67

147.91.9.68

147.91.9.69

147.91.9.70 147.91.9.71

147.91.9.65

147.91.9.126

147.91.9.72147.91.9.100 147.91.9.101

Addressing in the LAN (VLAN)

VLAN 1

10.10.5.0/24

VLAN 2

147.91.8.0/24

VLAN 8

147.91.9.0/24

VLAN 215

147.91.16.0/23

10.10.5.1147.91.8.5147.91.9.1147.91.16.1

Addressing in the WAN

21.15.4.0/30

21.15.4.1

21.15.4.218.240.6.1

18.240.6.2

18.240.6.0/30

21.15.4.4/30

21.15.4.6

21.15.4.521.15.4.9

21.15.4.10

21.15.4.8/30

21.15.4.12/30

21.15.4.13

21.15.4.14

Why we are using network addresses?

147.91.9.64/26

147.91.9.66147.91.9.67

147.91.9.68

147.91.9.69

147.91.9.70 147.91.9.71

147.91.9.65

147.91.9.126

147.91.9.72147.91.9.100 147.91.9.101

eth0

147.91.9.64/26

147.91.9.66147.91.9.67

147.91.9.68

147.91.9.69

147.91.9.70 147.91.9.71

147.91.9.65

147.91.9.126

147.91.9.72147.91.9.100 147.91.9.101

eth0

Routing table

147.91.9.65 -> eth0147.91.9.66 -> eth0147.91.9.67 -> eth0147.91.9.68 -> eth0147.91.9.69 -> eth0147.91.9.70 -> eth0147.91.9.71 -> eth0147.91.9.72 -> eth0147.91.9.73 -> eth0147.91.9.74 -> eth0…

Routing table

147.91.9.64/26 -> eth0

15

IP Address Classification

• Total available address space: 0.0.0.0 0.0.0.0 -- 255.255.255.255255.255.255.255.• We can classify addresses according to the following criteria:

–– Classes:Classes:– A, B, C, D, E class networks. Classes are now obsoleted!

–– Usage:Usage:– Public IP addresses (globally routeable, unique and non-reusable).– Private IP addresses (routeable in private networks only).– Special IP addresses (reserved, broadcast, multicast etc. networks).

–– Validity:Validity:– Provider aggregatable (valid until the ISP-User agreement is valid).– Provider independent (valid until initial criteria for their assignment

are met).

16

Network Prefix Length - m

• Prefix length may be determined:– Automatically, depending on the address class - A, B, C, D, E (classful).– Arbitary, depending on the ISP and customer network topology (CIDR).

• It defines the maximum number of addresses available to the user:

6553665536 /16/16 65536 addresses256256 /24/24 256 addresses

6464 /26/26 64 addresses

16 bits24 bits26 bits

• Assigned network prefix length may be expanded (subnetting)

17

Classful Addressing

• Today mostly obsoleted, used only by some routing protocols.• Classful addressing was created in the past to ease allocations.• IP adress space is divided to 5 IP adress classes - A, B, C, D i E:

0 remaining 31 bits 0.0.0.0 - 127.255.255.255A10 remaining 30 bits 128.0.0.0 - 191.255.255.255B110 remaining 29 bits 192.0.0.0 - 223.255.255.255C1110 remaining 28 bits 224.0.0.0 - 239.255.255.255D1111 remaining 28 bits 240.0.0.0 - 255.255.255.255E

18

Prefix Length and Classes

Class IP range Start IP address m Subnet maskA 0/1 0.0.0.0 8 255.0.0.0B 128/2 128.0.0.0 16 255.255.0.0C 192/3 192.0.0.0 24 255.255.255.0D 224/4 224.0.0.0 - -E 240/4 240.0.0.0 - -

• Older routing protocols determined prefix length (m) by the class.• Newer routing protocols explicitly transmit prefix length.

19

Classful Subnetting

• A customer is assigned an IP network on class boundaries:

147.91.147.91.0.00.0 /16/16 (6553465534 hosts)

• The customer might expand the network prefix length, e.g.:

1316 /19/193 66 subnets, 81908190 hosts/subnet

1216 /20/204 1414 subnets, 40944094 hosts/subnet

816 /24/248 254254 subnets, 254254 hosts/subnet

• Subnet number of all 0’s and all 1’s is not allowed by default.• To allow all 0’s and all 1’s to be subnet numbers, routers must be

configured for that.

Why Classful Addressing?

• Routing protocols did not transport information about netmask to conserve necessary bandwidth on the links.

• With implicit definition of netmask, it was easier to implement routing protocols.

• Estimated number of hosts on the network was much less then available address space.

21

Drawbacks of Classful Addressing

• The customer must always be assigned a classful network.

• Classful addressing is a waste of address space:– Formerly, users with more than 254 hosts had been assigned a B class.– At the end of 1992, 70% of B class space was assigned.

• A route to each classful subnet must be specified separately:– If an ISP had 254 customers, with addresses:

193.1.1.0, 193.1.2.0, 193.1.3.0 … 193.1.254.0254 separate route entries should be entered in the global routing table!

• These drawbacks led to a better solution - CIDR!

22

Classless Addressing (CIDR)

• Basis for classless inter-domain routing (CIDR).• A customer is assigned an IP network on arbitary boundaries, e.g.:

1319 195.91.160.0195.91.160.0 /19/19 (81928192 hosts)

• The customer might expand the network prefix length, e.g.:

819 /24/245 3232 subnets, 254254 hosts/subnet

• Subnet number of all 0’s and all 1’s is allowed by default.• At the time of introduction of classless routing, it was necessary to

additionally configure routers to support it.

23

Advantages of Classless Addressing

• The customer does not need to be assigned a classful network.• Classful addressing saves address space:

– Formerly, users with more than 254 hosts had been assigned a B class.– Now, they are assigned multiple “C class” networks (/23, /22, /21 etc.).

• Routes could be aggregated easily:– If an ISP had 254 customers, with addresses:

193.1.1.0, 193.1.2.0, 193.1.3.0 … 193.1.254.0they will need a single entry in the routing table - 193.1.0.0 /16 !!!193.1.0.0 /16 !!!

• Classless addressing (CIDR) introduced a better model of global address distribution process, defined by the RFC 2050RFC 2050.

24

FLSM vs VLSM Subnetting

Fixed length subnet mask subnetting (FLSM):• Typical in classful environments.• Needed by older routing protocols, like RIPv1.• All network segments should have the same network masks (prefixes).• Not practical, when the network has a lot of segments, divided by routers.• It may result in non-economical solutions (say, a /24 for a point-to-point link!).

Variable length subnet mask subnetting (VLSM):• Supported by major routing protocols today.• Allows network segments, separated by routers, to have variable prefixes.• Very practical, even in the point-to-point case (/30 assigned usually).• Smaller percentage of address space loss (for reserved addresses).

25

Example Network Topology

Ethernet

Ethernet

Ethernet

Repeater

Accessserver

Embeddedrouter

Router Router

Dial-in x 10

Total of 200hosts

100hosts

50 PCs

50 PCs

40 PCs

35 PCs

30 PCs

20 PCs

PPP (unnumbered)

1

23

4

5

6

7

8

9

26

Fixed-length Subnet Masks

Ethernet

Ethernet

Ethernet

Repeater

Accessserver

Embeddedrouter

Router Router

10.0.0.3 10.0.0.12

10.0.0.50 10.0.0.0/24

10.0.0.0/24

Dial-in x 1010.0.9.0 /24

10.0.0.77

10.0.1.77 10.0.1.21 10.0.1.0/24

10.0.1.78 10.0.1.7950 PCs - 10.0.2.0/24

50 PCs - 10.0.3.0/24

40 PCs - 10.0.4.0/24

35 PCs - 10.0.5.0/24

30 PCs - 10.0.6.0/24

20 PCs - 10.0.7.0/24

PPP (unnumbered)

27

Addressing Plan - FLSM

i hosts Max addr Start address Prefix Subnet mask Broadcast 1 200 254 10.0.0.0 /24 255.255.255.0 10.0.0.255 2 100 254 10.0.1.0 /24 255.255.255.0 10.0.1.255 3 50 254 10.0.2.0 /24 255.255.255.0 10.0.2.255 4 50 254 10.0.3.0 /24 255.255.255.0 10.0.3.255 5 40 254 10.0.4.0 /24 255.255.255.0 10.0.4.255 6 35 254 10.0.5.0 /24 255.255.255.0 10.0.5.255 7 30 254 10.0.6.0 /24 255.255.255.0 10.0.6.255 8 20 254 10.0.7.0 /24 255.255.255.0 10.0.7.255 9 10 254 10.0.8.0 /24 255.255.255.0 10.0.8.255

Network address and broadcast address can Network address and broadcast address can NOTNOT be used for host be used for host

addressing!addressing!

28

Variable-length Subnet Masks (VLSM)

Ethernet

Ethernet

Ethernet

Repeater

Accessserver

Embeddedrouter

Router Router

10.0.0.3 10.0.0.12

10.0.0.50 10.0.0.0/24

10.0.0.0/24

Dial-in x 1010.0.2.192/28

10.0.0.77

10.0.1.77 10.0.1.21 10.0.1.0/25

10.0.1.78 10.0.1.7950 PCs - 10.0.1.128/26

50 PCs - 10.0.1.192/26

40 PCs - 10.0.2.0/26

35 PCs - 10.0.2.64/26

30 PCs - 10.0.2.128/27

20 PCs - 10.0.2.160/27

PPP (unnumbered)

29

Addressing Plan - VLSM

i hosts Max addr Start address Prefix Subnet mask Broadcast 1 200 254 10.0.0.0 /24 255.255.255.0 10.0.0.255 2 100 126 10.0.1.0 /25 255.255.255.128 10.0.1.127 3 50 62 10.0.1.128 /26 255.255.255.192 10.0.1.191 4 50 62 10.0.1.192 /26 255.255.255.192 10.0.1.255 5 40 62 10.0.2.0 /26 255.255.255.192 10.0.2.63 6 35 62 10.0.2.64 /26 255.255.255.192 10.0.2.127 7 30 30 10.0.2.128 /27 255.255.255.224 10.0.2.159 8 20 30 10.0.2.160 /27 255.255.255.224 10.0.2.191 9 10 14 10.0.2.192 /28 255.255.255.240 10.0.2.207

Network address and broadcast address can Network address and broadcast address can NOTNOT be used for host be used for host

addressing!addressing!

30

IP Address Distribution

ISP ISP

ISP ISPISP ISP ISPISP

IANA

Assignments

Allocations

RIPE NCC ARIN APNIC LACNIC AfriNIC

Internet Registries

32

Address Distribution - Example

ISP

ISP

RIPE NCC

IANA

ISP

193/8193/8

193.1.32.0 /19193.1.32.0 /19

193.2.0.0 /16193.2.0.0 /16

193.1.128.0 /18193.1.128.0 /18

193.2.20.32 /27193.2.20.32 /27 193.2.20.0 /24193.2.20.0 /24193.2.8.0 /21193.2.8.0 /21

Information about address distribution?

• Every Internet Registry is maintaining public database about address assignment

• www.ripe.net - RIPE• www.arin.net - ARIN• www.lacnic.net - LACNIC• www.apnic.net - APNIC• www.afrinic.net - AfriNIC

36

Address Categories

Public IP numbers:• Globally unique - one IP address points to one and only one destination.• Non-reusable - once used, the same IP address must not be used elsewhere!• Routable - theoretically “visible” from anywhere in the Internet.• Need global coordinated allocation/assignment process (IANA, RIRs, ISPs …).• Agreggatable - routes to 62.2.16/2162.2.16/21 and i 62.2.24/2162.2.24/21 give 62.2.16/2062.2.16/20!• Limited resource, like a radio-frequency spectrum! They need careful planning!

Private IP numbers:• Defined by the RFC 1918 (networks 10/810/8, 172.16/12172.16/12 and 192.168/16192.168/16).• Basic application - intranets, networks behind firewalls or NATs or networks

which won’t connect to the Internet at all!• They must not be routed on the public networks!• Need coordination withing the private network where they are used.

37

Special IP Addresses

• Used internally by various networking protocols.• They must notmust not be used for host/network addressing.

IP network m Abbreviated IP network usage0.0.0.0 /0 0/0 Default gateway127.0.0.0 /8 127/8 Loopback network224.0.0.0 /4 224/2 Multicast addresses (class D)240.0.0.0 /4 240/4 Class E (reserved by IANA)

• Special addresses are also: network address, subnet mask, broadcast address.

38

Address Validity (RFC 2050)

Provider aggregatable (PA) address space:• Assigned by the ISPs, for the need of their end users.• Valid until the agreement between the ISP and the customer is valid.• Upon provider change, the user must renumbermust renumber their network!• Provider guarantees global uniqueness and visibility of the assigned addresses.• Most of assignments, being done today, are provider aggregatable.

Provider independent (PI) address space:• Address space, formerly assigned directly by InterNIC, RIPE NCC, APNIC.• InterNIC, RIPE NCC, APNIC do notdo not assign addresses to end users any more!• The ISP reserves the right to refuse to route them, or to extra charge the cost for

their routing.• Necessary for multihomed networks!

39

Conclusion Addressing - Before and Now

Before - classful addressing:• End users received addresses from

InterNIC, RIPE NCC, APNIC.• A whole classful network address

had to be assigned (say, C class).• Fixed-length subnet masks in the

user network.• Avoidance of using “zero” subnets.• Network prefix length derived

directly from the address class.•• When changing the ISP, the user When changing the ISP, the user

did not need to renumber the did not need to renumber the network!network!

Now - CIDR:• End users receive addresses from

their ISPs.• An arbitary network prefix can be

assigned (say, /26 = ¼ C class).• Variable-length subnet masks in

the user network.• Normal usage of “zero” subnets.• Network prefix length information

transmitted along with the netnum.•• When changing the ISP, the user When changing the ISP, the user

has to renumber the network!has to renumber the network!