0% found this document useful (0 votes)
5 views

Unit 3

Uploaded by

Manish Nagar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Unit 3

Uploaded by

Manish Nagar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 162

Computer Networks

( KCS-603 )
UNIT 3
Network Layer Design Goals

1. The services provided by the network layer


should be independent of the subnet topology.

2. The Transport Layer should be shielded from the


number, type and topology of the subnets
present.

3. The network addresses should be uniform (even


across LANs and WANs).

Computer Networks
Machine A Machine B

Application Application

Transport Transport
Router/Gateway
Internet Internet Internet
Network Network
Network
Interface Interface
Interface

Network 1 Network 2

Computer Networks
Network Layer Design Issues
• Store-and-forward packet switching
• Services provided to transport layer
• Implementation of connectionless service
• Implementation of connection-oriented service
• Comparison of virtual-circuit and datagram networks

Computer Networks
Design issues
• Store-and-forward packet switching
• Equipment of: carrier <> customer
• Algorithm at router
• Receive packet
• Check packet (e.g. checksum)
• Forward packet

Computer Networks
Design issues: services
• Interface
• Important: = interface between carrier and customer
• Designed with following goals in mind:
• Services should be independent of the subnet technology
• Transport layer should be shielded from the number, type,
topology of the subnets
• Network addresses should use a uniform numbering plan, even
across LANs and WANs
• Connections?
• Connection-oriented <> Connectionless!

Computer Networks
Design issues: services
• Connection-oriented <> Connectionless
• PTTs: connection-oriented
• 100 years of experience with the world-wide telephone
system
• Connection time  billing!
• Internet
• Subnets are inherently unreliable
• Real issue: where to put the complexity as some/many
applications require reliable transfer (~ connection-
oriented service)
• Network layer
• Transport layer

Computer Networks
Design issues: services
• Connection-oriented <> Connectionless
(cont.)
• In favour of connectionless service
• Computing power is cheap: hosts can handle the
complexity
• Subnet is a large, long lasting investment: keep it
simple
• For some applications speedy delivery (low,
constant delay) is important
• In favour of connection-oriented service
• Users want a reliable trouble-free service
• Some services are easier to provide on top of
connection-oriented service

