Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
25 views

Computer Networks (LMS) Unit 1

Uploaded by

jatin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Computer Networks (LMS) Unit 1

Uploaded by

jatin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 310

UNIT 1

CO MAPPING

CO1 To develop an understanding of basic networking concepts

BOOKS FOR READING

T1: Computer Networks by Andrew S Tanenbaum


T2: Computer Networking by James F Kurose & Keith W. Ross
T3: Data Communication and Networking by Behrrouz A. Forouzan

VIDEO LINKS

https://www.youtube.com/playlist?list=PLWkguCWKqN9MdQXjSM5DE17NU7_RQA_MH

https://www.digimat.in/nptel/courses/video/106105183/L01.html

https://freevideolectures.com/course/2276/computer-networks

https://www.youtube.com/playlist?list=PLBlnK6fEyqRgMCUAG0XRw78UA8qnv6jEx

READING MATERIAL

CONGESTION CONTROL
▪ Another issue in a network-layer protocol is congestion control.
▪ Congestion in the network layer is a situation in which too many datagrams are
present in an area of the Internet.
▪ Congestion may occur if the number of datagrams sent by source computers is beyond
the capacity of the network or routers.
▪ In this situation, some routers may drop some of the datagrams.

SECURITY
▪ Another issue related to communication at the network layer is security.
▪ To provide security for a connectionless network layer, we need to have another
virtual level that changes the connectionless service to a connectionoriented service.
This virtual layer is called as called IPSec (IP Security).
• The performance of a network can be measured in terms of Delay,
Throughput and Packet loss.
• Congestion control is an issue that can improve the performance.
DELAY
• A packet from its source to its destination, encounters delays.
• The delays in a network can be divided into four types:
Transmission delay, Propagation delay, Processing delay and Queuing delay.

Transmission Delay
• A source host or a router cannot send a packet instantaneously.
• A sender needs to put the bits in a packet on the line one by one.
• If the first bit of the packet is put on the line at time t1 and the last bit is put on the
line at time t2, transmission delay of the packet is (t2 - t1).
• The transmission delay is longer for a longer packet and shorter if the sender can
transmit faster.
• The Transmission delay is calculated using the formula Delaytr = (Packet length) /
(Transmission rate)

• Example :
In a Fast Ethernet LAN with the transmission rate of 100 million bits per
second and a packet of 10,000 bits, it takes (10,000)/(100,000,000) or 100
microseconds for all bits of the packet to be put on the line.

Propagation Delay
• Propagation delay is the time it takes for a bit to travel from point A to point B in the
transmission media.
• The propagation delay for a packet-switched network depends on the propagation
delay of each network (LAN or WAN).
• The propagation delay depends on the propagation speed of the media, which is
3X108 meters/second in a vacuum and normally much less in a wired medium.
• It also depends on the distance of the link.
• The Propagation delay is calculated using the formula
Delaypg = (Distance) / (Propagation speed)

Example
If the distance of a cable link in a point-to-point WAN is 2000 meters and the
propagation speed of the bits in the cable is 2 X 108 meters/second, then the
propagation delay is 10 microseconds.
Processing Delay
• The processing delay is the time required for a router or a destination host to receive
a packet from its input port, remove the header, perform an error detection procedure,
and deliver the packet to the output port (in the case of a
router) or deliver the packet to the upper-layer protocol (in the case of the destination
host).
• The processing delay may be different for each packet, but normally is calculated as
an average.

Delaypr = Time required to process a packet in a router or a destination host

Queuing Delay
• Queuing delay can normally happen in a router.
• A router has an input queue connected to each of its input ports to store packets
waiting to be processed.
• The router also has an output queue connected to each of its output ports to store
packets waiting to be transmitted.
• The queuing delay for a packet in a router is measured as the time a packet waits in
the input queue and output queue of a router.
Delayqu = The time a packet waits in input and output queues in a router

Total Delay
• Assuming equal delays for the sender, routers and receiver, the total delay (source-
to-destination delay) of a packet can be calculated if we know the number of routers,
n, in the whole path.
Total delay = (n + 1) (Delaytr + Delaypg + Delaypr) + (n) (Delayqu) If we
have n routers, we have (n +1) links.
• Therefore, we have (n +1) transmission delays related to n routers and the source,
(n +1) propagation delays related to (n +1) links, (n +1) processing delays related
to n routers and the destination, and only n queuing delays related to n routers.

THROUGHPUT
• Throughput at any point in a network is defined as the number of bits passing
through the point in a second, which is actually the transmission rate of data at that
point.
• In a path from source to destination, a packet may pass through several links
(networks), each with a different transmission rate.
• Throughput is calculated using the formula
Throughput = minimum{TR1 , TR2, . . . TRn}
• Example:
Let us assume that we have three links, each with a different transmission rate.
The data can flow at the rate of 200 kbps in Link1, 100 kbps in Link2 and 150kbps
in Link3.
Throughput = minimum{200,100,150} = 100.

PACKET LOSS
Another issue that severely affects the performance of communication is the number of
packets lost during transmission.

• When a router receives a packet while processing another packet, the received packet
needs to be stored in the input buffer waiting for its turn.
• A router has an input buffer with a limited size.
• A time may come when the buffer is full and the next packet needs to be dropped.
• The effect of packet loss on the Internet network layer is that the packet needs to be
resent, which in turn may create overflow and cause more packet loss.

CONGESTION CONTROL
Congestion at the network layer is related to two issues, throughput and delay.

Based on Delay
• When the load is much less than the capacity of the network, the delay is at a
minimum.
• This minimum delay is composed of propagation delay and processing delay, both of
which are negligible.
• However, when the load reaches the network capacity, the delay increases sharply
because we now need to add the queuing delay to the total delay.
• The delay becomes infinite when the load is greater than the capacity.

Based on Throughout
• When the load is below the capacity of the network, the throughput increases
proportionally with the load.
• We expect the throughput to remain constant after the load reaches the capacity, but
instead the throughput declines sharply. The reason is the discarding of packets by
the routers.
• When the load exceeds the capacity, the queues become full and the routers have to
discard some packets.
• Discarding packets does not reduce the number of packets in the network because the
sources retransmit the packets, using time-out mechanisms, when the packets do not
reach the destinations.
Congestion Control Mechanisms
• Congestion control is a mechanism for improving performance.
• It refers to techniques and mechanisms that can either prevent congestion before it
happens or remove congestion after it has happened.
• In general, we can divide congestion control mechanisms into two broad categories:
➢ Open-loop Congestion control (prevention)
➢ Closed-loop Congestion control (removal)

OPEN-LOOP CONGESTION CONTROL


▪ In open-loop congestion control, policies are applied to prevent congestion before it
happens.
▪ In these mechanisms, congestion control is handled by either the source or the
destination.

Retransmission Policy
➢ Retransmission is sometimes unavoidable.
➢ If the sender feels that a sent packet is lost or corrupted, the packet needs to
be retransmitted.
➢ Retransmission in general may increase congestion in the network.
➢ However, a good retransmission policy can prevent congestion.
➢ The retransmission policy and the retransmission timers must be designed to
optimize efficiency and at the same time prevent congestion.

Window Policy
➢ The type of window at the sender may also affect congestion.
➢ The Selective Repeat window is better than the Go-Back-N window for
congestion control.
➢ In the Go-Back-N window, when the timer for a packet times out, several
packets may be resent, although some may have arrived safe and sound at the
receiver.
➢ This duplication may make the congestion worse.
➢ The Selective Repeat window, on the other hand, tries to send the specific
packets that have been lost or corrupted.

Acknowledgment Policy
➢ The acknowledgment policy imposed by the receiver may also affect
congestion.
➢ If the receiver does not acknowledge every packet it receives, it may slow down
the sender and help prevent congestion.
➢ Several approaches are used in this case.
➢ A receiver may send an acknowledgment only if it has a packet to be sent or a
special timer expires.
➢ A receiver may decide to acknowledge only N packets at a time.
➢ Sending fewer acknowledgments means imposing less load on the network.

Discarding Policy
➢ A good discarding policy by the routers may prevent congestion and at the
same time may not harm the integrity of the transmission.
➢ For example, in audio transmission, if the policy is to discard less sensitive
packets when congestion is likely to happen, the quality of sound is still
preserved and congestion is prevented or alleviated.

Admission Policy
➢ An admission policy, which is a quality-of-service mechanism can also prevent
congestion in virtual-circuit networks.
➢ Switches in a flow first check the resource requirement of a flow before
admitting it to the network.
➢ A router can deny establishing a virtual-circuit connection if there is
congestion in the network or if there is a possibility of future congestion.

CLOSED-LOOP CONGESTION CONTROL


▪ Closed-loop congestion control mechanisms try to alleviate congestion after it
happens.
▪ Several mechanisms have been used by different protocols.

Backpressure
➢ The technique of backpressure refers to a congestion control mechanism in
which a congested node stops receiving data from the immediate upstream
This may cause the upstream node or nodes to become congested, and they, in
turn, reject data from their upstream node or nodes, and so on.
➢ Backpressure is a node-to- node congestion control that starts with a node and
propagates, in the opposite direction of data flow, to the source.
➢ The backpressure technique can be applied only to virtual circuit networks, in
which each node knows the upstream node from which a flow of data is
coming.

Choke Packet
➢ A choke packet is a packet sent by a node to the source to inform it of
congestion.
➢ In backpressure, the warning is from one node to its upstream node, although
the warning may eventually reach the source station.
➢ In the choke-packet method, the warning is from the router, which has
encountered congestion, directly to the source station.
➢ The intermediate nodes through which the packet has traveled are not warned.
➢ The warning message goes directly to the source station; the intermediate
routers do not take any action.

Implicit Signaling
➢ In implicit signaling, there is no communication between the congested node
or nodes and the source.
➢ The source guesses that there is congestion somewhere in the network from
other symptoms.
➢ For example, when a source sends several packets and there is no
acknowledgment for a while, one assumption is that the network is congested.
➢ The delay in receiving an acknowledgment is interpreted as congestion in the
network; the source should slow down.

Explicit Signaling
➢ The node that experiences congestion can explicitly send a signal to the source
or destination.
➢ The explicit-signaling method is different from the choke-packet method.
➢ In the choke-packet method, a separate packet is used for this purpose; in the
explicit-signaling method, the signal is included in the packets that carry data.
➢ Explicit signaling can occur in either the forward or the backward direction.
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (22*CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


Computer Networks

Course Objectives: The "Computer Network" course is where we will go on an


exciting trip through the complex world of computer networks. We want to take
this opportunity to welcome you the purpose of this course is to offer you a strong
foundation in networking basics, hence providing you with the knowledge and
skills essential to build, develop, and maintain sturdy network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.

2
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Recall the fundamental concepts of computer networks, including OSI


CO1
model layers, TCP/IP protocols, and network topologies.

3
Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,


Unit-1 hierarchical, Broadcast routing.

Congestion control: congestion prevention policies, congestion control in


Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.

4
SUGGESTIVE READINGS

1. Computer Networks by Andrew S Tanenbaum


2. Computer Networking by James F Kurose & Keith W. Ross
3. Data Communication and Networking by Behrrouz A. Forouzan

5
DATA COMMUNICATIONS

The term telecommunication means communication at a


distance. The word data refers to information presented in
whatever form is agreed upon by the parties creating and
using the data.

Data communications are the exchange of data between


two devices via some form of transmission medium such as
a wire cable or wireless.
1. Delivery → Correct destination
2. Accuracy → Accurate data
3. Timelines → Real-time transmission
4. Jitter → Uneven delay
Topics to be discussed in this section:

Components
Data Représentation
Data Flow

Components
Figure 1.1 Five components of data communication

5
1

2 3
4
Data Representation
1. Text
2. Numbers
3. Images
4. Audio
5. Video

Data flow

▪ Simplex

▪ Half-duplex

▪ Full-duplex
NETWORKS

A network is a set of devices (nodes) connected by


communication links. A node can be a computer, printer, or
any other device capable of sending and/or receiving data
generated by other nodes on the network.

Topics discussed in this section:


Distributed Processing
Network Criteria (performance, reliability, and security)
Physical Structures ( type of connections and topologies)
Network Models
Categories of Networks ( LAN, MAN and WAN)
Types of connections
◼ Point to point
◼ A dedicated link is provided
between two devices

◼ Multipoint
◼ More than two specific devices
share a single link
Physical Topology

Tree
MESH Topology

Every device has a dedicated point-to-


point link to every other devices
Dedicated
Link carries traffic only between the two
devices it connects
A fully connected mesh network has n(n-
1)/2 physical channels to link n devices
Every device on the network must have n-
1 input/output (I/O) ports
Advantage
Less traffic, robust, secure, easy to
maintain
Disadvantage
n(n-1)/2 physical duplex links
Need more resource (cable and ports),
expensive
STAR Topology

• Each device has a dedicated point-to-point link only to a central controller,


usually called a hub.

• No direct traffic and link between devices

• Advantages
• Less expensive

• Easy to install and reconfigure

• Robustness

• Disadvantage
• Single point of failure
BUS Topology

A Multipoint Topology
All Devices are Linked Through a Backbone Cable
Nodes are Connected to the Bus Cable by Drop Lines and Taps.
• Advantage:
• Ease of Installation
• Disadvantages:
• Difficult Reconnection and Fault Isolation
• Broken or Fault of the Bus Cable stops all Transmission
RING Topology

• Each device is dedicated point-to-point connection only with the two devices on either side of it
• A signal is passed along the ring in the direction, from device to device, until it reaches its
destination
• Each device in the ring incorporates a repeater

• Advantages
• Relatively easy to install and reconfigure
• Fault isolation is simplified
• Disadvantage
• Unidirectional traffic
Tree Topology
Tree topologies integrate multiple topologies together

Example: Tree topology


integrates multiple star
topologies together onto
a bus

Advantages:
Point-to-point wiring for individual segments.
Supported by several hardware and software venders.
Disadvantages:
Overall length of each segment is limited by the type of cabling used.
If the backbone line breaks, the entire segment goes down.
More difficult to configure and wire than other topologies.
Categories of Networks
1. Local Area Network (LAN)
2. Wireless Local Area Network (WLAN)
3. Metropolitan Area Network (MAN)
4. Wide Area Network (WAN)
An isolated LAN connecting 12 computers to a hub in a closet
LAN (Local Area Network)
•Distance: Typically spans a
small geographic area, such as a
single building or a campus. The
range is usually within a few
hundred meters to a few
kilometers.
•Application: Used within a
single building, office, school, or
home to connect computers,
printers, servers, and other
devices for sharing resources and
information.
Metropolitan Area Network (MAN)
Wide Area Network (WAN)
•Distance: Covers a much larger geographic area, potentially
spanning countries or even continents. The range can be
from tens of kilometers to thousands of kilometers.
•Application: Used to connect multiple LANs
and MANs across large distances, enabling
communication and resource sharing among
branch offices, regional offices, and
international locations of an organization.
WANs: a switched WAN and a point-to-point WAN
Interconnection of Networks: internet
A heterogeneous network made of four WANs and two LANs
WAN using VPN

Integrating WAN with VPNs offers a secure, scalable, and cost-effective solution for
organizations needing to connect geographically dispersed networks and provide secure
remote access.
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.

2
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Recall the fundamental concepts of computer networks, including OSI


CO1
model layers, TCP/IP protocols, and network topologies.

3
Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,


Unit-1 hierarchical, Broadcast routing.

Congestion control: congestion prevention policies, congestion control in


Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.

4
SUGGESTIVE READINGS

1. Computer Networks by Andrew S Tanenbaum


2. Computer Networking by James F Kurose & Keith W. Ross
3. Data Communication and Networking by Behrrouz A. Forouzan

5
THE INTERNET

The Internet has changed many aspects of our daily lives. It


has affected the way we do business as well as the way we
spend our leisure time. The Internet is a communication
system that has brought a wealth of information to our
fingertips and organized it for our use.

A Brief History → ARPANET


• 1967 ACM
• 1969 UCLA, UCSB, SRI, UoU
• 1972 TCP
The Internet Today (ISPs)
Hierarchical organization of the Internet
PROTOCOLS AND STANDARDS

protocols and standards.

Protocol is synonymous with rule.


Standards are agreed-upon rules.

Topics discussed in this section:


Protocols
Standards
Standards Organizations
Internet Standards
PROTOCOLS AND STANDARDS

Protocols
• Syntax → format of the data
• Semantics → meaning of each section
• Timing → when data should be sent and how fast.

Standards
• De facto → by fact (not approved as a standard)
• De jure → by Law (approved)
PROTOCOLS AND STANDARDS

Standards Organizations
• International Organization for Standardization (ISO)
• International Telecommunication Union - Telecommunication
Standards (ITU-T)
• American National Standards Institute (ANSI)
• Institute of Electrical and Electronics Engineers (IEEE)
• Electronic Industries Association (EIA)
Network Models
OSI Model
THE OSI MODEL

Established in 1947, the International Standards


Organization (ISO) is a multinational body dedicated
to worldwide agreement on international standards.

An ISO is the Open Systems Interconnection (OSI)


model is the standard that covers all aspects of
network communications from ISO. It was first
introduced in the late 1970s.
LAYERED TASKS

◼ A network model is a layered architecture


◼ Task broken into subtasks
◼ Implemented separately in layers in stack
◼ Functions need in both systems
◼ Peer layers communicate

◼ Protocol:
◼ A set of rules that governs data communication
◼ It represents an agreement between the communicating devices
Layered Architecture
Layers
Seven layers of the OSI model
Layer 7. Application

Layer 6. Presentation
Layer 5. Session

Receiver
Layer 4. Transport
Sender

Layer 3. Network

Layer 2. Data Link


Layer 1. Physical
Layered Architecture
◼ A layered model
◼ Each layer performs a subset of the required
communication functions
◼ Each layer relies on the next lower layer to perform
more primitive functions
◼ Each layer provides services to the next higher layer
◼ Changes in one layer should not require changes in
other layers
◼ The processes on each machine at a given layer are
called peer-to-peer process
PEER – TO – PEER PROCESS
◼ Communication must move downward through the layers on
the sending device, over the communication channel, and
upward to the receiving device
◼ Each layer in the sending device adds its own information to
the message it receives from the layer just above it and passes
the whole package to the layer just below it
◼ At the receiving device, the message is unwrapped layer by
layer, with each process receiving and removing the data
meant for it
PEER – TO – PEER PROCESS
◼ The passing of the data and network information down
through the layers of the sending device and backup through
the layers of the receiving device is made possible by interface
between each pair of adjacent layers
◼ Interface defines what information and services a layer must
provide for the layer above it.
ISO is the organization.
OSI is the model.

Topics discussed in this section:


Layered Architecture
Peer-to-Peer Processes
Encapsulation
This is the only layer that directly interacts with data from the user. Software
applications like web browsers and email clients rely on the application layer to
initiate communications. But it should be made clear that client software
applications are not part of the application layer; rather the application layer is
responsible for the protocols and data manipulation that the software relies on
to present meaningful data to the user.
Application layer protocols include HTTP as well as SMTP (Simple Mail Transfer
Protocol is one of the protocols that enables email communications).
This layer is primarily responsible for preparing data so that it can be used by the
application layer; in other words, layer 6 makes the data presentable for applications
to consume. The presentation layer is responsible for translation, encryption, and
compression of data.

Finally the presentation layer is also responsible for compressing data it receives from the
application layer before delivering it to layer 5. This helps improve the speed and
efficiency of communication by minimizing the amount of data that will be transferred.
This is the layer responsible for opening and closing communication between the two
devices. The time between when the communication is opened and closed is known as
the session. The session layer ensures that the session stays open long enough to
transfer all the data being exchanged, and then promptly closes the session in order to
avoid wasting resources.
Layer 4 is responsible for end-to-end communication between the two devices. This includes
taking data from the session layer and breaking it up into chunks called segments before
sending it to layer 3. The transport layer on the receiving device is responsible for reassembling
the segments into data the session layer can consume.
The transport layer is also responsible for flow control and error control. Flow control
determines an optimal speed of transmission to ensure that a sender with a fast connection
does not overwhelm a receiver with a slow connection. The transport layer performs error
control on the receiving end by ensuring that the data received is complete, and requesting a
retransmission if it isn’t.
The network layer is responsible for facilitating data transfer between two different
networks. If the two devices communicating are on the same network, then the network
layer is unnecessary. The network layer breaks up segments from the transport layer into
smaller units, called packets, on the sender’s device, and reassembling these packets on
the receiving device. The network layer also finds the best physical path for the data to
reach its destination; this is known as routing.
The data link layer is very similar to the network layer, except the data link layer facilitates
data transfer between two devices on the same network. The data link layer takes packets
from the network layer and breaks them into smaller pieces called frames. Like the
network layer, the data link layer is also responsible for flow control and error control in
intra-network communication (The transport layer only does flow control and error control
for inter-network communications).
This layer includes the physical equipment involved in the data transfer, such as the
cables and switches. This is also the layer where the data gets converted into a bit
stream, which is a string of 1s and 0s. The physical layer of both devices must also
agree on a signal convention so that the 1s can be distinguished from the 0s on both
devices.
Tasks involved in sending a letter

Topics discussed in this section:


Sender, Receiver, and Carrier
Hierarchy (services)
The interaction between layers in the OSI model
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.

2
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Recall the fundamental concepts of computer networks, including OSI


CO1
model layers, TCP/IP protocols, and network topologies.

3
Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,


Unit-1 hierarchical, Broadcast routing.

Congestion control: congestion prevention policies, congestion control in


Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.

4
SUGGESTIVE READINGS

1. Computer Networks by Andrew S Tanenbaum


2. Computer Networking by James F Kurose & Keith W. Ross
3. Data Communication and Networking by Behrrouz A. Forouzan

5
LAYERS IN THE OSI MODEL

Topics discussed in this section:


1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
Physical Layer
The physical layer is responsible for movements of
individual bits from one hop (node) to the next.

◼ Function
◼ Physical characteristics of interfaces and media
◼ Representation of bits
◼ Data rate
◼ Synchronization of bits
◼ Line configuration (point-to-point or multipoint)
◼ Physical topology (mesh, star, ring or bus)
◼ Transmission mode ( simplex, half-duplex or duplex)
Physical layer
Data Link Layer

The data link layer is responsible for moving


frames from one hop (node) to the next.

◼ Function
◼ Framing
◼ Physical addressing
◼ Flow control
◼ Error control
◼ Access control
Data link layer
Hop-to-hop delivery
Example 1

In following Figure a node with physical address 10 sends a frame to a node


with physical address 87. The two nodes are connected by a link. At the data
link level this frame contains physical addresses in the header. These are the
only addresses needed. The rest of the header contains other information
needed at this level. The trailer usually contains extra bits needed for error
detection
Network Layer

The network layer is responsible for the


delivery of individual packets from
the source host to the destination host.

◼ Source-to-destination delivery
◼ Responsible from the delivery of packets from the original
source to the final destination
◼ Functions
◼ Logical addressing

◼ routing
Network layer
Source-to-destination delivery
Example 2

We want to send data from a node


with network address A and
physical address 10, located on
one LAN, to a node with a
network address P and physical
address 95, located on another
LAN. Because the two devices are
located on different networks, we
cannot use physical addresses
only; the physical addresses only
have local influence. What we
need here are universal addresses
that can pass through the LAN
boundaries. The network (logical)
addresses have this characteristic.
Transport Layer
The transport layer is responsible for the delivery
of a message from one process to another.

◼ Process-to- process delivery

◼ Functions

◼ Port addressing

◼ Segmentation and reassembly

◼ Connection control ( Connection-oriented or connection-less)

◼ Flow control

◼ Error control
Transport layer

Segmentation and reassembly


Reliable process-to-process delivery of a message
Example 3

Data coming from the


upper layers have port
addresses j and k (j is the
address of the sending
process, and k is the
address of the receiving
process). Since the data size
is larger than the network
layer can handle, the data
are split into two packets,
each packet retaining the
port addresses (j and k).
Then in the network layer,
network addresses (A and
P) are added to each
packet.
Session Layer
The session layer is responsible for dialog
control and synchronization.

▪ It establishes, maintains and synchronize the


interaction between communicating system
▪ Function
▪ Dialog control
▪ Synchronization (checkpoints)
Session layer

Synchronization
Presentation Layer
The presentation layer is responsible for translation,
compression, and encryption.

▪ Concerned with the syntax and semantics of the


information exchanged between two system
▪ Functions
▪ Translation ( EBCDIC-coded text file → ASCII-coded
Extended Binary Coded (American Standard
file) Decimal Interchange Code Code for Information
Interchange)

▪ Encryption and Decryption


▪ Compression
Presentation layer
Application Layer
The application layer is responsible for
providing services to the user.

◼ Functions
◼ Network virtual terminal (Remote log-in)

◼ File transfer and access

◼ Mail services

◼ Directory services (Distributed Database)

◼ Accessing the World Wide Web


Application layer
Summary of layers
Summary of layers

OSI Model
Data
Layer Function
unit

User 7. Application Network process to application


support Data 6. Presentation Data representation and encryption
layers
5. Session Inter-host communication
Sender

Receiver
User
Segment 4. Transport End-to-end connections and reliability
Network
Path determination and logical
Packet 3. Network
Network addressing
support Frame 2. Data Link Physical addressing
layers
Bit 1. Physical Media, signal and binary transmission
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.

2
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Recall the fundamental concepts of computer networks, including OSI


CO1
model layers, TCP/IP protocols, and network topologies.

3
Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,


Unit-1 hierarchical, Broadcast routing.

Congestion control: congestion prevention policies, congestion control in


Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.

4
SUGGESTIVE READINGS

1. Computer Networks by Andrew S Tanenbaum


2. Computer Networking by James F Kurose & Keith W. Ross
3. Data Communication and Networking by Behrrouz A. Forouzan

5
Network Models

TCP/IP Model
TCP/IP PROTOCOL SUITE

The layers in the TCP/IP protocol suite do not exactly


match those in the OSI model. The original TCP/IP
protocol suite was defined as having four layers: host-to-
network, internet, transport, and application. However,
when TCP/IP is compared to OSI, we can say that the
TCP/IP protocol suite is made of five layers: physical, data
link, network, transport, and application.

Topics discussed in this section:


Physical and Data Link Layers
Network Layer
Transport Layer
Application Layer
OSI Model
TCP/IP and OSI model

TCP/IP Model
Internet Layer

TCP/IP support the Internet Protocol IP ( unreliable).


IP is a host-to-host protocol.
Supporting protocols:
• Address Resolution Protocol (ARP)
• Reverse Address Resolution Protocol (RARP)
• Internet Control Massage Protocol (ICMP)
• Internet Group Massage Protocol (IGMP)
Transport Layer

Process-to-process protocol.
• User Datagram Protocol (UDP)
• Transmission Control Protocol (TCP)
• Stream Control Transmission Protocol (SCTP)
ADDRESSING

Four levels of addresses are used in an internet


employing the TCP/IP protocols: physical, logical,
port, and specific.

Topics discussed in this section:


Physical Addresses
Logical Addresses
Port Addresses
Specific Addresses
Addresses in TCP/IP
Relationship of layers and addresses in TCP/IP
Physical Address

Physical addresses are imprinted on the


NIC. Most local-area networks (Ethernet)
use a 48-bit (6-byte) physical address written
as 12 hexadecimal digits; every byte (2
hexadecimal digits) is separated by a colon.

Example:
07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical
address.
Physical Address

• known also as the MAC address


• Is the address of a node as defined by its
LAN or WAN
• It is included in the frame used by data link
layer
The physical addresses in the datagram may change
from hop to hop.
Logical Address

▪ IP addresses are necessary for universal


communications that are independent of physical
network.
▪ No two host address on the internet can have the
same IP address
▪ IP addresses in the Internet are 32-bit address that
uniquely define a host.

The physical addresses will change from hop to hop,


but the logical addresses usually remain the same.
Port addresses

Port address is a 16-bit address represented by one decimal


number ranged from (0-65535) to choose a process among
multiple processes on the destination host.
▪ Destination port number is needed for delivery.
▪ Source port number is needed for receiving a reply as an
acknowledgments.

In TCP/IP , a 16-bit port address represented


as one single number. Example: 753

The physical addresses change from hop to hop,


but the logical and port addresses usually remain the same.
Port addresses
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
UNIT 1

CO MAPPING

CO1 To develop an understanding of basic networking concepts

BOOKS FOR READING

T1: Computer Networks by Andrew S Tanenbaum


T2: Computer Networking by James F Kurose & Keith W. Ross
T3: Data Communication and Networking by Behrrouz A. Forouzan

VIDEO LINKS

https://www.youtube.com/playlist?list=PLWkguCWKqN9MdQXjSM5DE17NU7_RQA_MH

https://www.digimat.in/nptel/courses/video/106105183/L01.html

https://freevideolectures.com/course/2276/computer-networks

https://www.youtube.com/playlist?list=PLBlnK6fEyqRgMCUAG0XRw78UA8qnv6jEx

READING MATERIAL
Routing:
The goal of the network layer is to deliver a datagram from its source to its destination or
destinations. If a datagram is destined for only one destination (one-to-one delivery), we
have unicast routing. If the datagram is destined for several destinations (one-to-many
delivery), we have multicast routing.

A routing table can be either static or dynamic. A static table is one with manual entries.

A dynamic table, on the other hand, is one that is updated automatically when there is a
change somewhere in the internet. The tables need to be updated as soon as there is a change
in the internet. For instance, they need to be updated when a router is down, and they need
to be updated whenever a better route has been found.

Intra and Inter-domain Routing:


An internet is divided into autonomous systems. An autonomous system (AS) is a group of
networks and routers under the authority of a single administration. Routing inside an
autonomous system is referred to as intra-domain routing. Routing between autonomous
systems is referred to as inter-domain routing. Each autonomous system can choose one or
more intradomain routing protocols to handle routing inside the autonomous system.

Distance Vector Routing:


In distance vector routing, the least-cost route between any two nodes is the route with
minimum distance. In this protocol, as the name implies, each node maintains a vector (table)
of minimum distances to every node.

Initialization
The tables in Figure 22.14 are stable; each node knows how to reach any other node and the
cost. At the beginning, however, this is not the case. Each node can know only the distance
between itself and its immediate neighbors, those directly connected to it. So for the moment,
we assume that each node can send a message to the immediate neighbors and find the
distance between itself and these neighbors. The distance for any entry that is not a neighbor
is marked as infinite (unreachable).

Sharing
The whole idea of distance vector routing is the sharing of information between neighbors.
Although node A does not know about node E, node C does. So if node C shares its routing
table with A, node A can also know how to reach node E. On the other hand, node C does not
know how to reach node D, but node A does. If node A shares its routing table with node C,
node C also knows how to reach node D. In other words, nodes A and C, as immediate
neighbors, can improve their routing tables if they help each other.

In other words, sharing here means sharing only the first two columns.

In distance vector routing, each node shares its routing table with its immediate
neighbors periodically and when there is a change.

Updating
When a node receives a two-column table from a neighbor, it needs to update its routing table.

When to Share
The question now is, When does a node send its partial routing table (only two columns) to
all its immediate neighbors? The table is sent both periodically and when there is a change
in the table.
Periodic Update A node sends its routing table, normally every 30 s, in a periodic update. The
period depends on the protocol that is using distance vector routing.

Triggered Update A node sends its two-column routing table to its neighbors anytime there
is a change in its routing table. This is called a triggered update. The change can result from
the following.

1. A node receives a table from a neighbor, resulting in changes in its own table after
updating.
2. A node detects some failure in the neighboring links which results in a distance
change to infinity.

Count to Infinity:
A problem with distance-vector routing is that any decrease in cost (good news) propagates
quickly, but any increase in cost (bad news) will propagate slowly. For a routing protocol to
work properly, if a link is broken (cost becomes infinity), every other router should be aware
of it immediately, but in distance-vector routing, this takes some time. The problem is
referred to as count to infinity.
Two-Node Loop Instability
A problem with distance vector routing is instability, which means that a network using this
protocol can become unstable.

At the beginning, both nodes A and B know how to reach node X. But suddenly, the link
between A and X fails. Node A changes its table. If A can send its table to B immediately,
everything is fine. However, the system becomes unstable if B sends its forwarding table to
A before receiving A’s forwarding table. Node A receives the update and, assuming that B has
found a way to reach X, immediately updates its forwarding table. Now A sends its new
update to B. Now B thinks that something has been changed around A and updates its
forwarding table. The cost of reaching X increases gradually until it reaches infinity. At this
moment, both A and B know that X cannot be reached. However, during this time the system
is not stable. Node A thinks that the route to X is via B; node B thinks that the route to X is via
A. If A receives a packet destined for X, the packet goes to B and then comes back to A.
Similarly, if B receives a packet destined for X, it goes to A and comes back to B. Packets
bounce between A and B, creating a two-node loop problem. A few solutions have been
proposed for instability of this kind.

Split Horizon
One solution to instability is called split horizon. In this strategy, instead of flooding the table
through each interface, each node sends only part of its table through each interface. If,
according to its table, node B thinks that the optimum route to reach X is via A, it does not
need to advertise this piece of information to A; the information has come from A (A already
knows). Taking information from node A, modifying it, and sending it back to node A is what
creates the confusion. In our scenario, node B eliminates the last line of its forwarding table
before it sends it to A. In this case, node A keeps the value of infinity as the distance to X.
Later, when node A sends its forwarding table to B, node B also corrects its forwarding table.
The system becomes stable after the first update: both node A and node B know that X is not
reachable.

Poison Reverse
Using the split-horizon strategy has one drawback. Normally, the corresponding protocol
uses a timer, and if there is no news about a route, the node deletes the route from its table.
When node B in the previous scenario eliminates the route to X from its advertisement to A,
node A cannot guess whether this is due to the split-horizon strategy (the source of
information was A) or because B has not received any news about X recently.

In the poison reverse strategy B can still advertise the value for X, but if the source of
information is A, it can replace the distance with infinity as a warning: “Do not use this value;
what I know about this route comes from you.”

Link-State Routing:
In Link State Routing algorithm the cost associated with an edge defines the state of the link.
Links with lower costs are preferred to links with higher costs; if the cost of a link is infinity,
it means that the link does not exist or has been broken.

Link-State Database (LSDB)


To create a least-cost tree with this method, each node needs to have a complete map of the
network, which means it needs to know the state of each link. The collection of states for all
links is called the link-state database (LSDB). There is only one LSDB for the whole internet;
each node needs to have a duplicate of it to be able to create the least-cost tree. The LSDB can
be represented as a two-dimensional array(matrix) in which the value of each cell defines
the cost of the corresponding link.

Now the question is how each node can create this LSDB that contains information about the
whole internet. This can be done by a process called flooding. Each node can send some
greeting messages to all its immediate neighbors (those nodes to which it is connected
directly) to collect two pieces of information for each neighboring node: the identity of the
node and the cost of the link. The combination of these two pieces of information is called
the LS packet (LSP); the LSP is sent out of each interface, When a node receives an LSP from
one of its interfaces, it compares the LSP with the copy it may already have. If the newly
arrived LSP is older than the one it has (found by checking the sequence number), it discards
the LSP. If it is newer or the first one received, the node discards the old LSP (if there is one)
and keeps the received one. It then sends a copy of it out of each interface except the one from
which the packet arrived. This guarantees that flooding stops somewhere in the network
(where a node has only one interface).
In other words, a node can make the whole map if it needs to, using this LSDB.

In the distance-vector routing algorithm, each router tells its neighbors what it knows
about the whole internet; in the link-state routing algorithm, each router tells the
whole internet what it knows about its neighbors.

Formation of Least-Cost Trees


To create a least-cost tree for itself, using the shared LSDB, each node needs to run the famous
Dijkstra Algorithm. This iterative algorithm uses the following steps:

1. The node chooses itself as the root of the tree, creating a tree with a single node,
and sets the total cost of each node based on the information in the LSDB.

2. The node selects one node, among all nodes not in the tree, which is closest to the
root, and adds this to the tree. After this node is added to the tree, the cost of all
other nodes not in the tree needs to be updated because the paths may have been
changed.

3. The node repeats step 2 until all nodes are added to the tree.
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


2

Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network addressing, and


CO2
routing protocols and Congestion Control with different methods.

1.3
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
5

Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum

2. Computer Networking by James F Kurose & Keith W. Ross

3. Data Communication and Networking by Behrrouz A.

Forouzan
Network Layer
❑ Design issues

❑ Routing

❑ Congestion

❑ Internetworking

❑ Internet Protocols

❑ Multimedia or QoS
Design issues
❑ Goal of layer: get packets from source host to
destination host
o Routing: should know about topology of subnet
o Congestion: should avoid overloading some
communication lines and routers
o Quality of service: offer the appropriate service
o Internetworking: deal with network differences, if
source and destination are connected to different
networks
Design issues
❑ Store-and-forward packet switching
o Equipment of: carrier <> customer
o Algorithm at router
• Receive packet
• Check packet (e.g. checksum)
• Forward packet
Design issues: services
❑ Interface
o Important: = interface between carrier and customer
o Designed with following goals in mind:
• Services should be independent of the subnet technology
• Transport layer should be shielded from the number, type,
topology of the subnets
• Network addresses should use a uniform numbering plan, even
across LANs and WANs
❑ Connections?
o Connection-oriented <> Connectionless!
Design issues: services
❑ Connection-oriented <> Connectionless
o PTTs: connection-oriented
• 100 years of experience with the world-wide telephone
system
• Connection time ➔ billing!
o Internet
• Subnets are inherently unreliable
o Real issue: where to put the complexity as some/many
applications require reliable transfer (~ connection-
oriented service)
• Network layer
• Transport layer
Design issues: services
❑ Connection-oriented <> Connectionless (cont.)
o In favour of connectionless service
• Computing power is cheap: hosts can handle the complexity
• Subnet is a large, long lasting investment: keep it simple
• For some applications speedy delivery (low, constant delay)
is important
o In favour of connection-oriented service
• Users want a reliable trouble-free service
• Some services are easier to provide on top of connection-
oriented service
o Examples
• ATM: connection oriented
• IP: connection-less
• IP on top of ATM
Design issues: services

Network
Layer
Design: internal organisation
❑ Virtual circuits
o Routes chosen at connection time
o Connection identified by a virtual circuit number (VCn)
o Primary service of subnet is connection-oriented

4
Transport 7 Transport
Network Network
Data Link Data Link
Physical Physical
Routing problem: map
[Incoming line, VCn]
➔[outgoing line, VCn]
Design: internal organisation
❑ Virtual circuits
Design: internal organisation
❑ Datagram subnet
o Each packet is routed independently
o Subnet has more work to do
o More robust, easier to adapt to failures and congestion

Transport Transport
Network Network
Data Link Data Link
Physical Physical
Routing problem: map
Destination address
➔ Outgoing line
Design: internal organisation
❑ Datagram subnet
Design: internal organisation
❑ Datagram subnet

Change of routing table


Design: internal organisation
Issue Datagram subnet VC subnet

Circuit setup Not needed required

Addressing Full addresses (source + Short VC number in each


destination) in each packet packet
State information No state held in subnet State held for each VC

Routing Done for each packet Route chosen at connection


independently setup
Effect of router None, except for packet All VCs passing failed router
failures losses are terminated
Congestion control difficult Easy if enough buffers can
be allocated in advance
Design: internal organisation
Issue Datagram subnet VC subnet

Circuit setup Not needed required

Addressing Full addresses (source + Short VC number in each


destination) in each packet packet
State information No state held in subnet State held for each VC

Routing Done for each packet Route chosen at connection


independently setup
Effect of router None, except for packet All VCs passing failed router
failures losses are terminated
Congestion control difficult Easy if enough buffers can
be allocated in advance
Design: internal organisation
Type of subnet
Service to upper layer Datagram Virtual Circuit

Connectionless UDP UDP


IP IP
ATM
Connection-oriented TCP ATM AAL1
IP ATM
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


2

Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network addressing, and


CO2
routing protocols and Congestion Control with different methods.

1.3
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
5

Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum

2. Computer Networking by James F Kurose & Keith W. Ross

3. Data Communication and Networking by Behrrouz A.

Forouzan
Network Layer
❑ Design issues

❑ Routing

❑ Congestion

❑ Internetworking

❑ Internet Protocols

❑ Multimedia or Qos
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing Most important
❑ Link State routing algorithms!
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Routing algorithms
❑ Desirable properties
o Correctness
o Simplicity
} all algorithms

