Escolar Documentos
Profissional Documentos
Cultura Documentos
CHAPTER 8
IP ADDRESSING, SUBNETTING, SUPERNETTING, CIDR TCP/IP
AND ROUTING PROTOCOLS
CONTENTS
8.1 OBJECTIVES
8.2 INTRODUCTION
8.3 TCP
8.4 IP
8.8 VLSM
8.9 CIDR
8.12 RIP
8.13 OSPF
8.16 BGPV4
CHAPTER 8
IP ADDRESSING, SUBNETTING, SUPERNETTING,
CIDR TCP/IP AND ROUTING PROTOCOLS
8.1OBJECTIVES
The objectives of this chapter is to understand
i) Concept of TCP/IP
ii) Concept of IP Address
iii) Concept of class A, B, and C IP addresses
iv) Concept of subnetting
v) Concept of VLSM
vi) Concept of Classless Inter-Domain Routing (CIDR)
vii) Concept of Routing Protocol
viii) RIP, OSPF and BGP
8.2 INTRODUCTION
In the mid-1990s, the Internet is a dramatically different network than when it
was first established in the early 1980s. There is a direct relationship between the
value of the Internet and the number of sites connected to the Internet. Over the past
few years, the Internet has experienced two major scaling issues as it has struggled to
provide continuous and uninterrupted growth. The eventual exhaustion of the IPv4
address space The ability to route traffic between the ever increasing number of
networks that comprise the Internet The first problem is concerned with the eventual
depletion of the IP address space.
8.3 TCP
TCP is a connection-oriented transport protocol that sends data as an
unstructured stream of bytes. By using sequence numbers and acknowledgment
messages, TCP can provide a sending node with delivery information about packets
transmitted to a destination node. Where data has been lost in transit from source to
destination, TCP can retransmit the data until either a timeout condition is reached or
until successful delivery has been achieved. TCP can also recognize duplicate
messages and will discard them appropriately. If the sending computer is transmitting
too fast for the receiving computer, TCP can employ flow control mechanisms to slow
data transfer. TCP can also communicate delivery information to the upper-layer
protocols and applications it supports. Figure below shows the relationship of the
Internet Protocol Suite to the OSI Reference Model
8.4 IP
IP is the primary layer 3 protocol in the Internet suite. In addition to
internetwork routing, IP provides error reporting and fragmentation and reassembly of
information units called datagrams for transmission over networks with different
maximum data unit sizes. IP represents the heart of the Internet protocol suite.
An IP address is divided into three parts. The first part designates the network
address, the second part designates the subnet address, and the third part designates
the host address.
CLASS A 0
CLASS B 10
CLASS C 110
Each Class B network address has a 16-bit network-prefix with the two
highest order bits set to 1-0 and a 14-bit network number, followed by a 16-bit host-
number. Class B networks are now referred to as"/16s" since they have a 16-bit
network-prefix.A maximum of 16,384 (214 ) /16 networks can be defined with up to
65,534 (216 -2) hosts per network.
8.7 SUBNETTING
In 1985, RFC 950 defined a standard procedure to support the subnetting, or division,
of a single Class A, B, or C network number into smaller pieces. Subnetting was
introduced to overcome some of the problems that parts of the Internet were
beginning to experience with the classful two-level addressing hierarchy:
Subnetting attacked the expanding routing table problem by ensuring that the
subnet structure of a network is never visible outside of the organization's private
network. The route from the Internet to any subnet of a given IP address is the same,
no matter which subnet the destination host is on. This is because all subnets of a
given network number use the same network-prefix but different subnet numbers. The
routers within the private organization need to differentiate between the individual
subnets, but as far as the Internet routers are concerned, all of the subnets in the
organization are collected into a single routing table entry. This allows the local
administrator to introduce arbitrary complexity into the private network without
affecting the size of the Internet's routing tables. Subnetting overcame the registered
number issue by assigning each organization one (or at most a few) network
number(s) from the IPv4 address space. The organization was then free to assign a
distinct subnetwork number for each of its internal networks. This allows the
organization to deploy additional subnets without needing to obtain a new network
number from the Internet.
The router accepts all traffic from the Internet addressed to network 130.5.0.0,
and forwards traffic to the interior subnetworks based on the third octet of the classful
address. The deployment of subnetting within the private network provides several
benefits: The size of the global Internet routing table does not grow because the site
administrator does not need to obtain additional address space and the routing
advertisements for all of the subnets are combined into a single routing table entry.
The local administrator has the flexibility to deploy additional subnets without
obtaining a new network number from the Internet. Route flapping (i.e., the rapid
changing of routes) within the private network does not affect the Internet routing
table since Internet routers do not know about the reachability of the individual
subnets - they just know about the reachability of the parent network number.
Extended-Network-Prefix Internet routers use only the network-prefix of the
destination address to route traffic to a subnetted environment. Routers within the
subnetted environment use the extended-network- prefix to route traffic between the
individual subnets. The extended-network-prefix is composed of the classful network-
prefix and the subnet-number.
The extended-network-prefix has traditionally been identified by the subnet
mask. For example, if you have the /16 address of 130.5.0.0 and you want to use the
entire third octet to represent the subnet-number, you need to specify a subnet mask of
255.255.255.0. The bits in the subnet mask and the Internet address have a one-to-one
correspondence. The bits of the subnet mask are set to 1 if the system examining the
address should treat the corresponding bit in the IP address as part of the extended-
network- prefix. The bits in the mask are set to 0 if the system should treat the bit as
part of the host-number.
The standards describing modern routing protocols often refer to the extended-
network-prefix- length rather than the subnet mask. The prefix length is equal to the
number of contiguous one-bits in the traditional subnet mask. This means that
specifying the network address 130.5.5.25 with a subnet mask of 255.255.255.0 can
also be expressed as 130.5.5.25/24. The /<prefix-length> notation is more compact
and easier to understand than writing out the mask in its traditional dotted-decimal
format.
8.8 VARIABLE LENGTH SUBNET MASKS (VLSM)
In 1987, RFC 1009 specified how a subnetted network could use more than
one subnet mask. When an IP network is assigned more than one subnet mask, it is
considered a network with "variable length subnet masks" since the extended-
network-prefixes have different lengths.RIP-1 Permits Only a Single Subnet Mask
When using RIP-1, subnet masks have to be uniform across the entire network-prefix.
RIP-1 allows only a single subnet mask to be used within each network number
because it does not provide subnet mask information as part of its routing table update
messages. In the absence of this information, RIP-1 is forced to make very simple
assumptions about the mask that should be applied to any of its learned routes.
How does a RIP-1 based router know what mask to apply to a route when it
learns a new route from a neighbor? If the router has a subnet of the same network
number assigned to a local interface, it assumes that the learned subnetwork was
defined using the same mask as the locally configured interface. However, if the
router does not have a subnet of the learned network number assigned to a local
interface, the router has to assume that the network is not subnetted and applies the
route's natural classful mask.Assuming that Port 1 of a router has been assigned the IP
address 130.24.13.1/24 and that Port 2 has been assigned the IP address
200.14.13.2/24. If the router learns about network 130.24.36.0 from a neighbor, it
applies a /24 mask since Port 1 is configured with another subnet of the 130.24.0.0
network. However, when the router learns about network 131.25.0.0 from a neighbor,
it assumes a "natural" /16 mask since it has no other masking information
available.How does a RIP-1 based router know if it should include the subnet-number
bits in a routing table update to a RIP-1 neighbor? A router executing RIP-1 will only
advertise the subnet-number bits on another port if the update port is configured with
a subnet of the same network number. If the update port is configured with a different
subnet or network number, the router will only advertise the network portion of the
subnet route and "zero-out" the subnet-number field.
For example, assume that Port 1 of a router has been assigned the IP address
130.24.13.1/24 and that Port 2 has been assigned the IP address 200.14.13.2/24. Also,
assume that the router has learned about network 130.24.36.0 from a neighbor. Since
Port 1 is configured with another subnet of the 130.24.0.0 network, the router assumes
that network 130.24.36.0 has a /24 subnet mask. When it comes to advertise this
route, it advertises 130.24.36.0 on Port 1, but it only advertises 130.24.0.0 on Port
2.For these reasons, RIP-1 is limited to only a single subnet mask for each network
number.
However, there are several advantages to be gained if more than one subnet
mask can be assigned to a given IP network number: Multiple subnet masks permit
more efficient use of an organization's assigned IP address space.Multiple subnet
masks permit route aggregation which can significantly reduce the amount of routing
information at the "backbone" level within an organization's routing domain.Efficient
Use of the Organization's Assigned IP Address Space.VLSM supports more efficient
use of an organization's assigned IP address space. One of the major problems with
the earlier limitation of supporting only a single subnet mask across a given network-
prefix was that once the mask was selected, it locked the organization into a fixed-
number of fixed-sized subnets. For example, assume that a network administrator
decided to configure the 130.5.0.0/16 network with a /22 extended-network-prefix.
Conceptually, a network is first divided into subnets, some of the subnets are
further divided into sub-subnets, and some of the sub-subnets are divided into sub 2
-subnets. This allows the detailed structure of routing information for one subnet
group to be hidden from routers in another subnet group.
11.0.0.0./8
11.1.0.0/16
11.2.0.0/16
11.3.0.0/16
11.252.0.0/16
11.253.0.0/16
11.254.0.0/16
11.1.1.0/24
11.1.2.0/24
11.1.253.0/24
11.1.254.0/24
11.253.32.0/19
11.253.64.0/19
11.253.160.0/19
11.253.192.0/19
11.1.253.32/27
11.1.253.64/27
11.1.253.160/27
11.1.253.192/27
The 11.0.0.0/8 network is first configured with a /16 extended-network-prefix.
The 11.1.0.0/16 subnet is then configured with a /24 extended-network-prefix and the
11.253.0.0/16 subnet is configured with a /19 extended-network-prefix. Note that the
recursive process does not require that the same extended-network-prefix be assigned
at each level of the recursion. Also, the recursive sub-division of the organization's
address space can be carried out as far as the network administrator needs to take it.
Likewise, Router C is able to summarize the six subnets behind it into a single
advertisement (11.253.0.0/16). Finally, since the subnet structure is not visible outside
of the organization, Router A injects a single route into the global Internet's routing
table -11.0.0.0/ 8 (or 11/8).
The near-term exhaustion of the Class B network address space. The rapid
growth in the size of the global Internet's routing tables. The eventual exhaustion of
the 32-bit IPv4 address space. Projected Internet growth figures made it clear that the
first two problems were likely to become critical by 1994 or 1995. The response to
these immediate challenges was the development of the concept of Supernetting or
Classless Inter-Domain Routing (CIDR). The third problem, which is of a more long-
term nature, is currently being explored by the IP Next Generation (IPng or IPv6)
working group of the IETF. CIDR was officially documented in September 1993 in
RFC 1517, 1518, 1519, and 1520. CIDR supports two important features that benefit
the global Internet routing system: CIDR eliminates the traditional concept of Class
A, Class B, and Class C network addresses. This enables the efficient allocation of the
IPv4 address space which will allow the continued growth of the Internet until IPv6 is
deployed. CIDR supports route aggregation where a single routing table entry can
represent the address space of perhaps thousands of traditional classful routes. This
allows a single routing table entry to specify how to route traffic to many individual
network addresses. Route aggregation helps control the amount of routing information
in the Internet's backbone routers, reduces route flapping (rapid changes in route
availability), and eases the local administrative burden of updating external routing
information. Without the rapid deployment of CIDR in 1994 and 1995, the Internet
routing tables would have in excess of 70,000 routes (instead of the current 30,000+)
and the Internet would probably not be functioning today!
CIDR Promotes the Efficient Allocation of the IPv4 Address Space CIDR
eliminates the traditional concept of Class A, Class B, and Class C network addresses
and replaces them with the generalized concept of a "network-prefix." Routers use the
network-prefix, rather than the first 3 bits of the IP address, to determine the dividing
point between the network number and the host number. As a result, CIDR supports
the deployment of arbitrarily sized networks rather than the standard 8-bit, 16- bit, or
24-bit network numbers associated with classful addressing. In the CIDR model, each
piece of routing information is advertised with a bit mask (or prefix-length). The
prefix-length is a way of specifying the number of leftmost contiguous bits in the
network-portion of each routing table entry. For example, a network with 20 bits of
network-number and 12-bits of host-number would be advertised with a 20-bit prefix
length (a /20).
The clever thing is that the IP address advertised with the /20 prefix could be a
former Class A, Class B, or Class C. Routers that support CIDR do not make
assumptions based on the first 3-bits of the address, they rely on the prefix-length
information provided with the route. In a classless environment, prefixes are viewed
as bit wise contiguous blocks of the IP address space. For example, all prefixes with a
/20 prefix represent the same amount of address space (212 or 4,096 host addresses).
Furthermore, a /20 prefix can be assigned to a traditional Class A, Class B, or Class C
network number.
It is important to note that there may be severe host implications when you
deploy CIDR based networks. Since many hosts are classful, their user interface will
not permit them to be configured with a mask that is shorter than the "natural" mask
for a traditional classful address. For example, potential problems could exist if you
wanted to deploy 200.25.16.0 as a /20 to define a network capable of supporting 4,094
(2 12 -2) hosts. The software executing on each end station might not allow a
traditional Class C (200.25.16.0) to be configured with a 20-bit mask since the natural
mask for a Class C network is a 24-bit mask. If the host software supports CIDR, it
will permit shorter masks to be configured. However, there will be no host problems
if you were to deploy the 200.25.16.0/20 (a traditional Class C) allocation as a block
of 16 /24s since non-CIDR hosts will interpret their local /24 as a Class C. Likewise,
130.14.0.0/16 (a traditional Class B) could be deployed as a block of 255 /24s since
the hosts will interpret the /24s as subnets of a /16. If host software supports the
configuration of shorter than expected masks, the network manager has tremendous
flexibility in network design and address allocation.
Port IP address
(i.e., 132.2.2.2) 133.3.0.0 133.4.0.0
2
2.2 3.3
132.2.0.0
1 3.4 4.5
1.1 3
130.1.0.0
0 Hop
134.4.0.0
1
2
134.3.0.
1Hop 0
2Hop
134.5.0.
0
Metric used by RIP is hop count, with 1 signifying a directly connected network of
the advertising router & 16 signifying unreachable network
RIP PARAMETERS
RIP packets are carried over UDP and for routing purposes use port 520.
Unless triggered by a configuration change RIP packets are sent every 30 seconds. If
no update packets re received for within 180 seconds the distance for that route is set
to infinity and will subsequently be removed from the routing table. The address
0.0.0.0. represents the default route to exit the AS.
Routing Information Protocol (Version 1)
RIP process operates from UDP port 420. Router sends a Response message
out to every RIP-enabled interface every 30 seconds. RIP defines two message type:
Request Messages and
Response Messages
RIP RIP
Header Data
UDP UDP
Header Data
IP IP
Header Data
D S T D CR
A A F ata C
RIP ALGORITHM
RIP defines the “best” route as the one with least number of routing hops.
Once a router is installed, or started, it should send messages to all of its neighbors.
A B C D
A B C D
A Bigger Update
Z 1 Route
Route
Hop
Y 1 Hop X
1
Router Y
Z A Y 1
Route HopX
Route Hop
Route Hop
Network Hop Router
WPort 1 Local 2 W 1
X 1
X 1 Local 1 Y 2
Y 2 B 1 Z 3
Z 3 B 1
E1
10.1.2.0 E1
E3
Router A Router B
Target
RIP will select 64 k - 9.6 k Route as it has got less hop than other E1-E3-E1 Route
150.1.0.0
160.1.0.0. 150.1.3.0
0
160.1.0.0 150.1.1.0 150.1.3.0
255.255.255.0 255.255.255.0 255.255.255.0
8.13 OSPF
OSPF is high functionality, Non-propriety (IGP Internet Gate way Protocol for
TCP/IP protocol family. OSPF based on link state technology Authentication of
routing updates It Supports the following: -
• VLSM (Variable Length Subnet Mark), CIDR super netting (It won’t Support
RIP)
• Route Summarization
• OSPF uses IP multicast to send link state updates. This ensures less processing
on routers that are not listening to OSPF packets.
• Updates are sent only in case of routing changes occur instead of periodically.
• Better use of Bandwidth
• Better convergence
LINK STATE
OSPF is a link state, we can think of a link as being an Interface and of its
relationship to its neighboring routers. A descriptions of interface include:
IP address of interface, the Mark, the type of N/W it is connected to, routers
connected to that N/W.
The collection of all these link state, would from Link State Database.
LINK STATE ALGORITHM
OSPF uses link state Algorithm to build and calculate the shortest path to all
its known destination. Upon initialization or due to any change in routing information,
a router will generate a link state advertisement. All router will exchange link states
by means of flooding. Each router that receives a link state update should store a copy
In its link state database and then propagate the update to other routers. After the
database of each router is completed the router with calculate the shortest path Tree
for all destinations (using Dijkastra Algorithm ). In case of no changes in the OSPF
N/W occur such as cost of link or a N/W being added or deleted, OSPF should be
very quite. Any changes that are occur are communicated via link state packets, and
the Dijkastra algorithm is recalculated to find shortest path.
SHORTEST PATH ALGORITHM
Algorithm places each router at the root of a tree and calculate shortest path to
each destination based on the communication, cost required to reach that destination
OSPF cost:
Cost (called metric) of an interface in OSPF is overhead required to send
packets across a certain interface. Cost is inversely proportional to the Bandwidth of
that interface. Higher Bandwidth indicates lover cost.
Area and Router Types
OSPF uses folding to exchange link state updates bet routers. Any change in
routing flooded to all routers in the N/W. Areas are introduced to put a boundary on
the explosion of link state updates. Dijkastra algorithm on a router limited to within
an area. All routers within an area have the exact link state database. Routers that
belongs to multiple areas, called Area Border Routers (ABR). ABR disseminating
routing information or routing changes between areas. A router that has all of its
interfaces with in the same area is called An Internet Router (IR)
Router that has interface in multiple areas is called Area Border Router (ABR)
ABR connect one or more areas to backbone and act as a gateway for inter area
traffic. An ABR has at least one interface that belongs to backbone and Maintain
separate link state data base for each of its area. That is why ABR has more memory
and powerful processor. All ABR are backbone router but all backbone router are not
ABR. An IR whose interfaces all belong to areas is also backbone router. ASBR
(Asynchronous System Boundary router) are gateways for external traffic, injecting
traffic routes into OSPF domain that were Learned from some other protocol, such as
the BGP and EIGRP Processes. An ASBR can be located anywhere within the OSPF
as, it may be IR, backbone Router or ABR
OSPF OVERVIEW
Upon initialization, each router records information about all its Interfaces.
Each router builds a packet know as the Link State Advertisement (LSA). Contains a
listing of all recently seen routers and their cost LSAs are restricted to being
forwarded only in the Originated area. Received LSAs are flooded to all other routers.
Each router makes a copy of the most recently “seen” LSA. Each outer has complete
knowledge of the topology of the Area to which it belongs. Adjacencies are formed
between a Designated Router ‘DR’ and Backup DR and other routers on a network.
Shortest Path Trees are constructed after routers exchange their databases using
Dijkstra’s algorithm. Router algorithm run only when changes occur (or every 30
minutes, Whichever is shorter.
Stub areas
Area 0
AS 2
Contain AS2
Route entries
Does not
Contain AS2 Area 2
Area 1 Route entries
An area that has only one entry and one exit point (must be the same
area).Used to reduce the number of external advertisements. A stub area blocks AS
external link advertisements.
Stub Network: A network which is connected to only one router e.g. a LAN to
a router.
static routes, or in a more complicated but robust way, with active internal routing
protocol such a s RIP, RIPv2, OSPF and IS-IS.
It’s obviously critical that any box inside your network know how to get
(directly or indirectly) to any other box inside your network. Before your invite
people to send data to your network, you’ve got to have a running and happy network
to take the data. If your default route into one or more providers, external routing is
not something you have in your network. But if you do want to “peer’ with someone
– or to “multi-home” to multiple providers and have a little bit more control over
where your data goes on the internet, you will be taking at least some external routes
into your network and will do so with BGP.
set of routers that operate under the same administration. BGP is often run among the
networks of Internet service providers (ISPs).
BGP went through different phases and improvements from it earlier version, BGP1,
in 1989 to today’s version, BGP4, deployment of which started in 1993. BGP$ is the
first version that handles aggregation (CIDR), super netting & allows the
announcement of “classless routes”- routes that aren’t strictly on “class A”, “ Class
B”, or “Class C” boundaries – but instead can also be “subnets” or “ super nets”.
BGP imposes no restrictions on the underlying internet topology. It assumes
that routing within an autonomous system is not via an intra-autonomous system
routing protocol. BGP constructs a graph of autonomous systems based on the
information exchanged between BGP neighbors. This directed graph environment is
sometimes referred to as a tree. As far as BGP is concerned, the whole internet is a
graph of Ass, with a path, and the collection of path information forms a route to
reach a specific destination. BGP ensures that loop free inter domain routing is
maintain
AS2
AS1
AS3
AS n-
AS4 1
AS
AS5 n