Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit III - NETWORK LAYER

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 144

1

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

01110101 10010101 00011101


11101010

32 bit address, or a 4 octet address or a


4-byte address

Decimal point notation


Classful Addressing
It uses the concept of classes
In classful addressing, the address space is divided
into five classes
 Class A address
 Class B address
 Class C address
 Class D address
 Class E address
In Classful addressing, a large part of the available
addresses were wasted.
In the mid-1990s, a new architecture, called
classless addressing, was introduced
Occupation of the
Address Space
Five classes
Finding the Class of an
Address
Netid and hostid of A, B,
and C Classes
Netid and Hostid are of varying lengths,
depending on the class of the address
Blocks in Class A
Only 1 byte in class A defines the netid
The leftmost bit should be ‘0’
Class A is divided into 27 = 128 blocks
Each block in class A contains 16,777,216
addresses
Blocks in Class B
2 bytes in class B define the class
The two leftmost bits should be ‘10’
Class B is divided into 214 = 16,384 blocks
Each block in class B contains 65,536
addresses
Blocks in Class C
3 bytes in class C define the class
The three leftmost bits should be ‘110’
Class C is divided into 221 = 2,097,152 blocks
Each block in class C contains 256 addresses
The Single Block in Class
D and E
Class D
Class D is designed for multicasting
Used to define one group of hosts on the
Internet

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

Supernet mask is the reverse of a subnet mask


Comparison of Subnet, Default, and
Supernet masks
Slash Notation
Notation of address including length of prefix

In classless addressing, we need to know one


of the addresses in the block and the prefix
length to define the block
Private Vs Public IP
Addresses
• Whatever connects directly into Internet must
have public (globally unique) IP address
• There is a shortage of public IPv4 address

• So Private IP addresses can be used within a


private network
• Three address ranges are reserved for private
usage
• 10.0.0.0/8
• 172.16.0.0/16 to 172.31.0.0/16
• 192.168.0.0/24 to 192.168.255.0/24

• A private IP is mapped to a Public IP, when the


machine has to access the Internet.
NAT
• NAT (Network Address Translation) Maps
Private IPs to Public IPs
• It is required because of shortage of IPv4
Address
H1 H2 H3 H4

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

Capable of producing over 340 undecillion


addresses.
32 IPv6 Addressing
IPv6 Representation

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

The ARP packet is encapsulated within an Ethernet 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

Encapsulation of 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

• Scope - a range of IP addresses


• IP lease - the IP# is assigned temporarily
DHCP Operation
DHCP Discover
Looks for a DHCP Server
DHCP Offer
The DHCP Server offers an Address
DHCP Request
The DHCP requests to lease the address
DHCP ACK
DHCP Server sends IP address to the host
Pros and Cons
Pros
 simplifies the task of assigning IP numbers to
each machine in the network
 makes easy to add, remove or move a host

 can assign defaults: default gateway, domain


name, DNS server, WINS server (if any) .
 ability to have fewer IP# than hosts

Cons
 if DHCP server is down, all hosts are down

 hard to keep information on free and used IP #


ICMP
ICMP

» IP has no built-in mechanism for error reporting and error-correction.


» What happen if something goes wrong?
» What happens if a router discard a datagram because it cannot find
a router to final destination?
» What happen if time-to-live field is zero?
» What happen if the final destination host must discard all fragments
of a datagram? because it has hot received all fragments within a
predetermined time-limit.
» IP also lacks a mechanism for host and management queries.
» A host some times needs to determine if a router or another host is
alive.
» Sometimes a network manager needs information from another host
or router.

» Internet Control Message Protocol (ICMP) has been designed to


compensate for the above two deficiencies of IP.
» ICMP does not correct errors , it simply reports them.
» ICMP is a companion to IP.
ICMP

Types of Messages
ICMP encapsulation

» ICMP itself is a network layer protocol.


» However its messages are not passes directly to data-link layer.
» The messages are first encapsulated inside IP data-grams before going
to the lower-layer as shown in Fig.20.12 below:

» The value of the protocol field in IP datagram is 1, as indication that the


IP data are an ICMP message.
ICMP  Types of Messages.

» ICMP messages are divided into two broad categories:

1. Error Reporting messages.


2. Query Messages.
ICMP  Types of Messages  Error-Reporting Messages:

Error-Reporting Messages:

» Although technology has produced increasingly reliable transmission


media, errors still exist and must be handled.
» As IP is not concerned with error-checking and error-control so ICMP
was designed to compensate this.
» However ICMP only REPORT errors, error CORRECTION is left to the
higher –level protocols.

» Error-Reporting messages are always sent to the original host because


the only information available in the the data-gram about the route is the
source and destination IP addresses.
» ICMP uses the source IP address to send the error message to the
source (originator) of the data-gram.
Note:

ICMP always reports error messages


to the original source.
Figure 20.13 Error-reporting messages

» 5 Types of errors are handled.


» Fig. 20.13 below shows them:
ICMP  Types of Messages  Error-Reporting Messages

Destination Unreachable.

Destination Unreachable:

» The router or the host sends a destination unreachable message back to


source host that initiated the datagram: when,
» The router cannot route a datagram or
» A host cannot deliver a datagram,
» The datagram is discarded.
ICMP  Types of Messages  Error-Reporting Messages

Source Quench.

Source Quench:

» IP connectionless protocol which uses, data-grams.


» Connectionless mechanism of IP results in lack of flow control and
congestion control.
» The lack of flow control can create a major problem in the operation of
source-destination delivery.
» The source host never knows if the destination host has been
overwhelmed with data-grams.
» The lack of congestion control creates a major problem in routers that
are supposed to forward the packets.
Note:

There is no flow control or congestion


