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

Mod 3

The document outlines the syllabus for a Computer Networks course at Dayananda Sagar University, detailing key topics such as network layer design, routing algorithms, and congestion control. It emphasizes the importance of routing packets through various algorithms like Distance Vector Routing and Link State Routing, as well as the services provided to the transport layer. Additionally, it discusses the mechanisms of store-and-forward packet switching and the implementation of connection-oriented and connectionless services.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views96 pages

Mod 3

The document outlines the syllabus for a Computer Networks course at Dayananda Sagar University, detailing key topics such as network layer design, routing algorithms, and congestion control. It emphasizes the importance of routing packets through various algorithms like Distance Vector Routing and Link State Routing, as well as the services provided to the transport layer. Additionally, it discusses the mechanisms of store-and-forward packet switching and the implementation of connection-oriented and connectionless services.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 96

Dayananda Sagar University

School of Engineering
Devarakaggalahalli, Harohalli Kanakapura Road, Dt, Ramanagara, Karnataka 562112

Department of Computer Science & Engineering


(Artificial Intelligence & Machine Learning)

COMPUTER NETWORKS
SEMESTER – V & III Semester
Course Code: 22AMXXXX /
23AMXXXX
 Dr. G. Naveen Babu, Associate Dean- SOE, DSU.
 Dr. Jayavrinda Vrindavanam, Professor & chairperson, Department of CSE(AI&ML), SoE, DSU.
 Dr. Hanumanth Sastry Sistla Professor, Department of CSE(AI&ML), SoE, DSU.
 Dr. Mude Nagarjuna Naik, Assistant Professor, Dept. of CS&E (AIML) SoE, DSU.
 Prof. Pradeep Kumar K, Assistant Professor, Dept. of CS&E (AIML) SoE, DSU.
 Prof. Pavithra A, Assistant Professor, Dept. of CS&E (AIML) SoE, DSU.
Syllabus
UNIT – III 10 Hours
Network layer design issues; (TB2-Ch5)
Routing algorithms (Distance Vector Routing, Link State Routing and
Hierarchical Routing).; (TB2-Ch5)
Congestion control algorithms; (TB2-Ch5)
Quality of service, and internetworking; (TB2-Ch5)
The network layer in the internet: IPv4 addresses, IPv6; (TB2-Ch5, TB1-Ch19)
Internet control protocols, OSPF (Open Shortest Path First), IP (Internet
Protocol);
(TB2-Ch5)

28/02/2025 2
Network layer design issues
 The network layer is concerned with getting packets from the source all the
way to the destination.
 Getting to the destination may require making many hops at intermediate routers
along the way.
 This function clearly contrasts with that of the data link layer, which has the more
modest goal of just moving frames from one end of a wire to the other.
 The network layer is the lowest layer that deals with end-to-end transmission.
 To achieve its goals, the network layer must know about the topology of the
network (i.e., the set of all routers and links) and choose appropriate paths through
 it, even for large networks.
 It must also take care when choosing routes to avoid overloading some of the
communication lines and routers while leaving others idle.

28/02/2025 3
An introduction to some of the issues that the designers of the network layer must
grapple with. These issues include the service provided to the transport layer and
the internal design of the network:

 Store-and-Forward Packet Switching, pg.no.356


 Services Provided to the Transport Layer, pg.no. 356
 Implementation of Connectionless Service, pg.no. 358
 Implementation of Connection-Oriented Service, pg.no. 359
 Comparison of Virtual-Circuit and Datagram Network, pg.no. 361

28/02/2025 4
Store-and-Forward Packet Switching
 The major components of the network are the ISP’s equipment (routers connected
by transmission lines), shown inside the shaded oval, and the customers’
equipment, shown outside the oval.
 Host H1 is directly connected to one of the ISP’s routers, A, perhaps as a home
computer that is plugged into a DSL modem.
 In contrast, H2 is on a LAN, which might be an office Ethernet, with a router, F,
owned and operated by the customer.
 This router has a leased line to the ISP’s equipment. F as being outside the oval
because it does not belong to the ISP.
 Routers on customer premises are considered part of the ISP network because they
run the same algorithms as the ISP’s routers.

28/02/2025 5
This equipment is used as follows:
 A host with a packet to send transmits it to the nearest router, either on its own LAN
or over a point-to-point link to the ISP.
 The packet is stored there until it has fully arrived and the link has finished its
processing by verifying the checksum.
 Then it is forwarded to the next router along the path until it reaches the destination
host, where it is delivered.
 This mechanism is store-and-forward packet switching.

28/02/2025 6
Services Provided to the Transport Layer
 The network layer provides services to the transport layer at the network
layer/transport layer interface.
 An important question is precisely what kind of services the network layer provides
to the transport layer.
 The services need to be carefully designed with the following goals in mind:
1. The services should be independent of the router technology.
2. The transport layer should be shielded from the number, type, and topology of
the routers present.
3. The network addresses made available to the transport layer should use a
uniform numbering plan, even across LANs and WANs.

28/02/2025 7
Implementation of Connectionless Service

 Two different organizations are possible, depending on the type of service offered.
 If connectionless service is offered, packets are injected into the network
individually and routed independently of each other. No advance setup is needed. In
this context, the packets are frequently called datagrams (in analogy with
telegrams) and the network is called a datagram network.
 If connection-oriented service is used, a path from the source router all the way
to the destination router must be established before any data packets can be sent.
This connection is called a VC (virtual circuit), in analogy with the physical circuits
set up by the telephone system, and the network is called a virtual-circuit
network.
 Suppose that the process P1 in Fig. has a long message for P2. It hands the
message to the transport layer, with instructions to deliver it to process P2 on host
H2. The transport layer code runs on H1, typically within the operating system. It
prepends a transport header to the front of the message and hands the result to the
network layer, probably just another procedure within the operating system.

28/02/2025 8
28/02/2025 9
Implementation of Connection-Oriented Service
 For connection-oriented service, we need a virtual-circuit network.
 The idea behind virtual circuits is to avoid having to choose a new route for every
packet sent, as in Fig.
 Instead, when a connection is established, a route from the source machine to the
