SlideShare a Scribd company logo
1 of 220
Download to read offline
Unit-2 Internet Protocol
Prof. D. P. Mishra
Digitally signed by Prof. D. P. Mishra
DN: cn=Prof. D. P. Mishra, o=DURG, ou=BIT, email=dpmishra@bitdurg.ac.in, c=IN
Date: 2021.04.28 11:47:05 +05'30'
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Purpose of IP
• Primary Network communication protocol
• IP relays/transfers network packet called datagrams
• Introduced in 1974 by vint cerf and bob kahn
• IP was datagram service included with TCP for providing
connectionless services
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Primary responsibility ..
• To provide legitimate network address and encapsulation
• Routing packets from one or many IP based networks
• Primary functionality is to provide identification of computer host nd
location service
• IP is main protocol of network layer which is responsible for
exchanging messages/datagrams/packets
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Internet Protocol Version 4
(IPv4)
• Internet Protocol is one of the major protocols in the TCP/IP
protocols suite.
• This protocol works at the network layer of the OSI model and at the
Internet layer of the TCP/IP model.
• Thus this protocol has the responsibility of identifying hosts based
upon their logical addresses and to route data among them
over the underlying network.
• IP provides a mechanism to uniquely identify hosts by an IP
addressing scheme.
• IP uses best effort delivery, i.e. it does not guarantee that packets
would be delivered to the destined host, but it will do its best to
reach the destination.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
IPV4 Header
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Header Details
• VER: Version of the IP protocol (4 bits), which is 4 for IPv4
• HLEN: IP header length (4 bits), which is the number of 32 bit words in the
header. Minimum value for this field is 5 and the maximum is 15
• Type of service: Low Delay, High Throughput, Reliability (8 bits)
• Total Length: Length of header + Data (16 bits), which has a minimum value
20 bytes and maximum is 65,535 bytes
• Identification: Unique Packet Id for identifying the group of fragments of a
single IP datagram (16 bits)
• Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment
flag, more fragments flag (same order)
• Fragment Offset: Specified in terms of number of 8 bytes, which has the
maximum value of 65,528 bytes
• Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to loop in
the network
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Protocol field
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Protocol Hex Value Decimal Value
Reserved 00 0
ICMP 01 1
IGMP 02 2
GGP (Gateway to Gateway) 03 3
IP-in-IP Encapsulation 04 4
TCP 06 6
EGP (Exterior Gateway Protocol) 08 8
UDP 11 17
ESP 32 50
AH 33 51
Header checksum
• Computed over header to provide protection against corruption in
transmission
• Calculated by dividing header bytes in words and then adding them
together
• It only considers header portion not payload
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Other fields
• Source address – Sender address
• Destination address - final destination (receiver)
• Options – Timestamp, record route taken , specify the list of routers
to visit
6th
Sem
CSE
-
Internetworking
With
TCP/IP
ARP , RARP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
The Address Resolution Protocol(ARP) maps a logical address to a physical address.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RARP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RARP
• RARP – obsolete Protocols
• BOOTP and others are in use
• RARP allows/supports only IP, No DG & DNS
• BOOTP Supports all
Proxy ARP
• Proxy ARP is a technique by which a proxy server on a given
network answers the Address Resolution Protocol (ARP) queries for
an IP address that is not on that network.
• The proxy is aware of the location of the traffic's destination and
offers its own MAC address as the (ostensibly final) destination.
• Proxy ARP is used between one more networks. In other words, we
can say that Proxy ARP provides data link discovery between
different networks.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Think about that, PC 1 want to ping PC 4 and it does not have PC 4’s MAC address
in its ARP Cache.
Here, the router has also an ARP Cache. We assume that Router’s ARP Cache has
only its interfaces at the beginning.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Think about that, PC 1 want to ping PC 4 and it does not have PC 4’s MAC address in its ARP
Cache. Here, the router has also an ARP Cache. We assume that Router’s ARP Cache has
only its interfaces at the beginning.
Firstly PC 1 sends a broadcast ARP Request to learn MAC address
of destination PC 4. With the other PCs in the same network, the first
network side interface of the router will also receive this broadcast.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Router detects that the destination is not in this network but it knows
the other network. So, router sends an ARP Reply to PC 1 with its
own interface MAC address. This message means that:
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Router checks its ARP Cache and it does not find any
record about PC 4’s IP address and MAC Address. So, it
sends a broadcast ARP Request to the second network.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
PC 4 in the second network, determines that the router that is being looked for is himself. It sends an ARP Reply,
that means :
“This is me!”
BOOTP
• The Bootstrap Protocol (BOOTP) is a computer networking protocol used in Internet Protocol
networks
• BOOTP automatically assign an IP address to network devices from a configuration server.
• The BOOTP was originally defined in RFC 951.
• BOOTP is implemented using the User Datagram Protocol (UDP) for transport protocol,
• BOOTP operates only on IPv4 networks.
• Port number 67 is used by the (DHCP) server for receiving client-requests and port number 68
is used by the client for receiving (DHCP) server responses.
• DHCP is based on BOOTP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• Port number 67 is used by the server for receiving client-requests and
• Port number 68 is used by the client for receiving (DHCP) server responses.
ICMP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
ICMP
• IP is unreliable protocol.
• Provides connectionless service for delivering datagram.
• IP is not having error correction and reporting mechanism.
• What happens if something goes wrong, what if router discards
packet if it doesn’t find route for the packet.
• IP also lacks in mechanism for lost and management queries.
• ICMP is designed to compensate the above deficiency.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Position of ICMP in N/W Layer
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• ICMP is network layer protocol
• However its messages are not directly passed to lower layer
• Messages are first encapsulated in IP datagram before going to lower layer.
ICMP Message
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Types of ICMP Messages
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
ICMP Error Reporting
ICMP Query Messages
6th
Sem
CSE
-
Internetworking
With
TCP/IP
ICMP Message Format
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• ICMP has 8-byte header and variable size data section
• Although general format of header is different for each message
type but the first four bytes are common to all
Source Quench
• Source Quench is an ICMP based mechanism used by network
devices to inform data sender that the packets can not be forwarded
due to buffers overload.
• When the message is received by a TCP sender, that sender should
decrease its send window to the respective destination in order to
limit outgoing traffic
• Source quench message is request to decrease traffic rate for
messages sending to the host(destination)
• ICMP will take source IP from the discarded packet and informs to
source by sending source quench message
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Source Quenching ..
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• Then source will reduce the speed of transmission so that router will free for congestion.
• When the congestion router is far away from the source the ICMP will send hop by
hop source quench message so that every router will reduce the speed of
transmission.
IGMP
• IP communication involves in two types of communication
• Unicast and multicast
• Unicast is in between sender and receiver one-to-one
• Multicast is one-to-many
• E.g. stock brokers, travel agents and applications like learning and
video on demand
• For Multicasting Class D IP address is used
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Routing Protocol in Computer
Network
• Routing is the process of
selecting a path for traffic in a
network or between or across
multiple networks.
• Broadly, routing is performed in
many types of networks, including
circuit-switched networks, such as
the public switched telephone
network (PSTN), and computer
networks, such as the Internet.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Delivery
• The network layer examines the handling of packets by the
underlying networks.
• This handling is referred to as delivery of a packet.
• The delivery of packet (source to final destination) can be
achieved by two methods:
1. Direct delivery
2. Indirect Delivery
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Direct delivery
• In this method, the source and destination of the packets are located
on the same network.
• The sender can determine, if the delivery is direct.
• With the help of masking, the sender can extract the network
address of the destination and compares this address with the
addresses of the connected networks.
• If the match is found, then the delivery is direct.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Indirect Delivery
• In this method, the destination host is not on the same network as
the deliverer. The packet is not delivered directly.
• The packet moves from router to router until it reaches the same
physical network as its final destination.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Direct vs Indirect
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Administrative Distance
• Administrative Distance (AD) is used to rate the trustworthiness
of routing information received from the neighbor router.
• AD is a numeric value which can range from 0 to 255.
• A smaller Administrative Distance (AD) is more trusted by a
router, therefore the best
• Administrative Distance (AD) being 0 and the worst, 255.
• The route with the least AD will be selected as the best route to
reach the destination remote network and that route will be placed
in the routing table.
• It defines how much reliable a routing protocol is.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Routing
• To route IP packets, a host or a router has a routing table with entries for each
destination or a combination of destinations.
• A static routing table contains information, which is entered manually.
• The administrator enters the route for each destination into the table.
• Dynamic routing table is updated periodically by using dynamic protocols like
RIP, OSPF or BGP.
• The main function of the network is to route the packets from source to
destination.
• More than one route is possible in every network, however the shortest route
should be selected.
• The shortest route means, a route which passes through the least number of
nodes to reach the destination.
• The routing algorithm is designed to find the shortest root and it is part of a
network software.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Classification
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Static(non adaptive) Routing
• Routing is done by the Network Administrators manually.
• All the possible paths which are already calculated are loaded into the routing
table.
• This setting will describe the path from a packet to its destination
Pros:
• On the router CPU, there is no processing time (overhead).
• Security guarantees. Suitable for smaller networks
Cons:
• Administrators must be able to understand internetwork on a system and router,
in order to connect and function correctly.
• On large scale computer networks static routing is not suitable for use.
• Inability to respond quickly in case of network failure.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Dynamic Routing
• The routing process is done by creating an automatic data communication path.
• Dynamic routing can change their routing decision on the basis of some changes
made in the topology.
• Dynamic routing is located at the computer layer network layer in the TCP / IP
Protocol Suites.
Advantage:
• Easier to use than static and default routing.
Cons
• Router workloads become heavy because of updates to the routing table at a
certain time.
• The speed of recognition and completeness of the routing table requires a long
time.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Default Routing
• The default route establishes a forwarding rule for packets when
no specific address of a next-hop host is available from
the routing table or other routing mechanisms.
• A default route is the route that takes effect when no other route is
available for an IP destination address.
• The default route in IPv4 is designated as 0.0.0.0/0 or simply 0/0
• The default route generally has a next-hop address of another
routing device,
6th
Sem
CSE
-
Internetworking
With
TCP/IP
An autonomous system (AS)
• AS is a network or group of networks
• Under one administrative group or organization
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Intradomain vs Interdomain
• Routing inside an autonomous system is referred to as intra-
domain routing, e.g. Distance vector
• Routing between two or more autonomous systems can be referred to
as inter-domain routing, e.g. Path Vector
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Intra-domain Routing Inter-domain Routing
Routing takes place within an
autonomous network.
Routing takes place between the
two autonomous networks.
This protocol ignores the internet outside
the autonomous system.
This protocol assumes that internet consists of
a collection of interconnected autonomous
systems.
Protocols for Intra-domain routing are
called as interior gateway protocols.
Protocol for Inter-domain routing are also
called as exterior gateway protocols.
Examples: RIP and OSPF etc. Example: BGP
Distance Vector Routing
• Distance vector routing is the dynamic routing algorithm and also
known as Bellman-Ford routing algorithm and Ford-
Fulkerson algorithm.
• It was designed for small network topologies.
• In this algorithm, node router constructs a table containing the
distance (total cost of path) to all other nodes and distributes that
vector to its immediate neighbors.
• For distance vector routing, it is assumed that each node knows the
cost of the link to each of its directly connected neighbors.
• A link, which is 'down' (which is not working) is assigned as an
infinite cost.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Distance Vector Routing ..
6th
Sem
CSE
-
Internetworking
With
TCP/IP
 Every node sends a message to its directly connected neighbors For example: A sends its information
to B and F.
 After communicating to each directly connected node, the shortest path can be easy to compute (as
shown in above table).
Advantages of distance Vector
• Distance vector routing protocol is easy to implement in small
networks.
• Debugging is very easy in the distance vector routing protocol.
• This protocol has a very limited redundancy in a small network.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Issues with the Distance Vector
Routing are:
• It takes long time for convergence due to growth in the
network (slower to converge than link state)
• It is at risk from the count-to-infinity problem.
• Vulnerability to the 'Count-to-Infinity' problem is a serious issue
with the distance vector.
• It creates more traffic than link state since a hop count change
must be propagated to all routers and processed on each router.
•
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Link state routing
• It is a dynamic type routing algorithm.
• In this method, one or more routers can be connected by using LAN.
• When a router is booted, it sends a special request (HELLO packet) message on
each point-to-point line.
• Then second router sends back a reply and asks who is it and the communication
starts.
• To determine the cost of line or path, the router sends an ECHO packet over the
line which the other router is required to send back immediately.
• By measuring the round-trip time and dividing it by two, the router (sender) can
get a reasonable estimate of the delay.
• Link state packet can be constructed periodically or after the occurrence of some
significant event. For example: if a line or neighbor is down or it may be coming
back.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Example.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Basic algorithm to distribute the
link state packets:
• Each state packet has a sequence number and it is incremented
for each sent packet.
• Routers can track all the source routers and sequence.
• When a new link state packet arrives, it is checked against the
list of packets already entered.
• If the packet is new, it is forwarded on all lines (except on
which it is arrived ie flooding) and discarded, if the packet is
duplicate.
• If the sequence number is lower (than the highest one), it is
rejected.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Changes to improve basic algo
• Once the router accumulates full set of link state packets, it can
construct the entire subnet graph and
• Dijkshtra's algorithm can be used to construct the shortest path to
all possible destination.
• Link state routing protocol uses event driven updates rather than
periodic updates.
• Link state routing protocol is widely used in actual networking
system.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Classification
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Routing Information Protocol
(RIP).
• The RIP is an intra-domain routing protocol.
• It is based on distance vector routing.
• In Implementation of RIP, the following steps are taken into
consideration:
1. The routers have routing tables, but network does not have routing table.
2. The destination in routing table is a network, this states that the first
column defines a network address.
3. The metric in RIP is called a hop count.
4. Infinity is defined as 16, which means that any route in an
autonomous system using RIP cannot have more than 15 hops.
5. The next-node column defines the address of the router to which the
packet is to be sent to reach its destination.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP ..
• Dynamic Routing Protocol
• It is a distance vector routing protocol
• It has AD value 120 and works on the application layer of OSI
model.
• RIP uses port number 520
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Working of RIP
• If there are 8 routers in a network
where
• Router 1 wants to send the data to
Router 3.
• If the network is configured with RIP, it
will choose the route which has the least
number of hops.
• There are three routes in the above
network, i.e., Route 1, Route 2, and
Route 3.
• The Route 2 contains the least number
of hops, i.e., 2 where Route 1 contains 3
hops, and Route 3 contains 4 hops,
• So RIP will choose Route 2.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Let's look at another example
• Suppose R1 wants to send the
data to R4.
• There are two possible routes to
send data from r1 to r2.
• As both the routes contain the
same number of hops, i.e., 3, so
• RIP will send the data to both the
routes simultaneously.
• This way, it manages the load
balancing, and data reach the
destination a bit faster.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
How RIP updates its Routing
table
The following timers are used to update the routing table:
RIP update timer : 30 sec
• The routers configured with RIP send their updates to all the neighboring routers every 30
seconds.
RIP Invalid timer : 180 sec
• The RIP invalid timer is 180 seconds, which means that if the router is disconnected from the
network or some link goes down, then the neighbor router will wait for 180 seconds to take the
update.
• If it does not receive the update within 180 seconds, then it will mark the particular route as not
reachable.
IP Flush timer : 240 sec
• The RIP flush timer is 240 second which is almost equal to 4 min means that
• If the router does not receive the update within 240 seconds then the neighbor route will remove
that particular route from the routing table which is a very slow process as 4 minutes is a long
time to wait.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Advantages of RIP
• It is easy to configure
• It has less complexity
• The CPU utilization is less.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Disadvantages of RIP
• In RIP, the route is chosen based on the
hop count metric.
• If another route of better bandwidth is
available, then that route would not be
chosen.
• Let's understand this scenario through an
example.
• We can observe that Route 2 is chosen in
the figure as it has the least hop count.
• The Route 1 is free and data can be
reached more faster; instead of this, data
is sent to the Route 2 that makes the
Route 2 slower due to the heavy traffic.
• This is one of the biggest disadvantages of
RIP.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Disadvantages of RIP..
• The RIP is a classful routing protocol, so it does not support the VLSM (Variable
Length Subnet Mask).
• It broadcasts the routing updates to the entire network that creates a lot of traffic.
• In RIP, the routing table updates every 30 seconds. Whenever the updates occur, it
sends the copy of the update to all the neighbors except the one that has caused the
update.
• It faces a problem of Slow convergence. Whenever the router or link fails, then it often
takes minutes to stabilize or take an alternative route; This problem is known as Slow
convergence.
• RIP supports maximum 15 hops which means that the maximum 16 hops can be
configured in a RIP
• The Administrative distance value is 120 (Ad value). If the Ad value is less, then the
protocol is more reliable than the protocol with more Ad value.
• The RIP protocol has the highest Ad value, so it is not as reliable as the other routing
protocols.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Source - cisco
D. V . Summary ..
• Assume:
 Each router knows only address/cost of neighbors
