0% found this document useful (0 votes)
3 views

Computer Networks Notes 342024

The document provides an overview of computer networks, including their definitions, configurations, and topologies such as mesh, star, tree, bus, and ring. It also discusses network protocols, hardware components, and the categories of networks like LAN, MAN, and WAN. Additionally, it covers the ISO-OSI reference model and its layers, detailing their functions and the concepts of bandwidth and throughput.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Computer Networks Notes 342024

The document provides an overview of computer networks, including their definitions, configurations, and topologies such as mesh, star, tree, bus, and ring. It also discusses network protocols, hardware components, and the categories of networks like LAN, MAN, and WAN. Additionally, it covers the ISO-OSI reference model and its layers, detailing their functions and the concepts of bandwidth and throughput.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 188

Computer Networks

Introduction:
• A system of interconnected computers and
computerized peripherals such as printers is
called a computer network.

• The aim of the computer network is the sharing of


resources among various devices and also useful
for communication between devices.

• Computers may connect to each other by


either wired or wireless media.
Link Configuration:
• For communication to occur, two devices must be connected in some way to the
same link at the same time. There are two possible types of connections: point-
to-point and multi-point.
Transmission Modes:
• Transmission mode defines the direction of signal
flow between two linked devices.
• Simplex: In a simplex mode, the commutation is
unidirectional.
• Half-duplex: In half- duplex mode, each stations can
both transmit and receive, but not at the same time.
• Full-duplex: Signal going in either direction share the
capacity of the link.
• Full-Full duplex: In this Mode, a node may send and
receive at a time but from different nodes. i.e. A Node
send to one node and receive from another node.
Network Topology
• A Network Topology is the arrangement with which computer systems or
network devices are connected to each other.
• The topology of a network is the geometric representation of the relationship of
all the links and linking devices (usually called nodes) to one another.
Mesh Topology:

• In a mesh topology, every device has a


dedicated point – to – point link to every
other devices.

• A fully connected mesh network having n


devices has n (n-1)/2 physical channels.
Star Topology:
• In star topology, each device has a
dedicated point – to – point link only to a
central controller, usually called a hub.

• Thus the devices are not directly linked to


each other.

• If one device wants to send data to another,


it sends the data to the controller, and the
relay the data to the other connected
device.
Tree Topology:
• Nodes in a tree are linked to a central hub
that controls the traffic to the network.

• The majority of devices connect to a


secondary hub that in turn is connected to
the central hub.

• The central hub in the tree is an active hub,


which contains a repeater (a hardware
devices that regenerators the received bit
pattern before sending them out).

• The secondary hubs may be active or


passive hubs. Passive hub provides a simple
physical connection between the attached
devices.
Bus Topology:

• 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.

• Key Elements of a Protocol:


• Message Encoding
• Message format
• Message Encapsulation
• Message Size
• Message Delivery Options
• Message Timing
Numbers with Different Bases:
Decimal (10) Binary (2) Octal (8) Hexadecimal (16)
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
ASCII Codes (Alphanumeric):
Line Coding
• Types of Line Coding
• Unipolar
• Non-Return to Zero (NRZ)
• Return to Zero (RZ)
• Polar
• Non-Return to Zero (NRZ)
• Return to Zero (RZ)
• Bipolar
• Non-Return to Zero (NRZ)
• Return to Zero (RZ)
• Manchester Coding
• Alternate Mark Inversion (AMI)
Network Hardware:
• The physical devices that are used to establish and
maintain the network are said to be Network Hardware
that includes:
• Repeater
• A repeater operates at the physical layer.

• 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.

• A bridge is a repeater, with add on the functionality of filtering content by


reading the MAC addresses of source and destination.

• 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.

• IP (Internet Protocol) Address:


• An IP address identifies a device on the global internet. An IPv4 address
consists of 32 bits, usually written as four decimal numbers, or a dotted
quad.
• Possible values range from 000.000.000.000 through 255.255.255.255.
ISO-OSI Reference Model:
• An ISO standard that covers all aspects of network communication is Open
System Interconnection (OSI) model. The purpose of OSI model is to
establish communication between different system without requiring
change to the logic of the underlying hardware and software.
• The OSI model has seven layers. The principles that were applied to arrive at the
seven layers can be briefly summarized as follows:
1. A layer should be created where a different perception is needed.
2. Each layer should perform a well-defined function.
3. The function of each layer should be chosen with an eye toward defining
internationally standardized protocols.
4. The layer boundaries should be chosen to minimize the information flow
across the interfaces.
5. The number of layers should be large enough that distinct functions need
not be thrown together in the same layer out of necessity and small enough
that the architecture does not become heavy.
ISO-OSI Reference Model (Contd.):
Functions of the OSI Layer:

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.