destination machine is chosen as part of the connection setup and stored in tables
inside the routers.
 That route is used for all traffic flowing over the connection, exactly the same way
that the telephone system works.
 When the connection is released, the virtual circuit is also terminated. With
connection-oriented service, each packet carries an identifier telling which virtual
circuit it belongs to.
 As an example, consider the situation shown in Fig. 5-3. Here, host H1 has
established connection 1 with host H2. This connection is remembered as the first
entry in each of the routing tables.
 The first line of A’s table says that if a packet bearing connection identifier 1 comes
in from H1, it is to be sent to router C and given connection identifier 1. Similarly,
the first entry at C routes the packet to E, also with connection identifier 1.
28/02/2025 10
28/02/2025 11
 In some contexts, this process is called label switching. An example of a
connection-oriented network service is MPLS (MultiProtocol Label Switching).
 It is used within ISP networks in the Internet, with IP packets wrapped in an MPLS
header having a 20-bit connection identifier or label. MPLS is often hidden from
customers, with the ISP establishing long-term connections for large amounts of
traffic, but it is increasingly being used to help when quality of service is important
but also with other ISP traffic management tasks.

28/02/2025 12
Comparison of Virtual-Circuit and Datagram Network

28/02/2025 13
Routing algorithms
 The main function of the network layer is routing packets from the source machine
to the destination machine.
 In most networks, packets will require multiple hops to make the journey. The only
notable exception is for broadcast networks, but even here routing is an issue if the
source and destination are not on the same network segment.
 The algorithms that choose the routes and the data structures that they use are a
major area of network layer design.
 The routing algorithm is that part of the network layer software responsible for
deciding which output line an incoming packet should be transmitted on.
 If the network uses datagrams internally, this decision must be made a new for
every arriving data packet since the best route may have changed since last time.
 If the network uses virtual circuits internally, routing decisions are made only when
a new virtual circuit is being set up. Thereafter, data packets just follow the already
established route.
 The latter case is sometimes called session routing because a route remains in
force for an entire session (e.g., while logged in over a VPN).
28/02/2025 14
 It is sometimes useful to make a distinction between routing, which is making the
decision which routes to use, and forwarding, which is what happens when a packet
arrives.
 One can think of a router as having two processes inside it. One of them handles
each packet as it arrives, looking up the outgoing line to use for it in the routing
tables. This process is forwarding.
 The other process is responsible for filling in and updating the routing tables. That is
where the routing algorithm comes into play.
 Routing algorithms can be grouped into two major classes:
1. Nonadaptive and
2. Adaptive.

28/02/2025 15
 Nonadaptive algorithms do not base their routing decisions on any
measurements or estimates of the current topology and traffic. Instead, the choice
of the route to use to get from I to J (for all I and J) is computed in advance, offline,
and downloaded to the routers when the network is booted. This procedure is
sometimes called static routing. Because it does not respond to failures, static
routing is mostly useful for situations in which the routing choice is clear.
 Adaptive algorithms, in contrast, change their routing decisions to reflect
changes in the topology, and sometimes changes in the traffic as well. These
dynamic routing algorithms differ in where they get their information (e.g., locally,
from adjacent routers, or from all routers), when they change the routes (e.g., when
the topology changes, or every ΔT seconds as the load changes), and what metric is
used for optimization (e.g., distance, number of hops, or estimated transit time).

28/02/2025 16
Routing Algorithms
 The Optimality Principle
 Shortest Path Algorithm
 Flooding
 Distance Vector Routing
 Link State Routing
 Hierarchical Routing
 Broadcast Routing
 Multicast Routing
 Any cast Routing
 Routing for Mobile Hosts
 Routingin AdHoc Networks

28/02/2025 17
Distance Vector Routing
 Computer networks generally use dynamic routing algorithms that are more
complex than flooding, but more efficient because they find shortest paths for the
current topology.
 Two dynamic algorithms in particular, distance vector routing and link state
routing, are the most popular.
 A distance vector routing algorithm operates by having each router maintain a table
(i.e., a vector) giving the best known distance to each destination and which link to
use to get there.
 These tables are updated by exchanging information with the neighbors. Eventually,
every router knows the best link to reach each destination.
 The distance vector routing algorithm is sometimes called by other names, most
commonly the distributed Bellman-Ford routing algorithm,

28/02/2025 18
 In distance vector routing, each router maintains a routing table indexed by,
and containing one entry for each router in the network.
 This entry has two parts: the preferred outgoing line to use for that
destination and an estimate of the distance to that destination. The
distance might be measured as the number of hops or using another metric.
 The router is assumed to know the ‘‘distance’’ to each of its neighbors. If the metric
is hops, the distance is just one hop. If the metric is propagation delay, the router
can measure it directly with special ECHO packets that the receiver just timestamps
and sends back as fast as it can.

28/02/2025 19
Part(a) shows a network.
The first four columns of part
(b)show the delay vectors received
from the neighbors of router J. A
claims to have a 12-msec delay to B,
a 25-msec delay to C, a 40 msec
delay to D, etc. Suppose that J has
measured or estimated its delay to
its neighbors, A, I, H, and K, as 8, 10,
12, and 6msec, respectively.

(a) A network. (b) Input from A, I, H, K, and the new routing table for J.

28/02/2025 20
 Consider how J computes its new route to router G. It knows that it can get to A in
8msec, and further more A claims to be able to get to G in18msec, so J knows it can
count on a delay of 26msec to G if it forwards packets bound for G toA. Similarly, it
computes the delay to G via I, H, and K as 41(31+10),18 (6+12), and
37(31+6)msec, respectively. The best of these values is18, so it makes an entry in
its routing table that the delay to G is 18msec and that the route to use is via H. The
same calculation is performed for all the other destinations, with the new routing
table shown in the last column of the figure.

 The Count-to-Infinity Problem: The settling of routes to best paths across the network is
called convergence. Distance vector routing is useful as a simple technique by which
routers can collectively compute shortest paths, but it has a serious drawback in practice:
although it converges to the correct answer, it may do so slowly. In particular, it reacts
rapidly to good news, but leisurely to badnews. Consider a router whose best route to
destination X is long. If, on the next exchange, neighbor A suddenly reports a short delay to
X, the router just switches over to using the line to A to send traffic to X. In one vector
exchange, the good news is processed.
28/02/2025 21
Link State Routing
 Distance vector routing was used in the ARPANET until 1979, when it was replaced
