22
1 Internet Addresses (You should read Chapter 4 in Forouzan) IP Address is 32 Bits Long Conceptually the address is the pair (NETID, HOSTID) Addresses are assigned by the internet company for assignment of names and numbers ICANN ICANN: Protocol Support Organization (PSO) Domain Name Supporting Organization (DNSO) Address Supporting Organization (ASO) Regional Internet Registries American Registry for Internet Numbers (ARIN) http://www.arin.net/registration/fee_schedule.html www.arin.net www.icann.org Reference “ IP Fundamentals ” Chapter 1 and 2 by Maufer

Internet Addresses - Georgia Institute of Technologyusers.ece.gatech.edu/dblough/4110/IPAddressesAndSubnetting.pdf · Internet Addresses Cont. ... Example : 172. 27. 0.0. / 16 R A

  • Upload
    vuxuyen

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

1

Internet Addresses (You should read Chapter 4 in Forouzan)

IP Address is 32 Bits Long

Conceptually the address is the pair (NETID, HOSTID)Addresses are assigned by the internet company for assignment of names and numbersICANN

ICANN:Protocol Support Organization (PSO)Domain Name Supporting Organization (DNSO)Address Supporting Organization (ASO)

Regional Internet RegistriesAmerican Registry for Internet Numbers (ARIN)

http://www.arin.net/registration/fee_schedule.htmlwww.arin.netwww.icann.org

Reference “ IP Fundamentals ” Chapter 1 and 2 by Maufer

2

Formats for IP addresses: (classful addressing)

Class A 0

10

110

1110

Network (7 bits) Host (24 bits)

Network (14 bits)

Network (21 bits)

Host (16 bits)

Host (8 bits)

Multicast address (28 bits)

( There is a class E reserved for future use)Historically a class A address was assigned to networks with > 216 (65, 536) hosts

Class B to networks with 28 (256) to 216 hosts

Class C to networks with < 28 hosts

Class B

Class C

Class D

3

Internet Addresses Cont.

For Humans easier to deal with decimal so dotted decimal notation is used.Group 8 bits.8 bits.8 bits.8 bits and use decimal numbers

Example 10000000 00001010 00000010 00011110 => 128.10.2.30Class Lowest Address Highest Address A 1.0.0.0 126.0.0.0 B 128.1.0.0 191.254.00 C 192. 0.1.0 223.255.254.0 D 224.0.0.0 239.255.255.255

Some addresses are reservedExample 127.0.0.0 is reserved for loop back

4

IP version 4 uses 32 bit address 2 4.3 billion addresses32≈

and 6.7 billion live on earth at present

Classless inter-domain routing (CIDR) discussed later slowed down addressexhaustion.

Scaling Issues:

1. Eventual exhaustion of the IPV4 address space.

2. Ability to route traffic between ever increasing number

of networks that comprise the internet.

5

IP addresses cont.

Class A all 0’s network number is used to represent the “ default” route ( 0.0.0.0)this is a routing table entry which means any destination not matching any othertable entry should be sent to the default route. (more later)

Class A all 1’s network number is loopback. 127.0.0.1 usually means “ This samemachine” all 127.anything.anything.anything is loopback.

There are a total of 27 -2 = 126 class A networks.

There are 214 - 2 = 16, 382 class B networks (again all 0’s & all 1’s networkaddresses reserved)

There are 221-2 = 2,097,150 class C networks.

There are 228 = 268, 435, 456 class D multicast addresses.

6

Notation:Class A has 8 bit network prefix this is called a slash 8’s /8can write 127.0.0.0 as 127/8 or 127.0.0.0/8

/ 8 prefixes ( class A)