Layer Physical Layer of OSI model. Any Layer of OSI model.

There is no dependency. Throughput is dependent on


Dependency Latency (Delay) does not latency (delay).
affect the bandwidth.

Bandwidth is not impacted Throughput is highly


by physical obstructions. impacted by external
Impact
interference, network
devices, and transmission
errors.
Maximum data rate of the
channel:
• Two theoretical formulas were developed to
calculate the maximum data rate:
• Nyquist for a noiseless channel:

Capacity = 2 * Bandwidth * log2(L) bits/sec

• Shannon for a noisy channel.

Capacity = bandwidth * log (1 + SNR) bits/sec


2
Examples:
• Consider a noiseless channel with a bandwidth of 3000 Hz
transmitting a signal with two signal levels. What can be
the maximum bit rate?
• We need to send 265 kbps over a noiseless channel with a
bandwidth of 20 kHz. How many signal levels do we need?
• A telephone line normally has a bandwidth of 3000 Hz
(300 to 3300 Hz) assigned for data communication. The
SNR is usually 3162. What will be the capacity for this
channel?
• Assume that SNR(dB) is 36 and the channel bandwidth is 2
MHz. Calculate the theoretical channel capacity.
DELAYS IN NETWORKS:

• 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:

• Queuing Delay: Time to wait in queue


• Processing Delay: Processing delay is the time that the nodes take to process
the packet header.
• Transmission Delay: Time to load the packet into the channel
• Propagation Delay: Time to reach the destination.

Network delay=Transmission Delay + Propagation Delay + Queuing


Delay + Processing Delay
Transmission delay = Packet size/bandwidth
Propagation delay=Length/Speed
• What are the propagation time and transmission time for
a 5-MB (megabyte) message (an image) if the bandwidth
of the network is 1 Gbps? Assume that the distance
between the sender and the receiver is 12,000 km and
that light travels at 2.4 * 108 m/s.
• A wants to send a 5 MB file to C in chunks of 500-byte
packets. To prevent any packet loss, when A sends a 500-
byte packet to C, it responds with a 50-byte packet to A
(through B) acknowledging that it has successfully
received the packet. Only after receiving the
acknowledgment, A sends the next packet. Assuming no
losses, how long will it take A to send the file to C:
Physical Characteristics of the
Media:
• Transmission media can be categorized as:
Twisted pair Cable:

Unshielded Twisted Pair (UTP) Shielded Twisted Pair (STP)


Twisted pair Cable:

• The least expensive and most widely used guided transmission


medium is twisted pair.
• Twisted pair may be used to transmit both analog and digital
transmission.
• For analog signals, amplifiers are required about every 5 to 6 km.
• For digital transmission, repeaters are required every 2 or 3 km.
• A twisted pair consists of two insulated copper wires arranged in a
regular spiral pattern.
• The twisting tends to decrease the crosstalk interference between
adjacent pairs in a cable.
• On long – distance links, the twist length typically varies from 5 to
15 cm. The wires in pair have thickness of from 0.4 to 0.9 mm.
Twisted pair Cable:
• Category 1:
• Used in telephone system
• Quality is fine for voice but inadequate for all but low-speed data communication.
• Category 2:
• Suitable for voice and for data transmission of up to 4 Mbps
• Category 3:
• Standard cable for most telephone systems. Used for data transmission of up to
10Mbps.
• Category 4:
• Should have at least three twists per foot per as well as other conditions to bring the
possible transmission rate to 16 Mbps.
• Category 5:
• Used for data transmission up to 100 Mbps
Shielded Vs Unshielded Twisted
Pair:

Crosstalk or interference is the undesired effect of one circuit (or channel) on


