3. 3
IP Address as a 32-Bit Binary Number
• Network number identifies the network to which a
device is attached (high order or left most bits)
• Host portion identifies the specific device on that
network (lower order or right most bits)
4. 4
IP Addressing Fundamentals
Note: The IP protocol has begun what will be a long conversion
from IP version 4 to IP version 6. This section focuses on IP
version 4.
• Basic Facts About IP Addresses
-They must be unique inside a particular network
-They are 32-bit numbers
-They are typically written, entered and displayed as
dotted-decimal numbers (e.g., 10.1.5.66)
-Each decimal number in a dotted-decimal IP address
represents 8 bits of the IP address (often called an octet)
-Each of the four decimal values in an IP address is
between 0 and 255, inclusive
5. 5
Dual-Homed Computer
• Device cannot be said to have an address, but each of
its connection points (or interfaces) to a network has an
address that allows other computers to locate it on that
particular network
6. 6
Network Layer Addressing
• Network ID enables a router to put a packet onto the
appropriate network segment. Host ID helps the router
deliver the packet to a specific host.
7. 7
How IP Routing Uses IP Addresses
• Routers learn routes to directly connected networks easily
• Routers can forward packets to networks that are not directly
connected by sending them to another router, called the next-
hop router
• IP routing relies on organization of IP addresses into groups to
allow efficient routing:
- IP addresses on the same physical network must
have the same value in the first part of the
addresses
- Routers can scale their routing tables because
they need only one entry for each IP network
9. 9
Address Class (Classful Addresses)
•Allocation of addresses is managed by American
Registry for Internet Numbers (ARIN)
10. 10
Identifying Address Class
IP Address Class Higher Order Bits First Octet Address
Range
Class A 0 0-127*
Class B 10 128-191
Class C 110 192-223
Class D 1110 224-239
13. 13
Calculating the Number of Hosts per Network
• Count the number of bits in the host portion of
the address
• For a Class A network, there are 24 host bits,
which gives 224
addresses (16,777,216
addresses)
• However, the 1st
and last addresses are
reserved for the network and network
broadcast addresses
• Actual host addresses = 2n
- 2
15. 15
Number of Class A, B, and C Networks
• Class A networks have a one-octet network
field
- Might think that there are 28
or 28
– 2 networks
available
- Since all Class A networks start with a binary 0, only
7 bits are available for network numbers
- 27
– 2 = 126 Class A networks
• Same logic can be applied to Class B and C
networks, but no need to subtract two
networks as there are not any reserved
network addresses
22. 22
IP Network Number and the Broadcast
Address
• Two numbers in each network must be
reserved for special purposes
- Cannot be assigned as unicast address to any
host
- The network number is one of the reserved
addresses
- The network broadcast address is a dotted-
decimal number that, when a packet is sent to
this address, it is sent to every host on the
network
23. 23
IP Network Number and the Broadcast
Address
• Two numbers in each network must be reserved for
special purposes (continued)
- The network broadcast address has all 1s in the
host portion of the address
- The network number is numerically the smallest
number in the network, and the network broadcast
address is the largest number in the network
- The term host address is often used to describe any
address that can be assigned to an interface in a
network
24. 24
Public and Private Address
• Public IP addresses are unique
• No two machines that connect to a public
network can have the same IP address
• Private networks that are not connected to
the Internet can have any valid address as
long as it is unique within the private network
• Grabbing “just any address” is strongly
discouraged because that network might
eventually be connected to the Internet
26. 26
NAT and Private IP Networks
• Connecting a network to the Internet using private
addresses requires translating the private
address to public address: Network Address
Translation (NAT)
• NAT allows a company to use a few registered
IP addresses instead of an entire network
• Hosts inside the company network typically
use private IP addresses
31. 31
Static Assignment of an IP address
• IP addresses can be assigned either statically or
dynamically
• When IP addresses are assigned statically, each device
must be configured with an IP address
• Assign static IP address, if the device need to be
referenced by other devices (like an address of a building)
• Records of the address assignments to be kept, because
problem can occur if duplicated IP addresses are used
• Servers should be assigned a static IP address so
workstations and other devices know how to access
needed service
• Other devices that should be assigned static IP addresses
are network printers, application servers and routers
33. 33
Dynamic Host Configuration Protocol (DHCP)
IP Address Assignment
• DHCP uses the concept of the client making a request and the
server supplying the IP address to the client, plus other
information such as the default gateway, subnet mask, DNS IP
address
• Allows a host to obtain IP address using a defined range of IP
addresses on a DHCP server
• As host come online, contact DHCP server and request an
address
• DHCP server choose an address and leases it to a device and
then reclaim that IP address for another user after the first user
release it
• DHCP request UDP port number 67 and reply port number 68
34. 34
Problems in Address Resolution
• In TCP/IP communications, a datagram on a
local-area network must contain both a
destination MAC address and a destination IP
address.
• TCP/IP needs a way to let a computer find the IP
address of another computer based on its name.
• TCP/IP also needs a way to find MAC addresses
associated with other computers.
35. 35
Problems in Address Resolution
• Hannah Knows her own name, IP address, and MAC
address because those things are configured in advance
• To find Jessie’s IP and MAC address, Hannah uses the
Domain Name System (DNS) and the Address Resolution
Protocol (ARP).
• DNS server IP address can be preconfigured or learned
using Dynamic Host Configuration Protocol (DHCP).
• Hannah simply sends a DNS request to the server,
supplying the name jessie, or jessis.skylinecomputer.com,
and the DNS replies with the IP address.
39. 39
Address Resolution Protocol (ARP)
• Some devices keep ARP tables which contain MAC
address and IP addresses of other devices that are
connected to the same LAN
40. 40
Address Resolution Protocol (ARP)
• When a network devices analyze the incoming data
frames to determine if the transmission for them,
part of this process adds the IP-MAC source
addresses to the ARP table.
• ARP table is dynamically updated, adding and
removing entries based on segment activity and
timeout values (time to keep an entry in the table).
• Length of time is depend on the OS, typically a few
hours.
41. 41
ARP operation within a subnet
• If host knows the IP address,
but not MAC address, host
build an ARP request (ARP
broadcast) and sends it to all
devices (MAC broadcast)
• Destination device responds
by sending its MAC address
(ARP reply)
44. 44
Default Gateway
• IP address of the interface on the router that connect to
the network segment on which the source host is located
(default gateway’s IP address must be the same network
segment as the source host)
45. 45
Default Gateway
• With a default gateway set on a computer, the
destination IP address is compared with the
host source address
• If the destination is in another network,
destination MAC address is default gateway
MAC address.
50. 50
Path Determination
• Path determination enables a router to compare the
destination address to the available routes in its
routing table, and to select the best path.
51. 51
Routing Overview
• Routing is the process of finding the most
efficient path from one device to another
• Router has two key functions
– Maintain routing table and make sure other
routers know of changes in the network topology
– When packets arrive at an interface, the router
must use the routing table to determine where to
send the packets. (It switches them to
appropriate interface)
55. 55
Comparing the Benefits of Routing and
Switching
• Switches provide the performance benefits of making
collision domains smaller, and providing for full duplex
transmission
• Routers provide a method of using sophisticated security
tools such as access control lists (ACLs)
57. 57
Routed Protocol vs Routing Protocol
Routing protocols determine the path that
routed protocols follow to their destinations.
58. 58
Routed Protocol
• Protocols that transfer data from one host to
another across a router are routed or routable
protocols
• Includes any network protocol suite that
provides enough information in its network
layer address to allow a router to forward it to
the next device and ultimately to its
destination.
–IP
–Internetwork Packet Exchange (IPX)
–Apple Talk
59. 59
Routing Protocol
• Routers use routing protocols to exchange routing tables and
share routing information
• Provides processes for sharing route information.
• Allows routers to communicate with other routers to update
and maintain the routing tables (through the transmission of
routing updates).
–Routing Information Protocol (RIP)
–Interior Gateway Routing Protocol (IGRP): Cisco
proprietary
–Enhanced Interior Gateway Routing Protocol (EIGRP):
Cisco proprietary
–Open Shortest Path First (OSPF)
62. 62
Basics of Learning Routes with Routing
Protocols
• Each router sends messages to other
routers attached to the same subnets
- The messages list all the routing information they
know
- Each router sends routing updates containing
information about new routes
- Eventually, all the routers learn all the routes
• Figure shows how Routing Information
Protocol (RIP) advertises and learns routes
64. 64
Using Metrics to Pick the Best Routes
• A router can learn of multiple routes when there is
redundancy in the network
• Routing protocols determine the best route by using a
metric
- The metric allows a router to measure how good
each competing route is and to pick the best route
• RIP is a simple routing protocol that uses only hop
count as its metric
- The hop count metric represents how many routers
sit between a router and a destination subnet
66. 66
Other Metric Components
• Cisco proprietary routing protocols such as
Interior Gateway Routing Protocol (IGRP) and
Enhanced Interior Gateway Routing Protocol
(EIGRP) can use four metrics
- Bandwidth
- Delay
- Link loading
- Link error rate (reliability)
• By default, both IGRP and EIGRP use only
bandwidth and delay
68. 68
Routing Table
• Protocol type
– Type of routing protocol that created the routing table entry
• Destination/ next-hop association
– Tell a router that a particular destination is either directly
connected to the router or that it can be reached via another
router called the next hop on the way to the final destination
• Routing metrics
– Routing metrics are used to determine a route’s desirability
• Outbound interface
– Interface that the data must be sent out to reach the final
destination
70. 70
Route Types
• Static Routes:
–Routes learned by the router when an administrator
manually establishes the route. The administrator
must manually update this static route entry whenever
an internetwork topology requires an update, such as
during a link failure.
• Dynamic Routes:
–Routes automatically learned by the router after an
administrator configures a routing protocol that helps
determine routes. Unlike static routes, as soon as the
network administrator enables dynamic routing, route
knowledge is automatically updated by a routing
process whenever new topology information is
received from routers within the internetwork.
73. 73
IGP and EGP
• IGPs route data within an autonomous
system.
–RIP, RIPv2, IGRP, EIGRP, OSPF, IS-IS
• EGPs route data between autonomous
systems
–Border Gateway Protocol (BGP) 4
74. 74
Type of Routing Protocols
• Examples of distance-vector protocols:
–Routing Information Protocol (RIP)
–Interior Gateway Routing Protocol (IGRP)
• Examples of link-state protocols:
–Open Shortest Path First (OSPF)
–Intermediate System-to-Intermediate System
(IS-IS)
• Examples of Hybrid Protocol:
–Enhanced IGRP (EIGRP)
76. 76
Subnetworks
To create a subnet address, a network
administrator borrows bits from the original host
portion and designates them as the subnet
field.
78. 78
Introduction to Subnetting
• Host bits must are reassigned (or “borrowed”) as
network bits.
• The starting point is always the leftmost host bit.
3 bits borrowed allows 23
-2 or 6 subnets
80. 80
Reasons for Subnetting
• Provides addressing flexibility for the network
administrator.
Each LAN must have its own network or subnetwork
address.
• Provides broadcast containment and low-level
security on the LAN.
• Provides some security since access to other
subnets is only available through the services
of a router.
81. 81
Subnet Addresses
• Internet knows your network as a whole,
subnet field will become additional routing
bits, routers within your organization can
recognize different locations, or subnets,
within the whole network
82. 82
Subnet Mask
• Determines which part of an IP address is the network
field and which part is the host field.
• Follow these steps to determine the subnet mask:
1. Express the subnetwork IP address in binary form.
2. Replace the network and subnet portion of the address with
all 1s.
3. Replace the host portion of the address with all 0s.
4. Convert the binary expression back to dotted-decimal
notation.
• Default Subnet Mask
87. 87
Subnetting Chart
• The “slash format” is a shorter way of
representing the subnet mask:
• /25 represents the 25 bits in the subnet mask
255.255.255.128
88. 88
Creating Subnet
• Borrow at least 2 bits
• At least 2 bits must remain for host numbers
• Number of usable subnets: 2n
– 2 where n is the
number of bits borrowed
• Number of usable host: 2m
– 2 where m is the
number of remaining bits
• To determine the number of bits to be used, network
designer needs to calculate how many hosts the
largest subnet requires and the number of subnet.
• Network administrators decide the size of subnets
based on organization and growth needs.
90. 90
Subnetting Class A and B Networks
• The available bits for assignment to the
subnet field in a Class A address is 22 bits
while a Class B address has 14 bits.
91. 91
The address 197.15.22.131 would be on
the subnet 197.15.22.128.
11000101 00001111 00010110 100 00011
Network Field SN Host Field
Class C address 197.15.22.131 with a
subnet mask of 255.255.255.224 (3 bits
borrowed)
Determining Subnet Mask Size
92. 92
Calculating the Subnetwork With ANDing
• ANDing is a binary process by which the router
calculates the subnetwork ID for an incoming packet.
1 AND 1 = 1; 1 AND 0 = 0; 0 AND 0 = 0
• The router then uses that information to forward the
packet across the correct interface.
Packet Address 192.168.10.65 11000000.10101000.00001010.010 00001
Subnet Mask 255.255.255.224 11111111.11111111.11111111.111 00000
Subnetwork Address 192.168.10.64 11000000.10101000.00001010.010 00000
95. 95
Broadcast Addresses
• Local or flooded broadcasts
(255.255.255.255) are not propagated by
Layer 3 internetworking device.
• Broadcasts directed into a specific network
are allowed and are forwarded by a Layer 3
device if configured
• In Cisco IOS Release 12.0 and later, routers
by default do not forward all subnets or
directed broadcast.