0% found this document useful (0 votes)
44 views155 pages

Unit I

Uploaded by

Abinaya Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views155 pages

Unit I

Uploaded by

Abinaya Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 155

CS3591

COMPUTER NETWORKS
UNIT I INTRODUCTION AND APPLICATION LAYER

Data Communication - Networks – Network Types – Protocol Layering –


TCP/IP Protocol suite – OSI Model – Introduction to Sockets -
Application Layer protocols: HTTP – FTP – Email protocols (SMTP -
POP3 - IMAP - MIME) – DNS – SNMP
TEXT BOOKS
• 1. James F. Kurose, Keith W. Ross, Computer Networking, A Top-
Down Approach Featuring the Internet, Eighth Edition, Pearson
Education, 2021.
• 2. Behrouz A. Forouzan, Data Communications and Networking with
TCP/IP Protocol Suite, Sixth Edition TMH, 2022
DATA COMMUNICATIONS

Data communications are the exchange of data between two devices


via some form of transmission medium such as a wired cable or
wireless.
SCOPE
NETWORKS

• A network is a set of devices (often referred to as nodes) connected by


communication links.
• A node can be a computer, printer, or any other device capable of sending
or receiving data generated by other nodes on the network.
What are the qualities you
are expecting from a
network?
CHARACTERISTICS OF A NETWORK

• The effectiveness of a network depends on three characteristics.


1. Delivery: The system must deliver data to the correct destination.
2. Accuracy: The system must deliver data accurately.
3. Timeliness: The system must deliver data in a timely manner.
Figure 1.1 Components of a data communication system

1. Message (Information or Data)


2. Sender
3. Receiver
4. Transmission Media
5. Protocol
• The five components are:
1. Message - it is the information to be communicated. Popular forms of
information include text, pictures, audio, video etc.
2. Sender - it is the device which sends the data messages. It can be a computer,
telephone handset etc.
3. Receiver - it is the device which receives the data messages. It can be a
computer, telephone handset etc.
4. Transmission medium - it is the physical path by which a message travels
from sender to receiver. Some examples include twisted-pair wire, coaxial
cable, radio waves etc.
5. Protocol - it is a set of rules that governs the data communications. Without a
protocol, two devices may be connected but not communicating.
TRANSMISSION MODES

• The way in which data is transmitted from one device to another device is
known as transmission mode.
• The transmission mode is also known as the communication mode.
• Each communication channel has a direction associated with it, and
transmission media provide the direction.
• Therefore, the transmission mode is also known as a directional mode.
Simplex

• In Simplex mode, the communication is unidirectional, i.e., the data flow in one direction.
• A device can only send the data but cannot receive it or it can receive the data but cannot send
the data.
• This transmission mode is not very popular as mainly communications require the two-way
exchange of data.
• The simplex mode is used in the business field as in sales that do not require any corresponding
reply.
• Keyboard and Monitor are the examples of the simplex mode as a keyboard can only accept the
data from the user and monitor can only be used to display the data on the screen.
HALF-DUPLEX MODE

• In a Half-duplex channel, direction can be reversed, i.e., the


station can transmit and receive the data as well.
• Messages flow in both the directions, but not at the same time.
• A Walkie-talkie is an example of the Half-duplex mode.
• In Walkie-talkie, one party speaks, and another party listens. After
a pause, the other speaks and first party listens. Speaking
simultaneously will create the distorted sound which cannot be
understood.
FULL-DUPLEX MODE

• In Full duplex mode, the communication is bi-directional, i.e., the data flow
in both the directions.
• Both the stations can send and receive the message simultaneously.
• The most common example of the full-duplex mode is a Telephone network.
When two people are communicating with each other by a telephone line,
both can talk and listen at the same time.
Figure 1.2 Data flow (simplex, half-duplex, and full-duplex)
NETWORK TOPOLOGY

• Network topology is the physical or logical arrangement of


devices and connections in a network.
• It defines how devices are connected to each other and how
data flows through the network

• Topology is defined as
• (1) The way in which a network is laid out physically.
• (2) The geometric representation of the relationship of all the
links and nodes to one-another.
TYPES OF NETWORK TOPOLOGY
1. Point to Point Topology
2. Mesh Topology
3. Star Topology
4. Bus Topology
5. Ring Topology
6. Tree Topology
7. Hybrid Topology
Point to Point Topology

• Point-to-point topology is a type of topology that works on the


functionality of the sender and receiver.
• It is the simplest communication between two nodes, in which one
is the sender and the other one is the receiver.
• Point-to-Point provides high bandwidth.
Mesh Topology
• Mesh technology is an arrangement of the network in which
computers are interconnected with each other through
various redundant connections.
• Thereare multiple paths from one computer to another
computer.
• Itdoes not contain the switch, hub or any central
computer which acts as a central point of communication.
• The Internet is an example of the mesh topology.
• Mesh topology is mainly used for WAN implementations.
• Mesh topology is mainly used for wireless networks.
• Advantages of Mesh Topology

• Communication is very fast between the nodes.


• Mesh Topology is robust.

• Disadvantages of Mesh Topology

• Installation and configuration are difficult.


• The cost of cables is high as bulk wiring is required, hence
suitable for less number of devices.
• The cost of maintenance is high
Bus topology
• Bus topology is a network type in which every computer and
network device is connected to single cable.
•  The long single cable acts as a backbone to link all the
devices in a network.
•  When it has exactly two endpoints, then it is called Bus
topology.
•  It transmits data only in one direction.
• If N devices are connected to each other in a bus topology, then the number of
cables required to connect them is 1, known as backbone cable, and N drop
lines are required.
• Coaxial or twisted pair cables are mainly used in bus-based networks
• The cost of the cable is less compared to other topologies, but it is used to
build small networks.
Advantages of Bus topology:

• Low-cost cable:
In bus topology, nodes are directly connected to the cable without passing
through a hub. Therefore, the initial cost of installation is low.

• Moderate data speeds:


Coaxial or twisted pair cables are mainly used in bus-based networks that
support upto 10 Mbps.

• Familiar technology:
Bus topology is a familiar technology as the installation and troubleshooting
techniques are well known, and hardware components are easily available.

• Limited failure:
A failure in one node will not have any effect on other nodes.
• Disadvantages of Bus topology:

• Extensive cabling: A bus topology is quite simpler, but still


it requires a lot of cabling.
• Reconfiguration difficult: Adding new devices to the
network would slow down the network.
Star Topology

• Star
topology is an arrangement of the network in which
every node is connected to the central hub, switch or a
central computer.
• The central computer is known as a server, and the
peripheral devices attached to the server are known
as clients.
• Coaxialcable or RJ-45 cables are used to connect the
computers.
• Hubsor Switches are mainly used as connection devices in
a physical star topology.
• Startopology is the most popular topology in network
implementation.
Advantages of Star topology
• Efficient troubleshooting: Troubleshooting is quite efficient
in a star topology as compared to bus topology.
• In a bus topology, the manager has to inspect the kilometers
of cable. In a star topology, all the stations are connected
to the centralized network.
• Therefore, the network administrator has to go to the
single station to troubleshoot the problem.

• Limited failure: As each station is connected to the central


hub with its own cable, therefore failure in one cable will
not affect the entire network.
• Cost effective: Star topology networks are cost-effective
as it uses inexpensive coaxial cable.
• High data speeds: It supports a bandwidth of approx
100Mbps. Ethernet 100BaseT is one of the most popular Star
topology networks.

Disadvantages of Star topology

•A Central point of failure: If the central hub or switch


goes down, then all the connected nodes will not be able to
communicate with each other.
Ring Topology

• In a Ring Topology, it forms a ring connecting devices with


exactly two neighboring devices.
• Ring topology is like a bus topology, but with connected ends.
• The data flows in one direction, i.e., it is unidirectional.
• The data flows in a single loop continuously known as an
endless loop.
• The data in a ring topology flow in a clockwise direction.
• Advantages of Ring topology:
• Cost: Twisted pair cabling is inexpensive and easily
available. Therefore, the installation cost is very low.
• Reliable: It is a more reliable network
• Disadvantages of Ring topology:
• Difficult troubleshooting: It requires specialized test
equipment to determine the cable faults. If any fault occurs
in the cable, then it would disrupt the communication
for all the nodes.
• Failure: The breakdown in one station leads to the failure of
the overall network.
• Reconfiguration difficult: Adding new devices to the
network would slow down the network.
Tree Topology
• Tree Topology is a topology which is having a tree structure in
which all the computers are connected like the branches
which are connected with the tree.
• In Computer Network, tree topology is called a combination of a
Bus and Star network topology.
• Advantages of Tree Topology:
• very flexible and also has better scalability.
• Tree network topology is considered to be the simplest
topology in all the topologies which is having only one route
between any two nodes on the network.

• Disadvantages of Tree Topology :


• If the central hub gets fails the entire system fails.
• The cost is high because of the cabling.
• If new devices are added, it becomes difficult to
reconfigure.
Hybrid Topology

• It is the combination of all the various types of topologies


such as Ring or Star topology or bus.
• Advantages of Hybrid Topology

• This topology is very flexible.


• The size of the network can be easily expanded by adding new
devices.

• Disadvantages of Hybrid Topology

• It is challenging to design the architecture of the Hybrid


Network.
• Hubs used in this topology are very expensive.
• The infrastructure cost is very high as a hybrid
network requires a lot of cabling and network devices.
• FAST-MESH TOPOLOGY/POINT-POINT
• EXPENSIVE-MESH TOPOLOGY
• BEST- MESH TOPOLOGY/STAR
• SLOW-BUS TOPOLOGY
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.
• There are mainly five types of Computer Networks
1.Personal Area Network (PAN)
2.Local Area Network (LAN)
3.Campus Area Network (CAN)
4.Metropolitan Area Network (MAN)
5.Wide Area Network (WAN)
1.Personal Area Network (PAN)

• PAN is the most basic type of computer network.


• It is a type of network designed to connect devices within a
short range, typically around one person.
• It allows your personal devices, like smartphones, tablets,
laptops, and wearables, to communicate and share data
with each other.
• PAN offers a network range of 1 to 100 meters from
person to device providing communication.
• Its transmission speed is very high with very easy
maintenance and very low cost.
• Examples of PAN are USB, computer, phone, tablet,
printer, PDA, etc.
Types of PAN
•Wireless Personal Area Networks: Wireless Personal Area Networks are created
by simply utilizing wireless technologies such as WiFi and Bluetooth. It is a low-
range network.

•Wired Personal Area Network: A wired personal area network is constructed using
• Advantages of PAN

• PAN is relatively flexible and provides high efficiency for short


network ranges.
• It needs easy setup and relatively low cost.
• It does not require frequent installations and maintenance
• It is easy and portable.

• Disadvantages of PAN
• Low network coverage area/range.
• Limited to relatively low data rates.
• Devices are not compatible with each other.
2. Local Area Network (LAN)

• LAN is the most frequently used network. A LAN is a computer