by link state routing.
 The primary problem that caused its demise was that the algorithm often took too
long to converge after the network topology changed (due to the count-to-infinity
problem). Consequently.
 A new algorithm, now called link state routing was introduced.
 Variants of link state routing called IS-IS and OSPF are the routing algorithms that
are most widely used inside large networks and the Internet today.
 The idea behind link state routing is fairly simple and can be stated as five parts.

28/02/2025 22
 Each router must do the following things to make it work:
1. Discover its neighbors and learn their network addresses.
2. Set the distance or cost metric to each of its neighbors.
3. Construct a packet telling all it has just learned.
4. Send this packet to and receive packets from all other routers.
5. Compute the shortest path to every other router.

Dijkstra’s algorithm can be run at each router to find the shortest path to
every other router.
5 states explanation is as follows:

28/02/2025 23
Learning about the Neighbors:
 When a router is booted, its first task is to learn who its neighbors are. It
accomplishes this goal by sending a special HELLO packet on each point-to-point
line.
 The router on the other end is expected to send back a reply giving its name.
 When two or more routers are connected by a broadcast link (e.g., a switch, ring, or
classic Ethernet), the situation is slightly more complicated.
 Fig. illustrates a broadcast LAN to which three routers, A, C, and F, are directly
connected. Each of these routers is connected to one or more additional routers.
 The broadcast LAN provides connectivity between each pair of attached routers.
 A better way to model the LAN is to consider it as a node itself, as shown in Fig.
 Here, we have introduced a new, artificial node, N, to which A, C, and F are
connected. One designated router on the LAN is selected to play the role of N in the
routing protocol.
 The fact that it is possible to go from A to C on the LAN is represented by the path
ANC here.

28/02/2025 24
28/02/2025 25
Setting Link Costs:
 The link state routing algorithm requires each link to have a distance or cost metric
for finding shortest paths.
 The cost to reach neighbors can be set automatically, or configured by the network
operator.
 If the network is geographically spread out, the delay of the links may be factored
into the cost so that paths over shorter links are better choices.
 The most direct way to determine this delay is to send over the line a special ECHO
packet that the other side is required to send back immediately. By measuring the
round-trip time and dividing it by two, the sending router can get a reasonable
estimate of the delay.

28/02/2025 26
 Building Link State Packets:
 Once the information needed for the exchange has been collected, the next step is
for each router to build a packet containing all the data.
 The packet starts with the identity of the sender, followed by a sequence
number and age and a list of neighbors.
 Building the link state packets is easy.
 The hard part is determining when to build them. One possibility is to build them
periodically, that is, at regular intervals. Another possibility is to build them when
some significant event occurs, such as a line or neighbor going down or coming
back up again or changing its properties appreciably.

28/02/2025 27
Find the Shortest distance by applying LSR using
neighbor's node

28/02/2025 28
Solution

28/02/2025 29
Distributing the Link State Packets:
 The trickiest part of the algorithm is distributing the link state packets.
 All of the routers must get all of the link state packets quickly and reliably.
First :
 If different routers are using different versions of the topology, the routes they
compute can have inconsistencies such as loops, unreachable machines, and other
problems.
 The fundamental idea is to use flooding to distribute the link state packets to all
routers.
 To keep the flood in check, each packet contains a 32-bit sequence number that
is incremented for each new packet sent. Routers keep track of all the (source
router, sequence) pairs they see.
 When a new link state packet comes in, it is checked against the list of packets
already seen. If it is new, it is forwarded on all lines except the one it arrived on. If it
is a duplicate, it is discarded.

28/02/2025 30
Distributing the Link State Packets:
Second:
 If a router ever crashes, it will lose track of its sequence number. If it starts again at
0, the next packet it sends will be rejected as a duplicate.
Third:
 If a sequence number is ever corrupted and 65,540 is received instead of 4 (a 1-bit
error), packets 5 through 65,540 will be rejected as obsolete, since the current
sequence number will be thought to be 65,540.
 The solution to all these problems is to include the age of each packet after the
sequence number and decrement it once per second.
 When the age hits zero, the information from that router is discarded. Normally, a
new packet comes in, say, every 10 sec, so router information only times out when
a router is down (or six consecutive packets have been lost, an unlikely event).
 The Age field is also decremented by each router during the initial flooding process,
to make sure no packet can get lost and live for an indefinite period of time (a
packet whose age is zero is discarded).
28/02/2025 31
Computing the New Routes:
 Once a router has accumulated a full set of link state packets, it can construct the
entire network graph because every link is represented.
 Every link is, in fact, represented twice, once for each direction. The different
directions may even have different costs.
 The shortest-path computations may then find different paths from router A to B
than from router B to A.
 Now Dijkstra’s algorithm can be run locally to construct the shortest paths to all
possible destinations. The results of this algorithm tell the router which link to use to
reach each destination. This information is installed in the routing tables, and
normal operation is resumed.

28/02/2025 32
Computing the New Routes:
 Link state routing is widely used in actual networks.
 Many ISPs use the IS-IS (Intermediate System-Intermediate System) link state
protocol (Oran, 1990). It was designed for an early network called DECnet, later
adopted by ISO for use with the OSI protocols and then modified to handle other
protocols as well, most notably, IP.
 OSPF (Open Shortest Path First) is the other main link state protocol. It was
designed by IETF several years after IS-IS and adopted many of the innovations
designed for IS-IS.
 These innovations include a self-stabilizing method of flooding link state updates,
the concept of a designated router on a LAN, and the method of computing and
supporting path splitting and multiple metrics.

28/02/2025 33
Hierarchical Routing
 As networks grow in size, the router routing tables grow proportionally. Not only is
router memory consumed by ever-increasing tables, but more CPU time is needed
to scan them and more bandwidth is needed to send status reports about them. At
a certain point, the network may grow to the point where it is no longer feasible for
every router to have an entry for every other router, so the routing will have to be
done hierarchically, as it is in the telephone network.
 In hierarchical routing, the routers are divided into regions. Each router has
