Download as pdf or txt
Download as pdf or txt
You are on page 1of 97

ADVANCED COMPUTER

NETWORKS

Dr. Irfana Memon


Department of CSE, QUEST

https://sites.google.com/a/quest.edu.pk/dr-irfana-memon/lecture-slides
Course Content
NO TOPIC
01 Introduction: Motivations of studying networking
02
03
04
05 Switching
06 Internetworking
07
08
09
10
11
12
Chapter 06
Internetworking
Chapter 6 : Outline
• Introduction to Internetworking
• Network Layer
• functions performed by the network layer
• Forwarding & Routing
• Services Provided by the Network Layer
• Network Addressing
• Classful Addressing
• Rules for assigning Network ID
• Routing
• Types of Routing
• Routing Algorithm
Internetworking
• An internetwork is defined as two or more computer
network LANs or WAN or computer network segments
are connected using devices, and they are configured by
a local addressing scheme. This process is known
as internetworking.
• An interconnection between public, private,
commercial, industrial, or government computer
networks can also be defined as internetworking.
• An internetworking uses the internet protocol.
• The reference model used for internetworking is Open
System Interconnection(OSI).
• The network layer (OSI) provides the logical
connection between different types of networks.
Network Layer
• The Network Layer is the third layer of the OSI model.
• It handles the service requests from the transport layer
and further forwards the service request to the data link
layer.
• The network layer translates the logical addresses into
physical addresses
• It determines the route from the source to the
destination and also manages the traffic problems such
as switching, routing and controls the congestion of
data packets.
• The main role of the network layer is to move the
packets from sending host to the receiving host.
Network Layer
The main functions performed by the network layer are:

• Routing: When a packet reaches the router's input link,


the router will move the packets to the router's output
link. For example, a packet from S1 to R1 must be
forwarded to the next router on the path to S2.
• Logical Addressing: The data link layer implements
the physical addressing and network layer implements
the logical addressing. Logical addressing is also used to
distinguish between source and destination system. The
network layer adds a header to the packet which
includes the logical addresses of both the sender and
the receiver.
Network Layer
• Internetworking: This is the main role of the network
layer that it provides the logical connection between
different types of networks.

• Fragmentation: The fragmentation is a process of


breaking the packets into the smallest individual data
units that travel through different networks.
Forwarding and Routing
• In Network layer, a router is used to forward the
packets.
• Every router has a forwarding table.
• A router forwards a packet by examining a packet's
header field and then using the header field value to
index into the forwarding table.
• The value stored in the forwarding table corresponding
to the header field value indicates the router's outgoing
interface link to which the packet is to be forwarded.
Forwarding and Routing
For example, the router with a header field value of 0111 arrives at a
router, and then router indexes this header value into the forwarding table
that determines the output link interface is 2. The router forwards the
packet to the interface 2. The routing algorithm determines the values that
are inserted in the forwarding table. The routing algorithm can be
centralized or decentralized.
Services Provided by the Network
Layer
• Guaranteed delivery: This layer provides the service
which guarantees that the packet will arrive at its
destination.
• Guaranteed delivery with bounded delay: This
service guarantees that the packet will be delivered
within a specified host-to-host delay bound.
• In-Order packets: This service ensures that the packet
arrives at the destination in the order in which they are
sent.
Services Provided by the Network
Layer
• Guaranteed max jitter: This service ensures that the
amount of time taken between two successive
transmissions at the sender is equal to the time
between their receipt at the destination.
• Security services: The network layer provides security
by using a session key between the source and
destination host. The network layer in the source host
encrypts the payloads of datagrams being sent to the
destination host. The network layer in the destination
host would then decrypt the payload. In such a way, the
network layer maintains the data integrity and source
authentication services.
Network Addressing
• Network Addressing is one of the major responsibilities
of the network layer.
• Network addresses are always logical, i.e., software-
based addresses.
• A host is also known as end system that has one link to
the network.
• The boundary between the host and link is known as an
interface.
• Therefore, the host can have only one interface.
• A router is different from the host in that it has two or
more links that connect to it.
• When a router forwards the datagram, then it forwards
the packet to one of the links..
Network Addressing
• The boundary between the router and link is known as
an interface, and the router can have multiple
interfaces, one for each of its links. Each interface is
capable of sending and receiving the IP packets, so IP
requires each interface to have an address.
• Each IP address is 32 bits long, and they are
represented in the form of "dot-decimal notation"
where each byte is written in the decimal form, and they
are separated by the period.
• An IP address would look like 193.32.216.9 where 193
represents the decimal notation of first 8 bits of an
address, 32 represents the decimal notation of second 8
bits of an address.
IP Addressing
An IP address is 32-bit long.
• It is usually written as four decimal numbers separated by dots
(periods) (dotted decimal notation)
• In hex, each of the four hexadecimal numbers is called an octet.
• Example: 137.207.192.003 or 89 CF C0 03
• An IP address contains a network part and a host part.
• The number of address bits used to identify the network, and the
number to identify the host, vary according to the class of the
address.
• Routers or gateways have one or more addresses
(depending on the no. of links they have)
•The three main address classes are class A, class B, and class C.
• By examining the first few bits of an address, IP software can
quickly determine the address class, and therefore its structure.
IP Addressing
An IP address is divided into two parts:
• Network ID: It represents the number of networks.
• Host ID: It represents the number of hosts.
IP Addressing
Note:
For Class A: Have a first dotted decimal number in the range 1-126
For Class B: Have a first dotted decimal number in the range 128-191
For Class C: Have a first dotted decimal number in the range 192-223
IP Addressing Format
IP Addresses assignment example
Class A
In Class A, an IP address is assigned to those networks
that contain a large number of hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
• In Class A, the first bit in higher order bits of the first
octet is always set to 0 and the remaining 7 bits
determine the network ID.
• The 24 bits determine the host ID in any network.
• The total number of networks in Class A = 27 = 128
network address
• The total number of hosts in Class A = 224 - 2 =
16,777,214 host address
Class B

