3.IP Addressing
3.IP Addressing
Introductory material.
University of Évora
IP Addresses
• Structure of an IP address
• Subnetting
• CIDR
• IP Version 6 addresses
IP Addresses
32 bits
version header Type of Service/TOS Total Length (in bytes)
(4 bits) length (8 bits) (16 bits)
flags
Identification (16 bits) Fragment Offset (13 bits)
(3 bits)
TTL Time-to-Live Protocol
Header Checksum (16 bits)
(8 bits) (8 bits)
• An IP address:
- is a 32 bit long identifier
- encodes a network number (network prefix)
and a host number
Dotted Decimal Notation
• Example:
10000000 10001111 10001001 10010000
1st Byte 2nd Byte 3rd Byte 4th Byte
= 128 = 143 = 137 = 144
128.143.137.144
Network prefix and Host number
Example: argon.cs.virginia.edu
•IP address is 128.143.137.144
– Is that enough info to route datagram??? -> No, need netmask or
prefix at every IP device (host and router)
•Using Prefix notation IP address is: 128.143.137.144/16
– Network prefix is 16 bits long
128.143 137.144
Subnetting
• Problem: Organizations
have multiple networks
University Network
which are independently
managed Engineering Medical
– Solution 1: Allocate an School School
address for each network
• Difficult to manage
• From the outside of the Library
organization, each
network must be
addressable ie have an
identifiable address.
– Solution 2: Add another
level of hierarchy to the
IP addressing structure Subnetting
Basic Idea of Subnetting
Subnet 128.49.0.12/24
Internet
Subnet 1
34=00100010
Subnet 128.49.1.34/25
Subnet 3
Router
R
Subnet 128.49.1.132/25
Subnet 4 132=10000100
Subnetwork: 128.49.1.0/24
Subnet 2
Subnet 128.49.3.72/24
2 bytes available for subnetting
IP Network: 128.49.0.0/16
Advantages of Subnetting
128.143.0.0/16
Same Network with Subnets
Same network with different subnetmasks
128.143.137.0
Subnet
Subnetting Example
• Solution:
– 10.2.22.0/24 (256 addresses > 200)
– 10.2.23.0/26 (64 addresses >61)
– 10.2.23.64/26 (64 addresses > 55)
– 10.2.23.128/26 (64 addresses > 41)
CIDR - Classless Interdomain Routing
• Goals:
– Restructure IP address assignments to increase efficiency
– Hierarchical routing aggregation to minimize route table
entries
• Consequence:
– Routers use the IP address and the length of the prefix for
forwarding.
– All advertised IP addresses must include a prefix
CIDR Example
Example:
• Assume that an ISP owns the address block 206.0.64.0/18,
which represents 16,384 (232-18=214) IP host addresses
• Suppose a client requires 800 host addresses
➢ 512=29<800<1024=210 -> 32-10 = 22,
➢ Assigning a /22 block, i.e., 206.0.68.0/22 -> gives a block
of 1,024 (210) IP addresses to client.
Subnetting and Classless Inter Domain
Routing (CIDR)
Company X :
206.0.68.0/22
ISP X owns:
206.0.64.0/18
204.188.0.0/15
209.88.232.0/21
Internet
Backbone ISP y :
209.88.237.0/24
Organization z1 : Organization z2 :
209.88.237.192/26 209.88.237.0/26
CIDR and Routing Information
Backbone routers do not know
anything about Company X, ISP
Y, or Organizations Z1, Z2.
Company X :
206.0.68.0/22
ISP K does not know about ISP K owns:
Organizations Z1, Z2. ISP Y sends everything which matches
206.0.64.0/18
the prefix:
204.188.0.0/15
209.88.237.192/26
209.88.232.0/21 to Organizations Z1
Internet
ISP K sends everything which
209.88.237.0/26 to Organizations Z2
Backbone
matches the prefix: ISP Y :
206.0.68.0/22 to Company X,
209.88.237.0/24 to ISP Y 209.88.237.0/24
Routing table
IPv6 - IP Version 6
• IP Version 6
– Is the successor to the currently used IPv4
– Specification completed in 1994
– Makes improvements to IPv4 (no revolutionary changes)
• Short notation:
• Abbreviations of leading zeroes:
CEDF:BP76:0000:0000:009E:0000:3025:DF12
→ CEDF:BP76:0:0:9E :0:3025:DF12
• “:0000:0000” can be written as “::”
CEDF:BP76:0:0:FACE:0:3025:DF12 → CEDF:BP76::FACE:0:3025:DF12
• IPv6 addresses derived from IPv4 addresses have different formats.
Convention allows to use IPv4 notation for the last 32 bits.
128.143.137.144 -> 0:0:0:0:0:ffff:808F:8990 or
128.143.137.144 -> 2002:808f:8990:0:0:0:0:0 (called 6to4 address)
IPv6 Provider-Based Addresses