0% found this document useful (0 votes)
12 views96 pages

Unit 4

Uploaded by

kuinkelpratik69
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)
12 views96 pages

Unit 4

Uploaded by

kuinkelpratik69
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/ 96

Network Layer Functions

• Path determination: route taken by packets from source to


destination (Routing Algorithm)
• Forwarding: more packets from router’s input to appropriate router
output
• Call setup: some n/w architectures require router cell setup along the
path before data flows
Forwarding and Routing
Network Layer Services
• Guaranteed delivery
• Guaranteed delivery with bounded delay
• In-order packet delivery
• Guaranteed minimal bandwidth
• Guaranteed maximum jitter
• Security services
Transport Vs Network Layer Service
• In transport layer, it is process to process service. But,
in network layer, it host to host service
• In all computer network architectures up to now
(internet, ATM, frame relay, and so on), the network
layer provides either a host to host connection service
or host to host connectionless service but not both
• Connection oriented service in transport layer is
implemented at the edge of the network in the end
systems, however, the network layer connection
service is implemented in the network core as well as
the end system
Connection-oriented and
Connectionless Services
Connection Oriented Service
• Based on Telephone System
• Establish Connection, Use Connection and Release
the Connection
• Packets are sent on same path in sequential order
• A packet is logically connected to the packet traveling
before it and to the packet traveling after it
• The decision about the route of a sequence of packets
with the same source and destination addresses can
be made only once
• This type of service is used in a virtual-circuit
approach to packet switching such as in Frame Relay
and ATM
Virtual-Circuit Network
A VC consists of
• A path
• VC numbers
• Entries in the forwarding table in each router along the path
3 Identifiable phases in a virtual circuit:
• VC setup
• Data transfer
• VC teardown
Virtual-Circuit Network
Virtual-Circuit
Signaling Protocols
• The messages that the end systems send into the network to initiate
or terminate a VC, and the messages passed between the routers to
set up the VC (that is, to modify connection state in router tables) are
known as signaling messages, and the protocols used to exchange
these messages are often referred to as signaling protocols.
Connection Less Service
• Connectionless service is modeled after the postal
system
• Computer networks that provide only a
connectionless service at the network layer are called
datagram networks
• In connectionless service, the network layer protocol
treats each packet independently, with each packet
having no relationship to any other packet
• The packets in a message may or may not travel the
same path to their destination
• This type of service is used in the datagram approach
to packet switching
Datagram
• Packets in the IPv4 layer are called datagrams
• Datagram is handled independently, and each
datagram can follow a different route to the
destination
• In a datagram network, each time an end system
wants to send a packet, it stamps the packet with the
address of the destination end system and then pops
the packet into the network
Datagram Networks
Datagram Networks

11001000 00010111 00010110 10100001


11001000 00010111 00011000 10101010
The Internet Protocol (IP)
Internet Protocol (IP)
• IPv4 is an unreliable and connectionless datagram
protocol-a best-effort delivery service
• The Internet Protocol version 4 (IPv4) is the delivery
mechanism used by the TCP/IP protocols
• IPv4 provides no error control or flow control
• IPv4 assumes the unreliability of the underlying layers and
does its best to get a transmission through to its
destination, but with no guarantees
• If reliability is important, IPv4 must be paired with a
reliable protocol such as TCP
• IPv4 is also a connectionless protocol for a packet-
switching network that uses the datagram approach
IP Operations
• Defines a packet and an addressing scheme
• Transfers data between the internet layer and network access layer
• Routers packets to remote hosts
• The main function of IP is forwarding and addressing in the internet
Datagram Format
Fragmentation - MTU
• Not all network access layer protocols can carry packets of
the same size. Some protocols can carry big packets and
other protocols can carry small packets
• Each router decapsulates the IPv4 datagram from the
frame it receives, processes it, and then encapsulates it in
another frame
• The format and size of the sent frame depend on the
protocol used by the physical network through which the
frame is going to travel
• When a datagram is encapsulated in a frame, the total
size of the datagram must be less than this maximum size,
which is defined by the restrictions imposed by the
hardware and software used in the network (MTU)
IP Datagram Fragmentation
Classful Addressing
Techniques to reduce address
shortage in IPv4
• Subnetting
• Classless Inter Domain Routing (CIDR)
• Network Address Translation (NAT)
Subnetting
• Three-level hierarchy: network, subnet, and host.
• The extended-network-prefix is composed of the classful
network-prefix and the subnet-number
• The extended-network-prefix has traditionally been identified
by the subnet mask