• In Class B, an IP address is assigned to those networks


that range from small-sized to large-sized networks.
• The Network ID is 16 bits long.
• The Host ID is 16 bits long.
• In Class B, the higher order bits of the first octet is
always set to 10, and the remaining14 bits determine
the network ID. The other 16 bits determine the Host
ID.
• The total number of networks in Class B = 214 = 16384
network address
• The total number of hosts in Class B = 216 - 2 = 65534
host address
Class C
• In Class C, an IP address is assigned to only small-
sized networks.
• The Network ID is 24 bits long.
• The host ID is 8 bits long.
• In Class C, the higher order bits of the first octet is
always set to 110, and the remaining 21 bits
determine the network ID.
• The 8 bits of the host ID determine the host in a
network.
• The total number of networks = 221 = 2097152
network address
• The total number of hosts = 28 - 2 = 254 host address
Class D

• In Class D, an IP address is reserved for multicast


addresses.
• It does not possess subnetting.
• The higher order bits of the first octet is always set to
1110, and the remaining bits determines the host ID in
any network.
Class E

• In Class E, an IP address is used for the future use or for


the research and development purposes.
• It does not possess any subnetting.
• The higher order bits of the first octet is always set to
1111, and the remaining bits determines the host ID in
any network.
Rules for assigning Host ID

• The Host ID is used to determine the host within any


network.
• The Host ID is assigned based on the following rules:
 The Host ID must be unique within any
network.
 The Host ID in which all the bits are set to 0
cannot be assigned as it is used to represent
the network ID of the IP address.
 The Host ID in which all the bits are set to 1
cannot be assigned as it is reserved for the
multicast address.
Rules for assigning Network ID

• If the hosts are located within the same local network,


then they are assigned with the same network ID.
• The following are the rules for assigning Network ID:
 The network ID cannot start with 127 as 127 is used by
Class A.
 The Network ID in which all the bits are set to 0 cannot
be assigned as it is used to specify a particular host on
the local network.
 The Network ID in which all the bits are set to 1 cannot
be assigned as it is reserved for the multicast address.
Classful Network Architecture
Class Higher NET ID HOST No.of No.of Range
bits bits ID bits networks hosts
per
networ
k
7 24
A 0 8 24 2 2 0.0.0.0 to
127.255.255.255
14 16
B 10 16 16 2 2 128.0.0.0 to
191.255.255.255
21 8
C 110 24 8 2 2 192.0.0.0 to
223.255.255.255
D 1110 Not Not Not Defined Not 224.0.0.0 to
Defined Defined Defined 239.255.255.255

E 1111 Not Not Not Defined Not 240.0.0.0 to


