Computer Networks Notes 342024
Computer Networks Notes 342024
Introduction:
• A system of interconnected computers and
computerized peripherals such as printers is
called a computer network.
• In bus topology one long cable acts as a background to link all the devices in
the network.
• Nodes are connected to the bus cable by drop lines or tabs. A drop line is a
connection running between the devices and the main cable.
Ring Topology:
• Each device has a decided point- to- point line configuration only with the two
devices on either side of it.
• A signal is passed along the ring in one direction, from devices to device to device,
until it reaches its destination.
Network Protocols:
• A protocol is a set of rules that govern data communications. A protocol defines
what is communicated, how it is communicated, and when it is communicated.
• Its job is to regenerate the signal over the same network before the signal
becomes too weak or corrupted so as to extend the length to which the signal
can be transmitted over the same network.
• Bridge
• A bridge operates at data link layer.
• It is also used for interconnecting two LANs working on the same protocol.
• It has a single input and single output port, thus making it a 2 port device.
Network Hardware (Contd.):
• Hub
• A hub is basically a multiport repeater.
• A hub can be categorized into active hub and passive hub
• Hubs cannot filter data, so data packets are sent to all connected
devices.
• Switch
• A switch is a multiport bridge with a buffer.
• The switch can perform error checking before forwarding data, making
it very efficient as it does not forward packets that have errors and only
forward good packets selectively to the correct port.
Network Hardware (Contd.):
• Router
• A router is a device like a switch that routes data packets based on their
IP addresses.
• Router is mainly a Network Layer device. Routers normally connect
LANs and WANs together and have a dynamically updating routing
table based on which they make decisions on routing the data packets.
• Gateway
• It is a passage to connect two networks together that may work
upon different networking models.
• They basically work as messenger agents that take data from
one system, interpret it, and transfer it to another system.
• Gateways are also called protocol converters and can operate at
any network layer. Gateways are generally more complex than
switches or routers.
Categories of Computer
Networks:
• Local Area Network (LAN):
• Local area networks, generally called LANs, are privately-owned
networks within a single building or campus of up to a few
kilometers in size.
• They are widely used to connect personal computers and workstations in
company offices and factories to share resources (e.g., printers) and
exchange information.
Categories of Computer Networks
(Contd):
Metropolitan Area Network (MAN):
• A metropolitan area network is a
network that covers a larger
geographic area by
interconnecting a different LAN
to form a larger network.
• In MAN, various LANs are
connected to each other through
a telephone exchange line.
Categories of Computer Networks
(Contd):
Wide Area Network (WAN):
• A Wide Area Network is a network that
extends over a large geographical area
such as states or countries.
• A Wide Area Network is quite a bigger
network than a LAN.
• A Wide Area Network is not limited to
a single location, but it spans a large
geographical area through a telephone
line, fiber optic cable, or satellite links.
• MAC (Media Access Control) Address:
• MAC addresses are assigned directly by the hardware manufacturer
• They are also referred to as hardware addresses.
• MAC addresses in LAN or WLAN networks consist of 6 bytes (48 bits) and
are written in hexadecimal notation.
A simple sentence to remember the order of layers in ISO-OSI model "All people
seem to need data processing."
Application Layer:
• The application layer contains a variety of protocols that are commonly needed
by users.
• One widely-used application protocol is HTTP (Hypertext Transfer Protocol),
which is the basis for the World Wide Web.
• When a browser wants a Web page, it sends the name of the page it wants to the
server using HTTP.
• The server then sends the page back. Other application protocols are used for file
transfer, and electronic mail.
Presentation Layer:
• It monitors message format and interpretation
of transmitted information through:
1. Translation
• The presentation layer handles the interoperability between the
different encoding methods.
• It converts the data from sender-dependent format into a
common format and changes the common format into receiver-
dependent format at the receiving end.
2. Encryption
• Encryption is a process of converting the sender-transmitted
information into another form and sending the resulting message
over the network.
3. Compression
• Data compression is a process of compressing the data
Presentation Layer:
Session Layer:
Session establishment, maintenance, and termination: The layer allows
the two processes to establish, use and terminate a connection.
Dialog Controller:
•The session layer allows two systems to start communication with each
other in half-duplex or full-duplex.
Synchronization:
•This layer allows a process to add checkpoints which are considered as
synchronization points into the data.
•These synchronization points help to identify the error so that the data is
re-synchronized properly and ends of the messages are not cut prematurely
and data loss is avoided.
Session Layer:
Transport Layer:
It is responsible for delivery of the entire message from the source host to destination host.
Port Addressing:
•The transport layer adds the header that contains the address known as a port address of the process.
•The responsibility of the transport layer is to transmit the message to the correct process.
Segmentation and Reassembly:
•When the transport layer receives the message from the upper layer, it divides the message into multiple
segments, and each segment is assigned with a sequence number that uniquely identifies each segment.
Connection control:
•The transport layer provides two services Connection-oriented service and connectionless service.
•A connectionless service treats each segment as an individual packet, and they all travel in different routes
to reach the destination.
•A connection-oriented service makes a connection with the transport layer at the destination machine
before delivering the packets.
Flow control:
The transport layer is also responsible for flow control.
Error control:
•The transport layer is also responsible for Error control.
•The sender transport layer ensures that the message reaches the destination without any error.
Transport Layer:
Network Layer:
It manages the delivery of individual data packets from source to destination
through appropriate addressing and routing.
Routing:
The network layer protocols determine which route is suitable from source
to destination.
This function of network layer is known as routing.
Logical Addressing:
In order to identify each device on internetwork uniquely, network layer
defines an addressing scheme.
The sender & receiver’s IP address are placed in the header by network
layer.
Such an address distinguishes each device uniquely and universally.
Network Layer:
Data Link Layer:
It is responsible for the reliable transfer of data frames from one node to
another connected by the physical layer.
Framing:
Framing is a function of the data link layer.
This can be accomplished by attaching special bit patterns to the beginning and end of the frame.
Physical addressing:
After creating frames, Data link layer adds physical addresses (MAC address) of sender and/or
receiver in the header of each frame.
Error control:
Data link layer provides the mechanism of error control in which it detects and retransmits
damaged or lost frames.
Flow Control:
The data rate must be constant on both sides else the data may get corrupted thus, flow control
coordinates that amount of data that can be sent before receiving acknowledgement.
Access control:
When a single communication channel is shared by multiple devices, MAC sub-layer of data link
layer helps to determine which device has control over the channel at a given time.
Data Link Layer:
Physical Layer:
• Physical Characteristics of the media
• Representation of bits
• Data rate
• Synchronization of bits
• Line Configuration
• Physical Topology and Transmission mode
Physical Layer:
Bandwidth:
• Bandwidth refers to the range of frequencies contained in a composite
signal or the range of frequencies a channel can pass.
• In other words, bandwidth can be defined as the maximum data rate with
which a network can communicate.
Throughput:
• Throughput is a measure of how fast we can actually send data through a network.
• In other words, the bandwidth is a potential measurement of a link; the throughput
is an actual measurement of how fast we can send data.
Bandwidth vs Throughput:
Key Bandwidth Throughput
Bandwidth is the maximum Throughput is defined as the
quantity of data that can be actual measurement of data
Definition
transmitted through a moving across a medium at
channel in a specific period any given point of time.
of time.
Bandwidth is measured in Throughput is measured in
Measurement Unit
Bits per Second. Bits per Second.
• The time required for a packet to send from one node to another is known as
network delay. It is a Composition of 4 types of delays:
• Types of TDM:
• Synchronous TDM
• Asynchronous (Statistical) TDM
Synchronous TDM:
Asynchronous TDM:
Synchronous vs Asynchronous
Communication:
• The following parameters should be determined at
the receiver to decode and interpret the
transmitted information.
• The start of each bit period (bit synchronization).
• The start and end of each character or byte (character
synchronization).
• The start and stop of the complete message block
(typically called frames).
Synchronous vs Asynchronous
Communication:
Point of Comparison Synchronous Transmission Asynchronous Transmission
Analog–to–Digital Conversion
Analog–to–Digital Conversion
Modem:
• Modem is a networking device that converts data
from one form to another.
• This device is useful in establishing a connection
between analog and digital devices by converting
the digital signal to Analog and vice versa
• It is a device that modulates signals to encode
digital information for transmission and
demodulates signals to decode the transmitted
information.
• Types of Modem:
• DSL (Digital Subscriber Line) Modem
• Cable modem
• Fibre Optic Modem
Data Link Layer:
• Data link layer uses the services of the physical layer to
send and receive bits over a communication channel.
• To accomplish these goals, the data link layer takes the
packets it gets from the network layer and
encapsulated them into frames for transmission.
• Functions:
• Providing well-defined service interface to the network layer.
• Dealing with transmission errors
• Regulating the flow of data so that slow receivers are not
flooded by fast senders
Switching:
• In a computer network with large number of
intermediate nodes and in turn multiple paths,
switching helps in deciding the best possible route to
transmit the information from source to destination:
Circuit Switching:
• In circuit switched network, two
nodes communicate with each
other over a dedicated
communication path.
• Connection should be
established before the data
transmission.
• Three phases:
• Connection Establishment
• Data Transmission
• Connection Termination
• Two types of circuit switching:
•Space Division Circuit Switching
•Time Division Circuit Switching
Message Switching:
• Types of frames:
• I –frame: first bit of control field is ‘0’
• S-frame: first two bits of control field is ‘10’
• U-frame: first two bits of control field is ‘11’
• The following character encoding is used in a data
link protocol:
• A: 01000111
• B: 11100011
• FLAG: 01111110
• ESC: 11100000
Show the bit sequence transmitted (in binary) for the four-
character frame “A B ESC FLAG” when each of the following
framing methods is used:
a) Byte Count
b) Flag Bytes with Byte Stuffing
c) Starting and Ending Flag Bytes with Bit Stuffing
Error Control:
• Include additional or redundant bits to allow the
receiver to detect the error (Error Detecting Codes)
• Parity
• Checksums
• Cyclic Redundancy Check (CRC)
• Include additional or redundant bits to allow the
receiver to detect and correct the error (Error Detecting
Codes)
• Hamming Codes
• Binary Convolution Codes
• Reed-Solomon Codes
• Low-Density Parity Check Codes
Checksum:
At sender side:
At receiver side:
Receiver’s Side:
•Iterative algorithm
•Notations:
•c( x , y): Link cost from node x to node y. If x and y nodes are not directly linked,
then c (x, y) = ∞.
•D(v): Path cost from source to destination v that has the least cost currently.
•P(v): Previous node (neighbor of v) along with current least cost path from
source to v.
•N: Set of nodes whose least cost path is known.
Link State Routing Algorithm:
Example:
Distance Vector Routing (DVR) Vs Link State
Routing (LSR):
DVR: Routers exchange their routing tables with routers that are directly
connected.
LSR: Routers exchange link state packets (LSPs) containing information about their
directly connected links. These packets are flooded throughout the network,
allowing each router to construct a complete map of the network.
1. Convergence
2. Scalability
DVR Protocols: Routing Information Protocol (RIP) [hop count], Interior Gateway
Routing Protocol (IGRP) [bandwidth, delay, reliability, and load]
LSR Protocols: Open Shortest Path First (OSPF), Enhanced Interior Gateway
Routing Protocol (EIGRP)
IPv4 Address:
• An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a device (for example, a
computer or a router) to the Internet.
• Connectionless protocol
• Fragments (divides) packets where necessary
• Addressing via 32-bit Internet addresses
• The most common strategies used to improve the address space utilization and
conserve addresses:
• Private Addressing
• Classless Inter-Domain Routing (CIDR)
Contd…
Public address:
This address considered as any valid address assigned to any
user, and the organization who is responsible for registering IP
ranges called Internet Service Providers (ISPs), and this address
will be unique.
Private Address:
Any number or address assigned to a device on a private Local
Area Network that is accessible only within the Local Area
Network.
Private Address
• It means if the internetwork is limited to one organization, the IP addresses
need only be unique within that organization.
• Only networks that interface with public networks such as the Internet need
public addresses.
Private Addresses:-
Internet Engineering Task Force (IETF) in RFC1918 designates three ranges of
IP addresses as private:
• 10.0.0.0 through 10.255.255.255
• 172.16.0.0 through 172.31.255.255
• 192.168.0.0 through 192.168.255.255
Classless Inter-Domain Routing (CIDR)
• Classless Inter Domain Routing (CIDR) is a method for
assigning IP addresses without using the standard IP address
classes like Class A, Class B or Class C.
• In CIDR , an IP address is represented as A.B.C.D /n, where
"/n" is called the IP prefix or network prefix.
• The IP prefix identifies the number of significant bits used to
identify a network.
• Example, 192.9.205.22 /18 means, the first 18 bits are used to
represent the network and the remaining 14 bits are used to
identify hosts.
Contd….
Contd…
Subnetting
• Subnetting is the process of dividing a large network into smaller, more manageable sub-networks called
subnets.
• Subnetting involves splitting a single network into multiple smaller networks, each with its own unique range
of IP addresses.
• Three important things should be taken into our account when we think about subnetting:-
As well as, to find the number of hosts per subnet. We can use formal 2x -2, where (x) is the number of
unmasked bits (0’s) .
Subnetting Steps:
• Identify the class of the IP address and note the default
subnet mask.
• Convert the default subnet mask into Binary.
• Note the number of hosts required per subnet and find
the subnet generator (SG) and octet position.
• Generate the new subnet mask.
• Use the SG and generate the network ranges (subnets)
in the appropriate octet position
IP Header:
IP Header:
Version (4 bits):
Indicates the version of the IP protocol being used.
IHL (Internet Header Length) (4 bits):
Specifies the length of the IP header in 32-bit words.
Type of Service (8 bits):
This field is rarely used and often set to zero.
DSCP (6 bits) (Differentiated Services Code Point): Type of service (TOS) VOIP uses it
Explicit Congestion Notification (ECN) (2 bits): End-to-End notification of n/w
congestion without dropping packets. Underlying layers should support it
Total Length (16 bits):
Specifies the total length of the IP packet, including both the header and the data.
Identification (16 bits):
Used for reassembly of fragmented packets. Every fragment belonging to the same
datagram has the same identification value.
Contd….
Flags (3 bits):
Contains control bits used in fragmentation.
• Reserved: Typically set to zero
• Don’t Fragment (DF): If set, indicates that the packet should not be
fragmented.
• More Fragments (MF): If set, indicates that more fragments are to
follow.
Fragment Offset (13 bits):
Indicates the position of the data in the original datagram for fragmented
packets.
Time to live (TTL) (8 bits):
Represents the maximum number of hops that a packet can traverse
before being discarded.
Contd…
• Protocol (8 bits):
Indicates the protocol used in the data portion of the packet.
• Header Checksum (16 bits):
Used for error-checking the header. It is calculated based on the
header's contents and adjusted during transmission.
• Source IP address (32 bits):
Specifies the IP address of the source.
• Destination IP address (32 bits):
Specifies the IP address of the destination.
• Option (0 – 40 Bytes):
Optional information such as source route, record route etc. Used by the
Network administrator to check whether a path is working or not.
IP Fragmentation & Reassembly
• Fragmentation: Reassembly:
• Identification field is 1. Destination should identify
used to identify the that the datagram is fragmented
fragments of the same from MF, Fragment offset field.
datagram. 2. Destination should identify all
• Offset field is to identify fragments belonging to the
the sequence of same datagram from the
fragments in the
Identification field.
datagram.
3. Identify the 1st
• MF =1 (more fragments
ahead) fragment(offset = 0).
4. Identify subsequent
• MF = 0 (last fragment)
fragments using header length,
• DF = 1 (cannot be
fragment offset.
fragmented)
5. Repeat until MF = 0.
IGMP (Internet Group Management Protocol):
• IGMP is a communication protocol used by hosts
and adjacent routers for multicasting
communication with IP networks and uses the
resources efficiently to transmit the message/data
packets.
• IGMP V1:
• ARP Request
• ARP Reply