Network-Prefix Subnet-Number Host-Number


Subnetting Example
128.10.1.1
H1 128.10.1.2
H2
Sub-network 128.10.1.0

Internet G
All traffic
to 128.10.0.0
128.10.2.1
H3 128.10.2.2
H4
Net mask 255.255.0.0

Sub-network 128.10.2.0

Subnet mask 255.255.255.0


Classless Inter-Domain Routing
• Eliminates traditional classful IP routing.
• Supports the deployment of arbitrarily sized networks
• Routing information is advertised with a bit mask/prefix length
specifies the number of leftmost contiguous bits in the network portion of each routing table
entry
• Example: 192.168.0.0/21
• sometimes called supernetting
Network Address Translation
• Each organization- single IP address
• Within organization – each host with IP unique to the
organization, from reserved set of IP addresses

3 Reserved ranges
10.0.0.0 – 10.255.255.255 (16,777,216 hosts)

172.16.0.0 – 172.31.255.255/12 (1,048,576


hosts)

192.168.0.0 – 192.168.255.255/16 (65,536


hosts)
NAT Example

Source Source NAT Router's


Source NAT Router's
Computer's Computer's Assigned
Computer IP Address
IP Address Port Port Number

A 10.0.0.1 400 24.2.249.4 1

B 10.0.0.2 50 24.2.249.4 2

C 10.0.0.3 3750 24.2.249.4 3

D 10.0.0.4 206 24.2.249.4 4


