CN Unit-I Notes

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

CS3591 COMPUTER NETWORKS

UNIT I INTRODUCTION AND APPLICATION LAYER 10

1. Data Communication
2. Networks
3. Network Types
4. Protocol Layering
5. TCP/IP Protocol suite
6. OSI Model
7. Introduction to Sockets
8. Application Layer protocols: HTTP – FTP – Email protocols (SMTP - POP3 - IMAP - MIME)
– DNS – SNMP.

INTRODUCTION:

Data Communication:

What is Data Communication?

Data Communication is a process of exchanging data or information In case of computer networks


this exchange is done between two devices over a transmission medium. This process involves a
communication system which is made up of hardware and software.

Human beings are the only creatures on the earth who are able to communicate with each other
through the medium of language. But humans take this gift to another extent. Distance, time, and
physical existence of the person don’t matter in communication these days because they build a
communication system through which they can communicate or share data like images, videos, text,
files, etc with their loved ones anytime anywhere. Communication is defined as a process in which
more than one computer transfers information, instructions to each other and for sharing resources. Or
in other words, communication is a process or act in which we can send or receive data. A network of
computers is defined as an interconnected collection of autonomous computers. Autonomous means
no computer can start, stop or control another computer.

Components of Data Communication

A communication system is made up of the following components:

1. Message: A message is a piece of information that is to be transmitted from one person to


another. It could be a text file, an audio file, a video file, etc.
2. Sender: It is simply a device that sends data messages. It can be a computer, mobile,
telephone, laptop, video camera, or workstation, etc.
3. Receiver: It is a device that receives messages. It can be a computer, telephone mobile,
workstation, etc.
4. Transmission Medium / Communication Channels: Communication channels are the
medium that connect two or more workstations. Workstations can be connected by either
wired media or wireless media.
CS3591 COMPUTER NETWORKS

5. Set of rules (Protocol): When someone sends the data (The sender), it should be
understandable to the receiver also otherwise it is meaningless. For example, Sonali sends a
message to Chetan. If Sonali writes in Hindi and Chetan cannot understand Hindi, it is a
meaningless conversation.

Therefore, there are some set of rules (protocols) that is followed by every computer connected to the
internet and they are:

 TCP(Transmission Control Protocol): It is responsible for dividing messages into packets on


the source computer and reassembling the received packet at the destination or recipient
computer. It also makes sure that the packets have the information about the source of the
message data, the destination of the message data, the sequence in which the message data
should be re-assembled, and checks if the message has been sent correctly to the specific
destination.
 IP(Internet Protocol): Do You ever wonder how does computer determine which packet
belongs to which device. What happens if the message you sent to your friend is received by
your father? Scary Right. Well! IP is responsible for handling the address of the destination
computer so that each packet is sent to its proper destination.

Type of data communication

As we know that data communication is communication in which we can send or receive data from
one device to another. The data communication is divided into three types:

1. Simplex Communication: It is one-way communication or we can say that unidirectional


communication in which one device only receives and another device only sends data and
devices uses their entire capacity in transmission. For example, IoT, entering data using a
keyboard, listing music using a speaker, etc.
CS3591 COMPUTER NETWORKS

2. Half Duplex communication: It is a two-way communication or we can say that it is a


bidirectional communication in which both the devices can send and receive data but not at the
same time. When one device is sending data then another device is only receiving and vice-
versa. For example, walkie-talkie.
3. Full-duplex communication: It is a two-way communication or we can say that it is a
bidirectional communication in which both the devices can send and receive data at the same
time. For example, mobile phones, landlines, etc.

Communication Channels

Communication channels are the medium that connects two or more workstations. Workstations can
be connected by either wired media or wireless media. It is also known as a transmission medium. The
transmission medium or channel is a link that carries messages between two or more devices. We can
group the communication media into two categories:

 Guided media transmission


 Unguided media transmission

1. Guided Media: In this transmission medium, the physical link is created using wires or cables
between two or more computers or devices, and then the data is transmitted using these cables in terms
of signals. Guided media transmission of the following types:

1. Twisted pair cable: It is the most common form of wire used in communication. In a twisted-pair
cable, two identical wires are wrapped together in a double helix. The twisting of the wire reduces
the crosstalk. It is known as the leaking of a signal from one wire to another due to which signal can
corrupt and can cause network errors. The twisting protects the wire from internal crosstalk as well as
external forms of signal interference. Types of Twisted Pair Cable :

 Unshielded Twisted Pair (UTP): It is used in computers and telephones widely. As the