Computer Networks
Subnet Types
1. Virtual circuits (VC) - connection setup (choosing of the route to the
destination), forwarding packets over the exactly that route (the
router maintains a table with the unique virtual circuit # ), and
connection release (termination of the VC).

2. Datagrams - no routers are working in advance, even if the service is


connection oriented. Each packet is sent independently from the
previous ones and routed over a different route. The routers do not
maintain virtual circuit #s. Each packet is carrying the full destination
address. Establishment of connections is done by the end stations,
and does not require any special work from the routers.

Computer Networks
• Virtual Circuit Network
• Routes chosen at connection time
• Connection identified by a virtual circuit number (VCn)
• Primary service of subnet is connection-oriented

Computer Networks
• Datagram subnet
• Each packet is routed independently
• Subnet has more work to do
• More robust, easier to adapt to failures and congestion

Change of routing table

Computer Networks - Rajat Verma


Comparison of Virtual-Circuit and Datagram Networks

Computer Networks - Rajat Verma


Function of Network Layer
• Get packets from source host to destination host
• Routing: should know about topology of subnet
• Congestion: should avoid overloading some communication
lines and routers
• Quality of service: offer the appropriate service
• Internetworking: deal with network differences, if source
and destination are connected to different networks

Computer Networks - Rajat Verma


Routing
Routing is the act of moving information across an inter-network from a source to a
destination. Along the way, at least one intermediate node typically is encountered. It’s
also referred to as the process of choosing a path over which to send the packets.
Routing is often contrasted with bridging, which might seem to accomplish precisely the
same thing to the casual observer. The primary difference between the two is that
bridging occurs at Layer 2 (the data link layer) of the OSI reference model, whereas
routing occurs at Layer 3 (the network layer). This distinction provides routing and
bridging with different information to use in the process of moving information from
source to destination, so the two functions accomplish their tasks in different ways. The
routing algorithm is the part of the network layer software responsible for deciding
which output line an incoming packet should be transmitted on, i.e. what should be the
next intermediate node for the packet.
Routing protocols use metrics to evaluate what path will be the best for a packet to
travel. A metric is a standard of measurement; such as path bandwidth, reliability, delay,
current load on that path etc; that is used by routing algorithms to determine the
optimal path to a destination. To aid the process of path determination, routing
algorithms initialize and maintain routing tables, which contain route information. Route
information varies depending on the routing algorithm used.

Computer Networks
- Rajat Verma
Desirable properties of a Routing Algorithm
Correctness and simplicity: The packets are to be correctly
delivered. Simpler the routing algorithm, it is better.

Robustness: Ability of the network to deliver packets via some


route even in the face of failures.

Stability: The algorithm should converge to equilibrium fast in


the face of changing conditions in the network.

Fairness and optimality: obvious requirements, but conflicting.

Efficiency: Minimum overhead

- Rajat Verma
Design Parameters of a Routing Algorithm
While designing a routing protocol it is necessary to take into
account the following design parameters:

Performance Criteria: Number of hops, Cost, Delay,


Throughput, etc.
Decision Time: Per packet basis (Datagram) or per session
(Virtual-circuit) basis
Decision Place: Each node (distributed), Central node
(centralized), Originated node (source)
Network Information Source: None, Local, Adjacent node,
Nodes along route, All nodes
Network Information Update Timing: Continuous, Periodic,
Major load change, Topology change

Computer Networks
- Rajat Verma
Classification of a Routing Algorithm
Static versus Adaptive

Single-path versus multi-path

Intra-domain versus inter-domain

Flat versus hierarchical

Link-state versus distance vector

Host-intelligent versus router-intelligent


- Rajat Verma
Static versus Adaptive
This category is based on how and when the routing tables are set-up and how they
can be modified, if at all. Adaptive routing is also referred as dynamic routing and Non-
adaptive is also known as static routing algorithms. Static routing algorithms are hardly
algorithms at all; the table mappings are established by the network administrator
before the beginning of routing. These mappings do not change unless the network
administrator alters them. Algorithms that use static routes are simple to design and
work well in environments where network traffic is relatively predictable and where
network design is relatively simple. Routing decisions in these algorithms are in no way
based on current topology or traffic.

Because static routing systems cannot react to network changes, they generally are
considered unsuitable for today's large, constantly changing networks. Most of the
dominant routing algorithms today are dynamic routing algorithms, which adjust to
changing network circumstances by analyzing incoming routing update messages. If the
message indicates that a network change has occurred, the routing software
recalculates routes and sends out new routing update messages. These messages
permeate the network, stimulating routers to rerun their algorithms and change their
routing tables accordingly. Dynamic routing algorithms can be supplemented with static
routes where appropriate.
- Rajat Verma
Single-Path versus Multi-path
This division is based upon the number of paths a router stores for a single
destination. Single path algorithms are where only a single path (or rather
single next hop) is stored in the routing table. Some sophisticated routing
protocols support multiple paths to the same destination; these are known as
multi-path algorithms. Unlike single-path algorithms, these multipath
algorithms permit traffic multiplexing over multiple lines. The advantages of
multipath algorithms are obvious: They can provide substantially better
throughput and reliability. This is generally called load sharing.

Intradomain versus Interdomain


Some routing algorithms work only within domains; others work within and
between domains. The nature of these two algorithm types is different. It
stands to reason, therefore, that an optimal intra-domain-routing algorithm
would not necessarily be an optimal inter-domain-routing algorithm.

- Rajat Verma
Flat Versus Hierarchical
Some routing algorithms operate in a flat space, while others use routing hierarchies.
In a flat routing system, the routers are peers of all others. In a hierarchical routing
system, some routers form what amounts to a routing backbone. Packets from non-
backbone routers travel to the backbone routers, where they are sent through the
backbone until they reach the general area of the destination. At this point, they travel
from the last backbone router through one or more non-backbone routers to the final
destination.
Routing systems often designate logical groups of nodes, called domains, autonomous
systems, or areas. In hierarchical systems, some routers in a domain can communicate
with routers in other domains, while others can communicate only with routers within
their domain.
In very large networks, additional hierarchical levels may exist, with routers at the
highest hierarchical level forming the routing backbone. The primary advantage of
hierarchical routing is that it mimics the organization of most companies and therefore
supports their traffic patterns well. Most network communication occurs within small
company groups (domains). Because intradomain routers need to know only about
other routers within their domain, their routing algorithms can be simplified, and,
depending on the routing algorithm being used, routing update traffic can be reduced
accordingly.
- Rajat Verma
Host-Intelligent Versus Router-Intelligent
This division is on the basis of whether the source knows about the
entire route or just about the next-hop where to forward the packet.
Some routing algorithms assume that the source end node will
determine the entire route. This is usually referred to as source routing.

In source-routing systems, routers merely act as store-and-forward


devices, mindlessly sending the packet to the next stop. These
algorithms are also referred to as Host-Intelligent Routing, as entire
route is specified by the source node. Other algorithms assume that
hosts know nothing about routes. In these algorithms, routers
determine the path through the internet based on their own strategy.

In the first system, the hosts have the routing intelligence. In the latter
system, routers have the routing intelligence.

- Rajat Verma
Routing Algorithm Metrics
Routing tables contain information used by switching software to
select the best route. In this section we will discuss the different nature
of information they contain, and the way they determine that one route
is preferable to others? Routing algorithms have used many different
metrics to determine the best route. Sophisticated routing algorithms
can base route selection on multiple metrics, combining them in a single
(hybrid) metric.

All the following metrics have been used:


• Path length
• Delay
• Bandwidth
• Load
• Communication cost
• Reliability

- Rajat Verma
Routing Algorithms
 Properties
 Shortest Path Routing
 Flooding
 Distance Vector Routing Most important
 Link State routing
algorithms!
 Hierarchical routing
 Broadcast routing
 Multicast routing
 Routing for mobile hosts
 Routing in Ad Hoc Networks
 Node Lookup in Peer-to-Peer Networks

Computer Networks
- Rajat Verma
Optimality principle: sink tree

Destination

Computer Networks
- Rajat Verma
Routing: shortest path
 Algorithm of Dijkstra: shortest path in graph
o Graph
• Node = router
• Arc = communication line
o Metric
• Number of hops
• Geographic distance
• Mean queueing and transmission delay

Computer Networks
- Rajat Verma
Routing: shortest path

Initial node

Elements of algorithm:
• Mark all nodes as free: 
• Mark initial node as selected: 
• repeat till destination is selected:
•Label all free nodes reachable from selected nodes with shortest
distance to a selected node
•Select free node with shortest distance to a selected node and
mark it as selected

Computer Networks
- Rajat Verma
Routing: shortest path

Computer Networks
- Rajat Verma
Routing: flooding
Flooding requires no network information whatsoever. Every incoming
packet to a node is sent out on every outgoing line except the one it
arrived on. All possible routes between source and destination are tried.
A packet will always get through if a path exists. As all routes are tried, at
least one packet will pass through the shortest route. All nodes, directly
or indirectly connected, are visited. Main limitation flooding is that it
generates vast number of duplicate packets. It is necessary to use
suitable damping mechanism to overcome this limitation. One simple is
to use hop-count; a hop counter may be contained in the packet header,
which is decremented at each hop, with the packet being discarded when
the counter becomes zero. The sender initializes the hop counter. If no
estimate is known, it is set to the full diameter of the subnet. Another
approach is keep track of packets, which are responsible for flooding
using a sequence number and avoid sending them out a second time. A
variation, which is slightly more practical, is selective flooding. The
routers do not send every incoming packet out on every line, only on
those lines that go in approximately in the direction of destination.
Computer Networks
- Rajat Verma
Routing: flooding
Some of the important utilities of flooding are:
 Flooding is highly robust, and could be used to
send emergency messages (e.g., military
applications).
 It may be used to initially set up the route in a
virtual circuit.
 Flooding always chooses the shortest path, since
it explores every possible path in parallel.
 Can be useful for the dissemination of important
information to all nodes (e.g., routing
information).
Computer Networks
- Rajat Verma
Routing: flooding

 Duplicates!! How to limit?


o Hop counter
• Decrement in each router
• Discard packet if counter is 0
• Initialisation?
o Sequence number in packet
• Avoid sending the same packet a second time
• Keep in each router per source a list of packets already seen
 Useful?

Computer Networks
- Rajat Verma
Routing Algorithms
 Properties
 Shortest Path Routing
 Flooding
 Distance Vector Routing Most important
 Link State routing
algorithms!
 Hierarchical routing
 Broadcast routing
 Multicast routing
 Routing for mobile hosts
 Routing in Ad Hoc Networks
 Node Lookup in Peer-to-Peer Networks

Computer Networks
- Rajat Verma
Routing: Distance Vector
Distance vector algorithms (also known as Bellman-Ford
algorithms) is a Adaptive algorithm.

Key features of the distance vector routing are as


follows:
o • The routers share the knowledge of the entire
autonomous system
o Sharing of information takes place only with the
neighbors
o Sharing of information takes place at fixed regular
intervals, say every 30 seconds.

Computer Networks
- Rajat Verma
Routing: Distance Vector (contd.)
Routing table for A
To cost via
A 0 -
B 12 B
C 25 B
D 40 B
E 14 E
F 23 E
G 18 B
H 17 J
I 21 E
J 9 J
K 24 J
L 29 J
Computer Networks
- Rajat Verma
Routing: Distance Vector (contd.)
 Algorithm
o At each step within a router:
• Get routing tables from neighbours
• Compute distance to neighbours
• Compute new routing table
o Characteristics:
• Iterative
• Asynchronous
• Distributed
Computer Networks
- Rajat Verma
Routing: Distance Vector (contd.)

Computer Networks
- Rajat Verma
Routing: Distance Vector (contd.)
 Distributed algorithm
o Triggers:
• Change in delay to neighbour
• Receive new table from neighbour
o Update local tables
o If changed: forward routing tables to neighbours
 Asynchronous
 Iterative
o Stops? How fast are changes propagated?
• Good news?
• Bad news?
Computer Networks
- Rajat Verma
Routing: Distance Vector (contd.)
Count to Infinity Problem

Good news:
• A comes up again

Only distances to A

Faster not possible!!!

Computer Networks
- Rajat Verma
Routing: Distance Vector (contd.)
Count to Infinity Problem
Bad news:
• A goes down

Loops!!
Slow!!

 = 5?

Computer Networks
- Rajat Verma
Routing: Link State
Key Features:

 The routers share the knowledge only about their neighbors


compared to all the routers in the autonomous system
 Sharing of information takes place only with all the routers in
the internet, by sending small updates using flooding compared
to sending larger updates to their neighbors
 Sharing of information takes place only when there is a change,
which leads to lesser internet traffic compared to distance
vector routing.

Computer Networks
- Rajat Verma
Routing: Link State
Overview of algorithm:
 Each router must
o Discover its neighbours and learn their network
addresses
o Measure the delay or cost to each of its neighbours
o Construct a packet with these distances
o Send this packet to all other routers
o Compute the shortest path to every other router

Computer Networks
- Rajat Verma
Routing: Link State (contd.)
Algorithm:
 Learning about neighbours:
o Upon boot of router
• Send HELLO packet on each point-to-point line
• Routers are supposed to send reply with a globally unique
name

o LAN
model

Computer Networks
- Rajat Verma
Routing: Link State (contd.)
Algorithm:
 Building link state packets
o Packet containing: o When to build?
• Identity of sender • periodically

• Sequence number + age • when significant events occur


• For each neighbour: name + distance

Computer Networks
- Rajat Verma
Routing: Link State (contd.)
 Distributing link state packets
o Trickiest part of algorithm Algorithm:
• Arrival time for packets different
• How to keep consistent routing tables
o Basic algorithm
• Flooding +
• Sequence number (in each packet) to limit duplicates
o Manageable problems
• Wrap around of sequence numbers:
• Wrong sequence number used:
– lost in case of crash
– Corruption
o Refinements
• Link state packets are not forwarded immediately
• During holding time:
– duplicates are discarded
– Old packets are thrown out
Computer Networks
- Rajat Verma
Packet buffer for router B
Routing: Link State (contd.) o ACK flag: ACK to send
o Send flag: packet to forward

Computer Networks
- Rajat Verma
Routing: Link State (contd.)
Algorithm:
 Computing new routes:
o With a full set of link state packets, a router can:
• Construct the entire subnet graph
• Run Dijkstra’s algorithm to compute the shortest path
to each destination
o Problems for large subnets
• Memory to store data
• Compute time

Computer Networks
- Rajat Verma
Differentiate between
Link State and Distance Vector routing algorithms
 Link-state algorithms (also known as shortest path first algorithms)
flood routing information to all nodes in the internetwork. Each
router, however, sends only the portion of the routing table that
describes the state of its own links. In link-state algorithms, each
router builds a picture of the entire network in its routing tables.

 Distance vector algorithms (also known as Bellman-Ford algorithms)


call for each router to send all or some portion of its routing table,
but only to its neighbors. In essence, link-state algorithms send
small updates everywhere, while distance vector algorithms send
larger updates only to neighboring routers. Distance vector
algorithms know only about their neighbors.
Computer Networks
- Rajat Verma
Comparison of Link State and Distance Vector
routing algorithms
Message complexity Robustness: what happens if
 LS: with n nodes, E links, O(nE) router malfunctions?
messages sent LS:
 DV: exchange between neighbors
o Node can advertise incorrect
only
link cost
Speed of Convergence o Each node computes only its
 LS: relatively fast own table
 DV: convergence time varies DV:
o May be routing loops o DV node can advertise
o Count-to-infinity problem incorrect path cost
o Each node’s table used by
others (error propagates)

Computer Networks
- Rajat Verma
Smilarities of Link State and Distance Vector
routing algorithms
 Shortest-path routing
o Metric-based, using link weights
o Routers share a common view of how good a path is
 As such, commonly used inside an organization
o RIP and OSPF are mostly used as intradomain protocols
o E.g., Princeton uses RIP, and AT&T uses OSPF
 But the Internet is a “network of networks”
o How to stitch the many networks together?
o When networks may not have common goals
o … and may not want to share information

Computer Networks
- Rajat Verma
Hierarchical routing

 Routers grouped in regions


 Each routers knows how to
reach:  Smaller tables
o Other routers in its own group  Longer paths
o Other regions
Computer Networks
- Rajat Verma
Intra and InterDomain Routing
 Because an internet can be so large, one routing
protocol cannot handle the task of updating routing
tables of all routers.
 So, an internet is divided into autonomous systems.
 An autonomous system (AS) is a group of networks

and routers under the authority of a single


administration.
 Intradomain routing
o used for the routing inside an autonomous system
 Interdomain routing
o used for the routing between autonomous systems
Computer Networks
- Rajat Verma
Autonomous Systems

Interdomain routing
Intradomain routing

Computer Networks
- Rajat Verma
Path Vector Routing
 is similar to distance vector routing
 Assuming that there is one node in each AS that acts as
on behalf of the entire AS : Speaker Node
 Speaker node creates a routing table and advertises it
speaker nodes in the neighboring ASs
o advertising the path, not the metric of the nodes

Computer Networks
- Rajat Verma
Path Vector Routing (cont’d)
 Initialization
o Each speaker node can know only the reachability of
nodes inside its AS

Computer Networks
- Rajat Verma
Path Vector Routing (cont’d)
 Sharing and Updating

- AS3 -

- AS3 -

Computer Networks
- Rajat Verma
Popular Routing Protocols
RIP, OSPF, BGP

 Dynamic protocols
o Sharing neighborhood information
 Use different metrics.
 RIP (one hop count, how many networks a packet crosses), Networks are
treated equally
 BGP (depend on the policy, set by administrator)
 OSPF (TOS, minimize delay, maximize throughput)
Computer Networks
- Rajat Verma
Popular Inter / Intra Domain Routing Protocols
RIP, OSPF, BGP
 RIP (Routing Information Protocol) : treating each network
equals.
o The cost of passing through each network is the same.
• so if a packet passes through 10 networks to reach the destination,
the total cost is hop counts.
 OSPF(Open Shortest Path First)
o allowing the administrator to assign a cost for passing through a
network based on the type of service required.
o A route through a network can have different costs (metrics)
 BGP (Border Router Protocol)
o Criterion is the policy, which can be set by the administrator.
o Policy defines what paths should be chosen.
 Static and Dynamic tables
 Unicast Routing and Multicast Routing
Computer Networks
- Rajat Verma
Routing Information Protocol (RIP)
 The Routing Information Protocol (RIP) is one of the most commonly used
Interior Gateway Protocol on internal networks which helps a router
dynamically adapt to changes of network connections by communicating
information about which networks each router can reach and how far away
those networks are. Although RIP is still actively used, it is generally
considered to have been obsolete by Link-state routing protocol such as OSPF.
 As RIP is a distance vector routing protocol, it represents the routing
information in terms of the cost of reaching the specific destination. Circuit
priorities are represented using numbers between 1 and 15. This scale
establishes the order of use of links. The router decides the path to use base
on the priority list. Once the priorities are established, the information is
stored in a RIP routing table. Each entry in a RIP routing table provides a
variety of information, including the ultimate destination, the next hop on the
way to that destination, and a metric. The metric indicates the distance in
number of hops to the destination. Other information can also be present in
the routing table, including various timers associated with the route; these
timers will be discussed in the next section.

Computer Networks
- Rajat Verma
Routing Information Protocol (RIP) – contd.

 RIP maintains only the best route to a destination thus


whenever new information provides a better route, it
would replaces the old route information. Network
topology alterations can provoke changes to routes,
causing, for example, a new route to become the best
route to a particular destination.
 When network topology changes occur, they are
reflected in routing update messages. For example, when
a router detects a link or router failure, it recalculates its
routes and sends routing update messages. Each router
receiving a routing update message that includes a change
updates its tables and propagates the change.
Computer Networks
- Rajat Verma
Open Shortest Path First (OSPF)
 Open Shortest Path First (OSPF) is another Interior Gateway Protocol.
It is a routing protocol developed for Internet Protocol (IP) networks
by the Interior Gateway Protocol (IGP) working group of the Internet
Engineering Task Force (IETF). OSPF was created because in the mid-
1980s, the Routing Information Protocol (RIP) was increasingly
incapable of serving large, heterogeneous internetworks. OSPF being
a SPF algorithm scales better than RIP.

 Few of the important features of OSPF are as follows:


This protocol is open, which means that its specification is in the public
domain. It means that anyone can implement it without paying license fees.
The OSPF specification is published as Request For Comments (RFC) 1247.

Computer Networks
- Rajat Verma
Open Shortest Path First (OSPF) – contd.
 OSPF is based on the SPF algorithm, which is also referred to as the
Dijkstra’s algorithm, named after the person credited with its creation.
 OSPF is a link-state routing protocol that calls for the sending of link-
state advertisements (LSAs) to all other routers within the same
hierarchical area. Information on attached interfaces, metrics used, and
other variables are included in OSPF LSAs. As a link-state routing
protocol, OSPF contrasts with RIP, which are distance-vector routing
protocols.
 Routers running the distance-vector algorithm send all or a portion of
their routing tables in routing-update messages only to their neighbors.
 OSPF specifies that all the exchanges between routers must be
authenticated. It allows a variety of authentication schemes, even
different areas can choose different authentication schemes. The idea
behind authentication is that only authorized router are allowed to
advertise routing information.
 OSPF include Type of service Routing. It can calculate separate routes for
each Type of Service (TOS), for example it can maintain separate routes to
a single destination based on hop-count and high throughput.
Computer Networks
- Rajat Verma
Open Shortest Path First (OSPF) – contd.

 OSPF provides Load Balancing.


 OSPF allows supports host-specific routes, Subnet-specific
routes and also network-specific routes.
 OSPF allows sets of networks to be grouped together.
 OSPF uses different message formats to distinguish the
information acquired from within the network (internal
sources) with that which is acquired from a router outside
(external sources).

Computer Networks
- Rajat Verma
Border Gateway Protocol (BGP)
The Border Gateway Protocol (BGP) is an inter-autonomous
system routing protocol.
BGP is used to exchange routing information for the
Internet and is the protocol used between Internet service
providers (ISP), which are different ASes.
 One of the most important characteristics of BGP is its
flexibility. The protocol can connect together any
internetwork of autonomous systems using an arbitrary
topology.
 The only requirement is that each AS have at least one
router that is able to run BGP and that this router
connect to at least one other AS's BGP router. Beyond
that, “the sky's the limit,” as they say.
Computer Networks
- Rajat Verma
Border Gateway Protocol (BGP) – contd.
 BGP can handle a set of ASs connected in a full mesh topology (each
AS to each other AS), a partial mesh, a chain of ASes linked one to the
next, or any other configuration. It also handles changes to topology
that may occur over time.
 The primary function of a BGP speaking system is to exchange
network reachability information with other BGP systems. This
network reachability information includes information on the list of
Autonomous Systems (ASs) that reachability information traverses.
BGP constructs a graph of autonomous systems based on the
information exchanged between BGP routers.
 As far as BGP is concerned, whole Internet is a graph of ASs, with each
AS identified by a Unique AS number. Connections between two ASs
together form a path and the collection of path information forms a
route to reach a specific destination. BGP uses the path information
to ensure the loop-free interdomain routing. Another important
assumption that BGP makes is that it doesn't know anything about
what happens within the AS. Computer Networks
- Rajat Verma
Border Gateway Protocol (BGP) – contd.

 This is of course an important prerequisite to the notion of an AS


being autonomous - it has its own internal topology and uses its own
choice of routing protocols to determine routes.
 BGP only takes the information conveyed to it from the AS and shares
it with other ASs. When a pair of autonomous systems agrees to
exchange routing information, each must designate a router that will
speak BGP on its behalf; the two routers are said to become BGP
peers of one another.
 As a router speaking BGP must communicate with a peer in another
autonomous system, usually a machine, which is near to the edge
(Border) of the autonomous system is selected for this. Hence, BGP
terminology calls the machine a Border Gateway Router.

Computer Networks
- Rajat Verma
Comparison between RIP, OSPF and BGP
RIP OSPF BGP
Interior/Exterior? Interior Interior Exterior
Type Distance Vector Link-state Path Vector
Default Metric Hopcount Cost Multiple Attributes
Hop count Limit 15 None EBGP Neighbors: 1
(default) IBGP
Neighbors: None
Convergence Slow Fast Average
Update timers 30 seconds Only when changes occur; Only when changes
(LSA table is refreshed every occur
30 minutes, however)
Updates Full Table Only Changes Only Changes

Classless Yes Yes Yes


Algorithm Bellmen Ford Dijkstra Best Path Algorithm
Update Address 224.0.0.9 5. (All SPF Routers) TCP port 179
6. (DR’s and BDR’s)
Protocol and UDP port 520 IP Protocol 89
Port
DATA TRAFFIC

The main focus of congestion control and quality of


service is data traffic.
In congestion control we try to avoid traffic congestion.
In quality of service, we try to create an appropriate
environment for the traffic. So, before talking about
congestion control and quality of service, we discuss the
data traffic itself.

Topics discussed in this section:


Traffic Descriptor
Traffic Profiles
Figure Traffic descriptors
Figure Three traffic profiles
Congestion Control
Congestion in a network may occur if the load on
the network (the number of packets sent to the
network) is greater than the capacity of the
network(the number of packets a network can handle).

Congestion control refers to the mechanisms and


techniques to control the congestion and keep
the load below the capacity.
Effects Of Congestion
 Packets arriving are stored at input buffers -> Routing decision
made
• Packet moves to output buffer
 Packets queued for output transmitted as fast as possible
• Statistical TDM
 If packets arrive too fast to be routed/output, buffers fill up
• Discard packets
• Flow control
Congestion Control Techniques
Congestion control refers to techniques and mechanisms that can
either prevent congestion, before it happens, or remove congestion,
after it has happened.

 Open loop: Protocols to prevent or avoid congestion, ensuring that the


system (or network under consideration) never enters a Congested State.

 Close loop: Protocols that allow system to enter congested state, detect
it, and remove it.
Open Loop solutions
 The first category of solutions or protocols attempt to solve the
problem by a good design, at first, to make sure that it doesn’t
occur at all.
 Once system is up and running, midcourse corrections are not
made. These solutions are somewhat static in nature, as the
policies to control congestion don’t change much according to
the current state of the system. Such Protocols are also known as
Open Loop solutions.
 These rules or policies include deciding upon when to accept
traffic, when to discard it, making scheduling decisions and so on.
Main point here is that they make decision without taking into
consideration the current state of the network.
 The open loop algorithms are further divided on the basis of
whether these acts on source versus that act upon destination.
Closed Loop solutions
 Closed loop solutions are based on the concept of feedback.
During operation, some system parameters are measured and
feed back to portions of the subnet that can take action to
reduce the congestion.

 This approach can be divided into 3 steps:


 Monitor the system (network) to detect whether the network is
congested or not and what’s the actual location and devices involved.
 To pass this information to the places where actions can be taken
 Adjust the system operation to correct the problem.

 Various Metrics can be used to monitor the network for


congestion. Some of them are: the average queue length,
number of packets that are timed-out, average packet delay,
number of packets discarded due to lack of buffer space, etc.
Closed Loop Solutions (contd.)
 The closed loop algorithms can also be divided into two
categories, explicit feedback and implicit feedback
algorithms.

 In the explicit approach, special packets are sent back to


the sources to curtail down the congestion.

 While in implicit approach, the source itself acts pro-


actively and tries to deduce the existence of congestion by
making local observations.
QUALITY OF SERVICE

Quality of service (QoS) is an internetworking issue that


has been discussed more than defined. We can
informally define quality of service as something a flow
seeks to attain.

Topics discussed in this section:


Flow Characteristics
Flow Classes
Flow characteristics
Flow characteristics
TECHNIQUES TO IMPROVE QoS

In this section, we discuss some techniques that can be


used to improve the quality of service. We briefly discuss
four common methods: scheduling, traffic shaping,
admission control, and resource reservation.

Topics discussed in this section:


Scheduling
Traffic Shaping
Resource Reservation
Admission Control
FIFO queue
Priority queuing
Weighted fair queuing
Leaky bucket
Consider a Bucket with a small hole at the bottom, whatever may be the rate of water
pouring into the bucket, the rate at which water comes out from that small hole is
constant. This scenario is depicted in figure (a). Once the bucket is full, any additional
water entering it spills over the sides and is lost (i.e. it doesn’t appear in the output
stream through the hole underneath). The same idea of leaky bucket can be applied to
packets, as shown in (b). Conceptually each network interface contains a leaky bucket.
And the following steps are performed:
 When the host has to send a packet, the packet is thrown into the bucket.
 The bucket leaks at a constant rate, meaning the network interface transmits
packets at a constant rate.
 Bursty traffic is converted to a uniform traffic by the leaky bucket.
 In practice the bucket is a finite queue that outputs at a finite rate.

 This arrangement can be simulated in the operating system or can be built into the
hardware. Implementation of this algorithm is easy and consists of a finite queue.
Whenever a packet arrives, if there is room in the queue it is queued up and if there
is no room then the packet is discarded.
Figure a) Leaky bucket
Figure b) Leaky bucket implementation

