You are on page 1of 40

UNIT III NETWORK LAYER

Network Layer Services – Packet switching – Performance – IPV4 Addresses – Forwarding of IP


Packets - Network Layer Protocols: IP, ICMP v4 – Unicast Routing Algorithms – Protocols –
Multicasting Basics – IPV6 Addressing – IPV6 Protocol

3.1 Network Layer Services


 transport segment from sending to receiving host
 on sending side encapsulates segments into datagrams
 on receiving side, delivers segments to transport layer
 network layer protocols in every host, router
 router examines header fields in all IP datagrams passing through it

Goals
 understand principles behind network layer services:
 network layer service models
 forwarding versus routing
 how a router works
 routing (path selection)
 broadcast, multicast
 instantiation, implementation in the Internet
Two key network-layer functions
 forwarding: move packets from router’s input to appropriate router output
 routing: determine route taken by packets from source to dest.
 routing algorithms
analogy:
 routing: process of planning trip from source to dest
 forwarding: process of getting through single interchange

3.2 Packet switching

 The user messages are split up into packets of a fixed maximum size .
 The packet can choose any path to carry the message.
 The whole user messages are reassembled at the destination node.
 This can significantly reduce the transmission time between the sender and receiver.

The characteristics are:

 Share communications channels within the network


 Flexible routing (can use the same physical channel to deliver messages to two different
nodes within the network.)
 Limited block size (usually 512 bytes or 1 kbytes)
 Can be used for interactive access (Response time dependent on network usage)

Two Types
 Virtual Circuits
 Datagrams

Datagram

 There is no connection between the sender and receiver.


 As there is no dedicated path between the sender and receiver
 The packets are routed individually and there are usually no delivery assurance between
the sender and receiver.

 Example: Internet

The characteristics of datagram service are given below:

Datagrams are individually routed within the subnet

No delivery assurance relating to the packets as the packets can be lost, out-of-sequence,
contaminated, duplicated etc.

Transaction (Sending a short message), connectionless oriented (No need to establish call prior
to sending data.)

Virtual Circuits

 Virtual circuit switching is a packet switching methodology whereby a path is established


between the source and the final destination.
 Through which all the packets will be routed during a call.
 This path is called a virtual circuit,
 The connection appears to be a dedicated physical circuit.
 However, other communications may also be sharing the parts of the same path.



Advantages of virtual circuit switching are:

 Packets are delivered in order,since they all take the same route;
 The connection is more reliable, network resources are allocated at call setup so that even
during times of congestion, provided that a call has been setup, the subsequent packets
should get through;
 Billing is easier, since billing records need only be generated per call and not per packet.

Disadvantages of a virtual circuit switched network are:

 The switching equipment needs to be more powerful, since each switch needs to store
details of all the calls that are passing through it and to allocate capacity for any traffic
that each call could generate;

Examples of virtual circuit switching are X.25 and Frame Relay.

Message Switching
 The source comp sends the data to the switching office first which stores the data in its
buffer.
 It then looks for a free link to another switching office and then sends the data to this office.
 Process is continued till the data is delivered to the destination computer.
 It is also known as store and forward technique.

Example : Email. Webrowsing

Advantages:

 Traffic congestion can be reduced.


 Channel efficiency can be greater.

Disadvantages

 Store and forward devices are expensive.


 It is not compatible with interactive application
 Differentiate Circuit , Datagram , Virtual Circuit
Circuit Switching Packet Switching(Datagram Packet Switching (Virtual
type) Circuit type)
Dedicated path No Dedicated path No Dedicated path
Path is established for entire Route is established for each Route is established for entire
conversation packet conversation
Call setup delay Packet transmission delay Call setup delay as well as
packet transmission delay
Overload may block call setup Overload increases packet Overload may block call setup
delay and increases packet delay
Fixed bandwidth Dynamic bandwidth Dynamic bandwidth
No overhead bits after call Overhead bits in each packet Overhead bits in each packet
setup

3.3Network performance
Network performance is measured in two fundamental ways .
 Bandwidth (or) throughput
 Latency (or) delay
Bandwidth and Latency
 Network performance is measured in two fundamental ways: bandwidth (also called
throughput) and latency (also called delay).
Bandwidth
 The bandwidth of a network is given by the number of bits that can be transmitted over
the network in a certain period of time.
 For digital devices, the bandwidth is usually expressed in bits per second(bps) or bytes
per second

 Throghput = packet transfer size / packet transfer time


 Transfer time = RTT + 1/ Bandwidth * packet transfer size

 For example, a network might have a bandwidth of 10 million bits/second (Mbps),


meaning that it is able to deliver 10 million bits every second.
Throughput = Packet Transfer Size/ Transfer time
Transfer time = RTT + 1/ Bandwidth X Transfer Size
Latency
 The second performance metric, latency, corresponds to how long it takes a message to
travel from one end of a network to the other.
Round-trip time (RTT)
There are many situations in which it is more important to know how long it takes to send
a message from one end of a network to the other and back, rather than the one-way
latency. We call this the round-trip time (RTT) of the network.