o Robustness: able to cope with


• changes in topology, load  hard to achieve
• hardware and software failures

o Stability
• Converge to equilibrium

o Fairness
o Optimality } conflicting
Routing algorithms
❑ Desirable properties (cont.)
Conflict!
o Fairness
o Optimality
Routing algorithms
❑ Taxonomy
o Non adaptive
• Routing decisions computed in advance, off-line and
downloaded
o Adaptive
• To changes in
– Topology
– Load
• Get information
– Locally
– From adjacent routers
– From all routers
Routing algorithms
❑ Optimality principle
Optimal path from I to K over J

I ⚫ d1 distance
⚫ K
d2
d1 + d2 is minimal
J ⚫ d3
Other path from J to K
d3 > d2
Set of all optimal routes as
• from all sources d1 + d3 > d1 + d2
• to a given destination
is a tree: sink tree
Routing algorithms
❑ Optimality principle: sink tree
Destination
Routing: shortest path
❑ Algorithm of Dijkstra: shortest path in graph
o Graph
• Node = router
• Arc = communication line
o Metric
• Number of hops
• Geographic distance
• Mean queueing and transmission delay
Routing: shortest path

Initial node

Elements of algorithm:
• Mark all nodes as free: 
• Mark initial node as selected: ⚫
• repeat till destination is selected:
• Label all free nodes reachable from selected nodes with shortest
distance to a selected node
• Select free node with shortest distance to a selected node and
mark it as selected
Routing: shortest path
Routing: flooding
❑ Every packet is sent out on every outgoing line
except the one it arrived at
Routing: flooding
❑ Every packet is sent out on every outgoing line
except the one it arrived at
Routing: flooding
❑ Every packet is sent out on every outgoing line
except the one it arrived at
Routing: flooding
❑ Every packet is sent out on every outgoing line
except the one it arrived at
Routing: flooding
❑ Every packet is sent out on every outgoing line
except the one it arrived at
❑ Duplicates!! How to limit?
o Hop counter
• Decrement in each router
• Discard packet if counter is 0
• Initialisation?
o Sequence number in packet
• Avoid sending the same packet a second time
• Keep in each router per source a list of packets already seen
❑ Useful?
Routing: flooding
❑ Every packet is sent out on every outgoing line
except the one it arrived at
❑ Sometimes useful
o Robust algorithm: e.g. military applications
o Broadcast
o Comparison purposes: always shortest path
❑ Selective flooding
o Use only those lines that are going approximately in
right direction
o Still working?
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing Most important
❑ Link State routing algorithms!
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Routing: distance vector
❑ Adaptive algorithm
o Exchange of info only with neighbours
❑ Data to be available in each router
o Routing table: per destination
• Distance
• Outgoing line
o Distance to all neighbours
Routing: distance vector
Routing table for A
To cost via
A 0 -
B 12 B
C 25 B
D 40 B
E 14 E
F 23 E
G 18 B
H 17 J
I 21 E
J 9 J
K 24 J
L 29 J
Routing: distance vector
❑ Algorithm
o At each step within a router:
• Get routing tables from neighbours
• Compute distance to neighbours
• Compute new routing table
o Characteristics:
• Iterative
• Asynchronous
• Distributed
Routing: distance vector
Routing tables from
Routing: distance vector