Defined Defined Defined 255.255.255.255
Why Routing Protocol?
Method to find and maintain routes between nodes in a dynamic
topology with possibly uni-directional links, using minimum
resources.
Common objective:
Route packets along the optimal path
–Routing protocols adapt to changing network conditions and by
definition offers multi-hop paths
–Routing protocols differ in route table
 construction
 maintenance
 update
Next-hop routing protocols can be categorized as:
–Link-state
–Distance-vector
Classification of Routing Protocols
Based on routing information update mechanism
• Proactive (table-driven) routing protocols;
• Reactive (on-demand) routing protocols;
• Hybrid protocols.
Based on usage of temporal information
• Based on past temporal information;
• Based on future temporal information.
Based on the routing topology
• Flat topology routing protocols
• Hierarchial topology routing protocols
Routing based on utilization of specific resources
• Power-aware routing;
• Geographical information assisted routing
Proactive routing Protocol
Proactive routing Protocol
Reactive Routing or On-Demand
• Reactive: discover route only when you need it
• Saves energy and bandwidth during inactivity
• Can be bursty -> congestion during high activity
• Significant delay might occur as a result of route
discovery
• Good for light loads, collapse in large loads
Hybrid Routing

• Proactive for neighborhood, Reactive for far away


(Zone Routing Protocol, Haas group)
• Proactive for long distance, Reactive for
neighborhood (Safari)
• Attempts to strike balance between the two
Hierarchical Routing
• Nodes are organized in clusters
• Cluster head “controls” cluster
• Trade off
– Overhead and confusion for leader election
– Scalability: intra-cluster vs intercluster
• One or Multiple levels of hierarchy
Geographical Routing

• Nodes know their geo coordinates (GPS)


