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

Computer Networks

The document provides an overview of computer networking, detailing its evolution, types of networks (such as LAN, WAN, MAN, and VPN), and various network topologies (including bus, ring, star, tree, mesh, and hybrid). It also discusses network devices, transmission modes, and the OSI reference model, which outlines the seven layers of networking. Key concepts include the functions of different layers, the importance of network devices, and the methods of data transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Computer Networks

The document provides an overview of computer networking, detailing its evolution, types of networks (such as LAN, WAN, MAN, and VPN), and various network topologies (including bus, ring, star, tree, mesh, and hybrid). It also discusses network devices, transmission modes, and the OSI reference model, which outlines the seven layers of networking. Key concepts include the functions of different layers, the importance of network devices, and the methods of data transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 161

Computer Networks

Evolution of Computer Network


What is Computer Networking?
A computer network is a collection of computers capable of transmitting,
receiving and exchanging voice, data and video traffic.

History of Computer Network


1960s - packet switiching
invented by Leonard Kleinrock
1970s - ARPANET
Advanced Research Projects Agency Network.
1980s - TCP/IP
Transmission control protocol / Internet protocol.
2000s - Commercial Internet
Computer Networks
The old model of the simple computer serving all of the organization
computational needs has been replaced by one in which a large number of
seperated but interconnected computers do the job - These systems are
called Computer Networks.
Internet - Networks come in many sizes, shapes and forms as we will see
later. They are usually connected together to make larger networks with
the Internet being the most well known example, of the network of
networks.
VPN (Virtual Private Network) - Networks called VPNs may be used to join
the individual networks at different sites and extend it into single network.
Voice over IP (VOIP) - Telephone calls between employees may be carried
by the computer network instead of the phone company this technology
is called IP Technology or Voice over IP.
PAN (Personal area Network)
PANs let devices communicate over the range of a person a common example
is, a wireless network that connects the computer with its peripherals. Almost
every computer as an attatched monitor, keyboard, mouse and printer
without using wireless this connection must be done with wire.

LAN (Local area Network)


A LAN is a privately owned that operates within and nearby a single building
like a house, office or factory. LANs are widely used to connect personal
computers and consumer electronics to let them share resources and
exchange information. When LANs are used by companies they are called
enterprise networks.
Metropolitan Area Network (MAN)

A metropolitan area network (MAN) is a computer network that interconnects


users with computer resources in a geographic region of the size of a
metropolitan area. A MAN typically covers a city or a campus. MANs are
formed by connecting multiple LANs. Thus, MANs are larger than LANs, but
smaller than wide area networks (WAN) that cover dispersed geographical
areas, sometimes directly connecting users around the world.
MANs are often used to provide high-speed data connections for businesses,
educational institutions, and government agencies. They can also be used to
provide public Wi-Fi access in cities and towns.
Wide Area Network (WAN)
A wide area network (WAN) is a computer network that spans a large geographic
area. A WAN connects multiple local area networks (LANs) together, often over long
distances. WANs are used by businesses, governments, and educational institutions
to connect their offices, campuses, and other locations.
WANs can be implemented using a variety of technologies, including:
Fiber optic cable: Fiber optic cable is the fastest and most reliable type of WAN
technology. It is often used to connect large organizations that need to transfer
large amounts of data quickly and reliably.
Coaxial cable: Coaxial cable is a less expensive and less reliable alternative to
fiber optic cable. It is often used to connect smaller organizations or to connect
LANs to a WAN.
Radio waves: Radio waves are the least expensive and least reliable type of WAN
technology. They are often used to connect remote locations or to connect
organizations that do not have access to fiber optic cable or coaxial cable.
Internetworks

Internetworks is a term that refers to the interconnection of multiple


computer networks. This can be done using a variety of technologies, such as
routers, firewalls, and switches. Internetworking allows for the sharing of
resources, such as files, printers, and applications, between different
networks.
The Internet is the most well-known example of an internetwork. It is a global
wide area network that connects computer systems across the world. The
Internet is made up of millions of smaller networks, each of which is owned
and operated by a different organization. These networks are interconnected
using a variety of technologies, such as routers and fiber optic cables.
Network Topology
What is network topology?
Topology defines the structure of the network of how all the computers are
interconnected to each other.There are two types of topology physical and
logical topology.
Bus Topology
Alternatively called line topology, bus topology is a network setup where each computer and
network device is connected to a single cable or backbone. Depending on the type of
computer network card, a coaxial cable or an RJ-45 network cable is used to connect them
together.
Advantages of bus topology
It works well when you have a small network.
It's the easiest network topology for connecting computers or peripherals in a linear
fashion.
It requires less cable length than a star topology.
Disadvantages of bus topology
It can be difficult to identify the problems if the whole network goes down.
It can be hard to troubleshoot individual device issues.
Bus topology is not great for large networks.
Terminators are required for both ends of the main cable.
Additional devices slow the network down.
If a main cable is damaged, the network fails or splits into two.
Ring topology
A ring topology is a network configuration where device connections create a
circular data path. Each networked device is connected to two others, like
points on a circle. Together, devices in a ring topology are called a ring network
Advantages of a ring topology
All data flows in one direction, reducing the chance of packet collisions.
A network server is not needed to control network connectivity between
each workstation.
Data can transfer between workstations at high speeds.
Additional workstations can be added without impacting performance of
the network.
Disadvantages of a ring topology
All data being transferred over the network must pass through each
workstation on the network, which can make it slower than a star topology.
The entire network will be impacted if one workstation shuts down.
The hardware needed to connect each workstation to the network is more
expensive than Ethernet cards and hubs/switches.
Start Topology
A star topology, sometimes known as a star network, is a network topology in which each
device is connected to a central hub. It is one of the most prevalent computer network
configurations, and it's by far the most popular Network Topology. In this network
arrangement, all devices linked to a central network device are displayed as a star.
Advantages of Star Topology
Fault Tolerance
Scalability
Connecting multiple device types
Low chances of data collisions
Disadvantages of Star Topology
Failure of central core
Expensive
Impact on mobility
Low data transfer rates
Tree Topology
In computer networking, tree topology is a type of network topology that resembles a tree. In a tree
topology, there is one central node (the “trunk”), and each node is connected to the central node through a
single path. Nodes can be thought of as branches coming off of the trunk. Tree topologies are often used to
create large networks.
Advantages of Tree Topology
Tree topology has several advantages over other network topologies:
It can support a large number of nodes.
It can be easily expanded.
Additionally, tree topologies are highly scalable and can be easily reconfigured.
Disadvantages of Tree Topology
Tree topology has a number of disadvantages, which include:
It can be difficult to troubleshoot issues in a tree topology as each node is connected to multiple other
nodes. This can make it hard to identify where the issue is located.
Tree topology can be less reliable than other topologies such as star or mesh as there are more potential
points of failure. If one node goes down, it can affect the entire network.
Tree topology can be more expensive to implement as it requires more cabling and equipment than
other topologies.
Mesh Topology
Mesh topology is a type of networking in which all the computers are inter-
connected to each other. In Mesh Topology, the connections between devices
take place randomly. The connected nodes can be computers, switches, hubs, or
any other devices. In this topology setup, even if one of the connections goes
down, it allows other nodes to be distributed.
Advantages of Mesh Topology
Scalable
Robust
Lower Cost
Redundancy
Disadvantages of Mesh Topology
Complex
Planning is difficult
high Power Consumption
challenging maintenance
Hybrid Topology
It is the combination of two or more different topologies. For example, in a
college we have so many departments, let us say one department uses ring
topology and another department uses Star topology, connecting these two
topologies which results in Hybrid Topology.
Hybrid= Ring+Star
The advantages of Hybrid topology are given below −
It is effective and flexible.
Troubleshooting is easy.
Error detecting is reliable.
It is scalable because the size can be increased easily.
The disadvantages of Hybrid Topology are given below −
Designing is difficult or complex.
It is costly.
Network Devices
Network devices, also known as networking hardware, are physical devices that
allow hardware on a computer network to communicate and interact with one
another. For example Repeater, Hub, Bridge, Switch, Routers, Gateway,
Brouter, and NIC, etc.

