CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
INTRODUCTION
the Internet is made of many networks (or links) connected through the connecting devices. In other words, the
Internet is an internetwork, a combination of LANs and WANs.
Packetizing
The first duty of the network layer is definitely packetizing: 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.
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.
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 sometimes called the forwarding tableand sometimes the routing table. 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).
PACKET SWITCHING
A router, in fact, is a switch that creates a connection between an input port and an output port. In data
communication switching techniques are divided into two broad categories, circuit switching and packet switching,
only packet switching is used at the network layer because the unit of data at this layer is a packet. Packet-switched
network can use two different approaches to route the packets: the datagram approach and the virtual circuit
approach.
Datagram Approach: Connectionless Service
When the network layer provides a connectionless service, each packet traveling in the Internet is an independent
entity; there is no relationship between packets belonging to the same message. The switches in this type of network
are called routers. A packet belonging to a message may be followed by a packet belonging to the same message or
to a different message. A packet may be followed by a packet coming from the same or from a different source.
Each packet is routed based on the information contained in its header: source and destination addresses. The
destination address defines where it should go; the source address defines where it comes from. The router in this
case routes the packet based only on the destination address. The source address may be used to send an error
message to the source if the packet is discarded. Figure below shows the forwarding process in a router in this case.
We have used symbolic addresses such as A and B.
Each packet is forwarded based on the label in the packet. To follow the idea of connection-oriented design to be
used in the Internet, we assume that the packet has a label when it reaches the router. Figure below shows the idea.
In this case, the forwarding decision is based on the value of the label, or virtual circuit identifier, as it is sometimes
called. To create a connection-oriented service, a three-phase process is used: setup, data transfer, and teardown. In
the setup phase, the source and destination addresses of the sender and receiver are used to make table entries for the
connection-oriented service. In the teardown phase, the source and destination inform the router to delete the
corresponding entries. Data transfer occurs between these two phases.
Setup Phase
In the setup phase, a router creates an entry for a virtual circuit. For example, suppose source A needs to create a
virtual circuit to destination B. Two auxiliary packets need to be exchanged between the sender and the receiver: the
request packet and the acknowledgment packet.
Request packet
A request packet is sent from the source to the destination. This auxiliary packet carries the source and destination
addresses.
The destination sends an acknowledgment to router R4. The acknowledgment carries the global source and
destination addresses so the router knows which entry in the table is to be completed. The packet also carries label
77, chosen by the destination as the incoming label for packets from A. Router R4 uses this label to complete the
outgoing label column for this entry. Note that 77 is the incoming label for destination B, but the outgoing label for
router R4. Router R4 sends an acknowledgment to router R3 that contains its incoming label in the table, chosen in
the setup phase. Router R3 uses this as the outgoing label in the table.
Router R3 sends an acknowledgment to router R1 that contains its incoming label in the table, chosen in the setup
phase. Router R1 uses this as the outgoing label in the table.
Finally router R1 sends an acknowledgment to source A that contains its incoming label in the table, chosen in the
setup phase.
The source uses this as the outgoing label for the data packets to be sent to destination B.
Data-Transfer Phase
The second phase is called the data-transfer phase. After all routers have created their forwarding table for a specific
virtual circuit, then the network-layer packets belonging to one message can be sent one after another. In Figure
below, we show the flow of a single packet, but the process is the same for 1, 2, or 100 packets. The source
computer uses the label 14, which it has received from router R1 in the setup phase. Router R1 forwards the packet
to router R3, but changes the label to 66.Router R3 forwards the packet to router R4, but changes the label to 22.
Finally, router R4 delivers the packet to its final destination with the label 77. All the packets in the message follow
the same sequence of labels, and the packets arrive in order at the destination.
Teardown Phase
In the teardown phase, source A, after sending all packets to B, sends a special packet called a teardown packet.
Destination B responds with a confirmation packet. All routers delete the corresponding entries from their tables.
NETWORK-LAYER PERFORMANCE
The upper-layer protocols that use the service of the network layer expect to receive an ideal service, but the network
layer is not perfect. The performance of a network can be measured in terms of delay, throughput, and packet
loss.
St. Joseph’s College of Engineering / St. Joseph’s Institute of Technology Page 3 of 25
CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
Congestion control is
an issue that can improve the performance.
Delay
The delays in a network can be divided into four types: transmission delay, propagation delay, processing delay, and
queuing delay.
Transmission Delay
A source host or a router cannot send a packet instantaneously. A sender needs to put the bits in a packet on the line
one by one. If the first bit of the packet is put on the line at time t1 and the last bit is put on the line at time t2,
transmission delay of the packet is (t2
shorter if the sender can transmit faster. In other words, the transmission delay is Delaytr = (Packet length) /
(Transmission rate).
Propagation Delay
Propagation delay is the time it takes for a bit to travel from point A to point B in the transmission media. The
propagation delay for a packet-switched network depends on the propagation delay of each network (LAN or
WAN). The propagation delay depends on the propagation speed of the media, which is 3 * 10 8 meters/second in a
vacuum and normally much less in a wired medium; it also depends on the distance of the link. In other words,
propagation delay is Delaypg = (Distance) / (Propagation speed).
Processing Delay
The processing delay is the time required for a router or a destination host to receive a packet from its input port,
remove the header, perform an error detection procedure, and deliver the packet to the output port (in the case of a
router) or deliver the packet to the upper-layer protocol (in the case of the destination host). The processing delay
may be different for each packet, but normally is calculated as an average. Delaypr = Time required to process a
packet in a router or a destination host
Total Delay
Assuming equal delays for the sender, routers, and receiver, the total delay (source-to-destination delay) a packet
encounters can be calculated if we know the number of routers, n, in the whole path.
Total delay =(n +1) (Delaytr + Delaypg + Delaypr) + (n) (Delayqu)
Note that if we have n routers, we have (n + 1) links. Therefore, we have (n + 1) transmission delays related to n
routers and the source, (n +1) propagation delays related to (n +1) links, (n+1) processing delays related to n routers
and the destination, and only n queuing delays related to n routers.
Throughput
Throughput at any point in a network is defined as the number of bits passing through the point in a second, which is
actually the transmission rate of data at that point. In a path from source to destination, a packet may pass through
several links (networks),each with a different transmission rate.
The average data rate for this path is 100 kbps, the minimum of the three different data rates.
The transmission rate of the main link in the calculation of the throughput is only 200 kbps because the link is shared
between three paths.
IPV4 ADDRESSES
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a host or a router to the
Internet.
Address Space
A protocol like IPv4 that 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 2b because each bit can
have
St. Joseph’s College of Engineering / St. Joseph’s Institute of Technology Page 4 of 25
CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
two different values (0 or 1). IPv4 uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296
(more than four billion).
Notation
There are three common notations to show an IPv4 address: binary notation (base 2),dotted-decimal notation (base
256), and hexadecimal notation (base 16). In binary notation, an IPv4 address is displayed as 32 bits. To make the
address more readable, one or more spaces are usually inserted between each octet (8 bits). Each octet is often
referred to as a byte. To make the IPv4 address more compact and easier to read, it is usually written in decimal form
with a decimal point (dot) separating the bytes. This format is referred to as dotted-decimal notation. Note that
because each byte (octet) is only 8 bits,each number in the dtted-decimal notation is between 0 and 255. We
sometimes see an IPv4 address in hexadecimal notation. Each hexadecimal digit is equivalent to four bits.This
means that a 32-bit address has 8hexadecimal digits.
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). The prefix length is n bits and the suffix length is (32 - n) bits.
Classful Addressing
When the Internet started, 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 Figure 18.18. This scheme is referred to as classful
addressing.
In class A, the network length is 8 bits, but since the first bit, which is 0, defines the class, we can have only
seven
bits as the network identifier. This means there are only 27 =128 networks in the world that can have a class A
address.
In class B, the network length is 16 bits, but since the first two bits, which are (10)2, define the class, we can have
only 14 bits as the network identifier. This means there are only 214 =16,384 networks in the world that can have a
class B address.All addresses that start with (110)2 belong to class C. In class C, the network
length is 24 bits, but since three bits define the class, we can have only 21 bits as the network identifier. This means
there are 221 = 2,097,152 networks in the world that can have a class C address. Class D is not divided into prefix
and suffix. It is used for multicast addresses. All addresses that start with 1111 in binary belong to class E. As in
Class D, Class E is not divided into prefix and suffix and is used as reserve.
EXAMPLE:
A classless address is given as 167.199.170.82/27. We can find the above three pieces of information
as follows. The number of addresses in the network is 232 - n = 25 = 32 addresses.
Address Mask
Another way 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
FORWARDING OF IP PACKETS
We discussed the concept of forwarding at the network layer earlier in this chapter. In this section, we extend the
concept to include the role of IP addresses in forwarding. As we discussed before, forwarding means to place the
packet in its route to its destination. When IP is used as a connectionless protocol, forwarding is based on the
destination address of the IP datagram; when the IP is used as a connection-oriented protocol, forwarding is based on
the label attached to an IP datagram.
Forwarding Based on Destination Address
In classless addressing, the whole address space is one entity; there are no classes. This means that forwarding
requires one row of information for each block involved. The table needs to be searched based on the network
address (first address in the block). Unfortunately, the destination address in the packet gives no clue about the
network address. To solve the problem, we need to include the mask (/n) in the table.
IPv4 is an unreliable datagram protocol—a best-effort delivery service. The term best-effort means that IPv4
packets
St. Joseph’s College of Engineering / St. Joseph’s Institute of Technology Page 7 of 25
CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
can be corrupted, be lost, arrive out of order, or be delayed, and may create congestion for the network. If reliability
is important, IPv4
must be paired with a reliable transport-layer protocol such as TCP. An example of a more commonly understood
best-effort delivery service is the post office. IPv4 is also a connectionless protocol that uses the datagram approach.
This means that each datagram is handled independently, and each datagram can follow a different route to the
destination. This implies that datagrams sent by the same source to the same destination could arrive out of order.
Datagram Format
Discussing the meaning and rationale for the existence of each field is essential to understanding the operation of
IPv4; a brief description of each field is in order.
Version Number. The 4-bit version number (VER) field defines the version of the IPv4 protocol, which, obviously,
has the value of 4.
Header Length. The 4-bit header length (HLEN) field defines the total length of the datagram header in 4-
byte
words. The IPv4 datagram has a variable-length header. When a device receives a datagram, it needs to know when
the header stops and the data, which is encapsulated in the packet, starts. However, to make the value of the header
length (number of bytes) fit in a 4-bit header length, the total length of the header is calculated as 4-byte words. The
total length is divided by 4 and the value is inserted in the field. The receiver needs to multiply the value of this field
by 4 to find the total length.
Service Type. In the original design of the IP header, this field was referred to as type of service (TOS), which
defined how the datagram should be handled. In the late 1990s, IETF redefined the field to provide differentiated
services (DiffServ).
Total Length. This 16-bit field defines the total length (header plus data) of the IP datagram in bytes. A 16-bit
number can define a total length of up to 65,535 (when all bits are 1s). However, the size of the datagram is
normally much less than this. This field helps the receiving device to know when the packet has completely
arrived.
To
find the length of the data coming from the upper layer, subtract the header length from the total length. The header
length can be found by multiplying the value in the HLEN field by 4.
Identification, Flags, and Fragmentation Offset. These three fields are related to the fragmentation of the IP
datagram when the size of the datagram is larger than the underlying network can carry.
Time-to-live. Due to some malfunctioning of routing protocols (discussed later) a datagram may be circulating in the
Internet, visiting some networks over and over without reaching the destination. This may create extra traffic in the
Internet. The time-to-live (TTL) field is used to control the maximum number of hops (routers) visited by the
datagram. When a source host sends the datagram, it stores a number in this field. This value is approximately two
times the maximum number of routers between any two hosts. Each router that processes the datagram decrements
this number by one. If this value, after being decremented, is zero, the router discards the datagram.
Protocol. In TCP/IP, the data section of a packet, called the payload, carries the whole packet from another protocol.
A datagram, for example, can carry a packet belonging to any transport-layer protocol such as UDP or TCP. A
datagram can also
carry a packet from other protocols that directly use the service of the IP, such as some routing protocols or some
auxiliary
corruptedprotocols.
during the transmission. IP puts the burden of error checking of the payload on the protocol that owns the
Header checksum. IP is not a reliable protocol; it does not check whether the payload carried by a datagram is
In order to make the IP protocol independent of the physical network, the designers decided to make the maximum
length of the IP datagram equal to 65,535 bytes.
This makes transmission more efficient if one day we use a link-layer protocol with an MTU of this size. However,
for other physical networks, we must divide the datagram to make it possible for it to pass through these networks.
This is called fragmentation.
When a datagram is fragmented, each fragment has its own header with most of the fields repeated, but some have
been changed. A fragmented datagram may itself be fragmented if it encounters a network with an even smaller
MTU. In other words, a datagram may be fragmented several times before it reaches the final destination.
Fields Related to Fragmentation
We mentioned before that three fields in an IP datagram are related to fragmentation:
identification, flags, and fragmentation offset. Let us explain these fields now. The 16-bit identification field
identifies a datagram originating from the source host. The combination of the identification and source IP address
must uniquely define a datagram as it leaves the source host. To guarantee uniqueness, the IP protocol uses a counter
to label the datagrams. The counter is initialized to a positive number.
When the IP protocol sends a datagram, it copies the current value of the counter to the identification field and
increments the counter by one. As long as the counter is kept in the main memory, uniqueness is guaranteed. When a
datagram is fragmented,
the value in the identification field is copied into all fragments. In other words, all fragments have the same
identification number, which is also the same as the original datagram. The identification number helps the
destination in reassembling the datagram. It knows that all fragments having the same identification value should be
assembled into one datagram.
The 3-bit flags field defines three flags. The leftmost bit is reserved (not used). 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 it cannot pass the
datagram
St. Joseph’s College of Engineering / St. Joseph’s Institute of Technology Page 9 of 25
CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
through any available physical network, it discards the datagram and sends an ICMP error message to the source
host (discussed later). If its value is 0, the datagram can be fragmented if necessary. 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.
It is the offset of the data in the original datagram measured in units of 8 bytes. Figure 19.6 shows a datagram with a
data size of 4000 bytes fragmented into three fragments. The bytes in the original datagram are numbered 0 to 3999.
The first fragment carries bytes 0 to 1399. The offset for this datagram is 0/8 = 0. The second fragment carries bytes
1400 to 2799; the offset value for this fragment is 1400/8 =175. Finally, the third fragment carries bytes 2800 to
3999. The offset value for this fragment is 2800/8 = 350.
ICMPv4
The IPv4 has no error-reporting or error-correcting mechanism. The IP protocol also lacks a mechanism for host and
management queries. A host sometimes needs to determine if a router or another host is alive. And sometimes a
network manager needs information from another host or router.
The Internet Control Message Protocol version 4 (ICMPv4) has been designed to compensate for the above two
deficiencies. It is a companion to the IP protocol. ICMP itself is a network-layer protocol.
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. For example, nodes can discover their neighbors. Also, hosts can discover and learn about
routers on their network and routers can help a node redirect its messages. An ICMP message has an 8-byte
header
St. Joseph’s College of Engineering / St. Joseph’s Institute of Technology Page 10 of 25
CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
and a variable-size data section. Although the general format of the header is different for each message type, the
first 4 bytes are common to all.
Least-Cost Trees
If there are N routers in an internet, there are (N 1) least-cost paths from each router to any other router. This means
we need N N 1) least-cost paths for the whole internet. If we have only 10 routers in an internet, we need 90 least-
cost paths. A better way to see all of these paths is to combine them in a least-cost tree. A least-cost tree is a tree
with the source router as the root that spans the whole graph (visits all other nodes) and in which the path between
the root and any other node is the shortest.
ROUTING ALGORITHMS
Several routing algorithms have been designed in the past. The differences between these methods are in the way
they interpret the least cost and the way they create the least-cost tree for each node.
Distance-Vector Routing
The distance-vector (DV) routing uses the goal we discussed in the introduction, to find the best route. In distance-
vector routing, the first thing each node creates is its own least-cost tree with the rudimentary information it has
about its immediate neighbors. The incomplete trees are exchanged between immediate neighbors to make the trees
more and more complete and to represent the whole internet. We can say that in distance-vector routing, a router
continuously tells all of its neighbors what it knows about the whole internet (although the knowledge can be
incomplete).
In distance-vector routing, normally we want to update an existing least cost with a least cost through an
intermediary node, such as z, if the latter is shorter. In this case, the equation becomes simpler, as shown below:
Distance Vectors
The concept of a distance vector is the rationale for the name distance-vector routing. A least-cost tree is a
combination of least-cost paths from the root of the tree to all destinations. These paths are graphically glued
together to form the tree. Distance-vector routing unglues these paths and creates a distance vector, a one-
dimensional array to represent the tree.
ALGORITHM
At each node x,
Initialization
for all destinations y in N:
Dx(y) = c(x,y) // If y is not a neighbor then c(x,y)
= ∞ for each neighbor w
Dw(y) = ? for all destination y in N.
for each neighbor w
send distance vector Dx = [ Dx(y) : y in N ] to w
loop
wait(until I receive any distance vector from some neighbor w)
for each y in N:
Dx(y) = minv{c(x,v)+Dv(y)}
If Dx(y) is changed for any destination y
Send distance vector Dx = [ Dx(y) : y in N ] to all neighbors
forever
When we know only one distance between two nodes, it is the least cost. Figure below shows all distance vectors for
our internet. However, we need to mention that these vectors are made asynchronously, when the corresponding
node has been booted; the existence of all of them in a figure does not mean synchronous creation of them. For
example, node A thinks that it is not connected to node G because the corresponding cell shows the least cost of
infinity. To improve these vectors, the nodes in the internet need to help each other by exchanging information. After
each node has created its vector, it sends a copy of the vector to all its immediate neighbors.
In the first event, node A has sent its vector to node B. Node B updates its vector using the cost cBA =2. In the
second event, node E has sent its vector to node B. Node B updates its vector using the cost cEA =4. After the first
event, node B has one improvement in its vector: its least cost to node D has changed from infinity to 5 (via node A).
After the second event, node B has one more improvement in its vector; its least cost to node F has changed from
infinity to 6 (via node E).
Count to Infinity
A problem with distance-vector routing is that any decrease in cost (good news) propagates quickly, but any increase
in cost (bad news) will propagate slowly. For a routing protocol to work properly, if a link is broken (cost becomes
infinity), every other router should be aware of it immediately, but in distance-vector routing, this takes some time.
The problem is referred to as count to infinity.
Example:
RIP has two types of messages: request and response. A request message is sent by a router that has just come up or
by a router that has some time-out entries. A request message can ask about specific entries or all entries. A response
(or update) message can be either solicited or unsolicited. A solicited response message is sent only in answer to a
request message. It contains information about the destination specified in the corresponding request message.
Link-State Routing
A routing algorithm that directly follows our discussion for creating least-cost trees and forwarding tables is link-
state (LS) routing. This method uses the term link-state to define the characteristic of a link (an edge) that
represents a network in the internet. In this algorithm the cost associated with an edge defines the state of the link.
Links with lower costs are preferred to links with higher costs; if the cost of a link is infinity, it means that the link
does not exist or has been broken.
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).
Each node can send some greeting messages to all its immediate neighbors (those nodes to which it is connected
directly) to collect two pieces of information for each neighboring node: the identity of the node and the cost of the
link. The combination of these two pieces of
information is called the LS packet (LSP)
Flooding
Each router sends link-state information out its links The next node sends it out through all of its links Except the
one where the information arrived
OSPF Messages – OSPF is a very complex protocol. It uses five different types of messages. These are as follows:
1. Hello message (Type 1) – It is used by the routers to introduce itself to the other routers.
2. Database description message (Type 2) – It is normally send in response to the Hello message.
3. Link-state request message (Type 3) – It is used by the routers that need information about specific Link-
State packet.
4. Link-state update message (Type 4) – It is the main OSPF message for building Link-State Database.
5.Link-state acknowledgement message (Type 5) – It is used to create reliability in the OSPF protocol.
Basic link state algorithm plus many features:
◆ Authentication of routing messages
◆Extra hierarchy: Partition into routing areas » “Border” router pretends to be directly connected to all routers in an
area (answers for them)
◆ Load balancing: Multiple equal cost routes
Path-Vector Routing
Path Vector Routing is a routing algorithm in unicast routing protocol of network layer, and it is useful for
interdomain routing. The principle of path vector routing is similar to that of distance vector routing. It assumes that
there is one node in each autonomous system that acts on behalf of the entire autonomous system is called Speaker
node .The speaker node in an AS creates a routing cable and advertises to the speaker node in the neighbouring
ASs
.A speaker node advertises the path, not the metrics of the nodes, in its autonomous system or other autonomous
systems
It is the initial table for each speaker node in a system made four ASs. Here Node A1 is the speaker node for AS1,
B1 for AS2, C1 for AS3 and D1 for AS4, Node A1 creates an initial table that shows A1 to A5 and these are located
The autonomous systems,however, are not categorized according to their size; they are categorized according to the
way they are connected to other ASs. We have stub ASs, multihomed ASs, and transient ASs.
Stub AS. A stub AS has only one connection to another AS. The data traffic can be either initiated or terminated in a
stub AS; the data cannot pass through it. A good example of a stub AS is the customer network, which is either the
source or the sink of data.
Multihomed AS. A multihomed AS can have more than one connection to other ASs, but it does not allow data
traffic to pass through it. A good example of such an AS is some of the customer ASs that may use the services of
more than one provider
network, but their policy does not allow data to be passed through them.
Transient AS. A transient AS is connected to more than one other AS and also allows the traffic to pass through.
The provider networks and the backbone are good examples of transient ASs.
Multicast Routing
Multicasting
In multicasting,
there is one source
and a group of
destinations. The
relationship is one
to many. In this
type of
communication, the source address is a unicast address, but the destination address is a group address, a group of one
or more destination networks in which there is at least one member of the group that is interested in receiving the
multicast datagram. The group address defines the members of the group.
St. Joseph’s College of Engineering / St. Joseph’s Institute of Technology Page 20 of 25
CS8591 / Computer Networks Department of CSE & IT 2019 - 2020
The idea is that each router helps to create the tree. To create a multicast tree rooted at the RP, PIM-SM uses join
and prune messages. First, three networks join group G1 and form a multicast tree. Later, one of the networks leaves
the group and the tree is pruned.
The join message is used to add possible new branches to the tree; the prune message is used to cut branches that
are not needed.
IPv6 ADDRESSING
The main reason for migration from IPv4 to IPv6 is the small size of the address space in IPv4. An IPv6 address is
128 bits or 16 bytes (octets) long, four times the address length in IPv4. An IPv6 address is 128 bits or 16 bytes
(octets) long, four times the address length in IPv4.
Abbreviation
Address Space
The address space of IPv6 contains 2128 addresses. This address space is 296 times the IPv4 address—definitely
no
address depletion—as shown, the size of the space is
Address Space Allocation
Like the address space of IPv4, the address space of IPv6 is divided into several blocks of varying size and each
block is allocated for a special purpose. Most of the blocks are still unassigned and have been set aside for future
use.
Packet Format
Each packet is composed of a base header followed by the payload. The base header occupies 40 bytes, whereas
payload can be up to 65,535 bytes of information. The description of fields follows.
Version. The 4-bit version field defines the version number of the IP. For IPv6, the value is 6.
❑Traffic class. The 8-bit traffic class field is used to distinguish different payloads with different delivery
requirements. It replaces the type-of-service field in IPv4.
❑Flow label. The flow label is a 20-bit field that is designed to provide special handling for a particular flow of
data. We will discuss this field later.
❑Payload length. The 2-byte payload length field defines the length of the IP datagram excluding the header. Note
that IPv4 defines two fields related to the length: header length and total length. In IPv6, the length of the base
header is fixed (40 bytes); only the length of the payload needs to be defined.
❑Next header. The next header is an 8-bit field defining the type of the first extension header (if present) or the
type of the data that follows the base header in the datagram. This field is similar to the protocol field in IPv4
❑ Hop limit. The 8-bit hop limit field serves the same purpose as the TTL field in IPv4.
❑Source and destination addresses. The source address field is a 16-byte (128-bit) Internet address that identifies
the original source of the datagram. The destination address field is a 16-byte (128-bit) Internet address that
identifies the destination of the datagram.
❑Payload. Compared to IPv4, the payload field in IPv6 has a different format and meaning, as shown in Figure
below.