complete details about how to route packets to destinations within its own region.
 Each router has information about the routers in its own region and it has no
information about routers in other regions. So, routers save one record in their table
for every other region.
 For huge networks, a two-level hierarchy may be insufficient hence, it may be
necessary to group the regions into clusters, the clusters into zones, the zones into
groups and so on.

28/02/2025 34
28/02/2025 35
Congestion control algorithms
 Too many packets present in the network causes packet delay and loss that degrades
performance. This situation is called congestion.
 The network and transport layers share the responsibility for handling
congestion.
 However, the most effective way to control congestion is to reduce the load that the
transport layer is placing on the network. This requires the network and transport
layers to work together.
 Figure depicts the onset of congestion.
 When the number of packets hosts send into the network is well within its carrying
capacity, the number delivered is proportional to the number sent.
 If twice as many are sent, twice as many are delivered. However, as the offered load
approaches the carrying capacity, bursts of traffic occasionally fill up the buffers
inside routers and some packets are lost.
 These lost packets consume some of the capacity, so the number of delivered
packets falls below the ideal curve. The network is now congested.

28/02/2025 36
28/02/2025 37
 Unless the network is well designed, it may experience a congestion collapse, in which
performance plummets as the offered load increases beyond the capacity.
 This can happen because packets can be sufficiently delayed inside the network that
they are no longer useful when they leave the network.
 Design networks that avoid congestion where possible and do not suffer from
congestion collapse if they do become congested.
 Congestion cannot wholly be avoided. If all of a sudden, streams of packets begin
arriving on three or four input lines and all need the same output line, a queue will
build up.

28/02/2025 38
Types of congestion control
 Explicit Congestion Notification (ECN): A method to control network congestion
without dropping packets
 Active Queue Management (AQM): Sends early congestion notification alerts to
end devices, which then reduce their transmission rates
 Leaky Bucket Algorithm: Regulates data transmission by allowing a fixed amount
of data to be sent at a constant rate
 Random Early Detection (RED): Decreases the number of dropped packets in
routers and reduces delay
 Slow Start: During congestion control, CWND is increased by the number of
segments acknowledged each time an ACK is received
 Token Bucket Algorithm: Regulates the transmission rate of packets by depleting
a token from the bucket for each transmitted packet
 Congestion control is used to identify conditions that cause heavy load and invoke
policies to address them. It's necessary to maintain network stability, reliability, and
performance, and to ensure that critical applications can operate seamlessly.

28/02/2025 39
Approaches to Congestion Control
 The presence of congestion means that the load is (temporarily) greater than the
resources (in a part of the network) can handle.
 Two solutions come to mind:
 Increase the resources
 Decrease the load.

28/02/2025 40
1. Network Provisioning
Network provisioning refers to the process of configuring and allocating network resources
such as bandwidth, IP addresses, and hardware to ensure that users and applications have
the necessary capacity to operate efficiently. It involves tasks like:
•Capacity Planning: Estimating the amount of bandwidth, switches, routers, and other
resources required for expected network traffic.
•Resource Allocation: Assigning resources to different users or services based on priorities,
ensuring that critical applications receive enough bandwidth and latency requirements.
•Scalability: Ensuring that the network can grow without performance degradation as more
devices or users connect.
2. Traffic-Aware Routing
Traffic-aware routing is a dynamic routing technique where decisions on packet forwarding are
based on real-time traffic conditions, such as network congestion, link failures, and latency. The
goal is to optimize the use of network resources by directing traffic through less congested or
more efficient paths.
•Algorithms: Protocols like OSPF (Open Shortest Path First) and EIGRP (Enhanced Interior
Gateway Routing Protocol) use traffic-aware metrics (such as link delay or bandwidth availability)
to make routing decisions.
•Benefits: Reduces bottlenecks, improves load distribution, and enhances overall network
performance.
28/02/2025 41
3. Admission Control
Admission control refers to the process of determining whether to accept or reject new traffic
flows based on current network conditions and resource availability. It is essential for maintaining
the Quality of Service (QoS) in networks that support real-time applications like VoIP or video
streaming.
•Working: Before accepting a new connection or traffic flow, the system checks whether
sufficient bandwidth and resources are available to meet the application's performance
requirements.
•Goal: Prevent network overload by ensuring only the traffic that the network can handle is
admitted, maintaining high performance for existing flows.
4. Traffic Throttling
Traffic throttling is the intentional slowing down of network traffic by controlling the rate at which
data packets are sent across the network. It helps manage network congestion, prevent overuse
of bandwidth, and ensure fair usage across users.
•Usage: Internet Service Providers (ISPs) often implement throttling to reduce network
congestion during peak hours or limit excessive data usage by certain users.
•Techniques: Traffic shaping and rate limiting are commonly used to throttle specific types of
traffic (e.g., peer-to-peer downloads) while prioritizing critical services (e.g., emergency
communication).

28/02/2025 42
5. Load Shedding
Load shedding in computer networks involves selectively dropping or discarding low-priority
traffic during periods of heavy load to prevent network overload and maintain the quality of
critical services.
•Goal: Ensure that essential services or high-priority traffic (such as emergency or real-time
communication) receive enough bandwidth by shedding non-critical traffic (such as bulk file
transfers).
•Benefits: Maintains network stability and prevents total congestion collapse during periods of
extreme demand.

28/02/2025 43
Quality of service
 An easy solution to provide good quality of service is to build a network with enough
capacity for whatever traffic will be thrown at it.
 The name for this solution is overprovisioning. The resulting network will carry
application traffic without significant loss and, assuming a decent routing scheme, will
deliver packets with low latency.
 The trouble with this solution is that it is expensive. It is basically solving a problem by
throwing money at it.
 Quality of service mechanisms let a network with less capacity meet application
requirements just as well at a lower cost.

Four issues must be addressed to ensure quality of service:


1. What applications need from the network.
2. How to regulate the traffic that enters the network.
3. How to reserve resources at routers to guarantee performance.
4. Whether the network can safely accept more traffic.

