0% found this document useful (0 votes)
69 views49 pages

EC3401 NS Unit - 2

The document covers the Network Layer protocols, focusing on IPv4 and IPv6 addressing, packetizing, routing, and forwarding processes. It discusses various services provided by the network layer, including error control, flow control, and congestion control, as well as design issues and methods like subnetting and supernetting. Additionally, it explains special addresses and the Internet Protocol (IP), emphasizing its role in data transmission across networks.

Uploaded by

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

EC3401 NS Unit - 2

The document covers the Network Layer protocols, focusing on IPv4 and IPv6 addressing, packetizing, routing, and forwarding processes. It discusses various services provided by the network layer, including error control, flow control, and congestion control, as well as design issues and methods like subnetting and supernetting. Additionally, it explains special addresses and the Internet Protocol (IP), emphasizing its role in data transmission across networks.

Uploaded by

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

SURYA GROUP OF INSTITUTIONS

SCHOOL OF ENGINEERING & TECHNOLOGY


Vikravandi – Villupuram

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 Protocols – IPv6 Addresses – IPv6 –
Datagram Format - Transition from IPv4 to IPv6.

Network Layer Services


 The main aim of this layer is to deliver packets from source to destination across multiple links
(networks).
 If two computers (system) are connected on the same link, then there is no need for a network layer.
It routes the signal through different channels to the other end and acts as a network controller.
 It also divides the outgoing messages into packets and to assemble incoming packets into messages
for higher levels.
 Some of the network layer services are,
Packetizing
 It is a process of encapsulating the payload in a network-layer packet at the source and decapsulating
the payload from the network-layer packet at the destination.
 The source host receives the payload from an upper-layer protocol, adds a header that contains the
source and destination addresses and some other information that is required by the network-layer
protocol and delivers the packet to the data-link layer.
 The source is not allowed to change the content of the payload unless it is too large for delivery and
needs to be fragmented.
 The destination host receives the network-layer packet from its data-link layer, decapsulates the
packet, and delivers the payload to the corresponding upper-layer protocol.
 If the packet is fragmented at the source or at routers along the path, the network layer is responsible
for waiting until all fragments arrive, reassembling them, and delivering them to the upper-layer
protocol.
 The routers in the path are not allowed to decapsulate the packets they received unless the packets
need to be fragmented.
 The routers are not allowed to change source and destination addresses either.
Routing and Forwarding
Routing
 The network layer is responsible for routing the packet from its source to the destination.
 A physical network is a combination of networks (LANs and WANs) and routers that connect them.
 This means that there is more than one route from the 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.
1
Forwarding
 Forwarding consists of taking a packet, looking at its destination address, consulting a table, and
sending the packet in a direction determined by that table.
 It is a relatively simple and well-defined process performed locally at a node.
 A forwarding table contains mapping between network number and an outgoing interface as well as
physical address of the next hop.
 The forwarding table is used when a packet is being forwarded and so must contain enough
information to accomplish the task.
 When a router receives a packet from one of its attached networks, it needs to forward the packet to
another attached network (in unicast routing) or to some attached networks (in multicast routing).
Other Services
 The other services expected from the network layer.
Error Control
 The mechanism of error control is to detect and retransmit damaged or lost frames.
(Or)
 Error control is the process of detecting and correcting both the bit level and packet level errors.
Flow Control
 Flow control regulates the amount of data a source can send without overwhelming the receiver.
 If the upper layer at the source computer produces data faster than the upper layer at the destination
computer can consume it, the receiver will be overwhelmed with data.
 To control the flow of data, the receiver needs to send some feedback to the sender to inform the
latter that it is overwhelmed with data.
Congestion Control
 Congestion in the network layer is a situation in which too many datagram’s are present in an area of
the Internet.
 Congestion may occur if the number of datagram’s sent by source computers is beyond the capacity
of the network or routers.
Functions of Network Layer
 Addressing: It translates logical network address into physical address. Concerned with circuit,
message or packet switching.
 Routing: Routers and gateways operate in the network layer. Mechanism is provided by Network
Layer for routing the packets to final destination.
 Connection services are provided including network layer flow control, network layer error control
and packet sequence control.
 Packetizing: Breaks larger packets into small packets.
Design Issues with Network Layer
 A key design issue is determining how packets are routed from source to destination.
 Routes can be based on static tables that are wired into the network and rarely changed.

2
 They can also be highly dynamic, being determined anew for each packet, to reflect the current
network load.
 If too many packets are present in the subnet at the same time, they will get into one another's way,
forming bottlenecks. The control of such congestion also belongs to the network layer.
 Moreover, the quality of service provided (delay, transmit time, jitter, etc) is also a network layer
issue.
 When a packet has to travel from one network to another to get to its destination, many problems
can arise such as:
o The addressing used by the second network may be different from the first one.
o The second one may not accept the packet at all because it is too large.
o The protocols may differ, and so on.
 It is up to the network layer to overcome all these problems to allow heterogeneous networks to be
interconnected.
Packet Switching
 Packet switching is a method for sending data whereby the data is divided in packets.
 Each packet is given a header containing information of the destination.
 Each packet is forwarded through the network to the destination using this information.
 At the destination the data has to be reassembled from the received packages.
 There are two common packet switching methods in use:
 Datagram Approach: Connectionless Service
o Each packet is forwarded independently based on the destination address.
o Routing decisions are made dynamically, so each packet may follow a different route and
thus the packages may arrive out of order.

Figure: A connectionless packet-switched network


 Virtual-Circuit Approach: Connection-Oriented Service
o A route is set up prior to packets being sent.
o The packets will all follow this route.
o This makes the routing through the network very easy and the packages will be received in
the correct order.

3
Figure: A virtual-circuit packet-switched network

****************************************************************************
IPV4 Address
 The identifier used in the IP layer of the TCP/IP protocol suite to identify the connection of each
device to the Internet is called the Internet address or IP address.
 An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a host or
a router to the Internet.
 The IP address is the address of the connection, not the host or the router, because if the device is
moved to another network, the IP address may be changed.
 An address space is the total number of addresses used by the protocol.
Hierarchy in Addressing
 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; the second part of the address,
called the suffix, defines the node (connection of a device to the Internet).
 Figure below shows the prefix and suffix of a 32-bit IPv4 address.
 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, which is now obsolete, is referred to as classfull addressing.
 The new scheme, which is referred to as classless addressing, uses a variable-length network prefix.

4
Classfull Addressing
 An IPv4 address was designed with a fixed-length prefix, but to accommodate both small and large
networks, three fixed-length prefixes were designed instead of one (n = 8, n = 16, and n = 24).
 The whole address space was divided into five classes (class A, B, C, D, and E), as shown in the
Figure.
 This scheme is referred to as classfull addressing.

Figure: Address Space in Classfull Addressing


Subnetting and Supernetting
Subnetting
 Subnetting is the technique of partitioning a large network into smaller networks.
 It is a technique of partitioning an individual physical network into several small-sized logical sub-
networks.
 These subnetworks are known as subnets.
 An IP address is made up of the combination of the network segment and a host segment.
 A subnet is constructed by accepting the bits from the IP address host portion which are then used to
assign a number of small-sized sub-networks in the original network.
 The Subnetting basically converts the host bits into the network bits.

Advantages of Subnetting
 Minimizes the network traffic through decreasing the volume of broadcasts.
 Increases addressing flexibility.

 Increases the number of allowed hosts in local area network.

5
Disadvantages of Subnetting
 However, it is quite expensive.
 It requires trained administrator to perform subnetting.