Better?
• Keep 4 tables (one for each neighbour)
• Use shortest path
Routing: distance vector
❑ Distributed algorithm
o Triggers:
• Change in delay to neighbour
• Receive new table from neighbour
o Update local tables
o If changed: forward routing tables to neighbours
❑ Asynchronous
o Execution in lock step not required
❑ Iterative How fast are changes propagated?
o Stops? • Good news?
• Bad news?
Routing: distance vector

Good news:
• A comes up again

Only distances to A

Faster not possible!!!


Routing: distance vector
Bad news:
• A goes down

B receives:
• Distance  from A
• Distance 2 from C
New distance from B to A: 3 via C
Routing: distance vector
Bad news:
• A goes down

C still
• believes its distance to A is 2
LOOP!!! • routes via B
B routes its packets for A via C
Routing: distance vector
Bad news:
• A goes down

Loops!!
Slow!!

 = 5?
Routing: distance vector
❑ Split horizon hack:
o Lie to neighbour A B C D E
about distance
if routing via 1 2 3 4 initially

neighbour   lie

 2 3 4 1 iteration

  3 4 2 iterations
Faster not possible!!

   4 3 iterations
Routing: distance vector
❑ Split horizon hack:
o Hack ➔ does not always work
❑ Example:
o D goes down
o A and B lie to C
o A offers to B route to D
o B offers to A route to D
o Loops again!!!
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing Most important
❑ Link State routing algorithms!
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Routing: link state
❑ Each router must Overview of algorithm:
o Discover its neighbours and learn their network
addresses
o Measure the delay or cost to each of its neighbours
o Construct a packet with these distances
o Send this packet to all other routers
o Compute the shortest path to every other router
Routing: link state
Algorithm:
❑ Learning about neighbours:
o Upon boot of router
• Send HELLO packet on each point-to-point line
• Routers are supposed to send reply with a globally unique
name
o LAN
model
Routing: link state
Algorithm:
❑ Measuring line cost
o Measure round-trip delay of HELLO Packet and its
reply
o Take load into account? Arguments both ways:

Yes! preference for unloaded line


No! oscillations are possible
Routing: link state
Algorithm:
❑ Building link state packets
o When to build?
o Packet containing:
• periodically
• Identity of sender
• Sequence number + age • when significant events occur

• For each neighbour: name + distance


Routing: link state
❑ Distributing link state packets
Algorithm:
o Trickiest part of algorithm
• Arrival time for packets different
• How to keep consistent routing tables
o Basic algorithm
• Flooding +
• Sequence number (in each packet) to limit duplicates
o Manageable problems
• Wrap around of sequence numbers: 32 bits + 1 packet/sec ➔ 137 years
• Wrong sequence number used: Age in each packet:
– lost in case of crash
• Decremented during flooding,
– Corruption while used in router
• Age 0 ➔ info discarded
Routing: link state
Algorithm:
❑ Distributing link state packets
o Basic algorithm
o Manageable problems
o Refinements
• Link state packets are not forwarded immediately
• During holding time:
– duplicates are discarded
– Old packets are thrown out
Network Layer
Packet buffer for router B
o ACK flag: ACK to send
o Send flag: packet to forward
Routing: link state
Algorithm:
❑ Computing new routes:
o With a full set of link state packets, a router can:
• Construct the entire subnet graph
• Run Dijkstra’s algorithm to compute the shortest path to each
destination
o Problems for large subnets
• Memory to store data
• Compute time
Routing: link state
❑ Usage:
o IS-IS protocol
• Designed for DECnet, adopted by ISO
• In use also in Internet
• Supports multiple network layer protocols
o OSPF protocol used in Internet
o Common features:
• Self-stabilizing method of flooding link state updates
• Concept of a designated router on a LAN
• Method of computing and supporting path splitting and multiple
metrics
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