name suggests, there is no external shielding so it does not protects from external interference.
It is cheaper than STP.
 Shielded Twisted Pair (STP): It offers greater protection from crosstalk due to shield. Due to
shielding, it protects from external interference. It is heavier and costlier as compare to
UTP.

2. Coaxial Cable: It consists of a solid wire core that is surrounded by one or more foil or wire
shields. The inner core of the coaxial cable carries the signal and the outer shield provides the ground.
It is widely used for television signals and also used by large corporations in building security systems.
Data transmission of this cable is better but expensive as compared to twisted pair.

3. Optical fibers: Optical fiber is an important technology. It transmits large amounts of data at very
high speeds due to which it is widely used in internet cables. It carries data as a light that travels inside
a thin glass fiber. The fiber optic cable is made up of three pieces:

1. Core: Core is the piece through which light travels. It is generally created using glass or
plastic.
CS3591 COMPUTER NETWORKS

2. Cladding: It is the covering of the core and reflects the light back to the core.
3. Sheath: It is the protective covering that protects fiber cable from the environment.

2. Unguided Media: The unguided transmission media is a transmission mode in which the
signals are propagated from one device to another device wirelessly. Signals can wave through the
air, water, or vacuum. It is generally used to transmit signals in all directions. Unguided Media is
further divided into various parts :

1. Microwave: Microwave offers communication without the use of cables. Microwave signals
are just like radio and television signals. It is used in long-distance communication. Microwave
transmission consists of a transmitter, receiver, and atmosphere. In microwave communication,
there are parabolic antennas that are mounted on the towers to send a beam to another antenna.
The higher the tower, the greater the range.

2. Radio wave: When communication is carried out by radio frequencies, then it is termed
radio waves transmission. It offers mobility. It is consists of the transmitter and the receiver.
Both use antennas to radiate and capture the radio signal.

3. Infrared: It is short-distance communication and can pass through any object. It is generally
used in TV remotes, wireless mouse, etc.

II.Network Types

Types of Computer Networks

A computer network is a cluster of computers over a shared communication path that works for the
purpose of sharing resources from one computer to another, provided by or located on the network
nodes.

Some of the uses of computer networks are the following:

 Communicating using email, video, instant messaging, etc.


 Sharing devices such as printers, scanners, etc.
 Sharing files
 Sharing software and operating programs on remote systems
 Allowing network users to easily access and maintain information

Types of Computer Networks

1. Personal Area Network (PAN)


2. Local Area Network (LAN)
3. Wide Area Network (WAN)
4. Wireless Local Area Network (WLAN)
5. Campus Area Network (CAN)
6. Metropolitan Area Network (MAN)
CS3591 COMPUTER NETWORKS

7. Storage Area Network (SAN)


8. System-Area Network (SAN)
9. Passive Optical Local Area Network (POLAN)
10. Enterprise Private Network (EPN)
11. Virtual Private Network (VPN)
12. Home Area Network (HAN)

1. Personal Area Network (PAN) :


PAN is the most basic type of computer network. This network is restrained to a single person,
that is, communication between the computer devices is centered only to an individual’s work
space. PAN offers a network range of 10 meters from a person to the device providing
communication.
Examples of PAN are USB, computer, phone, tablet, printer, PDA, etc.

2. Local Area Network (LAN) :


LAN is the most frequently used network. A LAN is a computer network that connects
computers together 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.
CS3591 COMPUTER NETWORKS

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

The most common example of WAN is the Internet.


CS3591 COMPUTER NETWORKS

4. Wireless Local Area Network (WLAN) :


WLAN is a type of computer network that acts as a local area network but makes use of wireless
network technology like Wi-Fi. This network doesn’t allow devices to communicate over physical
cables like in LAN but allows devices to communicate wirelessly.

5.Metropolitan Area Network (MAN) :


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.

Examples of MAN are networking in towns, cities, a single large city, large area within multiple
buildings, etc.

6. Campus Area Network (CAN) :


CAN is bigger than a LAN but smaller than a MAN. This is a type of computer network which is
usually used in places like a school or college. This network covers a limited geographical area that is,
it spreads across several buildings within the campus.

Examples of CAN are networks that cover schools, colleges, buildings, etc.

7. Storage Area Network (SAN) :