Supernetting
 Supernetting is the method used for combining the smaller ranges of addresses into larger space.
 It was devised to make the routing process more convenient.
 Additionally, it reduces the size of routing table information so that it could consume less space in
the router’s memory.
 It is inverse process of subnetting, in which several networks are merged into a single network.
 While performing supernetting, the mask bits are moved toward the left of the default mask.
 The supernetting is also known as router summarization and aggregation.
 It results in the creation of more host addresses at the expense of network addresses, where basically
the network bits are converted into host bits.
 The supernetting is performed by internet service provider rather than the normal users, to achieve
the most efficient IP address allocation.
 CIDR (Classless Inter-Domain Routing) is scheme used to route the network traffic across the
internet.
 CIDR is a supernetting technique where the several subnets are combined together for the network
routing.
 In simpler words, CIDR allows the IP addresses to be organized in the subnetworks independent of
the value of the addresses.

Advantages of Supernetting
 The size of the router memory table is minimized.
 It also increases the speed of routing table lookup.

 Provision for the router to isolate the topology changes from the other routers.

 It also reduces the network traffic.


Disadvantages of Supernetting
 The whole network should exist in the same class.
 When merged, it lacks covering different areas.
6
Classless Addressing
 Subnetting and supernetting in classfull addressing did not really solve the address depletion
problem.
 In classless addressing, variable-length blocks are used that belong to no classes.
 We can have a block of 1 address, 2 addresses, 4 addresses, 128 addresses, and so on.
 In classless addressing, the whole address space is divided into variable length blocks.
 The prefix in an address defines the block (network); the suffix defines the node (device).

Prefix Length: Slash Notation


 The notation is informally referred to as slash notation and formally as classless interdomain
routing or CIDR strategy.

Figure: Slash Notation (CIDR)


Address Mask
 To find the first and last addresses in the block is to use the address mask.
 The address mask is a 32-bit number in which the n leftmost bits are set to 1s and the rest of the bits
(32 - n) are set to 0s.
 A computer can easily find the address mask because it is the complement of (232-n - 1).
 The reason for defining a mask in this way is that it can be used by a computer program to extract the
information in a block, using the three bit-wise operations NOT, AND, and OR.
Network Address
 The first address, the network address, is particularly important because it is used in routing a
packet to its destination network.

Figure: Network Address


Block Allocation

7
 The next issue in classless addressing is block allocation.
 The ultimate responsibility of block allocation is given to a global authority called the Internet
Corporation for Assigned Names and Numbers (ICANN).
 It assigns a large block of addresses to an ISP (or a larger organization that is considered an ISP in
this case).
 For the proper operation of the CIDR, two restrictions need to be applied to the allocated block.
o The number of requested addresses, N, needs to be a power of 2. The reason is that N = 232 - n
or n = 32 - log2N. If N is not a power of 2, we cannot have an integer value for n.
o The requested block needs to be allocated where there are an adequate number of contiguous
addresses available in the address space. However, there is a restriction on choosing the first
address in the block. The first address needs to be divisible by the number of addresses in the
block. The reason is that the first address needs to be the prefix followed by (32 − n) number
of 0s. The decimal value of the first address is then,
first address = (prefix in decimal) x 232 - n = (prefix in decimal) x N.

Address Aggregation
 One of the advantages of the CIDR strategy is address aggregation (sometimes called address
summarization or route summarization).
 When blocks of addresses are combined to create a larger block, routing can be done based on the
prefix of the larger block.
 ICANN assigns a large block of addresses to an ISP.
 Each ISP in turn divides its assigned block into smaller subblocks and grants the subblocks to its
customers.

Special Addresses
 The five special addresses that are used for special purposes: this-host address, limited-broadcast
address, loopback address, private addresses, and multicast addresses.
This-host Address
 The only address in the block 0.0.0.0/32 is called the this-host address.
 It is used whenever a host needs to send an IP datagram but it does not know its own address to use
as the source address.
Limited-broadcast Address
8
 The only address in the block 255.255.255.255/32 is called the limited-broadcast address.
 It is used whenever a router or a host needs to send a datagram to all devices in a network.
Loopback Address
 The block 127.0.0.0/8 is called the loopback address.
 A packet with one of the addresses in this block as the destination address never leaves the host; it
will remain in the host.
Private Addresses
 Four blocks are assigned as private addresses: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and
169.254.0.0/16.
Multicast Addresses
 The block 224.0.0.0/4 is reserved for multicast addresses.

********************************************************************************

Network Layer Protocols ( IP, ICMP, Mobile IP)


Internet Protocol (IP)
 The Internet Protocol (IP) is the method or protocol to send data from one computer to another on
the Internet.
 It is used to build scalable, heterogeneous internetworks.
 It is an unreliable and connectionless datagram protocol.
 IP provides best-effort delivery of datagram (connectionless) packets between two hosts.
o IP tries but doesn’t guarantee that packets will arrive (best effort)
o Packets can be lost or duplicated (unreliable)
o Ordering of datagram is not guaranteed (connectionless)
 IP Service model has two parts. They are,
o Datagram (connectionless) model of data delivery
o Addressing scheme to identify all hosts uniquely in the internetwork.

9
Figure: A simple internetwork where H represents hosts and R represents routers
Datagram Delivery
 Best-effort, connectionless service is used by IP to deliver a datagram
 Packets can be lost or corrupted. It can also be delivered out of order.
 IP provides neither error control nor flow control. It is an unreliable service.
Datagram Format
 Packets used by the IP are called datagrams.
 A datagram is a variable-length packet consisting of two parts: header and payload (data).
 The header is 20 to 60 bytes in length and contains information essential to routing and delivery.
 Minimum packet length is 20 bytes and maximum 65,535 bytes.

 Version― It specifies the current version of IP. (IPv4 Or IPv6)


 HLen (Header Length) ― Specifies the total length of the header in 4-byte words.
 Service Type (TOS - Type of Service) ― It defines how the datagram should be handled.
 Length― Specifies length of a packet including header.
10
 Ident (Identifier) ― a 16-bit identifier that uniquely identifies a datagram packet.
 Flags ― 3-bit field contains D (do not fragment) bit and M (more fragment) bit.
 Offset―shows relative position of the fragment in units of 8 bytes.
 TTL (Time to Live) ―defines lifetime of the datagram (default 64 hops).
 Protocol ― specifies upper layer protocol (e.g., 6 for TCP, 17 for UDP).
 Checksum ― 16-bit internet checksum for the packet header.
 Source Address / Destination Address ― 32-bit IP address to find source and destination host.
IP Fragmentation and Reassembly
 IP fragmentation is an internet protocol process that breaks datagram into smaller pieces (fragments),
so that packets may be formed that can pass through a link with a smaller maximum transfer unit
(MTU) than the original datagram size.
 Then the fragments are reassembled by the receiving host.
 The value of the MTU differs from one physical network protocol to another.
o For example, Ethernet (1500 bytes), FDDI (4500 bytes)

Figure: Maximum Transfer Unit (MTU)


 Strategy
o Fragmentation occurs in a router when it receives a datagram that it wants to forward over a
network which has (MTU < datagram).
o Reassembly is done at the receiving host
o All the fragments carry the same identifier in the Ident field
o Fragments are self-contained datagram’s
o IP does not recover from missing fragments

Figure: Fragmentation and Reassembly


Fields Related to Fragmentation

11
 There are three fields in an IP datagram are related to fragmentation: identification, flags, and
