3. Network Layer duties
Interconnecting
different
networks and
making them
look the same
to the transport
layer.
Unique
addresses are
required to
define each
host/machine/
device/user in
the network
The
coming
PDU’s
from
transport
the
layer
placed
must be
in
network-layer
packets and
sent to the
data-link layer
To fragment
transport
PDUs
layer
into
smaller units so
that they can
be transferred
over various
data-link layer
technologies
network layer
packet is
ready, what
to do ?
6. Delivery
The network layer supervises the handling of the packets
by the underlying physical networks. This handling is
called as the delivery of a packet.
7. Forwarding
• Forwarding means to place the packet in its
route to its destination.
• Forwarding requires a host or a router to have a
routing table
• Forwarding techniques are required to make the
size of the routing table manageable
– Next-hop method versus route method
– Network-specific method versus host-specific method
– Default method
11. Routing Table
• Static routing table: created manually
• Dynamic routing table: updated periodically by using one of
the dynamic routing protocols such as RIP, OSPF, or BGP
• Common fields in a routing table
– Flag: U(up), G(gateway), H(host-specific), D(added by
redirection), M(modified by redirection)
– Reference count: number of users of this route at the
moment
– Use: the number of packets transmitted through this router
for the corresponding destination
12. Communication in internet
• Unicasting
• Multicasting
• Broadcasting
• Forwarding of a datagram by a router is normally
based on the prefix of the destination address in
the datagram, which defines the network to
which the destination host is connected.
13. Unicasting
1. One source and one destination network.
2. Each router in the path of the datagram tries to forward
the packet to one and only one of its interfaces.
14. Multicasting
1. One source and a group of destinations
2. The relationship between the source and the destination
network is one to many
3. The source address is a unicast address and the
destination address is a group address.
4. A group address defines the members of the group.
16. Multicasting versus Multiple Unicasting
1. Multicasting starts with a single packet from the source , further
duplicated by the routers; Multiple unicasting, several packets starts
from the source.
2. Destination address in each packet is the same for all duplicates;
source sends packets with each having a different unicast destination
address
3. Only a single copy of the packet travels between any two routers;
Multiple copies travels between two routers
17. Emulation of Multicasting with Unicasting
• Multicasting is efficient than multiple unicasting (
requires less bandwidth ) and there is no delay
as only one packets is created by the source (
no delay) .
• In multiple unicasting, links handle several
copies and packets are created with a relative
delay between packets.
18. Internet Structure
• Made of a huge no. of networks and routers that connect
them
• Changed from Tree-like structure, with a Single back-
bone, to a Multi-back bone structure , uses Hierarchical
Routing
19. Routing in internet
Why no single protocol?
• Scalability problem:
• Size of forwarding table becomes time-consuming
• Updating creates a huge amount of traffic
• Administrative issue
• ISP is run by an administrative authority and controls
the system.
• Impose some policy on the traffic passing through its
ISP.
• May wish to run a specific routing algorithm to meet
needs of system
20. Intra- and Interdomain Routing
• AS (autonomous system): A group of networks and
routers under the authority of a single administration
• Intradomain routing: inside an AS
• Interdomain routing: between ASs
• R1, R2, R3, and R4 use a intradomain and an
interdomain routing protocol.
• The other routes use only intradomain routing protocols
22. Hierarchical Routing
Considers each Internet Service Provider (ISP) as Autonomous System (AS)
• Stub AS –
• has only one connection to another AS
• Does not allow the traffic to pass through it
• Data traffic can be either initiated or terminated in stub AS
• Example is the customer network, which is either the source or the sink
of data.
• Multihomed AS –
• can have more than one connection to other AS
• Does not allow the traffic to pass through it
•Few customer networks that may use the services of more than one
provider network, but their policy does not allow data to be passed through
them.
• Transient AS –
• connected to more than one other AS
• Allow the traffic to pass through it
• Provider networks and backbone are example
23. Network-Layer Routing
• Routing tasks are methods of finding the paths for
packet from their sources to their destinations.
• Routers are responsible mainly for implementing
routing algorithms
24. Classification of Routing Algorithms
1. Static Routing and Dynamic Routing
2. Least Cost Path and Non-Least Cost Path
3. Intra Domain and Inter Domain Routing
26. Distance Vector Routing
• To find best route
• Each nodes creates its own least cost tree from basic
information about its neighbors.
• Incomplete trees are exchanged between immediate
neighbors to make complete trees
• Bellman-Ford equation is used to build new least-cost
path from previously established least-cost paths
27. Distance Vector Routing
• Paths are joined together to form the Tree.
• Distance- Vector routing creates a one-dimensional array
to represent the Tree.
• In this method, a router continuously tells all of its
neighbors what it knows about the Internetwork.
28. Count to Infinity problem with Distance
vector routing
• Any decrease in cost ( good news) propagates quickly,
but any increase in cost ( bad news) will propagate
slowly.
• if a link is broken i.e. cost becomes infinity, every other
router should be aware of it immediately
• But in Distance-vector routing, this takes some time. This
problem is referred to as Count to infinity.
• It sometimes takes several updates before the cost for a
broken link is recorded as infinity by all routers
29. Techniques to solve Count to Infinity
problem
• Split Horizon
• Poison Reverse
30. Distance Vector Routing
• The least-cost route between any two nodes is the route
with minimum distance
• Each node maintains a vector(table)
distances to every node
• Distance vector routing table
of minimum
31. Distance Vector Routing: Initialization
At the beginning, each node can know only the distance
between itself and its immediate neighbors
32. Distance Vector Routing: Sharing
In distance vector routing, each node shares its routing
table with its immediate neighbors periodically and when
there is a change
33. Distance Vector Routing: Updating
• When a node receives a two-column table from a
neighbor, it need to update its routing table
• Updating rule:
– Choose the smaller cost. If the same, keep the old
one
– If the next-node entry is the same, the receiving node
chooses the new row
34. When to Share
• Periodic update: A node sends its routing table,
normally every 30 s
• Triggered update: A node sends its two-column
routing table to its neighbors anytime there is a
change in its routing table
35. Link State Routing
• Each node has the entire topology of the domain- the list
of nodes and links, how they are connected including
type, cost, and condition of the links(up or down)
• Node can use Dijkstra’s algorithm to build a routing
table
36. Link State Knowledge
• Each node has partial knowledge: it know the state (type,
condition, and cost) of its links. The whole topology can
be compiled from the partial knowledge of each node
37. Building Routing Table
1. Creation of the states of the links by each node, called
the link state packet (LSP)
2. Dissemination of LSPs to every other router, called
flooding, in an efficient and reliable way
3. Formation of a shortest path tree for each node
4. Calculation of a routing table based on the shortest path
tree
• Creation of LSP
– LSP contains node identity, the list of links (to
make the topology), sequence number (to facilitate
flooding and distinguish new LSPs from old ones
– LSPs are generated (1) when there is a change in the
topology of the domain, (2) on a periodic basis,
normally 60 min or 2 h
38. Building Routing Table
• Flooding of LSPs
– The creating node sends a copy of the LSP out of
each interface
– A node compares it with the copy it may already have.
If the newly arrived LSP is older than the one it has, it
discards the LSP. If it is newer,
1.It discards the old LSP and keeps the new one
2.It sends a copy of it out of each interface except the
one from which the packet arrived
• Formation of shortest path tree: Dijkstra Algorithm
– After receiving all LSPs, each node will have a copy
of the whole topology. Need to find the shortest path
to every other node
– The Dijkstra algorithm creates a shortest path tree
from a graph
40. Routing Table
• Each node uses the shortest path tree protocol to
construct its routing table
• The routing table shows the cost of reaching each node
from the root
41. Path Vector Routing
• The goal is reachability, to allow the packet to reach its
destination without assigning costs to the route.
• Path from a source to all destinations is determined by
best spanning tree, which is not the least-cost tree.
• Tree is determined by the source by imposing its policy;
• If there is more than one route to a destination, source
chooses the route that has minimum number of nodes to
be visited.
42. Path Vector Routing
• Policy is defined by selecting the best of multiple paths.
Path vectors at booting time
Updating path vectors
43. Unicast Routing Protocols
its
• Protocol
a)
b)
of
the
needs to
domain
messages
define :
operation
exchanged
c) communication between routers and
d) interaction with protocols in other domains
44. Multicasting
• In multicast routing, the router may forward the received
packet through several of its interfaces.
• Broadcasting is a special case of multicasting
45. Multicasting vs. Multiple Unicasting
• Emulation of multicasting through multiple unicasting is
not efficient and may create long delays, particularly with
a large group
46. Multicasting Applications
• Access to distributed databases
• Information dissemination
• Dissemination of news
• Teleconferencing
• Distance learning
47. Multicast tree
• Objectives of multicasting:
• Every member of the group should receive one, and only
one, copy of the multicast packet. Nonmember must not
receive a copy
• There must be no loops in routing
• The path traveled from source to each destination must be
optimal
• In a source-based tree approach, the combination of source
and group determines the tree (DVMRP, MOSPF, PIM-DM)
• In the group-shared tree approach, the group determines the
tree (CBT, PIM-SM)
48. Multicast Routing
• Optimal routing: Shortest path trees
• Unicast Routing
– Each router in the domain has a table that defines
a shortest path tree to possible destinations
49. Shortest Path Tree
• Multicast Routing
– Each involved router needs to construct a shortest path
tree for each group
• Source-Based Tree and Group-Shared Tree
• In the source-based tree approach, each router needs to
have one shortest path tree for each group
50. Shortest Path Tree
• In the group-shared tree approach, only the core router, which has
a shortest path tree for each group, is involved in multicasting
53. Multicast Link State Routing: MOSPF
• uses the source-based tree approach
• n (the number of group) topologies and n shortest path trees
made
• Each router has a routing table that represents as many
shortest path trees as there are groups
• is an extension of the OSPF protocol that uses multicast link
state routing to create source-based trees
• requires a new link state update packet to associate the
unicast address of a host with the group address or addresses
the host is sponsoring
• is a data-driven protocol; the first time an MOSPF router see a
datagram with a given source and group address, the router
constructs the Dijkstra shortest path tree
54. 54
Multicast Distance Vector: DVMRP
• uses the source-based trees, but the router never actually
makes a routing table
• does not allow a router to send its routing table to its
neighbors. The idea is to create a table from scratch by
using the information from the unicast distance vector
tables
• Process based on four decision-making strategies. Each
strategy is built on its predecessor
– Flooding
– Reverse Path Forwarding (RPF)
– Reverse Path Broadcasting (RPB)
– Reverse Path Multicasting (RPM)
55. DVMRP: Strategies
• Flooding broadcasts packets, but creates loops in the systems
• Reverse path forwarding: RPF eliminates the loop in the flooding
process
56. DVMRP: Strategies
• Reverse path broadcasting: RPB creates a shortest path
broadcast tree from the source to each destination. It guarantees
that each destination receives one and only one copy of the packet
• Problem with RPF
57. DVMRP: Strategies
• Reverse path multicasting: RPM adds pruning and
grafting to RPB to create a multicast shortest path tree
that supports dynamic membership changes
58. Core-Based Tree (CBT)
• CBT is a group-shared protocol that uses a core as the root of the
tree
• AS is divided into regions, and core (center router or rendezvous
router) is chosen for each region
• Each router sends a unicast join message to rendezvous router
• When the rendezvous router has received all join messages from
every member of the group, the tree is formed
59. Sending Multicast Packets
• The source sends the multicast packet (encapsulated in a unicast
packet) to the core router. The core router decapsulates the packet
and forwards it to all interested hosts. Each router that receives the
multicast packet, in turn, forwards it to all interested ports
60. Protocol Independent Multicast (PIM)
• PIM-DM (Dense Mode) and PIM-SM (Sparse Mode)
• PIM-DM is used in a dense multicast environment, such
as a LAN
• PIM-DM is a source-based tree routing protocol that
uses RPF and pruning and grafting strategies for
multicasting. However, it is independent of the underlying
unicast protocol.
• PIM-SM is used in a sparse multicast environment such
as a WAN
• PIM-SM is a group-shared routing protocol that has a
rendezvous point as the source of the tree
• PIM-SM is similar to CBT but uses a simpler procedure.
61. Address Resolution Protocol (ARP)
is a protocol used by the Internet Protocol (IP)
[RFC826], specifically IPv4, to map IP network
addresses to the hardware addresses used by a
data link protocol.
The protocol operates below the network layer
as a part of the interface between the OSI
network and OSI link layer.
66. Routing Information Protocol
• RIP: an intradomain routing protocol used inside an AS
• Simple protocol based distance vector routing
• Metric is simple, a hop count. The distance is defined as
the number of links (networks) to reach the destination
69. What is IPv6
• Also known as IPng (next generation)
• A new version of the Internet Protocol
– Primarily designed to extend address space
–Enhancements and new features
70. Why is IPv6 Here
• IPv6 provides a platform for new Internet
functionality that will be needed in the
immediate future, and provide flexibility for
further growth and expansion.
71. Features of IPv6
• 128 bit Addressing
• Header
• Security
• Privacy
• Autoconfiguration
• Routing
• Quality of Service
72. IPv6 Addresses
• An IPv6 address is 128 bits long
• Hexadecimal colon notation:
• Abbreviation:
73. IPv6
• Destination address can belong
Categories
to any of three
1. Unicast – Defines a single computer
2. Anycast –Defines a group of computers with same prefix
3. Multicast-Defines a group with same prefix & delivers to
each
• IPv6 address is divided in two parts. First part is called
as type prefix. This is variable length prefix defines the
purpose of the address (3 to 10 bits)
74. IPv6 Addresses
• Unicast addresses: define a single computer
– Two types: geographically based and provider-based
– Prefixes for provider-based unicast address
– Type id (3 bits), Registry id (5 bits)
Multicast addresses:
define a group of
hosts
75. IPv6 Addresses
• Anycast addresses: define a group of nodes
– Unlike multicast, a packet is delivered to only one of the
members of the anycast group, the nearest
• Reserved addresses:
• Local addresses: private networks
81. Compatible address
A compatible address is 96 bit 0 followed by 32 bit IPv4 address & used to
send to message to another IPv6 machine but intermediate path is IPv4.
We require IPv4 address in some cases which can be embedded in IPv6
address by two methods. 1. Compatible 2. Mapped
In compatible address 32 bit IPv4 address is preceded by 96 bits zeros.
For e.g. 2.13.17.14 becomes
0::020D:110E
82. Mapped address
A mapped address is 80 bit 0 followed by 16 bits of 1’s followed
by 32 bit IPv4 address. This is used for communicating to IPv4
client .
A mapped address uses 80 bit of zeros followed by 16 bits of
one, followed by 32 bit IPv4 address. For e.g.
2.13.17.14 becomes 0::FFFF:020D:110E
These two methods are useful even calculating checksum for
IPv4 addresses.
83. Link local address
These are defined for private addresses. Block identifier is
1111111010. Next 70 bits set to 0 and last 48 bits define node address.
84. Site local address
These are defined for site local addresses. Block identifier is
1111111011. Next 38 bits set to 0 and last 80 bits define subnet
& node address
85. Multicast address
Multicast start with 8 bits 1 prefix. 4 bit flag defines permanent or
transient. Permanent can be defined by IANA & used all times
while transient used temporarily for e.g. teleconferencing.
88. IPv4 Header
VERS HL
Fragment Offset
Fragment Length
Service
Datagram ID FLAG
TTL Protocol Header Checksum
Source Address
Destination Address
Options (if any)
Data
1 byte
1 byte 1 byte 1 byte
4 for IPv4
89. 91
IPv6 Header
VERS PRIO
Hop Limit
Flow Label
Payload Length Next Header
1 byte
1 byte 1 byte 1 byte
6 for IPv6
Source Address (128 bits - 16 bytes)
Dest. Address (128 bits - 16 bytes)
90. 92
IPv6 Header Fields
• VERS: 6 (IP version number)
• Priority: will be used in congestion control
• Flow Label: experimental - sender can label a
sequence of packets as being in the same flow.
• Payload Length: number of bytes in everything
following the 40 byte header, or 0 for a Jumbogram.
91. 93
IPv6 Header Fields
• Next Header is similar to the IPv4 “protocol”
field - indicates what type of header follows
the IPv6 header.
• Hop Limit is similar to the IPv4 TTL field (but
now it really means hops, not time).
97. Three transition strategies from IPv4 to IPv6
• Transition should be smooth to prevent any problems
between IPv4 and IPv6 systems
98. Dual stack
All hosts have a dual stack of protocols before migrating
completely to version 6
• Uses both protocol stack & related other protocols.
• Uses a DNS query, If DNS returns 32 bit IP it sends IPv4
packet otherwise IPv6.
99. Tunneling
IPv6 packet is encapsulated in an IPv4 packet
• Tunneling can be of two types-
Automatic & Configured Tunneling
100. Automatic Tunneling
• If destination uses IPv6 compatible address it uses
automatic tunneling. Here sender sends IPv6 compatible
packet which will be encapsulated by IPv4 address &
transition take place to the receiver. Receiver takes IPv4
packet , determines that it is encapsulated IPv6 packet.
Extract it & sends to IPv6 protocol.
101. Configured tunneling
• If destination is not supporting IPv6 compatible address
it uses configured tunneling. Here sender sends IPv6
non compatible packet which will be encapsulated by
IPv4 address & transition take place to the receiver.
Router at boundary decapsulates IPv4 packet. Receiver
takes IPv6 packet & processes it.
102. Header translation
• Necessary when the majority of the Internet has
moved to IPv6 but some systems still use IPv4
• Header format must be changed totally through
header translation