SAN is a type of computer network that is high speed and connects groups of storage devices to
several servers. This network does not depend on LAN or WAN.. Instead, a SAN moves the storage
resources from the network to its own high-powered network. A SAN provides access to block-level
data storage.

Examples of SAN are a network of disks accessed by a network of servers.


CS3591 COMPUTER NETWORKS

8. System Area Network (SAN) :


A SAN is a type of computer network that connects a cluster of high-performance computers. It is a
connection-oriented and high bandwidth network. A SAN is a type of LAN that handles high amounts
of information in large requests. This network is useful for processing applications that require high
network performance.

Microsoft SQL Server 2005 uses SAN through virtual interface adapter.

9.Passive Optical Local Area Network (POLAN) :


A POLAN is a type of computer network which is an alternative to a LAN. POLAN uses optical
splitters to split an optical signal from a single strand of single mode optical fibre to multiple signals to
distribute users and devices. In short, POLAN is a point to multipoint LAN architecture.

10. Enterprise Private Network (EPN) :


EPN is a type of computer network mostly used by businesses that want a secure connection over
various locations to share computer resources.

11. Virtual Private Network (VPN) :


A VPN is a type of computer network that extends a private network across the internet and lets the
user send and receive data as if they were connected to a private network even though they are not.
Through a virtual point-to-point connection users can access a private network remotely. VPN protects
you from malicious sources by operating as a medium that gives you a protected network connection.

12. Home Area Network (HAN) :

Many of the houses might have more than a computer. To interconnect those computers and with other
peripheral devices, a network should be established similar to the local area network (LAN) within
that home. Such a type of network that allows a user to interconnect multiple computers and other
digital devices within the home is referred to as Home Area Network (HAN). HAN encourages
sharing of resources, files, and programs within the network. It supports both wired and wireless
communication.
CS3591 COMPUTER NETWORKS

protocol layering

What is protocol layering in computer network?

In networking, layering means to break up the sending of messages into separate components and
activities. Each component handles a different part of the communication. This can be referred to as
the Transmission Control Protocol/Internet Protocol (TCP/IP) model.

TCP/IP Model

Layers of OSI Model The OSI Model we just looked at is just a reference/logical model. It was
designed to describe the functions of the communication system by dividing the communication
procedure into smaller and simpler components. But when we talk about the TCP/IP model, it was
designed and developed by Department of Defense (DoD) in 1960s and is based on standard protocols.
It stands for Transmission Control Protocol/Internet Protocol. The TCP/IP model is a concise version
of the OSI model. It contains four layers, unlike seven layers in the OSI model. The layers are:

1. Process/Application Layer
2. Host-to-Host/Transport Layer
3. Internet Layer
4. Network Access/Link Layer
CS3591 COMPUTER NETWORKS
CS3591 COMPUTER NETWORKS
CS3591 COMPUTER NETWORKS

1. Network Access Layer –

This layer corresponds to the combination of Data Link Layer and Physical Layer of the OSI model. It
looks out for hardware addressing and the protocols present in this layer allows for the physical
transmission of data. We just talked about ARP being a protocol of Internet layer, but there is a
conflict about declaring it as a protocol of Internet Layer or Network access layer. It is described as
residing in layer 3, being encapsulated by layer 2 protocols.

The Network Access Layer is a layer in the OSI model that is responsible for establishing a connection
between a device and the physical network. It is responsible for transmitting and receiving data over
the physical medium of the network, such as a wire or wireless connection.

One common use case of the Network Access Layer is in networking devices, such as routers and
switches. These devices use the Network Access Layer to establish connections with other devices on
the network and transmit and receive data. For example, a router may use the Network Access Layer
to establish a connection with a device on the network and then forward data packets to and from that
device.

Another use case of the Network Access Layer is in communication devices, such as phones and
laptops. These devices use the Network Access Layer to establish a connection with a wireless or
wired network and transmit and receive data over that connection. For example, a phone may use the
Network Access Layer to connect to a wireless network and send and receive phone calls and text
messages.

2. Internet Layer –

This layer parallels the functions of OSI’s Network layer. It defines the protocols which are
responsible for logical transmission of data over the entire network. The main protocols residing at this
layer are :