another circuit (or channel).
It occurs when one line picks up some of the signals travelling down another
line.
Coaxial Cable:
Coaxial Cable:
• Coaxial cable has a central core conductor of solid or wire (usually copper)
enclosed in an insulating sheath, which again is encased in an outer
conductor of metal foil.
• Coaxial cable is perhaps the most versatile transmission medium and is
enjoying widespread use in wide variety of applications.
• Coaxial cable is used to transmit both analog and digital signals.
• Coaxial cable has frequency characteristics that are superior to those of
twisted pair and can be used effectively at higher frequencies and data rates.
• Because of its shielded, concentric construction, coaxial cable is much less
susceptible to interfaces and crosstalk than twisted pair.
• For long-distance transmission of analog signals, amplifiers are needed
every few kilometres, with closer spacing required if higher frequencies are
used. The usable spectrum for analog signaling extends to about 500 MHz.
• For digital signaling repeaters are needed every kilometre or so, with closer
spacing needed for higher data rates.
Coaxial Cable Standards
• Different coaxial cable designs are categorized by their radio government
(RG) ratings.
• Each RG number denotes a unique set of physical specifications, including:
• The wire gauge of the inner conductor
• The thickness and type of the inner insulator
• The construction of the shield
• Size and type of the out casing.
Fibre Optic Cable:
Fibre optic is a cable that holds the optical fibres coated in plastic that are
used to send the data by pulses of light.
The plastic coating protects the optical fibres from heat, cold,
electromagnetic interference from other types of wiring.
Fibre optics provide faster data transmission than copper wires.
Fibre Optic Cable:
• When a light ray passes from one medium to another, for example, from
fused silica to air, the ray is reflected at the silica/air boundary.
• For angles of incidence above a certain critical value, the light is refracted
back into the silica, none of it escapes into the air.
• Thus a light ray incident at or above the critical angle is trapped inside the
fiber and can propagates for many kilo meters with virtually no loss.
• The light passes through core that is surrounded by a glass cladding with a
lower index of reflection than the core, to keep all the light in the core.
• Next comes a thin plastic jacket to protect the cladding.
Point-Point Transmission
Characteristics of Guided Media:
Unguided Media:
• Unguided media means the usage of wireless signals,
that are spread over in the air and are received and
interpreted by appropriate antennas.
• When an antenna is attached to electrical circuit of a
computer or wireless device, it converts the digital
data into wireless signals and spread all over within
its frequency range.
• The receptor on the other end receives these signals
and converts them back to digital data.
• Ex: Radio Waves, Micro Waves, InfraRed, UV, Visible
Light
Multiplexing:
• Multiplexing is the sharing of a medium or bandwidth.
• It is the process in which multiple signals coming from
multiple sources are combined and transmitted over a
single communication/physical line.
• It is used in cases where the signals of lower bandwidth and
the transmitting media is having higher bandwidth.
• In this, the signals are combined into one and are sent over a
link that has greater bandwidth of media than the
communicating nodes.
• Two types of Multiplexing:
• Frequency Division Multiplexing (FDM)
• Time Division Multiplexing (TDM)
Frequency Division Multiplexing:
• In this, a number of signals are transmitted at the
same time, and each source transfers its signals in
the allotted frequency range.
• There is a suitable frequency gap between the 2
adjacent signals to avoid over-lapping.
Time Division Multiplexing (TDM):
• In frequency division multiplexing all the signals
operate at the same time with different frequencies,
but in time-division multiplexing, all the signals
operate with the same frequency at different times.

• 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

Transmits data in the form of Transmits 1 byte or


Definition
chunks or frames character at a time

Speed of Transmission Quick Slow

Cost Expensive Cost-effective


Time Interval Constant Random

Gaps between the data? Does not exist Exist

Chat Rooms, Telephonic


Examples Conversations, Video Email, Forums, Letters
Conferencing
Modulation/Demodulation:

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:

• Also called as store and forward switching.


• The data transfer will happen in the form of a message (Large block of
data)
• The connections between the nodes will be established dynamically.
• Each intermediate device receives the whole message and buffers it
until there are resources available to transfer it to the next hop.
• If the next hop does not have enough resources to accommodate large
size message, the message is stored and switch waits.
Packet Switching
• In packet switching, messages are divided into
packets of fixed or variable size.
• Resources for data transmission are allocated based
on a first-come, first-served basis.
• Each switching node has a small amount of buffer
space to hold packets temporarily.
• Types of packet switching:
• Datagram Packet Switching
• Virtual Circuit Packet Switching
Datagram Packet Switching vs
Virtual Circuit Packet Switching:

Datagram Packet Switching Virtual Circuit Packet Switching


Framing:
• Framing means breaking up the bit stream
(packets) received from network layer into discrete
and distinguishable frames
• Each frame contains a frame header, payload field
for holding the packet, and a frame trailer.
Framing (Contd.):
• Framing can be broadly classified into:
• Fixed-size framing
• Variable size framing
• Methods of framing:
• Byte Count (or) Character Count
• Flag bytes with byte stuffing (or) character stuffing
• Flag bits with bit stuffing
• Physical layer coding violations
Byte Count:
Flag bytes with byte stuffing:
Byte Oriented Protocols:
• It deals with the frame as a collection of bytes or
characters.
• BSC – Binary Synchronous Communication Protocol

• PPP – Point-to-Point Protocol

• DDCMP – Digital Data Communication Protocol


Flag bits with bit stuffing:
Bit Oriented Protocols:
• It deals with the frame as a collection of bits
• High-Level Data Link Control (HDLC)

• 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:

• If m-bit checksum is used, the data unit (frame) to be transmitted


is divided into segments of m bits.
• All the m-bit segments are added.
• The result of the sum is then complemented using 1’s
complement arithmetic.
• The data along with the checksum value is transmitted to the
receiver.

At receiver side:

• If m-bit checksum is being used, the received data unit is divided


into segments of m bits.
• All the m-bit segments are added along with the checksum value.
• The value so obtained is complemented and the result is checked.
Cyclic Redundancy Check
Sender’s Side:

• A string of ‘n’ 0’s is appended to the data unit to be transmitted.


• Here, ‘n’ is one less than the number of bits in CRC generator.
• Binary division is performed of the resultant string with the CRC
generator.
• After division, the remainder so obtained is called as CRC.
• It may be noted that CRC also consists of n bits

Receiver’s Side:

• The transmitted code word is received.