fragmentation offset.
 The 16-bit identification field identifies a datagram originating from the source host.
 The 3-bit flags field defines three flags.
o The leftmost bit is reserved (not used).
o The second bit (D bit) is called the do not fragment bit.
 If its value is 1, the machine must not fragment the datagram.
 If its value is 0, the datagram can be fragmented if necessary.
o The third bit (M bit) is called the more fragment bit.
 If its value is 1, it means the datagram is not the last fragment; there are more
fragments after this one.
 If its value is 0, it means this is the last or only fragment.
 The 13-bit fragmentation offset field shows the relative position of this fragment with respect to the
whole datagram.

********************************************************************

Internet Control Message Protocol (ICMP) – ICMPv4


 ICMP stands for Internet Control Message Protocol (ICMP).
 It is a supporting protocol in the Internet protocol suite.
 It is used to report error messages to source host and diagnose network problems.
 ICMP message is encapsulated within an IP packet.
 ICMP messages are not passed directly to the data-link layer.
 Instead, the messages are first encapsulated inside IP datagram’s before going to the lower layer.
 When an IP datagram encapsulates an ICMP message, the value of the protocol field in the IP
datagram is set to 1 to indicate that the IP payroll is an ICMP message.
 It also provides the basis for two widely used debugging tools, ping and traceroute.
o ping uses ICMP echo messages to determine if a node is reachable and alive.
o traceroute uses a slightly non-intuitive technique to determine the set of routers along the path
to a destination.
ICMP Encapsulation

12
ICMP Messages
 ICMP messages are divided into two broad categories: error-reporting messages 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, which occur in pairs, help a host or a network manager get specific information
from a router or another host.

Figure: General Format of ICMP Messages


 Type - defines the type of the message.
 Code - specifies the reason for the particular message type.
 Checksum – Common field used to detect errors in the message.
 The rest of the header is specific for each message type.
 The data section in error messages carries information for finding the original packet that had the
error.
 In query messages, the data section carries extra information based on the type of query.
Error Reporting Messages
 It is used to report problems that a router or a host (destination) may encounter when it processes an
IP packet.

 Destination Unreachable―When a router cannot route a datagram, the datagram is discarded and
sends a destination unreachable message to source host.

13
 Destination-unreachable messages include four basic types: They are,
o Network Unreachable
o Host Unreachable
o Protocol Unreachable
o Port Unreachable
Network-Unreachable
 It indicates that the router cannot find the destination network (does not exist or has failed) or
has no route to this network.
Host-Unreachable
 It alerts the sending host that the destination host requested cannot be found.
Protocol-Unreachable
 It indicates that the Transport layer protocol (UDP or TCP) is not available.
Port-Unreachable
 It indicates that the process or application in the source host is attempting to establish a
connection which is not active on the destination host.
 Source Quench ― It informs the sender that the network has encountered congestion and the
datagram has been dropped; the source needs to slow down sending more datagrams.
 Time Exceeded ― Router discards a datagram when TTL field becomes 0 and a time 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 problem message to source.
 Redirection ― is used when the source uses a wrong router to send out its message. The router
redirects the message to the appropriate router, but informs the source that it needs to change its
default router in the future. The IP address of the default router is sent in the message.
Query Messages
 Query messages are used to diagnose some network problems.

 Echo Request & Reply ― The echo request (type 8) and the echo reply (type 0) pair of messages is
used by a host or a router to test the liveliness of another host or router.
 Timestamp Request & Reply ― The timestamp request (type 13) and the timestamp reply (type 14)
pair of messages is used to find the round-trip time between two devices or to check whether the
clocks in two devices are synchronized.
 Address Mask Request & Reply

14
o If the host knows the address of the router; it sends the request directly to the router.
o If it does not know, it broadcasts the message.
o The router receiving the address mask request message responds with an address mask reply
message, providing the necessary mask for the host.
 Router Advertisement & Solicitation
o A host that wants to send data to a host on another network needs to know the address of
routers connected to its own network.
o A host broadcasts a router solicitation message to know about the router.
o Router broadcasts its routing information with router advertisement message.
********************************************************************
Mobile IP
 Mobile IP (or MIP) is an Internet Engineering Task Force (IETF) standard communications protocol
that is designed to allow mobile device users to move from one network to another while maintaining
a permanent IP address.
Stationary Hosts
 A host in the Internet does not have an address that it can carry with itself from one place to another.
 The address is valid only when the host is attached to the network.
 If the network changes, the address is no longer valid.
 This scheme works perfectly with stationary hosts.
“The IP addresses are designed to work with stationary hosts because part of the address defines the
network to which the host is attached.”
Mobile Hosts
 When a host moves from one network to another, the IP addressing structure needs to be modified.
Changing the Address
 One simple solution is to let the mobile host change its address as it goes to the new network.
 The host can use DHCP to obtain a new address to associate it with the new network.
Two Addresses
 Mobile IP has two addresses for a mobile host: one home address and one care-of address.
 The home address is permanent;
 The care-of address changes as the mobile host moves from one network to another.

Figure: Home Address and Care-of Address


Agents
15
 To make the change of address transparent to the rest of the Internet requires a home agent and a
foreign agent.
 Figure below shows the position of a home agent relative to the home network and a foreign agent
relative to the foreign network.

Figure: Home Agent and Foreign Agent


Home Agent
 The home agent is usually a router attached to the home network of the mobile host.
 The home agent acts on behalf of the mobile host when a remote host sends a packet to the mobile
host.
 The home agent receives the packet and sends it to the foreign agent.

Foreign Agent
 The foreign agent is usually a router attached to the foreign network.
 The foreign agent receives and delivers packets sent by the home agent to the mobile host.
 The mobile host can also act as a foreign agent. In other words, the mobile host and the foreign agent
can be the same.
 However, to do this, a mobile host must be able to receive a care-of address by itself, which can be
done through the use of DHCP.
 When the mobile host acts as a foreign agent, the care-of address is called a 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.
Three Phases
 To communicate with a remote host, a mobile host goes through three phases: agent discovery,
registration, and data transfer.

16
Figure: Remote Host and Mobile Host Communication

 The first phase, agent discovery, involves the mobile host, the foreign agent, and the home agent.
 The second phase, registration, also involves the mobile host and the two agents.
 Finally, in the third phase, the remote host is also involved.
Agent Discovery
 The first phase in mobile communication, agent discovery, consists of two subphases.
 A mobile host must discover (learn the address of) a home agent before it leaves its home network.
 A mobile host must also discover a foreign agent after it has moved to a foreign network.
 This discovery consists of learning the care-of address as well as the foreign agent’s address.
 The discovery involves two types of messages: advertisement and solicitation.
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.

Figure: Agent Advertisement


 The field descriptions are as follows:
o Type - The 8-bit type field is set to 16.
o Length - The 8-bit length field defines the total length of the extension message (not the
length of the ICMP advertisement message).

17
o Sequence number - The 16-bit sequence number field holds the message number. The
recipient can use the sequence number to determine if a message is lost.
o Lifetime - The lifetime field defines the number of seconds that the agent will accept
requests. If the value is a string of 1s, the lifetime is infinite.
o Code - The code field is an 8-bit flag in which each bit is set (1) or unset (0).
o Care-of Addresses - 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. Note that this field is
used only by a foreign agent.
Agent Solicitation
 When a mobile host has moved to a new network and has not received agent advertisements, it can
initiate an agent solicitation.
 It can use the ICMP solicitation message to inform an agent that it needs assistance.
 Mobile IP does not use a new packet type for agent solicitation; it uses the router solicitation packet