1. IP – stands for Internet Protocol and it is responsible for delivering packets from the source
host to the destination host by looking at the IP addresses in the packet headers. IP has 2
versions: IPv4 and IPv6. IPv4 is the one that most of the websites are using currently. But IPv6
is growing as the number of IPv4 addresses are limited in number when compared to the
number of users.
2. ICMP – stands for Internet Control Message Protocol. It is encapsulated within IP datagrams
and is responsible for providing hosts with information about network problems.
3. ARP – stands for Address Resolution Protocol. Its job is to find the hardware address of a host
from a known IP address. ARP has several types: Reverse ARP, Proxy ARP, Gratuitous ARP
and Inverse ARP.

The Internet Layer is a layer in the Internet Protocol (IP) suite, which is the set of protocols that define
the Internet. The Internet Layer is responsible for routing packets of data from one device to another
across a network. It does this by assigning each device a unique IP address, which is used to identify
the device and determine the route that packets should take to reach it.
CS3591 COMPUTER NETWORKS

Here is an example of a use case for the Internet Layer:

Imagine that you are using a computer to send an email to a friend. When you click “send,” the email
is broken down into smaller packets of data, which are then sent to the Internet Layer for routing. The
Internet Layer assigns an IP address to each packet and uses routing tables to determine the best route
for the packet to take to reach its destination. The packet is then forwarded to the next hop on its route
until it reaches its destination. When all of the packets have been delivered, your friend’s computer
can reassemble them into the original email message.

In this example, the Internet Layer plays a crucial role in delivering the email from your computer to
your friend’s computer. It uses IP addresses and routing tables to determine the best route for the
packets to take, and it ensures that the packets are delivered to the correct destination. Without the
Internet Layer, it would not be possible to send data across the Internet.

3. Host-to-Host Layer –

This layer is analogous to the transport layer of the OSI model. It is responsible for end-to-end
communication and error-free delivery of data. It shields the upper-layer applications from the
complexities of data. The two main protocols present in this layer are :

1. Transmission Control Protocol (TCP) – It is known to provide reliable and error-free


communication between end systems. It performs sequencing and segmentation of data. It also
has acknowledgment feature and controls the flow of the data through flow control mechanism.
It is a very effective protocol but has a lot of overhead due to such features. Increased overhead
leads to increased cost.
2. User Datagram Protocol (UDP) – On the other hand does not provide any such features. It is
the go-to protocol if your application does not require reliable transport as it is very cost-
effective. Unlike TCP, which is connection-oriented protocol, UDP is connectionless.
1. HTTP and HTTPS – HTTP stands for Hypertext transfer protocol. It is used by the
World Wide Web to manage communications between web browsers and servers.
HTTPS stands for HTTP-Secure. It is a combination of HTTP with SSL(Secure Socket
Layer). It is efficient in cases where the browser need to fill out forms, sign in,
authenticate and carry out bank transactions.
2. SSH – SSH stands for Secure Shell. It is a terminal emulations software similar to
Telnet. The reason SSH is more preferred is because of its ability to maintain the
encrypted connection. It sets up a secure session over a TCP/IP connection.
3. NTP – NTP stands for Network Time Protocol. It is used to synchronize the clocks on
our computer to one standard time source. It is very useful in situations like bank
transactions. Assume the following situation without the presence of NTP. Suppose you
carry out a transaction, where your computer reads the time at 2:30 PM while the server
records it at 2:28 PM. The server can crash very badly if it’s out of sync.

The host-to-host layer is a layer in the OSI (Open Systems Interconnection) model that is responsible
for providing communication between hosts (computers or other devices) on a network. It is also
known as the transport layer.
CS3591 COMPUTER NETWORKS

Some common use cases for the host-to-host layer include:

1. Reliable data transfer: The host-to-host layer ensures that data is transferred reliably between
hosts by using techniques like error correction and flow control. For example, if a packet of
data is lost during transmission, the host-to-host layer can request that the packet be
retransmitted to ensure that all data is received correctly.
2. Segmentation and reassembly: The host-to-host layer is responsible for breaking up large
blocks of data into smaller segments that can be transmitted over the network, and then
reassembling the data at the destination. This allows data to be transmitted more efficiently and
helps to avoid overloading the network.
3. Multiplexing and demultiplexing: The host-to-host layer is responsible for multiplexing data
from multiple sources onto a single network connection, and then demultiplexing the data at
the destination. This allows multiple devices to share the same network connection and helps to
improve the utilization of the network.
4. End-to-end communication: The host-to-host layer provides a connection-oriented service that
allows hosts to communicate with each other end-to-end, without the need for intermediate
devices to be involved in the communication.

