0% found this document useful (0 votes)
8 views101 pages

Chapter 3

The document provides an overview of the network layer, detailing its functions such as packetizing, forwarding, routing, and logical addressing. It explains the differences between connection-oriented and connectionless communication, as well as the performance measures of the network layer including delay, throughput, and packet loss. Additionally, it covers Internet Protocol (IP) addressing, including IPv4 and IPv6, and the concepts of subnetting and classful addressing.

Uploaded by

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

Chapter 3

The document provides an overview of the network layer, detailing its functions such as packetizing, forwarding, routing, and logical addressing. It explains the differences between connection-oriented and connectionless communication, as well as the performance measures of the network layer including delay, throughput, and packet loss. Additionally, it covers Internet Protocol (IP) addressing, including IPv4 and IPv6, and the concepts of subnetting and classful addressing.

Uploaded by

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

Introduction to Network Layer

 It is the lowest layer that deals with delivering of individual


packet from source host to destination host.
1. The first duty of the network layer is packetizing:
encapsulating the payload in a network-layer packet at the
source and decapsulating the payload from the network-layer
packet at the destination.
2. Forwarding:- involves the transfer of a packet from an
incoming link to an outgoing link within a single router.
3. Routing:- involves all of a network’s routers, whose collective
interactions via routing protocols (algorithms) determine the
paths that packets take on their trips from source to destination
node.
4. Logical addressing: required if a packet passes the
, to distinguish the source and destination systems.
5. Best path selection:- Best path is selected by a routing protocol
based on the value or metric it uses to determine the distance to
reach a network.
Introduction cont….
6. Connection setup:
 Connection-oriented communication (virtual circuit network) and
 Connectionless communication (datagram network)
7.Store-and-Forward Packet Switching: A host with a
packet to send transmits it to the nearest router. The
packet is stored there until it has fully arrived and the link
has finished its processing by verifying the checksum.
 Then forwarded to the next router along the path until it reaches
the destination host, where it is delivered. This mechanism is
store-and-forward packet switching.
8. Security: network layer provide a security for a
connectionless service, for this purpose we need to have
another virtual level (IPsec) that changes the
connectionless service to a connection-oriented service.
Cont’d…
cont’d….
Services Provided to the Transport Layer:
 The services provided to the transport layer by the network
layer can be carefully designed by considering the
following transport layer requirements in mind:
1.The services should be independent of the router technology.
2.The transport layer should be shielded from the number,
type, and topology of the routers present.
3.The network addresses made available to the transport layer
should use a uniform numbering plan, even across LANs and
WANs.
 The network layer should provide connection oriented or
connectionless service to transport layer.
Connectionless and Connection-oriented
Communication
Comparison of Datagram and Virtual-Circuit Networks
Issue Datagram network Virtual-circuit network
Circuit Not needed Required
setup
Addressing Each packet contains the full Each packet contains a short VC
source and destination address number

State Routers do not hold state Each VC requires router table space
information information about connections per connection

Routing Each packet is routed Route chosen when VC is set up; all
independently packets follow it.
Effect of None, except for packets lost All VCs that passed through the
router during the crash failed router are terminated
failures
Quality of Difficult Easy if enough resources can be
service allocated in advance for each VC
Congestion Difficult Easy if enough resources can be
control allocated in advance for each VC
Network-Layer Performance Measures
 The performance of a network can be measured in terms of
delay, throughput, and packet loss (sometimes congestion
control can also be consider to improve the performance).
vThe delays in a network can be divided into four types:
1. Transmission delay=(Packet length) / (Transmission rate)
2. Propagation delay =(Distance) / (Propagation speed)
3. Processing delay =Time required to process a packet in a
router or a destination host
4. Queuing delay=The time a packet waits in input and output
queues in a router
⁃ Total delay = (n + 1) (Delay tr + Delay pg + Delay pr) +
(n) (Delay qu), by assuming the total number of router in
the middle equals to n.
Cont’d……
 Throughput is the number of bits passing through the
point in a second, which is actually the transmission rate of
data at that point.
 Another issue that severely affects the performance of
communication is the number of packets lost during
transmission.
 Throughput = minimum {TR1, TR2, . . . TRn}.
Introduction cont….
Router
Router cont….
 Two main router functions:
⁃ Forwarding datagrams from incoming to outgoing links
⁃ Run routing algorithms/protocols (e.g., RIP, OSPF, IGRP
and others).
Input ports
 An input port performs the following key functions:
⁃ It performs the physical layer function of terminating an incoming
physical link at a router.
⁃ An input port also performs link-layer functions needed to
interoperate with the link layer at the other side of the incoming link,
and
⁃ The lookup function is also performed at the input port. It is here that
the forwarding table is consulted to determine the router output port to
which an arriving packet will be forwarded via the switching fabric.
 Control packets (for example, packets carrying routing protocol
information) are forwarded from an input port to the routing
processor.
Switching fabric
vIt is the heart of the router, it can be used to forward data
from incoming port to outgoing port.
vSwitching fabric can be implemented in the following
ways: Switching via memory, Switching via bus and
Switching via interconnection network (Crossbar).
Output ports
 An output port stores packets received from the switching
fabric and transmits these packets on the outgoing link by
performing the necessary link-layer and physical-layer
functions.
 When a link is bidirectional, an output port will typically be
paired with the input port for that link on the same line card
(a printed circuit board containing one or more input ports,
which is connected to the switching fabric).
 Scheduling discipline chooses among queued datagrams for
transmission by considering the issues like:
⁃ Ordering (First Come First Served), Quality of Service
(QoS), fairness (protecting monopoly of resources).
Routing Processor
 The routing processor:
⁃ Executes the routing protocols (which we’ll study in the
next classes and demonstrated in the laboratory sessions),
⁃ Maintains routing tables (by sharing routing table
information among routers) and attached link state
information (dependent on the routing algorithm used),
and
⁃ Computes the forwarding table for the router
 It also performs the network management functions.
