0% found this document useful (0 votes)
3 views43 pages

Unit II Networks and Security

This document covers the network layer protocols in the TCP/IP suite, focusing on IPv4 and IPv6 addressing, routing, and key services such as packetizing, routing, error control, flow control, congestion control, and security. It details the structure and categories of IPv4 addressing, including classful and classless addressing, and explains the Internet Protocol (IP) and Internet Control Message Protocol (ICMP) functionalities. The document also discusses the IP datagram format, fragmentation, and the role of ICMP in error reporting and queries.

Uploaded by

rajesh08980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views43 pages

Unit II Networks and Security

This document covers the network layer protocols in the TCP/IP suite, focusing on IPv4 and IPv6 addressing, routing, and key services such as packetizing, routing, error control, flow control, congestion control, and security. It details the structure and categories of IPv4 addressing, including classful and classless addressing, and explains the Internet Protocol (IP) and Internet Control Message Protocol (ICMP) functionalities. The document also discusses the IP datagram format, fragmentation, and the role of ICMP in error reporting and queries.

Uploaded by

rajesh08980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

UNIT II NETWORK LAYER PROTOCOLS

Network Layer – IPv4 Addressing – Network Layer Protocols (IP,ICMP and Mobile IP) Unicast and Multicast
Routing – Intradomain and Interdomain Routing Protocol–IPv6 Addresses – IPv6 – Datagram Format -
Transition from IPv4 to IPv6.
INTRODUCTION

• The network layer in the TCP/IP protocol suite is responsible for the host-to- host delivery of
datagrams.
• It provides services to the transport layer and receives services from 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.

Services provided by network layer are

1.PACKETIZING
▪ The first duty of the network layer is definitely packetizing.
▪ This means encapsulating the payload (data received from upper layer) in a network-layer
packet at the source and decapsulating the payload from the network-layer packet at the
destination.
▪ The network layer is responsible for delivery of packets from a sender to a receiver without
changing or using the contents.

2.ROUTING AND FORWARDING


Routing
▪ The network layer is responsible for routing the packet from its source to the destination.
▪ The network layer is responsible for finding the best one among these possible routes.
▪ The network layer needs to have some specific strategies for defining the best route.
▪ Routing is the concept of applying strategies and running routing protocols to create the
decision-making tables for each router.
▪ These tables are called as routing tables.

Forwarding
▪ Forwarding can be defined as the action applied by each router when a packet arrives at one of
its interfaces.
▪ The decision-making table, a router normally uses for applying this action is called the
forwarding table.
▪ When a router receives a packet from one of its attached networks, it needs to forward the packet
to another attached network.

3.ERROR CONTROL
▪ The network layer in the Internet does not directly provide error control.
▪ It adds a checksum field to the datagram to control any corruption in the header, but
not in the whole datagram.
▪ This checksum prevents any changes or corruptions in the header of the datagram.
▪ The Internet uses an auxiliary protocol called ICMP, that provides some kind of error
control if the datagram is discarded or has some unknown information in the header.

4.FLOW CONTROL
1
▪ Flow control regulates the amount of data a source can send without overwhelming the
receiver.
▪ The network layer in the Internet, however, does not directly provide any flow control.
▪ The datagrams are sent by the sender when they are ready, without any attention to the readiness
of the receiver.
▪ Flow control is provided for most of the upper-layer protocols that use the services of
the network layer, so another level of flow control makes the network layer more
complicated and the whole system less efficient.

5.CONGESTION CONTROL
▪ Another issue in a network-layer protocol is congestion control.
▪ Congestion in the network layer is a situation in which too many datagrams are present
in an area of the Internet.
▪ Congestion may occur if the number of datagrams sent by source computers is beyond
the capacity of the network or routers.
▪ In this situation, some routers may drop some of the datagrams.

6.SECURITY
▪ Another issue related to communication at the network layer is security.
▪ To provide security for a connectionless network layer, we need to have another virtual
level that changes the connectionless service to a connection- oriented service. This
virtual layer is called as called IPSec (IP Security).
IPV4 ADDRESSING
• The IP address is the address of the connection, not the host or the router. An IPv4
address is a 32-bit address that uniquely and universally defines theconnection .
• If the device is moved to another network, the IP address may be changed.
• IPv4 addresses are unique in the sense that each address defines one, and onlyone,
connection to the Internet.
• If a device has two connections to the Internet, via two networks, it has twoIPv4
addresses.
• Pv4 addresses are universal in the sense that the addressing system must beaccepted
by any host that wants to be connected to the Internet.

IPV4 ADDRESS SPACE

• IPv4 defines addresses has an address space.


• An address space is the total number of addresses used by the protocol.
• If a protocol uses b bits to define an address, the address space is 2 b because
each bit can have two different values (0 or 1).
• IPv4 uses 32-bit addresses, which means that the address space is 2 32 or
4,294,967,296 (more than four billion).
• 4 billion devices could be connected to the Internet.

IPV4 ADDRESS NOTATION


There are three common notations to show an IPv4 address:
(i) binary notation (base 2), (ii) dotted-decimal notation (base 256), and
(ii) hexadecimal notation (base 16).

2
In binary notation, an IPv4 address is displayed as 32 bits. To make the address morereadable,
one or more spaces are usually inserted between bytes (8 bits).

In dotted-decimal notation,IPv4 addresses are usually written in decimal form with a decimal
point (dot) separating the bytes. Each number in the dotted-decimal notation is between 0 and
255.

In hexadecimal notation, each hexadecimal digit is equivalent to four bits. This means that a 32-
bit address has 8 hexadecimal digits. This notation is often used in network programming.

HIERARCHY IN IPV4 ADDRESSING


• In any communication network that involves delivery, the addressing system is
hierarchical.
• A 32-bit IPv4 address is also hierarchical, but divided only into two parts.
• The first part of the address, called the prefix, defines the network(Net ID); thesecond
part of the address, called the suffix, defines the node (Host ID).
• The prefix length is n bits and the suffix length is (32- n) bits.

• A prefix can be fixed length or variable length.


• The network identifier in the IPv4 was first designed as a fixed-length prefix.
• This scheme is referred to as classful addressing.
• The new scheme, which is referred to as classless addressing, uses a variable-length
network prefix.

CATEGORIES OF IPV4 ADDRESSING


• There are two broad categories of IPv4 Addressing techniques.
• They are
➢ Classful Addressing
➢ Classless Addressing

3
CLASSFUL ADDRESSING
• An IPv4 address is 32-bit long(4 bytes).
• An IPv4 address is divided into sub-classes:

Classful Network Architecture

Class A
• In Class A, an IP address is assigned to those networks that contain a largenumber
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 0and the
remaining 7 bits determine the network ID.
• The 24 bits determine the host ID in any network.

4
• The total number of networks in Class A = 2 7 = 128 network address
• The total number of hosts in Class A = 2 24 - 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 = 2 14 = 16384 network address
• The total number of hosts in Class B = 2 16 - 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 = 2 21 = 2097152 network address
• The total number of hosts = 2 8 - 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 remainingbits
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.

5
• The higher order bits of the first octet is always set to 1111, and the remainingbits
determines the host ID in any network.

NETWORK LAYER PROTOCOLS


1. INTERNET PROTOCOL
➢ The main protocol Internet Protocol is responsible for packetizing, forwarding,and
delivery of a packet at the network layer.
➢ The Internet Control Message Protocol version 4 (ICMPv4) helps IPv4 tohandle some
errors that may occur in the network-layer delivery.