For example, consider a network with two hosts, A and B. Host A wants to send a file to host B. The
host-to-host layer in host A will break the file into smaller segments, add error correction and flow
control information, and then transmit the segments over the network to host B. The host-to-host layer
in host B will receive the segments, check for errors, and reassemble the file. Once the file has been
transferred successfully, the host-to-host layer in host B will acknowledge receipt of the file to host A.

In this example, the host-to-host layer is responsible for providing a reliable connection between host
A and host B, breaking the file into smaller segments, and reassembling the segments at the
destination. It is also responsible for multiplexing and demultiplexing the data and providing end-to-
end communication between the two hosts.

Layers of OSI Model

OSI stands for Open Systems Interconnection. It has been developed by ISO – ‘International
Organization for Standardization‘, in the year 1984. It is a 7 layer architecture with each layer
having specific functionality to perform. All these 7 layers work collaboratively to transmit the data
from one person to another across the globe.
CS3591 COMPUTER NETWORKS

1. Physical Layer (Layer 1) :

The lowest layer of the OSI reference model is the physical layer. It is responsible for the actual
physical connection between the devices. The physical layer contains information in the form of bits.
It is responsible for transmitting individual bits from one node to the next. When receiving data, this
layer will get the signal received and convert it into 0s and 1s and send them to the Data Link layer,
which will put the frame back together.

The functions of the physical layer are as follows:

1. Bit synchronization: The physical layer provides the synchronization of the bits by providing
a clock. This clock controls both sender and receiver thus providing synchronization at bit
level.
2. Bit rate control: The Physical layer also defines the transmission rate i.e. the number of bits
sent per second.
3. Physical topologies: Physical layer specifies the way in which the different, devices/nodes are
arranged in a network i.e. bus, star, or mesh topology.
4. Transmission mode: Physical layer also defines the way in which the data flows between the
two connected devices. The various transmission modes possible are Simplex, half-duplex and
full-duplex.
CS3591 COMPUTER NETWORKS

2. Data Link Layer (DLL) (Layer 2) :

The data link layer is responsible for the node-to-node delivery of the message. The main function of
this layer is to make sure data transfer is error-free from one node to another, over the physical layer.
When a packet arrives in a network, it is the responsibility of DLL to transmit it to the Host using its
MACaddress.
Data Link Layer is divided into two sublayers:

1. Logical Link Control (LLC)


2. Media Access Control (MAC)

The packet received from the Network layer is further divided into frames depending on the frame size
of NIC(Network Interface Card). DLL also encapsulates Sender and Receiver’s MAC address in the
header.

The Receiver’s MAC address is obtained by placing an ARP(Address Resolution Protocol) request
onto the wire asking “Who has that IP address?” and the destination host will reply with its MAC
address.

The functions of the Data Link layer are :

1. Framing: Framing is a function of the data link layer. It provides a way for a sender to
transmit a set of bits that are meaningful to the receiver. This can be accomplished by attaching
special bit patterns to the beginning and end of the frame.
2. Physical addressing: After creating frames, the Data link layer adds physical addresses (MAC
address) of the sender and/or receiver in the header of each frame.
3. Error control: Data link layer provides the mechanism of error control in which it detects and
retransmits damaged or lost frames.
CS3591 COMPUTER NETWORKS

4. Flow Control: The data rate must be constant on both sides else the data may get corrupted
thus, flow control coordinates the amount of data that can be sent before receiving
acknowledgement.
5. Access control: When a single communication channel is shared by multiple devices, the
MAC sub-layer of the data link layer helps to determine which device has control over the
channel at a given time.

3. Network Layer (Layer 3) :

The network layer works for the transmission of data from one host to the other located in
different networks. It also takes care of packet routing i.e. selection of the shortest path to
transmit the packet, from the number of routes available. The sender & receiver’s IP addresses
are placed in the header by the network layer.

The functions of the Network layer are :

1. Routing: The network layer protocols determine which route is suitable from source to
destination. This function of the network layer is known as routing.
2. Logical Addressing: In order to identify each device on internetwork uniquely, the network
layer defines an addressing scheme. The sender & receiver’s IP addresses are placed in the
header by the network layer. Such an address distinguishes each device uniquely and
universally.
CS3591 COMPUTER NETWORKS

** Network layer is implemented by networking devices such as routers.

4. Transport Layer (Layer 4) :

