Unit III - NETWORK LAYER
Unit III - NETWORK LAYER
Unit III - NETWORK LAYER
DEPT. OF ECE
U21EC503 COMPUTER COMMUNICATION
NETWORKS
UNIT-I PHYSICAL LAYER
Dr.K.B.Gurumoorthy, Associate
Professor /ECE
COURSE OUTCOMES
Upon completion of the course, the student will be
able to
CO1: Solve the topology issues in physical layer
(Apply)
CO2: Model the error detection and correction
mechanism for data-link layer (Apply)
CO3: Implement suitable routing protocols for the
networks (Apply)
CO4: Examine the functions of transport layer protocols
(Analyze)
CO5: Compare the performance of different application
layer protocols (Analyze)
2
TEXT BOOKS &
REFERENCES
TEXT BOOKS:
1. J.F. Kurose, K.W. Ross, “Computer Networking: A Top-Down
Approach”, 5th edition, Addison-Wesley, 2017
2. Behrouz A Forouzan, “Data Communications and Networking”,
5th edition, Tata McGraw–Hill, New Delhi, 2015
REFERENCES:
1. William Stallings, “Data and Computer Communications”, 10th
edition, Pearson Education, 2013
2. Larry L. Peterson, Bruce S. Davie, “Computer Networks: A
Systems Approach”, 5th edition, Morgan Kaufmann Publishers Inc.,
2012
3. Ying-Dar Lin, Ren-Hung Hwang and Fred Baker, “Computer
Networks: An Open Source Approach”, 1st edition, McGraw Hill
Publisher, 2011
3
UNIT III NETWORK
LAYER
CO3: Implement suitable routing protocols
for the networks (Apply)
4
Topi
cs
• Internetworking
• IPv4 – Subnetting
• IPv6
• Distance vector (RIP)
• Link state (OSPF) routing algorithms
• Inter-domain Routing (BGP)
• Basics of IP support protocols (ARP,
RARP, DHCP, ICMP)
• Network address translation (NAT)
5
Internetworking
Internetworking
IP Address
A Numeric address
It is an Identifier for a computer or device on a network.
Every device has to an have IP address for
communication purposes.
Consists of two parts : Network Address & Host Address
Two types
IPv4 - Internet Protocol Version 4
IPv6 – Internet Protocol Version 6
Two devices on the Internet can never have the same
address at same time.
The IP addresses are unique and universal.
IPv4
IPv4 is the current version (not for long) of
IP addresses.
It is 32 bit address written four bytes
(octets) separated by periods.
Number Range from 0 -255.
Address Space
2power 32 = 4,294,967,296 possible unique
addresses (More than 4 billion)
Binary Notation and Dotted-
Decimal Notation
Binary notation
Class E
Reserved for future purposes
Two-Level Addressing
Network Mask
Used to extract the network address from the
destination address of a packet
Called a default mask
Classless Addressing
To overcome address depletion and give
more organizations access to the internet,
classless addressing was designed and
implemented.
CIDR : Classless Inter Domain Routing
The no of 1’s in the default mask is increase
to define the subnet mask.
Three-Level Addressing :
Subnetting
The organization that was granted a block in
class A or B needed to divide its large
network into several subnetworks for better
security and management
In subnetting, a network is divided into
several smaller subnetworks with each
subnetwork having its own subnetwork
address.
Its used to save wasted IP addresses
Network Mask and
Subnet Mask
Supernetting
Combine several class C blocks to create a
larger range of address
An organization that needs 1000 addresses can
be granted four class C blocks.
H5
10.0.1.2 10.0.1.3 10.0.1.2 10.0.1.3
213.168.112.3
10.0.1.1 10.0.1.1
Private network 1 Private network 2
Internet
Router/NAT Router/NAT
128.195.4.119 128.143.71.21
IPv6 Address
29
30 IPv6 Addressing
IPv6
IPv6 is the next generation of IP addresses.
128bit hexadecimal address.
Hexadecimal uses both numbers and alphabets
Each hexadecimal character represents 4 bits
Abbreviation
Mixed Notation
::130.24.24.18
CIDR Notation
33 IPv6 Addressing
IPv6 Address Space
128 bits (or 16 bytes) long: four times as long as its
predecessor.
2128 : about 340 billion billion billion billion different
addresses
Colon hexadecimal notation:
addresses are written using 32 hexadecimal digits.
digits are arranged into 8 roups of four to improve the
readability.
Groups are separated by colons
2001:0718:1c01:0016:020d:56ff:fe77:52a3
Note:
DNS plays an important role in the IPv6 world
(manual typing of IPv6 addresses is not an easy thing,
Some zero suppression rules are allowed to lighten this
task at least a little.
34 IPv6 Addressing
Types of IPv6 Addresses
Three Address Types : In IPv6, a destination
address can belong to one of three categories:
unicast, anycast,
and multicast
35 IPv6 Addressing
Unicast Address
36 IPv6 Addressing
Anycast Address
37 IPv6 Addressing
Multicast Address
38 IPv6 Addressing
Address Space Allocation
39 IPv6 Addressing
Global Unicast Addresses
40 IPv6 Addressing
Mapping for Ethernet MAC
41 IPv6 Addressing
Special Addresses
42 IPv6 Addressing
Autoconfiguration
One of the interesting features of IPv6
addressing is the autoconfiguration of hosts.
As we discussed in IPv4, the host and routers
are originally configured manually by the
network manager.
However, the Dynamic Host Configuration
Protocol, DHCP, can be used to allocate an IPv4
address to a host that joins the network.
In IPv6, DHCP protocol can still be used to
allocate an IPv6 address to a host, but a host
can also configure itself.
43 IPv6 Addressing
Renumbering
To allow sites to change the service provider,
renumbering of the address prefix (n) was built
into IPv6 addressing.
As we discussed before, each site is given a prefix
by the service provider to which it is connected. If
the site changes the provider, the address prefix
needs to be changed.
A router to which the site is connected can
advertise a new prefix and let the site use the old
prefix for a short time before disabling it. In other
words, during the transition period, a site has two
prefixes.
44 IPv6 Addressing
IPv4 Vs IPv6
Pros
Network Layer Security
Less Processing Overhead
Auto Configuration
No more NAT
No More Private Address Collisions.
Simpler Administration
Simpler Header Format
Built in Authentication and Privacy
Cons
Difficult to remember
Does not support old PCs
Occupy more spaces
Dual Stack approach must be configured manually if old
devices do not support IPv6
Routing Algorithms
Basics of IP support protocols (ARP,
RARP, DHCP, ICMP)
ARP & RARP
87
88
89
ARP and RARP
90
ARP
ARP associates an IP address with its physical address.
On a typical physical network, such as a LAN, each device
on a link is identified by a physical or station address that is
usually imprinted on the NIC.
91
ARP Packet
Network
Type - Ethernet
is type 1(16 bit)
Protocol Type-
IPv4=x0800
Hardware
Length:length of
Ethernet
Address (6)
Protocol
Length:length of
IPv4 address (4)
92
Encapsulating ARP Packet
93
ARP Cases
94
Exercise
A host with IP address 130.23.43.20 and physical address
B2:34:55:10:22:10 has a packet to send to another host
with IP address 130.23.43.25 and physical address
A4:6E:F4:59:83:AB (which is unknown to the first host).
The two hosts are on the same Ethernet network. Show the
ARP request and reply packets encapsulated in Ethernet
frames.
Sol
95
Cache Table
If ARP just resolved an IP address, chances are
a few moments later someone is going to ask
to resolve the same IP address
When ARP returns a MAC address, it is placed
in a cache. When the next request comes in
for the same IP address, look first in the cache
96
RARP
RARP finds the logical address for a machine that only
knows its physical address.
This if often encountered on thin-client workstations. No
disk, so when machine is booted, it needs to know its IP
address
RARP requests are broadcast, RARP replies are unicast.
97
RARP Packet
RARP Packet
98
ARP & RARP
Static IP address
Manually input by network administrator
Manageable for small networks
Requires careful checks to avoid duplication
Dynamic IP address
Assigned by server when host boots
Derived automatically from a range of
addresses
Duration of ‘lease’ negotiated, then address
released back to server
DHCP
Types of IP address
Assignment
Static IP address
Manually input by network administrator
Manageable for small networks
Requires careful checks to avoid duplication
Dynamic IP address
Assigned by server when host boots
Derived automatically from a range of
addresses
Duration of ‘lease’ negotiated, then address
released back to server
DHCP was created by the Dynamic Host
Configuration Working Group of the Internet
Engineering Task Force(IETF)
Runs over UDP
Utilizing ports:
67 – connections to server
68 – connections to client
Extension of BOOTP (protocol used for simple
interaction)-
DHCP enhances the capabilities of BOOTP
DHCP is basically used for dynamic configuration
Uses client–server model
Three Protocols for Dynamic IP
allocation
RARP ( Until 1985)
BOOTP (1985 – 1993)
DHCP (Since 1993)
DHCP Operation
(1) IP scope (0)
DHCP discover
MAC address
DHCP
CLIENT DHCP offer
IP#, lease time
DHCP DHCP
(2) SERVER DATABASE
DHCP request
IP#, MAC address
DHCP MAC address, IP#,
CLIENT DHCP ack
lease time
IP#, lease time
Cons
if DHCP server is down, all hosts are down
Types of Messages
ICMP encapsulation
Error-Reporting Messages:
Destination Unreachable.
Destination Unreachable:
Source Quench.
Source Quench:
Source Quench.
Source Quench:
Time Exceeded.
TimeExceeded :
1. The router that receives the datagram with value of 0 in TTL field
discards the datagram.
» At the time of discarding the datagram a time-exceeded
message must be sent by router to the original source.
Parameter Problem.
Parameter Problem:
Redirection.
Redirection:
» For efficiency reasons the host do not take part in the routing update
process, because there are many more hosts in the internet than the
routers.
» Updating the routing tables of hosts dynamically produces unacceptable
traffic.
» The hosts usually use static routing.
ICMP Types of Messages Error-Reporting Messages
Redirection.
Redirection:
» When a host comes-up, its routing table has a limited number of entries.
» It usually knows the IP address of one router, the default router.
» For this reason, the host may send a datagram, which is destined for
another network, the wrong router.
» In this case, the router that receives the datagram will forward the
datagram to correct router.
» However, to update the routing table of a host, it sends a redirection
message back to this host.
ICMP Types of Messages Error-Reporting Messages
Query:
» IPv4 has two-level address structure (netid and hostid) categorized into
five classes (A, B, C,D and E). The use of address is inefficient.
New Options:
» IPv6 has new options to allow for additional functionalities.
IPv6 Advantages over IPv4: