0% found this document useful (0 votes)
2 views

Module 3 Computer Networks

Uploaded by

kiran
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Module 3 Computer Networks

Uploaded by

kiran
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 62

MODULE-3

• Network Layer: Network layer Services, Packet Switching,


IPv4 Address, IPv4 Datagram, IPv6 Datagram,
Introduction to Routing Algorithms, Unicast Routing
Protocols: DVR, LSR, PVR, Unicast Routing protocols: RIP,
OSPF, BGP, Multicasting Routing-MOSPF
• Textbook: Ch. 18.1, 18.2, 18.4, 22.2,20.1-20.3, 21.3.2
NETWORK-LAYER SERVICES
NETWORK-LAYER SERVICES
• Packetizing :
• The network layer has the primary responsibility of
packetizing.
• At the source Encapsulates data from the upper layer into
a network-layer packet.
• It adds a header with source/destination addresses then
passes the packet to the data-link layer.
• Routing and Forwarding
• Routing
• The network layer is responsible for routing the packet
from its source to the destination.
• The network layer is responsible for finding the best one
among these possible routes.
NETWORK-LAYER SERVICES
• Routing and Forwarding
• Forwarding
• Forwarding can be defined as the action applied by each
router when a packet arrives at one of its interfaces.
NETWORK-LAYER SERVICES
• Flow Control
• To control the flow of data, the receiver needs to send
some feedback to the sender to inform the latter that it is
overwhelmed with data.
• Congestion Control
• Congestion may occur if the number of datagrams sent by
source computers is beyond the capacity of the network
or routers.
• Quality of Service
• applications such as multimedia communication (audio
and video), the quality of service (QoS) of the
communication has become more and more important.
• Security
PACKET SWITCHING
• Datagram Approach: Connectionless Service
PACKET SWITCHING
• Datagram Approach: Connectionless Service
• When the network layer provides a connectionless
service, each packet traveling in the Internet is an
independent entity
• Each packet is routed based on the information contained
in its header: source and destination addresses.
PACKET SWITCHING
• Virtual-Circuit Approach: Connection-Oriented Service
• Before all datagrams in a message can be sent, a virtual
connection should be set up to define the path for the
datagrams.
PACKET SWITCHING
• Setup Phase
• Request packet
PACKET SWITCHING
• Setup Phase
• Acknowledgment Packet
PACKET SWITCHING
• Introduction to IPV4 Addressing
• In TCP/IP protocol suite to identify the connection of each
device to the Internet is called the Internet address or IP
address.
• An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a host.
• A protocol like IPv4 that defines addresses has an address
space.
• An address space is the total number of addresses used
by the protocol.
• IPv4 uses 32-bit addresses, which means that the address
space is 2^32 or 4,294,967,296 (more than four billion).
PACKET SWITCHING
• Introduction to IPV4 Addressing
• Notation
• There are three common notations to show an IPv4
address:
• 1. binary notation (base 2)
• 2. dotted-decimal notation (base 256)
• 3. hexadecimal notation (base 16).
PACKET SWITCHING
• Introduction to IPV4 Addressing
PACKET SWITCHING
• Hierarchy in Addressing
• A 32-bit IPv4 address is also hierarchical, but divided only
into two parts.
• The first part of the address, called the prefix, defines the
network.
• The second part of the address, called the suffix, defines
the node.
• The prefix length is n bits and the suffix length is (32 − n)
bits.
PACKET SWITCHING
• Hierarchy in Addressing
PACKET SWITCHING
• Classful Addressing
• When the Internet started, an IPv4 address was designed
with a fixed-length prefix.
• To accommodate both small and large networks, three
fixed-length prefixes were designed instead of one (n = 8,
n = 16, and n = 24).
• The whole address space was divided into five classes
(class A, B, C, D, and E).
PACKET SWITCHING
• Classful Addressing
PACKET SWITCHING
• Class A:
• Network length: 8 bits
• Since the first bit 0, defines the class A.
• Network identifier: 7 bits
• Total 2^7 = 128 networks in the world that can have a
class A address.
• Class B:
• Network length: 16 bits
• Since the first two bits 10, define the class B.
• Network identifier: 14 bits
• Total 2^14 = 16,384 networks in the world that can have a
class B address.
PACKET SWITCHING
• Class C:
• Network length: 24 bits
• Since the first three bits starts with 110 belong to class C.
• Network identifier: 21 bits
• Total 2^21 = 2,097,152 networks in the world that can
have a class C address.
• Class D is not divided into prefix and suffix. It is used for
multicast addresses.
• Class E is not divided into prefix and suffix and is used for
research or experimental purpose.
• Class A was intended for large networks, Class B for
medium-sized networks, and Class C for small networks.
PACKET SWITCHING
• Classless Addressing
• In classless addressing, variable-length blocks are used
that belong to no classes.
• The prefix in an address defines the network, the suffix
defines the node (device).
PACKET SWITCHING
• Classless Addressing
• Theoretically, number of addresses in a block needs to be
a power of 2.
• We can have a block of 2^0, 2^1, 2^2, . . . , 2^32
addresses.
• The size of the network is inversely proportional to the
length of the prefix.
• A small prefix means a larger network; a large prefix
means a smaller network.
PACKET SWITCHING
• Prefix Length: Slash Notation
• The first question that we need to answer in classless
addressing is how to find the prefix length if an address is
given.
• Since the prefix length is not inherent in the address, we
need to separately give the length of the prefix.
• In this case, the prefix length, n, is added to the address,
separated by a slash.
• The notation is informally referred to as slash notation.
PACKET SWITCHING
• Extracting Information from an Address
• Given any address in the block, we normally like to know
three pieces of information about the block to which the
address belongs:
• 1. The number of addresses
• 2. The first address in the block
• 3. The last address
PACKET SWITCHING
• Extracting Information from an Address
• A classless address is given as 167.199.170.82/27. We can
find the above three pieces of information as follows.
• The number of addresses in the network is 2^32 − n = 2^5
= 32 addresses.
PACKET SWITCHING
PACKET SWITCHING
• Dynamic Host Configuration Protocol (DHCP)
• Dynamic Host Configuration Protocol (DHCP) is an
application-layer protocol that helps assign IP addresses
automatically in a network.
• Assign **permanent IP addresses** to hosts and routers.
• Assign **temporary, on-demand IP addresses**, such as
providing a traveler with a temporary IP for Internet
access in a hotel.
PACKET SWITCHING
• DHCP Message Format
• DHCP is a client-server protocol in which the client sends a
request message and the server returns a response
message.
PACKET SWITCHING
• 1.DHCPDISCOVER: The host, needing an IP, sends a
DHCPDISCOVER message.
• The transaction-ID is set randomly, as the host doesn’t
know any network details.
• source IP as 0.0.0.0 (unknown host) and the destination
as 255.255.255.255 (broadcast).
• 2. DHCPOFFER: One or more DHCP servers respond with a
DHCPOFFER message.
• It includes the offered IP (in the your address field), the
server’s IP.
PACKET SWITCHING
• DHCPREQUEST: The host picks the best offer and replies
with a DHCPREQUEST message to that server, setting
known fields.

