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

Computer Network

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

Computer Network

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

Computer Network

Definition
A computer network is a group of computers linked to each other that
enables the computer to communicate with another computer and share
their resources, data, and applications.

Goals of Computer Networks: The following are some important goals


of computer networks:

1. Resource Sharing –
Many organization has a substantial number of computers in
operations, which are located apart. Ex. A group of office workers
can share a common printer, fax, modem, scanner, etc.

2. High Reliability –
If there are alternate sources of supply, all files could be
replicated on two or more machines. If one of them is not
available, due to hardware failure, the other copies could be
used.

3. Inter-process Communication –
Network users, located geographically apart, may converse in an
interactive session through the network. In order to permit this,
the network must provide almost error-free communications.

4. Flexible access –
Files can be accessed from any computer in the network. The
project can be begun on one computer and finished on another.

Other goals include Distribution of processing functions,


Centralized management, and allocation of network resources,
Compatibility of dissimilar equipment and software, Good
network performance, Scalability, Saving money, Access to
remote information, Person to person communication, etc.

Components of Computer Network


Computer network components are the major parts which are needed
to install the software. Some important network components
are NIC, switch, cable, hub, router, and modem. Depending on the
type of network that we need to install, some network components can
also be removed. For example, the wireless network does not require a
cable.
Following are the major components required to install a network:
NIC

 NIC stands for network interface card.


 NIC is a hardware component used to connect a computer with
another computer onto a network
 It can support a transfer rate of 10,100 to 1000 Mb/s.
 The MAC address or physical address is encoded on the network
card chip which is assigned by the IEEE to identify a network card
uniquely. The MAC address is stored in the PROM (Programmable
read-only memory).

There are two types of NIC:

1. Wired NIC
2. Wireless NIC

Wired NIC: The Wired NIC is present inside the motherboard. Cables and
connectors are used with wired NIC to transfer data.
Wireless NIC: The wireless NIC contains the antenna to obtain the
connection over the wireless network. For example, laptop computer
contains the wireless NIC.

Hub
A Hub is a hardware device that divides the network connection among
multiple devices. When computer requests for some information from a
network, it first sends the request to the Hub through cable. Hub will
broadcast this request to the entire network. All the devices will check
whether the request belongs to them or not. If not, the request will be
dropped.
The process used by the Hub consumes more bandwidth and limits the
amount of communication. Nowadays, the use of hub is obsolete, and it is
replaced by more advanced computer network components such as
Switches, Routers.
Switch
A switch is a hardware device that connects multiple devices on a
computer network. A Switch contains more advanced features than Hub.
The Switch contains the updated table that decides where the data is
transmitted or not. Switch delivers the message to the correct destination
based on the physical address present in the incoming message. A Switch
does not broadcast the message to the entire network like the Hub. It
determines the device to whom the message is to be transmitted.
Therefore, we can say that switch provides a direct connection between
the source and destination. It increases the speed of the network.

Router

 A router is a hardware device which is used to connect a LAN


with an internet connection. It is used to receive, analyze and
forward the incoming packets to another network.
 A router works in a Layer 3 (Network layer) of the OSI
Reference model.
 A router forwards the packet based on the information available
in the routing table.
 It determines the best path from the available paths for the
transmission of the packet.

Advantages Of Router:
 Security: The information which is transmitted to the network
will traverse the entire cable, but the only specified device which
has been addressed can read the data.
 Reliability: If the server has stopped functioning, the network
goes down, but no other networks are affected that are served
by the router.
 Performance: Router enhances the overall performance of the
network. Suppose there are 24 workstations in a network
generates a same amount of traffic. This increases the traffic
load on the network. Router splits the single network into two
networks of 12 workstations each, reduces the traffic load by
half.
 Network range

Modem

 A modem is a hardware device that allows the computer to


connect to the internet over the existing telephone line.
 A modem is not integrated with the motherboard rather than it is
installed on the PCI slot found on the motherboard.
 It stands for Modulator/Demodulator. It converts the digital data
into an analog signal over the telephone lines.

Based on the differences in speed and transmission rate, a modem can be


classified in the following categories:

 Standard PC modem or Dial-up modem


 Cellular Modem
 Cable modem

Cables and Connectors


Cable is a transmission media used for transmitting a signal.
There are three types of cables used in transmission:

 Twisted pair cable


 Coaxial cable
 Fibre-optic cable

Computer Network Architecture


Computer Network Architecture is defined as the physical and logical
design of the software, hardware, protocols, and media of the
transmission of data. Simply we can say that how computers are
organized and how tasks are allocated to the computer.
The two types of network architectures are used:

 Peer-To-Peer network
 Client/Server network

Peer-To-Peer network

 Peer-To-Peer network is a network in which all the computers are


linked together with equal privilege and responsibilities for
processing the data.
 Peer-To-Peer network is useful for small environments, usually up
to 10 computers.
 Peer-To-Peer network has no dedicated server.
 Special permissions are assigned to each computer for sharing
the resources, but this can lead to a problem if the computer
with the resource is down.
Advantages Of Peer-To-Peer Network:

 It is less costly as it does not contain any dedicated server.


 If one computer stops working but, other computers will not stop
working.
 It is easy to set up and maintain as each computer manages
itself.

Disadvantages Of Peer-To-Peer Network:

 In the case of Peer-To-Peer network, it does not contain the


centralized system . Therefore, it cannot back up the data as the
data is different in different locations.
 It has a security issue as the device is managed itself.

Client/Server Network

 Client/Server network is a network model designed for the end


users called clients, to access the resources such as songs,
video, etc. from a central computer known as Server.
 The central controller is known as a server while all other
computers in the network are called clients.
 A server performs all the major operations such as security and
network management.
 A server is responsible for managing all the resources such as
files, directories, printer, etc.
 All the clients communicate with each other through a server. For
example, if client1 wants to send some data to client 2, then it
first sends the request to the server for the permission. The
server sends the response to the client 1 to initiate its
communication with the client 2.
Advantages Of Client/Server network:

 A Client/Server network contains the centralized system.


Therefore we can back up the data easily.
 A Client/Server network has a dedicated server that improves the
overall performance of the whole system.
 Security is better in Client/Server network as a single server
administers the shared resources.
 It also increases the speed of the sharing resources.

Disadvantages Of Client/Server network:

 Client/Server network is expensive as it requires the server with


large memory.
 A server has a Network Operating System(NOS) to provide the
resources to the clients, but the cost of NOS is very high.
 It requires a dedicated network administrator to manage all the
resources.

Computer Network Types


A computer network is a group of computers linked to each other that
enables the computer to communicate with another computer and share
their resources, data, and applications.
A computer network can be categorized by their size. A computer
network is mainly of four types:
 LAN(Local Area Network)
 PAN(Personal Area Network)
 MAN(Metropolitan Area Network)
 WAN(Wide Area Network)

LAN(Local Area Network)

 Local Area Network is a group of computers connected to each


other in a small area such as building, office.
 LAN is used for connecting two or more personal computers
through a communication medium such as twisted pair, coaxial
cable, etc.
 It is less costly as it is built with inexpensive hardware such as
hubs, network adapters, and ethernet cables.
 The data is transferred at an extremely faster rate in Local Area
Network.
 Local Area Network provides higher security.
PAN(Personal Area Network)

 Personal Area Network is a network arranged within an individual


person, typically within a range of 10 meters.
 Personal Area Network is used for connecting the computer
devices of personal use is known as Personal Area Network.
 Thomas Zimmerman was the first research scientist to bring
the idea of the Personal Area Network.
 Personal Area Network covers an area of 30 feet.
 Personal computer devices that are used to develop the personal
area network are the laptop, mobile phones, media player and
play stations.

There are two types of Personal Area Network:

 Wired Personal Area Network


 Wireless Personal Area Network
Wireless Personal Area Network: Wireless Personal Area Network is
developed by simply using wireless technologies such as WiFi, Bluetooth.
It is a low range network.
Wired Personal Area Network: Wired Personal Area Network is created
by using the USB.

Examples Of Personal Area Network:

 Body Area Network: Body Area Network is a network that


moves with a person. For example, a mobile network moves
with a person. Suppose a person establishes a network
connection and then creates a connection with another device to
share the information.
 Offline Network: An offline network can be created inside the
home, so it is also known as a home network. A home network
is designed to integrate the devices such as printers, computer,
television but they are not connected to the internet.
 Small Home Office: It is used to connect a variety of devices to
the internet and to a corporate network using a VPN

MAN(Metropolitan Area Network)

 A metropolitan area network is a network that covers a larger


geographic area by interconnecting a different LAN to form a
larger network.
 Government agencies use MAN to connect to the citizens and
private industries.
 In MAN, various LANs are connected to each other through a
telephone exchange line.
 The most widely used protocols in MAN are RS-232, Frame Relay,
ATM, ISDN, OC-3, ADSL, etc.
 It has a higher range than Local Area Network(LAN).
Uses Of Metropolitan Area Network:

 MAN is used in communication between the banks in a city.


 It can be used in an Airline Reservation.
 It can be used in a college within a city.
 It can also be used for communication in the military.

WAN(Wide Area Network)

 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 bigger network than the LAN.
 A Wide Area Network is not limited to a single location, but it
spans over a large geographical area through a telephone line,
fibre optic cable or satellite links.
 The internet is one of the biggest WAN in the world.
 A Wide Area Network is widely used in the field of Business,
government, and education.
Examples Of Wide Area Network:

 Mobile Broadband: A 4G network is widely used across a


region or country.
 Last mile: A telecom company is used to provide the internet
services to the customers in hundreds of cities by connecting
their home with fiber.
 Private network: A bank provides a private network that
connects the 44 offices. This network is made by using the
telephone leased line provided by the telecom company.

Advantages Of Wide Area Network:


Following are the advantages of the Wide Area Network:

 Geographical area: A Wide Area Network provides a large


geographical area. Suppose if the branch of our office is in a
different city then we can connect with them through WAN. The
internet provides a leased line through which we can connect
with another branch.
 Centralized data: In case of WAN network, data is centralized.
Therefore, we do not need to buy the emails, files or back up
servers.
 Get updated files: Software companies work on the live server.
Therefore, the programmers get the updated files within
seconds.
 Exchange messages: In a WAN network, messages are