IP - INTERNET PROTOCOL
➢ The Internet Protocol is the key tool used today to build scalable,
heterogeneous internetworks.
➢ IP runs on all the nodes (both hosts and routers) in a collection of networks

➢ IP defines the infrastructure that allows these nodes and networks to functionas a
single logical internetwork.

IP SERVICE MODEL
➢ Service Model defines the host-to-host services that we want to provide
➢ The main concern in defining a service model for an internetwork is that we can provide
a host-to-host service only if this service can somehow be provided overeach of the
underlying physical networks.
➢ The Internet Protocol is the key tool used today to build scalable, heterogeneous
internetworks.
➢ The IP service model can be thought of as having two parts:
• A GLOBAL ADDRESSING SCHEME - which provides a way toidentify
all hosts in the internetwork
• A DATAGRAM DELIVERY MODEL – A connectionless model of data
delivery.
IP PACKET FORMAT / IP DATAGRAM FORMAT
➢ A key part of the IP service model is the type of packets that can be carried.

6
➢ The IP datagram consists of a header followed by a number of bytes of data.

FIELD DESCRIPTION

Version Specifies the version of IP. Two versions exists – IPv4 and IPv6.
HLen Specifies the length of the header
TOS An indication of the parameters of the quality of servicedesired such
(Type of Service) as Precedence, Delay, Throughput and Reliability.
Length Length of the entire datagram, including the header. The maximumsize of
an IP datagram is 65,535(210 )bytes
Ident Uniquely identifies the packet sequence number.
(Identification) Used for fragmentation and re-assembly.
Flags Used to control whether routers are allowed to fragment a packet.If a
packet is fragmented , this flag value is 1.If not, flag value is0.

Offset Indicates where in the datagram, this fragment belongs.


(Fragmentation The fragment offset is measured in units of 8 octets(64
offset) bits). The first fragment has offset zero.
TTL Indicates the maximum time the datagram is allowed to
(Time to Live) remain in the network. If this field contains the value zero, then the
datagram must be destroyed.
Protocol Indicates the next level protocol used in the data portion of the
datagram
Checksum Used to detect the processing errors introduced into the packet

Source Address The IP address of the original sender of the packet.

Destination The IP address of the final destination of the packet.


Address
Options This is optional field. These options may contain values foroptions such
as Security, Record Route, Time Stamp, etc
Pad Used to ensure that the internet header ends on a 32 bit boundary.The
padding is zero.

7
IP DATAGRAM - FRAGMENTATION AND REASSEMBLY
Fragmentation :
➢ Every network type has a maximum transmission unit (MTU), which is thelargest
IP datagram that it can carry in a frame.

➢ Fragmentation of a datagram will only be necessary if the path to thedestination


includes a network with a smaller MTU.
➢ When a host sends an IP datagram,it can choose any size that it wants.
➢ Fragmentation typically occurs in a router when it receives a datagram that it wants
to forward over a network that has an MTU that is smaller than thereceived
datagram.
➢ Each fragment is itself a self-contained IP datagram that is transmitted over a
sequence of physical networks, independent of the other fragments.
➢ Each IP datagram is re-encapsulated for each physical network over which ittravels.

➢ For example , if we consider an Ethernet network to accept packets up to 1500bytes


long.
➢ This leaves two choices for the IP service model:
• Make sure that all IP datagrams are small enough to fit inside one packeton any
network technology
• Provide a means by which packets can be fragmented and reassembledwhen
they are too big to go over a given network technology.
➢ Fragmentation produces smaller, valid IP datagrams that can be readily reassembled into
the original datagram upon receipt, independent of the orderof their arrival.

Example:

➢ The original packet starts at the client; the fragments are reassembled at theserver.
➢ The value of the identification field is the same in all fragments, as is the valueof the
flags field with the more bit set for all fragments except the last.
➢ Also, the value of the offset field for each fragment is shown.
➢ Although the fragments arrived out of order at the destination, they can becorrectly
reassembled.

8
ICMPV4 - INTERNET CONTROL MESSAGE PROTOCOL VERSION 4
➢ ICMP is a network-layer protocol.
➢ It is a companion to the IP protocol.
➢ Internet Control Message Protocol (ICMP) defines a collection of error messages that
are sent back to the source host whenever a router or host isunable to process an
IP datagram successfully.

ICMP MESSAGE TYPES


➢ ICMP messages are divided into two broad categories: error-reportingmessages
and query messages.
➢ The error-reporting messages report problems that a router or a host(destination)
may encounter when it processes an IP packet.
➢ The query messages help a host or a network manager get specific informationfrom a
router or another host.

ICMP Error – Reporting Messages

➢ Destination Unreachable―When a router cannot route a datagram, the datagram is


discarded and sends a destination unreachable message to source host.
➢ Source Quench―When a router or host discards a datagram due to congestion, it sends a
source-quench message to the source host. This message acts as flowcontrol.
➢ Time Exceeded―Router discards a datagram when TTL field becomes 0 and atime
exceeded message is sent to the source host.
➢ Parameter Problem―If a router discovers ambiguous or missing value in any field of the
datagram, it discards the datagram and sends parameter problemmessage to source.
➢ Redirection―Redirect messages are sent by the default router to inform the sourcehost to
update its forwarding table when the packet is routed on a wrong path.

9
ICMP Query Messages

Echo Request & Reply―Combination of echo request and reply messages


determines whether two systems communicate or not.
Timestamp Request & Reply―Two machines can use the timestamp requestand
reply messages to determine the round-trip time (RTT).
Address Mask Request & Reply―A host to obtain its subnet mask, sends an address
mask request message to the router, which responds with an addressmask reply
message.
Router Solicitation/Advertisement―A host broadcasts a router solicitation message to
know about the router. Router broadcasts its routing information with router
advertisement message.

ICMP MESSAGE FORMAT


An ICMP message has an 8-byte header and a variable-size data section.

Type Defines the type of the message


Code Specifies the reason for the particular message type
Checksum Used for error detection
Rest of the header Specific for each message type
Data Used to carry information
Identifier Used to match the request with the reply
Sequence Number Sequence Number of the ICMP packet

10
ICMP DEBUGGING TOOLS
Two tools are used for debugging purpose. They are (1) Ping (2) Traceroute

Ping
The ping program is used to find if a host is alive and responding.
The source host sends ICMP echo-request messages; the destination, if alive,responds
with ICMP echo-reply messages.

The ping program sets the identifier field in the echo-request and echo-reply message
and starts the sequence number from 0; this number is incremented by1 each time a
new message is sent.
The ping program can calculate the round-trip time.
It inserts the sending time in the data section of the message.
When the packet arrives, it subtracts the arrival time from the departure time toget the
round-trip time (RTT).
$ ping google.com

Traceroute or Tracert
The traceroute program in UNIX or tracert in Windows can be used to tracethe path
of a packet from a source to the destination.
It can find the IP addresses of all the routers that are visited along the path.
The program is usually set to check for the maximum of 30 hops (routers) to bevisited.
The number of hops in the Internet is normally less than this.
$ traceroute google.com

9. UNICAST ROUTING
• Routing is the process of selecting best paths in a network.
• In unicast routing, a packet is routed, hop by hop, from its source to itsdestination by
the help of forwarding tables.
• Routing a packet from its source to its destination means routing the packet from a
source router (the default router of the source host) to a destinationrouter (the
router connected to the destination network).
• The source host needs no forwarding table because it delivers its packet to thedefault
router in its local network.
• The destination host needs no forwarding table either because it receives thepacket
from its default router in its local network.
• Only the intermediate routers in the networks need forwarding tables.