• The received code word is divided with the same CRC generator.
• On division, the remainder so obtained is checked.
• Ex: dividend - 11001101, divisor - 1011
Hamming Codes:
Hamming Code Construction:
• Find the number of parity bits required for code.
• Construct a bit location table where the bit positions
are designated in decimal numbers from LSB to MSB.
• Determine the parity bits positions that are numbered
as ascending powers of two (1, 2, 4,…).
• Determine the parity bits (based on odd or even parity)
and enter them into the table to form ‘n+k’ code.
Detecting and Correcting an Error:
• Each parity bit, along with its corresponding group of bits must be
check for proper parity.
• The correct result of individual parity check is marked by ‘0’
whereas wrong is marked as ‘1’.
• After all parity checks, binary code is formed taking resulting bit
for first parity as LSB.
• This code gives error bit location.
• If code has all bits ‘0’ then there is no error in the hamming code.
Flow Control:
• Data Link layer service
• Set of protocols that oversees the proper data flow
from the source (sender) to the destination
(receiver).
• Noiseless Channel:
• Stop – N – Wait Protocol
• Noisy Channel:
• Stop – N – Wait ARQ Protocol
• Go – Back – N ARQ Protocol
• Selective Repeat ARQ Protocol
Problems:
• Station A needs to send a message consisting of 9
packets to station B using a sliding window (window
size of 3) and Go-back-n error control strategy. All
packets are ready and immediately available for
transmission. If every 5th packet that A transmits
gets lost (but no ACKs from B ever get lost). Then
what is the number of packets that A will transmit
for sending the message to B?
Access Control:
Data Link Layer:
• Logical Link Control (LLC) - flow control and the error control in the data
link layer
• Media Access Control (MAC) – Access control on the shared medium and
reduce collision
• Random Access Protocols
• In this protocol, all the station has the equal priority to
send the data over a channel.
• Depending on the shared media state, each station
transmits the data frame.
• Controlled Access Protocols
• In the controlled access method, each station interacts
and decides to send a data frame by a particular station
approved by all other stations.
• It means that a single station cannot send the data
frames unless all other stations are not approved.
• Channelization Protocols
• The total usable bandwidth in a shared channel is
allowed to be shared across multiple stations based on
their time, space (frequency), and codes.
ALOHA (Advocates of Linux Open-source Hawaii
Association):
• Every station wishing to transmit is
allowed to transmit.
• If more than one device attempt to
transmit at the same time, there will be
collision and the transmitted frame will be
destroyed.
• A sender waits for a reasonable amount of
time for an acknowledgment.
• If there is no acknowledgment the station
waits for a random amount of time, called
the backoff time, and assumes that a
collision has occurred and retransmits the
frame.
• Receiving station, examines the frame for
address detection, and checks for errors.
• If a received frame is valid then
immediately send an acknowledgment.
• If a received frame is not valid, it simply
ignores the frame. The maximum
utilization of the channel is only about
18%.
Slotted ALOHA:
• In this scheme, the time on the
channel is divided into discrete
intervals, each interval
corresponding to frame
transmission time.
• This approach requires the users to
agree of slot boundaries.
• Transmission is permitted to begin
only at a slot boundary. Thus
continuous pure ALOHA is turned
into a discrete one.
• This increase to the maximum
utilization of the channel to about
27%.
CSMA (Carrier Sense Multiple
Access) With CSMA, a station wishing to transmit
first listen to the cable to determine if
there is any traffic on the line i.e. if
another transmission is in progress.
1 – persistent:
When a station has data to send, it first
listens to the channel to see if anyone
else is transmitting at that moment. If
yes, the station will continuously sense
the carrier to know whether it is idle.
Non-persistent:
the station does not continually sense it
to seize it immediately upon detecting
the end of the previous transmission.
Instead, it waits a random time and then
repeats the algorithm.
P-persistent:
When a station becomes ready to send, it
senses the channel. If it is idle, it
transmits with a probability p.
CSMA/CD:
• When a frame is ready, the transmitting station
checks whether the channel is idle or busy.
• If the channel is busy, the station waits until
the channel becomes idle.
• If the channel is idle, the station starts
transmitting and continually monitors the
channel to detect collision.
• If a collision is detected, the station starts the
collision resolution algorithm.
• The station resets the retransmission counters
and completes frame transmission.
CSMA/CA:
• When a frame is ready, the transmitting station checks
whether the channel is idle or busy.
• If the channel is busy, the station waits until the
channel becomes idle.
• If the channel is idle, the station waits for an Inter-
frame gap (IFG) amount of time and then sends the
frame.
• After sending the frame, it sets a timer.
• The station then waits for acknowledgement from the
receiver. If it receives the acknowledgement before
expiry of timer, it marks a successful transmission.
• Otherwise, it waits for a back-off time period and
restarts the algorithm.
Controlled Access Protocols -
Reservation:
• A station needs to make a reservation before sending
data.
• In each interval, a reservation frame precedes the
data frames sent in that interval.
• When a station needs to send a data frame, it make a
reservation in its own slot.
• The station that have made reservations can send
their data frames after the reservation frame.
Controlled Access Protocols -
Polling:
• The polling protocol designates one of the nodes a
master node.
• The master node provides the access the remaining
nodes in a round-robin form.
• The master determines the completion of
transmission by observing lack of signal voltage on
the channel.
Controlled Access Protocols –
Token passing:
• A station is authorized to send data when it receives
a special frame called a token.
• A small, special purpose frame known as a token is
exchanged among the nodes in some fixed order.
• When a node receives a token, it holds onto the
token only if it has some frames to transmit;
otherwise, it immediately forwards the token to the
next node.
Routing Algorithms:
• Routing algorithms helps in providing the best possible
route for packet exchange between nodes connected in
different networks.
• The routing algorithm initializes and maintains the routing
table for the process of path determination between two
nodes.
• The routing protocols use the metric to determine the best
path for the packet delivery.
• The widely used metrics are 1. distance, 2. total transit
time, 3. hop count, 4. Bandwidth.
• Routing can be classified into
• Static Routing - Ex: Flooding, Random Walks
• Dynamic Routing – Ex: Distance Vector (RIP), Link state (OSPF)
Node x knows cost to each neighbor v

Distance Vector Routing Algorithm:


• Distributed/decentralized routing algorithm.
• The distance vector routing algorithm works by having each router maintain a routing table
(distance vector), having details of the destination, cost, and the next hop.
• Each router transmits its distance vector excluding the next hop column to each of its
neighbours.
• Each router receives and saves the most recently received distance vector from each of its
neighbours.
• A router recalculates its distance vector when:
• It receives a distance vector from a neighbour containing different information than
before.
• It discovers that a link to a neighbour gone down.
• The DV calculation is based on minimizing the cost to each destination using Bellman-Ford
Equation.

Dx(y) = minv{C(x, v) + Dv(y)} for each node y N

• Dx(y) = Estimate of least cost from x to y


• C(x, v) = Node x knows cost to each neighbour v
Link State Routing Algorithm:

•Centralized information sharing: Flooding

•Iterative algorithm

•Dijkstra's algorithm: Shortest path first

•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.

The routing algorithms are differed:

1. Convergence

2. Scalability

3. Memory and Computation

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

• However, it contains no functions for end-to-end message


reliability or flow control.
• IP makes the ‘best effort’ to forward packets to the next
destination but does not guarantee delivery because it is
connectionless.
Contd…

Each network interface connected to the Internet has a unique


address consisting of two parts:

Network address, address of the network within the Internet


(used by gateways for routing IP packets between networks).

Host address, address of the computer within the network


(used for delivering packets to a particular network interface
within the network).
Internet address format
• The 32-bit IP address is separated into four 8-bit octets,
allowing each octet to have a value ranging from 0 to 255.

• Furthermore, the IP address is logically separated into two


distinct components: the network ID and the host ID. The
network ID is used to identify the subnet upon which the host
resides. The host ID is used to identify the host itself within the
given subnet.

IP addresses can be displayed in three typical formats:


• Binary notation, Decimal equivalent notation are the formats
that systems on the network use to process the address.
• An example of binary notation is
11000000.10101000.00000001.01100100
• An example of decimal notation is 192.168.1.100
Contd…
Contd…..
• 240.0.0.0 to 255.255.255.254 – reserved for Experimental addresses.

• 127.0.0.1 - Loopback address (communicate with themselves) (reserved


127.0.0.0 to 127.255.255.255)

• 224.0.0.0 – 224.0.0.255 – Link-local (routing information exchanged by


routing protocols

• 224.0.1.0 – 238.255.255.255 – reserved for Network time protocol

• The most common strategies used to improve the address space utilization and
conserve addresses:

• Private Addressing
• Classless Inter-Domain Routing (CIDR)
Contd…

The IP address can be classify into two classes:

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.

• This subnetting provides


• Efficient resource utilization
• Improved Security
• Scalability
• Improved Network Management.

• Three important things should be taken into our account when we think about subnetting:-

1. Network address – the first one

2. Broadcast address – the last one

3. Host addresses – everything in between

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:

• Type – Host Membership Query and Host


Membership Report, leave report.
IGMP V2:

0x11 for Membership Query

0x12 for IGMPv1 Membership Report

0x16 for IGMPv2 Membership Report

0x22 for IGMPv3 Membership Report

0x17 for Leave Group


IGMP V3 (Source Specific Multicast)
Contd….
• Max Response Time – This field is ignored for message
types other than membership query. For membership
query type, it is the maximum time allowed before
sending a response report.
• Resv – It is set to zero of sent and ignored when received.
• The Suppress Router - Side Processing (S) flag - If set to
1, it indicates that the router should not perform any
group state changes due to this report.
• QRV – It represents Querier’s Robustness Variable.
Routers keeps on retrieving the QRV value from the most
recently received query as their own value until the most
recently received QRV is zero.
• QQIC – It represents Querier’s Query Interval Code.
Internet Control Message Protocol (ICMP):
• ICMP is used for reporting errors and management
queries.
• It is a supporting protocol and is used by network
devices like routers for sending error messages and
operations information.

• Type – Message type, Code – Additional information


about the error message and type, Extended Header –
locating the problem in IP message.
Contd…
Contd….
Contd…
ARP (Address Resolution Protocol):
• ARP find the hardware address, also known as the
MAC address of a host from its known IP address

• ARP Request

• ARP Reply

• ARP Cache Table

You might also like