transmitted fast. The web application like Facebook, Whatsapp,
Skype allows you to communicate with friends.
 Sharing of software and resources: In WAN network, we can
share the software and other resources like a hard drive, RAM.
 Global business: We can do the business over the internet
globally.
 High bandwidth: If we use the leased lines for our company
then this gives the high bandwidth. The high bandwidth
increases the data transfer rate which in turn increases the
productivity of our company.

Disadvantages of Wide Area Network:


The following are the disadvantages of the Wide Area Network:

 Security issue: A WAN network has more security issues as


compared to LAN and MAN network as all the technologies are
combined together that creates the security problem.
 Needs Firewall & antivirus software: The data is transferred
on the internet which can be changed or hacked by the hackers,
so the firewall needs to be used. Some people can inject the
virus in our system so antivirus is needed to protect from such a
virus.
 High Setup cost: An installation cost of the WAN network is
high as it involves the purchasing of routers, switches.
 Troubleshooting problems: It covers a large area so fixing the
problem is difficult.

The following are the design issues for the layers:


1. Reliability: It is a design issue of making a network that
operates correctly even when it is made up of unreliable
components.
2. Addressing: There are multiple processes running on one
machine. Every layer needs a mechanism to identify senders and
receivers.
3. Error Control: It is an important issue because physical
communication circuits are not perfect. Many error detecting and
error correcting codes are available. Both sending and receiving
ends must agree to use any one code.
4. Flow Control: If there is a fast sender at one end sending data
to a slow receiver, then there must be flow control mechanism to
control the loss of data by slow receivers. There are several
mechanisms used for flow control such as increasing buffer size
at receivers, slow down the fast sender, and so on. Some process
will not be in position to accept arbitrarily long messages. This
property leads to mechanisms for disassembling, transmitting
and the reassembling messages.
5. Multiplexing and De-multiplexing: If the data has to be
transmitted on transmission media separately, it is inconvenient
or expensive to setup separate connection for each pair of
communicating processes. So, multiplexing is needed in the
physical layer at sender end and de-multiplexing is need at the
receiver end.
6. Scalability: When network gets large, new problem arises. Thus
scalability is important so that network can continue to work well
when it gets large.
7. Routing: When there are multiple paths between source and
destination, only one route must be chosen. This decision is
made on the basis of several routing algorithms, which chooses
optimized route to the destination.
8. Confidentiality and Integrity: Network security is the most
important factor. Mechanisms that provide confidentiality defend
against threats like eavesdropping. Mechanisms for integrity
prevent faulty changes to messages.

Connection Oriented &


Connection-less Services
Both Connection-oriented service and Connection-less service are used for
the connection establishment between two or more than two devices.
These type of services are offered by network layer.
Connection-oriented service is related to the telephone system. It
includes the connection establishment and connection termination. In
connection-oriented service, Handshake method is used to establish the
connection between sender and receiver.

Connection-less service is related to the postal system. It does not


include any connection establishment and connection termination.
Connection-less Service does not give the guarantee of reliability. In this,
Packets do not follow same path to reach destination.
Difference between Connection-oriented and Connection-less
Services:
S.N
Connection-oriented Service Connection-less Service
O

Connection-oriented service is related Connection-less service is related


1.
to the telephone system. to the postal system.

Connection-oriented service is Connection-less Service is


2. preferred by long and steady preferred by bursty
communication. communication.

Connection-oriented Service is Connection-less Service is not


3.
necessary. compulsory.

Connection-less Service is not


4. Connection-oriented Service is feasible.
feasible.

In connection-oriented Service, In connection-less Service,


5.
Congestion is not possible. Congestion is possible.

Connection-oriented Service gives the Connection-less Service does not


6.
guarantee of reliability. give the guarantee of reliability.

In connection-oriented Service, Packets In connection-less Service, Packets


7.
follow the same route. do not follow the same route.

Connection-oriented Services requires Connection-less Service requires a


8.
a bandwidth of high range. bandwidth of low range.
ISO-OSI Reference Model
OSI Model

 OSI stands for Open System Interconnection is a reference


model that describes how information from
a software application in one computer moves through a physical
medium to the software application in another computer.
 OSI consists of seven layers, and each layer performs a particular
network function.
 OSI model was developed by the International Organization for
Standardization (ISO) in 1984, and it is now considered as an
architectural model for the inter-computer communications.
 OSI model divides the whole task into seven smaller and
manageable tasks. Each layer is assigned a particular task.
 Each layer is self-contained, so that task assigned to each layer
can be performed independently.

Characteristics of OSI Model:

 The OSI model is divided into two layers: upper layers and lower
layers.
 The upper layer of the OSI model mainly deals with the
application related issues, and they are implemented only in the
software. The application layer is closest to the end user. Both
the end user and the application layer interact with the software
applications. An upper layer refers to the layer just above
another layer.
 The lower layer of the OSI model deals with the data transport
issues. The data link layer and the physical layer are
implemented in hardware and software. The physical layer is the
lowest layer of the OSI model and is closest to the physical
medium. The physical layer is mainly responsible for placing the
information on the physical medium.

Principles of OSI Reference Model :


 A layer should be created where a different abstraction is
needed.
 Each layer should perform a well-defined function.
 The function of each layer should be chosen with an eye toward
defining internationally standardized protocols.
 The layer boundaries should be chosen to minimize the
information flow across the interfaces.
 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 architecture does not become
unwieldy.

Model
Physical layer

 The main functionality of the physical layer is to transmit the


individual bits from one node to another node.
 It is the lowest layer of the OSI model.
 It establishes, maintains and deactivates the physical
connection.
 It specifies the mechanical, electrical and procedural network
interface specifications.

Functions of a Physical layer:

 Line Configuration: It defines the way how two or more devices


can be connected physically.
 Data Transmission: It defines the transmission mode whether
it is simplex, half-duplex or full-duplex mode between the two
devices on the network.
 Topology: It defines the way how network devices are arranged.
 Signals: It determines the type of the signal used for
transmitting the information.

Data-Link Layer

 This layer is responsible for the error-free transfer of data


frames.
 It defines the format of the data on the network.
 It provides a reliable and efficient communication between two or
more devices.
 It is mainly responsible for the unique identification of each
device that resides on a local network.
 It contains two sub-layers:
o Logical Link Control Layer
 It is responsible for transferring the packets to
the Network layer of the receiver that is
receiving.
 It identifies the address of the network layer
protocol from the header.
 It also provides flow control.
o Media Access Control Layer
 A Media access control layer is a link between
the Logical Link Control layer and the
network's physical layer.
 It is used for transferring the packets over the
network.

Functions of the Data-link layer

 Framing: The data link layer translates the physical's raw bit
stream into packets known as Frames. The Data link layer adds
the header and trailer to the frame. The header which is added to
the frame contains the hardware destination and source address.
 Physical Addressing: The Data link layer adds a header to the
frame that contains a destination address. The frame is
transmitted to the destination address mentioned in the header.
 Flow Control: Flow control is the main functionality of the Data-
link layer. It is the technique through which the constant data
rate is maintained on both the sides so that no data get
corrupted. It ensures that the transmitting station such as a
server with higher processing speed does not exceed the
receiving station, with lower processing speed.
 Error Control: Error control is achieved by adding a calculated
value CRC (Cyclic Redundancy Check) that is placed to the Data
link layer's trailer which is added to the message frame before it
is sent to the physical layer. If any error seems to occurr, then
the receiver sends the acknowledgment for the retransmission of
the corrupted frames.
 Access Control: When two or more devices are connected to
the same communication channel, then the data link layer
protocols are used to determine which device has control over
the link at a given time.

Network Layer

 It is a layer 3 that manages device addressing, tracks the


location of devices on the network.
 It determines the best path to move data from source to the
destination based on the network conditions, the priority of
service, and other factors.
 The Data link layer is responsible for routing and forwarding the
packets.
 Routers are the layer 3 devices, they are specified in this layer
and used to provide the routing services within an internetwork.
 The protocols used to route the network traffic are known as
Network layer protocols. Examples of protocols are IP and Ipv6.

Functions of Network Layer:

 Internetworking: An internetworking is the main responsibility


of the network layer. It provides a logical connection between
different devices.
 Addressing: A Network layer adds the source and destination
address to the header of the frame. Addressing is used to
identify the device on the internet.
 Routing: Routing is the major component of the network layer,
and it determines the best optimal path out of the multiple paths
from source to the destination.
 Packetizing: A Network Layer receives the packets from the
upper layer and converts them into packets. This process is
known as Packetizing. It is achieved by internet protocol (IP).

Transport Layer

 The Transport layer is a Layer 4 ensures that messages are


transmitted in the order in which they are sent and there is no
duplication of data.
 The main responsibility of the transport layer is to transfer the
data completely.
 It receives the data from the upper layer and converts them into
smaller units known as segments.
 This layer can be termed as an end-to-end layer as it provides a
point-to-point connection between source and destination to
deliver the data reliably.

The two protocols used in this layer are:

 Transmission Control Protocol


o It is a standard protocol that allows the systems to
communicate over the internet.
o It establishes and maintains a connection between
hosts.
o When data is sent over the TCP connection, then the
TCP protocol divides the data into smaller units known
as segments. Each segment travels over the internet
using multiple routes, and they arrive in different orders
at the destination. The transmission control protocol
reorders the packets in the correct order at the
receiving end.
 User Datagram Protocol
o User Datagram Protocol is a transport layer protocol.
o It is an unreliable transport protocol as in this case
receiver does not send any acknowledgment when the
packet is received, the sender does not wait for any
acknowledgment. Therefore, this makes a protocol
unreliable.

Functions of Transport Layer:

 Service-point addressing: Computers run several programs


simultaneously due to this reason, the transmission of data from
source to the destination not only from one computer to another
computer but also from one process to another process. The
transport layer adds the header that contains the address known
as a service-point address or port address. The responsibility of
the network layer is to transmit the data from one computer to
another computer and 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.
When the message has arrived at the destination, then the
transport layer reassembles the message based on their
sequence numbers.
 Connection control: 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. In connection-oriented service, all the
packets travel in the single route.
 Flow control: The transport layer also responsible for flow
control but it is performed end-to-end rather than across a single
link.
 Error control: The transport layer is also responsible for Error