NETWORK AS A GRAPH
The Figure below shows a graph representing a network.

11
The nodes of the graph, labeled A through G, may be hosts, switches, routers,or
networks.
The edges of the graph correspond to the network links.
Each edge has an associated cost.

The basic problem of routing is to find the lowest-cost path between any two nodes,
where the cost of a path equals the sum of the costs of all the edges thatmake up the
path.
This static approach has several problems:
❖ It does not deal with node or link failures.
❖ It does not consider the addition of new nodes or links.
❖ It implies that edge costs cannot change.
For these reasons, routing is achieved by running routing protocols among thenodes.
These protocols provide a distributed, dynamic way to solve the problem of finding
the lowest-cost path in the presence of link and node failures andchanging edge
costs.

UNICAST ROUTING ALGORITHMS

➢ There are three main classes of routing protocols:


1) Distance Vector Routing Algorithm – Routing Information Protocol
2) Link State Routing Algorithm – Open Shortest Path First Protocol
3) Path-Vector Routing Algorithm - Border Gateway Protocol

DISTANCE VECTOR ROUTING (DSR)


ROUTING INFORMATION PROTOCOL (RIP)
BELLMAN - FORD ALGORITHM

Distance vector routing is distributed, i.e., algorithm is run on all nodes.


Each node knows the distance (cost) to each of its directly connected neighbors.
Nodes construct a vector (Destination, Cost, NextHop) and distributes to its
neighbors.
Nodes compute routing table of minimum distance to every other node via
NextHop using information obtained from its neighbors.

Initial State

In given network, cost of each link is 1 hop.


Each node sets a distance of 1 (hop) to its immediate neighbor andcost
to itself as 0.
Distance for non-neighbors is marked as unreachable with value ∞ (infinity).
For node A, nodes B, C, E and F are reachable, whereas nodes D and G
are unreachable.

12
The initial table for all the nodes are given below

Each node sends its initial table (distance vector) to neighbors and receivestheir
estimate.
Node A sends its table to nodes B, C, E & F and receives tables from nodes B,C, E &
F.
Each node updates its routing table by comparing with each of its neighbor'stable
For each destination, Total Cost is computed as:
▪ Total Cost = Cost (Node to Neighbor) + Cost (Neighbor to Destination)
If Total Cost < Cost then
▪ Cost = Total Cost and NextHop = Neighbor
Node A learns from C's table to reach node D and from F's table to reachnode
G.
Total Cost to reach node D via C = Cost (A to C) + Cost(C to D)
Cost = 1 + 1 = 2.
▪ Since 2 < ∞, entry for destination D in A's table is changed to (D, 2, C)
▪ Total Cost to reach node G via F = Cost(A to F) + Cost(F to G) = 1 + 1 = 2
▪ Since 2 < ∞, entry for destination G in A's table is changed to (G, 2, F)
Each node builds complete routing table after few exchanges amongst itsneighbors.

13
System stabilizes when all nodes have complete routing information, i.e.,
convergence.
Routing tables are exchanged periodically or in case of triggered update.
The final distances stored at each node is given below:

Updation of Routing Tables


There are two different circumstances under which a given node decides to send arouting update
to its neighbors.

Periodic Update
➢ In this case, each node automatically sends an update message every so often,even if
nothing has changed.
➢ The frequency of these periodic updates varies from protocol to protocol, butit is
typically on the order of several seconds to several minutes.
Triggered Update
In this case, whenever a node notices a link failure or receives an update from one of
its neighbors that causes it to change one of the routes in its routingtable.

14
Whenever a node’s routing table changes, it sends an update to its neighbors, which
may lead to a change in their tables, causing them to send an update totheir neighbors.

ROUTING INFORMATION PROTOCOL (RIP)


• RIP is an intra-domain routing protocol based on distance-vector algorithm.
Example



• Routers advertise the cost of reaching networks. Cost of reaching each link is 1 hop. For
example, router C advertises to A that it can reach network 2, 3 at cost0 (directly
connected), networks 5, 6 at cost 1 and network 4 at cost 2.
• Each router updates cost and next hop for each network number.
• Infinity is defined as 16, i.e., any route cannot have more than 15 hops.Therefore RIP
can be implemented on small-sized networks only.
• Advertisements are sent every 30 seconds or in case of triggered update.

Command - It indicates the packet type.


Value 1 represents a request packet. Value 2 represents a response packet.
Version - It indicates the RIP version number. For RIPv1, the value is 0x01.
Address Family Identifier - When the value is 2, it represents the IP protocol.
IP Address - It indicates the destination IP address of the route. It can be theaddresses
of only the natural network segment.
Metric - It indicates the hop count of a route to its destination.

Count-To-Infinity (or) Loop Instability Problem

• Suppose link from node A to E goes down.


❖ Node A advertises a distance of ∞ to E to its neighbors
❖ Node B receives periodic update from C before A’s update
reaches B
❖ Node B updated by C, concludes that E can be reached in 3 hops via C
❖ Node B advertises to A as 3 hops to reach E

15
❖ Node A in turn updates C with a distance of 4 hops to E and so on
• Thus nodes update each other until cost to E reaches infinity, i.e., noconvergence.
• Routing table does not stabilize.
• This problem is called loop instability or count to infinity

Solution to Count-To-Infinity (or) Loop Instability Problem :

• Infinity is redefined to a small number, say 16.


• Distance between any two nodes can be 15 hops maximum. Thus distancevector
routing cannot be used in large networks.
• When a node updates its neighbors, it does not send those routes it learnedfrom
each neighbor back to that neighbor. This is known as split horizon.
• Split horizon with poison reverse allows nodes to advertise routes it learntfrom a
node back to that node, but with a warning message.

LINK STATE ROUTING (LSR)


OPEN SHORTEST PATH PROTOCOL (OSPF)
DIJKSTRA’S
• Each node knows state of link ALGORITHM
to its neighbors and cost.
• Nodes create an update packet called link-state packet (LSP) that contains:
➢ ID of the node
➢ List of neighbors for that node and associated cost
➢ 64-bit Sequence number
➢ Time to live
• Link-State routing protocols rely on two mechanisms:
➢ Reliable flooding of link-state information to all other nodes
➢ Route calculation from the accumulated link-state knowledge

Reliable Flooding
• Each node sends its LSP out on each of its directly connected links.
• When a node receives LSP of another node, checks if it has an LSP already forthat
node.
• If not, it stores and forwards the LSP on all other links except the incomingone.
• Else if the received LSP has a bigger sequence number, then it is stored and
forwarded. Older LSP for that node is discarded.
• Otherwise discard the received LSP, since it is not latest for that node.
• Thus recent LSP of a node eventually reaches all nodes, i.e., reliable flooding.

(a) (b) (c) (d)

16
• Flooding of LSP in a small network is as follows:
➢ When node X receives Y’s LSP (fig a), it floods onto its neighbors A
and C (fig b)
➢ Nodes A and C forward it to B, but does not sends it back to X (fig c).
➢ Node B receives two copies of LSP with same sequence number.
➢ Accepts one LSP and forwards it to D (fig d). Flooding is complete.
• LSP is generated either periodically or when there is a change in the topology.

Route Calculation
• Each node knows the entire topology, once it has LSP from every other node.
• Forward search algorithm is used to compute routing table from the receivedLSPs.
• Each node maintains two lists, namely Tentative and Confirmed with entries ofthe form
(Destination, Cost, NextHop).

