Professional Documents
Culture Documents
SCENARIO:
Let’s 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.
6. Presentation Layer (Layer 6) :
Web proxy
Overview
Cookies
client server
Cookie file usual http request server
ebay: 8734 msg
usual http response + creates I
Set-cookie: 1678
1678 for u
Cookie file
usual http request
amazon: 1678 msg cookie-
ebay: 8734 cookie:
usual 1678
http response
specific
msg action
Packet Switching
Packet switching is a connectionless network switching
technique. Here, the message is divided and grouped into a
number of units called packets that are individually routed
from the source to the destination. There is no need to
establish a dedicated circuit for communication.
Process
Each packet in a packet switching technique has two parts: a
header and a payload. The header contains the addressing
information of the packet and is used by the intermediate
routers to direct it towards its destination. The payload carries
the actual data.
A packet is transmitted as soon as it is available in a node,
based upon its header information. The packets of a message
are not routed via the same path. So, the packets in the
message arrives in the destination out of order. It is the
responsibility of the destination to reorder the packets in
order to retrieve the original message.
The process is diagrammatically represented in the following
figure. Here the message comprises of four packets, A, B, C and
D, which may follow different routes from the sender to the
receiver.
Bit Torrent
The BitTorrent protocol can be used to reduce the server and
network impact of distributing large files. Rather than
downloading a file from a single source server, the BitTorrent
protocol allows users to join a "swarm" of hosts to upload
to/download from each other simultaneously. The protocol is
an alternative to the older single source, multiple mirror
sources technique for distributing data, and can work
effectively over networks with lower bandwidth. Using the
BitTorrent protocol, several basic computers, such as home
computers, can replace large servers while efficiently
distributing files to many recipients. This lower bandwidth
usage also helps prevent large spikes in internet traffic in a
given area, keeping internet speeds higher for all users in
general, regardless of whether or not they use the BitTorrent
protocol.
The first release of the Bittorrent client had no search engine
and no peer exchange, so users who wanted to upload a file
had to create a small torrent descriptor file that they would
upload to a torrent index site. The first uploader acted as
a seed, and downloaders would initially connect as peers.
(see diagram on the right) Those who wish to download the
file would download the torrent which their client would use
to connect to tracker which had a list of the IP addresses of
other seeds and peers in the swarm. Once a peer completed
a download of the complete file, it could in turn function as a
seed.
The file being distributed is divided
into segments called pieces. As each peer receives a new
piece of the file, it becomes a source (of that piece) for other
peers, relieving the original seed from having to send that
piece to every computer or user wishing a copy. With
BitTorrent, the task of distributing the file is shared by those
who want it; it is entirely possible for the seed to send only a
single copy of the file itself, and eventually distribute to an
unlimited number of peers. Each piece is protected by
a cryptographic hash contained in the torrent
descriptor.[6] This ensures that any modification of the piece
can be reliably detected, and thus prevents both accidental
and malicious modifications of any of the pieces received at
other nodes. If a node starts with an authentic copy of the
torrent descriptor, it can verify the authenticity of the entire
file it receives.
Pieces are typically downloaded non-sequentially, and are
rearranged into the correct order by the BitTorrent client,
which monitors which pieces it needs, and which pieces it has
and can upload to other peers. Pieces are of the same size
throughout a single download (for example a 10 MB file may
be transmitted as ten 1 MB pieces or as forty 256 KB pieces).
Due to the nature of this approach, the download of any file
can be halted at any time and be resumed at a later date,
without the loss of previously downloaded information,
which in turn makes BitTorrent particularly useful in the
transfer of larger files. This also enables the client to seek out
readily available pieces and download them immediately,
rather than halting the download and waiting for the next
(and possibly unavailable) piece in line, which typically
reduces the overall time of the download. This eventual
transition from peers to seeders determines the overall
"health" of the file (as determined by the number of times a
file is available in its complete form).
The distributed nature of BitTorrent can lead to a flood-
like spreading of a file throughout many peer computer
nodes. As more peers join the swarm, the likelihood of a
successful download by any particular node increases.
Relative to traditional Internet distribution schemes, this
permits a significant reduction in the original distributor's
hardware and bandwidth resource costs. Distributed
downloading protocols in general
provide redundancy against system problems, reduce
dependence on the original distributor,[9] and provide
sources for the file which are generally transient and
therefore there is no single point of failure as in one way
server-client transfers
Napster
Napster is a different way to distribute MP3 files. Instead of
storing the songs on a central computer, the songs live on
users's machines. When you want to download a song using
Napster, you are downloading it from another person's
machine, and that person could be your next door neighbor
or someone halfway around the world. Individuals tend to be
less concerned about copyright laws than businesses like
mp3.com have to be, so individuals make all sorts of
copyrighted songs available to the world from their personal
machines. This means that anyone can download, for free,
any song that someone has taken the time to encode in the
MP3 format
Session Layer
Session layer is one of the most important layers in the OSI
model because it is responsible for two important things in
the computer networks i.e. authorization and authentication.
Let’s talk more about the basics of the session layer below.
Session management
As its name suggests, the session layer is responsible for
managing a session which includes opening, closing and
managing a session between end-user application processes.
You can think of session layer as the main layer which
handles the requests and responses between the two
applications.
Authentication
Before establishing a session with some network peer, it is
important for one of the computers to know that another
peer it is communicating to is a legitimate one. In short
terms, you can say that authentication is the process of
verifying that "you are who you say you are".
Authorization
Authorization is more like "Are you authorized to do so?"
Here is an example:
Purpose-
It is mainly used for the retrieval of data from websites throughout the internet.
It works on the top of TCP/IP suite of protocols.
Working-
Then-
HTTP opens a connection between the client and server through TCP.
HTTP sends a request to the server which collects the requested data.
HTTP sends the response with the objects back to the client.
HTTP closes the connection.
Working-
NOTE-
Characteristics of SMTP-
Working-
FTP establishes two TCP connections between the client and the server.
One connection is used for transferring data.
Other connection is used for transferring control information.
Characteristics of FTP-
Important Notes-
Note-01:
Emails can’t be sent using FTP.
This is because-
FTP requires the connection establishment between the client and server before
transferring the files.
So, both have to be online at the same time.
That is why, emails are not sent using FTP.
Note-02:
FTP is used for transferring one file at a time in either direction between the client and
the server.
Note-03:
This is because-
The client establishes control connection for the duration of an FTP session.
It typically spans multiple data transfers.
So, FTP is a stateful protocol.