28/02/2025 44
 Two versions of quality of service for the Internet called Integrated Services
(IntServ) and Differentiated Services(DiffServ).
 IntServ: A fine-grained, flow-based mechanism that reserves resources for each
session to guarantee performance levels. IntServ is best for small domains where
the number of flows and network size are controlled.
 DiffServ: A coarse-grained, class-based mechanism that classifies traffic into
groups and handles each group differently. DiffServ is best for large networks
because it's more scalable than IntServ.

28/02/2025 45
QoS- Application requirement
 A stream of packets from a source to a destination is called a flow. A flow might be
all the packets of a connection in a connection-oriented network, or all the packets
sent from one process to another process in a connectionless network.
 The needs of each flow can be characterized by four primary parameters:
bandwidth, delay, jitter, and loss. Together, these determine the QoS (Quality of
Service) the flow requires.
 Several common applications and the stringency of their network requirements are
listed.
 Network requirements are less demanding than application requirements in those
cases that the application can improve on the service provided by the network.
 In particular, networks do not need to be lossless for reliable file transfer, and they
do not need to deliver packets with identical delays for audio and video playout.
 Some amount of loss can be repaired with retransmissions, and some amount of
jitter (The variation (i.e., standard deviation) in the delay or packet arrival times is
called jitter) can be smoothed by buffering packets at the receiver.

28/02/2025 46
28/02/2025 47
 To accommodate a variety of applications, networks may support different
categories of QoS. An influential example comes from Asynchronous Transfer Mode
(ATM) networks, which were once part of a grand vision for networking but have
since become a niche technology. They support:

 Constant bit rate (e.g., telephony).


 Real-time variable bit rate (e.g., compressed videoconferencing).
 Non-real-time variable bit rate (e.g., watching a movie on demand).
 Available bit rate (e.g., file transfer).

28/02/2025 48
QoS- Traffic Shaping
 Traffic shaping is a technique for regulating the average rate and burstiness of
a flow of data that enters the network.
 The goal is to allow applications to transmit a wide variety of traffic that suits their
needs, including some bursts, yet have a simple and useful way to describe the
possible traffic patterns to the network.
 When a flow is set up, the user and the network (i.e., the customer and the
provider) agree on a certain traffic pattern (i.e., shape) for that flow.
 In effect, the customer says to the provider ‘‘My transmission pattern will look like
this; can you handle it?’’
 This agreement is called an SLA (Service Level Agreement), especially when it is
made over aggregate flows and long periods of time, such as all of the traffic for a
given customer.
 As long as the customer fulfills her part of the bargain and only sends packets
according to the agreed-on contract, the provider promises to deliver them all in a
timely fashion.
 Traffic shaping reduces congestion and thus helps the network live up to its
promise.
 Monitoring
28/02/2025
a traffic flow is called traffic policing. 49
 There are 2 types of traffic shaping algorithms:

 Leaky Bucket
 Token Bucket

 Token Bucket and Leaky Bucket are two algorithms used for network traffic shaping
and rate limiting. They help manage the rate of traffic flow in a network, but they do
so in slightly different ways.

28/02/2025 50
Token Bucket Algorithm
 Mechanism: The token bucket algorithm is based on tokens being added to a
bucket at a fixed rate. Each token represents permission to send a certain amount
of data. When a packet (data) needs to be sent, it can only be transmitted if there is
a token available, which is then removed from the bucket.
Characteristics:
 Burst Allowance: Can handle bursty traffic because the bucket can store tokens,
allowing for temporary bursts of data as long as there are tokens in the bucket.
 Flexibility: The rate of token addition and the size of the bucket can be adjusted to
control the data rate.
Pros:
 Allows for flexibility in handling bursts of traffic.
 Useful for applications where occasional bursts are acceptable.
Cons:
 Requires monitoring the number of available tokens, which might add complexity.

28/02/2025 51
Leaky Bucket Algorithm
 Mechanism: In the leaky bucket algorithm, packets are added to a queue (bucket),
and they are released at a steady, constant rate. If the bucket (buffer) is full,
incoming packets are discarded or queued for later transmission.
Characteristics:
 Smooth Traffic: Ensures a steady, uniform output rate regardless of the input
burstiness.
 Overflow: Can result in packet loss if the bucket overflows.
Pros:
 Simple to implement and understand.
 Ensures a steady, consistent flow of traffic.
Cons:
 Does not allow for much flexibility in handling traffic bursts.
 Can lead to packet loss if incoming rate exceeds the bucket’s capacity.

28/02/2025 52
Difference between Leaky and Token buckets

Leaky Bucket Token Bucket


When the host has to send a packet , In this, the bucket holds tokens
packet is thrown in bucket. generated at regular intervals of time.

Bucket leaks at constant rate Bucket has maximum capacity.

If there is a ready packet , a token is


Bursty traffic is converted into uniform
removed from Bucket and packet is
traffic by leaky bucket.
send.

In practice bucket is a finite queue If there is no token in the bucket, then


outputs at finite rate the packet cannot be sent.

28/02/2025 53
Numerical question on Leaky bucket

28/02/2025 54
Solution

28/02/2025 55
Numerical question on Leaky bucket

28/02/2025 56
QoS- Admission Control
 QoS guarantees are established through the process of admission control.
 The network then decides whether to accept or reject the flow based on its capacity
and the commitments it has made to other flows. If it accepts, the network reserves
capacity in advance at routers to guarantee QoS when traffic is sent on the new
flow.
 Any routers on the path without reservations might become congested, and a single
congested router can break the QoS guarantee. Many routing algorithms find the
single best path between each source and each destination and send all traffic over
the best path.
 QoS guarantees for new flows may still be accommodated by choosing a different
route for the flow that has excess capacity. This is called QoS routing.
 Because many parties may be involved in the flow negotiation (the sender, the
receiver, and all the routers along the path between them), flows must be described
accurately in terms of specific parameters that can be negotiated. A set of such
parameters is called a flow specification.

28/02/2025 57
 Based on RFCs 2210 and 2211 for Integrated Services, a QoS design has 5
parameters.

 The first two parameters, the token bucket