Hub
A hub joins multiple devices on the same LAN, broadcasting messages to all
ports without examining frames
Switch
A network switch forwards data to its
proper destination, examining a packets
MAC address info to determining the
intended device.

Router
The router is a physical or virtual internetworking
device that is designed to receive, analyze, and
forward data packets between computer networks. A
router examines a destination IP address of a given
data packet, and it uses the headers and forwarding
tables to decide the best way to transfer the
packets.
Bridge
Bridges are used to connect two subnetworks that use interchangeable
protocols. It combines two LANs to form an extended LAN. The main
difference between the bridge and repeater is that the bridge has a
penetrating efficiency.
Gateway
A gateway connects discrete networks and translates packet data so it can
travel between the systems. This network device allows to broaden network.
handles traffic issues efficiently. but it never filters data, it is costly and
difficult to manage.
Modem
Modem is a device that enables a computer to send or receive data over
telephone or cable lines. The data stored on the computer is digital whereas a
telephone line or cable wire can transmit only analog data.
Repeater
Repeaters are network devices operating at physical layer of the OSI model
that amplify or regenerate an incoming signal before retransmitting it. They
are incorporated in networks to expand its coverage area. They are also
known as signal boosters.
Access Point
device that sends and receives data wirelessly over radio frequencies
It's an easy installation, allows data transmission even user is moving
simple to extends to places where wires and cables are not
accessible.but it's range of network devices is limited which causes
issues for many users installing this network device is difficult.
Transmission Modes
The way in which data is transmitted from one device to another is known as
transmission mode.
simplex mode
half duplex mode
full duplex mode

Simplex mode
The communication is unidirectional i.e. data flows in one direction. since it is
unidirectional it has no intercommunication between devices.Example:
Keyboard and traditional monitors. The keyboard can only introduce input,
the monitor can only give the output
Half duplex mode
In half-duplex mode, each station can both transmit and receive, but not at
the same time. When one device is sending, the other can only receive, and
vice versa. The half-duplex mode is used in cases where there is no need for
communication in both directions at the same time. The entire capacity of the
channel can be utilized for each direction.
Example: Walkie-talkie in which message is sent one at a time and messages
are sent in both directions.
Full duplex
In full-duplex mode, both stations can transmit and receive simultaneously. In
full_duplex mode, signals going in one direction share the capacity of the link with
signals going in another direction.Full-duplex mode is used when communication in
both directions is required all the time. The capacity of the channel, however, must
be divided between the two directions. Example: Telephone Network in which
there is communication between two persons by a telephone line, through which
both can talk and listen at the same time.
(Open Systems Interconnect)
OSI Reference Model
OSI or Open System Interconnection model was developed by International
Standards Organization (ISO). It gives a layered networking framework that
conceptualizes how communications should be done between heterogeneous
systems. It has seven interconnected layers. The seven layers of the OSI
Model are a physical layer, data link layer, network layer, transport layer,
session layer, presentation layer, and application layer
7 Layers of OSI Model
Physical layer: The physical layer is the lowest layer of the OSI model. It
is responsible for the electrical and physical aspects of data
transmission. This includes the physical medium, such as copper wire or
fiber optic cable, and the connectors and hardware used to connect
devices to the network.

Data link layer: The data link layer is responsible for error detection and
correction for data transmitted over the physical layer. It also defines
how data is to be framed into packets for transmission. The data link layer
uses a variety of techniques to detect and correct errors, such as
checksums and cyclic redundancy checks (CRCs).
Network layer: The network layer is responsible for routing data between
devices on different networks. It also provides addressing and routing
information for data packets. The network layer uses a variety of routing
protocols to determine the best path for data to travel.
Transport layer: The transport layer provides a reliable connection
between two applications. It ensures that data is delivered in the correct
order and that any errors are corrected. The transport layer uses a variety
of mechanisms to ensure reliability, such as sequence numbers,
acknowledgments, and retransmissions.
Session layer: The session layer manages the communication between two
applications. It establishes and maintains a connection between the two
applications, and it ensures that data is exchanged in a coordinated
manner. The session layer uses a variety of mechanisms to manage
communication, such as synchronization points and checkpoints.
Presentation layer: The presentation layer translates data between
different formats. For example, it can convert text from one character
encoding to another. The presentation layer also provides encryption and
compression services.