2

Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network addressing, and


CO2
routing protocols and Congestion Control with different methods.

1.3
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
5

Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum

2. Computer Networking by James F Kurose & Keith W. Ross

3. Data Communication and Networking by Behrrouz A.

Forouzan
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing
❑ Link State routing
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Hierarchical routing
❑ When network size increases…
o Larger stables
o More CPU time needed to
compute …
o More bandwidth needed
Hierarchical routing
❑ Solution?
Hierarchical routing

❑ Routers grouped in regions


❑ Each routers knows how to
reach: + Smaller tables
o Other routers in its own group − Longer paths
o Other regions
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing
❑ Link State routing
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Broadcast routing
❑ Send message to all other hosts:
o Update distributed database
o Distribute weather reports
o Distribute live radio/TV programs
❑ Poor methods:
o Send a distinct packet to each destination
• List of addresses needed
• High usage of bandwidth
o Flooding
• Too many packets
o Multidestination routing
• Each packet contains a list of destination
• On each line a single packet
Broadcast routing
❑ Best method: use sink tree

o Broadcast source =
root of sink tree
o Forwarding on sink tree
lines
o Excellent use of bandwidth
o Source tree must be known
at each intermediate node
Broadcast routing
❑ Sink tree approximation: reverse path forwarding

if a packet arrives on line used for traffic to source of broadcast


then forward packet on all lines, except the one it arrived on
else discard packet
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing
❑ Link State routing
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Multicast routing
❑ Send a message to a well-
defined group
o Large in size
o Small compared to network
as a whole
❑ Group management
o Create and destroy groups
o Process can leave and join a
group
How will routers know
about groups? ❑ algorithm
Multicast routing

source

❑ Algorithm ❑ Pruning:
o Source computes spanning o Link state routing
tree • Each router knows full topology
o Distance vector routing
o Remove lines that do not
• Reverse path forwarding +
lead to hosts of group
• PRUNE messages to remove
( = pruning) arcs
Multicast routing

source

❑ Pruning:
o Link state routing
• Each router knows full topology
o Distance vector routing
• Reverse path forwarding +
• PRUNE messages to remove
arcs
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


2

Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network addressing, and


CO2
routing protocols and Congestion Control with different methods.

1.3
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
5

Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum

2. Computer Networking by James F Kurose & Keith W. Ross

3. Data Communication and Networking by Behrrouz A.

Forouzan
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing
❑ Link State routing
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Routing for Mobile Hosts
❑ Model of world: WAN + LANs, wireless cells
o Move from time to time
❑ Migratory users
o Use network when connected
❑ Roaming users

o Compute on the run


o Maintain connections as they
move around
Routing for Mobile Hosts
❑ Foreign agent: keeps track of ❑ Home agent: keeps track of
users: users
o who are currently visiting the o whose home is in the area
area o who are currently visiting
another area

Permanent home location


Permanent home address
Routing for Mobile Hosts
❑ How does it work?
o Registration procedure with foreign agents
o Sending packets
o Leaving an area
❑ Registration procedure with foreign agent
o Announcing existence of foreign agent
• Broadcast by foreign agent
• Broadcast query by arriving mobile user
o Mobile user gives to foreign agent
• Home address
• Current data link address
• Security information
o Foreign agent contacts home agent of user
Routing for Mobile Hosts
❑ Registration procedure with foreign agent (cont.)
o Announcing existence of foreign agent
o Mobile user gives to foreign agent
o Foreign agent contacts home agent of user
• Identity of user
• Security info
• Network address of foreign agent
o Home agent
• Checks security info
• Sends ack to foreign agent
o Foreign agent
• Stores state
• Informs mobile user
Routing for Mobile Hosts
❑ Sending a packet to a mobile user
o Home address is used ➔ packet routed to home LAN
o Packet intercepted by home agent
 address of user  address of home agent!
o Packet forwarded to the foreign agent
• Encapsulation – tunneling
o Foreign agent forwards packet to mobile user
• Which protocol, address used?
o Sender is given address of foreign agent
• Encapsulation – tunneling used, required?
Routing for Mobile Hosts

Home agent

Foreign agent
Routing for Mobile Hosts
❑ Leaving an area
o Announced by user ➔ deregistration
o Automatic detection by foreign agent
❑ Various different schemes:
o Protocol carried out by routers or hosts
o Routers along the way intercept and redirect traffic
o Visitor gets temporary address to off-load foreign agent
o Modify original packet instead of encapsulation
o Security aspects: authentication?
THANK YOU
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


2

Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES

On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network addressing, and


CO2
routing protocols and Congestion Control with different methods.

1.3
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
5

Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum

2. Computer Networking by James F Kurose & Keith W. Ross

3. Data Communication and Networking by Behrrouz A.

Forouzan
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing
❑ Link State routing
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Routing in Ad Hoc Networks
❑ Ad Hoc Network = routers are mobile
o No fixed topologies
o No fixed or known neighbors
o Valid paths can disappear at any time
o Node = router + host
o Routing quite different from routing in wired networks
❑ Examples
o Military vehicles on a battlefield
o Fleet of ships at see
o People with notebooks (lacking 802.11)
❑ AODV = Ad hoc On-demand distance vector routing
o On-demand: route computed when needed
o Distance vector for mobile world
o Taking into account limited bandwidth + low battery life
Routing in Ad Hoc Networks
❑ Graph presentation
o Node
o Arc = nodes connected
can communicate directly by radio
❑ Routing table:
o Line for known routes
o Can be valid or invalid
❑ A wants to send a packet
o To H: forward to D Dest Next Distance Other
o To I: start route discovery broadcasting hop fields
a route request packet B B 1 …

C B 2 …

H D 3 …
Routing in Ad Hoc Networks
❑ Route request packet:

❖ Source & destination address: e.g. IP address


❖ Request ID:
• local counter incremented for each new route request packet
broadcasted
• allows to discard duplicate requests at other nodes
❖ Source sequence #
• counter to distinguish old routes to destination from new ones
❖ Destination sequence #
• most recent sequence counter of destination seen by source
Routing in Ad Hoc Networks
❑ Processing a route request packet
o duplicate request?
• Yes: discard
o Fresh route to destination known?
• Fresh = local destination sequence # >= destination sequence
# in request
• Yes: send route reply packet
o No fresh route to destination is known!
• Store info from route request in reverse route table; to enable
the forwarding of route reply packets
• Increment hop count
• Rebroadcast route request
Routing in Ad Hoc Networks
❑ Processing a route request packet
o Duplicate request?
o Fresh route to destination known?
o No fresh route to destination is known!
Routing in Ad Hoc Networks
❑ Processing a route request packet
o Duplicate request?
o Fresh route to destination known?
o No fresh route to destination is known!

o (a) Range of A's broadcast.


o (b) After B and D have received A's broadcast.
o (c) After C, F, and G have received A's broadcast.
o (d) After E, H, and I have received A's broadcast.
Shaded nodes are new recipients. Arrows show possible reverse routes.
Routing in Ad Hoc Networks
❑ Route reply packet
o Returned by
• Intermediate node knowing a fresh route
• Destination node

