Network Addressing
Network Addressing
Internet protocol
1
Transport
IP
Network
router
• The router examines header fields in all
network-layer datagrams passing through Process
it
Endpoint
Two key network-layer functions
• Forwarding: move Analogy: taking a
packets from router’s road trip
input to appropriate
router output Forwarding:
process of getting
• Routing: determine route through single
taken by packets from interchange
source to destination
• routing algorithms
Routing: process
of planning trip
from source to
• The network layer solves
destination
the routing problem.
4
Data plane and Control Plane
Data plane = Forwarding Control plane = Routing
• local, per-router function • network-wide logic
• determines how datagram • determines how datagram is
arriving on router input routed along end-to-end path
from source to destination
port is forwarded to endpoint
router output port
• two control-plane approaches:
• Distributed routing algorithm
values in arriving
packet header running on each router
• Centralized routing algorithm
0111 1 running on a (logically)
3
2 centralized server
Internet Addressing
7
The Internet needs addresses
• Addresses allow endpoints to identify, and hence talk to
each other
• E.g., like people have names
• Two methods:
• Old: Classful addressing
• New: Classless addressing (also called
classless inter-domain routing, or CIDR)
Classful IPv4 addressing
Classful IPv4 addressing
Class 32 bits
network host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
CIDR
• An ISP can obtain a block of 200.8.0.0/16
addresses and partition this further
to its customers
• Say an ISP has 200.8.0.0/16 address
(65K addresses).
200.8.0.
• The ISP has customer who needs 0
200.8.0. 200.8.4.128/
only 64 addresses starting from 1 26
…
200.8.4.128
200.8.1.
• Then that block can be specified as 0
200.8.1.
200.8.4.128/26 1
…
• 200.8.4.128/26 is “inside” 200.8.0.0/16 200.8.255.2
55
Netmask (or subnet mask)
• An alternative to denote the IP prefix length of an
organization
• 32 bits: a 1-bit denotes a prefix bit position. 0 is the
host part. network host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
network Host
part of part of
mask mask
11111111 11111111 11111110 00000000
Netmask: 255.255.254.0
Detecting addresses from same
network
• Given IP addresses A and B, and netmask M.
1. Compute logical AND (A & M).
2. Compute logical AND (B & M).
3. If (A & M) == (B & M) then A and B are
on the same subnet.