The transport layer provides services to the application layer and takes services from the network
layer. The data in the transport layer is referred to as Segments. It is responsible for the End to End
Delivery of the complete message. The transport layer also provides the acknowledgement of the
successful data transmission and re-transmits the data if an error is found.

At sender’s side: Transport layer receives the formatted data from the upper layers, performs
Segmentation, and also implements Flow & Error control to ensure proper data transmission. It also
adds Source and Destination port numbers in its header and forwards the segmented data to the
Network Layer.

Note: The sender needs to know the port number associated with the receiver’s application.

Generally, this destination port number is configured, either by default or manually. For example,
when a web application makes a request to a web server, it typically uses port number 80, because this
is the default port assigned to web applications. Many applications have default ports assigned.

At receiver’s side: Transport Layer reads the port number from its header and forwards the Data
which it has received to the respective application. It also performs sequencing and reassembling of
the segmented data.

The functions of the transport layer are as follows:

1. Segmentation and Reassembly: This layer accepts the message from the (session) layer, and
breaks the message into smaller units. Each of the segments produced has a header associated
with it. The transport layer at the destination station reassembles the message.
2. Service Point Addressing: In order to deliver the message to the correct process, the transport
layer header includes a type of address called service point address or port address. Thus by
specifying this address, the transport layer makes sure that the message is delivered to the
correct process.

The services provided by the transport layer :

A. Connection-Oriented Service: It is a three-phase process that includes

– Connection Establishment
– Data Transfer
– Termination / disconnection

In this type of transmission, the receiving device sends an acknowledgement, back to the source after a
packet or group of packets is received. This type of transmission is reliable and secure.
CS3591 COMPUTER NETWORKS

B. Connectionless service: It is a one-phase process and includes Data Transfer. In this type of
transmission, the receiver does not acknowledge receipt of a packet. This approach allows for much
faster communication between devices. Connection-oriented service is more reliable than
connectionless Service.

* Data in the Transport Layer is called as Segments.


** Transport layer is operated by the Operating System. It is a part of the OS and communicates with
the Application Layer by making system calls.
Transport Layer is called as Heart of OSI model.

5. Session Layer (Layer 5) :

This layer is responsible for the establishment of connection, maintenance of sessions, authentication,
and also ensures security.
The functions of the session layer are :

1. Session establishment, maintenance, and termination: The layer allows the two processes to
establish, use and terminate a connection.
2. Synchronization: This layer allows a process to add checkpoints which are considered
synchronization points into the data. These synchronization points help to identify the error so
that the data is re-synchronized properly, and ends of the messages are not cut prematurely and
data loss is avoided.
3. Dialog Controller: The session layer allows two systems to start communication with each
other in half-duplex or full-duplex.

**All the below 3 layers(including Session Layer) are integrated as a single layer in the TCP/IP
model as “Application Layer”.
**Implementation of these 3 layers is done by the network application itself. These are also known as
Upper Layers or Software Layers.

Scenario:

Let us consider a scenario where a user wants to send a message through some Messenger application
running in his browser. The “Messenger” here acts as the application layer which provides the user
with an interface to create the data. This message or so-called Data is compressed, encrypted (if any
secure data), and converted into bits (0’s and 1’s) so that it can be transmitted.
CS3591 COMPUTER NETWORKS

6. Presentation Layer (Layer 6):

The presentation layer is also called the Translation layer. The data from the application layer is
extracted here and manipulated as per the required format to transmit over the network.
The functions of the presentation layer are :

 Translation: For example, ASCII to EBCDIC.


 Encryption/ Decryption: Data encryption translates the data into another form or code. The
encrypted data is known as the ciphertext and the decrypted data is known as plain text. A key
value is used for encrypting as well as decrypting data.
 Compression: Reduces the number of bits that need to be transmitted on the network.

7. Application Layer (Layer 7) :

 At the very top of the OSI Reference Model stack of layers, we find the Application layer
which is implemented by the network applications. These applications produce the data, which
has to be transferred over the network. This layer also serves as a window for the application
services to access the network and for displaying the received information to the user.
 Example: Application – Browsers, Skype Messenger, etc.
 **Application Layer is also called Desktop Layer.

The functions of the Application layer are :

1. Network Virtual Terminal


2. FTAM-File transfer access and management
3. Mail Services
4. Directory Services
CS3591 COMPUTER NETWORKS

INTRODUCTION TO SOCKETS