rate and token bucket size, use a token
bucket to give the maximum sustained rate
the sender may transmit, averaged over a
long time interval, and the largest burst it can
send over a short time interval.
 The third parameter, the peak data rate, is
the maximum transmission rate tolerated,
even for brief time intervals. The sender must
never exceed this rate even for short bursts.
 The last two parameters specify the
minimum and maximum packet sizes,
including the transport and network layer
headers (e.g., TCP and IP)

28/02/2025 58
 The first two parameters, the token bucket rate and token bucket size, use a
token bucket to give the maximum sustained rate the sender may transmit,
averaged over a long time interval, and the largest burst it can send over a short
time interval.
 The third parameter, the peak data rate, is the maximum transmission rate
tolerated, even for brief time intervals. The sender must never exceed this rate
even for short bursts.
 The last two parameters specify the minimum and maximum packet sizes, including
the transport and network layer headers (e.g., TCP and IP)

28/02/2025 59
Internetworking
 when two or more networks are connected to form an internetwork, or more simply
an internet.
 Many different networks exist, including PANs, LANs, MANs, and WANs. We have
described Ethernet, Internet over cable, the fixed and mobile telephone networks,
802.11, 802.16, and more.
 The Internet is the prime example of this interconnection. (We will write Internet
with a capital ‘‘I’’ to distinguish it from other internets, or connected networks.) The
purpose of joining all these networks is to allow users on any of them to
communicate with users on all the other ones.

28/02/2025 60
How Networks Differ:

28/02/2025 61
How Networks Can Be Connected:
 There are two basic choices for connecting different networks: we can build devices
that translate or convert packets from each kind of network into packets for each
other network we can try to solve the problem by adding a layer of indirection and
building a common layer on top of the different networks. In either case, the
devices are placed at the boundaries between networks

28/02/2025 62
 Tunneling:
 Handling the general case of making two different networks interwork is
exceedingly difficult.
 However, there is a common special case that is manageable even for different
network protocols.
 This case is where the source and destination hosts are on the same type of
network, but there is a different network in between. As an example, think of an
international bank with an IPv6 network in Paris, an IPv6 network in London and
connectivity between the offices via the IPv4 Internet.
 This situation is shown in Fig

28/02/2025 63
 The solution to this problem is a technique called tunneling.

 Tunneling is widely used to connect isolated hosts and networks using other
networks. The network that results is called an overlay since it has
effectively been overlaid on the base network. Deployment of a network
protocol with a new feature is a common reason, as our ‘‘IPv6 over IPv4’’

28/02/2025 64
Internetwork Routing:
 The internet may be much larger than any of the networks that comprise it. It may
therefore require routing algorithms that scale well by using a hierarchy, even if
none of the individual networks need to use a hierarchy.
 All of these considerations lead to a two-level routing algorithm. Within each
network, an intradomain or interior gateway protocol is used for routing.
 Across the networks that make up the internet, an interdomain or exterior
gateway protocol is used.
 In the Internet, the interdomain routing protocol is called BGP (Border Gateway
Protocol).

28/02/2025 65
Packet Fragmentation:
 Each network or link imposes some maximum size on its packets. These limits have
various causes, among them
 1. Hardware (e.g., the size of an Ethernet frame).
 2. Operating system (e.g., all buffers are 512 bytes).
 3. Protocols (e.g., the number of bits in the packet length field).
 4. Compliance with some (inter)national standard.
 5. Desire to reduce error-induced retransmissions to some level.
 6. Desire to prevent one packet from occupying the channel too long.

 Allow routers to break up packets into fragments, sending each fragment as a


separate network layer packet.

28/02/2025 66
28/02/2025 67
28/02/2025 68
The network layer in the internet
 Quasihierarchical organization

 The glue that holds the whole


Internet together is the
network layer protocol, IP
(Internet Protocol).

 Unlike most older network


layer protocols, IP was
designed from the beginning
with internetworking in mind.

28/02/2025 69
The IP Version 4 Protocol:

28/02/2025 70
 Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a
standalone specification.
 It is one of the core protocols of standards-based internetworking methods in the
Internet and other packet-switched networks.
 IPv4 was the first version deployed for production on SATNET in 1982 and on the
ARPANET in January 1983.
 It is still used to route most Internet traffic today, even with the ongoing
deployment of Internet Protocol version 6 (IPv6), its successor.
 IPv4 uses a 32-bit address space which provides 4,294,967,296 (232) unique
addresses, but large blocks are reserved for special networking purposes.

28/02/2025 71
 The Internet Protocol is the protocol that defines and enables internetworking
at the internet layer of the Internet Protocol Suite. In essence it forms the Internet. It
uses a logical addressing system and performs routing, which is the
forwarding of packets from a source host to the next router that is one hop closer to
the intended destination host on another network.

 IPv4 is a connectionless protocol, and operates on a best-effort delivery


model, in that it does not guarantee delivery, nor does it assure proper
sequencing or avoidance of duplicate delivery. These aspects, including data
integrity, are addressed by an upper layer transport protocol, such as the
Transmission Control Protocol (TCP).

28/02/2025 72
 as

28/02/2025 73
 Version: 4 bits
The first header field in an IP packet is the Version field. For IPv4, this is always equal to 4.

 Internet Header Length (IHL): 4 bits


The IPv4 header is variable in size due to the optional 14th field (Options). The IHL field
contains the size of the IPv4 header; it has 4 bits that specify the number of 32-bit words in
the header. The minimum value for this field is 5, which indicates a length of 5 × 32 bits =
160 bits = 20 bytes. As a 4-bit field, the maximum value is 15; this means that the
maximum size of the IPv4 header is 15 × 32 bits = 480 bits = 60 bytes.

 Differentiated Services Code Point (DSCP): 6 bits


Originally defined as the type of service (ToS), this field specifies differentiated services
(DiffServ). Real-time data streaming makes use of the DSCP field. An example is
Voice over IP (VoIP), which is used for interactive voice services.

 Explicit Congestion Notification (ECN): 2 bits


This field allows end-to-end notification of network congestion without dropping packets
. ECN is an optional feature available when both endpoints support it and effective when also
supported by the underlying network.
28/02/2025 74
 Total Length: 16 bits
