Week 8-9
Week 8-9
1
Variable sized subnets
Variable Sized Subnets
• Variable-length subnet mask
(VLSM) provides more
efficient use of addresses. 30 hosts
2
Classless Addressing
3
Classless address blocks
• An entity is granted a block (range) of addresses
• The size of the block (the number of addresses) varies
based on the nature and size of the entity
• Restrictions:
1. The addresses in a block must be contiguous, one after
another.
2. The number of addresses in a block must be a power of 2
(1, 2, 4, 8, ... ).
3. The first address must be evenly divisible by the number of
addresses.
4
Mask in Classless Addressing
• In IPv4 addressing, a block of addresses can be
defined as x.y.z.t/n in which x.y.z.t defines one of the
addresses and the /n defines the mask.
• The address and the /n notation completely define
the whole block (the first address, the last address,
and the number of addresses).
• The first address in the block can be found by setting
the rightmost 32-n bits to 0s.
5
Subnetted
Network
6
Subnets and Addresses
7
Example 1
A block of addresses is granted to a small
organization. We know that one of the addresses is
205.16.37.39/28. What is the first address in the
block?
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
8
Example 2
• An ISP is granted a block of addresses starting with
190.100.0.0/16 The ISP needs to distribute these addresses to
three groups of customers as follows:
a) 1st group has 64 customers; each needs 256 addresses.
b) 2nd group has 128 customers; each needs 128 addrs.
c) 3rd group has 128 customers; each needs 64 addresses.
• Design the subblocks and find out how many addresses are still
available after these allocations.
9
Example 2
10
Network Address Translation
• IP addresses are scarce.
• The long-term solution is for the whole Internet to migrate
to IPv6
– 128-bit addresses
• The quick fix is NAT (Network Address Translation)
– described in RFC 3022
• Assign each company a single IP address (or at most, a small
number of them) for Internet traffic.
• Within the company, every computer gets a unique IP address
(private)
• When a packet exits the company and goes to the Internet, an
address translation takes place.
– (private -> global)
11
Private addresses
13
Translation table
14
NAT
• Using one IP address
– 1 private host can access an external host at a time
• Using a pool of IP addresses
– N global addresses = N private hosts can access same
external host at a time
• Using both IP addresses and port numbers
– many private hosts can access many external host at a
time
15
PAT – Port Address Translation
16
PAT Example
NAT/PAT table
maintains translation
of: DA, SA, SP
DA SA DP SP DA SA DP SP
DA SA DP SP DA SA DP SP
18
IPv6 Addresses
19
IPv6 Addressing - 3 Types
1. Unicast
2. Anycast
3. Multicast
IPv6
1. Inevitability
2. Efficiency
3. Security
22
Abbreviated IPv6 addresses
23
Multicast address in IPv6
24
Reserved addresses in IPv6
25
IPv6 Tunnelling: Dual Environments
• Packets travelling on the Internet will
meet routers that are not IPv6
capable
• To ensure compatibility IETF created
IPv6 over IPv4 Tunneling
IPv6 Tunnelling: Dual Environments
• To determine which protocol to use a router will use DNS records
If multiple IPv4/v6 addresses, IPv6 addresses will be tried first, and then
IPv4 addresses will be tried.