18ECC303J Unit 3 Week 8
18ECC303J Unit 3 Week 8
Communication Networks
Course Credit : 4
Theory : 9 Hours
Session 6 Session 7
• Network Layer Protocol- • Internet Protocol(IP)-IPV6
IPV4
Week 8
Session 8
• Routing Protocols-
Distance Vector& Link
State
• Routing Issues-Delivery,
Forwarding and Routing
(Week 8) Session -6
Network Layer Protocol- IPv4
• The Internet Protocol version 4 (IPv4) is the
delivery mechanism used by the TCP/IP
protocols.
• IPv4 is an unreliable and connectionless
datagram protocol.
• IPv4 provides no error control or flow control
(except for error detection on the header).
• 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.
• IPv4 relies on a higher-level protocol to take care
of all these problems.
IP Services
Delivery service of IP is minimal
IP provides un unreliable connectionless best effort service.
Unreliable: IP doesn’t make an attempt to recover lost packets
Packet can be lost, duplicated, delayed, out-of-order
No notification of such problems
Best-effort: Does not make guarantees on the service
• Makes earnest attempt to deliver (IPv4 provides no error control or flow
control, No throughput output, No delay guarantee)
Connectionless
Each Packets treated independently
Purpose of the IP
IP: protocol that defines delivery service
Specifies basic unit of transfer
Exact format of data
Performs the routing function
Chooses the paths for packets
Includes rules for unreliable packet delivery
How hosts and routers process packets
How and when error messages are generated
When packets can be discarded
5
Datagram:
• Packets in the IPv4 layer are called datagrams
• The datagram begins with a header followed by a data (or payload)
• The header is 20 to 60 bytes in length and contains information essential to routing and delivery.
• It is an 4 byte section (i.e. 32 bits)
• The size of a datagram is determined by the application that sends data.
• Allowing the size of datagrams to vary makes IP adaptable to a variety of applications.
Datagram Format
Version (VER)
• This 4-bit field defines the version of the IPv4 protocol.
• Currently the version is 4. (0100)
• For IPV6 – version is 6 – represented as 0110
• This field tells the IP software running in the processing
machine the datagram format is 4
• If the version of IP changes, then the datagram is
discarded .
Header length (HLEN)
• This 4-bit field defines the total length of the datagram
header in 4-byte words.
• The length of header is variable length from 20 to 60
bytes
• If there are no option, the value of field is 5 ( 5 x 4 – 20
bytes)
• If the value of field is 15 (15 x 4 = 60 bytes)
• The value of the field varies from 0 to 15
Datagram Format
Services
• IETF (Internet Engineering Task Force) has changed the
interpretation and name of this 8-bit field.
• This field previously called service type,
is now called differentiated services.
• In service type the
first 3 bits are called precedence bits.
• defines priority of the datagram – during congestion
• starts from 000 to 111
• If a router is congested
needs to discard some datagram’s
• lowest precedence are discarded first
• The next 4 bits
• The next 4 bits is type of service (TOS) bits with only one bit set.
The last bit is not used.
TOS bits Description
• 0000 - Normal service
• 1000 - Minimize Delay (D)
• 0100 - Maximize Throughput (T)
• 0010 - Maximize Reliability (R)
• 0001 - Minimize Cost (C)
Datagram Format
• Differentiated service
• In differentiated services
• 6 bits define code point , last 2 bits
unused.
• In code point
• If rightmost 3 bits are 0s, the 3 leftmost
bits are same as precedence.
• If 3 rightmost bits are not all 0s, the 6 bits
define 64 services based on the priority
assignment by the Internet or local
authorities.
• First category (Numbers 0,2,4, ….62) - is
assigned by Internet authority
• Second category (Numbers 3, 7,11, 15 …..61) –
by Local authority
• Third category (1, 5, 9, ….61) - is temporary
and used for experimental purpose
Datagram Format
Total length
• The 16-bit field defines the total length (header plus data).
• The total length of the IPv4 datagram is restricted to 65,535
bytes (216 - 1).
• If the length is large for certain lower layer protocols, then
fragmentation is done.
• Some lower layer protocols impose minimum payload length,
in such case padding is done.
Time to live
• Defines lifetime of the datagram.
• This field is used to control the maximum number of hops
(routers) visited by the datagram.
• When the source host sends a datagram, it stores a number.
• Each router that processes the datagram decrements this
number by 1.
• If the value becomes zero, the datagram is discarded.
• Default is 64
• Problems
Setting it too high the packet will loop a lot
Setting it too low the packet will not reach the destination
Datagram Format
Protocol
• This 8-bit field defines the higher-level protocol that uses the
services of the IPv4 layer.
• An IPv4 datagram can encapsulate data from several higher-
level protocols such as TCP, UDP, ICMP, and IGMP.
• The values are
Time stamp
The drawbacks of IPv4
2. The Internet must accommodate real-time audio and video transmission that requires
minimum delay strategies and reservation of resources are not provided in IPv4.
3. The Internet must provide encryption and authentication of data for some applications. No
encryption or authentication is provided by IPv4.
Review Questions
1. Which field among flag, offset, TOS and identifier, in the
IPv4 datagram is not related to fragmentation?
2. The TTL field has value 10. How many routers (max) can
process this datagram?
3. In IPv4, what is the length of data field given an HLEN value
of 12 and total length value is 40000?
Answers
1. TOS (TOS-type of service identifies the type of packets. It is not related to fragmentation
but is used to request specific treatment such as high throughput, high reliability or low
latency for the IP packet depending upon the type of service it belongs to.)
2. 10 (TTL stands for Time to Live. This field specifies the life of the IP packet based on the
number of hops it makes (Number of routers it goes through). TTL field is decremented by
one each time the datagram is processed by a router. When the value is 0, the packet is
automatically destroyed.)
3. 39952 (12*4=48, 40000-48=39952)
(Week 8) Session -7
Network Layer Protocol- IPv6
Why IPv6
Shortage of IPv4 addresses
Internet is expanding very rapidly in developing countries like India, China
New devices like phones need IP address
End-to-End Reachability is not possible without IPv6
New Features like Autoconfiguration, better support for QoS, Mobility and
Security, Route Aggregation, Jumbo Frames
The advantages are:
Larger address space
• An IPv6 address is 128 bits long. Compared with the 32-bit address of IPv4
Is a huge (296) increase in the address space.
New options
• IPv6 has new options to allow for additional functionalities.
Each block is then converted into Hexadecimal and separated by ‘:’ symbol:
Even after converting into Hexadecimal format, IPv6 address remains long. IPv6 provides some rules to shorten the
address.
The rules (Address Abbreviation Rule)are as follows
Rule.1: Discard leading Zero(es):
In Block 5, 0063, the leading two 0s can be omitted, such as (5th block):
Rule.2: If two of more blocks contain consecutive zeroes, omit them all and replace with double colon sign :: , such as
(6th and 7th block):
Consecutive blocks of zeroes can be replaced only once by ::
Rule.3: so if there are still blocks of zeroes in the address, they can be shrunk down to a single zero, such as (2nd
block):
IPv6 Addressing
FC
IPv6 Packet Format
• The IPv6 packet is shown below.
• Each packet is composed of
A mandatory Base Header (40 Bytes) followed by the Payload (65,535 Bytes) of
information.
• The payload consists of two parts:
Optional extension headers
Data from upper layers.
Format of IPv6 Datagram
Version
The 4-bit field
Defines the version number of the IP is 6
Priority
8-bit field defines, the header that follows the base header in
the datagram.
Hop limit
8-bit hop limit field serves the same purpose as the TTL field
in IPv4.
Format of IPv6 Datagram
Source address
16-Byte (128-bit) Internet address
- Congestion Controlled -
If a source adapts itself to traffic slowdown when there is
Congestion, the traffic is referred to as congestion-
controlled traffic.
- Non-Congestion Controlled.
Flow Label
• To a router, a flow is a sequence of packets that share the same
characteristics,
such as traveling the same path, using the same
resources, having the same kind of security, etc.
sent from a source to a destination that needs special handling is
called flow of packets.
• The combination of source address and the flow label uniquely
define a flow of packets.
• A router that supports the handling of flow labels has a flow
label table.
Extension Headers
• The length of the base header is fixed at 40 bytes.
Gives greater functionality to the IP datagram,
Can be followed by up to six extension headers.
Many of these headers are options in IPv4.
• Six types of extension headers are:
• Six types of extension headers are:
1. Hop-by-Hop Option
• Used when the source needs to pass information to all routers visited by the datagram.
The three options are Pad-1, Pad-N, and jumbo payload.
• The Pad1 and Pad-N option is designed for alignment purposes.
• The jumbo payload option
-Define a payload longer than 65,535 bytes.
2.Source Routing
• Combines the concepts of the strict source route and the loose source route options of
IPv4.
3.Fragmentation
• Only the original source can fragment.
• A source must use a path MTU discovery technique to find the smallest MTU supported
by any network on the path.
• The source then fragments using this knowledge.
4.Authentication
• Validates the message sender and ensures the integrity of data.
5.Encrypted Security Payload
• An extension that provides confidentiality and guards against eavesdropping.
6.Destination Option
• Used when the source needs to pass information to destination only.
• Intermediate routers cannot access this information.
Review Questions
1. Which character(s) are used to express a string of zeros
inside of a IPv6 address?
2. How many bits are in an IPv6 address?
3. In the IPv6 header, the traffic class field is similar to which
field in the IPv4 header?
4. IPv6 does not use _________ type of address.
5. The _________ field determines the lifetime of IPv6
datagram
Answers
1. ::
2. 128
3. TOS
4. Broadcast
5. Hop limit
Session 8:
Routing Protocols- Distance
Vector& Link State
3
Routing Protocol
Routing protocols are the set of rules used by the routers to communicate between source & destination.
Each protocol has its own algorithm to choose the best path.
The metrics by routing protocols ,
*Number of network layer devices along with the path (hop count)
*Bandwidth
*Delay
*Load
*MTU (maximum transmission unit)
*Cost
Routing protocols store the result of these metrics in routing table.
TYPES OF ROUTING PROTOCOL
STATIC ROUTING
DYNAMIC ROUTING
1. DISTANCE
RIP- RIPv1 , RIPv2
IGRP
2.LINK STATE VECTOR
EIGRP
OSPF
Interior and Exterior routing protocols
Autonomous system(AS) is a group of networks and
routers under single administration.
Intradomain-Routing inside the AS and Interdomain-
Routing between AS
41
Distance Vector Routing
42
Updating routing table
When a node receives a two-column table from a neighbor, it needs
to update its routing table.
1. The receiving node needs to add the cost between itself and the sending
node to each value in the second column.
2. The receiving node needs to add the name of the sending node to each row
as the third column (next node).
3. The receiving node needs to compare each row of its old table with the
corresponding row of the modified version of the received table.
a. If the next-node entry is different, the receiving node chooses the row with the smaller cost.
If there is a tie, the old one is kept.
b. If the next-node entry is the same, the receiving node chooses the new row.
43
Distance vector routing
Initialization of tables in distance vector routing:
infinite ∞ (
unreachable).
Think the node as the cities and the lines as
the roads connecting them
44
Distance vector routing
45
Distance vector routing
The least cost route between any two nodes is the route with min
distance.
46
Distance vector routing
1. Each router shares its entire routing table with its
neighbours.
2. Sharing:
periodically update :on the order of several seconds -30s-
Triggered update: The change can result from the
following:
A node receives a table from a neighbor, resulting in changes in its
own table after updating.
A node detects some failure in the neighboring links which results in
a distance change to infinity ∞
47
Two-Node Loop Instability
An age – prevents the old LSP’s from remaining in the domain for the longer
time.
Keep on doing so we can formulate the shortest path tree and once we
find it , the routing table for A to reach all other nodes by shortest
path can be calculated.
Routing Issues:
Delivery, Forwarding, and
Routing
Delivery
The network layer supervises the handling of the packets by the underlying
physical networks. We define this handling as the delivery of a packet.
Direct versus Indirect Delivery
Forwarding
Forwarding means to place the packet in its route to its destination.
Forwarding requires a host or a router to have a routing table
Forwarding techniques to make the size of the routing table manageable
Next-hop method versus route method
Network-specific method versus host-specific method
Default method
Forwarding Techniques
It makes the size of the routing table manageable and also
handle issues such as security.
Route method versus next-hop method
Forwarding Techniques
Host –specific versus network-specific method
• Default method
Network Specific method
Network specific method reduces the routing table and
simplifies the searching process.
Instead of having an entry for every destination host
connected to same physical network , only one entry that
defines the address of the destination network.
In other words, we treat all hosts connected to same network
as one single entity.
Forwarding Process
In classless addressing, we need at least four columns in a routing
table
Example
Make a routing table for router R1, using the configuration in Figure
Example
Routing table for router R1