Classful addressing allows using only the first 1,2,3 or 4 bits to determine theclass. (I.E. if MSB = 0 => class A

/ 8 address block has 231 out of 232 total IP addresses

=> / 8 takes up 50% total IPV4 addresses

/ 16 prefixes ( class B) 230 total addresses => 25% total IPV4 addresses

/ 24 prefixes ( class C ) 229 out of 232 => 12.5% total IPV4 addresses

Class D with 1110 most significant bits used for multicast

Class E with 1111 most significant bits and are reserved for experimental use

7

In the Beginning

- IP addresses assigned based on request, not need- 32 bit address was thought to be plenty- classful addresses easy to understand and implement but not efficient / 24 supports 254 hosts too small / 16 supports 65,534 too large

8

IP RoutingFor a host IP routing is simple:If destination is directly connected to host then IP datagram is sent directly tothe destination.

otherwise host sends datagram to a default router

The IP layer can be configured to act as a router in addition to acting as a host

A host never forwards datagrams from one of its interfaces to another, while arouter forwards datagrams

IP Layer has a routing table in memory that it searches each time it receives aa datagram to send

Each entry in routing table contains:

- Destination IP address

- IP address of a next hop router or IP address of a directly connected network

- Flags (specify if network or host address)

- Specification of which network interface the datagram should go to for transmission

9

IP Routing Performs The Following Actions:

1. Search routing table for entry that matches complete destination IP address

2. Search table for match of destination network IP. This check must take into account a possible “ Subnet Mask ” ( Defined Later ).

3. Search for default entry.

4. If none of the above discard and send host unreachable or network unreachable error back.

Note: Hop by hop nature of this process.

10

Classical Subnetting Reference “ IP Fundamentals ” Chapter 3

Extended-Network-Prefix

Network - Prefix Host - Number

Network - Prefix Subnet - Number Host - Number

Before :

After :

Subnetting attacks the expanded routing table problem by making the subnetstructure of a network invisible outside the organization’s private network.

External Internet Does Not Need To Know Internal Subnet Structure

11

Example : 172. 27. 0.0. / 16

Subnet 1R A R C

Subnet 2R B R D

Internet

Subnet 5

Subnet 4

Subnet 3

R B

R A

Internet sees

I need 5 subnets so I use 3 bits in the subnet - number field

12

This means I have

Subnet Number Binary representationof least-significant two bytes

Available host addresseswithin each subnet

0 172.27.0.0 00000000.00000000 0.1- 31. 2541 172.27.32.0 00100000.00000000 32.1- 63.2542 172.27.64.0 01000000.00000000 64.1- 95.2543 172.27.96.0 01100000.00000000 96.1-127.2544 172.27.128.0 10000000.00000000 128.1-159.2545 172.27.160.0 10100000.00000000 160.1-191.2546 172.27.192.0 11000000.00000000 192.1-223.2547 172.27.224.0 11100000.00000000 224.1-255.254

Need a method to know how many bits are used for subnet-number=> subnet mask In this example the subnet mask is 255.255.224.0 11111111.11111111.11100000.00000000

13

Subnet Mask

At boot time a machine gets its own IP address ( stored on disk for example )

Host also needs to be told how many bits are to be used for subnet ID and how manyfor host ID. This is the subnet mask.

Subnet mask is 32 bit value containing “one bits” for the network ID and subnet ID,“zero valued bits” for host ID.

Two examples for class B addresses:

Class B

Subnet mask 11111111 11111111 11111111 00000000 = 0Xff ff ff 00 This is a /24 extended network prefix = 255.255.255.0 (Subnet masks are only occasionally written in Hexadecimal)Class B

16 bits 8 bits 8 bits

Net ID Subnet ID Host ID

Net ID Subnet ID Host ID16 bits 10 bits 6 bits

Subnet mask 11111111 11111111 11111111 11 000000 = 0Xff ff ff C0 This is a /26 extended network prefix = 255.255.255.192

14

When a host is given its own IP address and its subnetwork mask it can then figure out:

• Am I class A, B, or C address ? ( Look at higher order bits )

• Where is the boundary between the network ID and the subnet ID ? ( Defined by class definition )

• Where is the boundary between the subnet ID and the host ID ? ( Host ID is 0’s in mask )

15

Subnet Addressing

Hosts are required to consider the Host ID Portion of an IP address as a Subnet ID Part and a Host ID Part.

Class A and class B addresses have too many bits allocated for the host ID 224 -2 and 216-2respectively (-2 address because all 0’s all 1’s for a host ID not allowed )

Example:

Class B16 Bits 8 Bits 8 Bits

Net ID = 130.207 Subnet ID Host ID

=> 256 subnets with 254 hosts per subnet (Assuming can use all 1’s and all 0’s subnet) Subnet hides the details of an internal network from external routers so that the externalRouter table is smaller To reach any host whose ID address begins with 130.207 external routers only need to know the path to the “ Gateway” router for the entire subnetwork.

16

Gateway

130.207.1.1

130.207.230.0 130.207.231.0

........ etc

If we used multiple class C addresses external routing tables need at most oneentry for each of the multiple class C addresses.

Subnetting reduces the size of routing tables.

Aside: A host address has a non zero ID and ID’s one host, a network address has a host ID of Zero and ID’s all hosts on that network.

*

17

Example:

For a class B host address of 140.252.1.1 and a subnet mask of 255.255.255.0

Note we have 8 bits for subnet and 8 bits for host ID

• If a destination IP address is 140.252.4.5 16 bits 8 bits 8 bits

140 252 1 1Class B

Subnet mask 11111111 11111111 11111111 00000000 = 255.255.255.0

Class B 140 252 4 5

Network Subnet

The network ID’s are the same ( 140.252 ) the subnetwork ID’s are different ( 1 and 4 )

18

Cont

• If the destination IP address is 140.252.1.22 the network ID’s are the same (140.252) the subnet ID’s are the same (1) the host ID’s are different.

• If the destination IP address is 192.43.235.6 ( This is a class C address ) The network ID’s are different

IP routing function makes comparisons like this all the time

[ REF: “TCP/IP Illustrated vol 1,” Stevens CH 3]

19

Subnet addressing Plan

1. How many total subnets does the organization need today?

2. How many total subnets will the organization need in the future?

3. How many hosts on largest subnet today?

4 How many hosts on largest subnet in future?

Example Problem:

An organization has been assigned the network number 193.1.1.0/24 and it needs to define six subnets. The largest subnet is required to support 25 hosts.

Answer: 6 subnets => 23 = 8 3 bits Use a /27 extended - network - prefix

=> 255.255.255.224

This leaves 5 bits to define host addresses on each subnet since all 0’s and all 1’s host addresses are reserved there are 25 - 2 = 30 assignable host addresses

20

Cont

This is >= 25 specified so ok

Base Net 11000001 . 00000001 . 00000001 . 00000000 = 193. 1. 1. 0/24

Subnet # 0 11000001 . 00000001 . 00000001 . 00000000 = 193. 1.1.0/27 # 1 . 001 = 193. 1.1.32/27 # 2 . 010 = 193. 1.1.64/27 # 3 . 011 = .96/27 # 4 . 100 = .128/27 # 5 . 101 = .160/27 # 6 . 110 = .192/27 # 7 . 111 = .224/27

Note: All multiples of subnet #1 (the 32)

21

All 0’s and all 1’s subnets

Initially all 0’s and all 1’s subnets were forbidden. This was true to eliminate the followingconfusion: ( in a classful router ) When 193. 1. 1. 0 is an advertised route we do not know for example if we are advertising

193 .1 .1 . 0/24 11000001. 00000001. 00000001. 000 00000

24 bitsor

193 .1 .1 . 0/27 11000001. 00000001. 00000001. 000 00000

27 bits

Which is a subnet with 000 in the Extended-Network-Prefix

- Without knowing the Prefix - Length or mask, a router cannot tell the difference in these two cases. ( Is it a route to an all 0’s subnet or is it a route to entire network? )

- Early routing protocols like RIP-1 do not supply a mask or Prefix - Length with each route

- Now days, with the development of routing protocols that do carry this info you can use all 0’s and all 1’s subnet

22

All 0’s And All 1’s Host Addresses

All 0’s host number is used to identify the base network ( or subnetwork )

All 1’s host number represents broadcast address for the network ( or subnetwork )

Example Possible Host Addresses For A Subnet

Given subnet #2 11000001.00000001. 00000001. 01000000 = 193.1.1.64/27Host #1 00001 = 193.1.1.65 . . . . . . . . .Host #30 11110 = 193.1.1.94

Broadcast For This Subnet is 11111 = 193.1.1.95

Aside: One can deploy network numbers from the private address space ( see RFC - 1918 ) for internal connectivity and use a network address translator ( NAT ) to provide external internet access