OPEN SHORTEST PATH FIRST PROTOCOL (OSPF)

• OSPF is a non-proprietary widely used link-state routing protocol.


• OSPF Features are:
➢ Authentication―Malicious host can collapse a network by advertising to reach
every host with cost 0. Such disasters are averted by authenticating routing
updates.
➢ Additional hierarchy―Domain is partitioned into areas, i.e., OSPF is more
scalable.
➢ Load balancing―Multiple routes to the same place are assigned same cost.
Thus traffic is distributed evenly.

Link State Packet Format

◻ Version ― represents the current version, i.e., 2.


◻ Type ― represents the type (1–5) of OSPF message.
Type 1 - “hello” message, Type 2 - request, Type 3 – send ,
Type 4 - acknowledge the receipt of link state messages ,
Type 5 - reserved

◻ SourceAddr ― identifies the sender


◻ AreaId ― 32-bit identifier of the area in which the node is located
◻ Checksum ― 16-bit internet checksum
◻ Authentication type ― 1 (simple password), 2 (cryptographic authentication).
◻ Authentication ― contains password or cryptographic checksum

17
Difference Between Distance-Vector And Link-State Algorithms

Distance vector Routing Link state Routing


Each node talks only to its directly Each node talks to all other nodes, but it
connected neighbors, but it tells them tells them only what it knows for sure
everything it has learned (i.e., only the state of its directly
connected links).
(i.e., distance to all nodes).

PATH VECTOR ROUTING (PVR)


BORDER GATEWAY PROTOCOL (BGP)
• Path-vector routing is an asynchronous and distributed routing algorithm.
• The Path-vector routing is not based on least-cost routing.
• The best route is determined by the source using the policy it imposes on the route.
• In other words, the source can control the path.
• Path-vector routing is not actually used in an internet, and is mostly designed to route
a packet between ISPs.

Spanning Trees
• In path-vector routing, the path from a source to all destinations is determined by the
best spanning tree.
• The best spanning tree is not the least-cost tree.
• It is the tree determined by the source when it imposes its own policy.
• If there is more than one route to a destination, the source can choose the route that
meets its policy best.
• A source may apply several policies at the same time.
• One of the common policies uses the minimum number of nodes to be visited. Another
common policy is to avoid some nodes as the middle node in a route.
• The spanning trees are made, gradually and asynchronously, by each node. When a
node is booted, it creates a path vector based on the information it can obtain about its
immediate neighbor.
• A node sends greeting messages to its immediate neighbors to collect these pieces of
information.
• Each node, after the creation of the initial path vector, sends it to all its immediate
neighbors.
• Each node, when it receives a path vector from a neighbor, updates its path vector using
the formula

• The policy is defined by selecting the best of multiple paths.


• Path-vector routing also imposes one more condition on this equation.
• If Path (v, y) includes x, that path is discarded to avoid a loop in the path.
• In other words, x does not want to visit itself when it selects a path to y.

18
Example:
• The Figure below shows a small internet with only five nodes.
• Each source has created its own spanning tree that meets its policy.
• The policy imposed by all sources is to use the minimum number of nodes to reach a
destination.
• The spanning tree selected by A and E is such that the communication does not pass
through D as a middle node.
• Similarly, the spanning tree selected by B is such that the communication does not
pass through C as a middle node.

Path Vectors made at booting time


• The Figure below shows all of these path vectors for the example.
• Not all of these tables are created simultaneously.
• They are created when each node is booted.
• The figure also shows how these path vectors are sent to immediate neighbors after
they have been created.

Updating Path Vectors


• The Figure below shows the path vector of node C after two events.
• In the first event, node C receives a copy of B’s vector, which improves its
vector: now it knows how to reach node A.
• In the second event, node C receives a copy of D’s vector, which does not
change its vector.
• The vector for node C after the first event is stabilized and serves as its
forwarding table.

19
BORDER GATEWAY PROTOCOL (BGP)

• The Border Gateway Protocol version (BGP) is the only interdomain routing
protocol used in the Internet today.
• BGP4 is based on the path-vector algorithm. It provides information about the
reachability of networks in the Internet.
• BGP views internet as a set of autonomous systems interconnected
arbitrarily.

• Each AS have a border router (gateway), by which packets enter and leave that AS.
In above figure, R3 and R4 are border routers.
• One of the router in each autonomous system is designated as BGP speaker.
• BGP Speaker exchange reachability information with other BGP speakers,
known as external BGP session.
• BGP advertises complete path as enumerated list of AS (path vector) to reach a
particular network.
• Paths must be without any loop, i.e., AS list is unique.
• For example, backbone network advertises that networks 128.96 and 192.4.153 can
be reached along the path <AS1, AS2, AS4>.

• If there are multiple routes to a destination, BGP speaker chooses one based on
policy.
20
• Speakers need not advertise any route to a destination, even if one exists.
• Advertised paths can be cancelled, if a link/node on the path goes down. This
negative advertisement is known as withdrawn route.
• Routes are not repeatedly sent. If there is no change, keep alive messages are sent.

iBGP - interior BGP


• A Variant of BGP
• Used by routers to update routing information learnt from other speakers to
routers inside the autonomous system.
• Each router in the AS is able to determine the appropriate next hop for all
prefixes.

10. UNICAST ROUTING PROTOCOLS

• A protocol is more than an algorithm.


• A protocol needs to define its domain of operation, the messages exchanged,
communication between routers, and interaction with protocols in other domains.
• A routing protocol specifies how routers communicate with each other, distributing
information that enables them to select routes between any two nodes on a
computer network.
• Routers perform the "traffic directing" functions on the Internet; data packets are
forwarded through the networks of the internet from router to router until they reach
their destination computer.
• Routing algorithms determine the specific choice of route.
• Each router has a prior knowledge only of networks attached to it directly.
• A routing protocol shares this information first among immediate neighbors, and then
throughout the network. This way, routers gain knowledge of the topology of the
network.
• The ability of routing protocols to dynamically adjust to changing conditions such as
disabled data lines and computers and route data around obstructions is what gives the
Internet its survivability and reliability.
• The specific characteristics of routing protocols include the manner in which they avoid
routing loops, the manner in which they select preferred routes, using information about
hop costs, the time they require to reach routing convergence, their scalability, and other
factors.

21
INTERNET STRUCTURE
• Internet has a million networks. Routing table entries per router should be
minimized.
• Link state routing protocol is used to partition domain into areas.
• An routing area is a set of routers configured to exchange link-state
information.
• Area introduces an additional level of hierarchy.
• Thus domains can grow without burdening routing protocols.

• There is one special area—the backbone area, also known as area 0.


• Routers R1, R2 and R3 are part of backbone area.
• Routers in backbone area are also part of non-backbone areas. Such routers are known
as Area Border Routers (ABR).
• Link-state advertisement is exchanged amongst routers in a non-backbone area.
• They do not see LSAs of other areas. For example, area 1 routers are not aware of
area 3 routers.
• ABR advertises routing information in their area to other ABRs.
• For example,R2 advertises area 2 routing information to R1 and R3, which in turn
pass onto their areas.
• All routers learn how to reach all networks in the domain.
• When a packet is to be sent to a network in another area, it goes through
backbone area via ABR and reaches the destination area.
• Routing Areas improve scalability but packets may not travel on the shortest path.

INTER DOMAIN ROUTING


• Internet is organized as autonomous systems (AS) each of which is under the control
of a single administrative entity.
• A corporation’s complex internal network might be a single AS, as may the
network of a single Internet Service Provider (ISP).
• Interdomain routing shares reachability information between autonomous
systems.