Computer Networks
- Rajat Verma
A leaky bucket algorithm shapes bursty traffic
into fixed-rate traffic by averaging the data rate.
It may drop the packets if the bucket is full.

The token bucket allows bursty traffic at a


regulated maximum rate.

Computer Networks
- Rajat Verma
Token bucket
The leaky bucket algorithm enforces a rigid pattern at the output
stream, irrespective of the pattern of the input. For many applications
it is better to allow the output to speed up somewhat when a larger
burst arrives than to loose the data.
Token Bucket algorithm provides such a solution. In this algorithm
leaky bucket holds token, generated at regular intervals.

Main steps of this algorithm can be described as follows:

 In regular intervals tokens are thrown into the bucket.


 The bucket has a maximum capacity.
 If there is a ready packet, a token is removed from the bucket, and
the packet is send.
 If there is no token in the bucket, the packet cannot be send.
Token bucket
Leaky Bucket Token Bucket
The leaky bucket is an algorithm that may be The token bucket is an algorithm used in
used to determine whether some sequence packet switched computer networks and
of discrete events conforms to defined limits telecommunications networks. It can be
on their average and peak rates or used to check that data transmissions, in the
frequencies. form of packets, conform to defined limits
on bandwidth and burstiness.
The Leaky Bucket Algorithm is used to The Token Bucket Algorithm allows the
control rate in a network. In this algorithm output rate vary depending on the size of
the input rate can vary but the output rate burst.
remains constant.
It is Token independent. It is Token dependent.
In Leaky bucket, if bucket is full, packet or In Token bucket, if bucket is full, token are
data is discarded. discarded but not the packet.
In Leaky bucket, Packets are transmitted In Token bucket, Packets can only be
continuously. transmitted when there are enough token.
It sends the packet at constant rate. It allows large bursts to be sent faster rate
after that constant rate.
It does not save token. It saves token to send large bursts.
Choke Packet Technique
Choke packet scheme is a close loop mechanism where each link is monitored to examine
how much utilization is taking place. If the utilization goes beyond a certain threshold limit,
the link goes to a warning and a special packet, called choke packet is sent to the source.
On receiving the choke packet, the source reduced the traffic in order to avoid congestion.