• Goal:
 Calculate routing table of next hop information for each destination
at each router
• Idea:
 Tell neighbors about learned distances to all destinations
6th
Sem
CSE
-
Internetworking
With
TCP/IP
DV Algorithm
• Each router maintains a vector of costs to all destinations
• Initialize neighbors with known cost, others with infinity
• Periodically send copy of distance vector to neighbors
• On reception of a vector, if neighbors path to a
destination plus neighbor cost is better, then switch to
better path
• Update cost in vector and next hop in routing table
• Assuming no changes, will converge to shortest paths
6th
Sem
CSE
-
Internetworking
With
TCP/IP
DV Example – Initial Table at A
D
G
A
F
E
B
C
Dest Cost Next
B 1 B
C 1 C
D  -
E 1 E
F 1 F
G  -
6th
Sem
CSE
-
Internetworking
With
TCP/IP
DV Example – Final Table at A
• Reached in a single iteration … simple example
D
G
A
F
E
B
C
Dest Cost Next
B 1 B
C 1 C
D 2 C
E 1 E
F 1 F
G 2 F
6th
Sem
CSE
-
Internetworking
With
TCP/IP
What if there are changes?
• One scenario: Suppose link between F and G fails
1. F notices failure, sets its cost to G to infinity and tells A
2. A sets its cost to G to infinity too, since it learned it from F
3. A learns route from C with cost 2 and adopts it
D
G
A
F
E
B
C
XXXXX
Dest Cost Next
B 1 B
C 1 C
D 2 C
E 1 E
F 1 F
G 3 C
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• Simple example
 Costs in nodes are to reach Internet
• Now link between B and Internet fails …
Count To Infinity Problem
Internet
A/2 B/1
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Count To Infinity Problem
• B hears of a route to the Internet via A with cost 2
• So B switches to the “better” (but wrong!) route
update
Internet
A/2 B/3
XXX
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Count To Infinity Problem
• A hears from B and increases its cost
update
Internet
A/4 B/3
XXX
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Count To Infinity Problem
• B hears from A and (surprise) increases its cost
• Cycle continues and we “count to infinity”
• Packets caught in the crossfire loop between A and B
update
Internet
A/4 B/5
XXX
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Split Horizon
• Solves trivial count-to-infinity problem
• Split horizon is a method of preventing a routing loop in a network.
• The basic principle is simple: Information about the routing for a
particular packet is never sent back in the direction from which
it was received.
• Split horizon can be achieved by means of a technique called poison
reverse
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Poison reverse
• A poison reverse is a way in which a gateway node tells its
neighbor gateways that one of the gateways is no longer
connected.
• To do this, the notifying gateway sets the number of hops to the
unconnected gateway to a number that indicates "infinite"
(meaning "You can't get there").
• Since RIP allows up to 15 hops to another gateway, setting the
hop count to 16 would mean "infinite.“
• This is the equivalent of route poisoning all possible reverse
paths
• Split horizon with poison reverse is more effective than simple
split horizon in networks with multiple routing paths
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP – More Details
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP - Routing Information
Protocol
• RIP supports dynamic routing
• Based on Distance vector uses hop count as metric
• A simple intradomain/IGP(Interior gateway Protocol)
• Open Standard , based on distance vector
• Classful routing protocol (Doesn’t support subnetting)
• Each router advertises its distance vector every 30 seconds (or
whenever its routing table changes) to all of its neighbors
• Maximum hop count is 15, with “16” equal to “”
• Administrative distance (AD Value) is 120
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIPv1
RIP Characteristics
 A Classful, Distance Vector (DV) routing protocol
 Metric = hop count
 Routes with a hop count > 15 are unreachable
 Updates are broadcast every 30 seconds
 Used for smaller network
 Router rip command is used for configuring router
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIPv1 Packet Format
IP header UDP header RIP Message
Command Version Set to 00...0
32-bit address
Unused (Set to 00...0)
address family Set to 00.00
Unused (Set to 00...0)
metric (1-16)
one
route
entry
(20
bytes)
Up to 24 more routes (each 20 bytes)
32 bits
One RIP message can
have up to 25 route entries
1: request
2: response
2: for IP
0…0: request full rou-
ting table
Address of destination
Cost (measured in hops)
1: RIPv1
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIPv2
• RIPv2 is an extends RIPv1:
 Subnet masks are carried in the route information
 Authentication of routing messages
 Route information carries next-hop address
 Exploites IP multicasting
• Extensions of RIPv2 are carried in unused fields of RIPv1 messages
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIPv2 Packet Format
IP header UDP header RIP Message
Command Version Set to 00...0
32-bit address
Unused (Set to 00...0)
address family Set to 00.00
Unused (Set to 00...0)
metric (1-16)
one
route
entry
(20
bytes)
Up to 24 more routes (each 20 bytes)
32 bits
One RIP message can
have up to 25 route entries
1: request
2: response
2: for IP
0…0: request full rou-
ting table
Address of destination
Cost (measured in hops)
2: RIP v
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIPv2 Packet Format
IP header UDP header RIPv2 Message
Command Version Set to 00.00
IP address
Subnet Mask
address family route tag
Next-Hop IP address
metric (1-16)
one
route
entry
(20
bytes)
Up to 24 more routes (each 20 bytes)
32 bits
Used to carry information
from other routing
protocols (e.g.,
autonomous system
number)
Identifies a better next-hop
address on the same
subnet than the advertising
router, if one exists
(otherwise 0….0)
2: RIPv2
Subnet mask for IP
address
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP Timers
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Update Timer 30 Sec
Hold on timer 180 Sec
Invalid Timer (30 +
150=180 Sec)
Flush Timer(180
+60=240 Sec) - Route is
purged after 4 min
• Invalid Timer : specifies how long a routing entry can be in the routing table without being updated. This is also called
as expiration
• Flush timer : controls the time between the route is invalidated or marked as unreachable and removal of entry from
the routing table
• hold-on timer: is started per route entry, when the hop count is changing from lower value to higher value. This allows
the route to get stabilized.
RIP Messages
• This is the operation of RIP in routed.
• Dedicated port for RIP is UDP port 520.
• Two types of messages:
 Request messages
 used to ask neighboring nodes for an update
 Response messages
 contains an update
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Routing with RIP
• Initialization: Send a request packet (command = 1, address
family=0..0) on all interfaces:
 RIPv1 uses broadcast if possible, 255.255.255.255
 RIPv2 uses multicast address 224.0.0.9, if possible
• Requesting routing tables from neighboring routers
• Request received: Routers that receive above request send their
entire routing table
• Response received: Update the routing table
• Typically, there is a routing daemon (routed) that is an application
layer process that provides access to routing tables.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Routing with Rip Cont.
• Regular routing updates: Every 30 seconds, send all or part of
the routing tables to every neighbor in an response message
• Triggered Updates: Whenever the metric for a route change, send
entire routing table.
• If a router does not hear from its neighbor once every 180 seconds,
the neighbor is deemed unreachable.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP Convergence
• Takes more time to converge
• RIP requires less CPU power and RAM than other routing protocols
• Router advertises details to its neighbors
• Routing by rumors, similar to rumor spread by peoples living in
locality/neighbors
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Security
• Issue: Sending bogus routing updates to a router
• RIPv1: No protection
• RIPv2: Simple authentication scheme
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP Security
IP header UDP header RIPv2 Message
Command Version Set to 00.00
Password (Bytes 0 - 3)
Password (Bytes 4 - 7)
0xffff Authentication Type
Password (Bytes 8- 11)
Password (Bytes 12 - 15)
Authetication
Up to 24 more routes (each 20 bytes)
32 bits
2: plaintext
password
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIPV1 vs RIPV2
RIP V1
• Classful i.e. VLSM not supported
• No authentication
• Uses broadcast address as
255.255.255.255
• Max hopcount is 15
• Periodic update is of 15
RIP V2
• Classless (CIDR/VLSM) Support
• Authentication is supported
• Uses multicast address 224.0.0.9
• In todays scenario only RIPV2 is used
even
• RIPV1 is removed from CISCO
Certification
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP Advantages
• Easy to configure
• No Design constraint
• No Complexity
• Less overhead
6th
Sem
CSE
-
Internetworking
With
TCP/IP
RIP Disadvantages
• RIP takes a long time to stabilize / slow convergence
• Work only on hop count
• Bandwidth utilization is high as routing table entry is heared after
every 30 Sec
• RIP has all the problems of distance vector algorithms, e.g., count-to-
Infinity
 RIP uses split horizon to avoid count-to-infinity
• Not scalable as - The maximum path in RIP is 15 hops
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Areas in AS(Autonomous System)
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Links specific to OSPF
• In OSPF connection is called as link
• There are four types of links
 Point-to-Point link
 Transient link
 Stub link
 Virtual link
6th
Sem
CSE
-
Internetworking
With
TCP/IP
1. Point-to-Point Link
• It connects with the help of two routers without any host or router as
a mediator.
• In this type of link, there is no need to assign a network address.
• Graphically, the nodes are represented as nodes and the link is
represented by bidirectional edge connecting the nodes.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
2. Transient link
• It is a network with several
routers attached to it.
• The data can enter through any
one of the routers and pass
through any router.
• The LAN or WAN with two or
more routers are the examples of
the transient link.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
3. Stub link
• It is a network connected with
only one router.
• The data packets enter the
network through this single router
and leave the network through
this same router.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
4. Virtual link
• Virtual link is created by the administrator, when the link between
two routers is disconnected.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
OSPF(Open Shortest Path First)
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Open Shortest Path First (OSPF)
• It is an intra-domain routing protocol based on link state routing.
• To handle routing efficiently, OSPF divides autonomous systems into different areas.
• Areas are the collection of networks, hosts and routers all contained within an
autonomous system.
• An autonomous system can be divided into many different areas.
• All networks inside an area must be connected.
• Routers inside an area flood is considered as the area with routing information.
• At the border of an area, special routers called as area border routers summarize the
information about the area and send it to other areas.
• There is a special area, which is called as backbone and
• All the areas inside an autonomous system must be connected with backbone.
• Backbone serves as primary area and the other areas are served as secondary areas
6th
Sem
CSE
-
Internetworking
With
TCP/IP
OSPF ..
• The routers inside the backbone are called as backbone routers.
• If the connectivity between the backbone and an area is broken, it is
necessary to create a virtual link between routers. The administrator
creates it.
• The OSPF protocol allows the administrator to assign a cost,
called as the metric to each route.
• The metric can be assigned on the type of services like minimum
delay, maximum throughput, etc.
• The router can have multiple routing tables based on different
services.
• In OSPF, a connection is called as link.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Open Shortest Path First (RFC 1247)
• Uses IP, has a value in the IP Header (8 bit protocol field)
• Interior routing protocol, its domain is also an autonomous system
• Divides an AS into areas
• Metric based on type of service
 Minimum delay (rtt), maximum throughput, reliability, etc..
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
OSPF
• IRP/IGP
• Divides AS in different Areas
• Router inside area floods area with routing info
• ABR summarizes the routing info of concern area
• All the areas in AS are connected to backbone area in AS
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
OSPF (type of links)
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
Point-to-point Link
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
Point –to – point link defines direct connection
between routers and it can be represented as
graph with link having bidirectional arrow
Transient Link
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
This link defines network to which multiple routers are attached, in
this type of network multiple routers are connected to common
network and they have many neighbors
Stub Links
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
This link is special case of transient link, which defines a
network with only one router connected to it, packet
enters and leave the network using single link
Virtual Links
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
When the link between two routers is broken, a new link
has to be established by the administrator, which is known
as virtual link
OSPF Background ..
• Link state/Shortest Path First Technology
• Dynamic Routing
• Fast Convergence
• Route authentication
OSPF (link state advertisement)
Router Link
Network Link
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
OSPF (LSA cont.)
Summary link to Network
Summary link to AS boundary router
External Link
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
DR & BDR
• OSPF uses
a DR (Designated
Router)
and BDR (Backup
Designated Router) on
each multi-access
network. ...
• DR and BDR act as a
central point for
exchanging
of OSPF information
between multiple
routers on the same,
multi-access broadcast
network segment.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Shortest Path Calculation
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
Shortest Path Calculation
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
Shortest Path Calculation
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
Shortest Path Calculations ..
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
3
2
1
4 5
4
4
8
7
3
Visited 1 2 3 4 5
∞ ∞ ∞ ∞ ∞
{1} 0 4 ∞ 8 ∞
{1,2} 0 4 7 8 ∞
{1,2,3} 0 4 7 8 ∞
{1,2,3,4} 0 4 7 8 15
Link State Algorithm
• Each router contains a database containing a
map of the whole topology
 Links
 Their state (including cost)