We could define the total latency as


Latency = Propagation + Transmit + Queue
Propagation = Distance/SpeedofLight
Transmit = Size/Bandwidth

Delay × Bandwidth Product


 It is also useful to talk about the product of these two metrics, often called the delay ×
bandwidth product.
Volume = delay × bandwidth product
 Where the latency corresponds to the length of the pipe and the bandwidth gives the
diameter of the pipe, then the delay × bandwidth product gives the volume of the pipe the
number of bits it holds.

o Smaller the width more will be transmission per unit time

Bits transmitted at a particular bandwidth can be regarded as having some width:


(a) bits transmitted at 1Mbps (each bit 1 μs wide);
(b) bits transmitted at 2Mbps (each bit 0.5 μs wide).

Jitter:
Application requirements: Jitter
Example: voice (telephony)

A 1-MB file would fill the 1-Mbps link 80 times, but only fill the 1-Gbps link 1/12 of one
time
Application requirements: Jitter

• Variance in end‐to‐end latency (or RTT)


• Example: voice (telephony)

3.4 IPV4 ADDRESSES

An ipv4 address is a 32-bit address that uniquely and universally defines the connection of
a device (for example, a computer or a router) to the internet
 AN IPV4 ADDRESS IS 32 BITS LONG
 THE IPV4 ADDRESSES ARE UNIQUE AND UNIVERSAL
 THE ADDRESS SPACE OF IPV4 IS 232 OR 4,294,967,296

GLOBAL ADDRESSES
 IP addresses properties
 Globally unique
 Hierarchical: network + host
 Network part: identifies the network the host is attached to
 Host: identifies a unique host on that network
 Ethernet addresses, even globally unique, are flat (no structure and thus no
meaning) and can not be use for routing
 Note that a router is attached to at least twonetworks, so it must have an ip address
on each port/interface
 Thus it is more precise to think of ip addresses as belonging to interfaces
rather than to hosts
 Approximately, 4 billion ip address, half are a type, ¼ is b type, and 1/8 is c type

 INTERNET ADDRESS STRUCTURE, SHOWING FIELD SIZES IN BITS


7 24

Cla ss A : 0 Netw ork ID Hos t ID

14 16

Cla ss B: 1 0 Netw ork ID Hos t ID

21 8

Cla ss C: 1 1 0 Netw ork ID Hos t ID

28

Cla ss D (mu ltica st): 1 1 1 0 Multica st add res s

27

Cla ss E (r ese rv ed) : 1 1 1 1 0 un us ed



 Class A was intended for wide area networks
 Thus there should a very few of them
 Class B was intended for a modest size networks (like a campus)
 Class C is for the large number of lans
 However, these classifications are not flexible and today’s ip addresses are normally
“classless” as we will see

Network/Host Hosts per


1st Octet 1st Octet Default
ID Number of Network
Decimal High Order Subnet
(N=Network, Networks (Usable
Range Bits Mask
H=Host) Addresses)
16,777,214
A 1 – 126* 0 N.H.H.H 255.0.0.0 126 (27 – 2)
(224 – 2)
16,382 (214 – 65,534 (216
B 128 – 191 10 N.N.H.H 255.255.0.0
2) – 2)
2,097,150 (221
C 192 – 223 110 N.N.N.H 255.255.255.0 254 (28 – 2)
– 2)
D 224 – 239 1110 Reserved for Multicasting
E 240 – 254 1111 Experimental; used for research

Format
 4 bytes, each byte is represented by a decimal number
 Dot notation
 10.3.2.4
 128.96.33.81
 192.12.69.77
FIND THE CLASS OF EACH ADDRESS.

 00000001 00001011 00001011 11101111


 11000001 10000011 00011011 11111111
 14.23.120.8
 252.5.15.111

SOLUTION
 The first bit is 0. This is a class a address.
 B. The first 2 bits are 1; the third bit is 0. This is a class c
address.
 The first byte is 14; the class is a.
 The first byte is 252; the class is e.

Example .1
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
a.10000001 00001011 00001011 11101111
b.11000001 10000011 00011011 1111111
Solution

We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add
dots for separation.

Example 2:
a.129.11.11.239
b.193.131.27.255
Solution
We replace each decimal number with its binary equivalent (see Appendix B)

Example 3

Change the following IPv4 addresses from dotted-decimal notation to binary notation
a.111.56.45.78
b.221.34.7.82

Solution
We replace each decimal number with its binary equivalent (see Appendix B)

a.01101111 00111000 00101101 01001110


b.11011101 00100010 00000111 01010010
Example 4
Find the error, if any, in the following IPv4 addresses
a.111.56.045.78
b.221.34.7.8.20
c.75.45.301.14
d.11100010.23.14.67
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d.A mixture of binary notation and dotted-decimal notation is not allowed.
Class Number of Blocks Block Size Application
A 128 16,777,216 Unicast
B 16,384 65,536 Unicast
C 2,097,152 256 Unicast
D 1 268,435,456 Multicast
E 1 268,435,456 Reserved

Number of blocks and block size in classful IPv4 addressing