Application layer: The application layer provides services to applications


that need to communicate over a network. For example, it provides file
transfer, email, and web browsing services. The application layer uses a
variety of protocols to communicate with other applications, such as
HTTP, FTP, and SMTP.
Transport Layer
Main functions done by Transport layer are:
Identifying service:
Identification of services is done using port numbers.
port is a logical communication channel.
Multiplexing and Demultiplexing :
From the application layer large no of requests are clubbed up of
different requests from the user, this method is known as multiplexing.
Different servers five the clubbed up request to the network layer and
by the help of transport layer it gets seperated and this method is
called demultiplexing.
Segmentation:
Breaking up of message given by the sender into several parts and sent
to the receiver this is called segmentation.
Sequencing and Reassembling:
After segmentation, the message recieved may or may not be in the
original order. so they allot numbering to every segments or packets.
And each packets are given sequence numbers that can be ordered
after recieving.
Error Correction:
If the reciever gets a missing packet reciever messages to the
transmitter to retransmit the particular packet to it.
Data Flow:
Flow of data can be controlled by Transport layer.

In transport layer after the segmentation every data are appended to a


transport header i.e TH and these are combined and known as segment.
Network Layer
Provides logical addressing and path determination (Routing) in this layer.
Protocols working in this layer are :
Routed protocols: used to carry data between hosts.
Routing protocols: which finds the best path for transporting data
From transport layer segment when in network layer it is added to a header
network header i.e., NH and is combined to known as packet.
Data Link Layer
It has 2 sub layers
MAC (Media Access Control)- IT provides reliable transit of data across a
physical link.
It also provides ERROR detection using (cyclic redundancy check) and
ordered delivery of frames.
LLC (Logical link Control) Provides communication with network layer.
Inter Layer Communication
How does it work?
each layer contains a Protocol Data Unit (PDU)
PDU's are used for peer-to-peer contact
between corresponding layers.
Data is handles by the top three layers,
then Segmented by the Transport layer.
The Network layer places it into packets
and DataLink frames the packets for
transmission.
Physical layer converts it into bits and
send it out over the media.
The recieving computer reverses the
process using information contained in the
PDU.
Data Encapsulation
At each layer in the OSI or TCP/IP protocol stack
Outgoing data is packaged and identified for delivery to the layer
underneath.
PDU - PAcket Data Unit - the "envelop" information attatched to a
packet at a particular TCP/IP protocol or OSI protocol.
e.g. header and trailer
Header
PDU's own particular opening component
Identifies the protocol in use, the sender and intended recipient.
Trailer (or packet trailer)
Provides data integrity checks for the payload.
OSI Model TCP/IP Model

It stands for Open System Interconnection. It stands for Transmission Control Protocol.

OSI model has been developed by ISO (International It was developed by ARPANET (Advanced Research
Standard Organization). Project Agency Network).

It consists of standard protocols that lead to the


It is an independent standard and generic protocol
development of an internet. It is a communication
used as a communication gateway between the
protocol that provides the connection among the
network and the end user.
hosts.

The transport layer does not provide the surety for


In the OSI model, the transport layer provides a
the delivery of packets. But still, we can say that it is
guarantee for the delivery of the packets.
a reliable model.

This model is based on a vertical approach. This model is based on a horizontal approach.

In this model, the session and presentation layer are


In this model, the session and presentation layers are
not different layers. Both layers are included in the
separated, i.e., both the layers are different.
application layer.
It is also known as a reference model through which various networks
are built. For example, the TCP/IP model is built from the OSI model. It is an implemented model of an OSI model.
It is also referred to as a guidance tool.

In this model, the network layer provides both connection-oriented


The network layer provides only connectionless service.
and connectionless service.

Protocols in the OSI model are hidden and can be easily replaced
In this model, the protocol cannot be easily replaced.
when the technology changes.

It consists of 7 layers. It consists of 4 layers.

OSI model defines the services, protocols, and interfaces as well as


In the TCP/IP model, services, protocols, and interfaces are not
provides a proper distinction between them. It is protocol
properly separated. It is protocol dependent.
independent.

The usage of this model is very low. This model is highly used.

It provides standardization to the devices like router, motherboard, It does not provide the standardization to the devices. It provides a
switches, and other hardware devices. connection between various computers.
Switching
Switching as applied to networking and IT, is the practice of directing a signal
or data element toward a particular hardware destination
Packet Switching
In packet based networks, the message gets broken into small data
packets.
These packets are sent out from the computer and they travel around the
network seeking out the most efficient route to travel as circuits become
available.
This does not necessarily mean that they seek out the shortest route.
Each packet may go a different route from others.
Circuit Switching
There are three phases in circuit switching:
Establish
Transfer
Disconnect
The telephone message is sent all together; it is not broken up
The message arrives in the same order that it was originally sent.
In modern circuit-switching networks, electronic signals pass through
several switches before a connection is established.
During a call no other network traffic can use those switchess.
The resources remain dedicated to the circuit during the entire data
transfer and the entire message follows the same path.
Circuit switching can be analog or digital.
Advantages
Circuit is dedicated to the call - no interference no sharing.
Guaranteed the full bandwidth for the duration of the call
Guaranteed quality of service