This 16-bit field defines the entire packet size in bytes, including header and data. The minimum
size is 20 bytes (header without data) and the maximum is 65,535 bytes. All hosts are
required to be able to reassemble datagrams of size up to 576 bytes, but most modern hosts
handle much larger packets. Links may impose further restrictions on the packet size, in
which case datagrams must be fragmented. Fragmentation in IPv4 is performed in either the
sending host or in routers. Reassembly is performed at the receiving host.
 Identification: 16 bits
This field is an identification field and is primarily used for uniquely identifying the group of
fragments of a single IP datagram. Some experimental work has suggested using the ID field
for other purposes, such as for adding packet-tracing information to help trace datagrams
with spoofed source addresses,[36] but any such use is now prohibited.[37]

28/02/2025 75
 Flags: 3 bits
There are three flags defined within this field.
 Reserved (R): 1 bit
Reserved. Should be set to 0.[a]
• Don't Fragment (DF): 1 bit
This field specifies whether the datagram can be fragmented or not. This can be used
when sending packets to a host that does not have resources to perform
reassembly of fragments. It can also be used for path MTU discovery, either
automatically by the host IP software, or manually using diagnostic tools such
as ping or traceroute. If the DF flag is set, and fragmentation is required to
route the packet, then the packet is dropped.
• More Fragments (MF): 1 bit
For unfragmented packets, the MF flag is cleared. For fragmented packets, all
fragments except the last have the MF flag set. The last fragment has a non-
zero Fragment Offset field, so it can still be differentiated from an
unfragmented packet.

28/02/2025 76
 Fragment Offset: 13 bits
This field specifies the offset of a particular fragment relative to the beginning of the original
unfragmented IP datagram. Fragments are specified in units of 8 bytes, which is why fragment
lengths are always a multiple of 8; except the last, which may be smaller. [39]
The fragmentation offset value for the first fragment is always 0. The field is 13 bits wide, so
the offset value ranges from 0 to 8191 (from (20 – 1) to (213 – 1)). Therefore, it allows a
maximum fragment offset of (213 – 1) × 8 = 65,528 bytes, with the header length included
(65,528 + 20 = 65,548 bytes), supporting fragmentation of packets exceeding the maximum IP
length of 65,535 bytes.
 Time to live (TTL): 8 bits
The time to live field limits a datagram's lifetime to prevent network failure in the event of a
routing loop. It is specified in seconds, but time intervals less than 1 second are rounded up to
1. In practice, the field is used as a hop count—when the datagram arrives at a router, the
router decrements the TTL field by one. When the TTL field hits zero, the router discards the
packet and typically sends an ICMP time exceeded message to the sender.
The program traceroute sends messages with adjusted TTL values and uses these ICMP time
exceeded messages to identify the routers traversed by packets from the source to the
destination.

28/02/2025 77
 Protocol: 8 bits
This field defines the transport layer protocol used in the data portion of the IP datagram. The
list of IP protocol numbers is maintained by Internet Assigned Numbers Authority
(IANA).Some of the common payload protocols include:

Protocol Number Protocol Name Abbreviation


1 Internet Control Message Protocol ICMP
2 Internet Group Management Protocol IGMP
6 Transmission Control Protocol TCP
17 User Datagram Protocol UDP
41 IPv6 encapsulation ENCAP
89 Open Shortest Path First OSPF
132 Stream Control Transmission Protocol SCTP

28/02/2025 78
 Header Checksum: 16 bits
The IPv4 header checksum field is used for error checking of the header. Before sending a packet,
the checksum is computed as the 16-bit ones' complement of the ones' complement sum of all
16-bit words in the header. This includes the Header Checksum field itself, which is set to zero
during computation. The packet is sent with Header Checksum containing the resulting value.
When a packet arrives at a router or its destination, the network device recalculates the
checksum value of the header, now including the Header Checksum field. The result should be
zero; if a different result is obtained, the device discards the packet.
 Source address: 32 bits
This field contains the IPv4 address of the sender of the packet. It may be changed in transit by
network address translation (NAT).
 Destination address: 32 bits
This field contains the IPv4 address of the intended receiver of the packet. It may also be affected
by NAT.
If the destination can be reached directly the packet will be delivered by the underlying link layer,
with the help of ARP. If not, the packet needs routing and will be delivered to gateway address
instead.

28/02/2025 79
 Options: 0 - 320 bits, padded to multiples of 32 bits
The Options field is not often used. Packets containing
some options may be considered as dangerous by some routers and be blocked.[40] The
value in the IHL field must include sufficient extra 32-bit words to hold all options and
any padding needed to ensure that the header contains an integral number of 32-bit
words. If IHL is greater than 5 (i.e., it is from 6 to 15) it means that the options field is
present and must be considered. The list of options may be terminated with the option
EOOL (End of Options List, 0x00); this is only necessary if the end of the options would
not otherwise coincide with the end of the header.

28/02/2025 80
IP Version 6
 IPv6 (IP version 6) is a
replacement design that does
just that. It uses 128-bit
addresses; a shortage of these
addresses is not likely any time
in the foreseeable future.

 However, IPv6 has proved very


difficult to deploy. It is a different
network layer protocol that does
not really interwork with IPv4.

28/02/2025 81
 In 1990 IETF started work on a new version of IP, one that would never run out of
addresses, would solve a variety of other problems, and be more flexible and
efficient as well. Its major goals were:
1. Support billions of hosts, even with inefficient address allocation.
2. Reduce the size of the routing tables.
3. Simplify the protocol, to allow routers to process packets faster.
4. Provide better security (authentication and privacy).
5. Pay more attention to the type of service, particularly for real-time data.
6. Aid multicasting by allowing scopes to be specified.
7. Make it possible for a host to roam without changing its address.
8. Allow the protocol to evolve in the future.
9. Permit the old and new protocols to coexist for years.

28/02/2025 82
 IPv6 meets IETF’s goals fairly well. It maintains the good features of IP, discards or
deemphasizes the bad ones, and adds new ones where needed.
 In general, IPv6 is not compatible with IPv4, but it is compatible with the other