• All routers have the same information
• All routers calculate the best path to every
destination
• Any link state changes are flooded across the
network
 “Global spread of local knowledge”
Link State Routing
• Automatic neighbour discovery
 Neighbours are physically connected routers
• Each router constructs a Link State Packet (LSP)
 Distributes the LSP to neighbours…
 …using an LSA (Link State Announcement)
• Each router computes its best path to every
destination
• On network failure
 New LSPs are flooded
 All routers recompute routing table
Low Bandwidth Requirements
• Only changes are propagated
• Multicast used on multi-access broadcast
networks
 224.0.0.5 used for all OSPF speakers
 224.0.0.6 used for DR and BDR routers
FDDI
Dual Ring
R1
LSA
X
LSA
“Shortest Path First”
• The optimal path is determined by the sum of
the interface costs
FDDI
Dual Ring
FDDI
Dual Ring
N1
N2 N3
N4
N5
R1
R2
R3
R4
Cost = 1 Cost = 1
Cost = 10
Cost = 10
Cost = 10
OSPF: How it works
• Hello Protocol
 Responsible for establishing and maintaining
neighbour relationships
 Elects Designated Router on broadcast networks
FDDI
Dual Ring
Hello
Hello
Hello
OSPF: How it works
• Hello Protocol
 Hello Packets sent periodically on all OSPF enabled
interfaces
 Adjacencies formed between some neighbours
• Hello Packet
 Contains information like Router Priority, Hello
Interval, a list of known neighbours, Router Dead
Interval, and the network mask
OSPF: How it works
• Trade Information using LSAs
 LSAs are added to the OSPF database
 LSAs are passed on to OSPF neighbours
• Each router builds an identical link state database
• SPF algorithm run on the database
• Forwarding table built from the SPF tree
OSPF: How it works
• When change occurs:
 Announce the change to all OSPF neighbours
 All routers run the SPF algorithm on the revised database
 Install any change in the forwarding table
Types of OSPF packets and header format
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• Link State Update packets are OSPF packet type 4.
• These packets implement the flooding of link state advertisements.
• Each Link State Update packet carries a collection of link state advertisements one hop further
from its origin.
• Several link-state advertisement may be included in a single packet.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Advantages of OSPF:
• Biggest advantage of OSPF over EIGRP is that it will run on any
device as its based on open standard
• OSPF is an open standard, not related to any particular vendor.
• It uses the SPF algorithm, developed by Dijkstra
• OSPF provide a loop-free topology.
• It provides fast convergence with triggered updates
• It supports classless / VLSM.
• Supports authentication
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
Enhanced Interior Gateway Routing Protocol (EIGRP) is an advanced distance-vector
routing protocol that is used in computer network for automating routing decisions and
configuration. (Developed by CISCO)
Disadvantages of OSPF
• It requires extra CPU processing to run the SPF algorithm
• It is bit complex to configure and more difficult to troubleshoot.
• OSPF maintains multiple copies of routing information, increasing
the amount of memory needed.
• OSPF routers check the status of other routers on the network by
sending a small hello packet at regular intervals.
• If a router does not respond to the hello packet, it is assumed dead,
and routing updates are sent to every other router by using a
multicast address.
Unit-3
Comp
Network
by
:
Prof.
D.
P.
Mishra
BITD
What Is a Router Module? .
• A router is a small device that brings together numerous networks.
• In terms of the seven layer OSI model of computer networking, a router is
considered a "Layer 3" gateway device; this means that it can move data from its
origin to its destination using one or more networks.
• In enterprise situations, a modular device has expansion slots that allow the
user the ability to add new modules as needed.
• The majority of modular devices come with a set number of fixed ports along
with the expansion slots.
• When choosing a router, selecting the type and number of ports is a major
decision. A user must ask themselves if they would purchase a router with:
• Just enough ports for today's needs?
• Both UTP and fiber ports?
• A mixture of UTP speeds.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
What Is a Router Module?..
• The user must consider carefully how many fiber ports and UTP ports are needed. At
the same time, they must also consider how many Gbps are needed as well as
bandwidth requirements.
• The modular devices come with expansion slots that give the user the flexibility to
add more modules as requirements change.
• Eg
• Ethernet port modules
• Broadband Modules
• Serial WAN Interface Module
• ISDN(BRI) Module
• Voice Modules
• SIP Proxy Module
• Analog and Digital Voice / Fax Module
6th
Sem
CSE
-
Internetworking
With
TCP/IP
IP Addressing
6th
Sem
CSE
-
Internetworking
With
TCP/IP
IPv4 supports 3-types of addressing
modes.
• Unicast Addressing Mode:
• Broadcast Addressing Mode:
• Multicast Addressing Mode:
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Unicast Addressing Mode:
• In this mode, data
is sent only to one
destined host.
• The Destination
Address field
contains 32- bit IP
address of the
destination host.
• Here the client
sends data to the
targeted server:
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Broadcast Addressing Mode:
• In this mode, the packet is
addressed to all the hosts in
a network segment.
• The Destination Address
field contains a special
broadcast address,
i.e. 255.255.255.255.
• When a host sees this
packet on the network, it is
bound to process it.
• Here the client sends a
packet, which is
entertained by all the
Servers:
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Multicast Addressing Mode:
• This mode is a mix of the
previous two modes, i.e.
the packet sent is
destined neither to a
single host nor all the
hosts on the segment.
• In this packet, the
Destination Address
contains a special
address which starts
with 224.x.x.x and can
be entertained by more
than one host.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Hierarchical Addressing Scheme
• IPv4 uses hierarchical addressing scheme. An IP address, which is
32-bits in length, is divided into two or three parts as depicted:
• A single IP address can contain information about the network and
its sub-network and ultimately the host.
• This scheme enables the IP Address to be hierarchical where a
network can have many sub-networks which in turn can have many
hosts.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Subnet Mask
• It is very necessary to distinguish both.
• For this, routers use Subnet Mask, which is as long as the size of the
network address in the IP address.
• Subnet Mask is also 32 bits long. If the IP address in binary is ANDed
with its Subnet Mask, the result yields the Network address.
• For example, say the IP Address is 192.168.1.152 and the Subnet Mask
is 255.255.255.0 then:
• It can be identified now that 192.168.1.0 is the Network number and
192.168.1.152 is the host on that network.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Binary Representation
• The positional value method is the simplest form of converting
binary from decimal value.
• IP address is 32 bit value which is divided into 4 octets.
• A binary octet contains 8 bits and the value of each bit can be
determined by the position of bit value '1' in the octet.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• Positional value of bits is determined by 2 raised to power (position – 1), that is the value of a bit
1 at position 6 is 2^(6-1) that is 2^5 that is 32.
• The total value of the octet is determined by adding up the positional value of bits. The value of
11000000 is 128+64 = 192.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Some examples
are
shown in the table
IPv4 Addressing system is
divided into five classes of IP
• All the five classes are identified by the first octet of IP Address.
• Internet Corporation for Assigned Names and Numbers is
responsible for assigning IP addresses.
• The first octet referred here is the left most of all.
• The octets numbered as follows depicting dotted decimal notation of
IP Address:
6th
Sem
CSE
-
Internetworking
With
TCP/IP
The number of networks and the number
of hosts per class can be derived by this
formula:
Class A Address
• The first bit of the first octet is always set to 0 (zero).
• Thus the first octet ranges from 1 – 127, i.e.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
• Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range 127.x.x.x is
reserved for loopback IP addresses.
• The default subnet mask for Class A IP address is 255.0.0.0 which implies that Class A
addressing can have 126 networks (27-2) and 16777214 hosts (224-2).
• Class A IP address format is thus: 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B Address
• An IP address which belongs to class B has the first two bits in the first
octet set to 10, i.e
• Class B IP Addresses range from 128.0.x.x to 191.255.x.x.
• The default subnet mask for Class B is 255.255.x.x.
• Class B has 16384 (214) Network addresses and 65534 (216-2) Host
addresses.
• Class B IP address format is:
10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Class C Address
• The first octet of Class C IP address has its first 3 bits set to 110,
that is:
• Class C IP addresses range from 192.0.0.x to 223.255.255.x.
• The default subnet mask for Class C is 255.255.255.x.
• Class C gives 2097152 (221) Network addresses and 254 (28-2) Host
addresses.
• Class C IP address format
is: 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Class D Address
• Very first four bits of the first octet in Class D IP addresses are set
to 1110, giving a range of:
• Class D has IP address rage from 224.0.0.0 to 239.255.255.255.
• Class D is reserved for Multicasting. In multicasting data is not
destined for a particular host, that is why there is no need to extract
host address from the IP address, and Class D does not have any
subnet mask.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Class E Address
• This IP Class is reserved for experimental purposes only for R&D or
Study.
• IP addresses in this class ranges from 240.0.0.0 to 255.255.255.254.
• Like Class D, this class too is not equipped with any subnet mask.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Summary
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Problems with Classful Addressing:
• The problem with this classful addressing method is that
millions of class A address are wasted,
many of the class B address are wasted,
whereas, number of addresses available in class C is so small that it
cannot cater the needs of organizations.
Class D addresses are used for multicast routing, and are therefore
available as a single block only.
Class E addresses are reserved.
• Since there are these problems,
• Classful networking/addressing was replaced by Classless
Inter-Domain Routing (CIDR) in 1993.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Subnetting
156
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Subnetting
 Creates multiple logical networks that exist within a single Class
A, B, or C network.
 If you do not subnet, you will only be able to use one network from
your Class A, B, or C network, which is unrealistic
 Each data link on a network must have a unique network ID, with
every node on that link being a member of the same network
157
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
IPv4 - Subnetting
• Each IP class is equipped with its own default subnet mask which
bounds that IP class to have prefixed number of Networks and
prefixed number of Hosts per network.
• Classful IP addressing does not provide any flexibility of
having less number of Hosts per Network or more Networks per IP
Class.
• CIDR or Classless Inter Domain Routing provides the flexibility
of borrowing bits of Host part of the IP address and using them as
Network in Network, called Subnet.
• By using Subnetting, one single Class A IP address can be used
to have smaller sub-networks which provides better network
management capabilities.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Subnetting.
• The process of dividing a single network into multiple sub networks
is called as Subnetting.
• The sub networks so created are called as subnets.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Advantages of subnetting
The main advantages of Subnetting a network are-
 It improves the security.
 The maintenance and administration of subnets is easy.
 Reduced network traffic
 Optimized network performance
Subnet ID-
 Each subnet has its unique network address known as its Subnet ID.
 The subnet ID is created by borrowing some bits from the Host ID part of the IP Address.
 The number of bits borrowed depends on the number of subnets created.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Types of Subnetting
6th
Sem
CSE
-
Internetworking
With
TCP/IP
1. Fixed Length Subnetting
• Fixed length Subnetting also called as classful
Subnetting divides the network into subnets where-
 All the subnets are of same size.
 All the subnets have equal number of hosts.
 All the subnets have same subnet mask.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
2. Variable Length Subnetting-
• Variable length Subnetting also called as classless
Subnetting divides the network into subnets where-
• All the subnets are not of same size.
• All the subnets do not have equal number of hosts.
• All the subnets do not have same subnet mask.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Example-01
Consider-
• We have a big single network having IP Address
200.1.2.0.
• We want to do Subnetting and divide this
network into 2 subnets.
• Clearly, the given network belongs to class C.
• For creating two subnets and to represent their
subnet IDs, we require 1 bit.
• So, We borrow one bit from the Host ID part.
• After borrowing one bit, Host ID part remains
with only 7 bits.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
How to create subnets
 Determine the number of required network IDs:
 One for each subnet
 One for each wide area network connection
 Determine the number of required host IDs per subnet:
 One for each TCP/IP host
 One for each router interface
 Based on the above requirements, create the following:
 One subnet mask for your entire network
 A unique subnet ID for each physical segment
 A range of host IDs for each subnet
165
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Subnetting a Class A/B/C Address
• How many subnets does the chosen subnet mask produce?
• How many valid hosts per subnet are available?
• What are the valid subnets?
• What’s the broadcast address of each subnet?
• What are the valid hosts in each subnet?
166
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Formula
1. No of subnets = 2x
- Where x is no of bits borrowed
2. No. of host = 2y – 2
- Where Y is no of o’s
3. Magic no or blocksize = Total no of addresses
Magic no/Block Size = 256 – Mask
167
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Example-01..
• If borrowed bit = 0, then it represents the first subnet.
• If borrowed bit = 1, then it represents the second subnet.
IP Address of the two subnets are-
• 200.1.2.00000000 = 200.1.2.0
• 200.1.2.10000000 = 200.1.2.128
6th
Sem
CSE
-
Internetworking
With
TCP/IP
For 1st Subnet-
• IP Address of the subnet = 200.1.2.0
• Total number of IP Addresses = 27 = 128
• Total number of hosts that can be configured = 128 – 2 = 126
• Range of IP Addresses = [200.1.2.00000000, 200.1.2.01111111] =
[200.1.2.0, 200.1.2.127]
• Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
• Limited Broadcast Address = 255.255.255.255
6th
Sem
CSE
-
Internetworking
With
TCP/IP
For 2nd Subnet-
• IP Address of the subnet = 200.1.2.128
• Total number of IP Addresses = 27 = 128
• Total number of hosts that can be configured = 128 – 2 = 126
• Range of IP Addresses = [200.1.2.10000000, 200.1.2.11111111] =
[200.1.2.128, 200.1.2.255]
• Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
• Limited Broadcast Address = 255.255.255.255
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Practice Example #1C: 255.255.255.128 (/25)
Network 192.168.10.0
 How many subnets? Since 128 is 1 bit on (10000000),
- The answer would be 21= 2.
 How many hosts per subnet?
- We have 7 host bits off (10000000), so the equation would be 27– 2 = 126 hosts.
 What are the valid subnets?
- 256 – 128 = 128. Remember, we’ll start at zero and count in our block size, so our
subnets are 0, 128.
 What’s the broadcast address for each subnet?
-The number right before the value of the next subnet is all host bits turned on and equals
the broadcast address. For the zero subnet, the next subnet is 128, so the broadcast of the 0
subnet is 127.
 What are the valid hosts?
-These are the numbers between the subnet and broadcast address
171
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Logical Network Implementation
192.168.10.0 192.168.10.128
.129
.1
.2 .3 .130 .131
172
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Practice Example #2C: 255.255.255.224 (/27)
Network 192.168.10.0
 How many subnets? 224 is 11100000, so our equation would be 23 = 8.
 How many hosts? 25– 2 = 30.
 What are the valid subnets? 256 – 224 = 32. We just start at zero and count to the