Disadvantages
Inefficient - the equipment may be unused for a lot of the call; if no data is
being sent, the dedicated line still remains open.
It takes a relatively long time to set up the circuit.
During a crisis or disaster, the network may become unstable or
unavailable.
It was primarily developed for voice traffic rather than data traffic.
Data Link Layer
The data link layer is responsible for error detection and correction
for data transmitted over the physical layer. It also defines how data
is to be framed into packets for transmission. The data link layer
uses a variety of techniques to detect and correct errors, such as
checksums and cyclic redundancy checks (CRCs).
Data Link Layer Design Issues
Services provide to the Network layer
Framing
Error Control
Flow Control
Functions of the Data Link Layer
Provide service interface to the network layer.
Framing provides a way for a sender to transmit a set of bits that are
meaningful to the reciever.
Dealing with transmission errors.
Regulating data flow.
Slow recievers not swamped by fast senders.
Services provided to network layer
Actual Communication :
In this communication, physical
medium is present through which
Data Link Layer simply transmits
data frames.

Virtual Communication :
In this communication, no physical
medium is present for Data Link
Layer to transmit data. It can be
only be visualized and imagined
that two Data Link Layers are
communicating with each other
with the help of or using data link
protocol.
Types of Services provided by Data Link Layer :
1. Unacknowledged Connectionless Service
Loses are taken care at higher layers.
used on a reliable medium like coax cables or optical fibers where the
error rate is low.
appropriate for voice, where delay is worse than bad data.
the data link layer of the sending machine sends independent frames to
the data link layer of the receiving machine.
The receiving machine does not acknowledge receiving the frame.
No logical connection is set up between the host machines. Error and
data loss is not handled in this service.
This is applicable in Ethernet services and voice communications.
2. Acknowledged Connectionless Service
useful on unreliable medium like wireless.
Acknowledgements add delays.
adding ACK (Aknowledgement) in Data Link Layer rather than on Network
Layer is just an optimization and not a requirement.
Leaving it to the network layer is inefficient as a large message has to be
resent in that case in contrast to small frames here.
On reliable channels, like fiber, the overhead associated with the ACK is
not justified.
no logical connection is set up between the host machines, but each
frame sent by the source machine is acknowledged by the destination
machine on receiving.
If the source does not receive the acknowledgment within a stipulated
time, then it resends the frame. This is used in Wifi (IEEE 802.11) services.
3. Acknowledged Connection Oriented Service
Most reliable
Guaranteed service-
Each frame sent is received.
Each frame is received exactly once.
Frames are received in order.
This is the best service that the data link layer can offer to the network
layer.
A logical connection is set up between the two machines and the data is
transmitted along this logical path.
The frames are numbered, that keeps track of loss of frames and also
ensures that frames are received in correct order.
Framing
In the physical layer, data transmission involves synchronised
transmission of bits from the source to the destination. The data link layer
packs these bits into frames.
Data-link layer takes the packets from the Network Layer and
encapsulates them into frames. If the frame size becomes too large, then
the packet may be divided into small sized frames. Smaller sized frames
makes flow control and error control more efficient.
Then, it sends each frame bit-by-bit on the hardware. At receiver’s end,
data link layer picks up signals from hardware and assembles them into
frames.
Framing is a function of Data Link Layer. It provides a way for a sender
to transmit a set of bits that are meaningful to the receiver.
Types of Framing
Character Count
Flag Bytes with byte stuffing
Flag Bytes with bit stuffing
Physical layer validation
Character Count
(a) without errors and (b) with errors.
Problems with framing with CC
What if the count is unclear.
Even with the checksum the receiver knows that the frame is bad and
there is no way to tell whether the next frame starts.
asking for retransmission doesn't help either because start of the
retransmission frame is unknown.
No longer used.
Framing with byte stuffing
Problem- fixed character size:
assumes character size to be 8
bits: can't handle heterogeneous
environment.
The data become so bulky.
Framing with bit stuffing

Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receiver’s memory after destuffing.
Physical Layer Encoding Violations
The final framing method is physical layer coding violations and is applicable
to networks in which the encoding on the physical medium contains some
redundancy. In such cases normally, a 1 bit is a high-low pair and a 0 bit is a
low-high pair. The combinations of low-low and high-high which are not used
for data may be used for marking frame boundaries.
Error Control
Positive and Negative Acknowledgement -To make sure all frames are
eventually delivered to the network layer at the destination and in the
proper order the receiver send back a special control frames bearing
positive or negative acknowledgements about the incoming frames.
If the sender receives a positive acknowledgement about a frame, a frame
has arrived safely.
A negative acknowledgement means that something has gone wrong, and
the frame must be transmitted again.
If there is hardware trouble, positive or negative acknowledgement will
not reach the sender and it has to hang forever.
In this case, timers are used.
Timers : what happens when a frame completely vanishes : receiver
neither sends a +ack nor –ack … then timer comes to help.
It may result in a frame being sent more than once and received more
than once :
solution : assign sequence numbers to frames
Error detection and correction
Data can be corrupted during its transmission. For reliable communication,
errors must be detected and corrected. Error detection and correction are
implemented either at the data link layer or the transport layer of the OSI
model

On a reliable medium : ED is sufficient where the error rate is low and asking
for retransmission after ED would work efficiently
In contrast, on an unreliable medium : Retransmission after ED may result in
another error and still another and so on. Hence EC is desirable.
Error Detecting code
1. Parity

value of parity bit is such that character has even (even parity) or odd (odd
parity) number of ones.
even number of bit errors goes undetected.
simple parity
Longitudinal Redundancy
Check/Vertical redundancy check (LRC/VRC)
Even Parity of 1's LRC/VRC
Error Detection
Error detection using CRC [cyclic redundancy check] bits.
It is also known as polynomial codes.
polynomial codes are based upon creating bit strings as representation of
polynomials with coefficients of 0 and 1 only.

Steps to send data using CRC bits


1. select the bit stream to send
2. select a generator polynomial
3. add required zeroes at the end of the original message such that if there
are 4 coefficients in a generator polynomial then 4-1 = 3 zeroes to be
added to the end of the original message.
4. do th XOR operation on the new message with the generator polynomial.
5. take the remainder (CRC) bits and add it to the original message.
6. now the message is ready to send across the network.