Internet Protocol (IP) and IP addressing
 As with any protocol standard, IP is specified in two parts:
1.The interface with a higher layer (TCP/UDP) - specifying
the services that IP provides – IP addressing
2.The actual protocol format and mechanisms
 IP basic characteristics:
⁃ Connectionless protocol - No connection is established before
sending data packets.
⁃ Best Effort (unreliable) - No overhead is used to guarantee
packet delivery.
⁃ Media Independent - Operates independently of the medium
carrying the data.
 There are two IP addressing method used in networking:-
1. Internet Protocol Version 4 (IPv4) is the first 32 bits
addressing method and
2. Internet Protocol Version 6 (IPv6) 128 bits addressing.
IP Header
IP header cont…..
 Version (4 bits): Indicates version number, to allow evolution of
the protocol; the value is 4.
 Header Length (4 bits): Length of header in 32-bit words. The
minimum value is five, for a minimum header length of 20
octets.
 Type of service: these bits were included in the IPv4 header to
allow different types of IP packets (reliability, precedence, delay,
and throughput parameters) to be distinguished from each other.
 Datagram Length (16 bits): it is total length of the datagram,
including header plus data, in octets (mostly less than or equal to
1500 bytes).
 Identifier, flags, fragmentation offset: these three fields have
to do with so-called IP fragmentation. The length of the
fragment (packet) is always dependent on the data link frame
size (i.e. Maximum Transmission Unit (MTU) of the current data
link protocol).
 Time-to-live (TTL): field is included to ensure that datagrams
do not circulate forever in the network. This field is decremented
by one each time the datagram is processed by a router. If the
TTL field reaches 0, the datagram must be dropped.
IP header cont……
 Protocol (8 bits): Indicates the next higher level protocol that
is to receive the data field at the destination; thus, this field
identifies the type of the next header in the packet after the IP
header. Example values are TCP = 6; UDP = 17 ; ICMP = 1.
 Header Checksum: An error-detecting code applied to the
header only.
 Source and Destination IP Address: Coded to allow a
variable allocation of bits to specify the network and the end
system attached to the specified network.
 The options parameter: it allows for future extensibility and
for inclusion of parameters that are usually not invoked. The
currently defined options are as follows:
⁃ Security, source routing, route recording, stream
identification and time-stamping.
 Padding (variable): Used to ensure that the datagram header
is a multiple of 32 bits in length.
 Data (variable): This field contains the data to be
transmitted in the datagram.
IPv4 Addressing
 IP address: it is a 32-bit identifier for host and router interfaces
(both physical and logical interfaces have an ip address).
 Interface is a boundary between the host and the physical link
in computer networking.
 An IP address is technically associated with an interface, rather
than with the host or router containing that interface.
 These addresses are typically written in so-called binary and
dotted-decimal notation, in which each byte of the address is
written in its decimal form and is separated by a period (dot)
from other bytes in the address. Dotted-decimal
notation and binary
Example:
notation for an IPv4
address
 These addresses cannot be chosen in a willy-nilly manner, however. A
portion of an interface’s IP address will be determined by the subnet
to which it is connected.
ÿ IPv4 uses 32-bit addresses, which means that the address space is 232
or 4,294,967,296 (more than 4 billion). This means that, theoretically,
if there were no restrictions, more than 4 billion devices could be
connected to the Internet. .
IPv4 Addressing cont…
Cont’d…
Rules for IPV4 Representation
vA mixture of binary notation and dotted-decimal notation is
not allowed.
vThere can be no more than four numbers.
vEach number needs to be less than or equal to 255.
vThere must be no leading zero .

Find the error, if any, in the following IPv4 addresses


Solution
a. There must be no leading zero (045).
b. There can be no more than four
numbers.
c. Each number needs to be less than or
equal to 255.
d. A mixture of binary notation and
dotted-decimal notation is not allowed.
Example 1
1. Change the following IPv4 addresses from binary notation
to dotted-decimal notation.

Solution
We replace each group of 8 bits with its equivalent decimal
number and add dots for separation.

Example 2: Change the following IPv4 addresses from


dotted-decimal notation to binary notation.

Solution
We replace each decimal number with its binary equivalent.
IPv4 Addressing cont’d….
Class full addressing
 Network Classes: the address is coded to allow a variable allocation of
bits to specify network and host. This encoding provides flexibility in
assigning addresses to hosts and allows a mix of network sizes on an
internet.
 In class full addressing, the address space is divided into five classes:
A, B, C, D, and E. Each class occupies some part of the address space.
 The three principal network classes are best suited to the following
conditions:
⁃ Class A: Few networks, each with many hosts
⁃ Class B: Medium number of networks, each with a medium number
of hosts
⁃ Class C: Many networks, each with a few hosts

• Network ID and Host ID


Example 4
Find class of the following IP addresses?
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution
a. The first bit is 0. This is a class A address.
b.The first 2 bits are 1; the third bit is 0. This is a class C address.
c. The first byte is 14; the class is A.
d.The first byte is 252; the class is E.
Classes and Blocks
 One problem with classful addressing is that each class is
divided into a fixed number of blocks with each block having
a fixed size .

Number of Blocks for class A = 27 Block size for class A = 224


Number of Blocks for class B = 214 Block size for class B = 216
Number of Blocks for class C = 221 Block size for class C = 28

 Block size = 2n where n is total number of host bit (suffix)


 Number of block = 2M-L where M is total number of network
bit and L is total number of common bit from network ID
IPv4 Addressing cont’d…..(CLA)
 The Internet’s address assignment strategy is known as Classless
Inter domain Routing (CIDR/Supernetting).
 CIDR generalizes the notion of subnet addressing.
 As with subnet addressing, the 32-bit IP address is divided into
