0% found this document useful (0 votes)
3 views

06 NW - Internet Protocol Addresses note chinh

This document provides an overview of Internet Protocol (IP) addresses, detailing both IPv4 and IPv6 addressing schemes, including their structure, subnetting, and allocation. It explains the significance of unique IP addresses for network communication and the transition from classful addressing to Classless Inter-Domain Routing (CIDR) for more efficient address management. Additionally, it discusses the hierarchical allocation of IP addresses and the role of Internet Service Providers (ISPs) in distributing these addresses to end users.

Uploaded by

Tuyết Mai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

06 NW - Internet Protocol Addresses note chinh

This document provides an overview of Internet Protocol (IP) addresses, detailing both IPv4 and IPv6 addressing schemes, including their structure, subnetting, and allocation. It explains the significance of unique IP addresses for network communication and the transition from classful addressing to Classless Inter-Domain Routing (CIDR) for more efficient address management. Additionally, it discusses the hierarchical allocation of IP addresses and the role of Internet Service Providers (ISPs) in distributing these addresses to end users.

Uploaded by

Tuyết Mai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Internet Protocol Addresses

126
Internet Protocol Addresses
• This chapter
• introduces the address scheme of the Internet Protocol (IPv4 and IPv6)

• describes subnet and classless addressing

• shows how the original IPv4 address scheme was divided into classes

• discusses special IP addresses

• Routing Part II: Aggregation

Computer Networks 127


Internet Protocol Addresses
• From the last chapters:
• Di erent networks use di erent (layer 2) addressing schemes (an ATM
network does not "understand" an Ethernet MAC address, nor does a
telephone network)

• To connect these networks, however, unique, standardized addresses are


necessary
• -> Introduction of additional, globally standardised addresses for all computers (= hosts)
that communicate via the Internet!

• -> Cross-network Internet address (= layer 3 address)

Computer Networks 128


ff
ff
RFC 791
• RFC 791 - INTERNET PROTOCOL - September 1981

• The IP standard requires that each host (more precisely: network card) is assigned a
unique number
• the Internet Protocol address (IP address)

• IPv4 (RFC 791): 32-bit number


