Professional Documents
Culture Documents
Chapter 1.2fundwementals of Computer Networking
Chapter 1.2fundwementals of Computer Networking
CINS/F1-01
IP Addressing
Classless Interdomain Routing (CIDR)
Chapter 1-2 Fundamental
Networking concepts review
Internet Protocol
Addressing
• Classless inter domain routing (CIDR), sub netting
• Address Resolution Protocol (ARP)
• Network Address Translation (NAT)
IP Addresses
• Structure of an IP address
• Classful IP addresses
• Limitations and problems with classful IP addresses
• 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)
Ethernet frame
IP Addresses
32 bits
0x4 0x5 0x00 4410
128.143.137.144
128.143.71.21
Ethernet frame
What is an IP Address?
• 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: ellington.cs.virginia.edu
128.143 137.144
bit # 0 1 7 8 31
Class A 0
Network Prefix Host Number
8 bits 24 bits
bit # 0 1 2 15 16 31
bit # 0 1 2 3 23 24 31
bit # 0 1 2 3 4 31
bit # 0 1 2 3 4 5 31
• Problem: Organizations
have multiple networks
University Network
which are independently
managed Engineering Medical
– Solution 1: Allocate one or School School
more Class C address for
each network
• Difficult to manage Library
• From the outside of the
organization, each network
must be addressable.
– Solution 2: Add another
level of hierarchy to the
Subnetting
IP addressing structure
Basic Idea of Subnetting
One solution to the IP address shortage was thought to be the subnet mask.
* There are different ways of subnetting. Commonly used netmasks for university
networks with /16 prefix (Class B) are 255.255.255.0 and 255.255.0.0
Subnet Example
Given the Class B address 190.52.0.0
Using /24
subnet... Network Network Subnet Host
207.21.24.216/30
207.21.24.96/27 207.21.24.128/27
207.21.24.64/27
207.21.24.208/30 207.21.24.212/30
207.21.24.196/30 207.21.24.200/30
• This network has seven /27 subnets with 30 hosts each AND seven
/30 subnets with 2 hosts each (one left over).
• /30 subnets with 2 hosts per subnet do not waste host addresses on
serial networks .
Typical Addressing Plan for an Organization that
uses subnetting
• Each layer-2 network (Ethernet segment, FDDI segment) is
allocated a subnet address.
128.143.71.0 / 24
128.143.0.0/16 128.143.16.0 / 24
128.143.7.0 / 24 128.143.8.0 / 24
128.143.17.0 / 24
128.143.22.0 / 24
128.143.136.0 / 24
Advantages of Subnetting
• Problem:
– Potential exhaustion of IPv4 address space (due to inefficiency)
• Class B network numbers are highly prized
– Not everyone needs one
• Lots of class C addresses but no one wants them
– Growth of back bone routing tables
• We don’t want lots of small networks since this causes large routing
tables
• Route calculation and management requires high computational
overhead
• Solution:
– Allow addresses assigned to a single entity to span multiple classed
prefixes
– Enhance route aggregation
Supernetting
• Assign block of contiguous network numbers to nearby networks
• Called CIDR: Classless Inter-Domain Routing
– Breaks rigid boundaries between address classes
– If ISP needs 16 class C addresses, make them contiguous
• Eg.192.4.16 to 192.4.31 enables a 20-bit network number
– Idea is to enable network number to be any length
– Collapse multiple addresses assigned to a single to one
address
• Represent blocks (number of class C networks) with a single pair
(first_network_address, count)
• Restrict block sizes to powers of 2
• Use a bit mask (CIDR mask) to identify block size
• All routers must understand CIDR addressing
CIDR - Classless Interdomain Routing
• Goals:
– Restructure IP address assignments to increase efficiency
– Hierarchical routing aggregation to minimize route table
entries
Network Network
Service Service
Provider Provider
With CIDR, a
router can
summarize
these routes
using a single
network
address by
using a 13-bit
prefix:
172.24.0.0 /13
Steps:
1. Count the number of left-most matching bits, /13 (255.248.0.0)
2. Add all zeros after the last matching bit:
172.24.0.0 = 10101100 00011000 00000000 00000000
CIDR and Address assignments
Example:
• Assume that an ISP owns the address block 206.0.64.0/18, which
represents 16,384 (214) IP addresses
• Suppose a client requires 800 host addresses
• With classful addresses: need to assign a class B address (and
waste ~64,700 addresses) or four individual Class Cs (and introducing 4
new routes into the global Internet routing tables)
• With CIDR: Assign a /22 block, e.g., 206.0.68.0/22, and allocated a
block of 1,024 (210) IP addresses.
CIDR and Routing Information
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 X does not know about ISPISP X owns:
y sends everything which matches
Organizations z1, z2. the prefix:
206.0.64.0/18 to Organizations z1
209.88.237.192/26
204.188.0.0/15to Organizations z2
209.88.237.0/26
209.88.232.0/21
Internet
ISP X sends everything which
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
• IP Version 6
– Is the successor to the currently used IPv4
– Specification completed in 1994
– Makes improvements to IPv4 (no revolutionary changes)
Subnet DA
DL Frame for Subnet
Addresses
128.171.17.13
Subnet
Subnet
Subnet
Internet and Data Link Addresses Serve
Different Purposes
• IP address
– To guide delivery to destination host across the
Internet (across multiple networks)
• Subnet Address
– To guide delivery between two hosts, two routers,
and a host and router within a single subnet
– Same LAN, Frame Relay network, etc.
Address Resolution
• Problem
– Router knows that destination host is on its
subnet based on the IP address of an arriving
packet
– Does not know the destination host’s subnet
address, so cannot deliver the packet across
the subnet
Destination Host
128.171.17.13
Subnet
subnet address?
Address Resolution Protocol (ARP)
• Router creates an ARP Request message to be
sent to all hosts on the subnet.
– Address resolution protocol message asks
“Who has IP address 128.171.17.13?”
– Passes ARP request to data link layer process
for delivery
Subnet
ARP Request
Address Resolution Protocol (ARP)
• Data link process of router broadcasts the ARP
Request message to all hosts on the subnet.
– On a LAN, MAC address of 48 ones tells all
stations to pay attention to the frame
Subnet
ARP Request
Address Resolution Protocol (ARP)
ARP Response
Subnet
Address Resolution Protocol (ARP)
• Router delivers the IP packet to the destination
host
– Places the IP packet in the subnet frame
– Puts the destination host’s subnet address in
the destination address field of the frame
Deliver IP Packet
within a subnet frame
Subnet
Address Resolution Protocol
ARP
Router Destination Host
Request
Internet Internet
Process Process
ARP
Response
Address Resolution Protocol
• However, the data link processes deliver these
ARP packets
– Router broadcasts the ARP Request
– Destination host sends ARP response to the
subnet source address found in the broadcast
frame
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP IP
Eth Eth
Phy Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
61
Private Network
62
Private Addresses
H1 H2 H3 H4
10.0.1.1 10.0.1.1
Private network 1 Private network 1
Internet
R1 128.195.4.119 128.143.71.21 R2
213.168.112.3
H5
63
Network Address Translation (NAT)
• A technology that can provide the mapping between the private and universal
addresses.
• The technology allows a site to use a set of private addresses for internal
communication and a set of global Internet addresses (at least one) for
communication with the rest of the world.
• The site must have only one connection to the global Internet through a NAT-
capable router that runs NAT software.
• NAT is a way to conserve IP addresses
– Can be used to hide a number of hosts behind a single IP address
– Uses private addresses:
• 10.0.0.0-10.255.255.255,
• 172.16.0.0-172.32.255.255 or
• 192.168.0.0-192.168.255.255
Network Address Translation (NAT)
65
Basic Operation of NAT
66
Pooling of IP Addresses
67
Pooling of IP Addresses
Private Internet
network
Private Public
Address Address
10.0.1.2
68
Supporting Migration between Network Service
Providers
• Scenario: In CIDR, the IP addresses in a corporate network are obtained
from the service provider. Changing the service provider requires
changing all IP addresses in the network.
• NAT solution:
– Assign private addresses to the hosts of the corporate network
– NAT device has static address translation entries which bind the
private address of a host to the public address.
– Migration to a new network service provider merely requires an update
of the NAT device. The migration is not noticeable to the hosts on the
network.
Note:
– The difference to the use of NAT with IP address pooling is that the
mapping of public and private IP addresses is static.
69
Supporting Migration between network service
Providers
70
IP Masquerading
71
IP Masquerading
72
Load Balancing of Servers
• NAT solution:
– Here, the servers are assigned private addresses
– NAT device acts as a proxy for requests to the server from
the public network
– The NAT device changes the destination IP address of
arriving packets to one of the private addresses for a
server
– A sensible strategy for balancing the load of the servers is
to assign the addresses of the servers in a round-robin
fashion.
73
Load Balancing of Servers
74
Concerns about NAT
• Performance:
– Modifying the IP header by changing the IP address
requires that NAT boxes recalculate the IP header
checksum
– Modifying port number requires that NAT boxes recalculate
TCP checksum
• Fragmentation
– Care must be taken that a datagram that is fragmented
before it reaches the NAT device, is not assigned a
different IP address or different port numbers for each of
the fragments.
75
Concerns about NAT
• End-to-end connectivity:
– NAT destroys universal end-to-end reachability of hosts on
the Internet.
76
Concerns about NAT
77