• Route to move packet closer to end point
• Protocols DREAM, GPSR, LAR
• Propagate geo info by flooding (decrease
frequency for long distances)
Classification of Routing Protocols
Proactive routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
DSDV Routing Protocol
WRP (Wireless Routing Protocol)
WRP (Wireless Routing Protocol)
WRP (Wireless Routing Protocol)
WRP (Wireless Routing Protocol)
WRP (Wireless Routing Protocol)
WRP (Wireless Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
CSGR (Cluster switch gateway Routing Protocol)
Reactive Routing Protocols
Reactive Routing
• Key Goal: Reduction in routing overhead
– Useful when number of traffic sessions is much
lower than the number of nodes.
• No routing structure created a priori. Let the
structure emerge in response to a need
• Two key methods for route discovery
– source routing
– backward learning (similar to intra-AS routing)
• Introduces delay
Reactive (on-demand) routing:
• Routing only when needed

Advantages:
0  eliminate periodic updates
query(0
reply(0  adaptive to network dynamics
)
) query(0 Disadvantages:
query(0)1 )  high flood-search overhead
3 with
reply(0
 mobility, distributed traffic
query(0
) 2 query(0  high route acquisition latency
) )
4
query(0)
reply(0) 5 query(0
)
Reactive Routing – Source initiated
• Source floods the network with a route request
packet when a route is required to a destination
– Flood is propagated outwards from the source
– Pure flooding = every node transmits the request only
once
• Destination replies to request
– Reply uses reversed path of route request
– sets up the forward path
• Two key protocols: DSR and AODV
Dynamic Source Routing (DSR)
[Johnson+ 1996]

• When node S wants to send a packet to node D,


but does not know a route to D, node S initiates a
route discovery

• Source node S floods Route Request (RREQ)

• Each node appends own identifier when


forwarding RREQ
Dynamic Source Routing (DSR)
Route Discovery RREQ FORMAT
Initiator ID
B
A-B-D-G A-B-D-G Initiator seq#
A-B-D-G G
Target ID
A A-B D A-B-D Partial route

A
A-C-E

A E H A-B-C
A-C-E Route Request (RREQ)
A-C-E
C A-C A-B-C
F Route Reply (RREP)

Route Discovery is issued with exponential back-off intervals.


Dynamic Source Routing (DSR)
Route Discovery: at source A
A need to send to
G

Lookup Cache for route A


to G
Start
Route Buffer no Route
Discovery packet found?

Protocol yes
Continue
wait

normal Write route in


processing yes
packet header
Route Packet
Discovery in Send
buffer?
finished dno packet to
on next-hop
Dynamic Source Routing (DSR)
<src,id> in Discard
Accept route
recently seen yes route
request packet
requests list? request

no
Ho
st’s yes Discard
ad route
dre request
ss
alr
Append no
ead
myAddr to
partial route
no my y
Add
in
r=ta
pat
rge
Store <src,id> in
list
rial
t
Send route
yes
rou
Route Discovery: At an
reply packet
te intermediate node
Broadcast packet
done
Dynamic Source Routing (DSR)
DSR - Route Discovery
• Route Reply message containing path information is
sent back to the source either by
– the destination, or
– intermediate nodes that have a route to the
destination
– Reverse the order of the route record, and include it in
Route Reply.
– Unicast, source routing
• Each node maintains a Route Cache which records
routes it has learned and overheard over time
Dynamic Source Routing (DSR)
Route Maintenance
• Route maintenance performed only while route is in use
• Error detection:
– Monitors the validity of existing routes by passively listening to data
packets transmitted at neighboring nodes
– Lower level acknowledgements
• When problem detected, send Route Error packet to original
sender to perform new route discovery
– Host detects the error and the host it was attempting;
– Route Error is sent back to the sender the packet – original src
Dynamic Source Routing (DSR)
Route Maintenance
B
RERR RERR G
D
G
A
Route Cache (A)
G: A, B, D, G G: A,
C, E, H, G E H
F: B, C, F

C
F
Dynamic Source Routing (DSR)
A Summary of DSR
Entirely on-demand, potentially zero control message
overhead
Trivially loop-free with source routing
Conceptually supports unidirectional links as well as
bidirectional links

High packet delays/jitters associated with on-demand routing


Space overhead in packets and route caches
Promiscuous mode operations consume excessive amount of
power
AODV Routing Protocol

S E
F
A
C

G D
B

•AODV = Ad Hoc On-demand Distance Vector


•Source floods route request in the network.
•Reverse paths are formed when a node hears
a route request.
•Each node forwards the request only once
(pure flooding).
AODV Routing Protocol
AODV Route Discovery
S E
F
A
C

G D
B

•Source floods route request in the network.


•Each node forwards the request only once
(pure flooding).
AODV Routing Protocol
AODV Route Discovery
S E
F
A
C

G D
B

• Uses hop-by-hop routing.


• Each node forwards the request only once (pure flooding).
• Reverse paths are formed when a node hears a route request.
AODV Routing Protocol
AODV Route Discovery
S E
F
A
C

G D
B

•Route reply forwarded via the reverse path.


AODV Routing Protocol
AODV Route Discovery
S E
F
A
C

G D
B

•Route reply is forwarded via the


reverse path … thus forming the
forward path.
•The forward path is used to route
data packets.
AODV Routing Protocol
Route Expiry
S E
F
A
C

G D
B

•Unused paths expire based on a timer.


AODV – Optimization
• Useful optimization: An intermediate node with a
route to D can reply to route request.
– Faster operation.
– Quenches route request flood.

• Above optimization can cause loops in presence of


link failures
AODV Routing Protocol
AODV: Routing Loops
A B C D

•Assume, link C-D fails, and node A does not know about it
(route error packet from C is lost).
•C performs a route discovery for D.
•Node A receives the route request (via path C-E-A)
•Node A replies, since A knows a route to D via node B
•Results in a loop: C-E-A-B-C
AODV Routing Protocol
AODV: Routing Loops
A B C D

•Assume, the link C-D fails, and node A does not know
about it (route error packet from C is lost).
•C performs a route discovery for D.
•Node A receives the route request (via path C-E-A)
•Node A replies, since A knows a route to D via node
B
•Results in a loop: C-E-A-B-C
AODV Routing Protocol
AODV: Use Sequence Numbers

• Each node X maintains a sequence number


– acts as a time stamp
– incremented every time X sends any message)
• Each route to X (at any node Y) also has X’s
sequence number associated with it, which is Y’s
latest knowledge of X’s sequence number.
• Sequence number signifies ‘freshness’ of the route
– higher the number, more up to date is the route.
AODV Routing Protocol
Use of Sequence Numbers in AODV
S Y ? D
Dest seq. no. = 10 Has a route
to D with Seq. no. = 15
seq. no = 7
RREQ carries 10 Y does not reply, but
forwards the RREQ

• Loop freedom: Intermediate node replies with a route


(instead of forwarding request) only if it has a route
with a higher associated sequence number.
Avoidance of Loop
DSN = Destination Sequence
Number.
9
A B C D
7 9 10
E
5
All DNS’s are for D

