Computer Networks (LMS) Unit 1
Computer Networks (LMS) Unit 1
CO MAPPING
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.
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)
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.
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
2
COURSE OUTCOMES
3
Unit-1 Syllabus
4
SUGGESTIVE READINGS
5
DATA COMMUNICATIONS
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
◼ Multipoint
◼ More than two specific devices
share a single link
Physical Topology
Tree
MESH Topology
• Advantages
• Less expensive
• 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
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
2
COURSE OUTCOMES
3
Unit-1 Syllabus
4
SUGGESTIVE READINGS
5
THE INTERNET
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
◼ 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
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
2
COURSE OUTCOMES
3
Unit-1 Syllabus
4
SUGGESTIVE READINGS
5
LAYERS IN THE OSI MODEL
◼ 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
◼ Function
◼ Framing
◼ Physical addressing
◼ Flow control
◼ Error control
◼ Access control
Data link layer
Hop-to-hop delivery
Example 1
◼ 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
◼ Functions
◼ Port addressing
◼ Flow control
◼ Error control
Transport layer
Synchronization
Presentation Layer
The presentation layer is responsible for translation,
compression, and encryption.
◼ Functions
◼ Network virtual terminal (Remote log-in)
◼ Mail services
OSI Model
Data
Layer Function
unit
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
2
COURSE OUTCOMES
3
Unit-1 Syllabus
4
SUGGESTIVE READINGS
5
Network Models
TCP/IP Model
TCP/IP PROTOCOL SUITE
TCP/IP Model
Internet Layer
Process-to-process protocol.
• User Datagram Protocol (UDP)
• Transmission Control Protocol (TCP)
• Stream Control Transmission Protocol (SCTP)
ADDRESSING
Example:
07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical
address.
Physical Address
CO MAPPING
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.
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.
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.
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
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
1.3
4
Unit-1 Syllabus
Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum
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
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
1.3
4
Unit-1 Syllabus
Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum
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
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
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:
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
1.3
4
Unit-1 Syllabus
Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum
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
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
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
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
1.3
4
Unit-1 Syllabus
Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum
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
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
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
1.3
4
Unit-1 Syllabus
Suggestive Readings
1. Computer Networks by Andrew S Tanenbaum
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:
❖ 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 Routing table of D
Node G goes down!
Routing in Ad Hoc Networks
❑ Route maintenance
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
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.
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.
1.3
1
.
4
Unit-1 Syllabus
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
5-26
unew = auold + (1 − a) f
1.3
1
.
4
Unit-1 Syllabus
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.
Wine: drop new packets (keep old); good for file transfer
Milk: drop old packets (keep new); good for mulitmedia
• Requirements
• Techniques for Achieving Good Quality of Service
• Integrated Services
• Differentiated Services
• Label Switching and MPLS
Requirements
5-30
1.3
1
.
4
Unit-1 Syllabus
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
(a) A leaky bucket with water. (b) a leaky bucket with packets.
The Token Bucket Algorithm
5-34
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.
● 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.
● Fair queuing
● Weighted fair queuing
1.3
1
.
4
Unit-1 Syllabus
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.
RSVP allows:
● Multiple senders to transmit to multiple groups of receivers
congestion.
RSVP-The ReSerVation Protocol
Bandwidth reservation is done with reverse path forwarding along
the spanning tree.
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
5-43
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
1.3
1
.
4
Unit-1 Syllabus
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.
Two-level routing:
Interior gateway protocol is used within each network
Exterior gateway protocol is used between networks