control. Error control is performed end-to-end rather than across
the single link. The sender transport layer ensures that message
reach at the destination without any error.

Session Layer

 It is a layer 3 in the OSI model.


 The Session layer is used to establish, maintain and synchronizes
the interaction between communicating devices.

Functions of Session layer:

 Dialog control: Session layer acts as a dialog controller that


creates a dialog between two processes or we can say that it
allows the communication between two processes which can be
either half-duplex or full-duplex.
 Synchronization: Session layer adds some checkpoints when
transmitting the data in a sequence. If some error occurs in the
middle of the transmission of data, then the transmission will
take place again from the checkpoint. This process is known as
Synchronization and recovery.
Presentation Layer

 A Presentation layer is mainly concerned with the syntax and


semantics of the information exchanged between the two
systems.
 It acts as a data translator for a network.
 This layer is a part of the operating system that converts the
data from one presentation format to another format.
 The Presentation layer is also known as the syntax layer.

Functions of Presentation layer:

 Translation: The processes in two systems exchange the


information in the form of character strings, numbers and so on.
Different computers use different encoding methods, 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.
 Encryption: Encryption is needed to maintain privacy.
Encryption is a process of converting the sender-transmitted
information into another form and sends the resulting message
over the network.
 Compression: Data compression is a process of compressing
the data, i.e., it reduces the number of bits to be transmitted.
Data compression is very important in multimedia such as text,
audio, video.

Application Layer

 An application layer serves as a window for users and application


processes to access network service.
 It handles issues such as network transparency, resource
allocation, etc.
 An application layer is not an application, but it performs the
application layer functions.
 This layer provides the network services to the end-users.

Functions of Application layer:

 File transfer, access, and management (FTAM): An


application layer allows a user to access the files in a remote
computer, to retrieve the files from a computer and to manage
the files in a remote computer.
 Mail services: An application layer provides the facility for email
forwarding and storage.
 Directory services: An application provides the distributed
database sources and is used to provide that global information
about various objects.

Comparison of TCP/IP and OSI


Model
The TCP model stands for Transmission Control Protocol, whereas IP
stands for Internet Protocol. A number of protocols that make the
internet possibly comes under the TCP/IP model. Nowadays, we do not
hear the name of the TCP/IP model much, we generally hear the name of
the IPv4 or IPv6, but it is still valid. This model consists of 4 layers. Now,
we will look at the diagrammatic representation of the TCP/IP model.

As shown in the above diagram, the TCP/IP model has 4 layers, while the
OSI model consists of 7 layers. Diagrammatically, it looks that the 4 layers
of the TCP/IP model exactly fit the 7 layers of the OSI model, but this is not
reality. The application layer of the TCP/IP model maps to the first three
layers, i.e., application, session, and presentation layer of the OSI model.
The transport layer of the TCP maps directly to the transport layer of the
OSI model. The internet layer of the TCP/IP model maps directly to the
network layer of the OSI model. The last two layers of the OSI model map
to the network layer of the TCP/IP model. TCP/IP is the most widely used
model as compared to the OSI model for providing communication
between computers over the internet.

Similarities between the OSI and TCP/IP model


The following are the similarities between the OSI and TCP/IP model:

 Share common architecture

Both the models are the logical models and having similar architectures
as both the models are constructed with the layers.

 Define standards

Both the layers have defined standards, and they also provide the
framework used for implementing the standards and devices.

 Simplified troubleshooting process

Both models have simplified the troubleshooting process by breaking the


complex function into simpler components.

 Pre-defined standards

The standards and protocols which are already pre-defined; these models
do not redefine them; they just reference or use them. For example, the
Ethernet standards were already defined by the IEEE before the
development of these models; instead of recreating them, models have
used these pre-defined standards.

 Both have similar functionality of 'transport' and


'network' layers

The function which is performed between the 'presentation' and


the 'network' layer is similar to the function performed at
the transport layer.

Differences between the OSI and TCP/IP model


Let's see the differences between the OSI and TCP/IP model in a
tabular form:

OSI Model TCP/IP Model


It stands for Open System It stands for Transmission
Interconnection. Control Protocol.
It was developed by ARPANET
OSI model has been developed by ISO
(Advanced Research Project
(International Standard Organization).
Agency Network).
It consists of standard protocols
It is an independent standard and
that lead to the development of
generic protocol used as a
an internet. It is a communication
communication gateway between the
protocol that provides the
network and the end user.
connection among the hosts.
The transport layer does not
In the OSI model, the transport layer
provide the surety for the
provides a guarantee for the delivery
delivery of packets. But still, we
of the packets.
can say that it is a reliable model.
This model is based on a vertical This model is based on a
approach. horizontal approach.
In this model, the session and
In this model, the session and
presentation layer are not
presentation layers are separated,
different layers. Both layers are
i.e., both the layers are different.
included in the application layer.
It is also known as a reference model
through which various networks are
It is an implemented model of an
built. For example, the TCP/IP model is
OSI model.
built from the OSI model. It is also
referred to as a guidance tool.
In this model, the network layer
The network layer provides only
provides both connection-oriented and
connectionless service.
connectionless service.
Protocols in the OSI model are hidden
In this model, the protocol cannot
and can be easily replaced when the
be easily replaced.
technology changes.
It consists of 7 layers. It consists of 4 layers.
OSI model defines the services, In the TCP/IP model, services,
protocols, and interfaces as well as protocols, and interfaces are not
provides a proper distinction between properly separated. It is protocol
them. It is protocol independent. dependent.
The usage of this model is very low. This model is highly used.
It does not provide the
It provides standardization to the
standardization to the devices. It
devices like router, motherboard,
provides a connection between
switches, and other hardware devices.
various computers.

Data Link Layer: Need,


Services Provided
In the OSI (Open System Interconnections) Model, each layer uses the
services of the layer below it and provides services to the layer above it.
The primary function of the data link layer is to provide a well-defined
service interface to the network layer above it.

Virtual Communication versus Actual Communication


The main service provided is to transfer data packets from the network
layer on the sending machine to the network layer on the receiving
machine. Data link layer of the sending machine transmits accepts data
from the network layer and sends them to the data link layer of the
destination machine which hands them to the network layer there.
In actual communication, the data link layer transmits bits via the physical
layers and physical medium. However virtually, this can be visualized as
the two data link layers communicating with each other using a data link
protocol.
The processes are depicted in the following diagram −
Types of Services
The data link layer offers three types of services.
 Unacknowledged connectionless service − Here, 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.
 Acknowledged connectionless service − Here, 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.
 Acknowledged connection-oriented service − 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. The service
has three distinct phases −
o Set up of connection – A logical path is set up between
the source and the destination machines. Buffers and
counters are initialised to keep track of frames.
o Sending frames – The frames are transmitted.
o Release connection – The connection is released,
buffers and other resources are released.
It is appropriate for satellite communications and long-distance
telephone circuits.

Sliding Window Protocol


The sliding window is a technique for sending multiple frames at a time. It
controls the data packets between the two devices where reliable and
gradual delivery of data frames is needed. It is also used in TCP
(Transmission Control Protocol).

In this technique, each frame has sent from the sequence number. The
sequence numbers are used to find the missing data in the receiver end.
The purpose of the sliding window technique is to avoid duplicate data, so
it uses the sequence number.

Types of Sliding Window Protocol


Sliding window protocol has two types:

1. Go-Back-N ARQ
2. Selective Repeat ARQ

Go-Back-N ARQ
Go-Back-N ARQ protocol is also known as Go-Back-N Automatic Repeat
Request. It is a data link layer protocol that uses a sliding window method.
In this, if any frame is corrupted or lost, all subsequent frames have to be
sent again.

4.5M
How to Get Linux Kernel 5.0 in Ubuntu 18.04 LTS Right Now

The size of the sender window is N in this protocol. For example, Go-Back-
8, the size of the sender window, will be 8. The receiver window size is
always 1.

If the receiver receives a corrupted frame, it cancels it. The receiver does
not accept a corrupted frame. When the timer expires, the sender sends
the correct frame again. The design of the Go-Back-N ARQ protocol is
shown below.

The example of Go-Back-N ARQ is shown below in the figure.


Selective Repeat ARQ
Selective Repeat ARQ is also known as the Selective Repeat Automatic
Repeat Request. It is a data link layer protocol that uses a sliding window
method. The Go-back-N ARQ protocol works well if it has fewer errors. But
if there is a lot of error in the frame, lots of bandwidth loss in sending the
frames again. So, we use the Selective Repeat ARQ protocol. In this
protocol, the size of the sender window is always equal to the size of the
receiver window. The size of the sliding window is always greater than 1.

If the receiver receives a corrupt frame, it does not directly discard it. It
sends a negative acknowledgment to the sender. The sender sends that
frame again as soon as on the receiving negative acknowledgment. There
is no waiting for any time-out to send that frame. The design of the
Selective Repeat ARQ protocol is shown below.
The example of the Selective Repeat ARQ protocol is shown below in the
figure.
Difference between the Go-Back-N ARQ and Selective Repeat
ARQ?

Go-Back-N ARQ Selective Repeat ARQ

If a frame is corrupted or lost in it,all In this, only the frame is sent again, which
subsequent frames have to be sent corrupted or lost.
again.

If it has a high error rate,it wastes a There is a loss of low bandwidth.


lot of bandwidth.

It is less complex. It is more complex because it has to do sorti


and searching as well. And it also requires mo
storage.

It does not require sorting. In this, sorting is done to get the frames in t
correct order.

It does not require searching. The search operation is performed in it.

It is used more. It is used less because it is more complex.

Why Selective Repeat Protocol?


The go-back-n protocol works well if errors are less, but if the line is poor
it wastes a lot of bandwidth on retransmitted frames. An alternative
strategy, the selective repeat protocol, is to allow the receiver to accept
and buffer the frames following a damaged or lost one.
Selective Repeat attempts to retransmit only those packets that are
actually lost (due to errors) :

 Receiver must be able to accept packets out of order.


 Since receiver must release packets to higher layer in order, the
receiver must be able to buffer some packets.