subnet mask value in blocks (increments) of 32: 0, 32, 64, 96, 128, 160, 192, and
224.
 What’s the broadcast address for each subnet (always the number right before the
next subnet)?
 What are the valid hosts (the numbers between the subnet number and the
broadcast address)?
173
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Practice Example #2C: 255.255.255.224 (/27)
Network 192.168.10.0
Subnet
Address
0 32 …………. 192 224
First Host 1 33 193 225
Last Host 30 62 222 254
Broadcast
Address
31 63 223 255
174
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Practice Example #1B: 255.255.128.0 (/17)
Network 172.16.0.0
 Subnets? 21 = 2
 Hosts? 215– 2 = 32,766 (7 bits in the third octet, and 8 in the fourth)
 Valid subnets? 256 – 128 = 128. 0, 128. Remember that subnetting
is performed in the third octet, so the subnet numbers are really 0.0
and 128.0, as shown in the next table
 Broadcast address for each subnet?
 Valid hosts?
175
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Practice Example #1B: 255.255.128.0 (/17)
Network 172.16.0.0
Subnet 0.0 128.0
First Host 0.1 128.1
Last Host 127.254 255.254
Broadcast 127.255 255.255
176
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Practice Example #2B: 255.255.240.0 (/20)
Network 172.16.0.0
• Subnets? 24= 16.
• Hosts? 212 – 2 = 4094.
• Valid subnets? 256 – 240 = 0, 16, 32, 48, etc., up to 240.
• Broadcast address for each subnet?
• Valid hosts?
177
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Practice Example #2B: 255.255.240.0 (/20) Network
172.16.0.0
Subnet 0.0 16.0 ……….. 240.0
First Host 0.1 16.1 240.1
Last Host 15.254 31.254 255.254
Broadcast 15.255 31.255 255.255
178
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
Ex-1
Suppose a network with IP Address 192.16.0.0. is divided into 2
subnets, find number of hosts per subnet.
• Also for the first subnet, find-
• Subnet Address
• First Host ID
• Last Host ID
• Broadcast Address
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
179
Solution.
• Given IP Address belongs to class C.
• So, 24 bits are reserved for the Net ID.
• The given network is divided into 2 subnets.
• So, 1 bit is borrowed from the host ID part for the subnet IDs.
• Then, Number of bits remaining for the Host ID = 7.
• Thus, Number of hosts per subnet = 27 = 128.
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
180
Solution.
For 1st Subnet-
• Subnet Address = First IP Address = 192.16.0.00000000 =
192.16.0.0
• First Host ID = 192.16.0.00000001 = 192.16.0.1
• Last Host ID = 192.16.0.01111110 = 192.16.0.126
• Broadcast Address = Last IP Address = 192.16.0.01111111 =
192.16.0.127
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
181
Ex-2
In a class B, network on the internet has a subnet mask of
255.255.240.0. What is the maximum number of hosts per subnet?
A. 4096
B. 4094
C. 4092
D. 4090
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
182
Solution.
• Number of bits reserved for network ID in the given subnet mask =
20.
• So, Number of bits reserved for Host ID = 32 – 20 = 12 bits.
• Thus, Number of hosts per subnet = 212 – 2 = 4094.
• In class B, 16 bits are reserved for the network.
• So, Number of bits reserved for subnet ID = 20 – 16 = 4 bits.
• Number of subnets possible = 24 = 16.
• Thus, Option (B) is correct.
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
183
EX-3
What is not true about Subnetting?
A. It is applied for a single network
B. It is used to improve security
C. Bits are borrowed from network portion
D. Bits are borrowed from Host portion
IP
Subnetting
&
Supernetting
-
Prof.
D.
P.
Mishra
184
Solution:
Option (C) is correct.
Supernetting
• Creating larger network
• Reverse process of Subnetting
• Combination of two or more networks
• Supernetting facilitates regional router aggregation
6th
Sem
CSE
-
Internetworking
With
TCP/IP
For Supernetting
• Need two or more Network or Subnets.
• Make the decimal network into binary value.
• Counting 0 and 1.
• Supernetting requires the use of routing protocols
• that support Classless Inter-Domain Routing (CIDR).
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Advantages of Supernet
• It reduces the size of routing updates.
• It provides a better overview of network.
• It decreases the use of resources such as Memory and CPU.
• It decreases the required time in rebuilding the routing tables.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Disadvantages of Supernetting
• The combination of blocks should be made in power 2;
• If three blocks are required, then there must be assigned four
blocks.
• The whole network should exist in the same class.
• When merged, it lacks covering different areas.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
6th
Sem
CSE
-
Internetworking
With
TCP/IP
BASIS FOR COMPARISON SUBNETTING SUPERNETTING
Basic A process of dividing a network into
subnetworks.
A process of combining small
networks into a larger network.
Procedure The number of bits of network
addresses is increased.
The number of bits of host
addresses is increased.
Mask bits are moved towards Right of the default mask. Left of the default mask.
Implementation VLSM (Variable-length subnet
masking).
CIDR (Classless interdomain
routing).
Purpose Used to reduce the address depletion. To simplify and fasten the routing
process.
Conclusion
• Subnetting and supernetting both the terms have inverse meaning
• where Subnetting is used to separate the smaller subnetworks form
each other by dividing a larger network.
• Conversely, supernetting is used to combine the smaller range of
addresses into a larger one to make routing process more easy and
fast.
• Ultimately, both techniques are used to increase the availability
of the IP addresses and reduce the depletion of IP addresses.
6th
Sem
CSE
-
Internetworking
With
TCP/IP
Security at IP Layer IPSec
IPSEC
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Fig: Security at Internet Layer as well as on upper layers too
Conceptual IPSEC Positioning
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
IPSEC Services
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
IPSEC HEADERS
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Modes of operation
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Tunnel Mode
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Tunnel Mode
Fig: Shows IPSEC in Tunnel Mode
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Transport Mode
Fig: Shows IPSEC in Transport Mode
Doesn’t hide Actual Source and Destination
Details
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
IKE (Internet Key Exchange)
Supporting Protocol of IPSEC that
results SA
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Security Association (SA):
• SA is agreement between communicating parties about factors such as
• IPSEC protocol version in use
• Mode of operation (Transport or Tunnel mode)
• Cryptographic algorithm
• Cryptographic keys and lifetime of keys etc
• Once SA is established both major protocols IPSEC (i.e. AH and ESP)
make use of it for actual operation
• Note: If both AH and ESP are used in that case communicating parties
require two set of SA one for AH and other for ESP
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
• Connect two sites securely through public network
• Allow remote access by individual users.
• Allows travelling users to remotely access private network
• If we remove VPN link then two sites will be separated with each
other
• By employing VPN two remote sites seems to be the one/single virtual
site
What is VPN ?
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Architecture of VPN
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Working of VPN.
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Working of VPN..
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Types of VPN
• Remote access VPN
• Intranet VPN
• Extranet VPN
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Remote Access VPN
• Gives access to remote or roaming users access of Main office / branch
office as shown in above block diagram
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Intranet VPN
• As shown in above block diagram Intranet VPN is used for joining
different branches of same organization.
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Extranet VPN
• As shown main branch office is connected to different business partners through
VPN, as Extranet VPN joins branch offices as well the business partners too i.e.
it’s not compulsion to provide VPN service to client branch offices only
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Advantages of VPN
• Greater scalability
• Easy to add or remove users
• Reduce long distance Telecommunication cost
• Mobility
• Scalability
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Disadvantages of VPN
• Lack of standards
• Understanding of security issues
• Unpredictable Intranet traffic
• Difficult to accommodate product from different vendors
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
Disadvantages of VPN
• Lack of standards
• Understanding of security issues
• Unpredictable Intranet traffic
• Difficult to accommodate product from different vendors
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
IPV6 Header Format
• The wonder of IPv6 lies in its header.
• An IPv6 address is 4 times larger than IPv4, but surprisingly,
• the header of an IPv6 address is only 2 times larger than IPv4.
• IPv6 headers have one Fixed Header and zero or more Optional
(Extension) Headers.
• All the necessary information that is essential for a router is kept in
the Fixed Header.
• The Extension Header contains optional information that helps
routers to understand how to handle a packet/flow.
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
IPv6 – Header.
IPv6 – Header..
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
S.N. Field & Description
1 Version (4-bits): It represents the version of Internet Protocol, i.e. 0110.
2
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).
3
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.
4
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.
5
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.
6
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.
7 Source Address (128-bits): This field indicates the address of originator of the packet.
8 Destination Address (128-bits): This field provides the address of intended recipient of the packet.
Difference between IPv4 and IPv6
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
6th
Sem
CSE
-
TCP/IP
(IPSEC-
IP
Security)
BASIS OF COMPARISON IPV4 IPV6
Address Configuration
Supports Manual and DHCP
configuration.
Supports Auto-configuration and
renumbering
End-to-end connection integrity Unachievable Achievable
Address Space It can generate 4.29 x 109 addresses.
It can produce quite a large number of
addresses, i.e., 3.4 x 1038.
Security features Security is dependent on application IPSEC is inbuilt in the IPv6 protocol
Address length 32 bits (4 bytes) 128 bits (16 bytes)
Address Representation In decimal In hexadecimal
Fragmentation performed by Sender and forwarding routers Only by the sender
Packet flow identification Not available
Available and uses flow label field in
the header
Checksum Field
Available Not available
Message Transmission Scheme
Broadcasting Multicasting and Any casting
Encryption and Authentication
Not Provided Provided
Internet Protocol.pdf

More Related Content

Similar to Internet Protocol.pdf

Similar to Internet Protocol.pdf (20)

TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
Protocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteProtocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol Suite
 
Transport Layer, Network layer.pptx
Transport Layer, Network layer.pptxTransport Layer, Network layer.pptx
Transport Layer, Network layer.pptx
 
Computer network coe351- part3-final
Computer network coe351- part3-finalComputer network coe351- part3-final
Computer network coe351- part3-final
 
ADDRESSING PADA TCP IP
ADDRESSING PADA TCP IPADDRESSING PADA TCP IP
ADDRESSING PADA TCP IP
 
Nnnnnn
NnnnnnNnnnnn
Nnnnnn
 
Ip and icmp
Ip and icmpIp and icmp
Ip and icmp
 
Chapter 4 internetworking [compatibility mode]
Chapter 4   internetworking [compatibility mode]Chapter 4   internetworking [compatibility mode]
Chapter 4 internetworking [compatibility mode]
 
Tcp ip
Tcp ipTcp ip
Tcp ip
 
Basic networking
Basic networkingBasic networking
Basic networking
 
Network Layer & Transport Layer
Network Layer & Transport LayerNetwork Layer & Transport Layer
Network Layer & Transport Layer
 
1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptx1.1.2 - Concept of Network and TCP_IP Model (2).pptx
1.1.2 - Concept of Network and TCP_IP Model (2).pptx
 
Network protocol
Network protocolNetwork protocol
Network protocol
 
Tcp presentation
Tcp presentationTcp presentation
Tcp presentation
 
QSpiders - Upper layer-protocols
QSpiders - Upper layer-protocolsQSpiders - Upper layer-protocols
QSpiders - Upper layer-protocols
 
07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt
 
Internet architecture protocol
Internet architecture protocolInternet architecture protocol
Internet architecture protocol
 
ENC_254_PPT_ch04.pdf
ENC_254_PPT_ch04.pdfENC_254_PPT_ch04.pdf
ENC_254_PPT_ch04.pdf
 
Intternetworking With TCP/IP
Intternetworking With TCP/IPIntternetworking With TCP/IP
Intternetworking With TCP/IP
 
ICMP.ppt
ICMP.pptICMP.ppt
ICMP.ppt
 

More from BIT DURG

JavaScript
JavaScriptJavaScript
JavaScriptBIT DURG
 
Understanding WWW
Understanding WWWUnderstanding WWW
Understanding WWWBIT DURG
 
Computer Networks
Computer NetworksComputer Networks
Computer NetworksBIT DURG
 
Computer Basics
Computer Basics Computer Basics
Computer Basics BIT DURG
 
ISDN & ATM
ISDN & ATMISDN & ATM
ISDN & ATMBIT DURG
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control ProtocolBIT DURG
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing ProtocolsBIT DURG
 
Computer Network Basics
Computer Network BasicsComputer Network Basics
Computer Network BasicsBIT DURG
 
Types of Linux Shells
Types of Linux Shells Types of Linux Shells
Types of Linux Shells BIT DURG
 
File Access Permission
File Access PermissionFile Access Permission
File Access PermissionBIT DURG
 
Control flow and related shell cripts
Control flow and related shell criptsControl flow and related shell cripts
Control flow and related shell criptsBIT DURG
 
Basic Shell Programs
Basic Shell ProgramsBasic Shell Programs
Basic Shell ProgramsBIT DURG
 
Filters & Vi Editor
Filters & Vi EditorFilters & Vi Editor
Filters & Vi EditorBIT DURG
 
Basic Linux Commands
Basic Linux CommandsBasic Linux Commands
Basic Linux CommandsBIT DURG
 
Linux Installation
Linux InstallationLinux Installation
Linux InstallationBIT DURG
 
Basics of GNU & Linux
Basics of GNU & LinuxBasics of GNU & Linux
Basics of GNU & LinuxBIT DURG
 
National youth day
National youth dayNational youth day
National youth dayBIT DURG
 
Visual Basic Tutorials
Visual Basic TutorialsVisual Basic Tutorials
Visual Basic TutorialsBIT DURG
 

More from BIT DURG (20)

HTML_DOM
HTML_DOMHTML_DOM
HTML_DOM
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Understanding WWW
Understanding WWWUnderstanding WWW
Understanding WWW
 
Computer Networks
Computer NetworksComputer Networks
Computer Networks
 
Computer Basics
Computer Basics Computer Basics
Computer Basics
 
ISDN & ATM
ISDN & ATMISDN & ATM
ISDN & ATM
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control Protocol
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing Protocols
 
Computer Network Basics
Computer Network BasicsComputer Network Basics
Computer Network Basics
 
MySQL
MySQL MySQL
MySQL
 
Types of Linux Shells
Types of Linux Shells Types of Linux Shells
Types of Linux Shells
 
File Access Permission
File Access PermissionFile Access Permission
File Access Permission
 
Control flow and related shell cripts
Control flow and related shell criptsControl flow and related shell cripts
Control flow and related shell cripts
 
Basic Shell Programs
Basic Shell ProgramsBasic Shell Programs
Basic Shell Programs
 
Filters & Vi Editor
Filters & Vi EditorFilters & Vi Editor
Filters & Vi Editor
 
