unit4 - WCU Computer Science
Download
Report
Transcript unit4 - WCU Computer Science
CSC 600
Internetworking
with
TCP/IP
Unit 4: Internet Addresses
(Ch. 4, 5, 6, 10)
Dr. Cheer-Sun Yang
Spring 2001
Internetworking Terms (1)
• Communications Network
– Facility that provides data transfer service
• An internet
– Collection of communications networks interconnected
by bridges and/or routers
• The Internet - note upper case I
– The global collection of thousands of individual
machines and networks
• Intranet
– Corporate internet operating within the organization
– Uses Internet (TCP/IP and http)technology to deliver
documents and resources
Internetworking Terms (2)
• End System (ES)
– Device attached to one of the networks of an
internet
– Supports end-user applications or services
• Intermediate System (IS)
– Device used to connect two networks
– Permits communication between end systems
attached to different networks
Internetworking Terms (3)
• Bridge
– IS used to connect two LANs using similar LAN
protocols
– Address filter passing on packets to the required
network only
– OSI layer 2 (Data Link)
• Router
– Connects two (possibly dissimilar) networks
– Uses internet protocol present in each router and end
system
– OSI Layer 3 (Network)
Internetworking Protocols
IP
Operation
Three Levels of Addresses
• Ethernet address (p. 30): appeared in a LLC
frame; used by firmware on the NIC to identify a
host machine. An Ethernet frame:
Preamble
Dest.
Source
Type
Data
CRC
8
6
6
2
46-1500
4
• IP Address: appears in an IP datagram(p. 98); used
by IP level software to identify source or
destination.
• TCP port: appeared in a TCP segment (P. 221);
used for identifying an application, i.e., TELNET,
FTP, etc.
IP ADDRESS FORMAT
IP Addresses - Class A
• 32 bit global internet address
• Network part and host part
• Class A
–
–
–
–
–
Start with binary 0
All 0 reserved
01111111 (127) reserved for loopback
Range 1.x.x.x to 126.x.x.x
All allocated
IP Addresses - Class B
• Starts with 10
• Range 128.x.x.x to 191.x.x.x
• Used for medium size networks that have
between 28 and 216 hosts.
• Second octet also included in network
address
• 214 = 16,384 class B addresses
• All allocated
IP Addresses - Class C
• Starts with 110
• Range 192.x.x.x to 223.x.x.x
• Used for networks that have less than 28
hosts.
• Second and third octet also part of network
address
• 221 = 2,097,152 addresses
• Nearly all allocated(See IPv6)
Addresses Specify Network
Connections
• To simplify the discussion, we said that an
internet address identifies a host. But this is
not strictly correct.
• If a host is moved from one LAN to
another, the IP address must be changed.
• So an IP address does not identify a host.
Addresses Specify Network
Connections
• Rather, an IP address identifies a network
connection.
• Another example is a multi-homed host. For
each connection, the host must be assigned
an IP address.
Network and Directed Broadcast
Addresses
• Why is network information encoded in an
IP address?
Network and Directed Broadcast
Addresses
• Why is network information encoded in an
IP address?
– Routing can become more efficient
– IP addresses can refer to networks as well as
hosts.
– If the hostid consists of all 0s, the IP address
refers to the network.
– If the hostid consists of all 1s, the IP address
refers to broadcasting to all nodes on the
network.(directed broadcast)
Limited Broadcast Addresses
• A directed broadcast address can be
interpreted unambiguously at any point in
the Internet because it uniquely identifies
the target network in addition to specifying
broadcast on that network.
• Disadvantage: it requires knowledge of the
network address.
• Another form: limited broadcast or local
broadcast address
Limited Broadcast Addresses
• A limited broadcast address contains thirtytwo 1s.
• A host may use the limited broadcast
address as part of a start-up procedure
before it learns its IP address.
Interpreting Zero to Mean “This”
• An IP address 0.0.0.0 means “this.”
• An IP address with netid 0 refers to “this
network.”
• Using netid 0 is especially important in
those cases where a host wants to
communicate over a network but does not
yet know the network IP address. All other
hosts interprete the address as meaning
“this” network.
Loopback
• Any IP address starting with 127 is
considered a loopback address.
• It means that a frame will not go out of the
machine. Instead, it will be passed to the
receiving module of the IP layer software as
if the frame is received from outside.
• It is used for testing IP configuration.
• For example: ping 127.0.0.1
Masking
• Masking is a process that extracts the
address of the physical network from an IP
address.
• For example: the mask for an IP address
128.175.1.1 to extract the netid is
255.255.0.0. (Why?)
Class D & Class E
• Class D – Multicast
• Class E – reserved for future use.
Dotted Decimal Notation
SOME SPECIAL FORMS OF ADDRESSES
EXAMPLE
Class B
Class A
10.0.0.37
128.10.2.70
192.5.48.7
192.5.48.6
Class C
EXAMPLE
I am “single”homed!
multi-homed
I am a router!
So am I!
ARP
• Mapping internet addresses to physical
addresses - the address resulation problem
An Example
• Whenever we type a command “ftp
144.26.77.43” (an Ethernet host) on
coyote.cs.wcupa.edu (144.26.28.51).
• The sending host must convert the 32-bit IP
address into the physical address for
144.26.77.43.
• Check this with TCPDUMP -e “arp” on taz
Address Resolution
• Some keeps tables in each machine that
contains pairs of high-level and physical
addresses.
• Others encode hardware addresses in highlevel addresses.
• TCP/IP uses two techniques
– direct mapping
– dynamic mapping
Direct Mapping
• Consider a token ring, e.g., proNET, that uses
small integers for physical addresses and allows
users to choose a hardware address when
installing an interface board in computer.
• One has the freedom to choose both the IP and the
physical addresses.
• We can choose the physical address as part of the
IP address.
• For example the physical address 3 has IP address
192.5.48.3
Direct Mapping
• Efficient
• But may not work for all networks, e.g.,
Ethernet
• Ethernet interface card is assigned a
physical address of 48 bits
• But an IP address has 32 bits
• A machine’s physical address can change
• A machine can have two or more addresses.
Dynamic Mapping
• The designer of TCP/IP devised a low-level
protocol to bind IP addresses to physical
addresses dynamically.
• Address Resolution Protocol (ARP)
• When a host A wants to resolve IP address
IB, it broadcasts the IP address. Only host B
would reply with the physical address to A.
A Question
• Isn’t it silly to broadcast a request first to
obtain the IP address prior to sending a
frame? Why not broadcasting the frame
with a physical address of the destination?
• Isn’t it the case anyway when sending out a
frame?
Why?
• It is costly to broadcast twice for every send
operation.
• After sending a request and reply once for
each machine, it is cheaper to keep the
mapping in a local cache.
• It is cheaper to look it up locally first prior
to sending out a frame.
• All machine can use IP address to identify a
host - one level of abstraction
ARP Cache Maintenance
• Cache opens up another can of worms!
• A host may change it’s IP address or
hardware address without notifying
everyone.
• A timer is associated with each entry in the
cache. When the timer expires, the entry is
deleted-trade efficiency with robustness.
• Command: /sbin/arp -a
ARP Refinements
• When A broadcasts a request, A also
includes it’s IP address and physical address
in the ARP request.
• Every host will save a copy of the mapping
about A.
• When the response is broadcast, eveery host
also keeps a copy of the mapping about B.
• When a machine replaces it’s physical
address, notify others at boot time.
ARP Encapsulations and Identification
ARP Message Format
RARP
• Determining an internet addresses at
startup.
• Usually an IP address is kept on a local
disk. If a machine doesn’t have a disk, how
can the machine determine its IP address?
• When bootstrap code is executed, it uses the
network to contact a server and obtain the
computer’s IP address.
A
B
C
D
A sends B, C, D a broadcast request.
B, C, D authorized to supply the RARP service (C
and D) reply directly to A.
Chapter 10
ClassLess and Subnet Address
Extensions
ROADS Problem
• Including all 0’s and all 1’s, the hostid in
– class A: 216 <= hostid <= 224 - 1
– class B: 28 <= hostid <= 216 -1
– class C: 0-255
• It is apparent that requiring a unique prefix
for each physical network would exhaust
the address space quickly.
• Running Out of Address Space (ROADS).
Solutions
• The address space of IP addressing scheme
becomes exhausted.
• Several ways to minimize the number of
addresses used:
– Transparent routers
– proxy ARP
– subnetting
Transparent Routers
The Local Area Network does not have its IP prefix; hosts attached to it are
assigned addresses as if they are connected directly to the WAN.
Transparent Routers
• A host does not have to tell the router where
a packet should be sent to. The router
knows where to send using default
information and history.
Transparent Routers
• Transparent routers can divide the IP
address into multiple parts and encode
information in unused parts. For example,
the ARPANET was assigned the address
10.0.0.0 and each packet switch node (PSN)
on the ARPANET had a unique integer
address.
Transparent Routers
• Internally, the ARPANET treated any 4octet IP address of the form 10.p.u.i as four
separate octets that specify a network (10),
a specific port on the destination PSN(p),
and a destination PSN (i). Octet u remains
uninterpreted.
• Thus, the addresses 10.2.5.37 and 10.2.9.37
both refer to host 2 on node 37.
Proxy ARP
Subnets and Subnet Masks
• Allow arbitrary complexity of internetworked
LANs within organization
• Insulate overall internet from growth of network
numbers and routing complexity
• Site looks to rest of internet like single network
• Each LAN assigned subnet number
• Host portion of address partitioned into subnet
number and host number
• Local routers route within subnetted network
• Subnet mask indicates which bits are subnet
number and which are host number
Subnets and Subnet Masks
• Example 1: An organization with a class A address
needs at least 1000 subnetworks. Find the subnet
mask and configuration of each subnetwork.
• Without subnetting: Mask = 255.0.0.0
• With subnetting: Mask = ?
Subnets and Subnet Masks
• Example 1: An organization with a class A address
needs at least 1000 subnetworks. Find the subnet
mask and configuration of each subnetwork.
• Without subnetting: Mask = 255.0.0.0
• With subnetting: Mask = 255.255.192.0
– 11111111-11111111-11000000-00000000
• Divide the original space range into 1024 ranges,
with two ranges to be reserved as special
addresses. There are 16384 addresses in each
range. There are 16382 (why?) possible
computers.
Subnets and Subnet Masks
• Example 2: An organization with a class B address
needs at least 12 subnetworks. Find the subnet
mask and the configuration.
• Subnet mask = 255.255.240.0
– 11111111 11111111 11110000 00000000
• The original hostid addresses have been divided
into 16 ranges, with two ranges reserved as special
addresses.
• There are 212(=4096) addresses in each range.
• Only 4094 computers can be attached to each
subnetwork.
Variable-Length Subnetting
• The Internet allows a site to use a variable-length
subnetting.
• As an example, a site has the following number of
hosts in 5 subnetworks with class C addresses: 60,
60, 60, 30, 30.
• What subnet mask should it be?
– Using 2 bits for the subnet id, we can have only 4
subnets
– Using 3 bits for the subnet id, we can have only 32
hostid addresses
Variable-Length Subnetting
• What subnet mask should it be?
– Using 2 bits for the subnet id, we can have only 4
subnets
– Using 3 bits for the subnet id, we can have only 32
hostid addresses
• A router maintains two subnet masks:
Variable-Length Subnetting
• A router maintains two subnet masks:
62 hosts
62 hosts
255.255.255.192
62 hosts
Router
255.255.255.224
30 hosts
30 hosts
Subnetting
CIDR Address Blocks and Bit
Masks
• Classless addressing is another name of
supernetting.
Supernetting
• The space of a class C address, with a maximum
number of 254 host addresses, may not satisfy the
need of an organization.
• Supernetting: apply for a group of class C
addresses instead of 1.
• For example, an organization that needs 1000
addresses can be granted 4 class C addresses:
–
–
–
–
X.Y.32.1-X.Y.32.254
X.Y.33.1-X.Y.33.254
X.Y.34.1-X.Y.34.254
X.Y.35.1-X.Y.35.254
• Network mask = 255.255.252.0 for netid
Supernetting
• For example, an organization that needs 1000
addresses can be granted 4 class C addresses:
–
–
–
–
X.Y.32.1-X.Y.32.254
X.Y.33.1-X.Y.33.254
X.Y.34.1-X.Y.34.254
X.Y.35.1-X.Y.35.254
• Network mask = 255.255.252.0 for netid
• X.Y.33.4 belongs to the supernet X.Y.33
• X.Y.36.4 doesn’t.
• We will come back to the subnetting and supernetting again when we
discuss Classless InterDomain Routing (CIDR)
CIDR Address Blocks and Bit
Masks
• CIDR requires both an address and a mask,
a shorthand notation was devised.
• The block of addresses in Fig. 10.10 can be
expressed as 128.211.168.0/21, where /21
denotes 21 bits in a mask.
• The /8, /16, and /24 prefixes correspond to
traditional class A, B, and C divisions.
A Classless Addressing Example
• If an ISP is assigned 128.211.0.0/16.
• The ISP can assign 128.211.0.0/16 to a
customer with 2048 address in the /21 range
that Fig. 10.10 specifies.
• The ISP can also assign 128.211.176.212/29
to cover the address range that Fig. 10.12
specifies.