ARP/RARP/GARP
Address Resolution Protocol (ARP) –
Address Resolution Protocol is a communication protocol used for
discovering physical address associated with given network address.
Typically, ARP is a network layer to data link layer mapping process, which
is used to discover MAC address for given Internet Protocol Address.
In order to send the data to destination, having IP address is necessary
but not sufficient; we also need the physical address of the destination
machine. ARP is used to get the physical address (MAC address) of
destination machine..

Before sending the IP packet, the MAC address of destination must be


known. If not so, then sender broadcasts the ARP-discovery packet
requesting the MAC address of intended destination. Since ARP-discovery
is broadcast, every host inside that network will get this message but the
packet will be discarded by everyone except that intended receiver host
whose IP is associated. Now, this receiver will send a unicast packet with
its MAC address (ARP-reply) to the sender of ARP-discovery packet. After
the original sender receives the ARP-reply, it updates ARP-cache and start
sending unicast message to the destination.
Reverse Address Resolution Protocol (RARP) –
Reverse ARP is a networking protocol used by a client machine in a local
area network to request its Internet Protocol address (IPv4) from the
gateway-router’s ARP table. The network administrator creates a table in
gateway-router, which is used to map the MAC address to corresponding
IP address.
When a new machine is setup or any machine which don’t have memory
to store IP address, needs an IP address for its own use. So the machine
sends a RARP broadcast packet which contains its own MAC address in
both sender and receiver hardware address field.

A special host configured inside the local area network, called as RARP-
server is responsible to reply for these kind of broadcast packets. Now the
RARP server attempt to find out the entry in IP to MAC address mapping
table. If any entry matches in table, RARP server send the response
packet to the requesting device along with IP address.

 LAN technologies like Ethernet, Ethernet II, Token Ring and Fiber
Distributed Data Interface (FDDI) support the Address Resolution
Protocol.
 RARP is not being used in today’s networks. Because we have
much great featured protocols like BOOTP (Bootstrap Protocol)
and DHCP( Dynamic Host Configuration Protocol).

Gratuitous ARP –
Gratuitous Address Resolution Protocol is used in advance network
scenarios. It is something performed by computer while booting up. When
the computer booted up (Network Interface Card is powered) for the first
time, it automatically broadcast its MAC address to the entire network.
After Gratuitous ARP MAC address of the computer is known to every
switch and allow DHCP servers to know where to send the IP address if
requested.
Gratuitous ARP could mean both Gratuitous ARP request and Gratuitous
ARP reply, but not needed is all cases. Gratuitous ARP request is a packet
where source and destination IP are both set to IP of the machine issuing
the packet and the destination MAC is the broadcast address ff:ff:ff:ff:ff:ff ;
no reply packet will occur.
Gratuitous ARP is ARP-Reply that was not prompted by an ARP-Request.
Gratuitous Address Resolution Protocol is useful to detect IP conflict.
Gratuitous ARP is also used to update ARP mapping table and Switch port
MAC address table.

Random Access Protocol: In this, all stations have same superiority


that is no station has more priority than another station. Any station can
send data depending on medium’s state( idle or busy). It has two features:

1. There is no fixed time for sending data


2. There is no fixed sequence of stations sending data

The Random access protocols are further subdivided as:


(a) ALOHA – It was designed for wireless LAN but is also applicable for
shared medium. In this, multiple stations can transmit data at the same
time and can hence lead to collision and data being garbled.

 Pure Aloha:
When a station sends data it waits for an acknowledgement. If
the acknowledgement doesn’t come within the allotted time then
the station waits for a random amount of time called back-off
time (Tb) and re-sends the data. Since different stations wait for
different amount of time, the probability of further collision
decreases.
 Vulnerable Time = 2* Frame transmission time
 Throughput = G exp{-2*G}

Maximum throughput = 0.184 for G=0.5

Slotted Aloha:
It is similar to pure aloha, except that we divide time into slots and
sending of data is allowed only at the beginning of these slots. If a station
misses out the allowed time, it must wait for the next slot. This reduces
the probability of collision.

Vulnerable Time = Frame transmission time

Throughput = G exp{-*G}

Maximum throughput = 0.368 for G=1

Multiple Access Control –


If there is a dedicated link between the sender and the receiver then data
link control layer is sufficient, however if there is no dedicated link present
then multiple stations can access the channel simultaneously. Hence
multiple access protocols are required to decrease collision and avoid
crosstalk. For example, in a classroom full of students, when a teacher
asks a question and all the students (or stations) start answering
simultaneously (send data at same time) then a lot of chaos is
created( data overlap or data lost) then it is the job of the teacher
(multiple access protocols) to manage the students and make them
answer one at a time.
Thus, protocols are required for sharing data on non dedicated channels.
Multiple access protocols can be subdivided further as –
CSMA
CSMA – Carrier Sense Multiple Access ensures fewer collisions as the
station is required to first sense the medium (for idle or busy) before
transmitting data. If it is idle then it sends data, otherwise it waits till the
channel becomes idle. However there is still chance of collision in CSMA
due to propagation delay. For example, if station A wants to send data, it
will first sense the medium.If it finds the channel idle, it will start sending
data. However, by the time the first bit of data is transmitted (delayed due
to propagation delay) from station A, if station B requests to send data
and senses the medium it will also find it idle and will also send data. This
will result in collision of data from station A and B.
CSMA access modes-

 1-persistent: The node senses the channel, if idle it sends the


data, otherwise it continuously keeps on checking the medium
for being idle and transmits unconditionally(with 1 probability) as
soon as the channel gets idle.
 Non-Persistent: The node senses the channel, if idle it sends
the data, otherwise it checks the medium after a random amount
of time (not continuously) and transmits when found idle.
 P-persistent: The node senses the medium, if idle it sends the
data with p probability. If the data is not transmitted ((1-p)
probability) then it waits for some time and checks the medium
again, now if it is found idle then it send with p probability. This
repeat continues until the frame is sent. It is used in Wifi and
packet radio systems.
 O-persistent: Superiority of nodes is decided beforehand and
transmission occurs in that order. If the medium is idle, node
waits for its time slot to send data.

CSMA/CD
CSMA/CD – Carrier sense multiple access with collision detection.
Stations can terminate transmission of data if collision is detected.
Carrier sense multiple access with collision detection (CSMA/CD) –
The CSMA method does not tell us what to do in case there is a collision.
Carrier sense multiple access with collision detection (CSMA/CD) adds on
to the CSMA algorithm to deal with the collision. In CSMA/CD, the size of a
frame must be large enough so that collision can be detected by sender
while sending the frame. So, the frame transmission delay must be at
least two times the maximum propagation delay.

 If distance increases, efficiency of CSMA decreases.


 CSMA is not suitable for long distance networks like WAN; but
works optimally for LAN.
 If length of packet is bigger, the efficiency of CSMA also
increases; but maximum limit for length is 1500 Bytes.
 Transmission Time >= 2*Propagation Time

CSMA/CA – Carrier sense multiple access with collision avoidance. The


process of collisions detection involves sender receiving
acknowledgement signals. If there is just one signal(its own) then the data
is successfully sent but if there are two signals(its own and the one with
which it has collided) then it means a collision has occurred. To distinguish
between these two cases, collision must have a lot of impact on received
signal. However it is not so in wired networks, so CSMA/CA is used in this
case.
CSMA/CA avoids collision by:

1. Interframe space – Station waits for medium to become idle


and if found idle it does not immediately send data (to avoid
collision due to propagation delay) rather it waits for a period of
time called Interframe space or IFS. After this time it again
checks the medium for being idle. The IFS duration depends on
the priority of station.
2. Contention Window – It is the amount of time divided into
slots. If the sender is ready to send data, it chooses a random
number of slots as wait time which doubles every time medium is
not found idle. If the medium is found busy it does not restart the
entire process, rather it restarts the timer when the channel is
found idle again.
3. Acknowledgement – The sender re-transmits the data if
acknowledgement is not received before time-out.

network Layer controls the operation of the subnet. The main aim of this
layer is to deliver packets from source to destination across multiple links
(networks). If two computers (system) are connected on the same link,
then there is no need for a network layer. It routes the signal through
different channels to the other end and acts as a network controller.
It also divides the outgoing messages into packets and to assemble
incoming packets into messages for higher levels.
In broadcast networks, the routing problem is simple, so the network layer
is often thin or even non-existent.

Functions of Network Layer

1. It translates logical network address into physical address.


Concerned with circuit, message or packet switching.
2. Routers and gateways operate in the network layer. Mechanism
is provided by Network Layer for routing the packets to final
destination.
3. Connection services are provided including network layer flow
control, network layer error control and packet sequence control.
4. Breaks larger packets into small packets.

Design Issues with Network Layer

 A key design issue is determining how packets are routed


from source to destination. Routes can be based on static
tables that are wired into the network and rarely changed. They
can also be highly dynamic, being determined anew for each
packet, to reflect the current network load.
 If too many packets are present in the subnet at the same
time, they will get into one another's way, forming bottlenecks.
The control of such congestion also belongs to the network
layer.
 Moreover, the quality of service provided(delay, transmit time,
jitter, etc) is also a network layer issue.
 When a packet has to travel from one network to another to
get to its destination, many problems can arise such as:
o The addressing used by the second network may be
different from the first one.
o The second one may not accept the packet at all
because it is too large.
o The protocols may differ, and so on.
 It is up to the network layer to overcome all these problems to
allow heterogeneous networks to be interconnected.

Routing algorithms: Least


Cost Routing algorithm
In practice, the majority of Internet routing methods are based on least-
cost algorithms. In such algorithms, a link cost is proportional to the links's
current traffic load. However, the link cost may not always be proportional
to the current load. The link cost is defined on both directions between
each pair of nodes. Several least-cost-path algorithms have been
developed for packet-switched networks. In particular, Dijkstra's
algorithm and the Bellman-Ford algorithm are the most effective and
widely used algorithms.

Dijkstra's Algorithm
Bellman-Ford Algorithm
Dijkstra's Algorithm
Dijkstra's algorithm is a centralized routing algorithm that maintains
information in a central location. The objective is to find the least-cost
path from a given source node to all other nodes. This algorithm
determines least-cost paths from a source node to a destination node by
optimizing the cost in multiple iterations. Dijkstra's algorithm is as
follows :
Begin Dijkstra's Algorithm
1. Define:

s =Source node

k =Set of visited nodes by the algorithm

± ij =Cost of the link from node i to node j