• Link failure increments the DSN at C (now is 10).


• If C needs route to D, RREQ carries the DSN (10).
• A does not reply as its own DSN is less than 10.
AODV Routing Protocol
Path Maintenance
3’ 3’

1 3 1
Destination Destination
2 2
Source Source
4 4

 Movement not along active path triggers no action


If source moves, reinitiate route discovery
 When destination or intermediate node moves
 upstream node of break broadcasts Route Error (RERR)
 RERR contains list of all destinations no longer reachable due
to link break
 RERR propagated until node with no precursors for destination is
reached
AODV Routing Protocol
Summary: AODV

• At most one route per destination maintained


at each node
– After link break, all routes using the failed link are
erased.
• Expiration based on timeouts.
• Use of sequence numbers to prevent loops.
• Optimizations
– Routing tables instead of storing full routes.
– Control flooding (incrementally increase ‘region’)
Hybrid Routing Protocols
Zone Routing Protocol (ZRP)

[Hass+ 1998]
–Hybrid protocol incorporates the merits of proactive (table-driven) and
reactive (on-demand) routing protocols
–Each node has a routing zone by specifying a zone radius in terms of hops
–Size of a zone can affect the communication performance
–Within the routing zone, a table driven routing protocol is used; therefore,
each node has a route to all the other nodes within the zone
–If destination falls out of the routing zone of source node, an on-demand
routing protocol is used
–Three sub-protocols:
 Intrazone Routing Protocol (IARP)  proactive
 Interzone Routing Protocol (IERP)  reactive
 Bordercast Resolution Protocol (BRP)
Zone Routing Protocol (ZRP)
Based on the concept of zones
• A zone is defined for each node separately
• Zone radius r given as number of hops
• The zones overlap

• Peripheral Center of S-
zone
nodes G, H, J,
and I
• Neighbor

nodes B, C, ….

r=2
(hops)
We depict zones as circles, but they are not.
Zone Routing Protocol (ZRP)
Based on the concept of zones
•A zone is defined for each node separately
•Zone radius r given as number of hops
•The zones overlap

• Peripheral nodes G, H, J, and I


• Neighbor nodes B, C, ….
Center of E-zone

r = 2 (hops)
We depict zones as circles, but they are not.
Zone Routing Protocol (ZRP)
Proactive Intra-zone Routing
ZRP refers to the locally proactive routing component as IARP
IARP is not a specific routing protocols. Instead, IARP is a family of
proactive routing protocols.

Each node maintains the


routing info to all nodes
in its zone
The updates are only
local in the zone.
Reduces the maintenance
costs to a limited zone
Zone Routing Protocol (ZRP)
Reactive Inter-zone Routing
• The globally reactive routing component is named IERP.
• IERP is responsible for discovering routes to destinations beyond a
node’s routing z one.

• For example, when S has a packet to send to x, IERP is responsible for


discovering this route.
• How does IERP work? I will explain in the next few slices.
Zone Routing Protocol (ZRP)
Interzone Routing (cont.)
IERP has two phases for route discovery:
•Route request
•Route reply
IERP don’t use standard flooding search. IERP border-casts a
route request.
Border-casting is a packet delivery service that allows a node to
efficiently send a message to its peripheral nodes.
Route query packet is uniquely identified by a combination of the
source node’s ID and request number.
Upon receipt of a route query packet, a node adds its ID to the
query.
Zone Routing Protocol (ZRP)

Interzone Routing (cont.)

If peripheral nodes don’t find the destination, they continue the


border-casting process.
If the destination is found, a route reply is sent back to the source
by reversing the accumulated route.
Zone Routing Protocol (ZRP)
Conclusions
1. ZRP provides a flexible solution to challenge of discovering
and maintaining routes. It combines two different methods
of routing in one protocol.
2. ZRP reduces the traffic amount compared to pure proactive
or reactive routing. The amount of intra-zone control traffic
increases with the zone’s size. However, using the
knowledge of the routing zone to reduce the amount of inter-
zone control traffic through border-casting.
3. QD, ET and LT provide significant improvements compared
with purely reactive ( =
1)and purely proactive schemes (
4. Zone routing is targeted for large networks. The amount of
control traffic does not depend on network size because
proactive updates are only local.
Wish You Good Luck

You might also like