network that connects computers through a common
communication path, contained within a limited area, that
is, locally.
• A LAN encompasses two or more computers connected
over a server.
• The two important technologies involved in this network are
Ethernet and Wi-fi.
• It ranges up to 2km & transmission speed is very high
with easy maintenance and low cost.
• Examples of LAN are networking in a home, school, library,
laboratory, college, office, etc.
• Advantages of a LAN

• High Speed: LAN offers a much higher speed(around 100 mbps) and
data transfer rate comparatively to WAN.

• Disadvantages of LAN

• The initial setup costs of installing Local Area Networks is high


because there is special software required to make a server.
• Communication devices like an ethernet cable, switches, hubs,
routers, cables are costly.
• LANs are restricted in size and cover only a limited area
• Since all the data is stored in a single server computer, if it can be
accessed by an unauthorized user, can cause a serious data
3. Campus Area Network (CAN)

• CAN is bigger than a LAN but smaller than a MAN.


• This is a type of computer network that is usually used in
places like a school or colleges.
• This network covers a limited geographical area that is, it
spreads across several buildings within the campus.
• CAN mainly use Ethernet technology with a range from 1km
to 5km. Its transmission speed is very high with a moderate
maintenance cost and moderate cost.
• Examples of CAN are networks that cover schools, colleges,
buildings, etc.
• Advantages of CAN
• Speed: Communication within a CAN takes place over Local Area
Network (LAN) so data transfer rate between systems is little bit
fast than Internet.
• Security: Network administrators of campus take care of network
by continuous monitoring, tracking and limiting access.
• To protect network from unauthorized access firewall is placed
between network and internet.
• Cost effective: With a little effort and maintenance, network
works well by providing fast data transfer rate with multi-
departmental network access.
• It can be enabled wirelessly, where wiring and cabling costs can be
managed. So to work with in a campus using CAN is cost-
effective in view of performance
4 .M e tro p o lita n A re a N e tw o rk (M A N )

• A MAN is larger than a LAN but smaller than a WAN.


• This is the type of computer network that connects computers over
a geographical distance through a shared communication
path over a city, town, or metropolitan area.
• a range from 5km to 50km.
• Its transmission speed is average.
• It is difficult to maintain and it comes with a high cost.
• Examples of MAN are networking in towns, cities, a single large
city, a large area within multiple buildings, etc.
• 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.

• Advantages of MAN
MAN offers high-speed connectivity in which the speed ranges from
10-100 Mbps.
The security level in MAN is high and strict as compared to
WAN.
• Disadvantages of MAN
The architecture of MAN is quite complicated hence, it is hard to
design and maintain.
5. Wide Area Network (WAN)

• WAN is a type of computer network that connects computers


over a large geographical distance through a shared
communication path.
• It is not restrained to a single location but extends over
many locations.
• WAN can also be defined as a group of local area networks
that communicate with each other with a range above
50km.
• Here we use Leased-Line & Dial-up technology.
• Its transmission speed is very low and it comes with very
high maintenance and very high cost.
• The most common example of WAN is the Internet.
• Advantages of WAN
• It covers large geographical area which enhances the reach of
organization to transmit data cheaply.

• Disadvantages of WAN
• Traffic congestion in Wide Area Network is very high.
• Noise and error are present in large amount due to multiple
connection point.
PROTOCOL LAYERING

• In networking, a protocol defines the rules that both the sender and
receiver and all intermediate devices need to follow to be able to
communicate effectively.
•  A protocol provides a communication service that the process use to
exchange messages.
•  When communication is simple, we may need only one simple
protocol.
•  When the communication is complex, we may need to divide the
task between different layers, in which case we need a protocol at
each layer, or protocol layering.
•  Protocol layering is that it allows us to separate the services from
the implementation.
•  A layer needs to be able to receive a set of services from the
lower layer and to give the services to the upper layer.
•  Any modification in one layer will not affect the other layers.
First Scenario
• Let us consider two simple scenarios to better understand the need
for protocol layering
• First Scenario:
• In the first scenario, communication is so simple that it can
occur in only one layer.
• Assume Maria and Ann are neighbors with a lot of common ideas.
• Communication between Maria and Ann takes place in one layer,
face to face, in the same language, as shown in Figure 2.1.
• Even in this simple scenario, we can see that a set of rules
needs to be followed.
• First, Maria and Ann know that they should greet each other
when they meet.
• Second, they know that they should confine their vocabulary
to the level of their friendship.
• Third, each party knows that she should refrain from
speaking when the other party is speaking.
• Fourth, each party knows that the conversation should be a
dialog, not a monolog: both should have the opportunity to
talk about the issue.
• Fifth, they should exchange some nice words when they leave
Second scenario
• In the second scenario, we assume that Ann is offered a
higher-level position in her company, but needs to move to
another branch located in a city very far from Maria.
• The two friends still want to continue their communication
and exchange ideas because they have come up with an
innovative project to start a new business when they
both retire.
• They decide to continue their conversation using regular
mail through the post office.
• they do not want their ideas to be revealed by other people.
• They agree on an encryption/decryption technique.
• The sender of the letter encrypts it to make it unreadable
by an intruder; the receiver of the letter decrypts it to get
the original letter.
• Assume that Maria and Ann use one technique that makes it
hard to decrypt the letter if one does not have the key for
doing so. Now we can say that the communication between
Maria and Ann takes place in three layers, as shown in
Figure 2.2.
• We assume that Ann and Maria each have three machines (or
robots) that can perform the task at each layer.
• The third layer machine listens to what Maria says and
creates the plaintext (a letter in English), which is passed
by the second layer machine.
• The second layer machine takes the plaintext, encrypts it,
and creates the ciphertext, which is passed by the first
layer machine.
• The first layer machine puts it in an envelope, adds the
sender and receiver addresses, and mails it.
• Protocol layering enables us to divide a complex task into
several smaller and simpler tasks.
• Basic Elements of Layered Architecture
•  Service: It is a set of actions that a layer provides to the
higher layer.
•  Protocol: It defines a set of rules that a layer uses to
exchange the information with peer entity. These rules mainly
concern about both the contents and order of the messages
used.
•  Interface: It is a way through which the message is
transferred from one layer to another layer.
• Features of Protocol Layering
• 1. It decomposes the problem of building a network
into more manageable components.
• 2. It provides a more modular design.
Principles of Protocol Layering
• 1. The first principle dictates that if we want bidirectional communication,
we need to make each layer so that it is able to perform two opposite tasks,
one in each direction.
• For example, the third layer task is to listen (in one
direction) and talk (in the other direction). The second layer
needs to be able to encrypt and decrypt. The first layer
needs to send and receive mail.
• 2. The second principle that we need to follow in protocol layering is that the
two objects under each layer at both sites should be identical.
• For example, the object under layer 3 at both sites should be
a plaintext letter. The object under layer 2 at both sites
should be a ciphertext letter. The object under layer 1 at
both sites should be a piece of mail.
Logical Connection