² ij =Cost of the least-cost path from node i to node j


2. Initialize:

k ={ s }

² sj = ± sj for j s
3. Next node:

Find x k that ² sx = min ² sj for j k.

Add x to k .
4. Least-cost paths:

² sj = min( ² sj , ² sx + ± xj ) for j k
If any two nodes i and j are not connected directly, the cost for that link is
infinity, indicated by ² ij =x. Steps 2 and 3 are repeated until paths are
assigned to all nodes. At step 1, k represents s , and ² sj computes the cost
of the least-cost path from s to node j . At step 2, we want to find x among
the neighboring nodes but not in k such that the cost is minimized. At step
3, we simply update the least-cost path. The algorithm ends when all
nodes have been visited and included in the algorithm.
Let us understand with the following example:

The set sptSet is initially empty and distances assigned to vertices are {0,
INF, INF, INF, INF, INF, INF, INF} where INF indicates infinite. Now pick the
vertex with minimum distance value. The vertex 0 is picked, include it
in sptSet. So sptSet becomes {0}. After including 0 to sptSet, update
distance values of its adjacent vertices. Adjacent vertices of 0 are 1 and 7.
The distance values of 1 and 7 are updated as 4 and 8. Following
subgraph shows vertices and their distance values, only the vertices with
finite distance values are shown. The vertices included in SPT are shown
in green colour.

Pick the vertex with minimum distance value and not already included in
SPT (not in sptSET). The vertex 1 is picked and added to sptSet. So sptSet
now becomes {0, 1}. Update the distance values of adjacent vertices of 1.
The distance value of vertex 2 becomes 12.
Pick the vertex with minimum distance value and not already included in
SPT (not in sptSET). Vertex 7 is picked. So sptSet now becomes {0, 1, 7}.
Update the distance values of adjacent vertices of 7. The distance value of
vertex 6 and 8 becomes finite (15 and 9 respectively).

Pick the vertex with minimum distance value and not already included in
SPT (not in sptSET). Vertex 6 is picked. So sptSet now becomes {0, 1, 7,
6}. Update the distance values of adjacent vertices of 6. The distance
value of vertex 5 and 8 are updated.

We repeat the above steps until sptSet does include all vertices of given
graph. Finally, we get the following Shortest Path Tree (SPT).

Bellman-Ford Algorithm
The Bellman-Ford algorithm finds the least-cost path from a source to a
destination by passing through no more than links. The essence of the
algorithm consists of the following steps
1.
Define:
s = Source node
± ij = Cost of the link from node i to node j

² ij ( ) = Cost of the least-cost path from i to j with no more than links

² sj ( 0)=x, for all j s

² ss ( )=0, for all


Least-cost path:

for any node j s with predecessor node i :

² sj ( + 1) = min i [ ² si ( ) + ± ij ]

If any two nodes i and j are not connected directly, ² ij ( ) =x. At step 2,
every value of ² is initialized . At step 3, we increase the number of links
in a sequence of iterations. During each iteration, we find the least-cost
path, given the value of . The algorithm ends when all nodes have been
visited and included in the algorithm.
Example
Let us understand the algorithm with following example graph. The
images are taken from this source.
Let the given source vertex be 0. Initialize all distances as infinite, except
the distance to the source itself. Total number of vertices in the graph is
5, so all edges must be processed 4 times.

Let all edges are processed in the following order: (B, E), (D, B), (B, D), (A,
B), (A, C), (D, C), (B, C), (E, D). We get the following distances when all
edges are processed the first time. The first row shows initial distances.
The second row shows distances when edges (B, E), (D, B), (B, D) and (A,
B) are processed. The third row shows distances when (A, C) is processed.
The fourth row shows when (D, C), (B, C) and (E, D) are processed.

The first iteration guarantees to give all shortest paths which are at most
1 edge long. We get the following distances when all edges are processed
second time (The last row shows final values).

The second iteration guarantees to give all shortest paths which are at
most 2 edges long. The algorithm processes all edges 2 more times. The
distances are minimized after the second iteration, so third and fourth
iterations don’t update the distances.

What is IP?
Here, IP stands for internet protocol. It is a protocol defined in the
TCP/IP model used for sending the packets from source to destination. The
main task of IP is to deliver the packets from source to the destination
based on the IP addresses available in the packet headers. IP defines the
packet structure that hides the data which is to be delivered as well as the
addressing method that labels the datagram with a source and destination
information.
An IP protocol provides the connectionless service, which is accompanied
by two transport protocols, i.e., TCP/IP (Links to an external site.) and
UDP/IP, so internet protocol is also known as TCP/IP (Links to an external
site.) or UDP (Links to an external site.)/IP.
The first version of IP (Internet Protocol) was IPv4. After IPv4, IPv6 came
into the market, which has been increasingly used on the public internet
since 2006.

What is IP Addressing?
An IP address is a unique identifier assigned to the computer which is
connected to the internet. Each IP address consists of a series of
characters like 192.168.1.2. Users cannot access the domain name of
each website with the help of these characters, so DNS resolvers are used
that convert the human-readable domain names into a series of
characters. Each IP packet contains two addresses, i.e., the IP address of
the device, which is sending the packet, and the IP address of the device
which is receiving the packet.
Types of IP addresses
IPv4 addresses are divided into two categories:

 Public address
 Private address

Public address
The public address is also known as an external address as they are
grouped under the WAN addresses. We can also define the public address
as a way to communicate outside the network. This address is used to
access the internet. The public address available on our computer
provides the remote access to our computer. With the help of a public
address, we can set up the home server to access the internet. This
address is generally assigned by the ISP (Internet Service Provider).
Key points related to public address are:

 The scope of the public address is global, which means that we


can communicate outside the network.
 This address is assigned by the ISP (Internet Service Provider).
 It is not available at free of cost.
 We can get the Public IP by typing on Google "What is my IP".

Private address
A private address is also known as an internal address, as it is grouped
under the LAN addresses. It is used to communicate within the network.
These addresses are not routed on the internet so that no traffic can come
from the internet to this private address. The address space for the
private address is allocated using InterNIC to create our own network.
The private addresses are assigned to mainly those computers, printers,
smartphones, which are kept inside the home or the computers that are
kept within the organization. For example, a private address is assigned to
the printer, which is kept inside our home, so that our family member can
take out the print from the printer.
If the computer is assigned with a private address, then the devices
available within the local network can view the computer through the
private ip address. However, the devices available outside the local
network cannot view the computer through the private IP address, but
they can access the computer if they know the router's public address. To
access the computer directly, NAT (Network Address Translator) is to be
used.
Key points related to private address are:

 Its scope is local, as we can communicate within the network


only.
 It is generally used for creating a local area network.
 It is available at free of cost.
 We can get to know the private IP address by simply typing the
"ipconfig" on the command prompt.

Classful Addressing
An IP address is 32-bit long. An IP address is divided into sub-classes:

 Class A
 Class B
 Class C
 Class D
 Class E

An ip address is divided into two parts:

 Network ID: It represents the number of networks.


 Host ID: It represents the number of hosts.
In the above diagram, we observe that each class have a specific range of
IP addresses. The class of IP address is used to determine the number of
bits used in a class and number of networks and hosts available in the
class.

Class A
In Class A, an IP address is assigned to those networks that contain a
large number of hosts.

 The network ID is 8 bits long.


 The host ID is 24 bits long.

In Class A, the first bit in higher order bits of the first octet is always set to
0 and the remaining 7 bits determine the network ID. The 24 bits
determine the host ID in any network.

Class B
In Class B, an IP address is assigned to those networks that range from
small-sized to large-sized networks.

 The Network ID is 16 bits long.


 The Host ID is 16 bits long.
Class C
In Class C, an IP address is assigned to only small-sized networks.

 The Network ID is 24 bits long.


 The host ID is 8 bits long.

Class D
In Class D, an IP address is reserved for multicast addresses. It does not
possess subnetting. The higher order bits of the first octet is always set to
1110, and the remaining bits determines the host ID in any network.

Class E
In Class E, an IP address is used for the future use or for the research and
development purposes. It does not possess any subnetting. The higher
order bits of the first octet is always set to 1111, and the remaining bits
determines the host ID in any network.

Rules for assigning Host ID:


The Host ID is used to determine the host within any network. The Host ID
is assigned based on the following rules:

 The Host ID must be unique within any network.


 The Host ID in which all the bits are set to 0 cannot be assigned
as it is used to represent the network ID of the IP address.
 The Host ID in which all the bits are set to 1 cannot be assigned
as it is reserved for the multicast address.

Rules for assigning Network ID:


If the hosts are located within the same local network, then they are
assigned with the same network ID. The following are the rules for
assigning Network ID:

 The network ID cannot start with 127 as 127 is used by Class A.


 The Network ID in which all the bits are set to 0 cannot be
assigned as it is used to specify a particular host on the local
network.
 The Network ID in which all the bits are set to 1 cannot be
assigned as it is reserved for the multicast address.

IPv4 Datagram Header


Size of the header is 20 to 60 bytes.

VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4


HLEN: IP header length (4 bits), which is the number of 32 bit words in
the header. The minimum value for this field is 5 and the maximum is 15.
Type of service: Low Delay, High Throughput, Reliability (8 bits)
Total Length: Length of header + Data (16 bits), which has a minimum
value 20 bytes and the maximum is 65,535 bytes.
Identification: Unique Packet Id for identifying the group of fragments of
a single IP datagram (16 bits)
Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment
flag, more fragments flag (same order)
Fragment Offset: Represents the number of Data Bytes ahead of the
particular fragment in the particular Datagram. Specified in terms of
number of 8 bytes, which has the maximum value of 65,528 bytes.
Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to
loop through the network by restricting the number of Hops taken by a
Packet before delivering to the Destination.
Protocol: Name of the protocol to which the data is to be passed (8 bits)
Header Checksum: 16 bits header checksum for checking errors in the
datagram header
Source IP address: 32 bits IP address of the sender
Destination IP address: 32 bits IP address of the receiver
Option: Optional information such as source route, record route. Used by
the Network administrator to check whether a path is working or not.

Differences between IPv4 and IPv6


Ipv4 Ipv6

Address
IPv4 is a 32-bit address. IPv6 is a 128-bit address.
length