The congestion control in the choke packet scheme can be monitored in the following
manner –

 Each link is monitored to estimate the level of utilization.


 If the utilization crosses a certain threshold limit, the link goes to a warning state and a
choke packet is send to the source.
 On receiving the choke packet, the source reduces the transmitting limit to a certain level
(say, by 50%).
 If still warning state persists, more choke packets are sent further reducing the traffic.
This continues until the link recovers from the warning state.
 If no further choke packet is received by the source within a time interval, the traffic is
increased gradually so that the system doesn’t go to congestion state again.
Logical Addressing
IPv4 ADDRESSES

An IPv4 address is a 32-bit address that uniquely and


universally defines the connection of a device (for
example, a computer or a router) to the Internet.

Topics discussed in this section:


 Address Space Notations
 Classful Addressing
 Classless Addressing
 Network Address Translation (NAT)
An IPv4 address is 32 bits long.

The IPv4 addresses are unique


and universal.

The address space of IPv4 is


232 or 4,294,967,296.
Figure Dotted-decimal notation and binary notation for an IPv4 address
Change the following IPv4 addresses from binary
notation to dotted-decimal notation.

Solution
We replace each group of 8 bits with its equivalent
decimal number and add dots for separation.
Change the following IPv4 addresses from dotted-
decimal notation to binary notation.