At the receiver's side


1. use the same generator polynomial and do the XOR on the recieved
message
2. if the remainder is zero the reciever can identify that no error has been
occured.
A bit stream 10101110 is transmitted using CRC.
X3+1 is the generator polynomial used. Find out
the codeword to be transmitted. Suppose during
the transmission, due to some noise 4th bit from
left of the code word flipped. Show how CRC
detects the error.
step 1: select the bit stream – 10101110
step 2: select the generator polynomial – X3 + 1 (X3 + 0X2 + 0X1 + 1)
step 3: coefficients : 1-0-0-1 so add (4-1) = 3 zeroes to be added to the
original message.
step 4: new message = 10101110000
step 5: do XOR operation on 10101110000 with 1001(coefficient).
sender side
crc bit = 001

to be XOR again

crossed and the


next bit is entered
receiver side
crc bit = 010

to be XOR again

crossed and the


next bit is entered
if the crc bits at the receiver side is full
zeroes like 000 etc. there is no error but
if its different then there is an error.
here an error has detected since a bit is
flipped when sending as said in the
question
CRC [Cyclic Redundancy Checksum]
The CRC error detection method treats the packet of data to be
transmitted as a large polynomial.
The transmitter takes the message polynomial and using polynomial
arithmetic divides it by the generating polynomial.
The quotient is discarded but the remainder is attached to the end of
message.
Hamming Code (Error Correction)
Hamming code is a set of error-correction codes that can be used to detect
and correct the errors that can occur when the data is moved or stored from
the sender to the receiver. It is a technique developed by R.W. Hamming for
error correction.

Suppose 16 bit message is transmitted using a hamming code how many


checkbits are needed to ensure that the receiver can detect and correct
single bit errors. give the code word for transmitting of message
1101001100110101
step 1: identify the data: sender side
the data is given as 1101001100110101

step 2: the checkbits can be inserted at positions 1,2,4,8,16,32,64......


now we have to find out
the values of c1,c2,c3,c4
and c5. with the help of
table given below we can
find the values of them
then we have to track where are the values starred on the table for c1,c2,c3...
C1 = (3,5,7,9,11,13,15,17,19,21) 1 excluded
C2 = (3,6,7,10,11,14,15,18,19) 2 excluded
C3 = (5,6,7,12,13,14,15,20,21) 4 excluded
C4 = (9,10,11,12,13,14,15) 8 excluded
C5 = (17,18,19,20,21) 16 excluded
then find the values on the corresponding positions received above at last
add one more bit as a parity bit and even the no of ones is even then the
parity bit will be 0 if it odd then the parity bit is 1
C1 = 11101011110 These red colored bits are the values
C2 = 1010101011 for c1,c2,c3,c4 and c5.
C3 = 1011001011
C4 = 00110011
C5 = 101011
suppose the 5th bit is altered during transmission and calculate the parity
bit in the receiver side.
message = 011100110011001110101

receiver side
C1 = (3,5,7,9,11,13,15,17,19,21) 1 excluded
C2 = (3,6,7,10,11,14,15,18,19) 2 excluded
C3 = (5,6,7,12,13,14,15,20,21) 4 excluded
C4 = (9,10,11,12,13,14,15) 8 excluded
C5 = (17,18,19,20,21) 16 excluded
C1 = 10101011111
C2 = 1010101011
C3 = 0011001010
C4 = 00110011
C5 = 101011
since C1 and C2's values have changed at
the receiver side it detects that there is
some error and C1 = 2^0 = 1 and C3=2^2 = 4
then add them up than we get 5.
thus altered bit is the 5th bit.
A bit stream of 16 bits data is to be transmitted
across the network. The receiver needs to detect
and correct error in the received data if any. Give
the code word obtained by the sender for
transmission. Assume that 5th bit is altered
during the transmission and how does the
receiver detect and correct that one bit error?
Data: 1100110011001100
FLOW CONTROL
Flow control is a technique that allows two stations working at different
speeds to communicate with each other. It is a set of measures taken to
regulate the amount of data that a sender sends so that a fast sender does
not overwhelm a slow receiver. In data link layer, flow control restricts the
number of frames the sender can send before it waits for an acknowledgment
from the receiver.
Stop and Wait Protocol
It is the simplest flow control method. In
this, the sender will transmit one frame at a
time to the receiver. The sender will stop
and wait for the acknowledgement from the
receiver.
performs better for LAN's than WAN's
because:
efficiency = 1/distance between sender
and receiver
Only problem is that there is a high
probability of occurrence of deadlock. due
to loss in data packet/ loss in feedback.
Sliding window protocol for noisy channel
Explanation
•In this example, the sending window sends data to the receiving window. The
receiving window sends the acknowledgment after receiving the data and
then the sending window sends another data frame.

•However, this time, along with the received acknowledgment, the receiving
window also sends another message saying that the available memory is full.