22
• The basic idea behind autonomous systems is to provide an additional way to
hierarchically aggregate routing information in a large internet, thus improving
scalability.
• Internet has backbone networks and sites. Providers connect at a peering point.

Traffic on the internet is of two types:


➢ Local Traffic - Traffic within an autonomous system is called local.
➢ Transit Traffic - Traffic that passes through an autonomous system is called
transit.

Autonomous Systems (AS) are classified as:


➢ Stub AS - is connected to only one another autonomous system and carries local
traffic only (e.g. Small corporation).
➢ Multihomed AS - has connections to multiple autonomous systems but refuses to
carry transit traffic (e.g. Large corporation).
➢ Transit AS - has connections to multiple autonomous systems and is designed to carry
transit traffic (e.g. Backbone service provider).

23
Policies Used By Autonomous Systems :
➢ Provider-Customer―Provider advertises the routes it knows, to the customer and
advertises the routes learnt from customer to everyone.
➢ Customer-Provider―Customers want the routes to be diverted to them. So they
advertise their own prefixes and routes learned from customers to provider and
advertise routes learned from provider to customers.
➢ Peer―Two providers access to each other’s customers without having to pay.

CHALLENGES IN INTER-DOMAIN ROUTING PROTOCOL


• Each autonomous system has an intra-domain routing protocol, its own policy and
metric.
• Internet backbone must be able to route packets to the destination that complies with
policies of autonomous system along a loopless path.
• Service providers have trust deficit and may not trust advertisements by other AS, or
may refuse to carry traffic from other AS.

TYPES OF ROUTING PROTOCOLS

Two types of Routing Protocols are used in the Internet:


1) Intradomain routing
➢ Routing within a single autonomous system
➢ Routing Information Protocol (RIP) - based on the distance-vector
algorithm - (REFER distance-vector routing algorithm)
➢ Open Shortest Path First (OSPF) - based on the link-state algorithm -
(REFER link-state routing algorithm)
2) Interdomain routing
➢ Routing between autonomous systems.
➢ Border Gateway Protocol (BGP) - based on the path-vector algorithm -
(REFER Path Vector routing algorithm)

24
11. MULTICASTING
• In multicasting, there is one source and a group of destinations.
• Multicast supports efficient delivery to multiple destinations.
• The relationship is one to many or many-to-many.
• One-to-Many (Source Specific Multicast)
o Radio station broadcast
o Transmitting news, stock-price
o Software updates to multiple hosts
• Many-to-Many (Any Source Multicast)
o Multimedia teleconferencing
o Online multi-player games
o Distributed simulations
• In this type of communication, the source address is a unicast address, but the
destination address is a group address.
• The group address defines the members of the group.

• In multicasting, a multicast router may have to send out copies of the same
datagram through more than one interface.
• Hosts that are members of a group receive copies of any packets sent to that
group’s multicast address
• A host can be in multiple groups
• A host can join and leave groups
• A host signals its desire to join or leave a multicast group by
communicating with its local router using a special protocol.
• In IPv4, the protocol is Internet Group Management Protocol (IGMP)
• In IPv6, the protocol is Multicast Listener Discovery (MLD)

IGMP OR MLD PROTOCOL


• Hosts communicate their desire to join / leave a multicast group to a router using
Internet Group Message Protocol (IGMP) in IPv4 or Multicast Listener Discovery
(MLD) in IPv6.
25
26

• Provides multicast routers with information about the membership status of hosts
connected to the network.
• Enables a multicast router to create and update list of loyal members for each
group.

MULTICAST ADDRESSING
• Multicast address is associated with a group, whose members are dynamic.
• Each group has its own IP multicast address.
• IP addresses reserved for multicasting are Class D in IPv4 (Class D 224.0.0.1 to
239.255.255.255), 1111 1111 prefix in IPv6.
o
• Hosts that are members of a group receive copy of the packet sent when
destination contains group address.

NEED FOR MULTICAST


Without support for multicast
• A source needs to send a separate packet with the identical data to each
member of the group
• Source needs to keep track of the IP address of each member in the group

Using IP multicast
• Sending host does not send multiple copies of the packet
• A host sends a single copy of the packet addressed to the group’s multicast
address
• The sending host does not need to know the individual unicast IP address of each
member

TYPES OF MULTICASTING
• Source-Specific Multicast - In source-specific multicast (one-to-many model), receiver
specifies multicast group and sender from which it is interested to receive packets.
Example: Internet radio broadcasts.

• Any Source Multicast - Supplements any source multicast (many-to-many model).

MULTICAST APPLICATIONS
• Access to Distributed Databases
• Information Dissemination
• Teleconferencing.
• Distance Learning

MULTICAST ROUTING
• To support multicast, a router must additionally have multicast forwarding tables
that indicate, based on multicast address, which links to use to forward the multicast
packet.
• Unicast forwarding tables collectively specify a set of paths.
27

• Multicast forwarding tables collectively specify a set of trees -Multicast


distribution trees.
• Multicast routing is the process by which multicast distribution trees are
determined.
• To support multicasting, routers additionally build multicast forwarding tables.
• Multicast forwarding table is a tree structure, known as multicast
distribution trees.
• Internet multicast is implemented on physical networks that support
broadcasting by extending forwarding functions.

MULTICAST DISTRIBUTION TREES


There are two types of Multicast Distribution Trees used in multicast routing. They
are
➢ Source-Based Tree: (DVMRP)
▪ For each combination of (source , group), there is a shortest path spanning tree.
▪ Flood and prune
➢ Send multicast traffic everywhere
➢ Prune edges that are not actively subscribed to group
▪ Link-state
➢ Routers flood groups they would like to receive
➢ Compute shortest-path trees on demand
➢ Shared Tree (PIM)
▪ Single distributed tree shared among all sources
▪ Does not include its own topology discovery mechanism, but instead uses
routing information supplied by other routing protocols
▪ Specify rendezvous point (RP) for group
▪ Senders send packets to RP, receivers join at RP

▪ RP multicasts to receivers; Fix-up tree for optimization


▪ Rendezvous-Point Tree: one router is the center of the group and
therefore the root of the tree.

MULTICAST ROUTING PROTOCOLS


• Internet multicast is implemented on physical networks that support
broadcasting by extending forwarding functions.
• Major multicast routing protocols are:
1. Distance-Vector Multicast Routing Protocol (DVMRP)
2. Protocol Independent Multicast (PIM)

1. Distance Vector Multicast Routing Protocol


• The DVMRP, is a routing protocol used to share information between routers
to facilitate the transportation of IP multicast packets among networks.
• It formed the basis of the Internet's historic multicast backbone.
• Distance vector routing for unicast is extended to support multicast routing.
• Each router maintains a routing table for all destination through exchange of
distance vectors.
• DVMRP is also known as flood-and-prune protocol.
• DVMRP consists of two major components:
28

• A conventional distance-vector routing protocol, like RIP


• A protocol for determining how to forward multicast packets, based on the routing
table
• DVMRP router forwards a packet if
• The packet arrived from the link used to reach the source of the packet
• If downstream links have not pruned the tree
• DVMRP protocol uses the basic packet types as follows:

• The forwarding table of DVMRP is as follows:

• Multicasting is added to distance-vector routing in four stages.