Solution
We replace each decimal number with its binary
equivalent.
Find the error, if any, in the following IPv4 addresses.

Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
In classful addressing, the address space is
divided into five classes:
A, B, C, D, and E.
Finding the classes in binary and dotted-decimal notation
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
Every IP address also has two parts-
• The first part identifies the network (Network ID) where the system is connected
• the second part identifies the system (Host ID)

Within the address range of each IPv4 network, we have three types of
addresses:
• Network address - The address by which we refer to the network
• Broadcast address - A special address used to send data to all hosts in the
network
• Host addresses - The addresses assigned to the end devices in the network
Class A :
No of Network: 27 (The first bit of a Class A address is always 0.)
No. of Usable Host address per Network: 224-2
(Minus 2 because 2 addresses are reserved for network and broadcast
address)

Class B :
No of Network: 214 (The first two bits of the first octet of a Class B
address are always 10.)
No. of Usable Host address per Network: 216-2

Class C :
No of Network: 221 (A Class C address begins with binary 110. )
No. of Usable Host address per Network: 28-2
Class D : The Class D address class was created to enable
multicasting in an IP address. A multicast address is a unique
network address that directs packets with that destination
address to predefined groups of IP addresses. Therefore, a
single station can simultaneously transmit a single stream of
data to multiple recipients. The Class D address space, much like
the other address spaces, is mathematically constrained. The
first four bits of a Class D address must be 1110.