two parts and again has the dotted-decimal form a.b.c.d/x (x is a
network prefix).
 The x most significant bits of an address of the form a.b.c.d/x
constitute the network portion of the IP address.
 The number of bits used in host portion determines the number
of hosts that we can have within the network.
 Types of Addresses in IPv4 Network
⁃ Network address ‐ The address by which we refer to the network
⁃ Broadcast address ‐ A special address used to send data to all hosts in the
network
⁃ Host addresses ‐ The addresses assigned to the end devices (including
router interfaces) in the network
 The size of the network is inversely proportional to the length of the
suffix. A small prefix means a larger network; a large prefix means a
smaller network.
Subnet and Network Prefixes (Subnet Masking)
 Subnetting is the process of splitting the larger network
into a number of smaller networks.
 Subnetting is the process of borrowing bits from the
HOST bits, in order to divide the larger network into small
subnets.
 Within the subnetted network, the local routers must route
on the basis of an extended network number consisting of
the network portion of the IP address and the subnet number.
 Because of Subnetting we get the following advantages:
⁃ Network traffic was reduced
⁃ Network performance become optimized
⁃ Network management become simple
⁃ Network supports large geographic area
⁃ It improves network organization , efficiency, maintenance &
security.
 The prefix length (x in the previous slide) is the number of
bits in the address that gives us the network portion.
Example
Subnet cont…
A. Dotted decimal and binary representations of IP address and
subnet masks

B. default subnet mask


Subnet cont…
How to Create Subnets
 To create a subnet answer the following questions:
⁃ How many subnets does the chosen subnet mask
produced?
• It can be calculated using 2n-dp, where n is the given
network prefix and dp is the default prefix for the given
class (i.e. class A, B or C) when IP address is a Classful IP
or dp is the network prefix given from ISP.
⁃ How many valid hosts per subnet are available?
⁕ It can be calculated using 232-n-2.
⁃ What are the valid subnets addresses?
⁃ What’s the broadcast address of each subnets?
⁃ What are the valid hosts in each subnet?
Subnet cont….
Example 1. Consider the following class C IP-address:
192.168.1.0/25 (255.255.255.128)
192.168.1.0 = Network address
255.255.255.128 = Subnet mask (i.e.
11111111.11111111.11111111.10000000)
 How many subnets?
⁃ Since 128 is 1 bit exceeded from the default 24 bits on (10000000),
the answer would be 225-24=21=2.
 How many hosts per subnet?
⁃ We have 7 (32-25) host bits off (10000000), so the equation would
be 27-2 = 126 hosts.
 What are the valid subnets?
⁃ 256-128 = 128. Remember, we’ll start at zero and count in our
block size, so our subnets are 0, 128.
Subnet cont…..
Example 1. cont……
 What is the broadcast address for each subnet?
 The number right before the next subnet address equals the
broadcast address. For the zero subnet 127 and for 128
subnet 255 are a broadcast addresses.
 What are the valid hosts? These are the numbers between
the subnet and broadcast address.

Subnet One Subnet Two

Subnet 0 128
First host 1 129
Last host 126 254
Broadcast 127 255
Subnet cont…..
Example 2. cont……
 A host has the IP address 194.20.5.103/27.
 What are the network address, broadcast address, and valid host
addresses for the IP subnet of which the host is a member of?
 what is the subnet mask in dotted-decimal notation?
 Question 3: What is the first valid host on the subnetwork that
the node 192.168.196.93/30 belongs to?

Subnet One Subnet Two

Subnet
First host
Last host
Broadcast
Subnet cont….
 Example 2: 168.22.0.0/20 (255.255.240.0) class B network
 Example 3: 42.0.0.0/10 (255.192.0.0) class A network
 Example 4: 172.26.0.0/23 (255.255.254.0) in a classless Ip-
address with /19 prefix.
 Example 5: 192.168.64.0/27 (255.255.255.224) in a
classless IP-address with /22 prefix.
 Example 6: A host has the IP address 198.22.45.183/26.
 What are the network address, broadcast address, and valid
host addresses for the IP subnet of which the host is a
member of?
 what is the subnet mask in dotted-decimal notation?
Classless Addressing
Restriction
• To simplify the handling of addresses, the Internet
authorities impose three restrictions on classless address
blocks:
1. The addresses in a block must be contiguous, one after another.
2. The number of addresses in a block must be a power of 2 (1, 2, 4,
8 .... ).
3. The first address must be evenly divisible by the number of
addresses.
First Address
⁕ The first address in the block can be found by setting the 32
- n rightmost bits in the binary notation of the address to 0s.
Example 5
 A block of addresses is granted to a small organization.
 We know that one of the addresses is 205.16.37.39/28.
 What is the first address in the block?
Solution
 The binary representation of the given address is
11001101 00010000 00100101 00100111
 If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010
or
205.16.37.32.
Last Address
The last address in the block can be found by setting the 32 -
n rightmost bits in the binary notation of the address to 1s.
Example 6
Find the last address for the block in Example 5.
Solution
 The binary representation of the given address is
11001101 00010000 00100101 00100111
 If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 0010
or
205.16.37.47
Number of Addresses
 The number of addresses in the block is the difference
between the last and first address.
 It can easily be found using the formula 232-n.
Example 7
 Find the number of addresses in Example 5.
Solution
 The value of n is 28, which means that number of
addresses is 2 32−28 or 16
Method II

 Another way to find the first address, the last address,


and the number of addresses is to represent the mask as
a 32-bit binary (or 8-digit hexadecimal) number.
F This is particularly useful when we are writing a program to
find these pieces of information.
F In the above example the /28 can be represented as:

(twenty-eight 1s and four 0s).