Network Address Translation (NAT)
IPv4 Addressing
Address Resolution Protocol (ARP)
ICMP
• The internet protocol is connectionless-mode
protocol, and as such, it has no error reporting and
error-correcting mechanisms. It relies on a module
called the Internet control message protocol (ICMP)
to;
a. Reports errors on the processing of a
datagram
b. Provide for some administrative and
status messages.
ICMP Message Types
a) The error-reporting messages report problems that a router or a
host (destination) may encounter when it processes an IP packet
b) The query messages, which occur in pairs, help a host or a network
manager get specific information from a router or another host
Message Format
Error Reporting
Query
Comparison of Network Layer in v4 and v6
Routing
• The term routing refers to taking a packet from one device and
sending it through the network to another device on a different
network
• Routers don’t really care about hosts
• They only care about networks and the best path to each network
To be able to route packets, a router must
know
• Destination address
• Neighbor routers from which it can learn about remote network.
• Possible routers to all remote network.
• The best route to each remote network.
• How to maintain and verify routing information.
Static Routing
• Providing ease of routing table maintenance in smaller networks that
are not expected to grow significantly
• Using a single default route, used to represent a path to any network
that does not have a more specific match with another route in the
routing table
Advantages of Static Routing
• Minimal CPU processing
• Easier for administrator to understand
• Easy to configure
Disadvantages of Static Routing
• Configuration and maintenance are time-consuming.
• Configuration is error-prone, especially in large networks.
• Administrator intervention is required to maintain changing route
information.
• Does not scale well with growing networks; maintenance becomes
cumbersome.
• Requires complete knowledge of the entire network for proper
implementation
Dynamic Routing
• A routing protocol is a set of processes, algorithms, and messages
that are used to exchange routing information and populate the
routing table with the routing protocol’s choice of best paths
Purpose of Dynamic Routing
• Discovering remote networks
• Maintaining up-to-date routing information
• Choosing the best path to destination networks
• Having the ability to find a new best path if the current path is no
longer available
Advantages of Dynamic Routing
• Administrator has less work in maintaining the configuration when
adding or deleting networks.
• Protocols automatically react to the topology changes.
• Configuration is less error-prone.
• More scalable; growing the network usually does not present a
problem.
Disadvantages of Dynamic Routing
• Router resources are used (CPU cycles, memory, and link bandwidth).
• More administrator knowledge is required for configuration,
verification, and troubleshooting.
Popular Routing Protocols
Metrics
• The most fundamental functionality in a dynamic
routing protocol:
– Find the ”best path” to a destination
• But what is best path?
– Interior routing: typically number of hops, or
bandwidth
– Exterior routing: business relations – peering
• Metrics
– Number of “hops” (most common)
– Bandwidth, Delay, Cost, Load, ”Policies”
The Distance-Vector protocol
• Each router sends a list of distance-vectors (route with cost) to each
neighbor periodically
• Every router selects the route with smallest metric.
• Metric is a positive integer
– The cost to reach a destination: number of hops
– Hop-count is limited to 1-15, 16 is “infinity”
Its implementation
• Keep a table with an entry for each destination N in the network.
• Store the distance D and next-hop G for each N in the table.
• Periodically, send the table to all neighbors (the distance-vector).
• For each update that comes in from neighbor G':
– Add the cost of the network to the new distance D'.
– Replace the route if D' < D.
– If G = G', replace the route.
Routing Information Protocol - RIP
• RIP-1 (RFC 1058), RIP-2 (RFC 2453)
• RIP uses Bellman-Ford to calculate routes
• Metric is hop counts
– 1: directly connected
– 16: infinity
– RIP cannot support networks with diameter > 14
• RIP uses distance vector
• RIP messages are carried via UDP datagrams.
– IP Multicast (RIP-2) or Broadcast (RIP-1)
RIP Problem: Count to Infinity
RIP Problem: Count to Infinity
Split Horizon
Split Horizon + Poison Reverse
Remaining problems
Triggered Update
Hold Down
Disadvantages with RIP
• Slow convergence
– Changes propagate slowly
– Each neighbor only speaks ~every 30 seconds; information
propagation time over several hops is long
• Instability
– After a router or link failure RIP takes minutes to stabilize.
• Hops count may not be the best indication for which is the best route.
• The maximum useful metric value is 15
– Network diameter must be less than or equal to 15.
• RIP uses lots of bandwidth
– It sends the whole routing table in updates.
Why would anyone use RIP?
• After all these problems you might ask this question.
• Answer
– It is easy to implement
– It is generally available
– Implementations have been rigorously
tested
– It is simple to configure.
– It has little overhead (for small networks)
Link-state routing
• Each router spreads information about its links to its neighbors.
• This information is flooded to every router in the routing domain so
that every router has knowledge of the entire network topology.
• Using Dijkstra's algorithm, the shortest path to each prefix in the
network is calculated
Link State Routing
Router must do following five things:
• Discover its neighbors and learn their network addresses
• Set the distance or cost metric to each of its neighbors
• Construct a packet telling all it has just learned
• Send this packet to and receive packets from all other routers
• Compute the shortest path to every other router
Comparison with Distance-vector
• Link-state uses a distributed database model
• Distance-vector uses a distributed processing model
• Link-state pros:
– More functionality due to distribution of original data, no dependency on
intermediate routers
o Easier to troubleshoot
– Fast convergence: when the network changes, new routes are
computed quickly
– Less bandwidth consuming
• Distance-vector pros:
– Less complex – easier to implement and administrate
– Needs less memory
Shortest Path Algorithm
Dijkstra Algorithm
• Define the root of the tree: the router
• Assign a cost of 0 to this node and make it the first permanent node.
• Examine each neighbor node of the last permanent node.
• Assign a cumulative cost to each node and make it tentative.
• Among the list of tentative nodes:
● Find the node with the smallest cumulative cost and make it
permanent.
● If a node can be reached from more than one direction, select
the direction with the smallest cumulative cost.
• Repeat steps 3 to 5 until every node is permanent.
The OSPF protocol
• The hello protocol
– Is there anybody out there?
– Detection of neighboring routers
– Election of designated routers
• The exchange protocol
- Exchange database between neighbors
• Reliable flooding
- When links change/age send: update to neighbors and flood recursively.
• Shortest path calculation
- Dijkstra's algorithm
- Compute shortest path tree to all destinations
OSPF Areas
• Divides the OSPF domain into smaller zones
– Smaller link-state database in each zone
– Also decreases signaling traffic
• Routers have limits on processing power and memory
– Router CPUs are typically much slower than
PCs
• CISCO nowadays recommends ~80 routers as a limit in
a single area
• You need a large network to benefit from areas
– Typical large companies
OSPF Network Topology
• Area 0 is the backbone area. All traffic goes via the backbone
• All other areas are connected to the backbone (1-level hierarchy)
• A Border area router has one interface in each area
• An AS Boundary Router – attaches to other AS:s
Link State Packet
• A link state packet can carry a large amount of information like : the
node identity, the list of links, a sequence number, and age
• They are created in two occasions:
a) When there is a change in the topology of the domain
b) On a periodic basis
Flooding of LSP
• After a node has prepared an LSP, it must be disseminated to all other
nodes, not only to its neighbors. The process is called flooding and based
on the following:
1) The creating node sends a copy of the LSP out of each interface
2) node that receives an LSP compares it with the copy it may already have.
If the newly arrived LSP is older than the one it has (found by checking
the sequence number), it discards the LSP. If it is newer, the node does
the following:
a) It discards the old LSP and keeps the new one.
b) It sends a copy of it out of each interface except the one from
which the packet arrived. This guarantees that flooding stops somewhere in
the domain (where a node has only one interface).
Link-State Advertisements
• LSAs are the elements of the distributed database
• The router describes its environment in the form of networks that it is
connected to
• Fundamental task in OSPF:
– Distribute the LSAs to all nodes in a reliable way
• Then, each node can compute Dijkstra on the same database
A Comparison of LS and DV Routing
Algorithms
• Message complexity
• Speed of convergence
• Robustness
Hierarchical Routing
Inter-AS Routing: BGP
Border Gateway Protocol (BGP)
• BGP is a standardized exterior gateway protocol (EGP),
as opposed to RIP, OSPF, and EIGRP which are interior
gateway protocols (IGP’s)
• BGP Version 4 (BGPv4) is the current standard
deployment
• BGP is considered a “Path Vector” routing protocol
• BGP was not built to route within an Autonomous
System (AS), but rather to route between AS’s
• BGP maintains a separate routing table based on
shortest AS Path and various other attributes, as
opposed to IGP metrics like distance or cost
Inter-AS Routing: BGP
• Exterior Gateway protocol
• Called Path vector Routing Algorithm.
• Neighboring BGP routers i.e. BGP peers exchange detailed path
information.
• Used for communicating between two AS
• Revolves around three activities
▫ Receiving and filtering route advertisement from directly attached
neighbors.
▫ Route Selection
▫ Sending route advertisements to neighbors.
BGP Messages