of ICMP.
Registration
 The second phase in mobile communication is registration.
 After a mobile host has moved to a foreign network and discovered the foreign agent, it must
register.
 There are four aspects of registration:
o The mobile host must register itself with the foreign agent.
o The mobile host must register itself with its home agent. This is normally done by the foreign
agent on behalf of the mobile host.
o The mobile host must renew registration if it has expired.
o The mobile host must cancel its registration (deregistration) when it returns home.
Request and Reply
 To register with the foreign agent and the home agent, the mobile host uses a registration request
and a registration reply as shown in the above Figure.
Registration Request
 A registration request is sent from the mobile host to the foreign agent to register its care-of address
and also to announce its home address and home agent address.
 The foreign agent, after receiving and registering the request, relays the message to the home agent.
 Note that 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.

18
Figure: Registration Request Format
 The field descriptions are as follows:
o Type - The 8-bit type field defines the type of message. For a request message the value of
this field is 1.
o Flag - The 8-bit flag field defines forwarding information. The value of each bit can be set or
unset.
o Lifetime - This field defines the number of seconds the registration is valid. If the field is a
string of 0s, the request message is asking for deregistration. If the field is a string of 1s, the
lifetime is infinite.
o Home Address - This field contains the permanent (first) address of the mobile host.
o Home Agent Address - This field contains the address of the home agent.
o Care-of Address - This field is the temporary (second) address of the mobile host.
o Identification - This field contains a 64-bit number that is inserted into the request by the
mobile host and repeated in the reply message. It matches a request with a reply.
o Extensions - Variable length extensions are used for authentication. They allow a home agent
to authenticate the mobile agent.
Registration Reply
 A registration reply is sent from the home agent to the foreign agent and then relayed to the mobile
host. The reply confirms or denies the registration request.
 Figure below shows the format of the registration reply.
 The fields are similar to those of the registration request with the following exceptions.
 The value of the type field is 3.
 The code field replaces the flag field and shows the result of the registration request (acceptance or
denial).
 The care-of address field is not needed.

Figure: Registration Reply Format


“A registration request or reply is sent by UDP using the well-known port 434.”
Encapsulation

19
 Registration messages are encapsulated in a UDP user datagram. An agent uses the well-known port
434; a mobile host uses an ephemeral port.
Data Transfer
 After agent discovery and registration, a mobile host can communicate with a remote host.
From Remote Host to Home Agent
 When a remote host wants to send a packet to the mobile host, it uses its address as the source
address and the 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.
 The packet, however, is intercepted by the home agent, which pretends it is the mobile host.
 This is done using the proxy ARP technique.
 Path 1 of the Figure shows this step.
From Home Agent to Foreign Agent
 After receiving the packet, the home agent sends the packet to the foreign agent, using the tunneling
concept.
 The home agent encapsulates the whole IP packet inside another IP packet using its address as the
source and the foreign agent’s address as the destination. Path 2 of the Figure shows this step.
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 packet would
just be sent back to the home network.)
 The packet is then sent to the care-of address. Path 3 of the Figure shows this step.