❖ Destination sequence#
o Number known by sender of reply packet
❖ Hop count
o Set to length of path known by sender of reply packet
o For destination = 0
Routing in Ad Hoc Networks
❑ Route maintenance
o Detect that neighbors are not reachable anymore
• Broadcast Hello packet periodically
• Failure to send packet
o Cleanup routing table

o Additional field in routing table: active neighbor


• Nodes that have offered path to destination in recent past
Routing in Ad Hoc Networks
❑ Route maintenance

o Routing table of D
Node G goes down!
Routing in Ad Hoc Networks
❑ Route maintenance

o New routing table of D:


• Delete routes with G as next hop
• Delete G as active neigbor
Routing Algorithms
❑ Properties
❑ Shortest Path Routing
❑ Flooding
❑ Distance Vector Routing
❑ Link State routing
❑ Hierarchical routing
❑ Broadcast routing
❑ Multicast routing
❑ Routing for mobile hosts
❑ Routing in Ad Hoc Networks
❑ Node Lookup in Peer-to-Peer Networks
Peer-to-Peer Networks
❑ Peer-to-Peer network
How o can
Large a
number
user of users
find a node that
o Usuallythe
contains permanent
infowired
heconnections
is looking for,
o In contact
in the to shareof
absence resources
a centralized
database orfeatures
❑ Interesting even a centralized index?
o Totally distributed
➔o Symmetric
Distributed storage system!
o No central control or hierarchy
o Users will not know each other
Routing?
o Users will not know where to find what they are
looking for
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
UNIT 1
CO MAPPING
CO1 To develop an understanding of basic networking concepts

BOOKS FOR READING


T1: Computer Networks by Andrew S Tanenbaum
T2: Computer Networking by James F Kurose & Keith W. Ross
T3: Data Communication and Networking by Behrrouz A. Forouzan

VIDEO LINKS
https://www.youtube.com/playlist?list=PLWkguCWKqN9MdQXjSM5DE17NU7_RQA_MH
https://www.digimat.in/nptel/courses/video/106105183/L01.html
https://freevideolectures.com/course/2276/computer-networks
https://www.youtube.com/playlist?list=PLBlnK6fEyqRgMCUAG0XRw78UA8qnv6jEx

READING MATERIAL

TECHNIQUES TO IMPROVE QoS


There are some techniques that can be used to improve the quality of service. four common methods:
scheduling, traffic shaping, admission control, and resource reservation.

Scheduling
Packets from different flows arrive at a switch or router for processing. A good scheduling
technique treats the different flows in a fair and appropriate manner. Several scheduling
techniques are designed to improve the quality of service.

FIFO Queuing
In first-in, first-out (FIFO) queuing, packets wait in a buffer (queue) until the node (router or
switch) is ready to process them. If the average arrival rate is higher than the average processing
rate, the queue will fill up and new packets will be discarded. A FIFO queue is familiar to those
who have had to wait for a bus at a bus stop.
Priority Queuing
In priority queuing, packets are first assigned to a priority class. Each priority class has its own queue.
The packets in the highest-priority queue are processed first. Packets in the lowest-priority queue are
processed last. Note that the system does not stop serving a queue until it is empty.

A priority queue can provide better QoS than the FIFO queue because higher priority traffic, such as
multimedia, can reach the destination with less delay. However, there is a potential drawback. If there is
a continuous flow in a high-priority queue, the packets in the lower-priority queues will never have a
chance to be processed. This is a condition called starvation.

Weighted Fair Queuing


A better scheduling method is weighted fair queuing. In this technique, the packets are still
assigned to different classes and admitted to different queues. The queues, however, are
weighted based on the priority of the queues; higher priority means a higher weight. The system
processes packets in each queue in a round-robin fashion with the number of packets selected
from each queue based on the corresponding weight. For example, if the weights are 3, 2, and 1,
three packets are processed from the first queue, two from the second queue, and one from the
third queue. If the system does not impose priority on the classes, all weights can be equal. In
this way, we have fair queuing with priority.
Traffic Shaping
Traffic shaping is a mechanism to control the amount and the rate of the traffic sent to the network.
Two techniques can shape traffic: leaky bucket and token bucket.

Leaky Bucket
If a bucket has a small hole at the bottom, the water leaks from the bucket at a constant rate as
long as there is water in the bucket. The rate at which the water leaks does not depend on the rate
at which the water is input to the bucket unless the bucket is empty. The input rate can vary, but
the output rate remains constant. Similarly, in networking, a technique called leaky bucket can
smooth out bursty traffic. Bursty chunks are stored in the bucket and sent out at an average rate.
A leaky bucket algorithm shapes bursty traffic into fixed-rate traffic by averaging the data
rate. It may drop the packets if the bucket is full.

Token Bucket
The leaky bucket is very restrictive. It does not credit an idle host. For example, if a host is not
sending for a while, its bucket becomes empty. Now if the host has bursty data, the leaky bucket
allows only an average rate. The time when the host was idle is not taken into account. On the
other hand, the token bucket algorithm allows idle hosts to accumulate credit for the future in
the form of tokens.

Assume the capacity of the bucket is c tokens and tokens enter the bucket at the rate of r tokens
per second. The system removes one token for every cell of data sent. The maximum number of
cells that can enter the network during any time interval of length t is shown below.

The maximum average rate for the token bucket is shown below.
This means that the token bucket limits the average packet rate to the network.

Example 30.2
Let’s assume that the bucket capacity is 10,000 tokens and tokens are added at the rate of 1000 tokens
per second. If the system is idle for 10 seconds (or more), the bucket collects 10,000 tokens and
becomes full. Any additional tokens will be discarded. The maximum average rate is shown below.
Maximum average rate = (1000t + 10,000)/t

The token bucket can easily be implemented with a counter. The counter is initialized to zero.
Each time a token is added, the counter is incremented by 1. Each time a unit of data is sent, the
counter is decremented by 1. When the counter is zero, the host cannot send data.

The token bucket allows bursty traffic at a regulated maximum rate.

Combining Token Bucket and Leaky Bucket


The two techniques can be combined to credit an idle host and at the same time regulate the
traffic. The leaky bucket is applied after the token bucket; the rate of the leaky bucket needs to
be higher than the rate of tokens dropped in the bucket.
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


1
.
2
Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES
On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network


CO2 addressing, and routing protocols and Congestion Control with
different methods.

1.3
1
.
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
1
.
5

Suggestive Readings
1.Computer Networks by Andrew S Tanenbaum
2.Computer Networking by James F Kurose & Keith W. Ross
3.Data Communication and Networking by Behrrouz A.
Forouzan
Congestion Control Algorithms
• General Principles of Congestion Control
• Congestion Prevention Policies
• Congestion Control in Virtual-Circuit Subnets
• Congestion Control in Datagram Subnets
• Load Shedding
• Jitter Control
Congestion

When too much traffic is offered, congestion sets in and


performance degrades sharply.
General Principles of Congestion
Control

A. Monitor the system .


– detect when and where congestion occurs.
B. Pass information to where action can be taken.
C. Adjust system operation to correct the problem.
Congestion Prevention Policies

5-26

Policies that affect congestion.


Congestion Control in Virtual-Circuit
Subnets: Admission control

(a) A congested subnet. (b) A redrawn subnet, eliminates


congestion and a virtual circuit from A to B.
Congestion Control in Datagram Subnets:
Warning Bit
The old DECNET and frame relay networks:
A warning bit is sent back in the ack to the source in the case
congestion. Every router on the path can set the warning bit.

unew = auold + (1 − a) f

Each router monitors its utilization u based on its temporary


utilization f (either 0 or 1). a is a forgetness rate.
If u is above a threshold, a warning state is reached.
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


1
.
2
Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES
On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network


CO2 addressing, and routing protocols and Congestion Control with
different methods.

1.3
1
.
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
1
.
5

Suggestive Readings
1.Computer Networks by Andrew S Tanenbaum
2.Computer Networking by James F Kurose & Keith W. Ross
3.Data Communication and Networking by Behrrouz A.
Forouzan
Hop-by-Hop
Choke Packets
(in high speed nets)
It takes 30 ms for a choke packet to
get from NY to SF. For a 155 Mbps,
4.6 Mbps gets in the pipe.

(a) A choke packet that affects only


the source.

(b) A choke packet that affects


each hop it passes through.
Dropping packets
Load shedding: Wine Vs. Milk

Wine: drop new packets (keep old); good for file transfer
Milk: drop old packets (keep new); good for mulitmedia

Random Early Detection


When the average queue length exceeds a threshold,
packets are picked at random from the queue and discarded.
Jitter Control

(a) High jitter. (b) Low jitter.


Quality of Service

• Requirements
• Techniques for Achieving Good Quality of Service
• Integrated Services
• Differentiated Services
• Label Switching and MPLS
Requirements

5-30

How stringent the quality-of-service requirements are.


ATM networks classify flows in four broad categories wrt
their QoS demand:

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


2. Real-time variable bit rate (e.g., video conferencing)
3. Non-real-time variable bit rate (e.g., video streaming)
4. Available bit rate (e.g., file transfer)
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


1
.
2
Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES
On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network


CO2 addressing, and routing protocols and Congestion Control with
different methods.

1.3
1
.
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
1
.
5