Find
a. The first address
b. The last address
c. The number of addresses.
Solution
a. The first address can be found by ANDing the given addresses
with the mask. ANDing here is done bit by bit. The result of
ANDing 2 bits is 1 if both bits are 1s; the result is 0 otherwise.

b. The last address can be found by ORing the given addresses


with the complement of the mask. ORing here is done bit by bit.
The result of ORing 2 bits is 0 if both bits are 0s; the result is 1
otherwise. The complement of a number is found by changing
each 1 to 0 and each 0 to 1.
Contd.

c. The number of addresses can be found by complementing


the mask, interpreting it as a decimal number, and adding
1 to it.
Subnet cont’d…..
Variable length subnet masking(VLSM)
Variable length subnet masking(VLSM)
Ø VLSM is a subnetting technique that allows network admins to
allocate IP addresses more efficiently using different subnet masks for
different network segments.
Ø It provides greater flexibility in assigning IP addresses by creating
subnets of varying sizes based on the specific needs and number of
hosts in each subnet.
Ø This technique helps reduce the waste of IP addresses and better
uses the available IP space.
Ø Steps to solve the problem:
1.Arrange the network form the largest to the smallest.
2.Pick a subnet for the largest network.
25 hosts
Subnet 1 2 4 8 16 32 64 128 256
Host 256 128 64 32 16 8 4 2 1
Subnet /24 /25 /26 /27 /28 /29 /30 /31 /32
Mask
Variable length subnet masking(VLSM)
Network ID Subnet Host Network
Mask
192.168.10.0 /27 32 25
192.168.10.32 /27 32 Unused
192.168.10.64 /27 32 Unused
192.168.10.96 /27 32 Unused
192.168.10.128 /27 32 Unused
192.168.10.160 /27 32 Unused
192.168.10.192 /27 32 Unused
192.168.10.224 /27 32 Unused

3. Pick the next largest network (repeats the process of step 2)


Example 7
Ø Suppose an organization is given the block 17.12.14.0/26,
which contains 64 addresses. The organization has three
offices and needs to divide the addresses into three sub
blocks of , , and addresses.
Ø We can find the new masks by using the following
arguments:
1.Suppose the mask for the first subnet is n1, then
must be 32, which means that .
2.Suppose the mask for the second subnet is n2, then
must be 16, which means that .
3.Suppose the mask for the third subnet is n3, then
must be 16, which means that .
Ø This means that we have the masks 27, 28, 28 with the
organization mask being 26.
Contd..
Read reserved IPV4
address range
Reserved IPv4 Address Ranges
 Multicast Addresses: it ranges 224.0.0.0 to
239.255.255.255.
 It is also subdivided into two types of addresses: reserved link
local addresses and globally scoped addresses.
⁃ The IPv4 multicast addresses 224.0.0.0 to 224.0.0.255 are
reserved link local addresses.
⁃ These addresses are to be used for multicast groups on a local
network. Packets to these destinations are always transmitted
with a time‐to‐live (TTL) value of 1.
⁃ The globally scoped addresses are 224.0.1.0 to
238.255.255.255.
⁃ They may be used to multicast data across the Internet.
⁃ For example, 224.0.1.1 has been reserved for Network Time
Protocol (NTP) to synchronize the time‐of‐day clocks of
network devices.
 Experimental Addresses: it ranges from 240.0.0.0 to
255.255.255.254. Currently, these addresses are listed as
reserved for future use.
Reserved IPv4 Address Range cont….
 Private Addresses: the address blocks belongs to this
category are:
 10.0.0.0 to 10.255.255.255 (10.0.0.0 /8)
 172.16.0.0 to 172.31.255.255 (172.16.0.0 /12)
 192.168.0.0 to 192.168.255.255 (192.168.0.0 /16)
 Default Route: it is used as a "catch all" route when a
more specific route is not available (0.0.0.0/8).
 Broadcast Address (255.255.255.255/32)
 Loopback (127.0.0.1/8) : the loopback is a special address
that hosts use to direct traffic to themselves.
Reserved IPv4 Address Range cont
 Link‐Local Addresses (Automatic Private IP
Addressing): the address block 169.254.0.0 to 169.254.255.255
(169.254.0.0 /16) are designated as link‐local addresses (private
DHCP address range).
 These addresses can be automatically assigned to the local host
by the operating system in environments where no IP
configuration is available (both static and dynamic IP address
assignments).
NOTE: When the device get ip-address either statically or
using a DHCP server link local address is automatically
replaced by this new address.
 TEST‐NET Addresses : the address block 192.0.2.0 to
192.0.2.255 (192.0.2.0 /24) is set aside for teaching and
learning purposes.
 These addresses can be used in documentation and network
examples.
 However, network devices will accept these addresses in their
configurations.
IPv6: Structure and Address Space
 The IP (IPv4) has been the foundation of the Internet and
virtually all multivendor private internetworks.
 This protocol is reaching the end of its useful life and a new
protocol, known as IPv6 (IP version 6), has been defined to
ultimately replace IP.
 The driving motivation for the adoption of a new version of IP
was the limitation imposed by the 32-bit address field in IPv4.
 With a 32-bit address field, it is possible in principle to assign
232 different addresses, which is over 4 billion possible addresses.
 Reasons for the inadequacy of 32-bit addresses include the
following:
⁃ This is convenient but wasteful of the address space. two-level
structure of the IP address
⁃ Networks are multiplying rapidly.
⁃ Growth of TCP/IP usage into new areas will result in a rapid
growth in the demand for unique IP addresses.
⁃ Multiple IP addresses are required for a single host.
IPv6 cont……
 IPv6 includes the following enhancements over IPv4:
⁃ Expanded address space: IPv6 uses 128-bit addresses.
⁃ Improved option mechanism: IPv6 options are placed in separate
optional headers that are located between the IPv6 header and the
transport-layer header. It also makes it easier to add additional
options.
⁃ Increased addressing flexibility: IPv6 includes the concept of an
anycast address in addition to the existing casting mechanisms in
IPv4 (i.e. Unicast, Multicast and Broadcast).
⁃ Support for resource allocation: IPv6 enables the labeling of
packets belonging to a particular traffic flow for which the sender
requests special handling. This aids in the support of specialized
traffic such as real-time video.
IPv6 Header

4- bits 8 -bits 20 -bits

16- bits 8- bits 8- bits

 The following fields are defined in IPv6:


⁃ Version: this 4-bit field identifies the IP version number.
⁃ IPv6 carries a value of 6(0110 sequence) in this field.
⁃ Traffic class: this 8-bit field is similar in spirit to the TOS field
we saw in IPv4.
⁃ Flow label: this 20-bit field is used to identify a flow (the
datagram that needs special treatments due to different reasons)
of datagrams. This is new, which is not in IPV4.
IPv6 Header cont……
 Payload length (16 bits): the number of bytes in the IPv6
datagram following the fixed-length datagram header.
 Next header: transport protocol to which the contents of this
datagram will be delivered.
 Hop limit: the total number of routers in transmission. If the
count reaches zero, the datagram is discarded.
 Source and destination addresses
 Data
 Several fields appearing in the IPv4 datagram are no longer
present in the IPv6 datagram:
⁃ Fragmentation/Reassembly: IPv6 does not allow for
fragmentation and reassembly at intermediate routers.
⁃ If an IPv6 datagram received by a router is too large to be
forwarded over the outgoing link, the router simply drops the
datagram and sends a “Packet Too Big” ICMP error message
back to the sender.
 Header checksum
 Options
IPv6 Addresses
 IPv6 addresses are 128 bits in length. Addresses are assigned to
individual interfaces on nodes, not to the nodes themselves.
 IPv6 allows three types of addresses:
⁃ Unicast: An identifier for a single interface.
⁃ Anycast: An identifier for a set of interfaces. A packet sent to an
anycast address is delivered to one of the interfaces identified by that
address (the “nearest” one, according to the routing protocols’
measure of distance).
⁃ Multicast: An identifier for a set of interfaces.
IPv6 Addresses cont.….
 IPv6 addresses are represented by treating the 128-bit address
as a sequence of 8 16-bit numbers, and representing this in the
form of eight hexadecimal numbers divided by colons, for
example:
2001:0DB8:0055:0000:CD23:0000:0000:0205
 One to three zeroes that appear as the leading digits in any
colon-delimited hexadecimal grouping may be dropped
(2001:0DB8:55:0:CD23:0:0:0205)
 A group of all zeroes, or consecutive groups of all zeroes, can
be substituted by a double colon, but this may only be done
once in an address.
⁃ Example:2001:DB8:55:0:CD23:0:0:0205 or 2001:DB8:55:0:CD23::205
⁕ Structure of IPv6
ipv6-address/prefix-length
 Prefix-length is a decimal value specifying how many of the
leftmost contiguous bits of the address comprise the prefix.
 Example: 2001:0DB8:55:0:CD23::0205/48 or ::/64 or
ABC::B:0:1234/80
Example 2

• Expand the address 0:15::1:12:1213 to its original.


Solution
• We first need to align the left side of the double colon to the
left of the original pattern and the right side of the double
colon to the right of the original pattern to find how many
0s we need to replace the double colon.

This means the original address is:


Internet Control Message Protocol (ICMP)
 ICMP provides a means for transferring messages from
routers and hosts each other.
 In essence, ICMP provides feedback about problems in the
communication environment.
 Examples: when a datagram cannot reach its destination, or
when the router does not have the buffering capacity to
forward a datagram.
 An ICMP message is sent in response to a datagram, either
by a router along the datagram’s path or by the intended
destination host.
 Although ICMP is, in effect, at the same level as IP in the
TCP/IP architecture, it is a user of IP.
 An ICMP message is constructed and then passed down to
IP, which encapsulates the message with an IP header and
then transmits the resulting datagram in the usual fashion.
ICMP cont….

 An ICMP message starts with a 64-bit header consisting of the


following:
⁃ Type (8 bits): Specifies the type of ICMP message.
⁃ Code (8 bits): Used to specify parameters of the message that
can be encoded in one or a few bits.
⁃ Checksum (16 bits): Checksum of the entire ICMP message.
⁃ Parameters (32 bits): Used to specify more lengthy
parameters.
ICMP cont….
 ICMP error report kinds:
⁃ The destination unreachable message covers a number of contingencies.
⁃ A router will return a time exceeded message if the lifetime of the
datagram expires.
⁃ A syntactic or semantic error in an IP header will cause a parameter
problem message.
⁃ The echo and echo reply messages (pinging and replaying the ping
message)provide a mechanism for testing that communication is possible
between entities.
ICMP cont.…..
 The source quench message provides a rudimentary form of
flow control.
 Either a router or a destination host may send this message to a
source host, requesting that it reduce the rate at which it is
sending traffic to the internet destination.
 A router sends a redirect message to a host on a directly
connected router to advise the host of a better route to a
particular destination.
 The timestamp and timestamp reply messages provide a
mechanism for sampling the delay characteristics of the internet.
 The address mask request and address mask reply messages
are useful in an environment that includes subnets.
 The address mask request and reply messages allow a host to
learn the address mask for the LAN to which it connects.
ICMPv6
 ICMPv6 is used by IPv6 nodes to report errors encountered in
processing packets, and to perform other internet-layer
functions, such as diagnostics (ICMPv6 "ping").
 ICMPv6 is an integral part of IPv6 and MUST be fully
implemented by every IPv6 node.
 ICMPv6 messages are grouped into two classes: error messages
and informational messages.

ICMPv6 error messages ICMPv6 informational