•The sending window pauses the transmission of data until it gets the
acknowledgment of the receiving window that space has been released and it
can continue the transmission process.
we are creating connection between sender and receiver.
there are 2 buffers created.
for sender - sending window
for receiver - receiving window
when sender sends data packet receiver sends back the remaining
receiving buffer space.
windowing - A flow control method for transfering data over a network.
window size - number of data packets that can be sent without waiting for
ACK.
Sliding Window -
each time frame is sent - window shrink
each time ACK received - window grows
Stop and Wait ARQ
working is same as that of stop and wait protocol and includes additional
components .
timeout timer.
sequence number of data packets
sequence number of feedback
available sequence numbers >= sender window size +receiver window
size.
EXPLANATION.
sender keeps a copy of last frame until it receives ACK.
for identification both data frames and ACKs are numbered alternatively 0
and 1.
sender has control variable (S) that holds number of recently sent frame
(0 or 1).
receiver has control variable (R) that holds number of next frame
expected (0 or 1).
sender starts a timer when it sends a frame and if the ACK is not received
within the time period sender assumes frame was lost and resent it.
receiver sends only positive ACK if the frame is intact.
ACK number always defines the number of next expected frame.
Piggybacking
•A method to combine a data
frame with ACK.
•Station A and B both have data
to send.
•Instead of sending separately,
station A sends a data frame
that includes an ACK.
•Station B does the same thing.
•Piggybacking saves bandwidth.
Problem with 1 bit sliding windows
Bandwidth utilization is poor (waiting for ACK, time out period .. etc.
wasting bandwidth for a valid period of time).
Solution - Pipelining
If the sender could send more frames without waiting for ACK for the first
one, the channel could have been utilized more efficiently. This technique
is called pipelining.
What to do if errors occur during pipelining
Go back n, or
Selective Repeat
Go Back n
Go Back N ARQ which stands for Go Back N Automatic Repeat Request
(ARQ) is a data link layer protocol that is used for data flow control
purposes. It is a sliding window protocol in which multiple frames are sent
from sender to receiver at once. The number of frames that are sent at
one depends upon the size of the window that is taken.
What to do when a frame in the middle of a long stream is bad? Large # of
succeeding frames may come to receiver before sender is told of error.
On discovering error, a solution is go back n. Here receiver discards all
subsequent frames (upto n) & sends no ack for the discarded frames.
Therefore the receiver DLL refuses all frames but the next one it must give
to the NL.
Eventually sender will retransmit all frames including lost/damaged one.
Advantages of Go Back n

1. It can send multiple frames at once.


2. Pipelining is present in the Go-Back-N ARQ i.e. a frame can be
sent by the sender before receiving the acknowledgment of
the previously sent frame. This results in a lesser waiting time
for the frame.
3. It handles corrupted as well as out-of-order frames which
result in minimal frame loss.
Disadvantages of Go-Back-N ARQ

1. If acknowledgment for a frame is not received, the whole window of


frames is retransmitted instead of just the corrupted frame. This makes
the Go Back N ARQ protocol inefficient.
2. Retransmission of all the frames on detecting a corrupted frame
increases channel congestion and also increases the bandwidth
requirement.
3. It is more time-consuming because while retransmitting the frames on
detecting a corrupted frame, the error-free frames are also transmitted.
Selective Repeat Protocol
The selective repeat ARQ is one of the Sliding Window Protocol strategies
that is used where reliable in-order delivery of the data packets is
required. The selective repeat ARQ is used for noisy channels or links and
it manages the flow and error control between the sender and the
receiver.
Store all frames following the bad one.
When sender notices that something is wrong it only retransmits the bad
frame.
This is like having a receiver window larger than 1
Thus any frame within the window may be accepted and buffered until all
the preceding ones have been passed to the network layer.
Could need large amounts of memory in DLL
Multiple Access
Problem: When two or more nodes transmit at the same time, their frames
will collide and the link bandwidth is wasted during collision
How to coordinate the access of multiple sending/receiving nodes to the
shared link???
Multiple access protocols are a set of protocols operating in the Medium
Access Control sublayer (MAC sublayer) of the Open Systems
Interconnection (OSI) model. These protocols allow a number of nodes or
users to access a shared network channel. Several data streams
originating from several nodes are transferred through the multi-point
transmission channel.
Main task is to minimize collisions in order to utilize the bandwidth by:
Determining when a station can use the link (medium)
what a station should do when the link is busy
what the station should do when it is involved in collision
CSMA (all previous methods) has an inefficiency:
If a collision has occurred, the channel is unstable until colliding
packets have been fully transmitted
CSMA/CD (Carrier Sense Multiple Access with Collision
Detection) overcomes this as follows:
While transmitting, the sender is listening to medium for collisions.
Sender stops transmission if collision has occurred reducing channel
wastage .
CSMA/CD is Widely used for bus topology LANs (IEEE 802.3, Ethernet).
Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a
network protocol for carrier transmission that operates in the Medium
Access Control (MAC) layer.
It senses or listens whether the shared channel for transmission is busy or
not, and defers transmissions until the channel is free.
IP Address Assignment
IP address is logical address
It is a network layer address(layer 3)
Two versions of IP:
IP version 4 is 32 bit
IP version 6 is 128 bit.
bit is represented by 0 or 1.
IP address in binary form (32 bits):

32 bits are divided into 4 octets:

IP address in decimal form:


Taking example of first octet:
Total 8 bits values will 0's and 1's
2^8 = 256 combinations
IP addresses are classified into 5 classes

CLASS A
CLASS B Used in Lan and
WAN
CLASS C

CLASS D reserved for multicasting


CLASS E reserved for research and development
Priority Bit
To Identify the Range of each class a bit Called Priority bit is used.
Priority bit is the left most bit in the first octet.

Class A Priority bit is 0


Class B Priority bit is 10
Class C Priority bit is 110
Class D Priority bit is 1110
Class E Priority bit is 1111
Class A
In Class A: First bit of the first octet is reserved as a priority bit, and the bit
value is zero.
0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
Class B
In Class B: First 2 bits of the first octet is reserved as a priority bit, and the
bit value is 10.
10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
Class C
In Class C: First 3 bits of the first octet is reserved as a priority bit, and the
bit value is 110.
110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
Class D
In Class D: First 4 bits of the first octet is reserved as a priority bit, and the
bit value is 1110.
1110xxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
Class E
In Class E: First 4 bits of the first octet is reserved as a priority bit, and the
bit value is 1111.
1111xxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
Network and Hosts

IP address is divided into network and hosts portion


Class A - N.H.H.H
Class B - N.N.H.H
Class C - N.N.N.H
Network Address
IP addresses with all bits as zero in host portion

Broadcast Address
IP addresses with all bits as ones in host portion

Valid IP addresses lie between network address and broadcast address