3.5 IP DATAGRAM FORWARDING


Netw ork 1 (Ethernet)

H7 R3 H8
H1 H2 H3

Netw ork 4

Netw ork 2 (Ethernet) (point-to-point)

R1

R2

H4
Netw ork 3 (FDDI)

H5 H6

 ALGORITHM
If (networknum of destination = networknum of one of my interfaces) then
deliver packet to destination over that interface
Else
if (networknum of destination is in my forwarding table) then
deliver packet to nexthop router
else
deliver packet to default router

For a host with only one interface and only a default router in its forwarding table, this
simplifies to
If (networknum of destination = my networknum)then
deliver packet to destination directly
Else
deliver packet to default router

3.6 Network Layer Protocols


3.6.1 IP
Netw ork 1 (Ethernet)

H7 R3 H8
H1 H2 H3

Netw ork 4

Netw ork 2 (Ethernet) (point-to-point)

R1

R2

H4
Netw ork 3 (FDDI)

H5 H6

IP INTERNET
 IP stands for internet protocol
 Key tool used today to build scalable, heterogeneous internetworks
 It runs on all the nodes in a collection of networks and defines the infrastructure that
allows these nodes and networks to function as a single logical internetwork

IP SERVICE MODEL
 Two parts
 Global Addressing Scheme
 Provides a way to identify all hosts in the network
 Datagram (Connectionless) model for data delivery
 Best-effort delivery (unreliable service)
 packets are lost
 packets are delivered out of order
 duplicate copies of a packet are delivered
 packets can be delayed for a long time
Datagram format: IP header
0 4 8 16 19 31

V ersion HLen TOS Length

Ident Flags Of f s et

TTL Protocol Chec ks um

Sourc eA ddr

DestinationA ddr

Pad
Options (variable)
(v ariable)

Data
IP HEADER
 Version (4 bits):
O Currently 4 or 6.
O Also called ipv4 and ipv6
 Hlen (4 bits):
O number of 32-bit words in header
O usually 5 32-bit words with no options
 Tos (8 bits):
O Type of service (not widely used)
 Length (16 bits):
O number of bytesin this datagram including the header
 Size of datagram (in bytes, header + data)