➢ Flooding
➢ Reverse Path Forwarding (RPF)
➢ Reverse Path Broadcasting (RPB)
➢ Reverse Path Multicast (RPM)
Flooding
◻ Router on receiving a multicast packet from source S to a Destination from
NextHop, forwards the packet on all out-going links.
◻ Packet is flooded and looped back to S.
◻ The drawbacks are:
o It floods a network, even if it has no members for that group.
o Packets are forwarded by each router connected to a LAN, i.e., duplicate
flooding

Reverse Path Forwarding (RPF)


◻ RPF eliminates the looping problem in the flooding process.
29

◻ Only one copy is forwarded and the other copies are discarded.
◻ RPF forces the router to forward a multicast packet from one specific interface: the one
which has come through the shortest path from the source to the router.
◻ Packet is flooded but not looped back to S.

Reverse-Path Broadcasting (RPB)


◻ RPB does not multicast the packet, it broadcasts it.
◻ 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.
◻ We need to prevent each network from receiving more than one copy of the packet.
◻ If a network is connected to more than one router, it may receive a copy of the packet
from each router.
◻ One router identified as parent called designated Router (DR).
◻ Only parent router forwards multicast packets from source S to the attached
network.
◻ When a router that is not the parent of the attached network receives a multicast packet,
it simply drops the packet.

Reverse-Path Multicasting (RPM)


◻ To increase efficiency, the multicast packet must reach only those networks that
30

have active members for that particular group.


◻ RPM adds pruning and grafting to RPB to create a multicast shortest path tree that
supports dynamic membership changes.

Pruning:
 Sent from routers receiving multicast traffic for which they have no active group
members
 “Prunes” the tree created by DVMRP
 Stops needless data from being sent

Grafting:
 Used after a branch has been pruned back
 Sent by a router that has a host that joins a multicast group
 Goes from router to router until a router active on the multicast group is reached
 Sent for the following cases
▪ A new host member joins a group
▪ A new dependent router joins a pruned branch
▪ A dependent router restarts on a pruned branch

2. Protocol Independent Multicast (PIM)


◻ PIM divides multicast routing problem into sparse and dense mode.
◻ PIM sparse mode (PIM-SM) is widely used.
◻ PIM does not rely on any type of unicast routing protocol, hence protocol
independent.
◻ Routers explicitly join and leave multicast group using Join and Prune
messages.
◻ One of the router is designated as rendezvous point (RP) for each group in a
domain to receive PIM messages.
◻ Multicast forwarding tree is built as a result of routers sending Join messages to RP.
◻ Two types of trees to be constructed:
▪ Shared tree - used by all senders
31

▪ Source-specific tree - used only by a specific sending host


◻ The normal mode of operation creates the shared tree first, followed by one or more
source-specific trees

Shared Tree

◻ When a router sends Join message for group G to RP, it goes through a set of
routers.
◻ Join message is wildcarded (*), i.e., it is applicable to all senders.
◻ Routers create an entry (*, G) in its forwarding table for the shared tree.
◻ Interface on which the Join arrived is marked to forward packets for that group.
◻ Forwards Join towards rendezvous router RP.
◻ Eventually, the message arrives at RP. Thus a shared tree with RP as root is
formed.

Example
◻ Router R4 sends Join message for group G to rendezvous router RP.
◻ Join message is received by router R2. It makes an entry (*, G) in its table and
forwards the message to RP.
◻ When R5 sends Join message for group G, R2 does not forwards the Join. It
adds an outgoing interface to the forwarding table created for that group.

◻ As routers send Join message for a group, branches are added to the tree, i.e., shared.
◻ Multicast packets sent from hosts are forwarded to designated router RP.

◻ Suppose router R1, receives a message to group G.


o R1 has no state for group G.
o Encapsulates the multicast packet in a Register message.
o Multicast packet is tunneled along the way to RP.
◻ RP decapsulates the packet and sends multicast packet onto the shared tree,
towards R2.
◻ R2 forwards the multicast packet to routers R4 and R5 that have members for group G.

Source-Specific Tree
◻ RP can force routers to know about group G, by sending Join message to the
32

sending host, so that tunneling can be avoided.


◻ Intermediary routers create sender-specific entry (S, G) in their tables. Thus a
source-specific route from R1 to RP is formed.
◻ If there is high rate of packets sent from a sender to a group G, then shared- tree is
replaced by source-specific tree with sender as root.

Example

◻ Rendezvous router RP sends a Join message to the host router R1.


◻ Router R3 learns about group G through the message sent by RP.
◻ Router R4 send a source-specific Join due to high rate of packets from sender.
◻ Router R2 learns about group G through the message sent by R4.
◻ Eventually a source-specific tree is formed with R1 as root.

Analysis of PIM
◻ Protocol independent because, tree is based on Join messages via shortest path.
◻ Shared trees are more scalable than source-specific trees.
◻ Source-specific trees enable efficient routing than shared trees.

12. IPV6 - NEXT GENERATION IP

• IPv6 was evolved to solve address space problem and offers rich set of
services.
• Some hosts and routers will run IPv4 only, some will run IPv4 and IPv6 and some
will run IPv6 only.

DRAWBACKS OF IPV4
• Despite subnetting and CIDR, address depletion is still a long-term problem.
• Internet must accommodate real-time audio and video transmission that requires
minimum delay strategies and reservation of resources.
• Internet must provide encryption and authentication of data for some
applications
33

FEATURES OF IPV6
1. Better header format - IPv6 uses a new header format in which options are separated
from the base header and inserted, when needed, between the base header and the data.
This simplifies and speeds up the routing process because most of the options do not
need to be checked by routers.
2. New options - IPv6 has new options to allow for additional functionalities.
3. Allowance for extension - IPv6 is designed to allow the extension of the protocol if
required by new technologies or applications.
4. Support for resource allocation - In IPv6, the type-of-service field has been removed,
but two new fields, traffic class and flow label, have been added to enable the source to
request special handling of the packet. This mechanism can be used to support traffic
such as real-time audio and video.

Additional Features :
1. Need to accommodate scalable routing and addressing
2. Support for real-time services
3. Security support
4. Autoconfiguration -
The ability of hosts to automatically configure themselves with such information as
their own IP address and domain name.
5. Enhanced routing functionality, including support for mobile hosts
6. Transition from ipv4 to ipv6

ADDRESS SPACE ALLOCATION OF IPV6


◻ IPv6 provides a 128-bit address space to handle up to 3.4 × 1038 nodes.
◻ IPv6 uses classless addressing, but classification is based on MSBs.
◻ The address space is subdivided in various ways based on the leading bits.
◻ The current assignment of prefixes is listed in Table

◻ A node may be assigned an “IPv4-compatible IPv6 address” by zero-extending a 32-


bit IPv4 addressto128 bits.

◻ A node that is only capable of understanding IPv4 can be assigned an “IPv4- mapped
IPv6 address” by prefixing the 32-bit IPv4 address with 2 bytes of all 1s and then zero-
extending the result to 128 bits.
GLOBAL UNICAST
◻ Large chunks (87%) of address space are left unassigned for future use.
34

◻ IPv6 defines two types of local addresses for private networks.


o Link local - enables a host to construct an address that need not be
globally unique.
o Site local - allows valid local address for use in a isolated site with several
subnets.
◻ Reserved addresses start with prefix of eight 0's.
o Unspecified address is used when a host does not know its address
o Loopback address is used for testing purposes before connecting
o Compatible address is used when IPv6 hosts uses IPv4 network
o Mapped address is used when a IPv6 host communicates with a IPv4 host
◻ IPv6 defines anycast address, assigned to a set of interfaces.
◻ Packet with anycast address is delivered to only one of the nearest interface.

ADDRESS NOTATION OF IPV6