Class E :
A Class E address has been defined. However, the Internet
Engineering Task Force (IETF) reserves these addresses for its
own research. Therefore, no Class E addresses have been
released for use in the Internet. The first four bits of a Class E
address are always set to 1s. Therefore, the first octet range for
Class E addresses is 11110000 to 11111111, or 240 to 255.
Number of blocks (Networks) and block (Hosts ) size
in classful IPv4 addressing

In classful addressing, a large part of the


available addresses were wasted.
Classful vs. Classless Addressing

 Classful addressing, as we have seen, has too


many problems
 Classless addressing, announced in 1996, allows
an ISP to assign as few or as many IP addresses
as requested
 The entire 2^32 address space is divided into
variable-sized blocks, which are multiples of
powers of 2
Masking-
Masking is finding the network address from an IP
address.
Table Default masks for classful addressing

Classful addressing, which is almost


obsolete, is replaced with classless
addressing.
Table- Prefix lengths

The addresses in color are the default masks for classes A, B, and C.
Thus, classful addressing is a special case of classless addressing.
In IPv4 addressing, a block of
addresses can be defined as
x.y.z.t /n
in which x.y.z.t defines one of the
addresses and the /n defines the mask.

The first address in the block can be


found by setting the rightmost
32 − n bits to 0s.
The last address in the block can be
found by setting the rightmost
32 − n bits to 1s.

The number of addresses in the block


can be found by using the formula
232−n.
Which of the following can be the beginning address
of a block that contains 16 addresses?
a. 205.16.37.32 b. 190.16.42.44
c. 17.17.33.80 d. 123.45.24.52

Solution
Only two are eligible (a and c).
The address 205.16.37.32 is eligible because 32 is
divisible by 16.
The address 17.17.33.80 is eligible because 80 is
divisible by 16.
Figure below shows a block of addresses, in both binary and
dotted-decimal notation, granted to a small business that needs 16
addresses.
We can see that the restrictions are applied to this block. The
addresses are contiguous. The number of addresses is a power of 2
(16 = 24), and the first address is divisible by 16.

Figure A block of 16 addresses granted to a small organization


A block of addresses is granted to a small organization.
We know that one of the addresses is 205.16.37.39/28.
What is the first address in the block?

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
Find the last address for the block in previous example

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
Find the number of host addresses in 205.16.37.39/28.

Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Note

The first address in a block is


normally not assigned to any device;
it is used as the network address that
represents the organization
to the rest of the world.
Subnetting
Introduction
Subnetting is a process of dividing large network into the
smaller networks based on layer 3 IP address. Every
computer in network has an IP address which represents its
location in network.

Subnetting reduces the size of the routing tables stored in


routers. Subnetting extends the existing IP address base &
restructures the IP address. As a result, routers must have a
way to extract from a IP address both the Network address &
the Host address.
A Network with Three Levels of Hierarchy
Addresses with and without Subnetting
Figure 5-5
Default mask and subnet mask
Figure 5-7
Comparison of a default mask and
a subnet mask
CIDR [ Classless Inter Domain Routing]
 CIDR is a slash notation of subnet mask. CIDR tells us number
of on bits in a network address.
 Class A has default subnet mask 255.0.0.0. that means first
octet of the subnet mask has all on bits. In slash notation it
would be written as /8, means address has 8 bits on.
 Class B has default subnet mask 255.255.0.0. that means first
two octets of the subnet mask have all on bits. In slash
notation it would be written as /16, means address has 16
bits on.
 Class C has default subnet mask 255.255.255.0. that means
first three octets of the subnet mask have all on bits. In slash
notation it would be written as /24, means address has 24
bits on.
Defining Subnets
Key terms to remember
 A subnet is a smaller portion of large network treated as its own separate
network. To create subnet we borrow bits from host portion and assign
them as network bits. This mean more networks, fewer hosts.
 If the network bits on two addresses do not match, then the two packets
are intended for two separate networks.
 On a 32 bits IP address at least eight bits must belong to the network
portion and at least 2 bits must belong to the host portion.
 Each IP address has a predefined IP class and that cannot be changed.
 Each class has a predefined default subnet mask that tell us the octets,
which are already part of the network portion, as well as how many bits we
have available to work with.
 Whatever network class is it, we cannot change those bits that are already
assigned.
 We cannot assign the network ID and the broadcast address to a host.
 Regardless how many bits are left in the host field, network ID and the
broadcast address must be reserved.
 Subnet bits start at the left and go to the right, without skipping bits.
Method of subnetting

In subnetting we find the answer of following questions-


 What is subnet mask for given address?
 How many subnets does given subnet mask provide ?
 What is block size for given subnet mask?
 What are the valid subnets?
 What are the total hosts?
 How many valid hosts are available per subnet?
 What is broadcast address of each subnet?
 What is network address of each subnet?