• BGP messages exchanged using TCP on port 179.


BGP Architecture

• BGP interacts with the Internal routing (OSPF/IS-IS/RIP/...)


– Redistributes routes between the two domains
• BGP really consists of two protocols:
– E-BGP: coordinates between border routers between AS:s
– I-BGP : coordinates between BGP peers within an AS
BGP Example

• N is an IP address prefix (a network) that is announced by AS1


(Origin AS)
• Every AS adds its own AS to the AS-PATH and sends BGP
Updates to next AS
• In the example, AS5 can choose which path to select based on
policies
BGP Function
• BGP provides each AS a means to:
1. Obtain subnet reachability information from neighboring ASs.
2. Propagate reachability information to all AS-internal routers.
3. Determine “good” routes to subnets based on reachability information and
policy.
• allows subnet to advertise its existence to rest of Internet: “I am here”
Why different Intra- and Inter-
AS routing ?
Policy:
• Inter-AS: admin wants control over how its traffic routed, who routes through its
net.
• Intra-AS: single admin, so no policy decisions needed
Scale:
• hierarchical routing saves table size, reduced update traffic
Performance:
• Intra-AS: can focus on performance
• Inter-AS: policy may dominate over performance
Why IPV6
• Deficiency of IPv4
• Address space exhaustion
• New types of service  Integration
• Multicast
• Quality of Service
• Security
• Mobility (MIPv6)
• Header and format limitations
Advantages of IPv6 over IPv4
• Larger address space
• Better header format
• New options
• Allowance for extension
• Support for resource allocation
• Support for more security
• Support for mobility
Changes from IPV4 to IPV6
IPV6 Header Format
Advantages of IPv6 over IPv4 (1)
Feature IPv4 IPv6
Source and destination 32 bits 128 bits
address
IPSec Optional required

Payload ID for QoS in No identification Using Flow label field


the header
Fragmentation Both router and the Only supported at the
sending hosts sending hosts
Header checksum included Not included

Resolve IP address to a broadcast ARP request Multicast Neighbor


link layer address Solicitation message
Advantages of IPv6 over IPv4 (2)
Feature IPv4 IPv6
Determine the address ICMP Router ICMPv6 Router
of the best default Discovery(optional) Solicitation and Router
gateway Advertisement (required)

Send traffic to all nodes Broadcast Link-local scope all-


on a subnet nodes multicast address

Configure address Manually or DHCP Autoconfiguration

Manage local subnet (IGMP) Multicast Listener


group membership Discovery (MLD)
Network Layer in v4 & v6
IPV6 Address Types
• Unicast
• Multicast
• Anycast

You might also like