messages:
1 Destination Unreachable 128 Echo Request
2 Packet Too Big 129 Echo Reply
3 Time Exceeded
4 Parameter Problem
ICMPv6 cont…..
 The ICMPv6 packet consists of a header and the protocol
payload.
 The header contains only three fields: type (8 bits), code (8
bits), and checksum (16 bits).
 Type specifies the type of the message. Values in the range
from 0 to 127 (high-order bit is 0) indicate an error message,
while values in the range from 128 to 255 (high-order bit is 1)
indicate an information message.
 The code field value depends on the message type and
provides an additional level of message granularity.
 The checksum field provides a minimal level of integrity
verification for the ICMP message.
Address Mapping
 Logical address (IP address): it is a network address
uniquely identify networks in the wide area network.
 Physical address: it is a MAC (Medium Access Control)
address, which provides a physical address for a host port
attached to the LAN.
 To deliver an IP datagram to a destination host, a mapping
must be made from the IP address to the subnetwork
(MAC) address for that last hop.
 If a datagram traverses one or more routers between source
and destination hosts, then the mapping must be done in the
final router, which is attached to the same subnetwork as
the destination host.
 If a datagram is sent from one host to another on the same
subnetwork, then the source host must do the mapping.
Address Mapping cont….
 For this purpose, a number of approaches are possible, it
include:
⁃ Each system can maintain a local table of IP addresses and
matching subnetwork addresses for possible correspondents.
⁃ A centralized directory can be maintained on each subnetwork
that contains the IP-subnet address mappings.
⁃ An address resolution protocol can be used.
Address Resolution Protocol (ARP)
 ARP allows dynamic distribution of the information needed to
build tables to translate an IP address A into a 48-bit Ethernet
address; the protocol can be used for any broadcast network.
ARP exploits the broadcast property of a LAN.
 ARP works as follows:
1. Each system on the LAN maintains a table of known IP-subnetwork
address mappings.
2. When a subnetwork address is needed for an IP address, and the
mapping is not found in the system’s table, the system uses ARP
directly on top of the LAN protocol (e.g., IEEE 802) to broadcast a
request. The broadcast message contains the IP address for which a
subnetwork address is needed.
3. Other hosts on the subnetwork listen for ARP messages and reply
when a match occurs. The reply includes both the IP and subnetwork
addresses of the requested and replying host.
4. The original request includes the requesting host’s IP address and
subnetwork address. Any interested host can copy this information
into its local table, avoiding the need for later ARP messages.
5. The ARP message can also be used simply to broadcast a host’s IP
address and subnetwork address, for the benefit of others on the
subnetwork.
Internet Group Management Protocol (IGMP)
 IGMP interaction is limited to a host and its attached router, another
protocol is required to coordinate the multicast routers throughout the
Internet, so that multicast datagrams are routed to their final
destinations. This latter functionality is accomplished by network-
layer multicast routing algorithms.
 Network-layer multicast in the Internet thus consists of two
complementary components: IGMP and multicast routing protocols.
 IGMP has only three message types. IGMP messages are
encapsulated within an IP datagram, with an IP protocol number
of 2.
I. The membership query message is sent by a router to all hosts on an
attached interface to determine the set of all multicast groups that
have been joined by the hosts on that interface.
II.membership report messages can be used by the host to replay the
router message or joins a multicast group without waiting for a
membership query message.
III.The final type of IGMP message is the leave group message (this
message is optional).
 How does a router detect the host leaves the group? The router infers
that a host is no longer in the multicast group if it no longer responds
to a membership query message with the given group address.
Network Address Translation (NAT)
NAT cont….
 The basic idea behind NAT is for the ISP to assign each home or
business a single (few) public IP address(es) for Internet traffic.
 Within the customer network, every computer gets a unique IP address,
which is used for routing in the intranet traffic. However, just before a
packet exits the customer network and goes to the ISP, an address
translation from the unique internal IP address to the shared public IP
address takes place.
 This translation makes use of three ranges of IP addresses that have
been declared as private. The only rule is that no packets containing
these addresses may appear on the Internet itself.
 If all datagrams arriving at the NAT router from the WAN have the
same destination IP address, then how does the router know the
internal host to which it should forward a given datagram?
 The router uses a NAT translation table, and to include port numbers
as well as IP addresses in the table entries.
NAT cont….
 NAT has enjoyed widespread deployment in recent years. But it
has some limitations:
⁃ First port numbers are meant to be used for addressing
processes, not for addressing hosts.
⁃ Second routers are supposed to process packets only up to
layer 3.
⁃ Third the NAT protocol violates the so-called end-to-end
argument; that is, hosts should be talking directly with each
other, without interfering nodes modifying IP addresses and
port numbers.
⁃ Fourth it interferes with P2P applications, including P2P file-
sharing applications and P2P Voice-over-IP applications.
Example
Device IP Default Subnet
Address Gateway mask
Router L

Router R

Server 0

PC0

Laptop 0

Server 2

Laptop 1

Laptop 2
Routing and Routing Tables
• Routing is a process where the data has to be transmitted from source to
destination by taking the shortest path to transmit data from the source
to the destination efficiently.
• A routing table is a set of rules, often viewed in table format, that
determines where data packets traveling over a network will be directed.
 The basic components of each entry in the routing table are:
⁃ Destination address: this refers to the IP address of the destination
network.
⁃ Subnet mask/Netmask: this refers to the class or range of the destination
address. It’s used to map the destination address to the right network.
⁃ Gateway/Next Hop: this refers to the next IP address to which the packet
is forwarded.
⁃ Interface: this refers to the outgoing interface that connects to the
destination.
⁃ Metric: this assigns a value to each route to ensure that optimal routes are
chosen for sending packets. In some instances, the metric is the number of
hops or number of routers to be crossed to get to the destination network.
If multiple routes exist, the route with the lowest metric is usually chosen.
Routing Protocols and their classifications
§ Different routing protocols use different algorithms and
approaches to gather and disseminate routing information
about their area.
§ Routing protocols are classified into the following
categories:

Interior Vs. Exterior Routing Protocols


§ The routing protocols used within an autonomous
systema(AS) are called interior gateway protocols (IGPs),
and the ones used between ASs are called exterior
gateway protocols (EGPs).
Routing Protocols and their classifications..
• AS is essentially a collection of IP networks and routers under
the same administration that share a common routing strategy.
⁃ Example ISP
• IGPs provide information on reachable interior destinations to
the outside work
• Classified to distance vector routing and link state routing
protocols
• EGPs provide information on reachable exterior destinations to
the interior routers.
• EGPs are typically used between ISPs.
• Another difference between them is the route determination.
• IGPs choose the best path based on distance, delay, or
bandwidth.
• Therefore, how the metrics are used is an important design issue
for IGPs.
• EGPs choose routes commonly according to a routing policy.
⁕ IGP:- Within a single autonomous system
⁃ Single network administration
Routing Protocols and their classifications…
IGP:- Unique routing policy
FMake best use of network resource
FUsed for exchanging routing information between gateways
(hosts with routers) within an autonomous network.
Exterior Gateway Protocol (EGP):- Among different
autonomous systems
Independent administrative entities
Communication between independent network infrastructures
EGP is a protocol for exchanging routing information between
two neighbor gateway hosts (each with its own router) in a
network of autonomous systems.
EGP is commonly used between hosts on the Internet to
exchange routing table information.
Examples of an EGP:
 Border Gateway Protocol (BGP)
 Exterior Gateway Protocol (Replaced by BGP)
Contd.

Fig. 4.2.1. The Internet comprises a large number of autonomous systems


protocols

 Updates frequently
 Updates are event triggered
 Each router is "aware" of
 Each router is "aware" of all
only its immediate neighbors other routers in the "area"
 Slow convergence  Fast convergence
 Prone to routing loops  Less subject to routing loops
 Easy to configure  More difficult to configure
 Fewer router resources  More router resource
required intensive
 Updates require more  Updates require less
bandwidth bandwidth
 Does not "understand" the  Has detailed knowledge of
topology of the network distant networks and routers
Routing Algorithm
 It is the part of the network layer software responsible for
deciding which output line an incoming packet should be
transmitted on.
 If the network uses datagrams internally, this decision must be
made a new path for every arriving data packet.
 If the network uses virtual circuits internally, routing decisions
are made only when a new virtual circuit (sometimes called
session) is being set up.
 A host is attached directly to one router, the default router for the
host.
 The purpose of a routing algorithm is then simple: given a set of
routers, with links connecting the routers, a routing algorithm
finds a “good” path from source router to destination router.
 Typically, a good path is one that has the least cost/fastest/least
congested.
Routing Algorithm cont….
 The design of routing algorithm may have the following
properties into consideration: correctness, simplicity,
robustness, stability, fairness, and efficiency.
 Routing algorithms can be grouped into two major classes:
non-adaptive and adaptive.
ØNon-adaptive (static) algorithms
ØAdaptive (dynamic) algorithms
⁃ These dynamic routing algorithms differ in where they get
their information, when they change the routes, and what
metric is used for optimization.
 Others classify routing algorithms into: global or
decentralized, link-state or distance-vector and load sensitive
or load-insensitive.
Routing Algorithm cont….
The Optimality Principle
 It states that if router J is on the optimal path from router I to router K,
then the optimal path from J to K also falls along the same route.
 To see this, call the part of the route from I to J r1 and the rest of the
route r2.
 As a direct consequence of the optimality principle, we can see that the
set of optimal routes from all sources to a given destination form a tree
rooted at the destination. Such a tree is called a sink tree and is
illustrated in the next slide.
Shortest Path Algorithm
 The idea is to build a graph of the network, with each node of
the graph representing a router and each edge of the graph
representing a communication line, or link.
 To choose a route between a given pair of routers, the algorithm
just finds the shortest path between them on the graph.
 The concept of a shortest path deserves some explanation.
⁃ One way of measuring path length is the number of hops.
⁃ Another metric is the geographic distance in kilometers.
Flooding
 In this algorithm every incoming packet is sent out on every
outgoing line except the one it arrived on.
 Flooding obviously generates vast numbers of duplicate
packets, in fact, an infinite number unless some measures are
taken to damp the process.
⁃ One such measure is to have a hop counter contained in the
header of each packet that is decremented at each hop, with
the packet being discarded when the counter reaches zero.
⁃ Another technique for damming the flood is to have routers
keep track (sequence number)of which packets have been
flooded, to avoid sending them out a second time.
 It is effective for broadcasting information, tremendously robust
and requires little in the way of setup.
Flooding cont….
Hierarchical Routing
 As networks grow in size, the router routing tables grow
proportionally. It affects router memory, CPU time and
bandwidth to send status reports to others.
 At a certain point, it is no longer feasible for every router to
have an entry for every other router, so the routing will have to
be done hierarchically.
 When hierarchical routing is used, the routers are divided
regions.
 Each router knows all the details about how to route packets to
destinations within its own region but knows nothing about
other regions.
 When a single network becomes very large, an interesting
question is ‘‘how many levels should the hierarchy have?’’
Distance Vector Routing
 A distance vector routing algorithm operates by having each
router maintain a table (i.e., a vector) giving the best known
distance to each destination and which link to use to get there.
 These tables are updated by exchanging information with the
neighbors.
 In distance vector routing, each router maintains a routing table
indexed by, and containing one entry for each router in the
network.
 This entry has two parts:
⁃ The preferred outgoing line to use for that destination and
⁃ An estimate of the distance to that destination.
 The commonly used distance vector routing protocols are: RIP