Only valid IP addresses are assigned to hosts/clients.
Class A : N.H.H.H
Network Address
0xxxxxxx.00000000.00000000.00000000
Broadcast Address
0xxxxxxx.11111111.11111111.11111111
Class B : N.N.H.H
Network Address
10xxxxxx.xxxxxxxx.00000000.00000000
Broadcast Address
10xxxxxx.xxxxxxxx.11111111.11111111
Class C : N.N.N.H
Network Address
110xxxxx.xxxxxxxx.xxxxxxxx.00000000
Broadcast Address
110xxxxx.xxxxxxxx.xxxxxxxx.11111111
There are certain addresses in each class of IP address that are reserved
for Private networks. These addresses are called private addresses.
These addresses are not routable or valid on Internet.
A subnet mask is a 32-bit number created by setting the host bits to all 0s
and setting network bits to all 1s.
In this way, the subnet mask is separated the IP address into the host
address and network address.
The broadcast address is always assigned to the "255" address, and a
network address is always assigned to the "0" address.
Since the subnet mask is reserved for a special purpose, it cannot be
assigned to the host.
Subnet Mask differentiates Network and Host portion.
Represented with all 1's in the network portion and with all 0's in host
portion.
Why do we need Subnetting?
1. Subnetting helps in organizing the network in an efficient way which helps
in expanding the technology for large firms and companies.
2. Subnetting is used for specific staffing structures to reduce traffic and
maintain order and efficiency.
3. Subnetting divides domains of the broadcast so that traffic is routed
efficiently, which helps in improving network performance.
4. Subnetting is used in increasing network security.
Class A = N.H.H.H = 255.0.0.0
Class B = N.N.H.H = 255.255.0.0
Class C = N.N.N.H = 255.255.255.0
1-bit masking 24 bits 8 bits
lets say we have an IP address - 192.168.1 . 00000000

left most bit will be altered into a bit value 1 and added to 192.168.1.
then it will become
the 1 you have moved is 2^7th bit so
25 bits 7 bits 2^7 = 128 this value is called block
192.168.1.1 0000000 size
formation of subnets

192.168.1.0+
128
192.168.1.128+ valid
128
192.168.1.256 invalid
then we get the customized subnet ID's
1st network id - 192.168.1.0 - 192.168.1.127
2nd network id - 192.168.1.128 - 192.168.1.255

default subnet ID for class C - 255.255.255.0


customized subnet id for class C - 255.255.255.128

valid IPs => 192.168.1.1 - 192.168.1.126


192.168.1.129 - 192.168.1.254
2-bit masking 24 bits 8 bits
lets say we have an IP address - 192.168.1 . 00000000

2 left most bits will be altered into a bit value 1 and added to 192.168.1.
then it will become
formation of subnets
26 bits 6 bits
192.168.1.0+ valid
192.168.1.11 000000
64
192.168.1.64+ valid
the 1 you have moved is 2^7th and 64
2^6th bit so 2^7 = 128 and 2^6 = 64 192.168.1.128+ valid
then the block size will be 128+64 = 64
192 192.168.1.192+ valid
64
192.168.1.256 invalid
then we get the customized subnet ID's
1st network id - 192.168.1.0 - 192.168.1.63
2nd network id - 192.168.1.64 - 192.168.1.127
3rd network id - 192.168.1.128 - 192.168.1.191
4th network id - 192.168.1.192 - 192.168.1.255
default subnet ID for class C - 255.255.255.0
customized subnet id for class C - 255.255.255.192

valid IPs => 192.168.1.1 - 192.168.1.62


192.168.1.165 - 192.168.1.126
192.168.1.129 - 192.168.1.190
192.168.1.193 - 192.168.1.254
Shortest Path Algorithm
Dijkstras Algorithm -
visit this link> https://www.youtube.com/watch?v=bZkzH5x0SKU
Congestion Control Algorithm
Congestion:
Too many packets present in the network causes packet delay and loss
that degrades performance. This situation is called congestion.
The network and transport layer share the responsibility for handling
congestion.
Since congestion occurs within the network, it is the network layer that
directly experiences it and must ultimately determine what to do with the
excess packets.
However the most efficient way to control congestion is to reduce the
load that the transport layer is placing on the network. This requires the
network and transport layers to work together.
The best way to handle both problems(flow control & Congestion Control) is to
get the host to slow down.
Thus, a host can get a ‘‘slow down’’ message either because the receiver
cannot handle the load or because the network cannot handle it.
Several techniques can be employed. These include:
1. Warning bit
2. Choke packets
3. Load shedding
4. Random early discard
5. Traffic shaping
The first 3 deal with congestion detection and recovery. The last 2 deal with
congestion avoidance
Traffic Shapping
Another method to control congestion is to shape the traffic before it
enters the network.
controls the rate at which packets are sent .
At the connection setup time, sender and carrier negotiate a traffic
pattern (shape).

Two Shapping Algorithms


Leaky Bucket
Token Bucket
Leaky Bucket
The Leaky Bucket Algorithm is used to control rate in the network.
It is implemented as a single server queue with constant service time.
If the bucket (buffer) overflows then the packets are discarded.
The leaky bucket enforces a constant output rate (average rate) regardless of the
burstiness of the input. Does nothing when input is idle.
The host injects one packet per clock tick onto the network. This results in a
uniform flow of packets, smoothing out bursts and reducing congestion.
When packets are the same size (as in ATM cells), the one packet per tick is okay.
For variable length packets though, it is better to allow a fixed number of bytes
per tick. E.g.
1024 bytes per tick will allow one 1024-byte packet or two 512-byte packets or
four 256-byte packets on 1 tick
Leaky bucket implementation
Token Bucket Algorithm
The leaky bucket algorithm has a rigid output design at an average rate
independent of the bursty traffic.
In some applications, when large bursts arrive, the output is allowed to speed
up. This calls for a more flexible algorithm, preferably one that never loses
information. Therefore, a token bucket algorithm finds its uses in network
traffic shaping or rate-limiting.
It is a control algorithm that indicates when traffic should be sent. This order
comes based on the display of tokens in the bucket.
The bucket contains tokens. Each of the tokens defines a packet of
predetermined size. Tokens in the bucket are deleted for the ability to share a
packet.
When tokens are shown, a flow to transmit traffic appears in the display of
tokens.
No token means no flow sends its packets. Hence, a flow transfers traffic up to
its peak burst rate in good tokens in the bucket.
Token Bucket Implementation
Difference between Leaky and Token buckets
Leaky Bucket Token Bucket

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