Basic Linux Commands
Basic Linux CommandsBasic Linux Commands
Basic Linux Commands
 
Linux Installation
Linux InstallationLinux Installation
Linux Installation
 
Basics of GNU & Linux
Basics of GNU & LinuxBasics of GNU & Linux
Basics of GNU & Linux
 
National youth day
National youth dayNational youth day
National youth day
 
Visual Basic Tutorials
Visual Basic TutorialsVisual Basic Tutorials
Visual Basic Tutorials
 

Recently uploaded

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 

Recently uploaded (20)

Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 

Internet Protocol.pdf

  • 1. Unit-2 Internet Protocol Prof. D. P. Mishra Digitally signed by Prof. D. P. Mishra DN: cn=Prof. D. P. Mishra, o=DURG, ou=BIT, email=dpmishra@bitdurg.ac.in, c=IN Date: 2021.04.28 11:47:05 +05'30'
  • 3. Purpose of IP • Primary Network communication protocol • IP relays/transfers network packet called datagrams • Introduced in 1974 by vint cerf and bob kahn • IP was datagram service included with TCP for providing connectionless services 6th Sem CSE - Internetworking With TCP/IP
  • 4. Primary responsibility .. • To provide legitimate network address and encapsulation • Routing packets from one or many IP based networks • Primary functionality is to provide identification of computer host nd location service • IP is main protocol of network layer which is responsible for exchanging messages/datagrams/packets 6th Sem CSE - Internetworking With TCP/IP
  • 5. Internet Protocol Version 4 (IPv4) • Internet Protocol is one of the major protocols in the TCP/IP protocols suite. • This protocol works at the network layer of the OSI model and at the Internet layer of the TCP/IP model. • Thus this protocol has the responsibility of identifying hosts based upon their logical addresses and to route data among them over the underlying network. • IP provides a mechanism to uniquely identify hosts by an IP addressing scheme. • IP uses best effort delivery, i.e. it does not guarantee that packets would be delivered to the destined host, but it will do its best to reach the destination. 6th Sem CSE - Internetworking With TCP/IP
  • 7. Header Details • VER: Version of the IP protocol (4 bits), which is 4 for IPv4 • HLEN: IP header length (4 bits), which is the number of 32 bit words in the header. Minimum value for this field is 5 and the maximum is 15 • Type of service: Low Delay, High Throughput, Reliability (8 bits) • Total Length: Length of header + Data (16 bits), which has a minimum value 20 bytes and maximum is 65,535 bytes • Identification: Unique Packet Id for identifying the group of fragments of a single IP datagram (16 bits) • Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment flag, more fragments flag (same order) • Fragment Offset: Specified in terms of number of 8 bytes, which has the maximum value of 65,528 bytes • Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to loop in the network 6th Sem CSE - Internetworking With TCP/IP
  • 8. Protocol field 6th Sem CSE - Internetworking With TCP/IP Protocol Hex Value Decimal Value Reserved 00 0 ICMP 01 1 IGMP 02 2 GGP (Gateway to Gateway) 03 3 IP-in-IP Encapsulation 04 4 TCP 06 6 EGP (Exterior Gateway Protocol) 08 8 UDP 11 17 ESP 32 50 AH 33 51
  • 9. Header checksum • Computed over header to provide protection against corruption in transmission • Calculated by dividing header bytes in words and then adding them together • It only considers header portion not payload 6th Sem CSE - Internetworking With TCP/IP
  • 10. Other fields • Source address – Sender address • Destination address - final destination (receiver) • Options – Timestamp, record route taken , specify the list of routers to visit 6th Sem CSE - Internetworking With TCP/IP
  • 12. 6th Sem CSE - Internetworking With TCP/IP The Address Resolution Protocol(ARP) maps a logical address to a physical address.
  • 14. 6th Sem CSE - Internetworking With TCP/IP RARP • RARP – obsolete Protocols • BOOTP and others are in use • RARP allows/supports only IP, No DG & DNS • BOOTP Supports all
  • 15. Proxy ARP • Proxy ARP is a technique by which a proxy server on a given network answers the Address Resolution Protocol (ARP) queries for an IP address that is not on that network. • The proxy is aware of the location of the traffic's destination and offers its own MAC address as the (ostensibly final) destination. • Proxy ARP is used between one more networks. In other words, we can say that Proxy ARP provides data link discovery between different networks. 6th Sem CSE - Internetworking With TCP/IP
  • 17. Think about that, PC 1 want to ping PC 4 and it does not have PC 4’s MAC address in its ARP Cache. Here, the router has also an ARP Cache. We assume that Router’s ARP Cache has only its interfaces at the beginning. 6th Sem CSE - Internetworking With TCP/IP Think about that, PC 1 want to ping PC 4 and it does not have PC 4’s MAC address in its ARP Cache. Here, the router has also an ARP Cache. We assume that Router’s ARP Cache has only its interfaces at the beginning.
  • 18. Firstly PC 1 sends a broadcast ARP Request to learn MAC address of destination PC 4. With the other PCs in the same network, the first network side interface of the router will also receive this broadcast. 6th Sem CSE - Internetworking With TCP/IP
  • 19. Router detects that the destination is not in this network but it knows the other network. So, router sends an ARP Reply to PC 1 with its own interface MAC address. This message means that: 6th Sem CSE - Internetworking With TCP/IP
  • 20. Router checks its ARP Cache and it does not find any record about PC 4’s IP address and MAC Address. So, it sends a broadcast ARP Request to the second network. 6th Sem CSE - Internetworking With TCP/IP PC 4 in the second network, determines that the router that is being looked for is himself. It sends an ARP Reply, that means : “This is me!”
  • 21. BOOTP • The Bootstrap Protocol (BOOTP) is a computer networking protocol used in Internet Protocol networks • BOOTP automatically assign an IP address to network devices from a configuration server. • The BOOTP was originally defined in RFC 951. • BOOTP is implemented using the User Datagram Protocol (UDP) for transport protocol, • BOOTP operates only on IPv4 networks. • Port number 67 is used by the (DHCP) server for receiving client-requests and port number 68 is used by the client for receiving (DHCP) server responses. • DHCP is based on BOOTP 6th Sem CSE - Internetworking With TCP/IP
  • 22. 6th Sem CSE - Internetworking With TCP/IP • Port number 67 is used by the server for receiving client-requests and • Port number 68 is used by the client for receiving (DHCP) server responses.
  • 24. ICMP • IP is unreliable protocol. • Provides connectionless service for delivering datagram. • IP is not having error correction and reporting mechanism. • What happens if something goes wrong, what if router discards packet if it doesn’t find route for the packet. • IP also lacks in mechanism for lost and management queries. • ICMP is designed to compensate the above deficiency. 6th Sem CSE - Internetworking With TCP/IP
  • 25. Position of ICMP in N/W Layer 6th Sem CSE - Internetworking With TCP/IP • ICMP is network layer protocol • However its messages are not directly passed to lower layer • Messages are first encapsulated in IP datagram before going to lower layer.
  • 27. Types of ICMP Messages 6th Sem CSE - Internetworking With TCP/IP
  • 30. ICMP Message Format 6th Sem CSE - Internetworking With TCP/IP • ICMP has 8-byte header and variable size data section • Although general format of header is different for each message type but the first four bytes are common to all
  • 31. Source Quench • Source Quench is an ICMP based mechanism used by network devices to inform data sender that the packets can not be forwarded due to buffers overload. • When the message is received by a TCP sender, that sender should decrease its send window to the respective destination in order to limit outgoing traffic • Source quench message is request to decrease traffic rate for messages sending to the host(destination) • ICMP will take source IP from the discarded packet and informs to source by sending source quench message 6th Sem CSE - Internetworking With TCP/IP
  • 32. Source Quenching .. 6th Sem CSE - Internetworking With TCP/IP • Then source will reduce the speed of transmission so that router will free for congestion. • When the congestion router is far away from the source the ICMP will send hop by hop source quench message so that every router will reduce the speed of transmission.
  • 33. IGMP • IP communication involves in two types of communication • Unicast and multicast • Unicast is in between sender and receiver one-to-one • Multicast is one-to-many • E.g. stock brokers, travel agents and applications like learning and video on demand • For Multicasting Class D IP address is used 6th Sem CSE - Internetworking With TCP/IP
  • 34. Routing Protocol in Computer Network • Routing is the process of selecting a path for traffic in a network or between or across multiple networks. • Broadly, routing is performed in many types of networks, including circuit-switched networks, such as the public switched telephone network (PSTN), and computer networks, such as the Internet. 6th Sem CSE - Internetworking With TCP/IP
  • 35. Delivery • The network layer examines the handling of packets by the underlying networks. • This handling is referred to as delivery of a packet. • The delivery of packet (source to final destination) can be achieved by two methods: 1. Direct delivery 2. Indirect Delivery 6th Sem CSE - Internetworking With TCP/IP
  • 36. Direct delivery • In this method, the source and destination of the packets are located on the same network. • The sender can determine, if the delivery is direct. • With the help of masking, the sender can extract the network address of the destination and compares this address with the addresses of the connected networks. • If the match is found, then the delivery is direct. 6th Sem CSE - Internetworking With TCP/IP
  • 37. Indirect Delivery • In this method, the destination host is not on the same network as the deliverer. The packet is not delivered directly. • The packet moves from router to router until it reaches the same physical network as its final destination. 6th Sem CSE - Internetworking With TCP/IP
  • 39. Administrative Distance • Administrative Distance (AD) is used to rate the trustworthiness of routing information received from the neighbor router. • AD is a numeric value which can range from 0 to 255. • A smaller Administrative Distance (AD) is more trusted by a router, therefore the best • Administrative Distance (AD) being 0 and the worst, 255. • The route with the least AD will be selected as the best route to reach the destination remote network and that route will be placed in the routing table. • It defines how much reliable a routing protocol is. 6th Sem CSE - Internetworking With TCP/IP
  • 41. Routing • To route IP packets, a host or a router has a routing table with entries for each destination or a combination of destinations. • A static routing table contains information, which is entered manually. • The administrator enters the route for each destination into the table. • Dynamic routing table is updated periodically by using dynamic protocols like RIP, OSPF or BGP. • The main function of the network is to route the packets from source to destination. • More than one route is possible in every network, however the shortest route should be selected. • The shortest route means, a route which passes through the least number of nodes to reach the destination. • The routing algorithm is designed to find the shortest root and it is part of a network software. 6th Sem CSE - Internetworking With TCP/IP
  • 44. Static(non adaptive) Routing • Routing is done by the Network Administrators manually. • All the possible paths which are already calculated are loaded into the routing table. • This setting will describe the path from a packet to its destination Pros: • On the router CPU, there is no processing time (overhead). • Security guarantees. Suitable for smaller networks Cons: • Administrators must be able to understand internetwork on a system and router, in order to connect and function correctly. • On large scale computer networks static routing is not suitable for use. • Inability to respond quickly in case of network failure. 6th Sem CSE - Internetworking With TCP/IP
  • 45. Dynamic Routing • The routing process is done by creating an automatic data communication path. • Dynamic routing can change their routing decision on the basis of some changes made in the topology. • Dynamic routing is located at the computer layer network layer in the TCP / IP Protocol Suites. Advantage: • Easier to use than static and default routing. Cons • Router workloads become heavy because of updates to the routing table at a certain time. • The speed of recognition and completeness of the routing table requires a long time. 6th Sem CSE - Internetworking With TCP/IP
  • 46. Default Routing • The default route establishes a forwarding rule for packets when no specific address of a next-hop host is available from the routing table or other routing mechanisms. • A default route is the route that takes effect when no other route is available for an IP destination address. • The default route in IPv4 is designated as 0.0.0.0/0 or simply 0/0 • The default route generally has a next-hop address of another routing device, 6th Sem CSE - Internetworking With TCP/IP
  • 47. An autonomous system (AS) • AS is a network or group of networks • Under one administrative group or organization 6th Sem CSE - Internetworking With TCP/IP
  • 48. Intradomain vs Interdomain • Routing inside an autonomous system is referred to as intra- domain routing, e.g. Distance vector • Routing between two or more autonomous systems can be referred to as inter-domain routing, e.g. Path Vector 6th Sem CSE - Internetworking With TCP/IP
  • 49. 6th Sem CSE - Internetworking With TCP/IP Intra-domain Routing Inter-domain Routing Routing takes place within an autonomous network. Routing takes place between the two autonomous networks. This protocol ignores the internet outside the autonomous system. This protocol assumes that internet consists of a collection of interconnected autonomous systems. Protocols for Intra-domain routing are called as interior gateway protocols. Protocol for Inter-domain routing are also called as exterior gateway protocols. Examples: RIP and OSPF etc. Example: BGP
  • 50. Distance Vector Routing • Distance vector routing is the dynamic routing algorithm and also known as Bellman-Ford routing algorithm and Ford- Fulkerson algorithm. • It was designed for small network topologies. • In this algorithm, node router constructs a table containing the distance (total cost of path) to all other nodes and distributes that vector to its immediate neighbors. • For distance vector routing, it is assumed that each node knows the cost of the link to each of its directly connected neighbors. • A link, which is 'down' (which is not working) is assigned as an infinite cost. 6th Sem CSE - Internetworking With TCP/IP
  • 51. Distance Vector Routing .. 6th Sem CSE - Internetworking With TCP/IP  Every node sends a message to its directly connected neighbors For example: A sends its information to B and F.  After communicating to each directly connected node, the shortest path can be easy to compute (as shown in above table).
  • 52. Advantages of distance Vector • Distance vector routing protocol is easy to implement in small networks. • Debugging is very easy in the distance vector routing protocol. • This protocol has a very limited redundancy in a small network. 6th Sem CSE - Internetworking With TCP/IP
  • 53. Issues with the Distance Vector Routing are: • It takes long time for convergence due to growth in the network (slower to converge than link state) • It is at risk from the count-to-infinity problem. • Vulnerability to the 'Count-to-Infinity' problem is a serious issue with the distance vector. • It creates more traffic than link state since a hop count change must be propagated to all routers and processed on each router. • 6th Sem CSE - Internetworking With TCP/IP
  • 54. Link state routing • It is a dynamic type routing algorithm. • In this method, one or more routers can be connected by using LAN. • When a router is booted, it sends a special request (HELLO packet) message on each point-to-point line. • Then second router sends back a reply and asks who is it and the communication starts. • To determine the cost of line or path, the router sends an ECHO packet over the line which the other router is required to send back immediately. • By measuring the round-trip time and dividing it by two, the router (sender) can get a reasonable estimate of the delay. • Link state packet can be constructed periodically or after the occurrence of some significant event. For example: if a line or neighbor is down or it may be coming back. 6th Sem CSE - Internetworking With TCP/IP
  • 58. Basic algorithm to distribute the link state packets: • Each state packet has a sequence number and it is incremented for each sent packet. • Routers can track all the source routers and sequence. • When a new link state packet arrives, it is checked against the list of packets already entered. • If the packet is new, it is forwarded on all lines (except on which it is arrived ie flooding) and discarded, if the packet is duplicate. • If the sequence number is lower (than the highest one), it is rejected. 6th Sem CSE - Internetworking With TCP/IP
  • 59. Changes to improve basic algo • Once the router accumulates full set of link state packets, it can construct the entire subnet graph and • Dijkshtra's algorithm can be used to construct the shortest path to all possible destination. • Link state routing protocol uses event driven updates rather than periodic updates. • Link state routing protocol is widely used in actual networking system. 6th Sem CSE - Internetworking With TCP/IP
  • 61. Routing Information Protocol (RIP). • The RIP is an intra-domain routing protocol. • It is based on distance vector routing. • In Implementation of RIP, the following steps are taken into consideration: 1. The routers have routing tables, but network does not have routing table. 2. The destination in routing table is a network, this states that the first column defines a network address. 3. The metric in RIP is called a hop count. 4. Infinity is defined as 16, which means that any route in an autonomous system using RIP cannot have more than 15 hops. 5. The next-node column defines the address of the router to which the packet is to be sent to reach its destination. 6th Sem CSE - Internetworking With TCP/IP
  • 62. RIP .. • Dynamic Routing Protocol • It is a distance vector routing protocol • It has AD value 120 and works on the application layer of OSI model. • RIP uses port number 520 6th Sem CSE - Internetworking With TCP/IP
  • 63. Working of RIP • If there are 8 routers in a network where • Router 1 wants to send the data to Router 3. • If the network is configured with RIP, it will choose the route which has the least number of hops. • There are three routes in the above network, i.e., Route 1, Route 2, and Route 3. • The Route 2 contains the least number of hops, i.e., 2 where Route 1 contains 3 hops, and Route 3 contains 4 hops, • So RIP will choose Route 2. 6th Sem CSE - Internetworking With TCP/IP
  • 64. Let's look at another example • Suppose R1 wants to send the data to R4. • There are two possible routes to send data from r1 to r2. • As both the routes contain the same number of hops, i.e., 3, so • RIP will send the data to both the routes simultaneously. • This way, it manages the load balancing, and data reach the destination a bit faster. 6th Sem CSE - Internetworking With TCP/IP
  • 65. How RIP updates its Routing table The following timers are used to update the routing table: RIP update timer : 30 sec • The routers configured with RIP send their updates to all the neighboring routers every 30 seconds. RIP Invalid timer : 180 sec • The RIP invalid timer is 180 seconds, which means that if the router is disconnected from the network or some link goes down, then the neighbor router will wait for 180 seconds to take the update. • If it does not receive the update within 180 seconds, then it will mark the particular route as not reachable. IP Flush timer : 240 sec • The RIP flush timer is 240 second which is almost equal to 4 min means that • If the router does not receive the update within 240 seconds then the neighbor route will remove that particular route from the routing table which is a very slow process as 4 minutes is a long time to wait. 6th Sem CSE - Internetworking With TCP/IP
  • 66. Advantages of RIP • It is easy to configure • It has less complexity • The CPU utilization is less. 6th Sem CSE - Internetworking With TCP/IP
  • 67. Disadvantages of RIP • In RIP, the route is chosen based on the hop count metric. • If another route of better bandwidth is available, then that route would not be chosen. • Let's understand this scenario through an example. • We can observe that Route 2 is chosen in the figure as it has the least hop count. • The Route 1 is free and data can be reached more faster; instead of this, data is sent to the Route 2 that makes the Route 2 slower due to the heavy traffic. • This is one of the biggest disadvantages of RIP. 6th Sem CSE - Internetworking With TCP/IP
  • 68. Disadvantages of RIP.. • The RIP is a classful routing protocol, so it does not support the VLSM (Variable Length Subnet Mask). • It broadcasts the routing updates to the entire network that creates a lot of traffic. • In RIP, the routing table updates every 30 seconds. Whenever the updates occur, it sends the copy of the update to all the neighbors except the one that has caused the update. • It faces a problem of Slow convergence. Whenever the router or link fails, then it often takes minutes to stabilize or take an alternative route; This problem is known as Slow convergence. • RIP supports maximum 15 hops which means that the maximum 16 hops can be configured in a RIP • The Administrative distance value is 120 (Ad value). If the Ad value is less, then the protocol is more reliable than the protocol with more Ad value. • The RIP protocol has the highest Ad value, so it is not as reliable as the other routing protocols. 6th Sem CSE - Internetworking With TCP/IP
  • 71. D. V . Summary .. • Assume:  Each router knows only address/cost of neighbors • Goal:  Calculate routing table of next hop information for each destination at each router • Idea:  Tell neighbors about learned distances to all destinations 6th Sem CSE - Internetworking With TCP/IP
  • 72. DV Algorithm • Each router maintains a vector of costs to all destinations • Initialize neighbors with known cost, others with infinity • Periodically send copy of distance vector to neighbors • On reception of a vector, if neighbors path to a destination plus neighbor cost is better, then switch to better path • Update cost in vector and next hop in routing table • Assuming no changes, will converge to shortest paths 6th Sem CSE - Internetworking With TCP/IP
  • 73. DV Example – Initial Table at A D G A F E B C Dest Cost Next B 1 B C 1 C D  - E 1 E F 1 F G  - 6th Sem CSE - Internetworking With TCP/IP
  • 74. DV Example – Final Table at A • Reached in a single iteration … simple example D G A F E B C Dest Cost Next B 1 B C 1 C D 2 C E 1 E F 1 F G 2 F 6th Sem CSE - Internetworking With TCP/IP
  • 75. What if there are changes? • One scenario: Suppose link between F and G fails 1. F notices failure, sets its cost to G to infinity and tells A 2. A sets its cost to G to infinity too, since it learned it from F 3. A learns route from C with cost 2 and adopts it D G A F E B C XXXXX Dest Cost Next B 1 B C 1 C D 2 C E 1 E F 1 F G 3 C 6th Sem CSE - Internetworking With TCP/IP
  • 76. • Simple example  Costs in nodes are to reach Internet • Now link between B and Internet fails … Count To Infinity Problem Internet A/2 B/1 6th Sem CSE - Internetworking With TCP/IP
  • 77. Count To Infinity Problem • B hears of a route to the Internet via A with cost 2 • So B switches to the “better” (but wrong!) route update Internet A/2 B/3 XXX 6th Sem CSE - Internetworking With TCP/IP
  • 78. Count To Infinity Problem • A hears from B and increases its cost update Internet A/4 B/3 XXX 6th Sem CSE - Internetworking With TCP/IP
  • 79. Count To Infinity Problem • B hears from A and (surprise) increases its cost • Cycle continues and we “count to infinity” • Packets caught in the crossfire loop between A and B update Internet A/4 B/5 XXX 6th Sem CSE - Internetworking With TCP/IP
  • 80. Split Horizon • Solves trivial count-to-infinity problem • Split horizon is a method of preventing a routing loop in a network. • The basic principle is simple: Information about the routing for a particular packet is never sent back in the direction from which it was received. • Split horizon can be achieved by means of a technique called poison reverse 6th Sem CSE - Internetworking With TCP/IP
  • 81. Poison reverse • A poison reverse is a way in which a gateway node tells its neighbor gateways that one of the gateways is no longer connected. • To do this, the notifying gateway sets the number of hops to the unconnected gateway to a number that indicates "infinite" (meaning "You can't get there"). • Since RIP allows up to 15 hops to another gateway, setting the hop count to 16 would mean "infinite.“ • This is the equivalent of route poisoning all possible reverse paths • Split horizon with poison reverse is more effective than simple split horizon in networks with multiple routing paths 6th Sem CSE - Internetworking With TCP/IP
  • 82. RIP – More Details 6th Sem CSE - Internetworking With TCP/IP
  • 83. RIP - Routing Information Protocol • RIP supports dynamic routing • Based on Distance vector uses hop count as metric • A simple intradomain/IGP(Interior gateway Protocol) • Open Standard , based on distance vector • Classful routing protocol (Doesn’t support subnetting) • Each router advertises its distance vector every 30 seconds (or whenever its routing table changes) to all of its neighbors • Maximum hop count is 15, with “16” equal to “” • Administrative distance (AD Value) is 120 6th Sem CSE - Internetworking With TCP/IP
  • 84. RIPv1 RIP Characteristics  A Classful, Distance Vector (DV) routing protocol  Metric = hop count  Routes with a hop count > 15 are unreachable  Updates are broadcast every 30 seconds  Used for smaller network  Router rip command is used for configuring router 6th Sem CSE - Internetworking With TCP/IP
  • 85. RIPv1 Packet Format IP header UDP header RIP Message Command Version Set to 00...0 32-bit address Unused (Set to 00...0) address family Set to 00.00 Unused (Set to 00...0) metric (1-16) one route entry (20 bytes) Up to 24 more routes (each 20 bytes) 32 bits One RIP message can have up to 25 route entries 1: request 2: response 2: for IP 0…0: request full rou- ting table Address of destination Cost (measured in hops) 1: RIPv1 6th Sem CSE - Internetworking With TCP/IP
  • 86. RIPv2 • RIPv2 is an extends RIPv1:  Subnet masks are carried in the route information  Authentication of routing messages  Route information carries next-hop address  Exploites IP multicasting • Extensions of RIPv2 are carried in unused fields of RIPv1 messages 6th Sem CSE - Internetworking With TCP/IP
  • 87. RIPv2 Packet Format IP header UDP header RIP Message Command Version Set to 00...0 32-bit address Unused (Set to 00...0) address family Set to 00.00 Unused (Set to 00...0) metric (1-16) one route entry (20 bytes) Up to 24 more routes (each 20 bytes) 32 bits One RIP message can have up to 25 route entries 1: request 2: response 2: for IP 0…0: request full rou- ting table Address of destination Cost (measured in hops) 2: RIP v 6th Sem CSE - Internetworking With TCP/IP
  • 88. RIPv2 Packet Format IP header UDP header RIPv2 Message Command Version Set to 00.00 IP address Subnet Mask address family route tag Next-Hop IP address metric (1-16) one route entry (20 bytes) Up to 24 more routes (each 20 bytes) 32 bits Used to carry information from other routing protocols (e.g., autonomous system number) Identifies a better next-hop address on the same subnet than the advertising router, if one exists (otherwise 0….0) 2: RIPv2 Subnet mask for IP address 6th Sem CSE - Internetworking With TCP/IP
  • 89. RIP Timers 6th Sem CSE - Internetworking With TCP/IP Update Timer 30 Sec Hold on timer 180 Sec Invalid Timer (30 + 150=180 Sec) Flush Timer(180 +60=240 Sec) - Route is purged after 4 min • Invalid Timer : specifies how long a routing entry can be in the routing table without being updated. This is also called as expiration • Flush timer : controls the time between the route is invalidated or marked as unreachable and removal of entry from the routing table • hold-on timer: is started per route entry, when the hop count is changing from lower value to higher value. This allows the route to get stabilized.
  • 90. RIP Messages • This is the operation of RIP in routed. • Dedicated port for RIP is UDP port 520. • Two types of messages:  Request messages  used to ask neighboring nodes for an update  Response messages  contains an update 6th Sem CSE - Internetworking With TCP/IP
  • 91. Routing with RIP • Initialization: Send a request packet (command = 1, address family=0..0) on all interfaces:  RIPv1 uses broadcast if possible, 255.255.255.255  RIPv2 uses multicast address 224.0.0.9, if possible • Requesting routing tables from neighboring routers • Request received: Routers that receive above request send their entire routing table • Response received: Update the routing table • Typically, there is a routing daemon (routed) that is an application layer process that provides access to routing tables. 6th Sem CSE - Internetworking With TCP/IP
  • 92. Routing with Rip Cont. • Regular routing updates: Every 30 seconds, send all or part of the routing tables to every neighbor in an response message • Triggered Updates: Whenever the metric for a route change, send entire routing table. • If a router does not hear from its neighbor once every 180 seconds, the neighbor is deemed unreachable. 6th Sem CSE - Internetworking With TCP/IP
  • 93. RIP Convergence • Takes more time to converge • RIP requires less CPU power and RAM than other routing protocols • Router advertises details to its neighbors • Routing by rumors, similar to rumor spread by peoples living in locality/neighbors 6th Sem CSE - Internetworking With TCP/IP
  • 94. Security • Issue: Sending bogus routing updates to a router • RIPv1: No protection • RIPv2: Simple authentication scheme 6th Sem CSE - Internetworking With TCP/IP
  • 95. RIP Security IP header UDP header RIPv2 Message Command Version Set to 00.00 Password (Bytes 0 - 3) Password (Bytes 4 - 7) 0xffff Authentication Type Password (Bytes 8- 11) Password (Bytes 12 - 15) Authetication Up to 24 more routes (each 20 bytes) 32 bits 2: plaintext password 6th Sem CSE - Internetworking With TCP/IP
  • 96. RIPV1 vs RIPV2 RIP V1 • Classful i.e. VLSM not supported • No authentication • Uses broadcast address as 255.255.255.255 • Max hopcount is 15 • Periodic update is of 15 RIP V2 • Classless (CIDR/VLSM) Support • Authentication is supported • Uses multicast address 224.0.0.9 • In todays scenario only RIPV2 is used even • RIPV1 is removed from CISCO Certification 6th Sem CSE - Internetworking With TCP/IP
  • 97. RIP Advantages • Easy to configure • No Design constraint • No Complexity • Less overhead 6th Sem CSE - Internetworking With TCP/IP
  • 98. RIP Disadvantages • RIP takes a long time to stabilize / slow convergence • Work only on hop count • Bandwidth utilization is high as routing table entry is heared after every 30 Sec • RIP has all the problems of distance vector algorithms, e.g., count-to- Infinity  RIP uses split horizon to avoid count-to-infinity • Not scalable as - The maximum path in RIP is 15 hops 6th Sem CSE - Internetworking With TCP/IP
  • 99. Areas in AS(Autonomous System) 6th Sem CSE - Internetworking With TCP/IP
  • 100. Links specific to OSPF • In OSPF connection is called as link • There are four types of links  Point-to-Point link  Transient link  Stub link  Virtual link 6th Sem CSE - Internetworking With TCP/IP
  • 101. 1. Point-to-Point Link • It connects with the help of two routers without any host or router as a mediator. • In this type of link, there is no need to assign a network address. • Graphically, the nodes are represented as nodes and the link is represented by bidirectional edge connecting the nodes. 6th Sem CSE - Internetworking With TCP/IP
  • 102. 2. Transient link • It is a network with several routers attached to it. • The data can enter through any one of the routers and pass through any router. • The LAN or WAN with two or more routers are the examples of the transient link. 6th Sem CSE - Internetworking With TCP/IP
  • 103. 3. Stub link • It is a network connected with only one router. • The data packets enter the network through this single router and leave the network through this same router. 6th Sem CSE - Internetworking With TCP/IP
  • 104. 4. Virtual link • Virtual link is created by the administrator, when the link between two routers is disconnected. 6th Sem CSE - Internetworking With TCP/IP
  • 105. OSPF(Open Shortest Path First) 6th Sem CSE - Internetworking With TCP/IP
  • 106. Open Shortest Path First (OSPF) • It is an intra-domain routing protocol based on link state routing. • To handle routing efficiently, OSPF divides autonomous systems into different areas. • Areas are the collection of networks, hosts and routers all contained within an autonomous system. • An autonomous system can be divided into many different areas. • All networks inside an area must be connected. • Routers inside an area flood is considered as the area with routing information. • At the border of an area, special routers called as area border routers summarize the information about the area and send it to other areas. • There is a special area, which is called as backbone and • All the areas inside an autonomous system must be connected with backbone. • Backbone serves as primary area and the other areas are served as secondary areas 6th Sem CSE - Internetworking With TCP/IP
  • 107. OSPF .. • The routers inside the backbone are called as backbone routers. • If the connectivity between the backbone and an area is broken, it is necessary to create a virtual link between routers. The administrator creates it. • The OSPF protocol allows the administrator to assign a cost, called as the metric to each route. • The metric can be assigned on the type of services like minimum delay, maximum throughput, etc. • The router can have multiple routing tables based on different services. • In OSPF, a connection is called as link. 6th Sem CSE - Internetworking With TCP/IP
  • 108. Open Shortest Path First (RFC 1247) • Uses IP, has a value in the IP Header (8 bit protocol field) • Interior routing protocol, its domain is also an autonomous system • Divides an AS into areas • Metric based on type of service  Minimum delay (rtt), maximum throughput, reliability, etc.. Unit-3 Comp Network by : Prof. D. P. Mishra BITD
  • 109. OSPF • IRP/IGP • Divides AS in different Areas • Router inside area floods area with routing info • ABR summarizes the routing info of concern area • All the areas in AS are connected to backbone area in AS Unit-3 Comp Network by : Prof. D. P. Mishra BITD
  • 110. OSPF (type of links) Unit-3 Comp Network by : Prof. D. P. Mishra BITD
  • 111. Point-to-point Link Unit-3 Comp Network by : Prof. D. P. Mishra BITD Point –to – point link defines direct connection between routers and it can be represented as graph with link having bidirectional arrow
  • 112. Transient Link Unit-3 Comp Network by : Prof. D. P. Mishra BITD This link defines network to which multiple routers are attached, in this type of network multiple routers are connected to common network and they have many neighbors
  • 113. Stub Links Unit-3 Comp Network by : Prof. D. P. Mishra BITD This link is special case of transient link, which defines a network with only one router connected to it, packet enters and leave the network using single link
  • 114. Virtual Links Unit-3 Comp Network by : Prof. D. P. Mishra BITD When the link between two routers is broken, a new link has to be established by the administrator, which is known as virtual link
  • 115. OSPF Background .. • Link state/Shortest Path First Technology • Dynamic Routing • Fast Convergence • Route authentication
  • 116. OSPF (link state advertisement) Router Link Network Link Unit-3 Comp Network by : Prof. D. P. Mishra BITD
  • 117. OSPF (LSA cont.) Summary link to Network Summary link to AS boundary router External Link Unit-3 Comp Network by : Prof. D. P. Mishra BITD
  • 118. DR & BDR • OSPF uses a DR (Designated Router) and BDR (Backup Designated Router) on each multi-access network. ... • DR and BDR act as a central point for exchanging of OSPF information between multiple routers on the same, multi-access broadcast network segment. 6th Sem CSE - Internetworking With TCP/IP
  • 123. Shortest Path Calculations .. Unit-3 Comp Network by : Prof. D. P. Mishra BITD 3 2 1 4 5 4 4 8 7 3 Visited 1 2 3 4 5 ∞ ∞ ∞ ∞ ∞ {1} 0 4 ∞ 8 ∞ {1,2} 0 4 7 8 ∞ {1,2,3} 0 4 7 8 ∞ {1,2,3,4} 0 4 7 8 15
  • 124. Link State Algorithm • Each router contains a database containing a map of the whole topology  Links  Their state (including cost) • All routers have the same information • All routers calculate the best path to every destination • Any link state changes are flooded across the network  “Global spread of local knowledge”
  • 125. Link State Routing • Automatic neighbour discovery  Neighbours are physically connected routers • Each router constructs a Link State Packet (LSP)  Distributes the LSP to neighbours…  …using an LSA (Link State Announcement) • Each router computes its best path to every destination • On network failure  New LSPs are flooded  All routers recompute routing table
  • 126. Low Bandwidth Requirements • Only changes are propagated • Multicast used on multi-access broadcast networks  224.0.0.5 used for all OSPF speakers  224.0.0.6 used for DR and BDR routers FDDI Dual Ring R1 LSA X LSA
  • 127. “Shortest Path First” • The optimal path is determined by the sum of the interface costs FDDI Dual Ring FDDI Dual Ring N1 N2 N3 N4 N5 R1 R2 R3 R4 Cost = 1 Cost = 1 Cost = 10 Cost = 10 Cost = 10
  • 128. OSPF: How it works • Hello Protocol  Responsible for establishing and maintaining neighbour relationships  Elects Designated Router on broadcast networks FDDI Dual Ring Hello Hello Hello
  • 129. OSPF: How it works • Hello Protocol  Hello Packets sent periodically on all OSPF enabled interfaces  Adjacencies formed between some neighbours • Hello Packet  Contains information like Router Priority, Hello Interval, a list of known neighbours, Router Dead Interval, and the network mask
  • 130. OSPF: How it works • Trade Information using LSAs  LSAs are added to the OSPF database  LSAs are passed on to OSPF neighbours • Each router builds an identical link state database • SPF algorithm run on the database • Forwarding table built from the SPF tree
  • 131. OSPF: How it works • When change occurs:  Announce the change to all OSPF neighbours  All routers run the SPF algorithm on the revised database  Install any change in the forwarding table
  • 132. Types of OSPF packets and header format Unit-3 Comp Network by : Prof. D. P. Mishra BITD
  • 133. 6th Sem CSE - Internetworking With TCP/IP • Link State Update packets are OSPF packet type 4. • These packets implement the flooding of link state advertisements. • Each Link State Update packet carries a collection of link state advertisements one hop further from its origin. • Several link-state advertisement may be included in a single packet.
  • 135. Advantages of OSPF: • Biggest advantage of OSPF over EIGRP is that it will run on any device as its based on open standard • OSPF is an open standard, not related to any particular vendor. • It uses the SPF algorithm, developed by Dijkstra • OSPF provide a loop-free topology. • It provides fast convergence with triggered updates • It supports classless / VLSM. • Supports authentication Unit-3 Comp Network by : Prof. D. P. Mishra BITD Enhanced Interior Gateway Routing Protocol (EIGRP) is an advanced distance-vector routing protocol that is used in computer network for automating routing decisions and configuration. (Developed by CISCO)
  • 136. Disadvantages of OSPF • It requires extra CPU processing to run the SPF algorithm • It is bit complex to configure and more difficult to troubleshoot. • OSPF maintains multiple copies of routing information, increasing the amount of memory needed. • OSPF routers check the status of other routers on the network by sending a small hello packet at regular intervals. • If a router does not respond to the hello packet, it is assumed dead, and routing updates are sent to every other router by using a multicast address. Unit-3 Comp Network by : Prof. D. P. Mishra BITD
  • 137. What Is a Router Module? . • A router is a small device that brings together numerous networks. • In terms of the seven layer OSI model of computer networking, a router is considered a "Layer 3" gateway device; this means that it can move data from its origin to its destination using one or more networks. • In enterprise situations, a modular device has expansion slots that allow the user the ability to add new modules as needed. • The majority of modular devices come with a set number of fixed ports along with the expansion slots. • When choosing a router, selecting the type and number of ports is a major decision. A user must ask themselves if they would purchase a router with: • Just enough ports for today's needs? • Both UTP and fiber ports? • A mixture of UTP speeds. 6th Sem CSE - Internetworking With TCP/IP
  • 138. What Is a Router Module?.. • The user must consider carefully how many fiber ports and UTP ports are needed. At the same time, they must also consider how many Gbps are needed as well as bandwidth requirements. • The modular devices come with expansion slots that give the user the flexibility to add more modules as requirements change. • Eg • Ethernet port modules • Broadband Modules • Serial WAN Interface Module • ISDN(BRI) Module • Voice Modules • SIP Proxy Module • Analog and Digital Voice / Fax Module 6th Sem CSE - Internetworking With TCP/IP
  • 140. IPv4 supports 3-types of addressing modes. • Unicast Addressing Mode: • Broadcast Addressing Mode: • Multicast Addressing Mode: 6th Sem CSE - Internetworking With TCP/IP
  • 141. Unicast Addressing Mode: • In this mode, data is sent only to one destined host. • The Destination Address field contains 32- bit IP address of the destination host. • Here the client sends data to the targeted server: 6th Sem CSE - Internetworking With TCP/IP
  • 142. Broadcast Addressing Mode: • In this mode, the packet is addressed to all the hosts in a network segment. • The Destination Address field contains a special broadcast address, i.e. 255.255.255.255. • When a host sees this packet on the network, it is bound to process it. • Here the client sends a packet, which is entertained by all the Servers: 6th Sem CSE - Internetworking With TCP/IP
  • 143. Multicast Addressing Mode: • This mode is a mix of the previous two modes, i.e. the packet sent is destined neither to a single host nor all the hosts on the segment. • In this packet, the Destination Address contains a special address which starts with 224.x.x.x and can be entertained by more than one host. 6th Sem CSE - Internetworking With TCP/IP
  • 144. Hierarchical Addressing Scheme • IPv4 uses hierarchical addressing scheme. An IP address, which is 32-bits in length, is divided into two or three parts as depicted: • A single IP address can contain information about the network and its sub-network and ultimately the host. • This scheme enables the IP Address to be hierarchical where a network can have many sub-networks which in turn can have many hosts. 6th Sem CSE - Internetworking With TCP/IP
  • 145. Subnet Mask • It is very necessary to distinguish both. • For this, routers use Subnet Mask, which is as long as the size of the network address in the IP address. • Subnet Mask is also 32 bits long. If the IP address in binary is ANDed with its Subnet Mask, the result yields the Network address. • For example, say the IP Address is 192.168.1.152 and the Subnet Mask is 255.255.255.0 then: • It can be identified now that 192.168.1.0 is the Network number and 192.168.1.152 is the host on that network. 6th Sem CSE - Internetworking With TCP/IP
  • 146. Binary Representation • The positional value method is the simplest form of converting binary from decimal value. • IP address is 32 bit value which is divided into 4 octets. • A binary octet contains 8 bits and the value of each bit can be determined by the position of bit value '1' in the octet. 6th Sem CSE - Internetworking With TCP/IP • Positional value of bits is determined by 2 raised to power (position – 1), that is the value of a bit 1 at position 6 is 2^(6-1) that is 2^5 that is 32. • The total value of the octet is determined by adding up the positional value of bits. The value of 11000000 is 128+64 = 192.
  • 148. IPv4 Addressing system is divided into five classes of IP • All the five classes are identified by the first octet of IP Address. • Internet Corporation for Assigned Names and Numbers is responsible for assigning IP addresses. • The first octet referred here is the left most of all. • The octets numbered as follows depicting dotted decimal notation of IP Address: 6th Sem CSE - Internetworking With TCP/IP The number of networks and the number of hosts per class can be derived by this formula:
  • 149. Class A Address • The first bit of the first octet is always set to 0 (zero). • Thus the first octet ranges from 1 – 127, i.e. 6th Sem CSE - Internetworking With TCP/IP • Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range 127.x.x.x is reserved for loopback IP addresses. • The default subnet mask for Class A IP address is 255.0.0.0 which implies that Class A addressing can have 126 networks (27-2) and 16777214 hosts (224-2). • Class A IP address format is thus: 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
  • 150. Class B Address • An IP address which belongs to class B has the first two bits in the first octet set to 10, i.e • Class B IP Addresses range from 128.0.x.x to 191.255.x.x. • The default subnet mask for Class B is 255.255.x.x. • Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses. • Class B IP address format is: 10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH 6th Sem CSE - Internetworking With TCP/IP
  • 151. Class C Address • The first octet of Class C IP address has its first 3 bits set to 110, that is: • Class C IP addresses range from 192.0.0.x to 223.255.255.x. • The default subnet mask for Class C is 255.255.255.x. • Class C gives 2097152 (221) Network addresses and 254 (28-2) Host addresses. • Class C IP address format is: 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH 6th Sem CSE - Internetworking With TCP/IP
  • 152. Class D Address • Very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of: • Class D has IP address rage from 224.0.0.0 to 239.255.255.255. • Class D is reserved for Multicasting. In multicasting data is not destined for a particular host, that is why there is no need to extract host address from the IP address, and Class D does not have any subnet mask. 6th Sem CSE - Internetworking With TCP/IP
  • 153. Class E Address • This IP Class is reserved for experimental purposes only for R&D or Study. • IP addresses in this class ranges from 240.0.0.0 to 255.255.255.254. • Like Class D, this class too is not equipped with any subnet mask. 6th Sem CSE - Internetworking With TCP/IP
  • 155. Problems with Classful Addressing: • The problem with this classful addressing method is that millions of class A address are wasted, many of the class B address are wasted, whereas, number of addresses available in class C is so small that it cannot cater the needs of organizations. Class D addresses are used for multicast routing, and are therefore available as a single block only. Class E addresses are reserved. • Since there are these problems, • Classful networking/addressing was replaced by Classless Inter-Domain Routing (CIDR) in 1993. 6th Sem CSE - Internetworking With TCP/IP
  • 157. Subnetting  Creates multiple logical networks that exist within a single Class A, B, or C network.  If you do not subnet, you will only be able to use one network from your Class A, B, or C network, which is unrealistic  Each data link on a network must have a unique network ID, with every node on that link being a member of the same network 157 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 158. IPv4 - Subnetting • Each IP class is equipped with its own default subnet mask which bounds that IP class to have prefixed number of Networks and prefixed number of Hosts per network. • Classful IP addressing does not provide any flexibility of having less number of Hosts per Network or more Networks per IP Class. • CIDR or Classless Inter Domain Routing provides the flexibility of borrowing bits of Host part of the IP address and using them as Network in Network, called Subnet. • By using Subnetting, one single Class A IP address can be used to have smaller sub-networks which provides better network management capabilities. 6th Sem CSE - Internetworking With TCP/IP
  • 159. Subnetting. • The process of dividing a single network into multiple sub networks is called as Subnetting. • The sub networks so created are called as subnets. 6th Sem CSE - Internetworking With TCP/IP
  • 160. Advantages of subnetting The main advantages of Subnetting a network are-  It improves the security.  The maintenance and administration of subnets is easy.  Reduced network traffic  Optimized network performance Subnet ID-  Each subnet has its unique network address known as its Subnet ID.  The subnet ID is created by borrowing some bits from the Host ID part of the IP Address.  The number of bits borrowed depends on the number of subnets created. 6th Sem CSE - Internetworking With TCP/IP
  • 162. 1. Fixed Length Subnetting • Fixed length Subnetting also called as classful Subnetting divides the network into subnets where-  All the subnets are of same size.  All the subnets have equal number of hosts.  All the subnets have same subnet mask. 6th Sem CSE - Internetworking With TCP/IP
  • 163. 2. Variable Length Subnetting- • Variable length Subnetting also called as classless Subnetting divides the network into subnets where- • All the subnets are not of same size. • All the subnets do not have equal number of hosts. • All the subnets do not have same subnet mask. 6th Sem CSE - Internetworking With TCP/IP
  • 164. Example-01 Consider- • We have a big single network having IP Address 200.1.2.0. • We want to do Subnetting and divide this network into 2 subnets. • Clearly, the given network belongs to class C. • For creating two subnets and to represent their subnet IDs, we require 1 bit. • So, We borrow one bit from the Host ID part. • After borrowing one bit, Host ID part remains with only 7 bits. 6th Sem CSE - Internetworking With TCP/IP
  • 165. How to create subnets  Determine the number of required network IDs:  One for each subnet  One for each wide area network connection  Determine the number of required host IDs per subnet:  One for each TCP/IP host  One for each router interface  Based on the above requirements, create the following:  One subnet mask for your entire network  A unique subnet ID for each physical segment  A range of host IDs for each subnet 165 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 166. Subnetting a Class A/B/C Address • How many subnets does the chosen subnet mask produce? • How many valid hosts per subnet are available? • What are the valid subnets? • What’s the broadcast address of each subnet? • What are the valid hosts in each subnet? 166 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 167. Formula 1. No of subnets = 2x - Where x is no of bits borrowed 2. No. of host = 2y – 2 - Where Y is no of o’s 3. Magic no or blocksize = Total no of addresses Magic no/Block Size = 256 – Mask 167 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 168. Example-01.. • If borrowed bit = 0, then it represents the first subnet. • If borrowed bit = 1, then it represents the second subnet. IP Address of the two subnets are- • 200.1.2.00000000 = 200.1.2.0 • 200.1.2.10000000 = 200.1.2.128 6th Sem CSE - Internetworking With TCP/IP
  • 169. For 1st Subnet- • IP Address of the subnet = 200.1.2.0 • Total number of IP Addresses = 27 = 128 • Total number of hosts that can be configured = 128 – 2 = 126 • Range of IP Addresses = [200.1.2.00000000, 200.1.2.01111111] = [200.1.2.0, 200.1.2.127] • Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127 • Limited Broadcast Address = 255.255.255.255 6th Sem CSE - Internetworking With TCP/IP
  • 170. For 2nd Subnet- • IP Address of the subnet = 200.1.2.128 • Total number of IP Addresses = 27 = 128 • Total number of hosts that can be configured = 128 – 2 = 126 • Range of IP Addresses = [200.1.2.10000000, 200.1.2.11111111] = [200.1.2.128, 200.1.2.255] • Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255 • Limited Broadcast Address = 255.255.255.255 6th Sem CSE - Internetworking With TCP/IP
  • 171. Practice Example #1C: 255.255.255.128 (/25) Network 192.168.10.0  How many subnets? Since 128 is 1 bit on (10000000), - The answer would be 21= 2.  How many hosts per subnet? - We have 7 host bits off (10000000), so the equation would be 27– 2 = 126 hosts.  What are the valid subnets? - 256 – 128 = 128. Remember, we’ll start at zero and count in our block size, so our subnets are 0, 128.  What’s the broadcast address for each subnet? -The number right before the value of the next subnet is all host bits turned on and equals the broadcast address. For the zero subnet, the next subnet is 128, so the broadcast of the 0 subnet is 127.  What are the valid hosts? -These are the numbers between the subnet and broadcast address 171 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 172. Logical Network Implementation 192.168.10.0 192.168.10.128 .129 .1 .2 .3 .130 .131 172 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 173. Practice Example #2C: 255.255.255.224 (/27) Network 192.168.10.0  How many subnets? 224 is 11100000, so our equation would be 23 = 8.  How many hosts? 25– 2 = 30.  What are the valid subnets? 256 – 224 = 32. We just start at zero and count to the subnet mask value in blocks (increments) of 32: 0, 32, 64, 96, 128, 160, 192, and 224.  What’s the broadcast address for each subnet (always the number right before the next subnet)?  What are the valid hosts (the numbers between the subnet number and the broadcast address)? 173 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 174. Practice Example #2C: 255.255.255.224 (/27) Network 192.168.10.0 Subnet Address 0 32 …………. 192 224 First Host 1 33 193 225 Last Host 30 62 222 254 Broadcast Address 31 63 223 255 174 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 175. Practice Example #1B: 255.255.128.0 (/17) Network 172.16.0.0  Subnets? 21 = 2  Hosts? 215– 2 = 32,766 (7 bits in the third octet, and 8 in the fourth)  Valid subnets? 256 – 128 = 128. 0, 128. Remember that subnetting is performed in the third octet, so the subnet numbers are really 0.0 and 128.0, as shown in the next table  Broadcast address for each subnet?  Valid hosts? 175 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 176. Practice Example #1B: 255.255.128.0 (/17) Network 172.16.0.0 Subnet 0.0 128.0 First Host 0.1 128.1 Last Host 127.254 255.254 Broadcast 127.255 255.255 176 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 177. Practice Example #2B: 255.255.240.0 (/20) Network 172.16.0.0 • Subnets? 24= 16. • Hosts? 212 – 2 = 4094. • Valid subnets? 256 – 240 = 0, 16, 32, 48, etc., up to 240. • Broadcast address for each subnet? • Valid hosts? 177 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 178. Practice Example #2B: 255.255.240.0 (/20) Network 172.16.0.0 Subnet 0.0 16.0 ……….. 240.0 First Host 0.1 16.1 240.1 Last Host 15.254 31.254 255.254 Broadcast 15.255 31.255 255.255 178 IP Subnetting & Supernetting - Prof. D. P. Mishra
  • 179. Ex-1 Suppose a network with IP Address 192.16.0.0. is divided into 2 subnets, find number of hosts per subnet. • Also for the first subnet, find- • Subnet Address • First Host ID • Last Host ID • Broadcast Address IP Subnetting & Supernetting - Prof. D. P. Mishra 179
  • 180. Solution. • Given IP Address belongs to class C. • So, 24 bits are reserved for the Net ID. • The given network is divided into 2 subnets. • So, 1 bit is borrowed from the host ID part for the subnet IDs. • Then, Number of bits remaining for the Host ID = 7. • Thus, Number of hosts per subnet = 27 = 128. IP Subnetting & Supernetting - Prof. D. P. Mishra 180
  • 181. Solution. For 1st Subnet- • Subnet Address = First IP Address = 192.16.0.00000000 = 192.16.0.0 • First Host ID = 192.16.0.00000001 = 192.16.0.1 • Last Host ID = 192.16.0.01111110 = 192.16.0.126 • Broadcast Address = Last IP Address = 192.16.0.01111111 = 192.16.0.127 IP Subnetting & Supernetting - Prof. D. P. Mishra 181
  • 182. Ex-2 In a class B, network on the internet has a subnet mask of 255.255.240.0. What is the maximum number of hosts per subnet? A. 4096 B. 4094 C. 4092 D. 4090 IP Subnetting & Supernetting - Prof. D. P. Mishra 182
  • 183. Solution. • Number of bits reserved for network ID in the given subnet mask = 20. • So, Number of bits reserved for Host ID = 32 – 20 = 12 bits. • Thus, Number of hosts per subnet = 212 – 2 = 4094. • In class B, 16 bits are reserved for the network. • So, Number of bits reserved for subnet ID = 20 – 16 = 4 bits. • Number of subnets possible = 24 = 16. • Thus, Option (B) is correct. IP Subnetting & Supernetting - Prof. D. P. Mishra 183
  • 184. EX-3 What is not true about Subnetting? A. It is applied for a single network B. It is used to improve security C. Bits are borrowed from network portion D. Bits are borrowed from Host portion IP Subnetting & Supernetting - Prof. D. P. Mishra 184 Solution: Option (C) is correct.
  • 185. Supernetting • Creating larger network • Reverse process of Subnetting • Combination of two or more networks • Supernetting facilitates regional router aggregation 6th Sem CSE - Internetworking With TCP/IP
  • 186. For Supernetting • Need two or more Network or Subnets. • Make the decimal network into binary value. • Counting 0 and 1. • Supernetting requires the use of routing protocols • that support Classless Inter-Domain Routing (CIDR). 6th Sem CSE - Internetworking With TCP/IP
  • 187. Advantages of Supernet • It reduces the size of routing updates. • It provides a better overview of network. • It decreases the use of resources such as Memory and CPU. • It decreases the required time in rebuilding the routing tables. 6th Sem CSE - Internetworking With TCP/IP
  • 188. Disadvantages of Supernetting • The combination of blocks should be made in power 2; • If three blocks are required, then there must be assigned four blocks. • The whole network should exist in the same class. • When merged, it lacks covering different areas. 6th Sem CSE - Internetworking With TCP/IP
  • 189. 6th Sem CSE - Internetworking With TCP/IP BASIS FOR COMPARISON SUBNETTING SUPERNETTING Basic A process of dividing a network into subnetworks. A process of combining small networks into a larger network. Procedure The number of bits of network addresses is increased. The number of bits of host addresses is increased. Mask bits are moved towards Right of the default mask. Left of the default mask. Implementation VLSM (Variable-length subnet masking). CIDR (Classless interdomain routing). Purpose Used to reduce the address depletion. To simplify and fasten the routing process.
  • 190. Conclusion • Subnetting and supernetting both the terms have inverse meaning • where Subnetting is used to separate the smaller subnetworks form each other by dividing a larger network. • Conversely, supernetting is used to combine the smaller range of addresses into a larger one to make routing process more easy and fast. • Ultimately, both techniques are used to increase the availability of the IP addresses and reduce the depletion of IP addresses. 6th Sem CSE - Internetworking With TCP/IP
  • 191. Security at IP Layer IPSec
  • 192. IPSEC 6th Sem CSE - TCP/IP (IPSEC- IP Security) Fig: Security at Internet Layer as well as on upper layers too
  • 198. Tunnel Mode Fig: Shows IPSEC in Tunnel Mode 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 199. Transport Mode Fig: Shows IPSEC in Transport Mode Doesn’t hide Actual Source and Destination Details 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 200. IKE (Internet Key Exchange) Supporting Protocol of IPSEC that results SA 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 201. Security Association (SA): • SA is agreement between communicating parties about factors such as • IPSEC protocol version in use • Mode of operation (Transport or Tunnel mode) • Cryptographic algorithm • Cryptographic keys and lifetime of keys etc • Once SA is established both major protocols IPSEC (i.e. AH and ESP) make use of it for actual operation • Note: If both AH and ESP are used in that case communicating parties require two set of SA one for AH and other for ESP 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 203. • Connect two sites securely through public network • Allow remote access by individual users. • Allows travelling users to remotely access private network • If we remove VPN link then two sites will be separated with each other • By employing VPN two remote sites seems to be the one/single virtual site What is VPN ? 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 207. Types of VPN • Remote access VPN • Intranet VPN • Extranet VPN 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 208. Remote Access VPN • Gives access to remote or roaming users access of Main office / branch office as shown in above block diagram 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 209. Intranet VPN • As shown in above block diagram Intranet VPN is used for joining different branches of same organization. 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 210. Extranet VPN • As shown main branch office is connected to different business partners through VPN, as Extranet VPN joins branch offices as well the business partners too i.e. it’s not compulsion to provide VPN service to client branch offices only 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 211. Advantages of VPN • Greater scalability • Easy to add or remove users • Reduce long distance Telecommunication cost • Mobility • Scalability 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 212. Disadvantages of VPN • Lack of standards • Understanding of security issues • Unpredictable Intranet traffic • Difficult to accommodate product from different vendors 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 213. Disadvantages of VPN • Lack of standards • Understanding of security issues • Unpredictable Intranet traffic • Difficult to accommodate product from different vendors 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 215. • The wonder of IPv6 lies in its header. • An IPv6 address is 4 times larger than IPv4, but surprisingly, • the header of an IPv6 address is only 2 times larger than IPv4. • IPv6 headers have one Fixed Header and zero or more Optional (Extension) Headers. • All the necessary information that is essential for a router is kept in the Fixed Header. • The Extension Header contains optional information that helps routers to understand how to handle a packet/flow. 6th Sem CSE - TCP/IP (IPSEC- IP Security) IPv6 – Header.
  • 217. 6th Sem CSE - TCP/IP (IPSEC- IP Security) S.N. Field & Description 1 Version (4-bits): It represents the version of Internet Protocol, i.e. 0110. 2 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). 3 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. 4 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. 5 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. 6 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. 7 Source Address (128-bits): This field indicates the address of originator of the packet. 8 Destination Address (128-bits): This field provides the address of intended recipient of the packet.
  • 218. Difference between IPv4 and IPv6 6th Sem CSE - TCP/IP (IPSEC- IP Security)
  • 219. 6th Sem CSE - TCP/IP (IPSEC- IP Security) BASIS OF COMPARISON IPV4 IPV6 Address Configuration Supports Manual and DHCP configuration. Supports Auto-configuration and renumbering End-to-end connection integrity Unachievable Achievable Address Space It can generate 4.29 x 109 addresses. It can produce quite a large number of addresses, i.e., 3.4 x 1038. Security features Security is dependent on application IPSEC is inbuilt in the IPv6 protocol Address length 32 bits (4 bytes) 128 bits (16 bytes) Address Representation In decimal In hexadecimal Fragmentation performed by Sender and forwarding routers Only by the sender Packet flow identification Not available Available and uses flow label field in the header Checksum Field Available Not available Message Transmission Scheme Broadcasting Multicasting and Any casting Encryption and Authentication Not Provided Provided