IP Addressing (subnetting)

advertisement
Subnetting
•32 bit addresses carefully assigned to make the IP
address of all hosts on a given network share a common
prefix.
•Advantage: Reduces size of routing tables within the
Internet
•Problems with the basic 2 level addressing mechanism:
•Naming: there’s not a one-to-one correspondence
between a host and an address/route.
•Flexibility and scalability: Each physical network
requires a unique network address.
1
Subnetting
•Naming problems:
•The path taken by a multihomed host depends on the
address specified.
2
Subnetting
•Flexibility and scalability example: Consider a medium
Enterprise (8000 hosts) that wants >1 physical networks.
•Options: purchase multiple class B addresses, one class B
plus additional blocks of Class C address, or limit to one
physical network.
3
Subnetting
•Other option is to extend the basic two level addressing
mechanism.
•Any extension must abide by the following:
•All hosts and routers at the site must agree to honor
the sites addressing scheme
•Other sites on the Internet treat the addresses as in
the original scheme.
Huge problem: shortage of Class B addresses.
Objective: Minimize the number of Class B network
addresses without destroying the original scheme.
4
Subnetting
Subnet addressing: Allows an organization to create
multiple logical networks internally while preserving the
presence of a single autonomous network to the outside.
An autonomous network:
A collection of routers and networks that fall under one
administrative entity.
5
Subnetting
Subnetting creates a 3 level addressing hierarchy
•Subnet mask identifies the extended network prefix.
•Subnetting is defined by RFC 950 and is a required Internet standard.
6
Subnetting
Example : 130.127.49.225 mask 255.255.255.0
10000010 01111111 00110001 11100001
Network ID
Network Number
Network Prefix
Host ID
Extended Network Prefix
Subnetwork Address
Subnet Number
SubnetID
Classfull network address: 130.127.0.0
Classfull network prefix notation: 130.127/16
Subnetwork address: 130.127.49.0
Network Prefix Notation: 130.127.49/24
7
Subnetting
Example : Subnetwork design 130.127/24
8
Subnetting
Example using bitwise AND operation to learn the extended network prefix
(using host IP address: 130.127.49.225, mask 255.255.255. )
10000010 01111111 00110001 11100001
11111111 11111111 11111111 00000000
-------------------------------------------------------------------10000010 01111111 00110001 00000000
Subnet id: 49,
host id: 225
Subnetwork address in network prefix notation: 130.127.49/24,
Classfull Internet Network Address: 130.127/16
Subnet broadcast on this subnet would be:
•130.127.49.255
•<130.127, 49, 255>
9
Subnetting
Network Design Example: 3 networks, 2000, 6000 and 1000 hosts.
Use a single Class B address. But expect the number of networks to
grow to 5 in the future. Design the IP addressing scheme.
10
Subnetting
Additional notation:
{<network number>, <subnet number>, <host number> }
Example: write the address 130.127.49.205/19 in this
notation:
Although this notation does not indicate the number of
subnets, it is useful for broadcasts.
What is the broadcast for this subnet ?
11
Subnetting
•Remember the all 1’s and all 0’s… we will assume
that the number of valid subnets and hosts (based on
subnet bits) does not include the all 1’s and all 0’s.
•To allow maximum flexibility in choosing how to
partition subnet addresses, RFC 950 permits subnet
interpretation to be chosen independently for each
physical network.
All machines must honor it!
12
Address Resolution
The address resolution problem:
remember IEEE 802.2 encapsulation...
Dest
Address
(6)
Source
Address
(6)
Length
(2)
DSAP SSAP cntl code type
(1)
(1)
(1) (3) (2)
Data ( 38 - 1492)
CRC
(4)
13
Address Resolution
Resolution through direct binding: Phys = f(IP)
• Objective is to encode the IP address in Physical
Dynamic binding protocol is required for Ethernet networks
where:
•Physical address larger than IP address (48 vs 32 bits)
•Physical address can change
•Potentially many hosts on the network
Address Resolution Protocol (ARP) defined by RFC 826
14
Address Resolution
•ARP is a protocol outside the set of TCP/IP protocols
15
Address Resolution
ARP Protocol: Case 1: Host A sends to Host D
16
Address Resolution
Case 1 Issues
•Why might there not be a response from D ?
•What happens if D does not respond?
•ARP cache entries timeout after 20 minutes
•Why?
•Why is the entry removed regardless of if the host uses
the information during the 20 minutes?
17
Address Resolution
Case 2: Host D receives an ARP request message from
Host A with target Host D.
Case 3: Host C observes the request from A to D. It will
use it only if A’s mapping is in its cache AND it is
different. (See stevens TCP Illustrated vol 1)
ARP topics:
•Arp command
•Gratuitous arp
•Arp security issues
18
Address Resolution
Reverse Address Resolution Protocol
•Used when a diskless host boots to learn its IP address
•There are other ways a Host can learn its Address: Bootp
and DHCP
19
Download