Chapter 4
Chapter 4
By - Sneha Nandanwar
NETWORK LAYER
⚫ The network layer is concerned with getting packets from the
source all the way to the destination.
⚫ Getting to the destination may require making many hops at
intermediate routers along the way.
⚫ The network layer is the lowest layer that deals with end-to-end
transmission.
⚫ To achieve its goals, the network layer must know about the
topology of the network (i.e., the set of all routers and links) and
choose appropriate paths through it, even for large networks.
⚫ It must also take care when choosing routes to avoid overloading
some of the communication lines and routers while leaving
others idle.
NETWORK LAYER SERVICES
⚫ Packetization- The network layer works on the conversion of
packets those received from its upper layer.
⚫ Logical Addressing-Maintains both the source and destination
addresses at the frame header. The network layer performs
addressing to find out the specific devices on the network.
⚫ Internetworking- It is possible as the physical and data link
layer work together to deliver the data packets from one node to
another node in the network.
⚫ Fragmentation
⚫ Routing & Forwarding- When packet reaches at the input of
the router, then the router should move the packet to an
appropriate link
PACKET SWITCHING
⚫ Packet switching is a method of transferring the data to a
network in form of packets.
⚫ In order to transfer the file fast and efficient manner over the
network and minimize the transmission latency, the data is
broken into small pieces of variable length, called Packet.
⚫ Bandwidth
⚫ Throughput
⚫ Latency
⚫ Jitter
⚫ Error Rate
IPv4 Addressing
⚫ IP stands for Internet Protocol and v4 stands for Version
Four (IPv4).
⚫ IPv4 was the primary version brought into action for
production within the ARPANET in 1983.
⚫ Each IPv4-based network must have the following:
⮚ A unique network number that is assigned by either an ISP,
an IR, or, for older networks, registered by the IANA. If you
plan to use private addresses, the network numbers you
devise must be unique within your organization.
⮚ Unique IPv4 addresses for the interfaces of every system on
the network.
⮚ IPv4 could be a 32-Bit IP Address.
IPv4 Address
⚫ The IPv4 address is a 32-bit number that uniquely identifies
a network interface on a system.
⮚ Here, the data is sent to all the devices in the network, i.e.,
multiple hosts.
⮚ Broadcast is possible also on the underlying data link layer in
Ethernet networks.
⮚ Frames are addressed to reach every computer on a given
LAN segment if they are addressed to MAC address
FF:FF:FF:FF:FF:FF.
⮚ Ethernet frames that contain IP broadcast packages are
usually sent to this address.
⮚ Multicast Addressing Mode
Classful Addressing
Limitation
Internet uses class A, B, and C addresses.
⚫ First IP Address of the block must be divisible by the size of the block.
CLASSLESS ADDRESSING
CIDR Notation-
⚫ IPv4 Address:167.199.170.82/27
⚫ Prefix= 27 Suffix=32-27=5
⚫ N=232-n
=232-27
=25
=32
IPv4 HEADER FORMAT
IPv4 HEADER FORMAT
⚫ Version − Version no. of Internet Protocol used (e.g. IPv4).
⚫ Source Address − 32-bit address of the Sender (or source) of the packet.
the packet.
greater than 5. These options may contain values for options such as
Security, Record Route, Time Stamp, etc.
Dynamic Host Configuration Protocol
(DHCP)
⚫ Dynamic Host Configuration Protocol (DHCP) is a networking
protocol for dynamically assigning IP addresses to each host
on your organization's network.
⚫ File-Name of the file for the client to request from the next server
(for example the name of the file that contains the operating
system for this client).
NETWORK ADDRESS
TRANSLATION (NAT)
⚫ To access the Internet, one public IP address is needed, but we
can use a private IP address in our private network.
⚫ The idea of NAT is to allow multiple devices to access the
Internet through a single public address.
⚫ To achieve this, the translation of private IP address to a public
IP address is required.
⚫ Network Address Translation (NAT) is a process in which one
or more local IP address is translated into one or more
Global IP address and vice versa in order to provide Internet
access to the local hosts.
NETWORK ADDRESS
TRANSLATION (NAT)
⚫ Generally, the border router is configured for NAT i.e the router
which has one interface in local (inside) network and one
interface in the global (outside) network.
⚫ When a packet traverse outside the local (inside) network,
then NAT converts that local (private) IP address to a global
(public) IP address.
⚫ When a packet enters the local network, the global (public) IP
address is converted to a local (private) IP address.
⚫ If NAT run out of addresses, i.e., no address is left in the pool
configured then the packets will be dropped and an Internet
Control Message Protocol (ICMP) host unreachable packet to the
destination is sent.
NETWORK ADDRESS
TRANSLATION (NAT)
NETWORK ADDRESS
TRANSLATION (NAT)
DISTANCE VECTOR ROUTING
ALGORITHM
⚫ Distance vector algorithms are based on the work done of R. E.
Bellman, L. R. Ford, and D. R. Fulkerson and for this reason
occasionally are referred to as Bellman-Ford or Ford-
Fulkerson algorithms.
⚫ The name distance vector is derived from the fact that routes are
advertised as vectors of (distance, direction), where distance is
defined in terms of a metric and direction is defined in terms of
the next-hop router.
⚫ A typical distance vector routing protocol uses a routing
algorithm in which routers periodically send routing updates to
all neighbors by broadcasting their entire route tables.
⚫ It is mainly used in ARPANET and RIP.
DISTANCE VECTOR ROUTING
ALGORITHM
Bellman-Ford Algorithm
Define distances at each node X
◆ dx(y) = cost of least-cost path from X to Y
Update distances based on neighbors
◆ dx(y) = min {c(x,v) + dv(y)} over all neighbors V
v 2 y
3 1
1
u
x 4 z
2 1
5 t du(z) = min{c(u,v) + dv(z),
w4 3
s c(u,w) + dw(z)}
49
DISTANCE VECTOR ROUTING
ALGORITHM
Each node:
Distance Vector Algorithm
Iterative, asynchronous: each wait for (change in local link
local iteration caused by: cost or message from
neighbor)
Local link cost change
Distance vector update
message from neighbor
recompute estimates
Distributed:
Each node notifies neighbors if distance to any destination
only when its DV changes has changed, notify
Neighbors then notify their neighbors
neighbors if necessary
50
DISTANCE VECTOR ROUTING
ALGORITHM
STEP BY STEP WORKING
c(x,v) = cost for direct link from x to v
◆ Node x maintains costs of direct links c(x,v)
router within the AS has a complete picture of the topology of the AS.
⚫ This picture is then used to calculate end-to-end paths through the AS,
⚫ Virtual link: If the link between the two routers is broken, the
administration creates the virtual path between the routers, and
that path could be a long one als
BORDER GATEWAY PROTOCOL
⚫ BGP is like a glue that helps connect the Internet together. It
is an inter-domain routing protocol that is used between
two autonomous systems.
⚫ BGP is a path vector protocol where granularity of information
is at an IP prefix level, served by autonomous systems.
⚫ The protocol can connect together any internetwork of
autonomous system using an arbitrary topology.
⚫ The only requirement is that each AS have at least one router that
is able to run BGP and that is router connect to at least one other
AS’s BGP router.
BORDER GATEWAY PROTOCOL
BORDER GATEWAY PROTOCOL
BORDER GATEWAY PROTOCOL
IPv6
⚫ Internet Protocol version 6 (IPv6) is the latest revision of the
Internet Protocol (IP) and the first version of the protocol to be
widely deployed.
⚫ IPv6 was developed by the Internet Engineering Task Force
(IETF) to deal with the long-anticipated problem of IPv4 address
exhaustion.
⚫ IP v6 is 128-bits address having an address space of 2^128,
which is way bigger than IPv4.
⚫ The IPv6 protocol can handle packets more efficiently, improve
performance and increase security.
⚫ It enables internet service providers to reduce the size of their
routing tables by making them more hierarchical.
IPv6
IPv6 Addressing
•An IPv6 address consists of 16 bytes (octets)
•Thus an IPv6 address is 128 bits long
• It uses hexadecimal colon notation.
• In this notation 128 bits is divided into eight sections. Each section is
2 bytes long.
• Two bytes in hexadecimal notation require four hexadecimal digits.
Thus, the address consists of 32 hexadecimal digits, with every four
digits separated by a colon.
IPv6
IPv6
Abbreviation
⚫ We can also write the IP address in abbreviated form.
⚫ This can be done by omitting the leading zeros of a section (four
digits between two colons)
⚫ In such a form, only leading zero can be omitted and not the
trailing zeros.
⚫ Using this form of abbreviation, 0074 can be written as 74, 000F
as F, and 000 as 0.Note 3210 cannot be abbreviated.
⚫ Further abbreviations are also possible if there are consecutive
sections consisting of zeros only. Using this scheme, zeros can
be removed altogether and can be replaced with a double colon.
IPv6 Addresses
IPv6 Addresses
IPv6 Addresses
Anycast-
⚫ IPv6 has introduced a new type of addressing, which is called
Anycast addressing.
⚫ In this addressing mode, multiple interfaces (hosts) are assigned
same Anycast IP address.
⚫ When a host wishes to communicate with a host equipped with
an Anycast IP address, it sends a Unicast message.
⚫ With the help of complex routing mechanism, that Unicast
message is delivered to the host closest to the Sender in terms of
Routing cost.
IPv6 Addresses Space
TRANSITION FROM IPv4 to IPv6
TRANSITION FROM IPv4 to IPv6