IPv6 is an alphanumeric
IPv4 is a numeric address that
address that consists of 8
Fields consists of 4 fields which are
fields, which are separated
separated by dot (.).
by colon.

IPv4 has 5 different classes of IP


address that includes Class A, IPv6 does not contain classes
Classes
Class B, Class C, Class D, and of IP addresses.
Class E.

Number of IP IPv4 has a limited number of IP IPv6 has a large number of IP


address addresses. addresses.

It supports VLSM (Virtual Length


Subnet Mask). Here, VLSM means
VLSM It does not support VLSM.
that Ipv4 converts IP addresses
into a subnet of different sizes.

It supports manual, DHCP,


Address It supports manual and DHCP
auto-configuration, and
configuration configuration.
renumbering.

Address space It generates 4 billion unique It generates 340 undecillion


addresses unique addresses.

End-to-end In the case of IPv6, end-to-


In IPv4, end-to-end connection
connection end connection integrity is
integrity is unachievable.
integrity achievable.

In IPv4, security depends on the


Security application. This IP address is not In IPv6, IPSEC is developed
features developed in keeping the security for security purposes.
feature in mind.

Address In IPv6, the representation of


In IPv4, the IP address is
representatio the IP address in
represented in decimal.
n hexadecimal.

Fragmentation is done by the


Fragmentatio Fragmentation is done by
senders and the forwarding
n the senders only.
routers.

It does not provide any It uses flow label field in the


Packet flow
mechanism for packet flow header for the packet flow
identification
identification. identification.

Checksum The checksum field is available in The checksum field is not


field IPv4. available in IPv6.

On the other hand, IPv6 is


Transmission
IPv4 is broadcasting. multicasting, which provides
scheme
efficient network operations.

Encryption
and It does not provide encryption It provides encryption and
Authenticatio and authentication. authentication.
n

It consists of 8 fields, and


Number of each field contains 2 octets.
It consists of 4 octets.
octets Therefore, the total number
of octets in IPv6 is 16.

UDP: Header Format,


UDP Header –
UDP header is 8-bytes fixed and simple header, while for TCP it may vary
from 20 bytes to 60 bytes. First 8 Bytes contains all necessary header
information and remaining part consist of data. UDP port number fields
are each 16 bits long, therefore range for port numbers defined from 0 to
65535; port number 0 is reserved. Port numbers help to distinguish
different user requests or process.

1. Source Port : Source Port is 2 Byte long field used to identify


port number of source.
2. Destination Port : It is 2 Byte long field, used to identify the
port of destined packet.
3. Length : Length is the length of UDP including header and the
data. It is 16-bits field.
4. Checksum : Checksum is 2 Bytes long field. It is the 16-bit one’s
complement of the one’s complement sum of the UDP header,
pseudo header of information from the IP header and the data,
padded with zero octets at the end (if necessary) to make a
multiple of two octets.

Notes – Unlike TCP, Checksum calculation is not mandatory in UDP. No


Error control or flow control is provided by UDP. Hence UDP depends on IP
and ICMP for error reporting.

TCP
TCP stands for Transmission Control Protocol. It is a transport layer
protocol that facilitates the transmission of packets from source to
destination. It is a connection-oriented protocol that means it establishes
the connection prior to the communication that occurs between the
computing devices in a network. This protocol is used with an IP

protocol, so together, they are referred to as a TCP/IP


.
The main functionality of the TCP is to take the data from the application
layer. Then it divides the data into a several packets, provides numbering
to these packets, and finally transmits these packets to the destination.
The TCP, on the other side, will reassemble the packets and transmits
them to the application layer. As we know that TCP is a connection-
oriented protocol, so the connection will remain established until the
communication is not completed between the sender and the receiver.

Features of TCP protocol


The following are the features of a TCP protocol:

o Transport Layer Protocol

TCP is a transport layer protocol as it is used in transmitting the data from


the sender to the receiver.

o Reliable

TCP is a reliable protocol as it follows the flow and error control


mechanism. It also supports the acknowledgment mechanism, which
checks the state and sound arrival of the data. In the acknowledgment
mechanism, the receiver sends either positive or negative
acknowledgment to the sender so that the sender can get to know
whether the data packet has been received or needs to resend.

o Order of the data is maintained

This protocol ensures that the data reaches the intended receiver in the
same order in which it is sent. It orders and numbers each segment so
that the TCP layer on the destination side can reassemble them based on
their ordering.

o Connection-oriented

It is a connection-oriented service that means the data exchange occurs


only after the connection establishment. When the data transfer is
completed, then the connection will get terminated.

o Full duplex

It is a full-duplex means that the data can transfer in both directions at


the same time.

o Stream-oriented
TCP is a stream-oriented protocol as it allows the sender to send the data
in the form of a stream of bytes and also allows the receiver to accept the
data in the form of a stream of bytes. TCP creates an environment in
which both the sender and receiver are connected by an imaginary tube
known as a virtual circuit. This virtual circuit carries the stream of bytes
across the internet.

Need of Transport Control Protocol


In the layered architecture of a network model, the whole task is divided
into smaller tasks. Each task is assigned to a particular layer that
processes the task. In the TCP/IP model

, five layers are application layer


, transport layer
, network layer
, data link layer
, and physical layer. The transport layer has a critical role in providing end-to-end
communication to the directly application processes. It creates 65,000 ports so that the
multiple applications can be accessed at the same time. It takes the data from the upper layer,
and it divides the data into smaller packets and then transmits them to the network layer.

Working of TCP
In TCP, the connection is established by using three-way handshaking. The
client sends the segment with its sequence number. The server, in return,
sends its segment with its own sequence number as well as the
acknowledgement sequence, which is one more than the client sequence
number. When the client receives the acknowledgment of its segment,
then it sends the acknowledgment to the server. In this way, the
connection is established between the client and the server.

Advantages of TCP

o It provides a connection-oriented reliable service, which means that


it guarantees the delivery of data packets. If the data packet is lost
across the network, then the TCP will resend the lost packets.
o It provides a flow control mechanism using a sliding window
protocol.
o It provides error detection by using checksum and error control by
using Go Back or ARP protocol.
o It eliminates the congestion by using a network congestion
avoidance algorithm that includes various schemes such as additive
increase/multiplicative decrease (AIMD), slow start, and congestion
window.

Disadvantage of TCP
It increases a large amount of overhead as each segment gets its own TCP
header, so fragmentation by the router increases the overhead.

TCP Header format


o Source port: It defines the port of the application, which is sending
the data. So, this field contains the source port address, which is 16
bits.
o Destination port: It defines the port of the application on the
receiving side. So, this field contains the destination port address,
which is 16 bits.
o Sequence number: This field contains the sequence number of
data bytes in a particular session.
o Acknowledgment number: When the ACK flag is set, then this
contains the next sequence number of the data byte and works as
an acknowledgment for the previous data received. For example, if
the receiver receives the segment number 'x', then it responds
'x+1' as an acknowledgment number.
o HLEN: It specifies the length of the header indicated by the 4-byte
words in the header. The size of the header lies between 20 and 60
bytes. Therefore, the value of this field would lie between 5 and 15.
o Reserved: It is a 4-bit field reserved for future use, and by default,
all are set to zero.
o Flags
There are six control bits or flags:
0. URG: It represents an urgent pointer. If it is set, then the data
is processed urgently.
1. ACK: If the ACK is set to 0, then it means that the data packet
does not contain an acknowledgment.
2. PSH: If this field is set, then it requests the receiving device
to push the data to the receiving application without buffering
it.
3. RST: If it is set, then it requests to restart a connection.
4. SYN: It is used to establish a connection between the hosts.
5. FIN: It is used to release a connection, and no further data
exchange will happen.

o Window size
It is a 16-bit field. It contains the size of data that the receiver can
accept. This field is used for the flow control between the sender
and receiver and also determines the amount of buffer allocated by
the receiver for a segment. The value of this field is determined by
the receiver.
o Checksum
It is a 16-bit field. This field is optional in UDP, but in the case of
TCP/IP, this field is mandatory.
o Urgent pointer
It is a pointer that points to the urgent data byte if the URG flag is
set to 1. It defines a value that will be added to the sequence
number to get the sequence number of the last urgent byte.
o Options
It provides additional options. The optional field is represented in
32-bits. If this field contains the data less than 32-bit, then padding
is required to obtain the remaining bits.
Application Layer: WWW and
HTTP
WWW stands for World Wide Web. A technical definition of the World
Wide Web is : all the resources and users on the Internet that are using
the Hypertext Transfer Protocol (HTTP).
A broader definition comes from the organization that Web inventor Tim
Berners-Lee helped found, the World Wide Web Consortium (W3C).
The World Wide Web is the universe of network-accessible information, an
embodiment of human knowledge.
In simple terms, The World Wide Web is a way of exchanging information
between computers on the Internet, tying them together into a vast
collection of interactive multimedia resources.

Internet and Web is not the same thing: Web uses internet to pass over
the information.

Evolution
World Wide Web was created by Timothy Berners Lee in 1989
at CERN in Geneva. World Wide Web came into existence as a proposal
by him, to allow researchers to work together effectively and efficiently
at CERN. Eventually it became World Wide Web.
The following diagram briefly defines evolution of World Wide Web:
WWW Architecture
WWW architecture is divided into several layers as shown in the following
diagram:
Identifiers and Character Set
Uniform Resource Identifier (URI) is used to uniquely identify
resources on the web and UNICODE makes it possible to built web pages
that can be read and write in human languages.
Syntax
XML (Extensible Markup Language) helps to define common syntax in
semantic web.
Data Interchange
Resource Description Framework (RDF) framework helps in defining
core representation of data for web. RDF represents data about resource
in graph form.
Taxonomies
RDF Schema (RDFS) allows more standardized description
of taxonomies and other ontological constructs.
Ontologies
Web Ontology Language (OWL) offers more constructs over RDFS. It
comes in following three versions:
 OWL Lite for taxonomies and simple constraints.
 OWL DL for full description logic support.
 OWL for more syntactic freedom of RDF