Bucket leaks at constant rate Bucket has maximum capacity.

If there is a ready packet , a token is


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

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


outputs at finite rate the packet cannot be sent.
TCP Connection Management
TCP is a connection oriented protocol
Process can run on any type of devices in the network.
Connection establishment helps:
Exchange and initiate the state variables.
MSS (maximum segment size) size, initial sequence numbers, ACK
type.
Allocate resources (buffer)
Problem
Solution - TCP three way handshake
Active: the client is responsible for the active opening of a TCP
connection. It means that the client must pro-actively send a connection
request (SYN) to an already known server (IP and port) using the connect
operation
Passive: the server is in charge of the passive opening of TCP connections.
Thus, the server waits for requests (SYN) from the client using the accept
operation. To actually accept a connection, the server must respond in
previously defined IP and port (bind) and have slots to hold new
connections (listen)
Step 1: In the first step, the client establishes a connection with a server. It
sends a segment with SYN and informs the server about the client should
start communication, and with what should be its sequence number.

Step 2: In this step server responds to the client request with SYN-ACK signal
set. ACK helps you to signify the response of segment that is received and
SYN signifies what sequence number it should able to start with the
segments.

Step 3: In this final step, the client acknowledges the response of the Server,
and they both create a stable connection will begin the actual data transfer
process.
Case 1
Case 2
What is Protocol?
A network protocol is an established set of rules that determine how data
is transmitted between different devices in the same network.
We have seen that the client and server carry on a machine-to-machine
conversation​
A network protocol is the set of rules governing a conversation between a
client and a server​
There are many protocols, HTTP is just one​
HTTP vs HTML

HTML - Hypertext markup language


Definitions of tags that are added to the Web documents to control their
appearance.

HTTP - Hypertext transfer protocol


The rules governing the conversation between a Web client and a Web server.

Both were invented by the same person at the same time.


HTTP is an application layer protocol​

The Web client and the Web server are application programs​
Application layer programs do useful work like retrieving Web
pages, sending and receiving email or transferring files​
Lower layers take care of the communication details​
The client and server send messages and data without
knowing anything about the communication network​
Many application layer protocols are used on the
Internet, HTTP is only one​
SMTP - POP3 - IMAP
SMTP (Simple Mail Transfer Protocol) is a TCP/IP protocol used in sending
and receiving email. SMTP is used most commonly by email clients,
including Gmail, Outlook, Apple Mail and Yahoo Mail. SMTP can send and
receive email, but email clients typically use a program with SMTP for
sending email.
POP3 (Post Office Protocol)
POP3 is an older protocol that was originally designed to be used on
only one computer. Unlike modern protocols that use two-way
synchronization, POP3 only supports one-way email synchronization,
only allowing users to download emails from a server to a client.
IMAP stands for Internet Message Access Protocol. It is an application
layer protocol which is used to receive the emails from the mail server. It
is the most commonly used protocols like POP3 for retrieving the emails.
The basic difference between SMTP and POP3 is that SMTP is a message
transfer agent used to send the message and POP3 is a message access agent
used to receive the message.​
The SMTP is a protocol that defines the working of Message Transfer Agent. It
is used to send the mail from the sender’s computer to the receiver’s mail
server. POP is a pull protocol that is required to pull mail from receiver’s mail
server to receiver’s computer. It also let user organize the mails.​
sender side
SMTP protocol is used in the scenario where both the sender and receiver of
mail must be connected to their mail server by WAN or LAN. SMTP protocol is
used two times, first between sender and its mail server and second between
client’s mail server and receivers mail server. SMTP is not used between
receiver’s mail server and receiver; the POP protocol accomplishes this task.​

receiver side
To access mail from the mail box present at the mail server the client MAA at
recipient computer establishes the connection with the mail server using TCP
port 110. For establishing connection client MAA at recipient’s computer
sends username and password to the mailbox. Then the user is authenticated
to retrieve mail messages one by one.​
SMTP vs POP3
BASIS FOR COMPARISON​ SMTP​ POP3​

Basic​ It is message transfer agent.​ It is message access agent.​

Full form​ Simple Mail Transfer Protocol.​ Post Office Protocol version 3.​

Between sender and sender mail


Between receiver and receiver
Implied​ server and between sender mail server
mail server.​
and receiver mail server.​

It transfers the
It allows to retrieve and organize
mail from senders computer to
work​ mails from mailbox on receiver mail
the mail box present on receiver's
server to receiver's computer.​
mail server.​
DNS​
What is DNS?​
DNS stands for Domain Name System (DNS) services. When we access a
website, we are using this service to locate the server where the domain's
website is located. When browsing the web, we usually type in a domain name
like www.google.com into our browser. This is better than trying to remember
an IP address linked to a Google server.​

Behind the scenes, a conversion happens using this service which converts
www.google.com to 172.217.12.46. The IP address designates the location of a
server on the Internet. This conversion process is called a query. This is an
integral part of how devices connect with each other to communicate over
the internet. To understand the query process, let’s review how this query
works.​
Iterative DNS Lookup

An iterative DNS query is a request for a


website name or URL. However, with this
query type, the domain name system
(DNS) server does not fetch the complete
answer for the query. Rather, it provides a
referral to other DNS servers that might
have the answer. Thus, if the queries
server does not have the IP address
requested, it forwards it to another DNS
server until the answer is found.
Recursive DNS Lookup
In a Recursive DNS Query, the DNS Client sends a Query to a DNS Server for
name resolution. The reply to the DNS Query can be an answer to the query or
an error message.
In Recursive DNS Query, If the DNS Server doesn't know the answer to
provide accurate answer to the DNS Client, DNS Server may query other DNS
Servers on behalf of the DNS Client.

You might also like