auxiliary Internet protocols, including TCP, UDP, ICMP, IGMP, OSPF, BGP, and
DNS, with small modifications being required to deal with longer addresses.

28/02/2025 83
Assignment
 More information on IPV6
 Difference between IPV4 & IPV6
 Advantages & disadvantages of IPV4 & IPV6

28/02/2025 84
Internet control protocols
•Internet Control Message Protocol (ICMP)
A fundamental protocol that allows network nodes to share information and errors without using
an upper-layer protocol.
•Transmission Control Protocol (TCP)
A main protocol of the Internet Protocol Suite, and part of the popular "TCP/IP" combination.
•File Transfer Protocol (FTP)
A TCP/IP protocol used to transfer files between computers.
•Address Resolution Protocol (ARP)
Translates IP addresses to MAC addresses and vice versa so LAN endpoints can communicate.
•Simple Mail Transfer Protocol (SMTP)
An email protocol that establishes rules for information exchange between email clients and
accounts.

28/02/2025 85
Internet control protocols
•Border Gateway Protocol (BGP)
A routing protocol that keeps systems on the internet up to date with the information
needed to send and receive data traffic.
•Open Shortest Path First (OSPF)
A shortest path first (SPF) protocol that distributes routing information between
routers.
•Post Office Protocol
An application-layer protocol used by e-mail users to retrieve e-mail from a mail server.
•Point-to-Point Protocol (PPP)
A data link layer communication protocol between two routers.

28/02/2025 86
Assignment
 Explain In detail about: IMCP—The Internet Control Message Protocol, ARP—The
Address Resolution Protocol, DHCP—The Dynamic Host Configuration Protocol, Label
Switching and MPLS.

 Refer Text book 2: Pg. no 465-473

28/02/2025 87
OSPF—An Interior Gateway Routing Protocol

 The Internet is made up of a large number of independent networks or ASes


(Autonomous Systems) that are operated by different organizations, usually a
company, university, or ISP.
 Inside of its own network, an organization can use its own algorithm for internal
routing, or intradomain routing, as it is more commonly known.
 Nevertheless, there are only a handful of standard protocols that are popular.
 In this section, we will study the problem of intradomain routing and look at the
OSPF protocol that is widely used in practice.
 in 1988 IETF began work on a link state protocol for intradomain routing. That
protocol, called OSPF (Open Shortest Path First), became a standard in 1990.
 It drew on a protocol called IS-IS (Intermediate-System to Intermediate-System),
which became an ISO standard.

28/02/2025 88
7 key features of OSPF
1. The algorithm had to be published in the open literature, hence the ‘‘O’’ in OSPF.
2. The new protocol had to support a variety of distance metrics, including physical
distance, delay, and so on.
3. It had to be a dynamic algorithm, one that adapted to changes in the topology
automatically and quickly.
4. It had to support routing based on type of service. The new protocol had to be able
to route real-time traffic one way and other traffic a different way.
5. OSPF had to do load balancing, splitting the load over multiple lines.
6. Support for hierarchical systems was needed which the OSPF had provided.
7. some modicum of security was required to prevent fun-loving students from
spoofing routers by sending them false routing information.

OSPF supports both point-to-point links (e.g., SONET) and broadcast networks
(e.g., most LANs). It is able to support networks with multiple routers, each of which
can communicate directly with the others (called multiaccess networks).

28/02/2025 89
The five kinds of messages used by OSPF

 More explanation refer text book 2 pg. no. 478

28/02/2025 90
28/02/2025 91
IP (Internet Protocol)
 The Internet Protocol (IP) is a protocol, or set of rules, for routing and addressing
packets of data so that they can travel across networks and arrive at the correct
destination.
 Data traversing the Internet is divided into smaller pieces, called packets. IP
information is attached to each packet, and this information helps routers to send
packets to the right place. Every device or domain that connects to the
Internet is assigned an IP address, and as packets are directed to the IP
address attached to them, data arrives where it is needed.

 Once the packets arrive at their destination, they are handled differently depending
on which transport protocol is used in combination with IP. The most common
transport protocols are TCP and UDP.

28/02/2025 92
What is an IP address? How does IP addressing work?

 An IP address is a unique identifier assigned to a device or domain that connects


to the Internet.
 Each IP address is a series of characters, such as '192.168.1.1'. Via DNS
resolvers, which translate human-readable domain names into IP addresses,
users are able to access websites without memorizing this complex series of
characters.
 Each IP packet will contain both the IP address of the device or domain sending the
packet and the IP address of the intended recipient, much like how both the
destination address and the return address are included on a piece of mail.

28/02/2025 93
IP packet
 IP packets are created by adding an IP header to each packet of data before it is
sent on its way. An IP header is just a series of bits (ones and zeros), and it records
several pieces of information about the packet, including the sending and receiving
IP address. IP headers also report:
 Header length
 Packet length
 Time to live (TTL), or the number of network hops a packet can make before it
is discarded
 Which transport protocol is being used (TCP, UDP, etc.)
 In total there are 14 fields for information in IPv4 headers, although one of them is
optional.

28/02/2025 94
TCP/IP
 The Transmission Control Protocol (TCP) is a transport protocol, meaning it
dictates the way data is sent and received. A TCP header is included in the data
portion of each packet that uses TCP/IP. Before transmitting data, TCP opens a
connection with the recipient. TCP ensures that all packets arrive in order once
transmission begins. Via TCP, the recipient will acknowledge receiving each packet
that arrives. Missing packets will be sent again if receipt is not acknowledged.

 TCP is designed for reliability, not speed. Because TCP has to make sure all packets
arrive in order, loading data via TCP/IP can take longer if some packets are missing.

 TCP and IP were originally designed to be used together, and these are often
referred to as the TCP/IP suite. However, other transport protocols can be used with
IP.

28/02/2025 95
UDP/IP
 The User Datagram Protocol, or UDP, is another widely used transport protocol. It is
faster than TCP, but it is also less reliable. UDP does not make sure all packets are
delivered and in order, and it does not establish a connection before beginning or
receiving transmissions.

28/02/2025 96

You might also like