From Mobile Host to Remote Host


 When a mobile host wants to send a packet to a remote host (for example, a response to the packet it
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 the Figure shows this step.
Transparency
 In this data transfer process, the remote host is unaware of any movement by the mobile host.
 The remote host sends packets using the home address of the mobile host as the destination address;
it receives packets that have the home address of the mobile host as the source address.
 The movement is totally transparent.
 The rest of the Internet is not aware of the movement of the mobile host.
***********************************************************************************

Routing

20
 It is a process of forwarding packets by finding the shortest path (Minimum Number of Hops) from
the source node to destination node in the network.
Forwarding and Routing
Forwarding
 Forwarding consists of taking a packet, looking at its destination address, consulting a table, and
sending the packet in a direction determined by that table.
 It is a relatively simple and well-defined process performed locally at a node.
 A forwarding table contains mapping between network number and an outgoing interface as well as
physical address of the next hop.
 The forwarding table is used when a packet is being forwarded and so must contain enough
information to accomplish the task.
Routing
 Routing is the process by which the forwarding tables are built.
 It depends on complex distributed algorithms that have continued to evolve.
 A routing table contains mapping between network number and logical address of next hop.
 It is built by the routing algorithm as an ancestor to the forwarding table.
There are reasons for implementing these tables as separate data structures:
 The forwarding table needs to be structured to optimize the process of looking up an address when
forwarding a packet.
 The routing table needs to be optimized for the purpose of calculating changes in topology.
 The forwarding table may even be implemented in specialized hardware.

Figure: (a) Routing and (b) Forwarding Table

Network as a Graph
 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 that make up the path.

Properties of Routing
 Some of the desirable properties of routing are,

21
o Correctness
o Simplicity
o Robustness
o Stability
o Optimality & Efficiency
Types of Routing
Static Routing (Non-Adaptive Routing)
 It manually sets up the optimal paths between the source and destination node.
 It is suitable for very small networks.
Dynamic Routing (Adaptive Routing)
 It uses dynamic protocols to update the routing table and to find the optimal path between the source
and destination node.
 It is used for larger networks.
 Some of the dynamic routing protocols are,
Intra-domain Routing
 Routing the information within an autonomous system is called as intra-domain routing.
 ie., collection of routers are under a single administrative control.
 It is also called Interior Gateway Protocol (IGP).
 Some of the Intra-domain routing protocols are,
o Distance Vector Routing – Eg: RIP
o Link State Routing – Eg: OSPF
Inter-domain Routing
 Routing the information between the autonomous systems is called as inter-domain routing.
 It is also called Exterior Gateway Protocol (EGP).
 Some of the Inter-domain routing protocols are,
o Path Vector Routing – Eg: BGP

Figure: Routing Protocols


----------------------------------------------------------------------------------------------------
Unicast Routing Algorithms

22
 In unicast routing, a packet is routed, hop by hop, from its source to its destination by the help of
forwarding tables.
 The source host needs no forwarding table because it delivers its packet to the default router in its
local network.
 The destination host needs no forwarding table either because it receives the packet from its default
router in its local network.
Distance Vector Routing
 Distance vector routing is a distributed routing algorithm that runs on all nodes.
 It is a dynamic routing algorithm based on Bellman – Ford algorithm.
 It has knowledge about only its immediate neighbor node in the network.
 Each node constructs a one dimensional array (a vector) containing the “distances” (costs) to all other
nodes and distributes that vector to its immediate neighbors.
 Starting assumption is that each node knows the cost of the link to each of its directly connected
neighbors.
 Every T seconds each router sends its table to its neighbor each router then updates its table based on
the new information.

Network as a Graph

Figure: Distance Vector Routing: An Example Network

Table: Initial Distances Stored at Each Node (Global View)


Initial Routing Table at Node A
 Initially, each node sets a cost of 1 to its directly connected neighbors and ∞ to all other nodes.

23
 The next step in distance-vector routing is that every node sends a message to its directly connected
neighbors containing its personal list of distances.

Final Routing Table at Node A


 In the absence of any topology changes, it takes only a few exchanges of information between
neighbors before each node has a complete routing table.
 The process of getting consistent routing information to all the nodes is called convergence.

Final distances stored at each node (Global View)

Other Distance Vector Issues


 When does a given node send a routing update to its neighbors?
o There are two different circumstances under which a given node decides to send a routing
update to its neighbors.
o Periodic Update

24
 Each node automatically sends an update message every so often, even if nothing has
changed. This serves to let the other nodes know that this node is still running.
o Triggered Update
 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 routing table.
 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 to their
neighbors.
 What happens when a link or node fails?
o The nodes, that notice the failure, send a new list of distances to their neighbors and tables
are updated.
 How does a node detect a failure?
o Nodes test links by sending control packets and wait for an acknowledgement.
o Nodes determine a link is down when it does not receive a periodic update.
Count to Infinity Problem (Loop Instability Problem)
 The Bellman–Ford algorithm does not prevent routing loops from happening and suffers from the
count to infinity problem.
 The core of the count to infinity problem is that if A tells B that it has a path somewhere, there is no
way for B to know if the path has B as a part of it.
 Sometimes the network does not stabilize.
 Each node advertises an unreachable link and the hop count increases on each router table in a cycle.
 Partial solution is to use some relatively small number as an approximation to infinity.
 One technique to improve the time to stabilize routing is called split horizon.
 The idea is that when a node sends a routing update to its neighbors, it does not send those routes it
learned from each neighbor back to that neighbor.
---------------------------------------------------------------------------------------------------------------
Routing Information Protocol (RIP)
 It is one of the more widely used routing protocols in IP networks.
 It is an intra-domain routing protocol based on distance-vector algorithm.
 RIP (Routing Information Protocol) dynamically builds a routing table using the distance vector
routing algorithm.
 The idea behind the distance vector algorithm is that each node constructs a one dimensional array
(vector) containing the distances (costs) to all other nodes and distributes that vector to its immediate
neighbors.
 Each node knows the cost of its directly connected neighbors.
 A link that is down is assigned an infinite cost.

25
Figure: Example Network running RIP
 In an internetwork, the goal of the routers is to learn how to forward packets to various networks.
 Instead of advertising the cost of reaching other routers, the routers advertise the cost of reaching
networks.
 The cost for reaching each link is 1 hop.
 For example, router C advertises to A that it can reach network 2, 3 at cost 0 (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.
 RIP prevents routing loops by implementing limit on the number of hops allowed in a path from
source to destination.
 The maximum number of hops allowed for RIP is 15, which limits the size of networks that RIP can
support.
 A hop count of 16 is considered an infinite distance and the route is considered unreachable.
 RIP implements the split horizon, route poisoning and hold down mechanisms to prevent incorrect
routing information from being propagated.
 Therefore RIP can be implemented only on small-sized networks.
 Routers running RIP send their advertisements for every 30 seconds.

RIP Versions
 There are three versions of the Routing Information Protocol. They are,
o RIPv1
o RIPv2
o RIPng
RIP Message Format

 RIP defines two types of messages. They are,

26
o Request Message
 Sent by a router that has just come up or has some time-out entries
 Can ask specific entries or all entries

o Response Message
 A response can be either solicited or unsolicited.
 Solicited Response - sent only in answer to a request
 Contains information about the destination specified in the request.
 Unsolicited Response - sent periodically
 Every 30s
 Contains information about the entire routing table.
 All the neighboring routers which receive the Request message respond back with the Response
Message containing their routing table.
RIP Packet Format
 RIP (version 2) packet format contains (network address, distance) pairs.
 A router also sends an update message whenever an update from another router causes it to change
its routing table.
 It supports multiple address families, not just IP—that is the reason for the Family part of the
advertisements.

Figure: RIPv2 Packet Format


 Command – It is an 8 bit field specifies the type of message, 1 for request and 2 for response.
 Version – It is an 8 bit field specifies the version of RIP.
27
 Must be Zero – It is a protocol field.
 Family – It is a 16 bit fields defines the family of the protocol.
 Network Address – It defines the address of the destination network.
 Distance – It is a 32 bit field defines the hop count from the advertising number router to the
destination network.
RIP Timers
 The routing information protocol uses the following timers as part of its operation. They are,
o Update Timer
o Invalid Timer
o Flush Timer
o Hold-down Timer
Update Timer
 The update timer controls the interval between two unnecessary response messages.
 By default the value is 30 seconds.
 The response message is broadcast to its entire RIP enabled interface.
Invalid Timer
 The invalid timer specifies how long a routing entry can be in the routing table without being
updated.
 This is also called as expiration Timer.
 By default, the value is 180 seconds.
 After the timer expires the hop count of the routing entry will be set to 16, marking the destination as
unreachable.
Flush Timer
 The flush timer controls the time between the routes is invalidated or marked as unreachable and
removal of entry from the routing table.
 By default the value is 240 seconds. This is 60 seconds longer than Invalid timer.
 So for 60 seconds the router will be advertising about this unreachable route to all its neighbors.
 This timer must be set to a higher value than the invalid timer.
Hold-down Timer
 The hold-down timer is started per route entry, when the hop count is changing from lower value to
higher value.
 This allows the route to get stabilized. During this time no update can be done to that routing entry.
 The default value of this timer is 180 seconds.
Advantages
 It is very useful for small networks
 It supports subnet
 Low memory requirement
 Easy to implement
Disadvantages
28
 It is not secure.
 RIP packet size increases as the number of networks increases.
 It generates more protocol traffic.
 It is slow to adjust for link failures.
--------------------------------------------------------------------------------------------------------------------
Link State Routing
 Link-state routing is the second major class of intra-domain routing protocol.
 Each node is assumed to be capable of finding out the state of the link to its neighbors (up or down)
and the cost of each link.
 The basic idea behind link-state protocols is very simple: It has knowledge about all the nodes in the
network.
 Thus, link state routing protocols rely on two mechanisms:
o Reliable dissemination of link-state information
o Calculation of routes from the sum of all the accumulated link-state knowledge.
Link-State Database (LSDB)
 To create a least-cost tree with this method, each node needs to have a complete map of the network,
which means it needs to know the state of each link.
 The collection of states for all links is called the link-state database (LSDB).
 There is only one LSDB for the whole internet; each node needs to have a duplicate of it to be able to
create the least-cost tree.
Reliable Flooding
 Reliable flooding is the process of making sure that all the nodes participating in the routing protocol
get a copy of the link-state information from all the other nodes.
 As the term flooding suggests, the basic idea is for a node to send its link-state information out on all
of its directly connected links; each node that receives this information then forwards it out on all of
its links.
 This process continues until the information has reached all the nodes in the network.
Link State Packet (LSP)
 Each node creates an update packet, also called a link-state packet (LSP), which contains the
following information:
o The ID of the node that created the LSP
o A list of directly connected neighbors of that node and associated cost
o A 64 bit sequence number
o A time to live for this packet
 The first two items are needed to enable route calculation; the last two are used to make the process
of flooding the packet to all nodes reliable.
 Flooding works in the following way.
o It stores the most recent LSP from each node.
o It forwards the LSP to all nodes except the incoming one.
29
o Then, it generates new LSP periodically and increments the SEQNO.
o It starts the SEQNO at 0 when it reboot.
o Finally decrement the TTL of each stored LSP and discards when TTL=0.

Figure: Flooding of Link-State Packets. (a) LSP arrives at node X; (b) X floods LSP to A and C; (c) A
and C flood LSP to B (but not X); (d) Flooding is Complete
 The above figure shows an LSP being flooded in a small network. Each node becomes shaded as it
stores the new LSP.
 In Figure (a) the LSP arrives at node X, which sends it to neighbors A and C in Figure (b). A and C
do not send it back to X, but send it on to B.
 Since B receives two identical copies of the LSP, it will accept whichever arrived first and ignore the
second as a duplicate.
 It then passes the LSP onto D, which has no neighbors to flood it to, and the process is complete.
 One of the important design goals of a link-state protocol’s flooding mechanism is,
o The newest information must be flooded to all nodes as quickly as possible.
o The old information must be removed from the network and not allowed to circulate.
o In addition, it is clearly desirable to minimize the total amount of routing traffic that is sent
around the network.
 One easy way to reduce overhead is to avoid generating LSPs unless absolutely necessary.
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 received LSPs.
 Each node maintains two lists, namely Tentative and Confirmed with entries of the form
(Destination, Cost, NextHop).
Forward Search Algorithm (Dijkstra’s Algorithm – Finding Shortest Path)
1. Initialize the Confirmed list with an entry for the Node (Cost = 0).
2. Node just added to Confirmed list is called Next. Its LSP is examined.
3. For each neighbor of Next, calculate cost to reach each neighbor as Cost (Node to Next) + Cost
(Next to Neighbor).
 If Neighbor is neither in Confirmed nor in tentative list, then add (Neighbor, Cost, NextHop)
to Tentative list.
 If Neighbor is in tentative list, and Cost is less than existing cost, then replace the entry with
(Neighbor, Cost, NextHop).
4. If tentative list is empty then Stop, otherwise move least cost entry from tentative list to Confirmed
list and return to Step 2.
30
Figure: Link-State Routing: An Example Network

Table: The steps for building the routing table for node D
Advantages
 It has been proven to stabilize quickly.
 It does not generate much traffic.
 It responds rapidly to topology changes or node failures.
Disadvantages
 On the downside, the amount of information stored at each node can be quite large.
---------------------------------------------------------------------------------------------------------------------------
Open Shortest Path First (OSPF)
 Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol (IP) networks.
 It falls into the group of interior routing protocols, operating within a single autonomous system
(AS).
Features of OSPF
 Authentication of Routing Messages ―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.
OSPF Header Format

31
Figure: OSPF Header Format
 Version ― represents the current version, i.e., 2.
 Type ― represents the type (1–5) of OSPF message.
 Message Length - Specifies the length of OSPF packet in bytes.
 SourceAddr ― identifies the sender of the message.
 AreaId ― A 32-bit identifier of the area in which the node is located
 Checksum ― A 16-bit internet checksum protects the entire packet except the authentication data.
 Authentication Type ― this field is 0 if no authentication is used; otherwise 1for simple password
and 2 for cryptographic authentication.
 Authentication― It contains the password or cryptographic checksum.
OSPF Message Types
 There are five different message types, for various types of communication: They are,
o Hello
o Database Description
o Link – State Request
o Link – State Send / Update
o Link - State Acknowledgement

32
 The basic building block of link-state messages in OSPF is the link-state advertisement (LSA). One
message may contain many LSAs.
 Type 1 LSAs advertise the cost of links between routers.
 Type 2 LSAs are used to advertise networks to which the advertising router is connected, while other
types are used to support additional hierarchy.

Figure: OSPF Link State Advertisement


 LS Age – It is equivalent of time to live, it counts up and the LSA expires when the age reaches a
defined maximum value. Type - It tells us that this is a type 1 LSA.
 Link State ID and Advertising Router – Both are identical carries 32-bit identifier that identifies the
router.
 LS Sequence Number – It is used to detect old or duplicate LSAs.
33
 LS Checksum - It is used to verify that data has not been corrupted.
 Length – It is the length of the complete LSA in bytes.
Each link in the LSA is represented by a Link ID, Link Data and a metric.
 The first two of these fields is used to identify the link.
 The metric is used to identify the cost of the link.
 Link Type ― specifies type of link (for example, point-to-point).
 TOS ― allows OSPF to choose different routes based on the value in TOS field.
Link-State Advertisement
 OSPF is based on the link-state routing algorithm, which requires that a router advertise the state of
each link to all neighbors for the formation of the LSDB.
 There are five types of link-state advertisements: router link, network link, summary link to network,
summary link to AS border router, and external link.

Figure: Five different LSPs


Router Link
 A router link advertises the existence of a router as a node.
 This type of advertisement can define one or more types of links that connect the advertising router
to other entities.
o A transient link announces a link to a transient network, a network that is connected to the
rest of the networks by one or more routers.
o This type of advertisement should define the address of the transient network and the cost of
the link.
o A stub link advertises a link to a stub network, a network that is not a through network.
Again, the advertisement should define the address of the network and the cost.

34
o A point-to-point link should define the address of the router at the end of the point-to-point
line and the cost to get there.
Network Link
 A network link advertises the network as a node.
 However, since a network cannot do announcements itself (it is a passive entity), one of the routers is
assigned as the designated router and does the advertising.
 In addition to the address of the designated router, this type of LSP announces the IP address of all
routers, but no cost is advertised because each router announces the cost to the network when it sends
a router link advertisement.
Summary Link to Network
 This is done by an area border router; it advertises the summary of links collected by the backbone to
an area or the summary of links collected by the area to the backbone.
Summary Link to AS
 This is done by an AS router that advertises the summary links from other ASs to the backbone area
of the current AS, information which later can be disseminated to the areas so that they will know
about the networks in other ASs.
External Link
 This is also done by an AS router to announce the existence of a single network outside the AS to the
backbone area to be disseminated into the areas.
-------------------------------------------------------------------------------------------------------------------
Compare Distance Vector Routing and Link State Routing

Multicast Routing
Explain multicast routing in detail with neat sketches.

35
 IP multicast is a method of sending Internet Protocol (IP) datagram’s to a group of interested
receivers in a single transmission.
 It is a form of point-to-multipoint communication often employed for streaming media applications
on the Internet and private networks.
Multicast Addresses
Write short notes on multicast address.
 A multicast address is a logical identifier for a group of hosts in a computer network, that are
available to process datagrams or frames intended to be multicast for a designated network service.
 Multicast addressing can be used in the Link Layer (Layer 2 in the OSI model), such as Ethernet
multicast, and at the Internet Layer (Layer 3 for OSI) for Internet Protocol Version 4 (IPv4) or
Version 6 (IPv6) multicast.
 IPv4 allocate class D address for multicast operation. Ipv6 also support for multicast addressing.
 Address range is 224.0.0.0 to 239.255.255.255.
 Out of 32 bits, only 28 bit is used for multicast address in Ipv4. The 4-bit is prefix for all multicast
address.
 Ethernet uses 23-bit for multicast addressing and remaining bit for shared prefix.
 In Ethernet, multicasting, mapping of 28 bit of IP address with 23 bit Ethernet address. It ignores 5
bit of higher order bits.
 It increases overhead and multicast source there must be two piece of information: source IP address
and group address.
Multicast Routing Techniques
Optimal Routing: Shortest Path Trees
 The process of optimal inter-domain routing eventually results in the finding of the shortest path
tree.
 The root of the tree is the source, and the leaves are the potential destinations.
 The path from the root to each destination is the shortest path.
Multicast Routing
 When a router receives a multicast packet, the situation is different from when it receives a unicast
packet.
 A multicast packet may have destinations in more than one network. Forwarding of a single packet
to members of a group requires a shortest path tree.
 Two approaches have been used to solve the problem:
o Source-Based Tree Approach
o Group-Shared Tree Approach
Source-Based Tree
 In the source-based tree approach to multicasting, each router needs to create a separate tree for
each source-group combination.
 ie., each router needs to have one shortest path tree for each group.

36
 The shortest path tree for a group defines the next hop for each network that has loyal member(s) for
that group.

Figure: Source-Based Tree Approach


Group-Shared Tree
 In group-shared tree approach, we designate a router to act as the phony source for each group.
 The designated router, which is called the core router or the rendezvous point router, acts as the
representative for the group.
 Any source that has a packet to send to a member of that group sends it to the core center (unicast
communication) and the core center is responsible for multicasting.
 The core center creates one single routing tree with itself as the root and any routers with active
members in the group as the leaves.
 In this approach, there are m core routers (one for each group) and each core router has a routing
tree, for the total of m trees.
 This means that the number of routing trees is reduced from (m x n) in the source-based tree
approach to m in this approach.

Figure: Group-Shared Tree Approach

Intra-domain Multicast Routing Protocols

37
Figure: Taxonomy of Multicast Routing Protocols
Multicast Open Shortest Path First (MOSPF)
 This protocol is an extension of the OSPF protocol that uses multicast link state routing to create
source-based trees.
 The protocol 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.
 This packet is called the group-membership LSA.
 In this way, we can include in the tree only the hosts (using their unicast addresses) that belong to a
particular group.
Multicast Distance Vector Routing (DVMRP)
 DVMRP (Distance Vector Multicast Routing Protocol) is a multicast routing protocol that
provides an efficient mechanism for connectionless datagram delivery to a group of hosts across an
internetwork.
 It is a distributed protocol that dynamically generates IP multicast delivery trees using a technique
called Reverse Path Multicasting.
 It is the oldest routing protocol that has been used to support multicast data transmission over
networks.
 The protocol sends multicast data in the form of unicast packets that are reassembled into multicast
data at the destination.
 Multicast distance vector routing uses source-based trees, but the router never actually makes a
routing table.
 When a router receives a multicast packet, it forwards the packet as though it is consulting a routing
table. We can say that the shortest path tree is evanescent. After its use (after a packet is forwarded)
the table is destroyed.
 To accomplish this, the multicast distance vector algorithm uses a process based on four decision-
making strategies. Each strategy is built on its predecessor.
 DVMRP is one of several multicast routing protocols described as flood-and-prune protocols.
 Multicasting is added to distance-vector routing in two stages.
o Reverse Path Broadcast floods packets to all networks
o Reverse Path Multicasting prunes end networks that do not have hosts belonging to a
multicast group.
 So, DVMRP is also known as flood-and-prune protocol.
38
Flooding
 A router receives a packet and, without even looking at the destination group address, sends it out
from every interlace except the one from which it was received.
 This is a broadcast, not a multicast. There is another problem: it creates loops.
 A packet that has left the router may come back again from another interlace or the same interlace
and be forwarded again.
 Some flooding protocols keep a copy of the packet for a while and discard any duplicates to avoid
loops.
Reverse Path Forwarding (RPF)
 RPF is a modified flooding strategy.
 To prevent loops, only one copy is forwarded; the other copies are dropped.
 In RPF, a router forwards only the copy that has traveled the shortest path from the source to the
router.
 To find this copy, RPF uses the unicast routing table. The router receives a packet and extracts the
source address (a unicast address).
 It consults its unicast routing table as though it wants to send a packet to the source address. The
routing table tells the router the next hop.
 If the multicast packet has just come from the hop defined in the table, the packet has traveled the
shortest path from the source to the router because the shortest path is reciprocal in unicast distance
vector routing protocols.
 This strategy prevents loops because there is always one shortest path from the source to the router.
If a packet leaves the router and comes back again, it has not traveled the shortest path.

Figure: Reverse Path Forwarding (RPF)


Reverse Path Broadcasting (RPB)
 RPF guarantees that each network receives a copy of the multicast packet without formation of
loops.

39
 However, RPF does not guarantee that each network receives only one copy; a network may receive
two or more copies.
 The reason is that RPF is not based on the destination address (a group address); forwarding is based
on the source address.

Figure: Problem with RPF


 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.

Figure: RPF Vs RPB


Reverse Path Multicasting (RPM)
 RPB does not multicast the packet, it broadcasts it.
 This is not efficient. To increase efficiency, the multicast packet must reach only those networks that
have active members for that particular group. This is called reverse path multicasting (RPM).
 To convert broadcasting to multicasting, the protocol uses two procedures, pruning and grafting.

 RPM adds pruning and grafting to RPB to create a multicast shortest path tree that supports dynamic
membership changes.
DVMRP Message Header

40
The fields for the DVMRP message are as follows:
 Type is the IGMP type number, which is set to 0x13 for all DVMRP messages. The actual
DVMRPv3 version is specified in the Major Version field.
 Checksum is a standard IP-style checksum, using a 16-bit one's complement of the one's
complement of the DVMRP message.
 Minor Version and Major Version are set to 0xFF and 0x03, respectively, for all DVMRPv3
messages.
 Code specifies the DVMRPv3 message type. The possible values of the code field and the
corresponding message types.

Code DVMRP Message Types


1 Probe
2 Report
3 Ask Neighbors
4 Neighbors
5 Ask Neighbors 2
6 Neighbors 2
7 Prune
8 Graft
9 Graft Ack
----------------------------------------------------------------------------------------------------------------------
PIM
Protocol-Independent Multicast (PIM) is a family of multicast routing protocols for Internet Protocol
(IP) networks that provide one-to-many and many-to-many distribution of data over a LAN, WAN or the
Internet.
 It is termed protocol-independent because PIM does not include its own topology discovery
mechanism, but instead uses routing information supplied by other routing protocols such as the
BGP.
 Protocol Independent Multicast (PIM) is the name given to two independent multicast routing
protocols:
o Protocol Independent Multicast, Dense Mode (PIM-DM)
o Protocol Independent Multicast, Sparse Mode (PIM-SM)
There are four variants of PIM:
 PIM Sparse Mode (PIM-SM)

41
o It explicitly builds unidirectional shared trees rooted at a rendezvous point (RP) per group,
and optionally creates shortest-path trees per source.
o It is a group-shared tree routing protocol that has a rendezvous point (RP) as the source of the
tree.
o Its operation is like CBT; however, it is simpler because it does not require acknowledgment
from a join message. In addition, it creates a backup set of RPs for each region to cover RP
failures.
o PIM-SM generally scales fairly well for wide-area usage.
o PIM-SM is commonly used in IPTV systems for routing multicast streams
between VLANs, Subnets or local area networks.
 PIM Dense Mode (PIM-DM)
o It uses dense multicast routing.
o It is a source-based tree routing protocol that uses RPF pruning and grafting strategies for
multicasting.
o PIM-DM is straightforward to implement but generally has poor scaling properties.
o The first multicast routing protocol, DVMRP used dense-mode multicast routing.
 Bidirectional PIM
o It explicitly builds shared bi-directional trees.
o It never builds a shortest path tree, so may have longer end-to-end delays than PIM-SM, but
scales well because it needs no source-specific state.
 PIM Source-Specific Multicast (PIM-SSM)
o It builds trees that are rooted in just one source, offering a more secure and scalable model for
a limited amount of applications.
o In SSM, an IP datagram is transmitted by a source S to an SSM destination address G, and
receivers can receive this datagram by subscribing to channel (S,G).
o One of the characteristics of PIM-SM is that it can switch from a group-shared tree strategy
to a source-based tree strategy when necessary.
PIM Operation
 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.
 PIM-SM assigns to each group a special router known as the rendezvous point.
 Rendezvous Point Tree: a group shared tree method in which there is one tree for each group.
 Rendezvous Router: A router which is the core or center for each multicast group is called as
rendezvous router; it becomes the root of the tree.
 PIM-SM allows two types of trees to be constructed: a shared tree, which may be used by all
senders, and a source-specific tree, which may be used only by a specific sending host.
 Routers explicitly join and leave multicast group using Join and Prune messages.

42
Shared Tree
 When a router sends Join message for group G to RP, it goes through a set of routers.
o Join message is wildcarded (*), i.e., it is applicable to all senders.
o Routers create an entry (*, G) in its forwarding table for the shared tree.
o Interface on which the Join arrived is marked to forward packets for that group.
o Forwards Join towards rendezvous router RP.
 Eventually, the message arrives at RP. Thus a shared tree with RP as root is formed.
Example
Consider the below figure (a) and (b) for Shared Tree
 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 sending host, so that
tunneling can be avoided.
 Intermediary routers create sender-specific entry (S, G) in their tables. Thus a sources 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
Consider the below figure (c) and (d) for Source-Specific Tree
 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.

43
Figure: (a) R4 sends Join to RP and joins shared tree; (b) R5 joins shared tree; (c) RP builds source-
specific tree to R1 by sending Join to R1; (d) R4 and R5 build source-specific tree to R1 by sending
Joins to R1.
***************************************************************************
Overview of IPv6 Addressing
Ipv6
 IPv6 stands for Internet Protocol version 6.
 The motivation for a new version of IP is simple: to deal with exhaustion of the IP address space.
 CIDR helped to contain the rate at which the Internet address space is being consumed and also
helped to control the growth of routing table information needed in the Internet’s routers.
 CIDR and subnetting could not solve address space exhaustion faced by IPv4.
 IPv6 was evolved to solve address space problem and offers rich set of services.
Historical Perspective
 The IETF began looking at the problem of expanding the IP address space in 1991, and several
alternatives were proposed.
 Since the IP address is carried in the header of every IP packet, increasing the size of the address
dictates a change in the packet header.
 The effort to define a new version of IP was known as IP Next Generation or IPng.
 An official IP version number was assigned, so IPng is now known as IPv6.
 The significance of changing to a new version of IP caused a snowball effect.
Features of IPv6
44
 In addition to the need to accommodate scalable routing and addressing, some of the other features
for IPng includes:
o Support for real-time services
o Security support
o Auto-configuration (i.e., the ability of hosts to automatically configure themselves with such
information as their own IP address and domain name)
o Enhanced routing functionality, including support for mobile hosts.
Addresses and Routing
• IPv6 provides 128 bit address space, instead of the 32 bit address of IPv4.
• IPv6 can potentially address 3.4 x 1028 nodes or approximately 1500 addresses per square foot of the
earth’s surface (which should be sufficient even when toasters on Venus have IP addresses!)
Address Space Allocation
 IPv6 addresses do not have classes, but the address space is still divided based on the leading bits.

 IPv4's class A, B and C addresses start with 001 prefix.


 Multicast address serves the purpose of class D address.
 Large chunks (87%) of address space are left unassigned for future use.
 IPv6 defines two types of local addresses for private networks.
o Link-local addresses are to be used for addressing on a single link or subnetwork. They
cannot be integrated into the global addressing scheme.
o Site-local addresses are designed for local use but formatted in such a way that they can later
be integrated into the global address scheme.
 Reserved addresses start with prefix of eight 0s.
o Unspecified address is used when a host does not know its address
o Loopback address is used for testing purposes before connected to network
o Compatible address is used when IPv6 hosts communicate through 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 any cast address is
delivered to only one of the nearest interface.

45
Address Notation
 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 a 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
Address Aggregation
 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.
 Format for provider-based unicast address aggregation is:

Figure: An IPv6 provider-based unicast address


 RegistryID―identifies the continent (North America, Europe or Asia and Pacific)
 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.
IPv6 Packet Format

 Version — The 4-bit field defines the version number of the IP. i.e., 6.
 TrafficClass — The 8-bit field is used to distinguish different payloads with different delivery
requirements. It replaces the type-of-service field in IPv4.

46
 FlowLabel — The flow label is a 20-bit field that is designed to provide special handling for a
particular flow of data.
 PayloadLen — It is 2-byte field defines the length of the IP datagram excluding the header.
 NextHeader — It is an 8-bit field defining the type of the first extension header or the type of the
data that follows the base header in the datagram.
 HopLimit — It serves the same purpose as TTL field in IPv4.
 SourceAddress / DestinationAddress — 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.

Figure: Ipv6 Extension Headers


 Hop-by-Hop Option
o The hop-by-hop option is used when the source needs to pass information to all routers
visited by the datagram.
 Destination Option
o The destination option is used when the source needs to pass information to the destination
only.
 Source Routing
o The source routing extension header combines the concepts of the strict source route and the
loose source route options of IPv4.
 Fragmentation
o The concept of fragmentation in IPv6 is the same as that in IPv4. In IPv6, only the original
source can fragment.
 Authentication
o The authentication extension header has a dual purpose: it validates the message sender and
ensures the integrity of data.
 Encrypted Security Payload (ESP)
o The encrypted security payload (ESP) is an extension that provides confidentiality and
guards against eavesdropping.

Advanced Routing Capabilities


 Auto configuration—Auto or stateless configuration of IP address to hosts without the need for a
DHCP server, i.e., plug and play.
47
 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 over IPv4
 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.
Difference between IPv4 and IPv6.
IPv4 IPv6
 IPv4 is a 32-Bit IP Address.  IPv6 is 128 Bit IP Address.
 IPv4 is a numeric address, and its  IPv6 is an alphanumeric address whose
binary bits are separated by a dot (.). binary bits are separated by a colon (:).
 IPv4 address uses the dot-decimal  IPv6 address is represented in
notation. hexadecimal, colon- separated notation.
 IPv4 support VLSM (Virtual Length  IPv6 does not offer support for VLSM.
Subnet Mask).  IPv6 support auto-configuration
 IPv4 does not support auto- capabilities.
configuration capabilities.

*****************************************************************************************************************************

Transition from IPv4 to IPv6


 Because of the huge number of systems on the Internet, the transition from IPv4 to IPv6 cannot
happen suddenly.
 It takes a considerable amount of time before every system can move from IPv4 to IPv6.
 The transition must be smooth to prevent any problems between IPv4 and IPv6 systems.

Figure: Three transition strategies


Dual Stack
 A station must run IPv4 and IPv6 simultaneously until all the Internet uses IPv6.
 To determine which version to use when sending a packet to a destination, the source host queries
the DNS.
 If the DNS returns an IPv4 address, the source host sends an IPv4 packet. If the DNS returns an IPv6
address, the source host sends an IPv6 packet.
48
Tunneling Strategy
 Tunneling is a strategy used when two computers using IPv6 want to communicate with each other
and the packet must pass through a region that uses IPv4.
 To pass through this region, the packet must have an IPv4 address.
 So the IPv6 packet is encapsulated in an IPv4 packet when it enters the region, and it leaves its
capsule when it exits the region.
 It seems as if the IPv6 packet enters a tunnel at one end and emerges at the other end.
 To make it clear that the IPv4 packet is carrying an IPv6 packet as data, the protocol value is set to
41.

Header Translation Strategy


 Header translation is necessary when the majority of the Internet has moved to IPv6 but some
systems still use IPv4.
 The sender wants to use IPv6, but the receiver does not understand IPv6.
 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.

49

You might also like