• After following the above two principles, we can think about


logical connection between each layer as shown in Figure 2.3.
• This means that we have layer-to-layer communication.
• Maria and Ann can think that there is a logical (imaginary)
connection at each layer through which they can send the
object created from that layer
TCP/IP PROTOCOL SUITE

• Transmission Control Protocol (TCP) is a connection-oriented


protocol for communications that helps in the exchange of
messages between different devices over a network.
• The Internet Protocol (IP), which establishes the technique for sending
data packets between computers, works with TCP.
• Layered architecture
• Description of the Layer
OSI MODEL

• OSI stands for Open System Interconnection.


• The OSI model provides a theoretical foundation for
understanding network communication.
• It 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
• Data flows through the OSI model in a step-by-step process:
• Application Layer: Applications create the data.
• Presentation Layer: Data is formatted and encrypted.
• Session Layer: Connections are established and managed.
• Transport Layer: Data is broken into segments for reliable
delivery.
• Network Layer: Segments are packaged into packets and
routed.
• Data Link Layer: Packets are framed and sent to the next
device.
• Physical Layer: Frames are converted into bits and
transmitted physically.
FUNCTIONS OF THE OSI LAYERS

1. PHYSICAL LAYER
• The physical layer is responsible for carrying individual bits in a frame
across the link.
• Although the physical layer is the lowest level in the tcp/ip protocol
suite.
• The physical layer coordinates the functions required to transmit a bit
stream over a physical medium.

• The physical layer is concerned with the following functions:


 Physical characteristics of interfaces and media - The physical layer
defines the characteristics of the interface between the devices and the
transmission medium.
• Two devices are connected by a transmission medium (cable or air).
•  Representation of bits - To transmit the stream of bits, it must be
encoded to signals. The physical layer defines the type of encoding.
• Signals: It determines the type of the signal used for transmitting the
information.

•  Data Rate or Transmission rate - The number of bits sent each second –
is also defined by the physical layer.
•  Line Configuration - In a point-to-point configuration, two devices are
connected together through a dedicated link. In a multipoint configuration, a
link is shared between several devices.
• Transmission Mode - The physical layer also defines the direction of
transmission between two devices: simplex, half-duplex or full-duplex.
• 2. DATA LINK LAYER
• It is responsible for transmitting frames from one node to the next node. The
other responsibilities of this layer are
•  Framing - Divides the stream of bits received into data units called frames.
•  Physical addressing – If frames are to be distributed to different systems on
the network , data link layer adds a header to the frame to define the sender and
receiver.
•  Flow control- If the rate at which the data are absorbed by the receiver is less
than the rate produced in the sender ,the Data link layer imposes a flow ctrl
mechanism.
•  Error control- Used for detecting and retransmitting damaged or lost
frames and to prevent duplication of frames. This is achieved through a trailer
added at the end of the frame.
•  Medium Access control -Used to determine which device has control over the
link at any given time.
3. NETWORK LAYER

• This layer is responsible for the delivery of packets from source to destination.
• 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 other responsibilities of this layer are
•  Logical addressing - If a packet passes the network boundary, we need
another addressing system for source and destination called logical address. This
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.
4. TRANSPORT LAYER

• It is responsible for Process to Process delivery. That is responsible for


source-to- destination (end-to-end) delivery of the entire message,
• It also ensures whether the message arrives in order or not.
• The other responsibilities of this layer are
•  Port addressing / Service Point addressing - The header includes an
address called port address / service point address. This layer gets the entire
message to the correct process on that computer.
•  Segmentation and reassembly - The message is divided into segments and
each segment is assigned a sequence number. These numbers are arranged
correctly on the arrival side by this layer.
• Connection control - This can either be connectionless or connection
oriented.
•  The connectionless treats each segment as an individual packet and delivers
to the destination.
•  The connection-oriented makes connection on the destination side before
the delivery. After the delivery the termination will be terminated.
•  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 - Error control is performed end-to-end rather than across
the single link..
5. SESSION LAYER

• This layer establishes, manages and terminates connections between


applications. The other responsibilities of this layer are
•  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
6. PRESENTATION LAYER

• It is concerned with the syntax and semantics of information exchanged