• Approx. 4 billion addresses (=2 )
32 [9 IP addresses per km 2 of the earth's surface]

• IPv6 (RFC 4291): 128-bit number


• That's not four times as many addresses, that’s four times as many bits

• Approx. 667 quadrillion addresses per mm2 of the earth's surface

• As with any numbering scheme, only a fraction of this is used

• Common: Each host has several IPv6 addresses

• Every packet sent over the Internet contains the IP address of the sender (source) and
the receiver (destination)

Computer Networks 129


IPv4
• The 32 bit IPv4 address is represented in dotted decimal
notation:

• Each octet (byte) is represented as an unsigned integer in


decimal notation

• The octets are separated by a dot

• Address range 0.0.0.0 to 255.255.255.255

Computer Networks 130


IPv6
• The 128 bit IPv6 address is represented in colon hexadecimal
notation:

• Two bytes of the address are expressed as a hexadecimal value


(0000 to ) and separated by a colon

• Leading zeros can be omitted: 2001:0:2c4:0:0:a12b:1:abc0

• Case insensitive

Computer Networks 131


ff
ff
IPv6
• Consecutive zero elds can be abbreviated by :: , but only once per address
• 2001:0000:0234:0000:0000:A12B:0001:ABC0

• 2001:0:234::A12B:1:ABC0

• Not valid: 2001::234::A12B:1:ABC0

• Further examples
• FF02:0:0:0:0:0:0:0:1 -> FF02::1

• 0:0:0:0:0:0:0:1 -> ::1

• 0:0:0:0:0:0:0:0 -> ::

• Side note: In a web browser (URL) the IPv6 address must be given in square brackets:
• http://[2001:0:234::A12B:1:ABC0]:8080/index.html

Computer Networks 132


fi
IP Addresses
• The IP address is made up of the network ID (pre x) and interface ID (su x)

• Pre x is the address of the physical network

• Su x is the address of the computer within this network


• More precisely: the network card of the computer

• This hierarchy simpli es routing considerably, as routers and their tables


• only take care of the delivery to the correct network.

• they therefore only have to evaluate the pre x and

• do not need to know the addresses of the individual stations within the network

Computer Networks 133


ffi
fi
fi
fi
fi
ffi
IP Addresses
• Example: Three physical networks, IPv4
• n is 24 everywhere, i.e. 3 byte pre x

• The rst three numbers of the IP address are


the network ID,
• the same for all computers in the same network.

• The last number is the interface ID,


• di erent for computers in the same network

• Router has 3 interfaces, therefore also 3 IP


addresses (one per network)

Computer Networks 134


ff
fi
fi
IP Addresses
• The IP address hierarchy is conditional on the Internet:
• Each computer (more precisely: interface) is assigned a unique address
worldwide

• The assignment of the network ID must be globally coordinated

• No two networks may have the same network ID

• Su xes can be assigned locally (no global coordination necessary)

• Routers only have to maintain network pre xes, but not individual
addresses in their routing tables

Computer Networks 135


ffi
fi
Subnet
• All computers (interfaces) with the
same network ID (pre x) form a
subnet

• All computers (interfaces) in a subnet


can reach each other directly, i.e.
without passing through a router

• Example: Three subnets that are


connected to a router. The network ID
is in the rst 24 bits here.
• Subnet mask: /24

Computer Networks 136


fi
fi
Subnet mask
• Speci es the number n of bits of the network ID. One (IPv6) or
two (IPv4) display options:
inh tuyen lien mien không phan loai
• CIDR representation (Classless Interdomain Routing):
• Is appended to the IP address using /n

• IPv4: 223.1.1.4 /24 -> The left 24 bits of 223.1.1.4 are the network ID

• IPv6: F001::1 /64 -> The left 64 bits of F001::1 are the network ID

• Classic IPv4 representation of /n by 32-bit number:


• whose left n bits are "one" and the remaining bits are "zero"

• 32-bit number is speci ed in dotted-decimal notation: 255.255.255.0

Computer Networks 137


fi
fi
Subnet mask
• CIDR representation (Classless Interdomain Routing):
• Is appended to the IP address using /n

• IPv4: 223.1.1.4 /24 -> The left 24 bits of 223.1.1.4 are the network ID

• IPv6: F001::1 /64 -> The left 64 bits of F001::1 are the network ID

• Classic IPv4 representation of /n by 32-bit number:


• whose left n bits are "one" and the remaining bits are "zero"
CIDR Classic IPv4
/3 224.0.0.0 (=11100000.00000000.00000000.00000000b)
/24 255.255.255.0 (=11111111.11111111.11111111.00000000b)
/27 255.255.255.224 (=11111111.11111111.11111111.11100000b)

Computer Networks 138


Subnet
• How many hosts (more precisely: interfaces) t into a subnet with subnet mask /n?

• IPv4: Number of bits for interface ID = (32-n)


• -> 2 (32-n) interface IDs can be formed

• Examples:

• /24 -> 2 32-24 = 28 = 256 Interface IDs -> 256 Hosts

• /25 -> 2 32-25 = 27 = 128 Interface IDs -> 128 Hosts

• /30 -> 2 32-30 = 22 = 4 Interface IDs -> 4 Hosts

• IPv6: Number of bits for interface ID = (128-n)


• /64 -> 2 128-64 = 264 = Interface IDs -> 1.8*10 19 Hosts

• Note: The larger the subnet mask, the fewer IP addresses are available for the
subnet

Computer Networks 139


fi
Subnet
• IPv4: two su xes are reserved and may not be assigned to a host:
• The smallest interface su x (for /24 e.g. .0, for /8 e.g. .0.0.0) stands for the entire subnet and
represents the network address (e.g. 192.168.1.0/24)

• The largest interface su x represents the broadcast address in the subnet (e.g. 192.168.178.255/24)

• IPv6: the smallest interface su x represents the network address.

• Examples:
• 192.168.1.0/24 -> Network address of the /24 network 192.168.1.0/24

• 10.0.0.0/8 -> Network address of this /8 network

• 192.168.1.255/24 -> Broadcast address of the network 192.168.1.0/24

• 10.255.255. 255/8 -> Broadcast address of the network 10.0.0.0/8

• 2001:1::/64 -> Network address of this /64 network

• 2001:1::1/64 -> Host address 1 of the network 2001:1::/64

Computer Networks 140


ffi
ffi
ffi
ffi
Subnet
• What is the maximum number of subnets with subnet mask /n?

• Number of bits for network ID = n

• -> 2 n network IDs can be formed

• Example:

• /8 -> 2 =256
8 network IDs -> max. 256 subnets with /8

• /9 -> 2 =512
9 network IDs -> max. 512 subnets with /9

• Note: The larger the subnet mask, the more corresponding subnets there
are

Computer Networks 141


Subnet
• The pre x requires enough bits so that each physical network
can be assigned a unique NW number

• The su x requires enough bits so that each computer can be


assigned a unique su x

Computer Networks 142


ffi
fi
ffi
IP Addresses
• The byte-wise former classes of Classfull Addressing:
• A -> /8

• B -> /16

• C -> /24

• 1993: Introduction of CIDR


• Reduction in the size of the global routing table

• No "waste" of IP addresses due to classes that are too large or too small

• In contrast to class-based addressing: Subnet mask can now have any length. (/8, /
9, ... /19, /20, /21 …) -> More ne-grained division of the address space possible

• There are no classes in IPv6

Computer Networks 143


fi
IP Addresses
• Example: A company has 300 computers in a subnet:

• A Class C /24 network o ers 2 32-24 -2 = 254 addresses -> too


few.

• A Class B /16 network o ers 2 32-16 -2 = 65534 addresses -> far


too many.

• With CIDR: /23 network with 2 32-23 -2 = 510 addresses -> ts


(better)

Computer Networks 144


ff
ff
fi
Allocation of IP Addresses
• Company or network customer receives a pre x, i.e. a network
number from the Internet Service Provider (ISP)

• The ISP in turn receives network numbers from the responsible


Regional Internet Registry (RIR); (Europe: RIPE NCC)

• There are 5 RIRs worldwide

Computer Networks 145


fi
Allocation of IP Addresses
• Speci cation of IP address blocks

• Previously: Representation "IP address /n" indicates that the pre x of the IP
address consists of n bits.

• Further use of the "IP address/n" representation as a CIDR address block:


• IP address/n stands for all IP addresses that match the IP address in the rst n bits

• This set of IP addresses is referred to as the IP address/n address block

• Examples
• 10.0.0.0/16 stands for all IP addresses from 10.0.0.0 to 10.0.255.255

• 2000:: /3 stands for the address block 2000:0:0:0:0:0:0:0:0:0 to


3FFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF

• The address block 12.0.0.0 - 12.255.255.255 is called 12.0.0.0/8.

Computer Networks 146


fi
fi
fi
Allocation of IP Addresses

• IPv6 pre x as aggregated route:


• 2001:600::/23 to RIP NCC

• 2001:638::/32 to DFN

• 2001:638:a01::/48 to OTH Regensburg

• 2001:638:a01:109::/64 NW1-Laboratory

• 2001:638:a01:110::/64 NW2-Laboratory

Computer Networks 147


fi
Allocation of IP Addresses
• The hierarchical allocation of addresses results in a signi cant
reduction of routing tables on the Internet:

Computer Networks 148


fi
Allocation of IP Addresses
• Example: A Company wants to set up an IP network. Four
physical networks are to be connected:

Computer Networks 149


Allocation of IP Addresses
• Estimation of the number of computers results in 350 hosts
• -> Company buys a /23 network (510 addresses) from the ISP

Computer Networks 150


Allocation of IP Addresses
• The NW administrator must create 4 smaller networks (network
address spaces) from the address space:
• First iteration: division into two networks

• Second iteration (division of the two networks into four networks)

• The four /25 networks are still one large /23 network for the ISP

Computer Networks 151


Allocation of IP Addresses

Computer Networks 152


Allocation of IP Addresses
• IPv6
• It works in the same way with IPv6, except that you have to consider 128-
bit numbers

• A subnet is (usually) assigned the subnet mask /64

• An ISP usually receives a /32 address range from the RIR that it can
distribute to end customers

• End customer receives a /48 address range (or only /56)

• End customer can use this to operate up to 2 (64-48) =2 16 = 65536 subnets

Computer Networks 153


Allocation of IP Addresses
• Company receives a /48 network from the ISP: 2001:A:B::/48

• Assigns /64 networks from this:

Computer Networks 154


Private IP Addresses
• With IPv4, there are network numbers that can be used for private subnets without an application.

• These addresses must not be directly visible on the global Internet (uniqueness)
• Networks without a connection to the Internet

• Networks that are connected to the Internet via Network Address Translation (NAT)

• Internet routers discard packets that contain private addresses

• RFC 1918: Address Allocation for Private Internets


• 1x Class A: 10.0.0.0/8 (10.0.0.0 - 10.255.255.255)

• 16x Class B: 172.16.0.0/12 (172.16.0.0 - 172.31.255.255)

• 256x Class C: 192.168.0.0/16 (192.168.0.0 - 192.168.255.255)

• There are no private addresses with IPv6


• Global reachability of every IPv6 host

• No more NAT

Computer Networks 155


Network Address Translation - NAT
• What?
• Replacing the source or destination IP address with another IP address

• Usually also the ports (part of OSI layer 4, explanation later)

• This allows computers with "private", non-routable IP addresses to be connected to the


Internet

• Who?
• The router

• Why?
• Because in IPv4 IP addresses are scarce / all gone

• This is why company-internal computers are typically assigned private IP addresses

• e.g. 192.168.x.y

Computer Networks 156


Network Address Translation - NAT

192.168.1.1
192.168.1.2

Router

238.125.35.133
192.168.1.3
Replaces internal IP with the external IP address

192.168.1.4

Computer Networks 157


Network address
• Refers to the network itself, not to the hosts of this network

• IP reserves the host address zero for this

• 128.211.0.0/16 identi es the subnet with the pre x 128.211

• 10.0.0.0/8 identi es the subnet with the pre x 10

• Such addresses are used in routing tables, for example, as routers


do not need to know every host, but only individual networks.

• The NW address should never appear as the destination address


in an IP packet

Computer Networks 158


fi
fi
fi
fi
Directed broadcast address
• To send a copy of a packet to all hosts
• uses a network "Broadcasting"

• When a packet is sent to a directed broadcast


address
• a single packet travels through the Internet until it reaches
the speci ed network

• then it is sent to all hosts of the network

• Directed broadcast address


• Su x consists of all 1 bits, e.g. 1.2.255.255/16

Computer Networks 159


ffi
fi
Local broadcast address
• Addresses all hosts of the local subnet

• Is used during startup by a computer that does not yet know its
network address

• IP reserves the address for this, which consists only of 1 bits


(255.255.255.255)

Computer Networks 160


Dynamic Host Con guration Protocol (DHCP)
• A computer must know its IP address in order to send or receive
packets
• Each packet contains the address of the source and the destination

• The TCP/IP family includes protocols that a computer can use to


automatically obtain its IP address at startup: DHCP
• A newly connected computer sends a local broadcast packet to
255.255.255.255 with the source IP 0.0.0.0

• A DHCP server (e.g. a router) receives the request an assigns an IP address


to the device

Computer Networks 161


fi
Loopback address
• Each host has a virtual network card, the so-called loopback
interface
• Packets sent to the loopback address are delivered to the host's own
computer

• With IPv4, the pre x 127.0.0.0/8 is reserved for this purpose

• The most popular loopback address 127.0.0.1 is also


referred to as localhost

• Purpose:
• Error diagnosis

• Communication between two network applications on the same


computer
• e.g: Media server that can be accessed both, from the network and from the local
PC via client software

• Other examples are print servers, HTTP servers, etc. ... all can be
contacted via 127.0.0.1 on the local computer

Computer Networks 162


fi
Special IPv6 addresses
• Unspeci ed: 0:0:0:0:0:0:0:0 or :: (like 0.0.0.0 in IPv4)

• Loopback: 0:0:0:0:0:0:0:1 or ::1 (like 127.0.0.1 in IPv4)


• to test whether your IPv6 stack works: –ping ::1

• Multicast: FF< ags><scope>::<multicast group>

Computer Networks 163


fi
fl
IPv6 global addresses
n bits m bits 128-n-m bits
Global unicast prefix Subnet ID Interface ID
• 128 bit Total
• >= 48 bit global unicast pre x

• <= 16 bit for subnet

• About 64 bit for interface ID (from MAC address or randomly or assigned


via DHCP)

• Addresses start with


• 2001:

• More precisely: The rst byte has the bits 001x xxxx

Computer Networks 164


fi
fi
Outlook
• The Internet Protocol (IP) is the common "language" of all
Internet hosts

• Now we know how the addresses work, we can look at further


details

Computer Networks 165

You might also like