◻ Standard representation of IPv6 address is x : x : x : x : x : x : x : x where x is a 16-bit
hexadecimal address separated by colon (:).
For example,
47CD : 1234 : 4422 : ACO2 : 0022 : 1234 : A456 : 0124

◻ IPv6 address with contiguous 0 bytes can be written compactly.


For example,
47CD : 0000 : 0000 : 0000 : 0000 : 0000 : A456 : 0124 → 47CD : : A456 : 0124

◻ IPv4 address is mapped to IPv6 address by prefixing the 32-bit IPv4 address with 2
bytes of 1s and then zero-extending the result to 128 bits.
For example,
128. 96.33.81 → : : FFFF : 128.96.33.81
This notation is called as CIDR notation or slash notation.

ADDRESS AGGREGATION OF IPV6


◻ IPv6 provides aggregation of routing information to reduce the burden on routers.
◻ Aggregation is done by assigning prefixes at continental level.
◻ For example, if all addresses in Europe have a common prefix, then routers in other
continents would need one routing table entry for all networks in Europe.

❖ Prefix - All addresses in the same continent have a common prefix


❖ RegistryID ― identifies the continent
❖ ProviderID ― identifies the provider for Internet access, i.e., ISP.
❖ SubscriberID ― specifies the subscriber identifier

❖ SubnetID ― contains subnet of the subscriber.


❖ InterfaceID ―contains link level or physical address.

PACKET FORMAT OF IPV6


35

◻ IPv6 base header is 40 bytes long.

❖ Version — specifies the IP version, i.e., 6.


❖ Traffic Class — defines priority of the packet with respect to traffic
congestion. It is either congestion-controlled or non-congestion controlled
❖ Flow Label — provides special handling for a particular flow of data. Router handles
different flows with the help of a flow table.
❖ Payload Len — gives length of the packet, excluding IPv6 header.
❖ Next Header — Options are specified as a header following IP header.
NextHeader contains a pointer to optional headers.
❖ Hop Limit — Gives the TTL value of a packet.
❖ Source Address / Destination Address — 16-byte addresses of source and
destination host

Extension Headers
◻ Extension header provides greater functionality to IPv6.
◻ Base header may be followed by six extension headers.
◻ Each extension header contains a NextHeader field to identify the header
following it.

❖ Hop-by-Hop — source host passes information to all routers visited by the


packet
❖ Destination — source host information is passed to the destination only.
❖ Source Routing — routing information provided by the source host.
❖ Fragmentation — In IPv6, only the source host can fragment. Source uses a path
MTU discovery technique to find smallest MTU on the path.
❖ Authentication — used to validate the sender and ensures data integrity.
❖ ESP (Encrypted Security Payload) — provides confidentiality against
eavesdropping.
36

ADVANCED CAPABILITIES OF IPV6


◻ Auto Configuration — Auto or stateless configuration of IP address to hosts without
the need for a DHCP server, i.e., plug and play.
◻ Advanced Routing — Enhanced routing support for mobile hosts is provided.
◻ Additional Functions ― Enhanced routing functionality with support for mobile
hosts.
◻ Security ― Encryption and authentication options provide confidentiality and
integrity.
◻ Resource allocation ― Flow label enables the source to request special
handling of real-time audio and video packets

ADVANTAGES OF IPV6
◻ Address space ― IPv6 uses 128-bit address whereas IPv4 uses 32-bit address. Hence
IPv6 has huge address space whereas IPv4 faces address shortage problem.
◻ Header format ― Unlike IPv4, optional headers are separated from base header in IPv6.
Each router thus need not process unwanted addition information.
◻ Extensible ― Unassigned IPv6 addresses can accommodate needs of future
technologies.

Dual-Stack Operation and Tunneling


◻ In dual-stack, nodes run both IPv6 and IPv4, uses Version field to decide which stack
should process an arriving packet.
◻ IPv6 packet is encapsulated with an IPv4 packet as it travels through an IPv4 network.
This is known as tunneling and packet contains tunnel endpoint as its destination
address.

Network Address Translation


◻ NAT enables hosts on a network to use Internet with local addresses.
◻ Addresses reserved for internal use range from 172.16.0.0 to 172.31.255.255
◻ Organization must have single connection to the Internet through a router that runs the
NAT software.

MOBILE IP
• Mobile IP is the extension of IP protocol.
• Mobile IP allows mobile computers to be connected to the Internet.

Addressing
• In Mobile IP, the main problem that must be solved is addressing.
Stationary Hosts
• The original IP addressing assumed that a host is stationary.
• A router uses an IP address to route an IP datagram.
• An IP address has two parts: a prefix and a suffix.
• The prefix associates a host with a network.
For example, the IP address 10.3.4.24/8 defines a host attached to the network 10.0.0.0/8.
• The address is valid only when the host is attached to the network.
• If the network changes, the address is no longer valid.Mobile Hosts
• When a host moves from one network to another, the IP addressing structure needs to be modified.
• The host has two addresses (Figure 19.12):
1) Home address &
37

2)Care-of address
1)
Home Address
➢ Original address of host called the home address.
➢ The home address is permanent.
➢ The home address associates the host with its home network.
➢ Home network is a network that is the permanent home of the host.
2) Care-of-Address
➢ The care-of address is temporary.
➢ The care-of address changes as the mobile-host moves from one network to another.
➢ Care-of address is associated with the foreign network.
➢ Foreign network is a network to which the host moves.
➢ When a mobile-host visits a foreign network, it receives its care-of address during the agent

R
discovery and registration phase.

YS
Agents
• Two agents are required to make change of address transparent to rest of the Internet (Fig 19.13):
1) Home-agent and
2) Foreign-agent.

SB
TE
O

1) Home Agent
• The home-agent is a router attached to the home network.
• The home-agent acts on behalf of mobile-host when a remote-host sends a packet to mobile-host.
N

• The home-agent receives and delivers packets sent by the remote-host to the foreign-agent.
2) Foreign Agent
• The foreign-agent is a router attached to the foreign network.
• The foreign-agent receives and delivers packets sent by the home-agent to the mobile-host.
U

• The mobile-host can also act as a foreign-agent i.e. mobile-host and foreign-agent can be the same.
• However, to do this, a mobile-host must be able to receive a care-of address by itself.
• In addition, the mobile-host needs the necessary software to allow it to communicate with the home-agent
VT

and to have two addresses: i) its home address and ii) its care-of address.
• This dual addressing must be transparent to the application programs.
Collocated Care-of-Address
➢ When the mobile-host and the foreign-agent are the same, the care-of-address is called a
collocated care-of-address.
➢ Advantage:
1) mobile-host can move to any network w/o worrying about availability of a foreign-agent.
➢ Disadvantage:
1) The mobile-host needs extra software to act as its own foreign-agent.
38

5.7.2 Three Phases


• To communicate with a remote-host, a mobile-host goes through 3 phases (Figure 19.14):
1) Agent Discovery: involves the mobile-host, the foreign-agent, and the home-agent.
2) Registration: involves the mobile-host, the foreign-agent, and the home-agent.
3) Data Transfer: Here, the remote-host is also involved.

R
YS
SB
TE

Agent Discovery
O

• Agent discovery consists of two subphases:


1) A mobile-host must discover (learn the address of) a home-agent before it leaves its home
network.
2) A mobile-host must also discover a foreign-agent after it has moved to a foreign network.
N

• This discovery consists of learning the care-of address as well as the foreign-agent‟s address.
• Two types of messages are used: i) advertisement and ii) solicitation.
U