Suggestive Readings
1.Computer Networks by Andrew S Tanenbaum
2.Computer Networking by James F Kurose & Keith W. Ross
3.Data Communication and Networking by Behrrouz A.
Forouzan
Buffering

Smoothing the output stream by buffering packets.


Traffic Shaping
The Leaky Bucket Algorithm

(a) A leaky bucket with water. (b) a leaky bucket with packets.
The Token Bucket Algorithm

5-34

(a) Before. (b) After.

Token bucket allows some burstiness (up to the number of token the
bucket can hold)
The Leaky and
Token Bucket
Example
(a) Input to a bucket.
(b) Output from a leaky
bucket.
Output from a token bucket
with capacities of
(c) 250 KB,
(d) 500 KB,
(e) 750 KB,
(f) Output from a 500KB
token bucket feeding a 10-
MB/sec leaky bucket.
Resource Reservation
Traffic shaping is more effective when all packets follow the
same route.

We can, similar to virtual circuits, assign a specific route to a


flow and then reserve resources along that route.

Three kinds of resources can be reserved:

● Bitrate
● Buffer space

● CPU cycles
Admission Control
We saw, resource reservation but how can the sender specify
required resources ? Also, some applications are tolerant of
occasional lapses is QoS. Also, apps might not know what its
CPU requirements are.
Hence routers must convert a set of specifications to resource
requirements and then decide whether to accept or reject the
flow.

An example of flow specification.


Proportional Routing
The idea here very different from what we have seen earlier.
Here multiple paths are assigned to each flow and a
appropriate fraction of the flow is sent simultaneously over
each path.

This technique is also called Multipath routing.


Packet Scheduling
If a router handling multiple flows uses first-come first-served method
to process packets, there is possibility of some flows being starved.

● Fair queuing
● Weighted fair queuing

(a) A router with five packets queued for line O.


(b) Finishing times for the five packets.
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


1
.
2
Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES
On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network


CO2 addressing, and routing protocols and Congestion Control with
different methods.

1.3
1
.
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
1
.
5

Suggestive Readings
1.Computer Networks by Andrew S Tanenbaum
2.Computer Networking by James F Kurose & Keith W. Ross
3.Data Communication and Networking by Behrrouz A.
Forouzan
Integrated Services (IntServ)
A flow-based approach to QoS using resource reservation.

Set of protocols aimed at streaming multimedia and standardized by


the IETF.

Allows both unicast and multicast transmissions.

Resource reSerVation Protocol (RSVP) is used to reserve the


resources at intermediate routers between sender and receivers.

RSVP allows:
● Multiple senders to transmit to multiple groups of receivers

● Permits individual users to switch channels freely

● Optimises bandwidth utilization while simultaneously eliminating

congestion.
RSVP-The ReSerVation Protocol
Bandwidth reservation is done with reverse path forwarding along
the spanning tree.

(a) A network, (b) The multicast spanning tree for host 1.


(c) The multicast spanning tree for host 2.
RSVP-The ReSerVation Protocol (2)

(a) Host 3 requests a channel to host 1. (b) Host 3 then requests a


second channel, to host 2. (c) Host 5 requests a channel to host 1.
A lighter approach to QoS
IntServ is very powerful but has some severe drawbacks:

- There is a setup phase, this cases delay in starting data flow.


- Routers need to maintain per-flow state. This approach is flow-based
and not very scalable.
- Complex router-to-router exchange of flow information.

A simpler and approach was then designed by the IETF called,


Differentiated Services (DiffServ).

DiffServ takes a class-based (as opposed to IntSev flow-based)


approach to QoS
Differentiated Services (DiffServ)
Introduces services classes with corresponding forwarding rules.

Network operator can “sell” services. Every incoming packet


carries a Type of Service field. Depending on the service class of a
packet, it may receive preferential treatment. The number of classes
are decided by the network operator.

Idea similar to overnight, two-day and surface delivery in courier


services.

Two simple classes are: Regular and expedited.


Expedited Forwarding

Expedited packets experience a traffic-free network,


e.g., if 10% of the traffic is expedited and 90% regular,
20% bandwidth is dedicated to expedited traffic.
Assured Forwarding

A possible implementation of the data flow for assured forwarding.


There are 4 priority classes and 3 discard probabilities:
low, medium, high.
Label Switching and MPLS
Vendors, developed label switching/tag switching now called
MPLS (MulitProtocol Label Switching) by the IETF.
Idea is to apply labels to every packet and route using these labels.

Transmitting a TCP segment using IP, MPLS,


and PPP (router-to-router).
Label Switching and MPLS
Comparison with virtual circuit techniques:

Similarities:
- Both used tags/circuit ids.
- Both lookup routing tables based on these tags.
- Tags have link local significance only.

Difference:
- There is no setup phase in MPLS.
- MPLS tags routes and not end-point processes (no transport
id), so greater aggregation is possible. All MPLS circuits to a
host can use the same tags. In ATM, only cells to the same
application can use the same tag.
Internetworking
• How Networks Differ
• How Networks Can Be Connected
• Concatenated Virtual Circuits
• Connectionless Internetworking
• Tunneling
• Internetwork Routing
• Fragmentation
Connecting Networks

A collection of interconnected networks.


How Networks Differ

5-43

Some of the many ways networks can differ.


How Networks Can Be Connected

(a) Two Ethernets connected by a switch (data link layer).


(b) Two Ethernets connected by routers (network layer).
Concatenated Virtual Circuits
Networks can be connected using connection-oriented
techniques. This allows easier QoS between disparate networks.
Only subnets internally using VCs can be connected this way.

Internetworking using concatenated virtual circuits


with gateways (multiprotocol routers).
Connectionless Internetworking

A connectionless internet.
Comparing internetworking approaches
Connection oriented:
Advantages:
- Buffers can be reserved in advanced
- Sequencing can be guaranteed
- Short headers
Disadvantages:
- No alternate routing around congestion.
- vulnerability to router failures
- tables space at routers
Connectionless oriented:
Advantages:
- Can be used to connected subnets without VCs inside.
- Robust to router failures
Disadvantage:
- No sequencing
- Longer headers
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in
APEX INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Computer Networks (21CSH-335)


Faculty: Dr. Ratish Kumar

DISCOVER . LEARN . EMPOWER


1
.
2
Computer Networks
Course Objectives: The "Computer Network" course is where we will go on an
exciting trip through the complex world of computer networks. We would like to
take this opportunity to welcome youThe purpose of this course is to offer you
with a strong foundation in networking basics, hence providing you with the
knowledge and skills that are essential to build, develop, and maintain sturdy
network infrastructures.
Beginning with fundamental principles of networking, such as the Open Systems
Interconnection (OSI) model, TCP/IP protocols, and network topologies, all the
way through the duration of this course, you will investigate a broad variety of
subjects. As we move on, we will learn more about the complexities of network
protocols, technologies, and security measures. Through participation in hands-on
laboratories and simulations, you will have the opportunity to get practical
experience in areas such as diagnosing common problems, configuring network
devices, and applying security measures to protect the integrity of the network.
COURSE OUTCOMES
On completion of this course, the students shall be able to:-

Explain the principles underlying data transmission, network


CO2 addressing, and routing protocols and Congestion Control with
different methods.

1.3
1
.
4

Unit-1 Syllabus

Introduction to Computer Network Contact Hours: 15

Network layer-design issue, routing algorithms: Distance vector, link state,

Unit-1 hierarchical, Broadcast routing.


Congestion control: congestion prevention policies, congestion control in
Datagram subnets, load shedding, jitter control, Leaky bucket and token
bucket algorithms.
1
.
5

Suggestive Readings
1.Computer Networks by Andrew S Tanenbaum
2.Computer Networking by James F Kurose & Keith W. Ross
3.Data Communication and Networking by Behrrouz A.
Forouzan
Internet Protocol (IP)
The idea is to design another protocol, independent of datalink
layer protocols, so that its packets can be encapsulated over many
datalink layer protocols.

Then when you want to transfer data between different subnets, a


multiprotocol router:
(1) extracts the IP packet from datalink layer frame on one subnet,
(2) encapsulates into datalink layer frame of another subnet
(3) send the new frame

IP allows diverse datalink layer subnets to exchange data. It is


connectionless.
Interworking of two different networks
is difficult. A solution to a special case is
tunneling.

Tunneling a car from France to England.


Tunneling (packets)

Tunneling a packet from Paris to London.


Internetwork Routing

(a) An internetwork. (b) A graph of the internetwork.

Two-level routing:
Interior gateway protocol is used within each network
Exterior gateway protocol is used between networks

Gateway is a multiprotocol router.


Fragmentation

(a) Transparent fragmentation (ATM, reassembly at the exit gateway).


(b) Nontransparent fragmentation (IP, reassembly at the receiver host).
Fragmentation (2)

Fragmentation when the elementary data size is 1 byte.


(a) Original packet, containing 10 data bytes.
(b) Fragments after passing through a network with maximum
packet size of 8 payload bytes plus header.
(c) Fragments after passing through a size 5 gateway.
THANK YOU

For queries and course clarification contact:


Dr. Ratish Kumar
Office: D2, 502
7018298525
ratish.e14394@cumail.in

You might also like