between two systems.
• The other responsibilities of this layer are
•  Translation – Different computers use different encoding system, this
layer is responsible for interoperability between these different encoding
methods. It will change the message into some common format.
•  Encryption and decryption-It means that sender transforms the original
information to another form and sends the resulting message over the n/w.
and vice versa.
•  Compression and expansion-Compression reduces the number of bits
contained in the information particularly in text, audio and video.
7. APPLICATION LAYER

• This layer enables the user to access the network. It handles issues such as
network transparency, resource allocation, etc. This allows the user to log on
to remote user.
• The other responsibilities of this layer are
•  FTAM (File Transfer, Access, Management) - Allows user to access files
in a remote host.
•  Mail services - Provides email forwarding and storage.
•  Directory services - Provides database sources to access information about
various sources and objects.
Introduction to Sockets

• A socket is one endpoint of a two-way communication link


between two programs running on the network.
• The socket provides bidirectional FIFO Communication facility
over the network.
• A socket connecting to the network is created at each end of
the communication.
• Each socket has a specific address. This address is
composed of an IP address and a port number.
• Socket are generally employed in client server
applications.
• The server creates a socket, attaches it to a network port
addresses then waits for the client to contact it.
• The client creates a socket and then attempts to connect
to the server socket.
• When the connection is established, transfer of data takes
place.
Application layer Protocol
• World Wide Web-(WWW) And HTTP-(hypertext Transfer
Protocol)
• FTP-file Transfer Protocol
• E-mail Protocols-SMTP,POP3,IMAP,MIME
• Domain Name System -(DNS)
• SNMP-simple Network Management Protocol.
WORLD WIDE WEB (WWW) AND HTTP

• World Wide Web (abbreviated WWW or Web).