• DHCPACK: The chosen server responds with DHCPACK if


the offered IP is still valid.
PACKET SWITCHING
• Network Address Resolution (NAT)
• Network Address Translation (NAT) is a technology that
maps private addresses to universal (global) addresses.
• NAT allows a network to use private addresses internally
and one or more global addresses for external
communication.
• The network connects to the global Internet through a
NAT-enabled router.
• This router translates internal private addresses to the
global addresses as needed for communication with the
outside world.
PACKET SWITCHING
• Network Address Resolution (NAT)
PACKET SWITCHING
• Network Address Resolution (NAT)
• Address Translation
• Address Translation: Outgoing packets pass through the
NAT router, which replaces the private source address
with the global NAT address.
• For incoming packets, the NAT router replaces the global
destination address with the appropriate private address.
PACKET SWITCHING
• Network Address Resolution (NAT)
PACKET SWITCHING
• INTERNET PROTOCOL (IP)
PACKET SWITCHING
• INTERNET PROTOCOL (IP)
• 1. IPv4: The main protocol responsible for packetizing,
forwarding, and delivering packets.
• 2. ICMPv4: Assists IPv4 by handling network-layer error
messages.
• 3. IGMP: Helps with multicasting in IPv4.
• 4. ARP: Maps network-layer addresses (IP) to link-layer
addresses (MAC), connecting the network and data-link
layers.
PACKET SWITCHING
• IPv4 datagram format
PACKET SWITCHING
• IPv4 datagram format
• 1. **Header**: 20 to 60 bytes, containing key routing and
delivery information.
• 2. **Payload (data)**: The actual data being transmitted.
PACKET SWITCHING
• IPv4 datagram format
• Version Number (VER): 4 bits, identifies the IPv4 protocol
(value is 4).
• Header Length (HLEN): 4 bits, defines the total header length.
• Service Type: Originally called Type of Service (TOS).
• Total Length: 16 bits, gives the total datagram length (header
+ data) in bytes.
• Identification, Flags, Fragmentation Offset: Used for
fragmenting large datagrams.
• Time-to-Live (TTL): Controls how long a datagram can
circulate.
• Protocol: Identifies the protocol carried in the payload (e.g.,
TCP, UDP)
PACKET SWITCHING
• IPv6 datagram format
PACKET SWITCHING
• IPv6 datagram format
• Version: Indicates the IP version (6 for IPv6).
• Traffic Class: Differentiates payloads based on delivery
requirements.
• Flow Label: Provides special handling for specific data
flows.
• Payload Length: Defines the length of the data payload
Next Header: Specifies the type of the upper layer
protocol in a packet.
• Hop Limit: Similar to TTL in IPv4, limits the packet's
lifetime.
• Source and Destination Addresses: 128-bit addresses
identifying the origin and destination of the packet.
Path-Vector Routing
• Both link-state and distance-vector routing are based on
the least-cost goal.
• There are some routers in the internet that a sender
wants to prevent its packets from going through.
• For example, a router may belong to an organization that
does not provide enough security.
• or It may belong to a commercial rival of the sender.
• To respond to these demands, a third routing algorithm,
called path-vector (PV) routing has been devised.
Spanning Trees
• In path-vector routing, the path from a source to all
destinations is also determined by the best spanning tree.
Creation of Spanning Trees
Updating path vectors
UNICAST ROUTING PROTOCOLS
• Internet Structure
Routing Information Protocol (RIP)
• Basics of RIP
• It uses a distance-vector routing algorithm for
implementation.
• RIP routers calculate the cost of reaching a network,
based on hop count.
Routing Information Protocol (RIP)
• Forwarding table for RIP
Routing Information Protocol (RIP)
• RIP Message Format
Routing Information Protocol (RIP)
• Working of RIP Algorithm
• RIP Messages:
• Message Types: Two types – request and response.
• Request: A router requests information about routes.
• Response: Sent as a response to a request.
• Update Messages. The update messages in RIP have a
very simple format and are sent only to neighbors.
• Convergence of Forwarding Tables. RIP uses the distance-
vector algorithm.
• RIP allows only 15 hops in a domain.
Open Shortest Path First (OSPF)
• OSPF is based on the link-state routing algorithm.
• OSPF router monitors the link by using cost and then
floods the link state information to the other router in the
network
Open Shortest Path First (OSPF)
Open Shortest Path First (OSPF)
• Hello Message (Type 1): Introduces a router to neighbors
and lists known neighbors.
Open Shortest Path First (OSPF)
• Database Description Message (Type 2): Sent in response
to Hello to help a new router get the full LSDB.
Open Shortest Path First (OSPF)
• Link-State Request Message (Type 3): Requests
information about a specific link state.
Open Shortest Path First (OSPF)
• Link-State Update Message (Type 4): Main message to
build the Link State Data Base
Open Shortest Path First (OSPF)
• Link-State Acknowledgment Message (Type 5): Confirms
receipt of update messages for reliability.
Border Gateway Protocol Version 4 (BGP4)
• BGP4 is based on the path-vector algorithm.
• BGP is an exterior gateway protocol to send packet
between the Autonomous Systems to exchange network
information among BGP routers.
• BGP connection inside an AS is called internal BGP (i BGP)
and connections between different Ass are called external
BGP (e BGP)

Border Gateway Protocol Version 4 (BGP4)
Operation of External BGP (eBGP)
Operation of Internal BGP (iBGP)

You might also like