Method of subnetting
What is subnet mask for given address?
 Subnetting take places when we extend the default subnet mask. We cannot
perform subnetting with default subnet mask and every classes have default
subnet mask.
 To figure out subnetted subnet mask ,we first need to write down the default
subnet mask. Now find the host bits borrowed to create subnets and convert
them in decimal.
 For example find the subnet mask of address 188.25.45.48/20 ?
 This address belong to class B and class B has default subnet mask
255.255.0.0[ /16 in CIDR ]. We borrowed 4 bits from hosts portion. As you
know subnetting move from left to right and it cannot skip any network bit.
So this subnet mask in binary would be
11111111. 11111111.11110000.00000000.
 First two octet have default value so its decimal value would be 255.255. We
will convert third octet in decimal value.
 To convert a binary number in decimal we add its decimal equivalent value. In
our example it would be 128+64+32+16+0+0+0+0 = 240.
 Our fourth octet has all bits off so its decimal value would be
Method of subnetting
 How many subnets does given subnet mask provide ?
To calculate the number of subnets provided by given subnet mask we
use 2N , where N = number of bits borrowed from host bits to create
subnets.
For example in 192.168.1.0/27, N is 3. By looking at address we can
determined that this address is belong to class C and class C has default
subnet mask 255.255.255.0 [/24 in CIDR].
In given address we borrowed 27 - 24 = 3 host bits to create subnets. Now
23 = 8, so our answer is 8.

 What is block size for subnet mask?


Block size or increment number is used to calculate the valid subnets.
Once you figure out the block size, calculation of valid subnets become
piece of cake. To figure out the block size, use this formula 256 - Subnet
mask = block size.
For example block size for subnet mask 255.255.255.240 is 256 - 240 = 16.
Method of subnetting
 What are the valid subnets?
Calculating valid subnet is two steps process. First calculate total subnet by
using formula 2N. In second step find the block size and count from zero in
block until you reach the subnet mask value.
For example calculate the valid subnets for 192.168.1.0/26.
Borrowed host bits are 2 [26-24].
Total subnets are 22 = 4.
Subnet mask would be 255.255.255.192.
Block size would be 256-192 = 64.
Start counting from zero at blocks of 64,
so our valid subnets would be 0,64,128,192.

 What are the total hosts?


Total hosts are the hosts available per subnet. To calculate total hosts use
formula 2H = Total hosts.
H is the number of host bits. For example in address 192.168.1.0/26 we have
32 - 26 [Total bits in IP address - Bits consumed by network address] = 6 bits.
Method of subnetting
 How many valid hosts are available per subnet?
Valid hosts are the number of hosts those can be assigned to devices. As
we know, we need to reduce two address per subnet, one for network ID
and another for broadcast ID. So our formula, to calculate valid hosts
would be Total hosts - 2 = Valid hosts.
In above example we have 64 hosts per subnet, so valid hosts in each
subnet would be 64 - 2 = 62.

 What is the network address of each subnet?


Network address is the first address of subnet. This address is used to
locate the network, and cannot be assigned to any host. In above example
address 0,64,128,192 are the network address.
Network address is always the first IP address of subnet.
Broadcast address is always the last IP address of subnet ( IP address
before the next subnet).
Valid hosts are the IP addresses between network address and broadcast
address.
Method of subnetting
 What is broadcast address of each subnet?
Broadcast address is the last address of subnet. This address is reserve for
network broadcast, and cannot be assigned to any host.

In the previous example-


0 Subnet has broadcast address 63
64 Subnet has broadcast address 127
128 Subnet has broadcast address 191
192 Subnet has broadcast address 255
Method of subnetting
/26
CIDR /26 has subnet mask 255.255.255.192 and 192 is 11000000 in
binary. We used two host bits in network address.

N=2
H=6
Total subnets ( 2N ) :- 22 = 4
Block size (256 - subnet mask) :- 256 - 192 = 64
Valid subnets ( Count blocks from 0) :- 0,64,128,192
Total hosts (2H) :- 26 = 64
Valid hosts per subnet ( Total host - 2 ) :- 64 - 2 = 62

Subnets Subnet 1 Subnet 2 Subnet 3 Subnet 4


Network ID 0 64 128 192
First host 1 65 129 193
Last host 62 126 190 254
Broadcast ID 63 127 191 255
Example 1:

What is the maximum number of hosts which a network on


internet having a subnet mask of 255.255.240.0 can handle?
Answer:
Convert the subnet mask to binary:
11111111.11111111.11110000.00000000

The zeroes tell you which bytes indicate the host;

in this case, 12 zeroes allow for 212 = 4096 different IP addresses within
the subnet.
Of these, two (the first and the last) are unusable for a host, so you have
a maximum of 4094 hosts.
Example 2:
You work for a large communications corporation which has been assigned a
Class A network address.
Currently, the company has 1,000 subnets in offices around the world. You
want to add 100 new subnets over the next three years, and you want to allow
for the largest possible number of host addresses per subnet.

Which subnet mask would you choose?

Answer: 255.255.224.0
Requirements: 1,000 subnets + 100 subnets = 1,100 subnets, and as many host
addresses as possible
2^10-2 = 1022 we Know from memory that 2^10= 1024, and will yield ONLY 1022 usable
subnets with 10 bits of subnetting
Because our requirements ask for over 1024 subnets, we must borrow one more host
bit for our subnetting:
2^11-2 = (1024 * 2) - 2 = 2046 unique usable subnets

Default class A subnet mask 11111111 00000000 00000000 00000000 = 255.0.0.0


SUBNET MASK REQUIRED 11111111 11111111 11100000 00000000 = 255.255.224.0
i.e. Default Class A subnet mask with ANOTHER 11 bits of subnetting
Example 3

What is the subnetwork address if the


destination address is 200.45.34.56 and the
subnet mask is 255.255.240.0?
11001000 00101101 00100010 00111000
11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000

The subnetwork address is 200.45.32.0.


Example 4
What is the subnetwork address if the destination address
is 19.30.84.5 and the mask is 255.255.192.0?
Solution
Example 5
A company is granted the site address
201.70.64.0 (class C). The company needs
six subnets. Design the subnets.
Solution

The number of 1s in the default


mask is 24 (class C).
Solution (Continued)

The company needs six subnets. This number


6 is not a power of 2. The next number that is
a power of 2 is 8 (23). We need 3 more 1s in
the subnet mask. The total number of 1s in
the subnet mask is 27 (24  3).
The total number of 0s is 5 (32  27). The
mask is
Solution (Continued)

11111111 11111111 11111111 11100000


or
255.255.255.224

The number of subnets is 8.