(Routing Information Protocol), BGP (Border Gateway
Protocol), IGRP (Interior Gateway Routing Protocol) and the
original ARPAnet.
Distance Vector Routing cont….
Link State Routing
 The idea behind link state routing can be stated as five parts.
 Each router must do the following things to make it work:
1. Discover its neighbors and learn their network addresses.
2. Set the distance or cost metric to each of its neighbors.
3. Construct a packet telling all it has just learned.
4. Send this packet to and receive packets from all other routers.
5. Compute the shortest path to every other router.
 In effect, the complete topology is distributed to every router.
Link state cont….
Link State Routing cont…..
Learning about the Neighbors
 When a router is booted, its first task is to learn who its
neighbors are.
 It accomplishes this goal by sending a special HELLO packet
on each point-to-point line.
 The router on the other end is expected to send back a reply
giving its name.
Link State Routing cont…..
Setting Link Costs
 The link state routing algorithm requires each link to have a
distance or cost metric for finding shortest paths.
 The cost to reach neighbors can be set automatically, or
configured by the network operator.
 A common choice is to make the cost inversely proportional to
the bandwidth and distance gap between two routers of the link.
 The most direct way to determine this delay is to send over the
line a special ECHO packet that the other side is required to send
back immediately.
 By measuring the round-trip time and dividing it by two, the
sending router can get a reasonable estimate of the delay.
Link State Routing cont…..
Building Link State Packets
 Building the link state packets is easy.
 The hard part is determining when to build them.
 One possibility is to build them periodically, that is, at regular
intervals.
 Another possibility is to build them when some significant event
occurs, such as a line or neighbor going down or coming back up
again or changing its properties appreciably.
Link State Routing cont…..
Distributing the Link State Packets
 The trickiest part of the algorithm is distributing the link state
packets.
 All of the routers must get all of the link state packets quickly
and reliably.
 If different routers are using different versions of the topology,
the routes they compute can have inconsistencies such as loops,
unreachable machines, and other problems.
 The fundamental idea is to use flooding to distribute the link
state packets to all routers.
Computing the New Routes
 Once a router has accumulated a full set of link state packets, it
can construct the entire network graph because every link is
represented.
 Every link is, in fact, represented twice, once for each direction.
 The different directions may even have different costs.
 The shortest-path computations may then find different paths
from router A to B than from router B to A.
Link State Routing cont…..
 Compared to distance vector routing, link state routing requires
more memory and computation.
 For a network with n routers, each of which has k neighbors, the
memory required to store the input data is proportional to kn,
which is at least as large as a routing table listing all the
destinations.
 Also, the computation time grows faster than kn, even with the
most efficient data structures, an issue in large networks.
 Nevertheless, in many practical situations, link state routing
works well because it does not suffer from slow convergence
problems.
 The two commonly used link state routing protocols IS-IS
(Intermediate System-Intermediate System) and OSPF (Open
Shortest Path First).
Asynchronous Transfer Mode (ATM)
 ATM is a switching and multiplexing technology that employs
small, fixed-length packets called cells.
 A fixed-size packet makes switching and multiplexing efficient
and a small cell size was chosen to support delay-intolerant
interactive voice service.
 ATM is a connection-oriented packet-switching technology that
was designed to provide the performance of a circuit-switching
network and the flexibility and efficiency of a packet-switching
network.
 ATM was intended to provide a unified networking standard for
both circuit-switched and packet-switched traffic, and to support
data, voice, and video with appropriate QoS mechanisms.
 ATM is used by ISP to implement wide area networks.
 Many DSL implementations use ATM over the basic DSL
hardware for multiplexing and switching, and ATM is used as a
backbone network technology in numerous IP networks and
portions of the Internet.
ATM cont…..
ATM Logical Connections
 Virtual channel connections (VCCs) is analogous to a virtual
circuit; it is the basic unit of switching in an ATM network.
 A VCC is set up between two end users through the network, and
a variable-rate, full-duplex flow of fixed-size cells is exchanged
over the connection.
 VCCs are also used for user–network exchange (control
signaling) and network–network exchange (network management
and routing).
 A virtual path connection (VPC) is a bundle of VCCs that have
the same endpoints. Thus, all of the cells flowing over all of the
VCCs in a single VPC are switched together.
ATM cont….
 Advantages of using a virtual paths:
 Simplified network architecture
 Increased network performance and reliability
 Reduced processing and short connection setup time
 Enhanced network services
 Virtual Path/Virtual Channel Characteristics ITU-T
recommend the following as characteristics:
 Quality of service (QoS)
 Switched and semipermanent virtual channel connections
 Cell sequence integrity
 Traffic parameter negotiation and usage monitoring
 Virtual channel identifier restriction within a VPC (unique for
Virtual Path)
ATM Cell Format
ATM Cell Format cont…
 The Generic Flow Control (GFC): it can be used for control of cell
flow only at the local user–network interface. The field could be used
to assist the customer in controlling the flow of traffic for different
qualities of service. In any case, the GFC mechanism is used to
alleviate short-term overload conditions in the network.
 The virtual path identifier (VPI) constitutes a routing field for the
network. In the network cell allows support for an expanded number of
VPCs internal to the network, to include those supporting subscribers
and those required for network management. The virtual channel
identifier (VCI) is used for routing to and from the end user.
 The Payload Type (PT) field indicates the type of information in the
information field (the detail codes found in the next slide).
 The Cell Loss Priority (CLP) bit is used to provide guidance to the
network in the event of congestion. A value of 0 indicates a cell of
relatively higher priority, which should not be discarded unless no
other alternative is available. A value of 1 indicates that this cell is
subject to discard within the network.
 The Header Error Control (HEC) field is an 8-bit error code that can
be used to correct single-bit errors in the header and to detect double-
bit errors.
ATM Cell Format cont…..
Next Chapter IV

Transport Layer

You might also like