A socket is one endpoint of a two-way communication link between two programs running on
the network. A socket is bound to a port number so that the TCP layer can identify the application
that data is destined to be sent to. An endpoint is a combination of an IP address and a port number.

An operating system is a piece of software that runs on the hardware of a computer. It oversees the
management of computer resources (such as printers, hard discs, RAM, and so on) along with user
CS3591 COMPUTER NETWORKS

processes for user-specific tasks. Network sockets enable user processes to communicate with each

other.
CS3591 COMPUTER NETWORKS

Socket in Computer Network

A socket is one endpoint of a two way communication link between two programs running on the
network. The socket mechanism provides a means of inter-process communication (IPC) by
establishing named contact points between which the communication take place.

Like ‘Pipe’ is used to create pipes and sockets is created using ‘socket’ system call. 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.
CS3591 COMPUTER NETWORKS
CS3591 COMPUTER NETWORKS

Application Layer protocols: HTTP – FTP – Email protocols (SMTP - POP3 - IMAP - MIME) –
DNS – SNMP.

Protocols in Application Layer

Application Layer:-

The application layer is present at the top of the OSI model. It is the layer through which users
interact. It provides services to the user.

Application Layer protocol:-

1. TELNET:

Telnet stands for the TELetype NETwork. It helps in terminal emulation. It allows Telnet clients to
access the resources of the Telnet server. It is used for managing files on the internet. It is used for
the initial setup of devices like switches. The telnet command is a command that uses the Telnet
protocol to communicate with a remote device or system. Port number of telnet is 23.

Command

telnet [\\RemoteServer]
\\RemoteServer : Specifies the name of the server to which you want to connect

2. FTP:

FTP stands for file transfer protocol. It is the protocol that actually lets us transfer files. It can
facilitate this between any two machines using it. But FTP is not just a protocol but it is also a
program.FTP promotes sharing of files via remote computers with reliable and efficient data
transfer. The Port number for FTP is 20 for data and 21 for control.

Command

ftp machinename

5. SMTP:

It stands for Simple Mail Transfer Protocol. It is a part of the TCP/IP protocol. Using a process
called “store and forward,” SMTP moves your email on and across networks. It works closely with
something called the Mail Transfer Agent (MTA) to send your communication to the right computer
and email inbox. The Port number for SMTP is 25.

Command
CS3591 COMPUTER NETWORKS

MAIL FROM:<mail@abc.com?

8. SNMP:

It stands for Simple Network Management Protocol. It gathers data by polling the devices on the
network from a management station at fixed or random intervals, requiring them to disclose certain
information. It is a way that servers can share information about their current state, and also a channel
through which an administrate can modify pre-defined values. The Port number of SNMP is
161(TCP) and 162(UDP).

Command

snmpget -mALL -v1 -cpublic snmp_agent_Ip_address sysName.0


9. DNS:

It stands for Domain Name System. Every time you use a domain name, therefore, a DNS service
must translate the name into the corresponding IP address. For example, the domain name
www.abc.com might translate to 198.105.232.4.
The Port number for DNS is 53.

Command

ipconfig /flushdns

10. DHCP:

It stands for Dynamic Host Configuration Protocol (DHCP). It gives IP addresses to hosts. There is
a lot of information a DHCP server can provide to a host when the host is registering for an IP address
with the DHCP server. Port number for DHCP is 67, 68.

Command

clear ip dhcp binding {address | * }

What are the differences between HTTP, FTP, and SMTP?

HTTP stands for Hyper Text Transfer Protocol, FTP for File Transfer Protocol, while SMTP stands for
Simple Mail Transfer Protocol. All three are used to transfer information over a computer network and
are an integral part of today’s internet.

Why do we need three Protocols for transferring files?


We need the three protocols as they all serve different purposes. These are HTTP, FTP, and SMTP.
CS3591 COMPUTER NETWORKS

1. HTTP is the backbone of the World Wide Web (WWW). It defines the format of messages
through which Web Browsers (like Firefox, Chrome) and Web Servers communicate, whilst
also defining how a web browser should respond to a particular web browser request.
2. FTP is the underlying protocol that is used to, as the name suggests, transfer files over a
communication network. It establishes two TCP connections: Control Connection to
authenticate the user, and Data Connection to transfer the files.
3. SMTP is what is used by Email servers all over the globe to communicate with each other so
that the assignment you submitted at 11:59 pm reaches your professor’s inbox within the
deadline.

HTTP:

HTTP stands for HyperText Transfer Protocol. It is invented by Tim Berner. HyperText is the type
of text which is specially coded with the help of some standard coding language called HyperText
Markup Language (HTML). HTTP/2 is the successor version of HTTP, which was published on May
2015. HTTP/3 is the latest version of HTTP, which is published in 2022. How it works ?
First of all, whenever we want to open any website then first we open web browser after that we will
type URL of that website (e.g., www.facebook.com ). This URL is now sent to Domain Name Server
(DNS). Then DNS first check records for this URL in their database, then DNS will return IP address
to web browser corresponding to this URL. Now browser is able to sent request to actual server.

After server sends data to client, connection will be closed. If we want something else from server we
should have to re-establish connection between client and server.

Characteristics of HTTP:

HTTP is IP based communication protocol which is used to deliver data from server to client or
vice-versa.

1. Server processes a request, which is raised by client and also server and client knows each
other only during current request and response period.
2. Any type of content can be exchanged as long as server and client are compatible with it.
3. Once data is exchanged then servers and client are no more connected with each other.
4. It is a request and response protocol based on client and server requirements.
5. It is connection less protocol because after connection is closed, server does not remember
anything about client and client does not remember anything about server.
6. It is stateless protocol because both client and server does not expecting anything from each
other but they are still able to communicate.

Email Protocols:

There are three common protocols used to deliver email over the Internet: the Simple Mail
Transfer Protocol (SMTP), the Post Office Protocol (POP), and the Internet Message Access
Protocol (IMAP). All three use TCP, and the last two are used for accessing electronic mailboxes.
CS3591 COMPUTER NETWORKS

Email protocols are a collection of protocols that are used to send and receive emails properly. The
email protocols provide the ability for the client to transmit the mail to or from the intended mail
server. Email protocols are a set of commands for sharing mails between two computers. Email
protocols establish communication between the sender and receiver for the transmission of email.
Email forwarding includes components like two computers sending and receiving emails and the mail
server. There are three basic types of email protocols.

Types of Email Protocols:

Three basic types of email protocols involved for sending and receiving mails are:

 SMTP
 POP3
 IMAP
 MIME

SMTP (Simple Mail Transfer Protocol):

 Simple Mail Transfer Protocol is used to send mails over the internet. SMTP is an
application layer and connection-oriented protocol. SMTP is efficient and reliable for
sending emails. SMTP uses TCP as the transport layer protocol. It handles the sending and
receiving of messages between email servers over a TCP/IP network.
 This protocol along with sending emails also provides the feature of notification for incoming
mails. When a sender sends an email then the sender’s mail client sends it to the sender’s mail
server and then it is sent to the receiver mail server through SMTP. SMTP commands are used
to identify the sender and receiver email addresses along with the message to be sent.
 Some of the SMTP commands are HELLO, MAIL FROM, RCPT TO, DATA, QUIT,
VERIFY, SIZE, etc. SMTP sends an error message if the mail is not delivered to the receiver
hence, reliable protocol.

POP(Post Office Protocol):

Post Office Protocol is used to retrieve email for a single client. POP3 version is the current version
of POP used. It is an application layer protocol. It allows to access mail offline and thus, needs less
internet time. To access the message it has to be downloaded. POP allows only a single mailbox to be
created on the mail server. POP does not allow search facilities

Some of the POP commands are LOG IN, STAT, LIST, RETR, DELE, RSET, and QUIT.

IMAP(Internet Message Access Protocol):

Internet Message Access Protocol is used to retrieve mails for multiple clients. There are several
IMAP versions: IMAP, IMAP2, IMAP3, IMAP4, etc. IMAP is an application layer protocol. IMAP
allows to access email without downloading them and also supports email download. The emails are
CS3591 COMPUTER NETWORKS

maintained by the remote server. It enables all email operations such as creating, manipulating,
delete the email without reading it. IMAP allows you to search emails. It allows multiple mailboxes
to be created on multiple mail servers and allows concurrent access. Some of the IMAP commands
are: IMAP_LOGIN, CREATE, DELETE, RENAME, SELECT, EXAMINE, and LOGOUT.

MIME(Multipurpose Internet Mail Extension Protocol):

Multipurpose Internet Mail Extension Protocol is an additional email protocol that allows non-
ASCII data to be sent through SMTP. It allows users to send and receive different types of data
like audio, images, videos and other application programs on the Internet. It allows to send multiple
attachments with single message. It allows to send message of unlimited length.

You might also like