The number of addresses in each subnet
is 25 (5 is the number of 0s) or 32.
Example 6
A small organization is given a block with the beginning
address and the prefix length 205.16.37.24/29 (in slash
notation). What is the range of the block?
Solution
The beginning address is 205.16.37.24. To find the
last address we keep the first 29 bits and change the
last 3 bits to 1s.
Beginning:11001111 00010000 00100101 00011000
Ending : 11001111 00010000 00100101 00011111
There are only 8 addresses in this block.
Example 7
What is the network address if one of the addresses is
167.199.170.82/27?

Solution
The prefix length is 27, which means that we must
keep the first 27 bits as it is and change the
remaining bits (5) to 0s. The 5 bits affect only the
last byte. The last byte is 01010010. Changing the
last 5 bits to 0s, we get 01000000 or 64. The
network address is 167.199.170.64/27.
Example 8
An organization is granted the block 130.34.12.64/26.
The organization needs to have four subnets. What are the
subnet addresses and the range of addresses for each
subnet?

Solution

The suffix length is 6. This means the total number


of addresses in the block is 64 (26). If we create
four subnets, each subnet will have 16 addresses.
Solution (Continued)

Let us first find the subnet prefix (subnet mask).


We need four subnets, which means we need to add
two more 1s to the site prefix. The subnet prefix is
then /28.
Subnet 1: 130.34.12.64/28 to 130.34.12.79/28.
Subnet 2 : 130.34.12.80/28 to 130.34.12.95/28.
Subnet 3: 130.34.12.96/28 to 130.34.12.111/28.
Subnet 4: 130.34.12.112/28 to 130.34.12.127/28.
Example 9:
A Corporation has been assigned the Class B network address
165.87.0.0. Company needs to divide the network into eight subnets.
What subnet mask should be applied to the network to provide the
most hosts per subnet?
a. 255.255.192.0
b. 255.255.224.0
c. 255.255.240.0
d. 255.255.248.0

Answer: 255.255.240.0
2^3-2 = 6 subnets
2^4-2 = 14 subnets
(2^16 - 2^4) -2 = 2^12 - 2 = 4094 hosts possible per subnet

Because 3 bits of subnetting will only yield 6 usable subnets (7 if ip


subnet-zero is enabled), you will need to borrow another bit. To meet
your minimum requirement of 8 subnets, and the maximum number of
hosts per subnet, this Subnet mask will be correct: 255.255.240.0
Figure Position of IPv4 in TCP/IP protocol suite
IP Packet Format
 Version: Version no. of Internet Protocol used (e.g. IPv4).
 IHL: Internet Header Length; Length of entire IP header.
 DSCP: Differentiated Services Code Point; this is Type of Service.
 ECN: Explicit Congestion Notification; It carries information
about the congestion seen in the route.
 Total Length: Length of entire IP Packet (including IP header and
IP Payload).
 Identification: If IP packet is fragmented during the
transmission, all the fragments contain same identification
number. to identify original IP packet they belong to.
 Flags: As required by the network resources, if IP Packet is too
large to handle, these ‘flags’ tells if they can be fragmented or
not. In this 3-bit flag, the MSB is always set to ‘0’.
 Fragment Offset: This offset tells the exact position of the
fragment in the original IP Packet.
 Time to Live: To avoid looping in the network, every packet is sent with
some TTL value set, which tells the network how many routers (hops)
this packet can cross. At each hop, its value is decremented by one and
when the value reaches zero, the packet is discarded.
 Protocol: Tells the Network layer at the destination host, to which
Protocol this packet belongs to, i.e. the next level Protocol. For
example protocol number of ICMP is 1, TCP is 6 and UDP is 17.
 Header Checksum: This field is used to keep checksum value of entire
header which is then used to check if the packet is received error-free.
 Source Address: 32-bit address of the Sender (or source) of the packet.
 Destination Address: 32-bit address of the Receiver (or destination) of
the packet.
 Options: This is optional field, which is used if the value of IHL is
greater than 5. These options may contain values for options such as
Security, Record Route, Time Stamp, etc.
IPv6
The network layer protocol in the TCP/IP protocol suite
is currently IPv4. Although IPv4 is well designed, data
communication has evolved since the inception of IPv4
in the 1970s.
IPv4 has some deficiencies that make it unsuitable for
the fast-growing Internet.

Topics discussed in this section:


Advantages
Packet Format
Extension Headers
Figure IPv6 datagram header and payload
Figure Format of an IPv6 datagram
Table Next header codes for IPv6
Table Priorities for congestion-controlled traffic
Table Priorities for no congestion-controlled traffic
Merit of IPv6 over IPv4
Some Network Layer Protocols

Internet Control Message Protocol (ICMP)

• ICMP is network diagnostic and error reporting protocol. ICMP belongs to IP protocol suite
and uses IP as carrier protocol. After constructing ICMP packet, it is encapsulated in IP
packet. Because IP itself is a best-effort non-reliable protocol, so is ICMP.
• Any feedback about network is sent back to the originating host. If some error in the
network occurs, it is reported by means of ICMP. ICMP contains dozens of diagnostic and
error reporting messages.
• ICMP-echo and ICMP-echo-reply are the most commonly used ICMP messages to check the
reachability of end-to-end hosts. When a host receives an ICMP-echo request, it is bound
to send back an ICMP-echo-reply. If there is any problem in the transit network, the ICMP
will report that problem.
Address Resolution Protocol(ARP)
If a machine talks to another machine in the same network, it requires its physical or MAC address.
But ,since the application has given the destination's IP address it requires some mechanism to bind
the IP address with its MAC address. This is done through Address Resolution protocol (ARP). IP
address of the destination node is broadcast and the destination node informs the source of its MAC
address.

IP ADDRESS  MAC ADDRESS


Reverse Address Resolution Protocol(RARP)
RARP is a protocol by which a physical machine in a local area network can request to learn its IP
address from a gateway server's Address Resolution Protocol table or cache. This is needed since the
machine may not have permanently attached disk where it can store its IP address permanently. A
network administrator creates a table in a local area network's gateway router that maps the physical
machine (or Medium Access Control - MAC) addresses to corresponding Internet Protocol addresses.
When a new machine is set up, its RARP client program requests from the RARP server on the router
to be sent its IP address. Assuming that an entry has been set up in the router table, the RARP server
will return the IP address to the machine which can store it for future use.

MAC ADDRESS  IP ADDRESS


Internet Group Management Protocol

Internet Group Management Protocol is a group


management protocol that mainly manages the group membership in a
multicast network.

•In a multicast network, multicast routers are used to route packets to


all the computers that are having membership of a particular group.
• The multicast routers use the information from IGMP to determine
which hosts are having membership of which group.
•A multicast router generally receives thousands of multicast packets
that have to be transmitted to various groups. If a router has no
knowledge about the group membership, it will broadcast packet to
every host and this will increase the load on the network.
• In order to save the network from such a problem, a list of groups IS
maintained when members of the group are present in the network.
• Thus, IGMP helps the multicast router to create and update this list.
•This protocol uses three different messages: query message,
membership report and leave report.

You might also like