1) Agent Advertisement
• When a router advertises its presence on a network using an ICMP router advertisement, it can
append an agent advertisement to the packet if it acts as an agent.
VT

38
39

• Various fields are (Figure 19.15):


1) Type
➢ This field is set to 16.
2) Length
➢ This field defines the total length of the extension message.
3) Sequence Number
➢ This field holds the message number.
➢ The recipient can use the sequence number to determine if a message is lost.
4) Lifetime
➢ This field defines the number of seconds that the agent will accept requests.
➢ If the value is a string of 1s, the lifetime is infinite.
5) Code

R
➢ This field is a flag in which each bit is set (1) or unset (0) (Table 19.1).

YS
SB
6) Care-of Addresses
TE
➢ This field contains a list of addresses available for use as care-of addresses.
➢ The mobile-host can choose one of these addresses.
➢ The selection of this care-of address is announced in the registration request.

2) Agent Solicitation
• When a mobile-host has moved to a new network and has not received agent advertisements, it caninitiate
O

an agent solicitation.
• It can use the ICMP solicitation message to inform an agent that it needs assistance
N

Registration
• After a mobile-host has moved to a foreign network and discovered the foreign-agent, it must
register.
U

• Four aspects of registration:


• The mobile-host must register itself with the foreign-agent.
• The mobile-host must register itself with its home-agent. This is normally done by
VT

theforeign-agent on behalf of the mobile-host.


• The mobile-host must renew registration if it has expired.
• The mobile-host must cancel its registration (deregistration) when it returns home.

Request & Reply


• To register with the foreign-agent and the home-agent, the mobile-host uses a registration requestand a
registration reply.
1) Registration Request
• A registration request is sent from the mobile-host to the foreign-agent
to register its care-of address and

39
40

to announce its home address and home-agent address.


• Foreign-agent, after receiving and registering the request, relays the message to the home-agent.
• The home-agent now knows the address of the foreign-agent because the IP packet that is used for
relaying has the IP address of the foreign-agent as the source address.

R
• Various fields are (Figure 19.16):
1) Type

YS
➢ This field defines the type of message.
➢ For a request message the value of this field is 1.
2) Flag
➢ This field defines forwarding information.
➢ The value of each bit can be set or unset (Table 19.2).

3) Lifetime
SB
➢ This field defines the number of seconds the registration is valid.
i) If the field is a string of 0s, the request message is asking for deregistration.
ii) This field If the field is a string of 1s, the lifetime is infinite.
4) Home Address
➢ This field contains the permanent (first) address of the mobile-host.
TE
5) Home Agent Address
➢ This field contains the address of the home-agent.

6) Care-of-Address
➢ This field is the temporary (second) address of the mobile-host.
7) Identification
O

➢ This field contains a 64-bit number that is inserted into the request by the mobile-host.
➢ This field matches a request with a reply.
8) Extensions
➢ This field is used for authentication.
N

➢ This field allows a home-agent to authenticate the mobile agent.

2) Registration Reply
U

• A registration reply is sent from home-agent to foreign-agent and then relayed to the mobile-host.
• The reply confirms or denies the registration request. (Figure 19.17)
• The fields are similar to registration request with the 3 exceptions:
VT

1) The value of the type field is 3.


2) The code field replaces the flag field and shows the result of the registration request
(acceptance or denial).
3) The care-of address field is not needed.

40
41

R
5.7.2.2 Data Transfer
• After agent discovery & registration, a mobile-host can communicate with a remote-host (Fig 19.17).

YS
SB
TE
O

• Here we have 4 cases (Figure 19.18):


1) From Remote Host to Home Agent
• When a remote-host wants to send a packet to the mobile-host, the remote-host uses
N

→ address of itself as the source address and


→ home address of the mobile-host as the destination address.
• In other words, the remote-host sends a packet as though the mobile-host is at its home network.
U

• The packet is intercepted by the home-agent, which pretends it is the mobile-host.


• This is done using the proxy ARP technique (Path 1 of Figure 19.18).
2) From Home Agent to Foreign Agent
• After receiving the packet, the home-agent sends the packet to the foreign-agent, using thetunneling
VT

concept.
• The home-agent encapsulates the whole IP packet inside another IP packet using its address as thesource
and the foreign-agent‟s address as the destination. (Path 2 of Figure 19.18).
3) From Foreign Agent to Mobile Host
• When the foreign-agent receives the packet, it removes the original packet.
• However, since the destination address is the home address of the mobile-host, the foreign-agent consults a
registry table to find the care-of address of the mobile-host. (Otherwise, the would just be sent back to the
home network.)
• The packet is then sent to the care-of address (Path 3 of Figure 19.18).
4) From Mobile Host to Remote Host

41
42

• When a mobile-host wants to send a packet to a remote-host (for example, a response to the packetit has
received), it sends as it does normally.
• The mobile-host prepares a packet with its home address as the source, and the address of the
remote-host as the destination.
• Although the packet comes from the foreign network, it has the home address of the mobile-host(Path
4 of Figure 19.18).

Inefficiency in Mobile IP
Triangle Routing
• Triangle routing occurs when the remote-host communicates with a mobile-host that is not attachedto the

R
same network (or site) as the mobile-host.
• When the mobile-host sends a packet to the remote-host, there is no inefficiency.

YS
• However, when the remote-host sends a packet to the mobile-host, the packet goes from the
remote-host to the home-agent and then to the mobile-host.
• The packet travels the two sides of a triangle, instead of just one side (Figure 19.20).

SB
TE

Solution
• One solution to inefficiency is for the remote-host to bind the care-of address to the home address ofa mobile-
O

host.
• For example, when a home-agent receives the first packet for a mobile-host, it forwards the packetto the
foreign-agent; it could also send an update binding packet to the remote-host so that future packets to this host
N

could be sent to the care-of address.


• The remote-host can keep this information in a cache.
• The problem with this strategy is that the cache entry becomes outdated once the mobile-host moves.
U

• In this case, the home-agent needs to send a warning packet to the remote-host to inform it of the change.
VT

5.3 TRANSITION FROM IPv4 TO IPv6


5.11.1 Strategies
• Three strategies have been devised for transition:
1) Dual stack
2) Tunneling and
3) Header translation.
1) Dual Stack
• Recommended: All hosts must run IPv4 and IPv6 (dual stack) simultaneously until all the Internet
uses IPv6 (Figure 22.11).

42
43

• To determine which version to use, the source queries the DNS.


i) If the DNS returns an IPv4 address, the source sends an IPv4 packet.
ii) If the DNS returns an IPv6 address, the source sends an IPv6 packet.

R
2) Tunneling
• Tunneling is a strategy used when
→ two computers using IPv6 want to communicate with each other and
→ the packet must pass through an IPv4 network.

YS
• To pass through IPv4 network, the packet must have an IPv4 address (Figure 22.12).
• So,
i) IPv6 packet is encapsulated in an IPv4 packet when the packet enters the IPv4 network.
ii) IPv6 packet is decapsulated from an IPv4 packet when the packet exits the IPv4 network.

SB
TE
3) Header Translation
• Header translation is necessary when the majority of the Internet has moved to IPv6 but some
systems still use IPv4 (Figure 22.13).
• The sender wants to use IPv6, but the receiver does not understand IPv6.
O

• Tunneling does not work in this situation because


→ the packet must be in the IPv4 format to be understood by the receiver.
• In this case, the header format must be totally changed through header translation.
• The header of the IPv6 packet is converted to an IPv4 header/
N
U
VT

43

You might also like