Ident (16 bits) and flags/offset (16 bits):
O Used by fragmentation
 Flags 3 bits: r (reserved bit set to 0) df (don't fragment ) mf (more fragments)
 FLAGS/OFFSET (16 BITS):
 Used by fragmentation
 Protocol (the type of transport packet being carried (e.g. 1 = icmp; 6 = tcp; 17= udp).
 Header checksum (a 1's complement checksum of ip header, updated whenever the
packet header is modified by a node. Packets with an invalid checksum are discarded
by all nodes in an ip network)
 TTL (8 BITS):
O Number of hops/routers this packet can travel
 Discard the looping packets
O Originally based on time, but changed to a hop-count based
O Each router decrements it by 1
O Discard the packet when it becomes 0
O Default is 64
 DestAddr&SrcAddr (32 bits)
o The key for datagram delivery
o Every packet contains a full destination address
o Forwarding/routing decisions are made at each router
o The source address is for the destination to know the sender and if it wants to
reply to it
Problems
 Setting it too high the packet will loop a lot
 Setting it too low the packet will not reach the destination

FRAGMENTATION AND REASSEMBLY


 Each network has some MTU (Maximum Transmission Unit)
 Ethernet (1500 bytes), FDDI (4500 bytes)
 IP packets need to fit in the payload of link-layer frame
Solutions
 Make all packet size small enough to fit all
 Or fragment the large packets into smaller ones and reassembles them later
Strategy
 Fragmentation occurs in a router when it receives a datagram that it wants to
forward over a network which has (MTU < datagram)
 Reassembly is done at the receiving host
 All the fragments carry the same identifier in the Ident field
 Fragments are self-contained datagrams

SUPPOSE PPP HAS MTU OF 532-BYTE PACKET (20 HEADER + 512 PAYLOAD)

IP datagrams traversing the sequence of physical networks

Header fields used in ip fragmentation. (a) unfragmented packet; (b) fragmented packets.
 Mtu path discovery is a good strategy to avoid fragmentation
 Send some packets first just discover the mtus on the path to the destination
SUBNETTING
Subnetting is a process of breaking large network in small networks known as subnets.
Subnetting happens when we extend default boundary of subnet mask. Basically we borrow host
bits to create networks.

Advantage of Subnetting

 Subnetting breaks large network in smaller networks and smaller networks are easier to
manage.
 Subnetting reduces network traffic
 Improve performance.
 It allows you to apply network security polices at the interconnection between subnets.
 It allows you to save money by reducing requirement for IP range.

2 METHODS :
 Boundary level
 Non boundary level

BOUNDARY LEVEL
If masking IP address is 255 then subnet id is same as Network Ip address
If masking IP address is 0 then subnet id is also 0.
Ex:
NETWORK IP : 132.128.40.5
MASKING IP : 255.255. 0. 0
SUBNETTING IP : 132.128. 0. 0

NON-BOUNDARY LEVEL
Find binary equivalent for IP address and Masking IP.
Perform bitwise and operation with these two values.

EX:
IP : 132.147.28.6
MASKING IP : 255.92. 2. 0
SUBNETTING IP: 132.16. 0. 0

STEP 1: FIND BINARY EQUIVALENT FOR 147 ,92


147 - 10010011
92 - 01011100
STEP 2:PERFORM BITWISE AND OPERATION
147 - 10010011
92 - 01011100
00010000
1 IS PRESENT IN 4TH POWER OF 2 , SO 2^4=16

3.6.2Internet Control Message Protocol (ICMP)


 Defines a collection of error messages that are sent back to the source host whenever a
router or host is unable to process an IP datagram successfully

Types of ICMP messages:


 Error reporting Message
 Query message
Error reporting Message
 ICMP messages are divided into error-reporting messages and query messages. The
error-reporting messages report problems that a router or a host (destination) may
encounter.
Query messages
 The query messages get specific information from a router or another host.
Category Type Message
Error-Reporting Message 3 Destination unreachable
4 Source quench
11 Time exceeded
12 Parameter problem
5 Redirection
Query Message 8 or 0 Echo request or reply
13 or 14 Timestamp request or reply
17 or 18 Address mask request or reply
10 or 9 Router solicitation or advertisement
General format of ICMP messages

All the ICMP messages are different. The only thing that is common amongst all is the first 4
bytes.
Type field tells what type of message;
Code field gives further information on the type of message.

ERROR REPORTING
ICMP does not correct errors, it simply reports them.
ICMP always reports the message back to the source
 Destination Unreachable
 Source Quench
 Time Exceeded
 Parameter Problem
 Redirection

Destination Unreachable
When a router cannot route a datagram or a host cannot deliver a datagram, the datagram is
discarded and the route ror host sends a destination-unreachable ICMP message.
Some subtypes of the “Destination Unreachable:

Code Description Reason for Sending

0 Network No routing table entry is available for the destination


Unreachable network.
1 Host Unreachable Destination host should be directly reachable, but does not
respond to ARP Requests.
2 Protocol The protocol in the protocol field of the IP header is not
Unreachable supported at the destination.
3 Port Unreachable The transport protocol at the destination host cannot pass
the datagram to an application.
4 Fragmentation IP datagram must be fragmented, but the DF bit in the IP
Needed header is set.
and DF Bit Set

Source-quench format
There is no flow control mechanism in IP, so ICMP allows a router to tell a source to
slow down (we just discarded one of your datagrams because our buffers are full). This
is source quench.
One source quench message is sent for each datagram discarded.

Time-exceeded message format


When a router decrements a Time-to-Live counter to zero, the datagram is tossed and a
time-exceeded message is returned to the source. Likewise if a destination does not
receive all the fragments in a set amount of time.
In a time-exceeded message, code 0 is used only by routers to show that the value of the time-to-
live field is zero. Code 1 is used only by the destination host to show that not all of the fragments
have arrived within a set time.

A parameter problem message can be created by a router or the destination host.


Code 0 - there is an error or ambiguity in one of the header fields.
Code 1 - the required part of an option is missing.

Redirection concept
 Routers are constantly updating themselves with new routing information. Not so with
hosts.
 A host has to know where the next router is too, but its table is usually static (for
efficiency).
 Host routing tables start off small, usually with only one entry - the default router.
 When the host sends a datagram to the wrong router (because its routing table is
incomplete), the router that receives the datagram sends the datagram to the correct
router AND sends a redirection message to the host.
 The host uses this info to update its routing table.
QUERY MESSAGES
ICMP can also diagnose some network problems through the query messages, a group of four
different pairs of messages. In this type of ICMP message, a node sends a message that is
answered in a specific format by the destination node.

ICMP Query message

Example of ICMP Queries:


The four different types of request and reply are:
 Echo Request and Reply
 Timestamp Request and Reply
 Address-Mask Request and Reply
 Router Solicitation and Advertisement

Echo Request and Reply


 An echo-request message can be sent by a host or router. An echo-reply message is sent
by the host or router which receives an echo-request message.
 Echo-request and echo-reply messages can be used by network managers to check the
operation of the IP protocol.
 If a router returns a reply, then it and IP are working.
 Echo-request and echo-reply messages can test the reachability of a host. This is usually
done by invoking the ping command.
Identifier field and Sequence number field are not used and can be arbitrarily set by the sender.
Identifier field is often the same as the process ID.

Timestamp-request and timestamp-reply messages


Timestamp-request and timestamp-reply messages can be used to calculate the round-trip time
between a source and a destination machine even if their clocks are not synchronized.
The timestamp-request and timestamp-reply messages can be used to synchronize two clocks in
two machines if the exact one-way time duration is known.

Sending time = receive timestamp - original timestamp


Receiving time = returned time - transmit time
Round-trip time = sending time + receiving time

Address-mask-request and address-mask-reply message format


If a thin-client host does not know its IP mask, it may issue an address-mask-request. Can also
use BOOTP or DHCP to obtain this information.
Address mask is 0 in request message.
Identifier and Sequence number fields are not used.
Router-solicitation message format

How does a host find out what routers are connected to itsown network? Or if those routers are
functioning? It can send out a router-solicitation message.This can be broadcast on current
network.

Identifier and Sequence number fields are not used.

Router-advertisement message format


This is the reply that comes back from the previous request.
Lifetime field shows the number of seconds that the entries are considered to be valid.

If address preference = 0, then this should be the default router


3.7 Unicast Routing Algorithms
An internet is a combination of networks connected by routers. When a datagram goes from a
source to a destination, it will probably pass through many routers until it reaches the router
attached to the destination network.

Hierarchical Routing

 Divide the routing problem in two parts:


 Routing within a single AS
 Intra-domain routing protocol
(each AS selects its own)
 Routing between ASs
 Inter-domain routing protocol
(Internet-wide standard)

Intra-domain Protocols
 RIP: Route Information Protocol
 Distance-vector algorithm
 Based on hop-count
 OSPF: Open Shortest Path First
 More recent Internet standard
 Uses link-state algorithm
 Supports authentication
Autonomous System (AS)
• Collection of networks with same routing policy
• Single routing protocol
• Usually under single ownership, trust and administrative control
• What is an Autonomous System (AS)?
• A set of routers under a single technical administration, using an interior gateway
protocol (IGP) and common metrics to route packets within the AS and using an
exterior gateway protocol (EGP) to route packets to other AS’s
• Sometimes AS’s use multiple IGPs and metrics, but appear as single AS’s to other
AS’s
Distance Vector Routing Protocol: (16m)
A router running distance vector protocol advertises its connected routes and learns new routes
from its neighbors. The routing cost to reach a destination is calculated by means of hops
between the source and destination. A router generally relies on its neighbor for best path
selection, also known as “routing-by-rumors”. RIP and BGP are Distance Vector Protocols.

 Distance Vector
 Each node constructs a one dimensional array (a vector) containing the “distances”
(costs) to all other nodes and distributes that vector to its immediate neighbors
 Starting assumption is that each node knows the cost of the link to each of its directly
connected neighbors
Initial distances stored at each node (global view)

Initial routing table at node A

Final routing table at node A


Final distances stored at each node (global view)

 The distance vector routing algorithm is sometimes called as Bellman-Ford algorithm


 Every T seconds each router sends its table to its neighbor each each router then updates its
table based on the new information
 Problems include fast response to good new and slow response to bad news. Also too
many messages to update
 When a node detects a link failure
 F detects that link to G has failed
 F sets distance to G to infinity and sends update to A
 A sets distance to G to infinity since it uses F to reach G
 A receives periodic update from C with 2-hop path to G
 A sets distance to G to 3 and sends update to F
 F decides it can reach G in 4 hops via A

 Slightly different circumstances can prevent the network from stabilizing


 Suppose the link from A to E goes down
 In the next round of updates, A advertises a distance of infinity to E, but B and C advertise
a distance of 2 to E
 Depending on the exact timing of events, the following might happen
o Node B, upon hearing that E can be reached in 2 hops from C, concludes that it can
reach E in 3 hops and advertises this to A
o Node A concludes that it can reach E in 4 hops and advertises this to C
o Node C concludes that it can reach E in 5 hops; and so on.
o This cycle stops only when the distances reach some number that is large enough to
be considered infinite
 Count-to-infinity problem
Count-to-infinity Problem
 Use some relatively small number as an approximation of infinity
 For example, the maximum number of hops to get across a certain network is never going
to be more than 16
 One technique to improve the time to stabilize routing is called split horizon
o When a node sends a routing update to its neighbors, it does not send those routes it
learned from each neighbor back to that neighbor
o For example, if B has the route (E, 2, A) in its table, then it knows it must have
learned this route from A, and so whenever B sends a routing update to A, it does not
include the route (E, 2) in that update
 In a stronger version of split horizon, called split horizon with poison reverse
 B actually sends that back route to A, but it puts negative information in the route to ensure
that A will not eventually use B to get to E
 For example, B sends the route (E, ∞) to A

Routing Information Protocol (RIP)

Link-State Routing Protocol: (OSPF)(16markq)

 This protocol acknowledges the state of a Link and advertises to its neighbors.
Information about new links is learnt from peer routers.
 After all the routing information has been converged, the Link-State Routing Protocol
uses its own algorithm to calculate the best path to all available links.
 OSPF and IS-IS are link state routing protocols and both of them use Dijkstra’s Shortest
Path First algorithm.

Link State Routing:


• Link state or distance vector?
• No universal metric – policy decisions
• Problems with link state:
• Metric used by routers not the same – loops
• LS database too large – entire Internet
• May expose policies to other AS’s

Open Shortest Path First

Strategy: Send to all nodes (not just neighbors) information about directly connected links (not
entire routing table).

 Link State Packet (LSP)


 id of the node that created the LSP
 cost of link to each directly connected neighbor
 sequence number (SEQNO)
 time-to-live (TTL) for this packet

 Reliable Flooding
 store most recent LSP from each node
 forward LSP to all nodes but one that sent it
 generate new LSP periodically; increment SEQNO
 start SEQNO at 0 when reboot
 decrement TTL of each stored LSP; discard when TTL=0

 Link State
 Reliable Flooding

 In practice, each switch computes its routing table directly from the LSP’s it has collected
using a realization of Dijkstra’s algorithm called the forward search algorithm

 Specifically each switch maintains two lists, known as Tentative and Confirmed
 Each of these lists contains a set of entries of the form (Destination, Cost, NextHop)

The algorithm
 Initialize the Confirmed list with an entry for myself; this entry has a cost of 0
 For the node just added to the Confirmed list in the previous step, call it node Next, select
its LSP
 For each neighbor (Neighbor) of Next, calculate the cost (Cost) to reach this Neighbor as the
sum of the cost from myself to Next and from Next to Neighbor
o If Neighbor is currently on neither the Confirmed nor the Tentative list, then add
(Neighbor, Cost, Nexthop) to the Tentative list, where Nexthop is the direction I go to reach
Next
o If Neighbor is currently on the Tentative list, and the Cost is less than the currently listed
cost for the Neighbor, then replace the current entry with (Neighbor, Cost, Nexthop) where
Nexthop is the direction I go to reach Next
 If the Tentative list is empty, stop. Otherwise, pick the entry from the Tentative list with the
lowest cost, move it to the Confirmed list, and return to Step 2.
Router metrics

 A router metric typically based on information like


 path length,
 bandwidth,
 load,
 hop count,
 path cost,
 delay,
 maximum transmission unit (MTU),
 Reliability and communications cost.
 These metrics used by a router to make routing decisions.
 It is typically one of many fields in a routing table.
 Metrics are used to determine whether one route should be chosen over another.
 The routing table stores possible routes, while link-state or topological databases may
store all other information as well. For example, Routing Information Protocol uses
hopcount (number of hops) to determine the best possible route.
 The route will go in the direction of the gateway with the lowest metric.
 The direction with the lowest metric can be a default gateway.
 Router metrics can contain any number of values that help the router determine the best
route among multiple routes to a destination.
What is the difference between Link State and Distance Vector?

· Distance vector protocols are used in small networks, and it has a limited number of hops,
whereas Link state protocol can be used in larger networks, and it has unlimited number of hops.

· Distance vector protocol has a high convergence time, but in link state, convergence time is
low.

· Distance vector protocol periodically advertise updates, but link state advertises only new
changes in a network.

· Distance vector protocol advertises only the directly connected routers and full routing tables,
but link state protocols only advertise the updates, and flood the advertisement.

· In distance vector protocol, loop is a problem, and it uses split horizon, route poisoning and
hold down as loop preventing techniques, but link state has no loop problems.

Inter-domain Protocol
 Border Gateway Protocol, version 4 (BGP-4)
 Internet is an arbitrarily interconnected set of ASs
 Each AS has a Speaker (advertiser)
 Goal: Reachability than optimality

Autonomous System (AS)


• Collection of networks with same routing policy
• Single routing protocol
• Usually under single ownership, trust and administrative control
• What is an Autonomous System (AS)?
• A set of routers under a single technical administration, using an interior gateway
protocol (IGP) and common metrics to route packets within the AS and using an
exterior gateway protocol (EGP) to route packets to other AS’s
• Sometimes AS’s use multiple IGPs and metrics, but appear as single AS’s to other
AS’s

BGP Example

Routing Areas
 AS divided into areas
 Area 0
 Known as the backbone area (connected to the backbone)
 Area Border Routers (ABRs): R1, R2, R3
 OSPF link state packets
 Do not leave the area in which they originated (if they are not ABRs)
 ABRs summarize routing information that they have learned from one area and
make it available in their advertisements to other areas.

• Hierarchically address nodes in a network


• Sequentially number top-level areas
• Sub-areas of area are labeled relative to that area
• Nodes are numbered relative to the smallest containing area
Routing Protocols
• Routers use “routing protocols” to exchange routing information with each other
– IGP is used to refer to the process running on routers inside an ISP’s network
– EGP is used to refer to the process running between routers bordering directly
connected ISP networks
Border Gateway Protocol (BGP)
 It is a standardized exterior gateway protocol designed to exchange routing and reachability
information among autonomous systems.
• The protocol is often classified as a path vector protocol but is sometimes also classed as a
distance-vector routing protocol.
• The Border Gateway Protocol makes routing decisions based on paths, network policies, or
rule-sets configured by a network administrator and is involved in making core routing
decisions.
• BGP may be used for routing within an autonomous system.
• In this application it is referred to as Interior Border Gateway Protocol,
• Three functional procedures are involved in BGP:
• * Neighbor acquisition
• * Neighbor reachability
• * Network reachability
1. Neighbor Acquisition:

 Each router attempts to establish a connection to each of its neighboring routers by


sending Neighbor Acquisition Request messages.
 A neighbor hearing a request can respond with a Neighbor Acquisition Confirm to say
that it recognized the request and wishes to connect.
 It may reject the acquisition by replying with a Neighbor Acquisition Refuse message. For
an EGP connection to be established between a pair of neighbors, each must first
successfully acquire the other with a Confirm message.

2. Neighbor Reachability:

 After acquiring a neighbor, a router checks to make sure the neighbor is reachable
and functioning properly on a regular basis.
 This is done by sending an EGP Hello message to each neighbor for which a
connection has been established.
 The neighbor replies with an I Heard You (IHU) message. These messages are
somewhat analogous to the BGP Keepalive message, but are used in matched
pairs.

3. Network Reachability Update:

 A router sends Poll messages on a regular basis to each of its neighbors.


 The neighbor responds with an Update message, which contains details about the
networks that it is able to reach.
 This information is used to update the routing tables of the device that sent the
Poll.

Header Format

Marker
Marker: This large field at the start of each BGP message is used for synchronization and
authentication.
Length: The total length of the message in bytes, including the fields of the header.
Length- length of the data
Type: Indicates the BGP message type
Type Value(Decimal) Message Type
1 Open
2 Update
3 Notification
4 Keepalive

BGP uses TCP to connect peers


BGP Messages
• Open
• Announces AS ID
• Determines hold timer – interval between keep_alive or update messages, zero
interval implies no keep_alive
• Keep_alive
• Sent periodically (but before hold timer expires) to peers to ensure connectivity.
• Sent in place of an UPDATE message
• Notification
• Used for error notification
• TCP connection is closed immediately after notification
BGP UPDATE Message
• List of withdrawn routes
• Network layer reachability information
• List of reachable prefixes
• Path attributes
• Origin
• Path
• Metrics
• All prefixes advertised in message have same path attributes

Path Selection Criteria


• Information based on path attributes
• Attributes + external (policy) information
• Examples:
• Hop count
• Policy considerations
• Preference for AS
• Presence or absence of certain AS
• Path origin
• Link dynamics

Advantages:
• Simplifies BGP
• No need for periodic refresh - routes are valid until withdrawn, or the connection
is lost
• Incremental updates
Disadvantages
• Congestion control on a routing protocol?
• Poor interaction during high load

Why Do We Need an IGP


• ISP backbone scaling
– Hierarchy
– Limiting scope of failure
– Only used for ISP’s infrastructure addresses, not customers or anything else
– Design goal is to minimise number of prefixes in IGP to aid scalability and rapid
convergence

Why Do We Need an EGP?


• Scaling to large network
– Hierarchy
– Limit scope of failure
• Define Administrative Boundary
• Policy
– Control reachability of prefixes
– Merge separate organisations
– Connect multiple IGPs

What Is an EGP
• Exterior Gateway Protocol
• Used to convey routing information between Autonomous Systems
• De-coupled from the IGP
• Current EGP is BGP
Exterior
– specifically configured peers
– connecting with outside networks
– set administrative boundaries binds AS’s together
– Carries customer prefixes
– Carries Internet prefixes
– EGPs are independent of ISP network topology

Interior
– automatic neighbour discovery
– generally trust your IGP routers
– prefixes go to all IGP routers
– binds routers in one AS together
– Carries ISP infrastructure addresses only
– ISPs aim to keep the IGP small for efficiency and scalability
3.8Multicasting Basics
Multicast is communication between a single sender and multiple receivers on a network. ...
Together with anycast and unicast, multicast is one of the packet types in the Internet Protocol
Version 6 (IPv6).
3.8.1 IPV6 Addressing
MULTICAST ADDRESSES
A multicast address is a destination address for a group of hosts that have joined a multicast
group. A packet that uses a multicast address as a destination can reach all members of the
group unless there are some filtering restriction by the receiver.
The multicast addresses are in the range 224.0.0.0 through 239.255.255.255

IP Multicast Address Ranges and Uses
Range Start Range End
Description
Address Address
Reserved for special “well-known” multicast
224.0.0.0 224.0.0.255
addresses.

Globally-scoped (Internet-wide) multicast


224.0.1.0 238.255.255.255
addresses.

Administratively-scoped (local) multicast


239.0.0.0 239.255.255.255
addresses.

3.6.2 IPV6 Protocol


Internet Protocol version 6 is a new addressing protocol designed to incorporate all the possible
requirements of future Internet known to us as Internet version.

Fixed Header

An IPv6 packet is the smallest message entity exchanged via the Internet Protocol across an
Internet Protocol version 6 (IPv6) network.

Packets consist of control information for addressing and routing, and a payload consisting of
user data.
The control information in IPv6 packets is subdivided into a mandatory fixed header and
optional extension headers.
The payload of an IPv6 packet is typically a datagram or segment of the higher-level Transport
Layer protocol, but may be data for an Internet Layer (e.g., ICMPv6) or Link Layer (e.g., OSPF)
instead

Features
 128-bit addresses (classless)
 multicast
 real-time service
 authentication and security
 autoconfiguration
 end-to-end fragmentation
 Expanded Address Space

IPv6 Address
 128-bit address
 3FFE:085B:1F1F:0000:0000:0000:00A9:1234
 8 groups of 16-bit hexadecimal numbers separated by “:”
 Leading zeros can be removed
 3FFE:85B:1F1F::A9:1234
 :: = all zeros in one or more group of 16-bit hexadecimal numbers

Packet format:

 40-byte “base” header


 Extension headers (fixed order, mostly fixed length)
 fragmentation
 source routing
 authentication and security
 Other Option

Packet Format Details


Version (4-bits): It represents the version of Internet Protocol, i.e. 0110.

Traffic Class (8-bits): These 8 bits are divided into two parts. The most significant 6 bits are
used for Type of Service to let the Router Known what services should be provided to this
packet. The least significant 2 bits are used for Explicit Congestion Notification (ECN).
Priority:-

Priority Meaning
0 NO Traffic
1 Data
2 Un Attuned Data traffic
3 Reserved
4 Attended data traffic
5 Reserved
6 Traffic
7 Control Traffic
Flow Label (20-bits): This label is used to maintain the sequential flow of the packets belonging
to a communication. The source labels the sequence to help the router identify that a particular
packet belongs to a specific flow of information. This field helps avoid re-ordering of data
packets. It is designed for streaming/real-time media.
Payload Length (16-bits): This field is used to tell the routers how much information a
particular packet contains in its payload. Payload is composed of Extension Headers and Upper
Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the Extension Headers
contain Hop-by-Hop Extension Header, then the payload may exceed 65535 bytes and this field
is set to 0.

Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if the
Extension Header is not present then it indicates the Upper Layer PDU. The values for the type
of Upper Layer PDU are same as IPv4’s.

Options are “extension header” that follow IP header


Code Next Header
0 HOP by HOP
2 ICMP
6 TCP
17 UDP
43 Source Routing
44 Fragmentation
50 Security
51 Authentication
60 Destination option
Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is
same as TTL in IPv4. The value of Hop Limit field is decremented by 1 as it passes a link
(router/hop). When the field reaches 0 the packet is discarded.
Source Address (128-bits): This field indicates the address of originator of the packet.
Destination Address (128-bits): This field provides the address of intended recipient of the
packet.

Extension header:
Extension Header Next Header Value Description
Hop-by-Hop Options header 0 Read by all devices in transit network
Routing header 43 Contains methods to support making
routing decision
Fragment header 44 Contains parameters of datagram
fragmentation
Destination Options header 60 Read by destination devices
Authentication header 51 Information regarding authenticity
Encapsulating Security 50 Encryption information
Payload header

Hop by hop option:


Is used when the source needs to pass information to all routers visited by the datagram.
Source routing:
The concept of the strict source route and the loose source route option of IPV4.
Fragmentation:
The original source is fragmented.
Authentication:
It validate the message sender ad ensure the integrity of data.
Encrypted security:
It provide confidentiality
Destination option: The source needs to pass information to the destination only.

The sequence of Extension Headers should be:

IPV6 header
Hop-by-Hop options header
Destination Options header1
Routing header
Fragment header
Authentication header
Encapsulating Security Payload header
Destination Options hearder2
Upper-layer header

These headers:
1. Should be processed by First and subsequent destinations.
2. Should be processed by Final Destination.

Extension Headers are arranged one after another in a linked list manner, as depicted in the
following diagram:
Extension Headers Connected Forma

IPSec Scenario

IPSec Benefits
 Provides strong security for external traffic
 Resistant to bypass
 Below transport layer hence transparent to applications
 Can be transparent to end users
 Can provide security for individual users if needed
 Authentication Header
 for authentication/integrity only
 Encapsulating Security Payload (ESP)
 for authentication/integrity/encryption (privacy)
 A key exchange function
 Manual or automated
 VPNs usually need combined function
Address Types are :
Unicast : One to One (Global, Link local, Site local, Compatible)
Anycast : One to Nearest (Allocated from Unicast)
Multicast : One to Many
Reserved
• A single interface may be assigned multiple IPv6 addresses of any type (unicast, anycast,
multicast)
No Broadcast Address -> Use Multicast
Advantages of IPV6:
 Larger address space
 Better header format
 New options
 Allowance for extension
 Support for resource allocation
 Support for more security
 Support for mobility

Advantages of IPv6 over IPv4 (1)

Feature IPv4 IPv6

Source and destination address 32 bits 128 bits

IPSec Optional required

Payload ID for QoS in the header No identification Using Flow label field

Fragmentation Both router and the sending hosts Only supported at the
sending hosts

Header checksum included Not included

Resolve IP address to a link layer address broadcast ARP request Multicast Neighbor
Solicitation message

Determine the address of the best default ICMP Router ICMPv6 Router
gateway Discovery(optional) Solicitation and Router
Advertisement (required)

Send traffic to all nodes on a subnet Broadcast Link-local scope all-nodes


multicast address

Configure address Manually or DHCP Auto configuration

Manage local subnet group membership (IGMP) Multicast Listener


Discovery (MLD)

You might also like