• The HyperText Transfer Protocol (HTTP), the most common
client server application program used in relation to the Web.
• The idea of the Web was first proposed by Tim Berners-Lee
in 1989 at CERN†, the European Organization for Nuclear
Research.
• The commercial Web started in the early 1990s.
• The Web today is a repository of information in which the
documents, called web pages, are distributed all over the
world and related documents are linked together.
• Linking allows one web page to refer to another web
page stored in another server somewhere else in the world.
The linking of web pages was achieved using a concept called
hypertext,
Architecture
• The WWW today is a distributed client-server service, in
which a client using a browser can access a service using a
server.
• However, the service provided is distributed over many
locations called sites. Each site holds one or more web
pages.
• Each web page, however, can contain some links to other
web pages in the same or other sites.
• In other words, a web page can be simple or composite.
• A simple web page has no links to other web pages; a
composite web page has one or more links to other web
pages.
• Each web page is a file with a name and address.
Web Client (Browser)
• A variety of vendors offer commercial browsers that
interpret and display a web page, and all of them use nearly
the same architecture.
• Each browser usually consists of three parts: a controller,
client protocols, and interpreters.
• The controller receives input from the keyboard or the
mouse and uses the client programs to access the
document.
• After the document has been accessed, the controller uses
one of the interpreters to display the document on the
screen.
• The client protocol can be one of the protocols described
later, such as HTTP or FTP.
• The interpreter can be HTML, Java, or JavaScript,
depending on the type of document.
• Some commercial browsers include Internet Explorer,
Netscape Navigator, and Firefox.
• Web Server
• The web page is stored at the server.
• Each time a request arrives, the corresponding document is
sent to the client
• Uniform Resource Locator (URL)
• A URL contains the following information which is listed below:
• Protocol name- http
• A colon followed by double forward-slash (://)
• Hostname (domain name) or IP address
• Port -A colon followed by port number (optional – unless specified otherwise, “:80” is
the default when using HTTP, and “:443” is the default when using HTTPS)
• Path-The path identifies the location and the name of the file in the underlying
• operating system.

https://www.geeksforgeeks.org/url-full-form
https://www.geeksforgeeks:80/filename
Web Documents
• The documents in the WWW can be grouped into three broad
categories: static, dynamic, and active.
Static Documents
• Static documents are fixed-content documents that are
created and stored in a server.
• The client can get a copy of the document only.
• The contents in the server can be changed, but the user
cannot change them. When a client accesses the document,
a copy of the document is sent.
• Static documents are prepared using one of several
languages:
• HyperText Markup Language (HTML), Extensible Markup
Language (XML), Extensible Style Language (XSL), and
Extensible Hypertext Markup Language (XHTML).
Dynamic Documents
• A dynamic web document does not exist in a predefined form.
• When a request arrives the web server runs an application
program that creates the document.
• The server returns the output of the program as a response
to the browser that requested the document.
• Because a fresh document is created for each request,
the contents of a dynamic document may vary from
one request to another.
• Scripting languages such as Java Server Pages (JSP), which
uses the Java language for scripting, or Active Server Pages
(ASP), a Microsoft product that uses Visual Basic language for
scripting,
Active Documents
• For many applications, we need a program or a script to
be run at the client site. These are called active
documents.
• For example, suppose we want to run a program that
creates animated graphics on the screen or a program
that interacts with the user.
• The program definitely needs to be run at the client site
where the animation or interaction takes place.
• When a browser requests an active document, the server
sends a copy of the document or a script.
• The document is then run at the client (browser) site.
HyperText Transfer Protocol (HTTP)

• HTTP stands for HyperText Transfer Protocol.


• It is a protocol used to access the data on the World
Wide Web (www).
• TheHTTP protocol can be used to transfer the data in the
form of plain text, hypertext, audio, video, and so on.
• The HyperText Transfer Protocol (HTTP) is used to define
how the client-server programs can be written to
retrieve web pages from the Web.
• An HTTP client sends a request; an HTTP server returns a
response.
• The server uses the port number 80; the client uses a
temporary port number.
• HTTP uses the services of TCP, which, as discussed before, is
a connection-oriented and reliable protocol.
• This means that, before any transaction between the
client and the server can take place, a connection
needs to be established between them.
• After the transaction, the connection should be terminated.
• The client and server, however, do not need to worry about
errors in messages exchanged or loss of any message,
because the TCP is reliable
Features of HTTP:

• Connectionless protocol:
• HTTP is a connectionless protocol. HTTP client initiates a
request and waits for a response from the server.
• When the server receives the request, the server processes
the request and sends back the response to the HTTP client
after which the client disconnects the connection.
• The connection between client and server exist only
during the current request and response time only.
• Stateless:
• HTTP is a stateless protocol as both the client and server
know each other only during the current request.
• Due to this nature of the protocol, both the client and
server do not retain the information between various
requests of the web pages.
• HTTP Connections
1.Non-Persistent
2.Persistent
Nonpersistent versus Persistent Connections

• If the web pages, objects to be retrieved, are located on


different servers, we do not have any other choice than to
create a new TCP connection for retrieving each object.
• However, if some of the objects are located on the same
server,
• we have two choices: to retrieve each object using a new
TCP connection or to make a TCP connection and
retrieve them all.
• The first method is referred to as a nonpersistent
connection, the second as a persistent connection.
Nonpersistent Connections

• In a nonpersistent connection, one TCP connection is


made for each request/response.
• The following lists the steps in this strategy:
• 1. The client opens a TCP connection and sends a request.
• 2. The server sends the response and closes the connection.
• 3. The client reads the data until it encounters an end-of-file
marker; it then closes the connection.
• The client needs to access a file that contains one link to an
image.
• The text file and image are located on the same server.
• Here we need two connections. For each connection, TCP
requires at least three handshake messages to
establish the connection, but the request can be sent with
the third one.
• After the connection is established, the object can be
transferred.
• After receiving an object, another three handshake
messages are needed to terminate the connection
• This means that the client and server are involved in two
connection establishments and two connection
terminations.
Persistent Connections

• HTTP version 1.1 specifies a persistent connection by default.


• In a persistent connection, the server leaves the connection open for more
requests after sending a response.
Cookies in HTTP

• An HTTP cookie (web cookie, browser cookie) is a little piece


of data that a server transmits to a user’s web
browser.
• When making subsequent queries, the browser may keep the
cookie and transmit it back to the same server.
• An HTTP cookie is typically used,
• A cookie is a small text file that a website sends to your
browser to store information about your browsing
activity.
FTP-FILE TRANSFER PROTOCOL
• File Transfer Protocol (FTP) is the standard protocol
provided by TCP/IP for copying a file from one host to
another.
• Although transferring files from one system to another seems
simple and straightforward, some problems must be dealt
with first.
• For example, two systems may use different file name
conventions.
• Two systems may have different ways to represent data.
• Two systems may have different directory structures.
• All of these problems have been solved by FTP in a very
simple and elegant approach.
• Although we can transfer files using HTTP, FTP is a better
choice to transfer large files or to transfer files using
different formats.
•  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 also used for downloading the files to computer
from other servers.

• FTP OBJECTIVES
•  It provides the sharing of files.
•  It is used to encourage the use of remote computers.
•  It transfers the data more reliably and efficiently.
• The above figure shows the basic model of the FTP.
•  The FTP client has three components:
• user interface, control process, and data transfer process.
•  The server has two components:
• server control process and server data transfer process.

• The control connection is made between the control


processes.
• The data connection is made between the data transfer
processes.
• Data transfer makes FTP more efficient.
• FTP CONNECTIONS
• There are two types of connections in FTP –

• Control Connection and Data Connection.


• The two connections in FTP have different lifetimes.
• The control connection remains connected during the entire
interactive FTP session.
• The data connection is opened and then closed for each file
transfer activity. When a user starts an FTP session, the control
connection opens.
• While the control connection is open, the data connection can be opened
and closed multiple times if several files are transferred.
• FTP uses two well-known TCP ports:
• Port 21 is used for the control connection
• Port 20 is used for the data connection.
• Control Connection:
• The control connection uses very simple rules for communication.
• The control connection is made between the control processes.
• The control connection remains connected during the entire interactive
FTP session.
• During this control connection, commands are sent from the client to
the server and responses are sent from the server to the client.
• Commands, which are sent from the FTP client control process, are in the
form of ASCII uppercase, which may or may not be followed by an
argument.
• 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.
• Every FTP command generates at least one response.
• A response has two parts: a three-digit number followed by text.
• The numeric part defines the code;
• the text part defines needed parameters or further explanations.
Security for FTP

• The FTP protocol was designed when security was not a big
issue.
• Although FTP requires a password, the password is sent in
plaintext (unencrypted), which means it can be intercepted
and used by an attacker.
• The data transfer connection also transfers data in plaintext,
which is insecure.
• To be secure, one can add a Secure Socket Layer between
the FTP application layer and the TCP layer. In this case FTP is
called SSL-FTP.
ELECTRONIC MAIL

• Electronic mail (or e-mail) allows users to exchange


messages.
• Message in mail not only contain text, but it also contains
images, audio and videos data.
• The person who is sending mail is called sender and person
who receives mail is called recipient.
• The basic components of an email system are : User Agent
(UA), Message Transfer Agent (MTA), Mail Box, and
Spool file
Mail User Agent (UA)
• A mail user agent, is a computer program that gives you
the ability to send and retrieve email through
interaction with the user.
• Some examples of mail user agents (MUAs), also known
as email clients, include:
• Microsoft Outlook: A popular desktop email client
• Mozilla Thunderbird: A popular desktop email client
• Apple Mail: A popular desktop email client
• Gmail: A popular mobile email client
• Proton Mail: A popular mobile email client
Message Transfer Agent (MTA)

• MTA is actually responsible for transfer of mail from one


system to another.
• To send a mail, a system must have client MTA and system
MTA.
• It transfer mail to mailboxes of recipients .
• The delivery from one MTA to another MTA is done by
Simple Mail Transfer Protocol.
Mailbox

• It is a file on local hard drive to collect mails.


• Delivered mails are present in this file.
• The user can read it delete it according to his/her
requirement.
• To use e-mail system each user must have a mailbox .
• Access to mailbox is only to owner of mailbox.
Spool file

• This file contains mails that are to be sent.


• User agent appends outgoing mails in this file using SMTP.
• MTA extracts pending mail from spool file for their
delivery.
Message Access Agent (MAA).

• A Message Access Agent (MAA) is a protocol used by email


clients to retrieve messages from a mail server.
• The two most common MAA protocols are the Post Office
Protocol 3 (POP3) and the Internet Message Access Protocol
(IMAP).
• When Alice needs to send a message to Bob, she runs a UA
program to prepare the message and send it to her mail
server.
• The mail server at her site uses a queue (spool) to store
messages waiting to be sent.
• The message, however, needs to be sent through the
Internet from Alice’s site to Bob’s site using an MTA.
• Here two message transfer agents are needed: one client and
one server.
• The user agent at the Bob site allows Bob to read the
received message.
• Bob later uses an MAA client to retrieve the message from
an MAA server running on the second server.
SMTP-SIMPLE MAIL TRANSFER PROTOCOL

• SMTP is an application layer protocol.


• Simple Mail Transfer mechanism (SMTP) is a mechanism for
exchanging email messages between servers.
• SMTP is a protocol for transmitting and receiving email
messages
• The client who wants to send the mail opens a TCP
connection to the SMTP server and then sends the mail
across the connection.
• The SMTP server is an always-on listening mode.
• As soon as it listens for a TCP connection from any client, the
SMTP process initiates a connection through port 25.
• After successfully establishing a TCP connection the client
process sends the mail instantly.
• The formal protocol that defines the MTA client and server in the Internet is
called Simple Mail Transfer Protocol (SMTP).
SMTP is used two times, between the sender and the sender’s mail server
and between the two mail servers.
As we will see shortly, another protocol is needed between the mail server
and the receiver.
SMTP simply defines how commands and responses must be sent back
and forth.
• Commands and Responses
• SMTP uses commands and responses to transfer messages between an MTA
client and an MTA server.
• The command is from an MTA client to an MTA server; the response is from an
MTA server to the MTA client.
• Commands :
• Commands are sent from the client to the server. The format of a command is
shown below:
Keyword: argument(s)
• Responses
• Responses are sent from the server to the client. A response is a three digit
code that may be followed by additional textual information.
Message Access Agent: POP and IMAP
• The first and second stages of mail delivery use SMTP.
• However, SMTP is not involved in the third stage because
SMTP is a push protocol; it pushes the message from
the client to the server.
• In other words, the direction of the bulk data (messages) is
from the client to the server. On the other hand, the third
stage needs a pull protocol;
• Client must pull messages from the server. The direction
of the bulk data is from the server to the client. The third
stage uses a message access agent.
• Currently two message access protocols are available:
• Post Office Protocol, version 3 (POP3) .
• Internet Mail Access Protocol, version 4 (IMAP4).
POP3
• POP 3 stands for Post Office Protocol Version 3.
• POP3 protocol is used to provide access to the mail
inbox that is stored in the email server.
• POP3 protocol can download and delete
messages.
• Mail access starts with the client when the user
needs to download its e-mail from the mailbox on the
mail server.
• The client opens a connection to the server on TCP
port 110.
• It then sends its user name and password to access the mailbox.
• The user can then list and retrieve the mail messages, one by one.
Figure 26.17 shows an example of downloading using POP3.
• The client on the right hand side because the e-mail receiver (Bob) is
running the client process to pull messages from the remote mail
server.
• POP3 has two modes: the delete mode and the keep mode.
• In the delete mode, the mail is deleted from the mailbox
after each retrieval.
• In the keep mode, the mail remains in the mailbox after
retrieval.
• The delete mode is normally used when the user is working at
her permanent computer and can save and organize the
received mail after reading or replying.
• The keep mode is normally used when the user accesses her
mail away from her primary computer (for example, from a
laptop).
• The mail is read but kept in the system for later retrieval
and organizing.
IMAP4

• Another mail access protocol is Internet Mail Access


Protocol, version 4 (IMAP4).
• IMAP4 is similar to POP3, but it has more features;
• IMAP4 is more powerful and more complex.
• POP3 is deficient in several ways. It does not allow the user to
organize her mail on the server; the user cannot have
different folders on the server.
• In addition, POP3 does not allow the user to partially
check the contents of the mail before downloading.
• IMAP4 provides the following extra functions:
• ❑ A user can check the e-mail header prior to downloading.
• ❑ A user can search the contents of the e-mail for a
specific string of characters prior to downloading.
• ❑ A user can partially download e-mail. This is especially
useful if bandwidth is limited and the e-mail contains
multimedia with high bandwidth requirements.
• ❑ A user can create, delete, or rename mailboxes on the
mail server.
• ❑ A user can create a hierarchy of mailboxes in a folder
for e-mail storage.
MIME
• MIME is a kind of add-on or a supplementary protocol that allows
non-ASCII data to be sent through SMTP.
• It allows the users to exchange different kinds of data files on the
Internet: audio, video, images, application programs as well.

• Features of MIME –
1.It is able to send multiple attachments with a single message.
2.Unlimited message length.
3.Binary attachments (executables, images, audio, or video files)
may be divided if needed.
4.MIME provided support for varying content types and multi-part
messages.
• MIME transforms non-ASCII data at the sender site to ASCII
data and delivers it to the client MTA to be sent through the
Internet.
• The message at the receiving site is transformed back to
the original data.
• We can think of MIME as a set of software functions that
transforms non-ASCII data to ASCII data and vice versa, as
shown in Figure 26.18.
Domain Name System (DNS)
• TCP/IP protocols use the IP address, which uniquely
identifies the connection of a host to the Internet.
However, people prefer to use names instead of numeric
addresses.
• Therefore, the Internet needs to have a directory system that
can map a name to an address.
• Domain Name System (DNS) is a hostname used for IP
address translation services.
• DNS is a distributed database implemented in a hierarchy of
name servers.
• It is an application layer protocol for message exchange
between clients and servers.
• It is required for the functioning of the Internet.
• What is the Need for DNS?
• Every host is identified by the IP address but remembering
numbers is very difficult for people also the IP addresses
are not static therefore a mapping is required to change the
domain name to the IP address.
• SoDNS is used to convert the domain name of the
websites to their numerical IP address.
A user wants to use a file transfer client to access the corresponding file transfer server
running on a remote host
The TCP/IP suite needs the IP address of the file transfer server to make the connection.
The following six steps map the host name to an IP address:
1. The user passes the host name to the file transfer client.
2. The file transfer client passes the host name to the DNS client.
3. The DNS client sends a message to a DNS server with a query that gives the file transfer
server name using the known IP address of the DNS server.
4. The DNS server responds with the IP address of the desired file transfer server.
5. The DNS server passes the IP address to the file transfer client.
6. The file transfer client now uses the received IP address to access the file transfer server.
• Types of Domain
• There are various kinds of domains:
• Generic
Domains: .com(commercial), .edu(educational), .mil(military)
, .org(nonprofit organization), .net(similar to commercial) all
these are generic domains.
• Country Domain: .in (India) .us .uk
• Inverse Domain: if we want to know what is the domain
name of the website. IP to domain name mapping. (eg:-
165.21.168.192.in-addr.arpa.)
Namespace/DNS Namespace
• A namespace is a context within which the names of all objects
must be unambiguously resolvable.
• Domain namespace refers to the hierarchical structure used for
organizing and identifying domain names on the Internet.
• It allows unique names to be assigned to websites and
resources.
• The domain namespace is composed of different levels, including
i.root
ii.top-level domains (TLDs)
iii. second-level domains
iv. subdomains.
Security of DNS

• DNS can be attacked in several ways including:


• 1. The attacker may read the response of a DNS server to find the
nature or names of sites the user mostly accesses. This type of
information can be used to find the user’s profile. To prevent this attack,
DNS messages need to be confidential .
• 2. The attacker may intercept the response of a DNS server and
change it or create a totally new bogus response to direct the user to the
site or domain the attacker wishes the user to access. This type of attack
can be prevented using message origin authentication and
message.
• 3. The attacker may flood the DNS server to overwhelm it or eventually
crash it. This type of attack can be prevented using the provision against
denial-of-service attack.
SNMP-SIMPLE NETWORK MANAGEMENT PROTOCOL

• Simple Network Management Protocol (SNMP) is an


Internet Standard protocol used for managing and
monitoring network-connected devices in IP networks.
• SNMP is an application layer protocol is used to monitor the
network, detect network faults, and sometimes even to
configure remote devices.
• SNMP uses the concept of manager and agent. That is, a
manager, usually a host, controls and monitors a set of
agents, usually routers or servers
SNMP is an application-level protocol in which a few manager
stations control a set of agents.
The protocol is designed at the application level so that it can
monitor
devices made by different manufacturers and installed on different
physical networks.
Managers and Agents

• A management station, called a manager, is a host that runs the SNMP


client program.
• A managed station, called an agent, is a router (or a host) that runs the
SNMP server program.
• Management is achieved through simple interaction between a
manager and an agent.
• The agent keeps performance information in a database.
• The manager has access to the values in the database.
• For example, a router can store in appropriate variables the number of
packets received and forwarded.
• The manager can fetch and compare the values of these two variables to
see if the router is congested or not.
• The manager can also make the router perform certain actions.
Components of SNMP

There are mainly three main components of SNMP


• SNMP Manager
• SNMP agent
• Management Information Base
• SNMP Manager:
• It is a centralized system used to monitor the network. It is
also known as a Network Management Station (NMS).
• A router that runs the SNMP server program is called an
agent, while a host that runs the SNMP client program is
called a manager.
• SNMP agent:
• It is a software management software module installed on a
managed device.
• The manager accesses the values stored in the database,
whereas the agent maintains the information in the database.
• Management Information Base:
• MIB consists of information on resources that are to be
managed.
• Characteristics of SNMP
• SNMP is used to monitor network
• It detects any network faults
• Can also be used to configure remote devices.
• Allows a standardized way of collecting information about
all kinds of devices from various manufacturers among the
networking industry.
• Advantages of SNMP
• It is simple to implement.
• Agents are widely implemented.
• Agent level overhead is minimal.
• It is robust and extensible.
• SNMP meet a critical need.

• Limitation of SNMP
• It is too simple and does not scale well.

You might also like