Rules
RIF and SWRL offers rules beyond the constructs that are available
from RDFs and OWL. Simple Protocol and RDF Query Language
(SPARQL) is SQL like language used for querying RDF data and OWL
Ontologies.
Proof
All semantic and rules that are executed at layers below Proof and their
result will be used to prove deductions.
Cryptography
Cryptography means such as digital signature for verification of the
origin of sources is used.
User Interface and Applications
On the top of layer User interface and Applications layer is built for
user interaction.
WWW Operation
WWW works on client- server approach. Following steps explains how the
web works:
1. User enters the URL (say, http://www.tutorialspoint.com) of
the web page in the address bar of web browser.
2. Then browser requests the Domain Name Server for the IP
address corresponding to www.tutorialspoint.com.
3. After receiving IP address, browser sends the request for web
page to the web server using HTTP protocol which specifies the
way the browser and web server communicates.
4. Then web server receives request using HTTP protocol and
checks its search for the requested web page. If found it returns
it back to the web browser and close the HTTP connection.
5. Now the web browser receives the web page, It interprets it and
display the contents of web page in web browser’s window.

Future
There had been a rapid development in field of web. It has its impact in
almost every area such as education, research, technology, commerce,
marketing etc. So the future of web is almost unpredictable.
Apart from huge development in field of WWW, there are also some
technical issues that W3 consortium has to cope up with.
User Interface
Work on higher quality presentation of 3-D information is under
deveopment. The W3 Consortium is also looking forward to enhance the
web to full fill requirements of global communities which would include all
regional languages and writing systems.
Technology
Work on privacy and security is under way. This would include hiding
information, accounting, access control, integrity and risk management.
Architecture
There has been huge growth in field of web which may lead to overload
the internet and degrade its performance. Hence more better protocol are
required to be developed.

The World Wide Web is about communication between web clients and
web servers.
Clients are often browsers (Chrome, Edge, Safari), but they can be any
type of program or device.
Servers are most often computers in the cloud.
Web Client

Cloud

Web Server

HTTP Request / Response


Communication between clients and servers is done
by requests and responses:

1. A client (a browser) sends an HTTP request to the web


2. A web server receives the request
3. The server runs an application to process the request
4. The server returns an HTTP response (output) to the browser
5. The client (the browser) receives the response

The HTTP Request Circle


A typical HTTP request / response circle:

1. The browser requests an HTML page. The server returns an HTML


file.
2. The browser requests a style sheet. The server returns a CSS file.
3. The browser requests an JPG image. The server returns a JPG file.
4. The browser requests JavaScript code. The server returns a JS file
5. The browser requests data. The server returns data (in XML or
JSON).

FTP
FTP

 FTP stands for File transfer protocol.


 FTP is a standard internet protocol provided by TCP/IP used for
transmitting the files from one host to another.
 It is mainly used for transferring the web page files from their
creator to the computer that acts as a server for other computers
on the internet.
 It is also used for downloading the files to computer from other
servers.

Objectives of FTP

 It provides the sharing of files.


 It is used to encourage the use of remote computers.
 It transfers the data more reliably and efficiently.

Why FTP?
Although transferring files from one system to another is very simple and
straightforward, but sometimes it can cause problems. For example, two
systems may have different file conventions. Two systems may have
different ways to represent text and data. Two systems may have
different directory structures. FTP protocol overcomes these problems by
establishing two connections between hosts. One connection is used for
data transfer, and another connection is used for the control connection.
Mechanism of FTP

The above figure shows the basic model of the FTP. The FTP client has
three components: the user interface, control process, and data transfer
process. The server has two components: the server control process and
the server data transfer process.
There are two types of connections in FTP:
 Control Connection: The control connection uses very simple
rules for communication. Through control connection, we can
transfer a line of command or line of response at a time. The
control connection is made between the control processes. The
control connection remains connected during the entire
interactive FTP session.
 Data Connection: The Data Connection uses very complex
rules as data types may vary. The data connection is made
between data transfer processes. The data connection opens
when a command comes for transferring the files and closes
when the file is transferred.

FTP Clients

 FTP client is a program that implements a file transfer protocol


which allows you to transfer files between two hosts on the
internet.
 It allows a user to connect to a remote host and upload or
download the files.
 It has a set of commands that we can use to connect to a host,
transfer the files between you and your host and close the
connection.
 The FTP program is also available as a built-in component in a
Web browser. This GUI based FTP client makes the file transfer
very easy and also does not require to remember the FTP
commands.

Advantages of FTP:

 Speed: One of the biggest advantages of FTP is speed. The FTP


is one of the fastest way to transfer the files from one computer
to another computer.
 Efficient: It is more efficient as we do not need to complete all
the operations to get the entire file.
 Security: To access the FTP server, we need to login with the
username and password. Therefore, we can say that FTP is more
secure.
 Back & forth movement: FTP allows us to transfer the files
back and forth. Suppose you are a manager of the company, you
send some information to all the employees, and they all send
information back on the same server.

Disadvantages of FTP:

 The standard requirement of the industry is that all the FTP


transmissions should be encrypted. However, not all the FTP
providers are equal and not all the providers offer encryption. So,
we will have to look out for the FTP providers that provides
encryption.
 FTP serves two operations, i.e., to send and receive large files on
a network. However, the size limit of the file is 2GB that can be
sent. It also doesn't allow you to run simultaneous transfers to
multiple receivers.
 Passwords and file contents are sent in clear text that allows
unwanted eavesdropping. So, it is quite possible that attackers
can carry out the brute force attack by trying to guess the FTP
password.
 It is not compatible with every system.

SSH
SSH stands for Secure Shell or Secure Socket Shell. It is a
cryptographic network protocol that allows two computers to
communicate and share the data over an insecure network such as the
internet. It is used to login to a remote server to execute commands and
data transfer from one machine to another machine.
The SSH protocol was developed by SSH communication security
Ltd to safely communicate with the remote machine.
Secure communication provides a strong password authentication and
encrypted communication with a public key over an insecure channel. It is
used to replace unprotected remote login protocols such as Telnet,
rlogin, rsh, etc., and insecure file transfer protocol FTP.
Its security features are widely used by network administrators for
managing systems and applications remotely.
The SSH protocol protects the network from various attacks such as DNS
spoofing, IP source routing, and IP spoofing.
A simple example can be understood, such as suppose you want to
transfer a package to one of your friends. Without SSH protocol, it can be
opened and read by anyone. But if you will send it using SSH protocol, it
will be encrypted and secured with the public keys, and only the receiver
can open it.
Before SSH:

After SSH:

Usages of SSH protocol


The popular usages of SSH protocol are given below:

 It provides secure access to users and automated processes.


 It is an easy and secure way to transfer files from one system to
another over an insecure network.
 It also issues remote commands to the users.
 It helps the users to manage the network infrastructure and
other critical system components.
 It is used to log in to shell on a remote system (Host), which
replaces Telnet and rlogin and is used to execute a single
command on the host, which replaces rsh.
 It combines with rsync utility to backup, copy, and mirror files
with complete security and efficiency.
 It can be used for forwarding a port.
 By using SSH, we can set up the automatic login to a remote
server such as OpenSSH.
 We can securely browse the web through the encrypted proxy
connection with the SSH client, supporting the SOCKS protocol.

How does SSH Works?


The SSH protocol works in a client-server model, which means it
connects a secure shell client application (End where the session is
displayed) with the SSH server (End where session executes).
As discussed above, it was initially developed to replace insecure login
protocols such as Telnet, rlogin, and hence it performs the same function.

The basic use of SSH is to connect a remote system for a terminal session
and to do this, following command is used:

1. ssh UserName@SSHserver.test.com

The above command enables the client to connect to the server,


named server.test.com, using the ID UserName.
If we are connecting for the first time, it will prompt the remote host's
public key fingerprint and ask to connect. The below message will be
prompt:

1. The authenticity of host 'sample.ssh.com' cannot be established.


2. DSA key fingerprint is 01:23:45:67:89:ab:cd:ef:ff:fe:dc:ba:98:76:
54:32:10.
3. Are you sure you want to continue connecting (yes/no)?
To continue the session, we need to click yes, else no. If we click yes, then
the host key will be stored in the known_hosts file of the local system. The
key is contained within the hidden file by default, which
is /.ssh/known_hosts in the home directory. Once the host key is stored
in this hidden file, there is no need for further approval as the host key will
automatically authenticate the connection.

SMTP
 SMTP stands for Simple Mail Transfer Protocol.
 SMTP is a set of communication guidelines that allow software to
transmit an electronic mail over the internet is called Simple
Mail Transfer Protocol.
 It is a program used for sending messages to other computer
users based on e-mail addresses.
 It provides a mail exchange between users on the same or
different computers, and it also supports:
o It can send a single message to one or more recipients.
o Sending message can include text, voice, video or
graphics.
o It can also send the messages on networks outside the
internet.
 The main purpose of SMTP is used to set up communication rules
between servers. The servers have a way of identifying
themselves and announcing what kind of communication they
are trying to perform. They also have a way of handling the
errors such as incorrect email address. For example, if the
recipient address is wrong, then receiving server reply with an
error message of some kind.

Components of SMTP
 First, we will break the SMTP client and SMTP server into two
components such as user agent (UA) and mail transfer agent
(MTA). The user agent (UA) prepares the message, creates the
envelope and then puts the message in the envelope. The mail
transfer agent (MTA) transfers this mail across the internet.

 SMTP allows a more complex system by adding a relaying


system. Instead of just having one MTA at sending side and one
at receiving side, more MTAs can be added, acting either as a
client or server to relay the email.
 The relaying system without TCP/IP protocol can also be used to
send the emails to users, and this is achieved by the use of the
mail gateway. The mail gateway is a relay MTA that can be used
to receive an email.

Working of SMTP
1. Composition of Mail: A user sends an e-mail by composing an
electronic mail message using a Mail User Agent (MUA). Mail User
Agent is a program which is used to send and receive mail. The
message contains two parts: body and header. The body is the
main part of the message while the header includes information
such as the sender and recipient address. The header also
includes descriptive information such as the subject of the
message. In this case, the message body is like a letter and
header is like an envelope that contains the recipient's address.
2. Submission of Mail: After composing an email, the mail client
then submits the completed e-mail to the SMTP server by using
SMTP on TCP port 25.
3. Delivery of Mail: E-mail addresses contain two parts: username
of the recipient and domain name. For example,
vivek@gmail.com, where "vivek" is the username of the recipient
and "gmail.com" is the domain name.
If the domain name of the recipient's email address is different
from the sender's domain name, then MSA will send the mail to
the Mail Transfer Agent (MTA). To relay the email, the MTA will
find the target domain. It checks the MX record from Domain
Name System to obtain the target domain. The MX record
contains the domain name and IP address of the recipient's
domain. Once the record is located, MTA connects to the
exchange server to relay the message.
4. Receipt and Processing of Mail: Once the incoming message
is received, the exchange server delivers it to the incoming
server (Mail Delivery Agent) which stores the e-mail where it
waits for the user to retrieve it.
5. Access and Retrieval of Mail: The stored email in MDA can be
retrieved by using MUA (Mail User Agent). MUA can be accessed
by using login and password.

DNS
An application layer protocol defines how the application processes
running on different systems, pass the messages to each other.

 DNS stands for Domain Name System.


 DNS is a directory service that provides a mapping between the
name of a host on the network and its numerical address.
 DNS is required for the functioning of the internet.
 Each node in a tree has a domain name, and a full domain name
is a sequence of symbols specified by dots.
 DNS is a service that translates the domain name into IP
addresses. This allows the users of networks to utilize user-
friendly names when looking for other hosts instead of
remembering the IP addresses.
 For example, suppose the FTP site at EduSoft had an IP address
of 132.147.165.50, most people would reach this site by
specifying ftp.EduSoft.com. Therefore, the domain name is more
reliable than IP address.

DNS is a TCP/IP protocol used on different platforms. The domain name


space is divided into three different sections: generic domains, country
domains, and inverse domain.

Generic Domains
 It defines the registered hosts according to their generic
behavior.
 Each node in a tree defines the domain name, which is an index
to the DNS database.
 It uses three-character labels, and these labels describe the
organization type.

Label Description
aero Airlines and aerospace companies
biz Businesses or firms
com Commercial Organizations
Cooperative business
coop
Organizations
edu Educational institutions
gov Government institutions
info Information service providers
int International Organizations
mil Military groups
museu Museum & other nonprofit
m organizations
name Personal names
net Network Support centers
org Nonprofit Organizations
Professional individual
pro
Organizations

Country Domain
The format of country domain is same as a generic domain, but it uses
two-character country abbreviations (e.g., us for the United States) in
place of three character organizational abbreviations.

Inverse Domain
The inverse domain is used for mapping an address to a name. When the
server has received a request from the client, and the server contains the
files of only authorized clients. To determine whether the client is on the
authorized list or not, it sends a query to the DNS server and ask for
mapping an address to the name.

Working of DNS
 DNS is a client/server network communication protocol. DNS
clients send requests to the. server while DNS servers send
responses to the client.
 Client requests contain a name which is converted into an IP
address known as a forward DNS lookups while requests
containing an IP address which is converted into a name known
as reverse DNS lookups.
 DNS implements a distributed database to store the name of all
the hosts available on the internet.
 If a client like a web browser sends a request containing a
hostname, then a piece of software such as DNS resolver sends
a request to the DNS server to obtain the IP address of a
hostname. If DNS server does not contain the IP address
associated with a hostname, then it forwards the request to
another DNS server. If IP address has arrived at the resolver,
which in turn completes the request over the internet protocol.

What is a multiple access protocol?


When a sender and receiver have a dedicated link to transmit data
packets, the data link control is enough to handle the channel. Suppose
there is no dedicated path to communicate or transfer the data between
two devices. In that case, multiple stations access the channel and
simultaneously transmits the data over the channel. It may create
collision and cross talk. Hence, the multiple access protocol is required to
reduce the collision and avoid crosstalk between the channels.

For example, suppose that there is a classroom full of students. When a


teacher asks a question, all the students (small channels) in the class start
answering the question at the same time (transferring the data
simultaneously). All the students respond at the same time due to which
data is overlap or data lost. Therefore it is the responsibility of a teacher
(multiple access protocol) to manage the students and make them one
answer.

47.3M
1K
Features of Java - Javatpoint

Following are the types of multiple access protocol that is subdivided into
the different process as:
A. Random Access Protocol
In this protocol, all the station has the equal priority to send the data over
a channel. In random access protocol, one or more stations cannot
depend on another station nor any station control another station.
Depending on the channel's state (idle or busy), each station transmits
the data frame. However, if more than one station sends the data over a
channel, there may be a collision or data conflict. Due to the collision, the
data frame packets may be lost or changed. And hence, it does not
receive by the receiver end.

Following are the different methods of random-access protocols for


broadcasting frames on the channel.

o Aloha
o CSMA
o CSMA/CD
o CSMA/CA

ALOHA Random Access Protocol

It is designed for wireless LAN (Local Area Network) but can also be used
in a shared medium to transmit data. Using this method, any station can
transmit data across a network simultaneously when a data frameset is
available for transmission.

Aloha Rules

1. Any station can transmit data to a channel at any time.


2. It does not require any carrier sensing.
3. Collision and data frames may be lost during the transmission of
data through multiple stations.
4. Acknowledgment of the frames exists in Aloha. Hence, there is no
collision detection.
5. It requires retransmission of data after some random amount of
time.

Pure Aloha

Whenever data is available for sending over a channel at stations, we use


Pure Aloha. In pure Aloha, when each station transmits data to a channel
without checking whether the channel is idle or not, the chances of
collision may occur, and the data frame can be lost. When any station
transmits the data frame to a channel, the pure Aloha waits for the
receiver's acknowledgment. If it does not acknowledge the receiver end
within the specified time, the station waits for a random amount of time,
called the backoff time (Tb). And the station may assume the frame has
been lost or destroyed. Therefore, it retransmits the frame until all the
data are successfully transmitted to the receiver.

1. The total vulnerable time of pure Aloha is 2 * Tfr.


2. Maximum throughput occurs when G = 1/ 2 that is 18.4%.
3. Successful transmission of data frame is S = G * e ^ - 2 G.
As we can see in the figure above, there are four stations for accessing a
shared channel and transmitting data frames. Some frames collide
because most stations send their frames at the same time. Only two
frames, frame 1.1 and frame 2.2, are successfully transmitted to the
receiver end. At the same time, other frames are lost or destroyed.
Whenever two frames fall on a shared channel simultaneously, collisions
can occur, and both will suffer damage. If the new frame's first bit enters
the channel before finishing the last bit of the second frame. Both frames
are completely finished, and both stations must retransmit the data
frame.

Slotted Aloha

The slotted Aloha is designed to overcome the pure Aloha's efficiency


because pure Aloha has a very high possibility of frame hitting. In slotted
Aloha, the shared channel is divided into a fixed time interval called slots.
So that, if a station wants to send a frame to a shared channel, the frame
can only be sent at the beginning of the slot, and only one frame is
allowed to be sent to each slot. And if the stations are unable to send data
to the beginning of the slot, the station will have to wait until the
beginning of the slot for the next time. However, the possibility of a
collision remains when trying to send a frame at the beginning of two or
more station time slot.

1. Maximum throughput occurs in the slotted Aloha when G = 1 that is


37%.
2. The probability of successfully transmitting the data frame in the
slotted Aloha is S = G * e ^ - 2 G.
3. The total vulnerable time required in slotted Aloha is Tfr.

CSMA (Carrier Sense Multiple Access)

It is a carrier sense multiple access based on media access protocol to


sense the traffic on a channel (idle or busy) before transmitting the data.
It means that if the channel is idle, the station can send data to the
channel. Otherwise, it must wait until the channel becomes idle. Hence, it
reduces the chances of a collision on a transmission medium.

CSMA Access Modes

1-Persistent: In the 1-Persistent mode of CSMA that defines each node,


first sense the shared channel and if the channel is idle, it immediately
sends the data. Else it must wait and keep track of the status of the
channel to be idle and broadcast the frame unconditionally as soon as the
channel is idle.

Non-Persistent: It is the access mode of CSMA that defines before


transmitting the data, each node must sense the channel, and if the
channel is inactive, it immediately sends the data. Otherwise, the station
must wait for a random time (not continuously), and when the channel is
found to be idle, it transmits the frames.
P-Persistent: It is the combination of 1-Persistent and Non-persistent
modes. The P-Persistent mode defines that each node senses the channel,
and if the channel is inactive, it sends a frame with a P probability. If the
data is not transmitted, it waits for a (q = 1-p probability) random time
and resumes the frame with the next time slot.

O- Persistent: It is an O-persistent method that defines the superiority of


the station before the transmission of the frame on the shared channel. If
it is found that the channel is inactive, each station waits for its turn to
retransmit the data.

CSMA/ CD

It is a carrier sense multiple access/ collision detection network


protocol to transmit data frames. The CSMA/CD protocol works with a
medium access control layer. Therefore, it first senses the shared channel
before broadcasting the frames, and if the channel is idle, it transmits a
frame to check whether the transmission was successful. If the frame is
successfully received, the station sends another frame. If any collision is
detected in the CSMA/CD, the station sends a jam/ stop signal to the
shared channel to terminate data transmission. After that, it waits for a
random time before sending a frame to a channel.

CSMA/ CA

It is a carrier sense multiple access/collision avoidance network


protocol for carrier transmission of data frames. It is a protocol that works
with a medium access control layer. When a data frame is sent to a
channel, it receives an acknowledgment to check whether the channel is
clear. If the station receives only a single (own) acknowledgments, that
means the data frame has been successfully transmitted to the receiver.
But if it gets two signals (its own and one more in which the collision of
frames), a collision of the frame occurs in the shared channel. Detects the
collision of the frame when a sender receives an acknowledgment signal.

Following are the methods used in the CSMA/ CA to avoid the collision:

Interframe space: In this method, the station waits for the channel to
become idle, and if it gets the channel is idle, it does not immediately
send the data. Instead of this, it waits for some time, and this time period
is called the Interframe space or IFS. However, the IFS time is often used
to define the priority of the station.

Contention window: In the Contention window, the total time is divided


into different slots. When the station/ sender is ready to transmit the data
frame, it chooses a random slot number of slots as wait time. If the
channel is still busy, it does not restart the entire process, except that it
restarts the timer only to send data packets when the channel is inactive.

Acknowledgment: In the acknowledgment method, the sender station


sends the data frame to the shared channel if the acknowledgment is not
received ahead of time.

You might also like