8/3/2019 10 Routing Subnets
1/32
Network Technology II Bridging Routing Fundamentals and Subnets page 1 of 32
Routing Fundamentals andSubnets
8/3/2019 10 Routing Subnets
2/32
Network Technology II Bridging Routing Fundamentals and Subnets page 2 of 32
Routable and routed protocols
A protocol is a set of rules that determines how computers
communicate with each other across networks
A protocol describes the following:
The format that a message must conform to .
The way in which computers must exchange a message within thecontext of a particular activity.
A routed protocol allows the router to forward data between nodes
on different networks.
The reason that a network mask is used is to allow groups ofsequential IP addresses to be treated as a single unit.
8/3/2019 10 Routing Subnets
3/32
Network Technology II Bridging Routing Fundamentals and Subnets page 3 of 32
IP as a routed protocol
The Internet Protocol (IP) is the most widely used implementation of
a hierarchical network-addressing scheme.
IP is a connectionless (no need for call setup), unreliable (no error
control), and best-effort delivery (no bandwidth control) protocol.
At the network layer, the data is encapsulated into packets, alsoknown as datagrams.
IP determines the contents of the IP packet header, which includes
addressing and other control information, but is not concerned with
the actual data.
8/3/2019 10 Routing Subnets
4/32
Network Technology II Bridging Routing Fundamentals and Subnets page 4 of 32
Packet propagation and switching
within a router Layer 3 data units, packets, are for end-to-end addressing. As the data crosses a Layer 3 device the Layer 2 information
changes.
Address checked to see if Broadcast or to Router Interface Frame
accepted.
CRC Checked.
Packet sent to Layer 4.
If destined for other IP or Gateway.
Frame given appropriate info and new FCS.
Sent out correct interface.
8/3/2019 10 Routing Subnets
5/32
Network Technology II Bridging Routing Fundamentals and Subnets page 5 of 32
Internet Protocol (IP)
Connectionless
Destination is not contacted before packet is sent.
Packets may take different paths to reach destination, therefore thepackets may not arrive in order.
Packet Switched, e.g. Postal System.
Connection Oriented
Connection established before data Tx.
Circuit Switched.
Packets follow same path (circuit) sequentially, e.g. Phone system
The Internet is a gigantic (big), connectionless network. All packetdeliveries are handled by IP. TCP adds Layer 4, connection-oriented, reliable (with error control) services to IP.
8/3/2019 10 Routing Subnets
6/32
Network Technology II Bridging Routing Fundamentals and Subnets page 6 of 32
Anatomy (structure) of an IP packet
IP packets consist of the data from upper layers plus an IP header.The IP header consists of the following: Version Indicates the version of IP currently used; four bits. If the
version field is different than the IP version of the receiving device, thatdevice will reject the packets.
IP header length (HLEN) Indicates the datagram header length in32-bit words. This is the total length of all header information,accounting for the two variable-length header fields.
Type-of-service(TOS) Specifies the level of importance that hasbeen assigned by a particular upper-layer protocol, eight bits.
Total length Specifies the length of the entire packet in bytes,including data and header, 16 bits. To get the length of the datapayload subtract the HLEN from the total length.
Identification Contains an integer that identifies the currentdatagram, 16 bits. This is the sequence number.
Flags A three-bit field in which the two low-order bits controlfragmentation. One bit specifies whether the packet can befragmented, and the other specifies whether the packet is the lastfragment in a series of fragmented packets.
** Note that fragmenting the packet means break down a large packet into severalsmall packets.
8/3/2019 10 Routing Subnets
7/32Network Technology II Bridging Routing Fundamentals and Subnets page 7 of 32
Anatomy of an IP packet (Contd)
Fragment offset Used to help piece together datagram fragments,13 bits. This field allows the previous field to end on a 16-bit boundary(3 bits flag + 13 bits fragment=16 bits).
Time-to-live (TTL) A field that specifies the number of hops (routers)a packet may travel. This number is decreased by one as the packettravels through a router. When the counter reaches zero the packet isdiscarded. This prevents packets from looping endlessly.
Protocol indicates which upper-layer protocol, such as TCP or UDP,
receives incoming packets after IP processing has been completed,eight bits. Header checksum helps ensure IP header integrity, 16 bits.
Source address specifies the sending node IP address, 32 bits.
Destination address specifies the receiving node IP address, 32bits.
Options allows IP to support various options, such as security,variable length.
Padding(fill up the space) extra zeros are added to this field toensure that the IP header is always a multiple of 32 bits.
Data contains upper-layer information, variable length up to 64 Kb.
8/3/2019 10 Routing Subnets
8/32Network Technology II Bridging Routing Fundamentals and Subnets page 8 of 32
Routing overview Routing takes place in the Network layer.
Routing allows individual addresses to be grouped together.
Routing finds most efficient path from one device to another.
Routers provide 2 key functions Maintain routing tables and network topology (utilizes routing
protocol).
Provide mechanisms for finding correct path (path determination).
Routers use metrics for path determination Hop Count, Delay, Bandwidth, Reliability, Cost, Load
Most common routable protocol is the Internet Protocol (IP). Other
routable protocols include:
IPX/SPX and AppleTalk - These protocols provide Layer 3 support.
Non-routable protocols do not provide Layer 3 support - The mostcommon non-routable protocol is NetBEUI. NetBEUI is a small,
fast, and efficient protocol that is limited to frame delivery within
one segment.
8/3/2019 10 Routing Subnets
9/32Network Technology II Bridging Routing Fundamentals and Subnets page 9 of 32
Routing versus switching
Switches are Layer 2 devices
Maintain ARP tables and MAC addresses for local broadcast
domain.
Routers are Layer 3 devices
Maintain IP and MAC tables for connected networks.
Routers block broadcasts.
Routers provide higher security and bandwidth control than
switches.
8/3/2019 10 Routing Subnets
10/32
Network Technology II Bridging Routing Fundamentals and Subnets page 10 of 32
Routed versus routing
Routed protocols transport data across a network.
Includes any network protocol suite that provides enough information inits network layer address to allow a router to forward it to the nextdevice and ultimately to its destination.
Defines the format and use of the fields within a packet.
The Internet Protocol (IP) and Novell's Internetwork Packet Exchange
(IPX) are examples of routed protocols. Other examples include
DECnet, AppleTalk, Banyan VINES, and Xerox Network Systems(XNS).
Routing protocols allow routers to choose the best path for datafrom source to destination. Provides processes for sharing route information.
Allows routers to communicate with other routers to update and
maintain the routing tables. Examples of routing protocols that support the IP routed protocol
include the Routing Information Protocol (RIP), Interior Gateway
Routing Protocol (IGRP), Open Shortest Path First (OSPF), Border
Gateway Protocol (BGP), and Enhanced IGRP (EIGRP).
8/3/2019 10 Routing Subnets
11/32
Network Technology II Bridging Routing Fundamentals and Subnets page 11 of 32
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.
Static routing configured by administrator.
Dynamic routing learned automatically from other routers and devices.
The destination address is obtained from the packet.
The mask of the first entry in the routing table is applied to the destinationaddress.
The masked destination and the routing table entry are compared.
If there is a match, the packet is forwarded to the port that is associatedwith that table entry.
If there is not a match, the next entry in the table is checked.
If the packet does not match any entries in the table, the router checks tosee if a default route has been set.
If a default route has been set, the packet is forwarded to the associatedport. A default route is a route that is configured by the networkadministrator as the route to use if there are no matches in the routingtable.
If there is no default route, the packet is discarded. Usually a message issent back to the sending device indicating that the destination wasunreachable.
8/3/2019 10 Routing Subnets
12/32
Network Technology II Bridging Routing Fundamentals and Subnets page 12 of 32
Routing tables Routers use routing protocols to build and maintain routing tables that
contain route information. Routing tables include the following:
Protocol type The type of routing protocol that created the routing tableentry.
Destination/next-hop associations These associations tell a router thata particular destination is either directly connected to the router, or that itcan be reached using another router called the next-hop on the way tothe final destination. When a router receives an incoming packet, it checksthe destination address and attempts to match this address with a routingtable entry.
Routing metric Different routing protocols use different routing metrics.Routing metrics are used to determine the desirability of a route. Forexample, the Routing Information Protocol (RIP) uses hop count as its onlyrouting metric. Interior Gateway Routing Protocol (IGRP) uses acombination of bandwidth, load, delay, and reliability metrics to create acomposite metric value.
Outbound interfaces The interface that the data must be sent out on, in
order to reach the final destination. Routers update tables by different updating protocols.
Periodic updates. Topology changes. Entire Tables. Partial Tables.
8/3/2019 10 Routing Subnets
13/32
Network Technology II Bridging Routing Fundamentals and Subnets page 13 of 32
Routing algorithms and metrics Routing protocols use different algorithms to decide which port an incoming
packet should be sent to Routing protocols often have one or more of the following design goals:
Optimization Optimization describes the capability of the routingalgorithm to select the best route. The route will depend on themetrics and metric weightings used in the calculation. For example,one algorithm may use both hop count and delay metrics, but mayconsider delay metrics as more important in the calculation.
Simplicity and low overhead The simpler the algorithm, the moreefficiently it will be processed by the CPU and memory in the router.This is important so that the network can scale to large proportions,such as the Internet.
Robustness (strong) and stability A routing algorithm shouldperform correctly when confronted (faced) by unusual or unforeseencircumstances, such as hardware failures, high load conditions, andimplementation errors.
Flexibility A routing algorithm should quickly adapt to a variety ofnetwork changes. These changes include router availability, routermemory, changes in bandwidth, and network delay.
Rapid convergence Convergence is the process of agreement byall routers on available routes. When a network event causeschanges in router availability, updates are needed to re-establishnetwork connectivity. Routing algorithms that converge slowly cancause data to be undeliverable.
8/3/2019 10 Routing Subnets
14/32
Network Technology II Bridging Routing Fundamentals and Subnets page 14 of 32
Routing algorithms and metrics (Contd) Metrics can be based on a single characteristic of a path, or can be
calculated based on several characteristics.
Bandwidth The data capacity of a link. Normally, a 10-MbpsEthernet link is preferable to a 64-kbps leased line.
Delay The length of time required to move a packet along each linkfrom source to destination. Delay depends on the bandwidth ofintermediate links, the amount of data that can be temporarily stored ateach router, network congestion, and physical distance.
Load The amount of activity on a network resource such as a routeror a link.
Reliability Usually a reference to the error rate of each network link.
Hop count The number of routers that a packet must travel throughbefore reaching its destination. Each router the data must pass throughis equal to one hop. A path that has a hop count of four indicates thatdata travelling along that path would have to pass through four routers
before reaching its final destination. If multiple paths are available to adestination, the path with the least number of hops is preferred. Ticks The delay on a data link using IBM PC clock ticks. One tick is
approximately 1/18 second. Cost An arbitrary value, usually based on bandwidth, monetary
expense, or other measurement, that is assigned by a networkadministrator.
8/3/2019 10 Routing Subnets
15/32
Network Technology II Bridging Routing Fundamentals and Subnets page 15 of 32
IGP and EGP An autonomous system is a network or set of networks under
common administrative control, such as the cisco.com domain.
An autonomous system consists of routers that present a consistent
(the same) view of routing to the external world.
Interior Gateway Protocols (IGP) - route data within an autonomous
system.
Routing Information Protocol (RIP) and (RIPv2).
Interior Gateway Routing Protocol (IGRP).
Enhanced Interior Gateway Routing Protocol (EIGRP).
Open Shortest Path First (OSPF).
Intermediate System-to-Intermediate System protocol (IS-IS).
Exterior Gateway Protocols (EGP).
EGPs route data between autonomous systems. An example of an
EGP is Border Gateway Protocol (BGP).
8/3/2019 10 Routing Subnets
16/32
Network Technology II Bridging Routing Fundamentals and Subnets page 16 of 32
Link state and distance vector Distance-Vector
Determines distance and direction (vector) to any link in internetwork
Routers send all or part of their routing tables to all other routers onperiodic basis (routing by rumor ).
Routing Information Protocol (RIP) The most common IGP in the
Internet, RIP uses hop count as its only routing metric.
Interior Gateway Routing Protocol (IGRP) This IGP was developed
by Cisco to address issues associated with routing in large,
heterogeneous (different kinds of) networks. Enhanced IGRP (EIGRP) This Cisco-proprietary IGP includes many
of the features of a link-state routing protocol. Because of this, it has
been called a balanced-hybrid protocol, but it is really an advanced
distance-vector routing protocol. Link-State
Respond quickly to network topology changes. When topology changes, send out Link-State Advertisement (LSAs).
Link-state algorithms typically use their databases to create routing
table entries that prefer the shortest path. Examples of link-state
protocols include Open Shortest Path First (OSPF) and Intermediate
System-to-Intermediate System (IS-IS).
8/3/2019 10 Routing Subnets
17/32
Network Technology II Bridging Routing Fundamentals and Subnets page 17 of 32
Routing protocols
RIP
Uses Hop Count as metric Max 15 Hops.
RIPv1 requires all devices in network use same subnet mask
classful routing that does not send subnet mask info in updates.
RIPv2 allows different subnet masks within network classless
routing that sends subnet mask info with updates VLSM.
IGRP A distance-vector routing protocol developed by Cisco.
IGRP can select the fastest available path based on delay,
bandwidth, load, and reliability.
IGRP higher maximum hop count limit than RIP. IGRP uses only classful routing.
8/3/2019 10 Routing Subnets
18/32
Network Technology II Bridging Routing Fundamentals and Subnets page 18 of 32
Routing protocols (Contd) OSPF is a link-state routing protocol developed by the Internet Engineering
Task Force (IETF) in 1988. OSPF was written to address the needs oflarge, scalable internetworks that RIP could not.
Intermediate System-to-Intermediate System (IS-IS) is a link-state routingprotocol used for routed protocols other than IP. Integrated IS-IS is anexpanded implementation of IS-IS that supports multiple routed protocolsincluding IP.
Like IGRP, EIGRP is a proprietary Cisco protocol. EIGRP is an advancedversion of IGRP. Specifically, EIGRP provides superior operating efficiencysuch as fast convergence and low overhead bandwidth. EIGRP is anadvanced distance-vector protocol that also uses some link-state protocolfunctions. Therefore, EIGRP is sometimes categorized as a hybrid routingprotocol.
Border Gateway Protocol (BGP) is an example of an External GatewayProtocol (EGP). BGP exchanges routing information between autonomoussystems while guaranteeing loop-free path selection. BGP is the principalroute advertising protocol used by major companies and ISPs on theInternet. BGP4 is the first version of BGP that supports classlessinterdomain routing (CIDR) and route aggregation. Unlike common InternalGateway Protocols (IGPs), such as RIP, OSPF, and EIGRP, BGP does notuse metrics like hop count, bandwidth, or delay. Instead, BGP makesrouting decisions based on network policies, or rules using various BGPpath attributes.
8/3/2019 10 Routing Subnets
19/32
Network Technology II Bridging Routing Fundamentals and Subnets page 19 of 32
The Mechanics of Subnetting
Whichever class of address needs to be subnetted, the following rules arethe same:
Total subnets = 2 to the power of the bits borrowed.
Total hosts= 2 to the power of the bits remaining.
Usable subnets = 2 to the power of the bits borrowed minus 2.
Usable hosts= 2 to the power of the bits remaining minus 2. Subnetworks are smaller divisions of networks.
They provide addressing flexibility.
Subnet addresses are assigned locally, usually by a network administrator.
Subnets reduce a broadcast domain.
8/3/2019 10 Routing Subnets
20/32
Network Technology II Bridging Routing Fundamentals and Subnets page 20 of 32
Subnet Addresses
Include Class A, B, or C network portion plus asubnet field and a host field.
Bits are borrowed from the host field and aredesignated as the subnet field.
Host (at least 2
bits)
SubnetNetwork
Network Host
8/3/2019 10 Routing Subnets
21/32
Network Technology II Bridging Routing Fundamentals and Subnets page 21 of 32
How many bits can I borrow?
68Class C
1416Class B
2224Class A
Maximum # of borrowed bitsSize of Host Field
You must remain at least 2 bits for the host part.
8/3/2019 10 Routing Subnets
22/32
Network Technology II Bridging Routing Fundamentals and Subnets page 22 of 32
Default Subnet Masks
Class A 255.0.0.0
Class B 255.255.0.0 Class C 255.255.255.0
8/3/2019 10 Routing Subnets
23/32
Network Technology II Bridging Routing Fundamentals and Subnets page 23 of 32
Calculating a Subnet
We will subnet the IP address:
223.14.17.0 What class IP address is this?
Class C
Step 1
Determine the default subnet mask
Class C default subnet mask:
255.255.255.0
Step 2 Determine the number of subnets needed and hosts on each to
determine how many bits to borrow from the host ID. Need:
13 subnets
10 hosts on each subnet
8/3/2019 10 Routing Subnets
24/32
Network Technology II Bridging Routing Fundamentals and Subnets page 24 of 32
Calculating a Subnet
223.14.17.0
X X X X H H H H
16 possiblesubnets
16 possible addresses inhost part (see next page)
Step 3
Figure the actual number of subnets and hosts by borrowing bits fromhost ID.
Lets see how many subnets and hosts we will have by borrowing 4
bits from the host.
8/3/2019 10 Routing Subnets
25/32
Network Technology II Bridging Routing Fundamentals and Subnets page 25 of 32
Calculating a Subnet Step 3 continued
We get 16 possiblesubnets and 16 possiblehosts for each
subnet because:For the 4 bits borrowed each bit can be a 1 or a 0 leaving
you with 24 or 16 possible combinations.
The same goes for the 4 leftover host bits.
Important: There are only 14 available hosts on each subnet.
Why? Because address with all '1' is the broadcast address and
that with all '0' is the network address.
A subnet address with all '0' is a zero subnet and that with all '1' is a
broadcast subnet.
The zero subnet and the broadcast subnet were reserved in yearspast but are now usable.
The ip subnet-zero command enables the router to use zero
subnet. The broadcast subnet can be used without special
configuration.
8/3/2019 10 Routing Subnets
26/32
Network Technology II Bridging Routing Fundamentals and Subnets page 26 of 32
Calculating a Subnet
Step 4Determine the subnet mask.
223.14.17.0
X X X X H H H H
Where X represents the borrowed bits for subnetting.
8/3/2019 10 Routing Subnets
27/32
Network Technology II Bridging Routing Fundamentals and Subnets page 27 of 32
Calculating a Subnet
Step 4 continued
Add the place values of X together to get thelast octet decimal value of the subnet mask.
128 + 64 + 32 + 16 = 240
The subnet mask is: 255.255.255.240
The subnet mask is used to reveal the subnetand host address fields in IP addresses.
last octet of the subnet mask=
27
26
25
24
23
22
21
20
1 1 1 1 0 0 0 0
8/3/2019 10 Routing Subnets
28/32
Network Technology II Bridging Routing Fundamentals and Subnets page 28 of 32
Calculating a Subnet
.112 - .1270000-111101118
.96 - .1110000-111101107
.80 - .950000-111101016
.64 - .790000-111101005
.48 - .630000-111100114
.32 - .470000-111100103
.16 - .310000-111100012
.0 -.150000-111100001
In DecimalHost BitsSubnet BitsSubnet #
Step 5
Determine the ranges of host addresses for each subnet.
8/3/2019 10 Routing Subnets
29/32
Network Technology II Bridging Routing Fundamentals and Subnets page 29 of 32
Calculating a Subnet
.240 - .2550000-1111111116
.224 - .2390000-1111111015
.208 - .2230000-1111110114
.192 - .2070000-1111110013
.176 - .1910000-1111101112
.160 - .1750000-1111101011
.144 - .1590000-1111100110
.128 -.1430000-111110009
In DecimalHost BitsSubnet BitsSubnet #
Step 5 continued ...
8/3/2019 10 Routing Subnets
30/32
Network Technology II Bridging Routing Fundamentals and Subnets page 30 of 32
Calculating a Subnet
Step 5 continued.
There are 16 possiblesubnets.
There are 16 possiblehosts on each subnet.
That equals 256 possible hosts.
What are our availablesubnets?
Ans: 16 (including the zero subnet and the broadcast
subnet)
What are our availablehosts on each subnet? Why?????
Ans: 14 available hosts on each subnet, because the
two host addresses with all '0' and all '1' are reserved,
i.e. number of hosts = 2n-1, where n = number of host
bits.
8/3/2019 10 Routing Subnets
31/32
Network Technology II Bridging Routing Fundamentals and Subnets page 31 of 32
Figuring Subnet Network Addresses
Step #1: Change the IP host address to binary. Step #2: Change the subnet mask to binary.
Step #3: Use the boolean operator AND to combine thetwo.
Step #4:Convert the network binary address to dotteddecimal.
8/3/2019 10 Routing Subnets
32/32
N t k T h l II B id i R ti F d t l d S b t 32 f 32
Figuring Subnet Network Addresses
IP Host 172.16.2.120
Subnet Mask 255.255.255.0
10101100.00010000.00000010.01111000
11111111.11111111.11111111.00000000
10101100.00010000.00000010.00000000
172.16.2.0This is the subnet network address. It is the lowestnumbered address on the subnet network. It can helpdetermine path.
AND