control mechanism in IP.
ICMP  Types of Messages  Error-Reporting Messages

Source Quench.

Source Quench:

» The source-quench message in ICMP has been designed to a kind of


flow control and congestion control to IP.
» When a router or host discards a datagram due to congestion, it sends a
source-quenched message to sender of the datagram.
» This Source-quench message has two purposes:
1. It informs the source that the datagram has been discarded.
2. It warns the source that there is congestion somewhere in the path
and that the source should slow down (quench) the sending
process.
ICMP  Types of Messages  Error-Reporting Messages

Time Exceeded.

TimeExceeded :

» The time exceeded message is generated in two cases:

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.

2. When all fragments that make up a message do not arrive at the


destination host within host.
» So a time-exceeded message is generated.
ICMP  Types of Messages  Error-Reporting Messages

Parameter Problem.

Parameter Problem:

» An ambiguity in the header part of a datagram can create serous


problems as the datagram travels through the Internet.
» If a router or the destination host discovers an ambiguous or missing
value in any field of datagram.
» so in this case router discards the datagram ands sends a parameter-
problem message back to source.
ICMP  Types of Messages  Error-Reporting Messages

Redirection.

Redirection:

» When a router needs to send a packet destined for another network, it


must know the IP address of the next appropriate router.
» The same is true if the sender is a host.
» Both router and hosts must have a routing table to find the address of
the router or the next router.
» Router take part in the routing update process, and hosts are supposed
to be updated constantly.
» Routing is dynamic.

» 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. (Fig. 20.14 Query Messages)

Query:

» In addition to error reporting, ICMP can diagnose some network


problems.
» This is accomplished through query messages.
» In this type of ICMP messages, a node sends a message that is answered
in a specific format by the destination node.
» Fig. 20.14 below shows a group of four different pairs of messages.
ICMP  Types of Messages  Error-Reporting Messages

Query Echo Request And Reply:

Echo Request and Reply:

» Echo-Request and Echo-Reply messages are designed for diagnostic


purposes.
» Network managers and users utilize this pair of messages to identify
network problems.
» The combination of echo–request and echo-reply messages determines
whether two systems (hosts or routers) can communicate with each
other.
ICMP  Types of Messages  Error-Reporting Messages

Query Time-stamp Request and Reply:

Time-Stamp Request and Reply:

» Two machines (hosts or routers) can use time-stamp-request and time-


stamp-reply messages. To determine the round-trip time needed for an
IP datagram to travel between them.
» It can also be used to synchronize the clocks in two machines.
ICMP  Types of Messages  Error-Reporting Messages

Query Address Mask Request and Reply:

Address Mask Request and Reply:

» The IP address of a host contains a network address, subnet address,


and host identifier.
» A host may know it’s a full address, but it may not know which part of
the address defines the network and sub-network address and which
part corresponds to the host identifier.
» In this case, the host can sends an Address Mask Request Message to a
router.
» The router then sends a mask in an Address Mask Reply Message.
ICMP  Types of Messages  Error-Reporting Messages

Query Router Solicitation and Advertisement:

Router Solicitation and Advertisement:

» As a host that wants to send data to a host on another network needs to


know the address of routers connected to its own network.
» Also, the host must know if the routers are alive and functioning.
» The router-solicitation and router-advertisement messages can help in
this situation.
» A host can broadcast (or multicast) a router-solicitation message.
» The router or routers that receives the solicitation message broadcast
their routing information using the route-advertisement message.
» A router can also periodically send router-advertisement message even
if no host has solicited.

» Note that when a router sends out an advertisement, it announces not


only its own presence but also the presence of all routers on the
network of which is aware.
20.4 IPv4 (deficiencies)

» The network layer protocol in the Internet is currently IPv4.


» IPv4 provides the host-to-host communication between systems in the
Internet.
» Although IPv4 is well designed, data communications has evolved since
the inception of IPv4 in the 1970s.
» IPv4 has some deficiencies that make it unsuitable for the fast-growing
Internet, including:

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

» The Internet must accommodate real-time audio and video transmission.


This type of transmission requires minimum delays strategies and
reservation of resources not provided in IPv4 design.

» The Internet must accommodate encryption and authentication of data


for some applications. Originally, no security mechanism was provided
by IPv4.
20.4 IPv6 Evolution:

» To overcome these deficiencies , Internet Protocol, version 6 (IPv6), also


known as Internetworking protocol, next generation (IPng), was
proposed and is now a standard.
» The internet protocol was extensively modified to accommodate the
unforeseen growth of Internet.
» The format and length of IP addresses were changed along with the
packet format.
IPv6 Advantages over IPv4:

» The next-generation IP, or IPv6 has some advantages over IPv4:

Larger Address Space:


» An IPv6 address is 128 bits long.
» As compared to IPv4 which is 32-bit, so a huge increase in address
space (296 addresses).

Better Header Format:


» IPv67 has a new header format in which options are separated from base
header and inserted, when needed, between the base header and upper
layer-layer data.
» This simplifies and speeds up the routing process because most of the
options do not need to be checked by routers.

New Options:
» IPv6 has new options to allow for additional functionalities.
IPv6 Advantages over IPv4:

Allowance for extension:


» IPv6 is designed to allow the extension of the protocol if required by new
technologies and applications.

Support for Resource Application:


» In IPv6 the type-of-service field has been removed, but a mechanism
called flow label has been added.
» Flow label enables the source to request special handling of the packet.
» This mechanism can be used to support traffic such as real time audio
and video.

Support for more functionality:


» The encryption and authentication options in IPv6 provide confidentiality
and integrity of the packet.
NAT
133
134
135
136
137
138
139
140
141
142
143
Q and A

You might also like