SlideShare a Scribd company logo
INDIAN INSTITUTE OF TECHNOLOGY
KHARAGPUR
Department of Computer Science
and Engineering
Sandip Chakraborty
sandipc@cse.iitkgp.ac.in
Rajat Subhra Chakraborty
rschakraborty@cse.iitkgp.ac.in
CS 31006: Computer Networks – Application Layer
Indian Institute of Technology Kharagpur
Software, Kernel
Firmware, Device Driver
Hardware
Protocol Stack Implementation in a Host
Physical
Data Link
Network
Transport
Application
Indian Institute of Technology Kharagpur
How Application Data Passes Through Different Layers
Physical
Data Link
Network
Transport
Application
HTTP Data
HTTP
Header
HTTP Data
HTTP
Header
TCP
Header
HTTP Data
HTTP
Header
TCP
Header
IP
Header
HTTP Data
HTTP
Header
TCP
Header
IP
Header
MAC
Header
HTTP Data
HTTP
Header
TCP
Header
IP
Header
MAC
Header
PHY
Header
PHY
Trailer
Indian Institute of Technology Kharagpur
Application Layer Interfacing
UDP
End to end
packet delivery
TCP
Connection
Establishment
Reliable Data
Delivery
Flow and
Congestion
Control
Ordered Packet
Delivery
Network
Transport
Application - 1
Data Link
Application - 2 Application - 3 Application - 4
Indian Institute of Technology Kharagpur
Application Layer Interfacing
UDP
End to end
packet delivery
TCP
Connection
Establishment
Reliable Data
Delivery
Flow and
Congestion
Control
Ordered Packet
Delivery
Network
Transport
Name Service
(DNS)
Data Link
Web
(HTTP)
Email
(SMTP, POP, IMAP)
File Transfer
(FTP)
Indian Institute of Technology Kharagpur
• Assign Unique names to an IP address (machine interface)
• ARPANET – a file hosts.txt listed all the computer names and their IP
addresses.
• Resolve the host name conflicts over the Internet – a naming hierarchy needs
to be managed
• Rooted at an organization Internet Corporation for Assigned Names and Numbers
(ICANN)
Domain Name System (DNS)
Indian Institute of Technology Kharagpur
The DNS Name Space
• The top level domains are run by registrars appointed by ICANN
• Name registrar for India (.in domain): registry.in (National Internet Exchange
of India – NIXI)
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Indian Institute of Technology Kharagpur
registry.in
Indian Institute of Technology Kharagpur
Registrars Under registry.in
Indian Institute of Technology Kharagpur
• The Domain Name Space and Resource Records: Specifications for a tree-
structured namespace and data associated with names.
• Name Servers: Server programs which hold information about the domain
tree’s structure and set information
• A particular name server has complete information about a subset of the domain
space
• Name servers know the parts of the domain tree for which they have complete
information -- a name server is said to be an AUTHORITY for this parts of the
namespace
Elements of DNS (RFC 1034)
Indian Institute of Technology Kharagpur
• Divide registries into non-overlapping zones – every zone has a name server
Name Servers
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Indian Institute of Technology Kharagpur
• The Domain Name Space and Resource Records: Specifications for a tree-
structured namespace and data associated with names.
• Name Servers: Server programs which hold information about the domain
tree’s structure and set information
• A particular name server has complete information about a subset of the domain
space
• Name servers know the parts of the domain tree for which they have complete
information -- a name server is said to be an AUTHORITY for this parts of the
namespace
• Resolvers: Program that extracts information from name servers in response
to client requests
Elements of DNS (RFC 1034)
Indian Institute of Technology Kharagpur
• Every domain has a set of resource records associated with it – DNS
database
Domain Resource Records
Indian Institute of Technology Kharagpur
• Domain_name: Domain to which the record applies.
• Time_to_live: Time for which this record is active – volatile records may be
assigned a small value
• Class: Normally IN – Internet resources
• Type: What type of record it is
• Value: Value of the record (IP address for A record type)
Domain Resource Records
Indian Institute of Technology Kharagpur
• A Type Records:
cse.iitkgp.ac.in 86400 IN A 203.110.245.250
• CNAME Type Records:
iitkgp.ac.in 86400 IN CNAME www.iitkgp.ac.in
• PTR Type Records:
172.16.5.33 86400 IN PTR www.iitkgp.ac.in
Domain Resource Records
Indian Institute of Technology Kharagpur
Sample DNS Database
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Indian Institute of Technology Kharagpur
Name Resolution – Looking Up for the Names
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Indian Institute of Technology Kharagpur
DNS Packet Structure
Indian Institute of Technology Kharagpur
Name Resolution (nslookup)
One of the name servers for IITKGP
Indian Institute of Technology Kharagpur
Name Resolution (dig)
An authoritative record
is one that comes from
the authority that
manages the record,
and thus is always
correct
UDP Message for
4096 bytes
Indian Institute of Technology Kharagpur
• UDP is much faster. TCP requires handshake time. DNS uses a cascading
approach for name resolution. With TCP, for every message, a connection
setup is required.
• DNS requests and responses are generally very small, and fits well within one
UDP segment.
• UDP is not reliable. In DNS, reliability is ensured at the application layer.
After timeout, the DNS client sends back the requests. After few consecutive
timeouts (can be set at the client), the request is aborted with an error.
Why DNS Uses UDP
Indian Institute of Technology Kharagpur
Application Layer Interfacing
UDP
End to end
packet delivery
TCP
Connection
Establishment
Reliable Data
Delivery
Flow and
Congestion
Control
Ordered Packet
Delivery
Network
Transport
Name Service
(DNS)
Data Link
Web
(HTTP)
Email
(SMTP, POP, IMAP)
File Transfer
(FTP)
Indian Institute of Technology Kharagpur
• Hypertext - A way to represent web
content (text along with formatting)
• Hypertext Markup Language (HTML) - A
scripting language to specify web data
along with simple formatting (bold, italics,
new line).
• A way to convert text based information to
graphics based information
• Today’s era: Many graphics, scripts and
other information are embedded inside
HTML – CSS, JavaScript etc.
The Web – Hypertext Transfer Protocol (HTTP)
Indian Institute of Technology Kharagpur
Differences between HTML Versions
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Indian Institute of Technology Kharagpur
• 1989 (CERN – European Center for Nuclear Research) – help large teams to
collaborate using a constantly changing collection of reports, blueprints,
drawings, photos and other documents
• The proposal came from Tim Berners-Lee
• A public demonstration at Hypertext ‘91 conference
• 1993 – The first graphical browser (Mosaic) developed by Marc Andreessen,
University of Illinois
• Andreessen formed the company Netscape Communications Corp
• Microsoft developed Internet Explorer – “browser war” between Internet Explorer
and Netscape Navigator
• 1994 – CERN and MIT signed an agreement to setup World Wide Web
Consortium (W3C)
A History of the Web
Indian Institute of Technology Kharagpur
The Web – Architectural Overview
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Indian Institute of Technology Kharagpur
• Three questions to be answered for accessing a web page
• What is the page called? (courses.html)
• Where is the page located? (cse.iitkgp.ac.in/~sandipc/)
• How can the page be accessed? (http://)
• Uniform Resource Locator (URL): Each page is assigned a URL that effectively
serves the page’s worldwide name
• URL have three components:
• The protocol
• The qualified name of the machine one which the page is located
• The path uniquely indicating the specific page
HTTP – The Client Side
http://cse.iitkgp.ac.in/~sandipc/courses.html
Indian Institute of Technology Kharagpur
• The browser determines the URL
• The browser asks DNS for the IP address of the server cse.iitkgp.ac.in
• DNS replies with 203.110.245.250
• The browser makes a TCP connection to 203.110.245.250 on port 80, the
well known port for the HTTP protocol (Note: https uses 443)
• It sends over an HTTP request asking for the page ~sandipc/courses.html
• The cse.iitkgp.ac.in server sends the page as an HTTP response, for example
by sending the file /courses.html
• If the page includes URLS that are needed for display, the browser fetches
the other URLs using the same process
The Steps When You Click http://cse.iitkgp.ac.in/~sandipc/courses.html
Indian Institute of Technology Kharagpur
The Steps When You Click http://cse.iitkgp.ac.in/~sandipc/courses.html
Indian Institute of Technology Kharagpur
• The browser displays the page courses.html
• The TCP connections are released if there are no other requests to the same
server for a short period.
The Steps When You Click http://cse.iitkgp.ac.in/~sandipc/courses.html
Indian Institute of Technology Kharagpur
• Generalization of the URLs – specifies the pages only or partially refers the pages
without complete locations
• /images/iit_kgp.png – may become URL
https://cse.iitkgp.ac.in/images/iit_kgp.png if accessed from cse.iitkgp.ac.in
Uniform Resource Identifier (URI)
Indian Institute of Technology Kharagpur
• Accept a TCP connection from a client (a browser).
• Get the path to the page, which is the name of the file requested.
• Get the file (from disk).
• Sends the content of the file to the client.
• Release (close) the TCP connection.
HTTP – The Server Side
Indian Institute of Technology Kharagpur
Multi-Threaded Server
Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
Serves multiple client
requests simultaneously
Indian Institute of Technology Kharagpur
• HTTP uses TCP to set up a connection between the server and the client. In
general, HTTP server runs at port 80 (default port) or 8080 (alternate port).
• HTTP 1.0 – After the connections were established, a single request was sent
over and a single response was sent back. Then the TCP connections are
released.
• Create separate connections for every content in the web-page. Overhead is high.
• Persistent Connection (HTTP 1.1) – send additional requests and additional
responses in a single TCP connection (connection reuse).
• It is also possible to pipeline requests.
Connections
Indian Institute of Technology Kharagpur
Connections
HTTP 1.0 HTTP 1.1 – Persistent
Connections
HTTP 1.1 – Persistent
Connections (Pipelined)
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Persistent Connections:
Set at keep-alive
information in the HTTP
header (HTTP 1.0)
HTTP 1.1 – All connections
are by default persistent
Indian Institute of Technology Kharagpur
• Specifies what a HTTP Request will do
• GET filename HTTP/1.1
HTTP Request Methods
Indian Institute of Technology Kharagpur
HTTP Request Header Fields (Partial List)
Indian Institute of Technology Kharagpur
• Specifies the status of the request message.
HTTP Response
Indian Institute of Technology Kharagpur
HTTP Response Header Fields (Partial List)
Indian Institute of Technology Kharagpur
HTTP Caching
Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
Indian Institute of Technology Kharagpur
Dynamic Web Applications
Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
Indian Institute of Technology Kharagpur
• HTTP is by default a stateless protocol
• Every Response corresponds to the previous Request only, it does not remember any
state information, such as last page accessed
• Use Cookies to store the state information. Client forwards the additional
information along with the Request message by reading the cookie.
Cookies
Indian Institute of Technology Kharagpur
• Intercepts the TCP connections to process the HTTP data.
HTTP Proxy
HTTP Proxy
Indian Institute of Technology Kharagpur
Application Layer Interfacing
UDP
End to end
packet delivery
TCP
Connection
Establishment
Reliable Data
Delivery
Flow and
Congestion
Control
Ordered Packet
Delivery
Network
Transport
Name Service
(DNS)
Data Link
Web
(HTTP)
Email
(SMTP, POP, IMAP)
File Transfer
(FTP)
Indian Institute of Technology Kharagpur
Electronic Mails – Architecture and Services
• User Agent: Allow people to read and send emails.
• Message Transfer Agents (main servers): Move the message from the source
to the destination
sandipc@cse.iitkgp.ernet.in
sukumar@iitg.ernet.in
cse.iitkgp.ernet.in
iitg.ernet.in
Indian Institute of Technology Kharagpur
• System processes run in the background on mail servers (always available).
• Automatically move emails through the system from the originator to the
recipient
• Uses Simple Mail Transfer Protocol (SMTP) – RFC 821, RFC 5321
• Implements mailing lists, an identical copy of message is delivered to
everyone in the list (btech@iitkgp.ac.in)
• Implements Mailboxes, to store all the emails received for a user
Message Transfer Agents
Indian Institute of Technology Kharagpur
• An envelope containing message header and message body
Message Format (RFC 5322)
Indian Institute of Technology Kharagpur
• Header fields (for message transport):
The Internet Message Format (RFC 5322)
Indian Institute of Technology Kharagpur
• Header fields (additional fields for message description):
The Internet Message Format (RFC 5322)
Indian Institute of Technology Kharagpur
• ARPANET: email consisted exclusively of text messages written in English and
expressed in ASCII
• MIME: Use multi-language and multimedia contents (audio, image etc.)
inside an email.
• Additional message headers for MIME:
MIME – The Multipurpose Internet Mail Extension
Indian Institute of Technology Kharagpur
• Uses SMTP Protocol
• Email is delivered by having the sending computer establishing TCP
connection to port 25 of the receiving computer.
Message Transfer
SMTP Server
(Port 25)
SMTP Client
(Port ANY)
SMTP Server
(Port 25)
SMTP Client
(Port ANY)
UA – SMTP
Client
Port ANY TCP TCP
sandipc@cse.iitkgp.ernet.in cse.iitkgp.ernet.in iitg.ernet.in
SMTP SMTP
Indian Institute of Technology Kharagpur
Message Transfer (SMTP)
Source: Computer Networks
(5th Edition) by Tanenbaum,
Wetherell
Indian Institute of Technology Kharagpur
• Pull type protocol – UA at the receiver side pulls the emails from mail server
after login.
• Post Office Protocol, Version 3 (POP3) – an earlier protocol for email delivery
• Internet Message Access Protocol, Version 4 (IMAP v4) – RFC 3501
• The email server runs an IMAP server at port 143
• The user agent runs IMAP client
• The client connects to the server and issues mail delivery commands
Final Delivery
Indian Institute of Technology Kharagpur
IMAP (Version 4) Commands
Indian Institute of Technology Kharagpur
Application Layer Interfacing
UDP
End to end
packet delivery
TCP
Connection
Establishment
Reliable Data
Delivery
Flow and
Congestion
Control
Ordered Packet
Delivery
Network
Transport
Name Service
(DNS)
Data Link
Web
(HTTP)
Email
(SMTP, POP, IMAP)
File Transfer
(FTP)
Indian Institute of Technology Kharagpur
• Is built on a client-server model (RFC 959)
• The client requests for the file or send the file to the server
• The server responses with the file data or store the file at the file server
• Works in two modes – Active and Passive
File Transfer Protocol (FTP)
File Server
(FTP Server)
User
(FTP Client)
File Request
File Response Status
File Data
Indian Institute of Technology Kharagpur
Active and Passive Modes of File Transfer
FTP server uses two different ports:
Port 21 (Command or Control
Port): For command message
transfer
Port 20 or Client assigned (Data
Port): For data transfer
Image Source: http://henrydu.com/blog/how-to/ftp-active-mode-vs-passive-mode-106.html
Indian Institute of Technology Kharagpur
• Specifically to avoid busy waiting, and keep the command channel
lightweight.
• You can always use a multiplexing between command/control and data,
but FTP is used for large file transfer; if command channel is used for data
transfer as well, the commands for other clients may experience a higher
queuing delay while one client is being served.
• The clients can continue sending and receiving control information while
data transfer is being take place
Why There are Two Channels – Command Channel and Data Channel
Indian Institute of Technology Kharagpur
Why There are Two Modes in FTP?
Active Mode: Client informs the
port number where it is listening,
and the server initiates the TCP
connection to that port (TCP server
is running at the client side)
What If the client is behind a firewall and can not
accept a connection?
Indian Institute of Technology Kharagpur
Why There are Two Modes in FTP?
Passive Mode: The server selects a
random port, and the client
initiates a TCP connection to that
server port.
The server can serve multiple
clients at different server data
ports through different threads.
The clients always initiate the
command and the data transfer.
Image Source: http://henrydu.com/blog/how-to/ftp-active-mode-vs-passive-mode-106.html
Indian Institute of Technology Kharagpur
• Stream mode: Data is sent as a continuous stream, relieving FTP from doing
any processing. Rather, all processing is left up to TCP. No End-of-file
indicator is needed, unless the data is divided into records.
• Block mode: FTP breaks the data into several blocks (block header, byte
count, and data field) and then passes it on to TCP.
• Compressed mode: Data is compressed using a simple algorithm
(usually run-length encoding).
FTP Data Transfer Modes
Source: Wikipedia
Indian Institute of Technology Kharagpur
FTP Sample Commands and Response Codes
Indian Institute of Technology Kharagpur
• Next, we’ll go for the Transport Layer ….

More Related Content

Similar to application_layer (1).pdf

Opal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsOpal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific Applications
Sriram Krishnan
 
Demystifying SharePoint Infrastructure – for NON-IT People
 Demystifying SharePoint Infrastructure – for NON-IT People  Demystifying SharePoint Infrastructure – for NON-IT People
Demystifying SharePoint Infrastructure – for NON-IT People
SPC Adriatics
 
MODULE-5_CCN.pptx
MODULE-5_CCN.pptxMODULE-5_CCN.pptx
MODULE-5_CCN.pptx
Dr. Shivashankar
 
Introduction to the Internet and Web.pptx
Introduction to the Internet and Web.pptxIntroduction to the Internet and Web.pptx
Introduction to the Internet and Web.pptx
hishamousl
 
Aplication and Transport layer- a practical approach
Aplication and Transport layer-  a practical approachAplication and Transport layer-  a practical approach
Aplication and Transport layer- a practical approach
Sarah R. Dowlath
 
Hadoop introduction
Hadoop introductionHadoop introduction
Hadoop introduction
musrath mohammad
 
Java Test
Java TestJava Test
Java Test
Paolo Celoria
 
Asynchronous Python with Twisted
Asynchronous Python with TwistedAsynchronous Python with Twisted
Asynchronous Python with Twisted
Adam Englander
 
Computer Network Part 1
Computer Network Part 1Computer Network Part 1
Computer Network Part 1
Jayaseelan Vejayon
 
Network Traffic Search using Apache HBase
Network Traffic Search using Apache HBaseNetwork Traffic Search using Apache HBase
Network Traffic Search using Apache HBase
Evans Ye
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207
Lori Head
 
21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS
21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS
21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS
Dr. Shivashankar
 
CDN Project Presentation
CDN Project PresentationCDN Project Presentation
CDN Project Presentation
Rasiah Senthurchelvan
 
Web Architecture and Technologies
Web Architecture and TechnologiesWeb Architecture and Technologies
Web Architecture and Technologies
Fulvio Corno
 
Web technologies: recap on TCP-IP
Web technologies: recap on TCP-IPWeb technologies: recap on TCP-IP
Web technologies: recap on TCP-IP
Piero Fraternali
 
PNDA - Platform for Network Data Analytics
PNDA - Platform for Network Data AnalyticsPNDA - Platform for Network Data Analytics
PNDA - Platform for Network Data Analytics
John Evans
 
Chapter_4_v8.0.pptx
Chapter_4_v8.0.pptxChapter_4_v8.0.pptx
Chapter_4_v8.0.pptx
ChungHong22
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
RX-M Enterprises LLC
 
Lecture17.ppt
Lecture17.pptLecture17.ppt
Lecture17.ppt
TaskinKhaleque
 
Lecture17 (1).ppt
Lecture17 (1).pptLecture17 (1).ppt
Lecture17 (1).ppt
ssuserec53e73
 

Similar to application_layer (1).pdf (20)

Opal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsOpal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific Applications
 
Demystifying SharePoint Infrastructure – for NON-IT People
 Demystifying SharePoint Infrastructure – for NON-IT People  Demystifying SharePoint Infrastructure – for NON-IT People
Demystifying SharePoint Infrastructure – for NON-IT People
 
MODULE-5_CCN.pptx
MODULE-5_CCN.pptxMODULE-5_CCN.pptx
MODULE-5_CCN.pptx
 
Introduction to the Internet and Web.pptx
Introduction to the Internet and Web.pptxIntroduction to the Internet and Web.pptx
Introduction to the Internet and Web.pptx
 
Aplication and Transport layer- a practical approach
Aplication and Transport layer-  a practical approachAplication and Transport layer-  a practical approach
Aplication and Transport layer- a practical approach
 
Hadoop introduction
Hadoop introductionHadoop introduction
Hadoop introduction
 
Java Test
Java TestJava Test
Java Test
 
Asynchronous Python with Twisted
Asynchronous Python with TwistedAsynchronous Python with Twisted
Asynchronous Python with Twisted
 
Computer Network Part 1
Computer Network Part 1Computer Network Part 1
Computer Network Part 1
 
Network Traffic Search using Apache HBase
Network Traffic Search using Apache HBaseNetwork Traffic Search using Apache HBase
Network Traffic Search using Apache HBase
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207
 
21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS
21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS
21 Scheme_21EC53_MODULE-5_CCN_Dr. ShivaS
 
CDN Project Presentation
CDN Project PresentationCDN Project Presentation
CDN Project Presentation
 
Web Architecture and Technologies
Web Architecture and TechnologiesWeb Architecture and Technologies
Web Architecture and Technologies
 
Web technologies: recap on TCP-IP
Web technologies: recap on TCP-IPWeb technologies: recap on TCP-IP
Web technologies: recap on TCP-IP
 
PNDA - Platform for Network Data Analytics
PNDA - Platform for Network Data AnalyticsPNDA - Platform for Network Data Analytics
PNDA - Platform for Network Data Analytics
 
Chapter_4_v8.0.pptx
Chapter_4_v8.0.pptxChapter_4_v8.0.pptx
Chapter_4_v8.0.pptx
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
 
Lecture17.ppt
Lecture17.pptLecture17.ppt
Lecture17.ppt
 
Lecture17 (1).ppt
Lecture17 (1).pptLecture17 (1).ppt
Lecture17 (1).ppt
 

More from lathass5

print mod 2.pdf
print mod 2.pdfprint mod 2.pdf
print mod 2.pdf
lathass5
 
EV List.pdf
EV List.pdfEV List.pdf
EV List.pdf
lathass5
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
lathass5
 
Data and Signals.ppt
Data and Signals.pptData and Signals.ppt
Data and Signals.ppt
lathass5
 
dtoa.ppt
dtoa.pptdtoa.ppt
dtoa.ppt
lathass5
 
MODULE 5.pptx
MODULE 5.pptxMODULE 5.pptx
MODULE 5.pptx
lathass5
 
OOP PPT 1.pptx
OOP PPT 1.pptxOOP PPT 1.pptx
OOP PPT 1.pptx
lathass5
 

More from lathass5 (7)

print mod 2.pdf
print mod 2.pdfprint mod 2.pdf
print mod 2.pdf
 
EV List.pdf
EV List.pdfEV List.pdf
EV List.pdf
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
 
Data and Signals.ppt
Data and Signals.pptData and Signals.ppt
Data and Signals.ppt
 
dtoa.ppt
dtoa.pptdtoa.ppt
dtoa.ppt
 
MODULE 5.pptx
MODULE 5.pptxMODULE 5.pptx
MODULE 5.pptx
 
OOP PPT 1.pptx
OOP PPT 1.pptxOOP PPT 1.pptx
OOP PPT 1.pptx
 

Recently uploaded

Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
HODECEDSIET
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 

Recently uploaded (20)

Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 

application_layer (1).pdf

  • 1. INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR Department of Computer Science and Engineering Sandip Chakraborty sandipc@cse.iitkgp.ac.in Rajat Subhra Chakraborty rschakraborty@cse.iitkgp.ac.in CS 31006: Computer Networks – Application Layer
  • 2. Indian Institute of Technology Kharagpur Software, Kernel Firmware, Device Driver Hardware Protocol Stack Implementation in a Host Physical Data Link Network Transport Application
  • 3. Indian Institute of Technology Kharagpur How Application Data Passes Through Different Layers Physical Data Link Network Transport Application HTTP Data HTTP Header HTTP Data HTTP Header TCP Header HTTP Data HTTP Header TCP Header IP Header HTTP Data HTTP Header TCP Header IP Header MAC Header HTTP Data HTTP Header TCP Header IP Header MAC Header PHY Header PHY Trailer
  • 4. Indian Institute of Technology Kharagpur Application Layer Interfacing UDP End to end packet delivery TCP Connection Establishment Reliable Data Delivery Flow and Congestion Control Ordered Packet Delivery Network Transport Application - 1 Data Link Application - 2 Application - 3 Application - 4
  • 5. Indian Institute of Technology Kharagpur Application Layer Interfacing UDP End to end packet delivery TCP Connection Establishment Reliable Data Delivery Flow and Congestion Control Ordered Packet Delivery Network Transport Name Service (DNS) Data Link Web (HTTP) Email (SMTP, POP, IMAP) File Transfer (FTP)
  • 6. Indian Institute of Technology Kharagpur • Assign Unique names to an IP address (machine interface) • ARPANET – a file hosts.txt listed all the computer names and their IP addresses. • Resolve the host name conflicts over the Internet – a naming hierarchy needs to be managed • Rooted at an organization Internet Corporation for Assigned Names and Numbers (ICANN) Domain Name System (DNS)
  • 7. Indian Institute of Technology Kharagpur The DNS Name Space • The top level domains are run by registrars appointed by ICANN • Name registrar for India (.in domain): registry.in (National Internet Exchange of India – NIXI) Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 8. Indian Institute of Technology Kharagpur registry.in
  • 9. Indian Institute of Technology Kharagpur Registrars Under registry.in
  • 10. Indian Institute of Technology Kharagpur • The Domain Name Space and Resource Records: Specifications for a tree- structured namespace and data associated with names. • Name Servers: Server programs which hold information about the domain tree’s structure and set information • A particular name server has complete information about a subset of the domain space • Name servers know the parts of the domain tree for which they have complete information -- a name server is said to be an AUTHORITY for this parts of the namespace Elements of DNS (RFC 1034)
  • 11. Indian Institute of Technology Kharagpur • Divide registries into non-overlapping zones – every zone has a name server Name Servers Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 12. Indian Institute of Technology Kharagpur • The Domain Name Space and Resource Records: Specifications for a tree- structured namespace and data associated with names. • Name Servers: Server programs which hold information about the domain tree’s structure and set information • A particular name server has complete information about a subset of the domain space • Name servers know the parts of the domain tree for which they have complete information -- a name server is said to be an AUTHORITY for this parts of the namespace • Resolvers: Program that extracts information from name servers in response to client requests Elements of DNS (RFC 1034)
  • 13. Indian Institute of Technology Kharagpur • Every domain has a set of resource records associated with it – DNS database Domain Resource Records
  • 14. Indian Institute of Technology Kharagpur • Domain_name: Domain to which the record applies. • Time_to_live: Time for which this record is active – volatile records may be assigned a small value • Class: Normally IN – Internet resources • Type: What type of record it is • Value: Value of the record (IP address for A record type) Domain Resource Records
  • 15. Indian Institute of Technology Kharagpur • A Type Records: cse.iitkgp.ac.in 86400 IN A 203.110.245.250 • CNAME Type Records: iitkgp.ac.in 86400 IN CNAME www.iitkgp.ac.in • PTR Type Records: 172.16.5.33 86400 IN PTR www.iitkgp.ac.in Domain Resource Records
  • 16. Indian Institute of Technology Kharagpur Sample DNS Database Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 17. Indian Institute of Technology Kharagpur Name Resolution – Looking Up for the Names Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 18. Indian Institute of Technology Kharagpur DNS Packet Structure
  • 19. Indian Institute of Technology Kharagpur Name Resolution (nslookup) One of the name servers for IITKGP
  • 20. Indian Institute of Technology Kharagpur Name Resolution (dig) An authoritative record is one that comes from the authority that manages the record, and thus is always correct UDP Message for 4096 bytes
  • 21. Indian Institute of Technology Kharagpur • UDP is much faster. TCP requires handshake time. DNS uses a cascading approach for name resolution. With TCP, for every message, a connection setup is required. • DNS requests and responses are generally very small, and fits well within one UDP segment. • UDP is not reliable. In DNS, reliability is ensured at the application layer. After timeout, the DNS client sends back the requests. After few consecutive timeouts (can be set at the client), the request is aborted with an error. Why DNS Uses UDP
  • 22. Indian Institute of Technology Kharagpur Application Layer Interfacing UDP End to end packet delivery TCP Connection Establishment Reliable Data Delivery Flow and Congestion Control Ordered Packet Delivery Network Transport Name Service (DNS) Data Link Web (HTTP) Email (SMTP, POP, IMAP) File Transfer (FTP)
  • 23. Indian Institute of Technology Kharagpur • Hypertext - A way to represent web content (text along with formatting) • Hypertext Markup Language (HTML) - A scripting language to specify web data along with simple formatting (bold, italics, new line). • A way to convert text based information to graphics based information • Today’s era: Many graphics, scripts and other information are embedded inside HTML – CSS, JavaScript etc. The Web – Hypertext Transfer Protocol (HTTP)
  • 24. Indian Institute of Technology Kharagpur Differences between HTML Versions Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 25. Indian Institute of Technology Kharagpur • 1989 (CERN – European Center for Nuclear Research) – help large teams to collaborate using a constantly changing collection of reports, blueprints, drawings, photos and other documents • The proposal came from Tim Berners-Lee • A public demonstration at Hypertext ‘91 conference • 1993 – The first graphical browser (Mosaic) developed by Marc Andreessen, University of Illinois • Andreessen formed the company Netscape Communications Corp • Microsoft developed Internet Explorer – “browser war” between Internet Explorer and Netscape Navigator • 1994 – CERN and MIT signed an agreement to setup World Wide Web Consortium (W3C) A History of the Web
  • 26. Indian Institute of Technology Kharagpur The Web – Architectural Overview Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 27. Indian Institute of Technology Kharagpur • Three questions to be answered for accessing a web page • What is the page called? (courses.html) • Where is the page located? (cse.iitkgp.ac.in/~sandipc/) • How can the page be accessed? (http://) • Uniform Resource Locator (URL): Each page is assigned a URL that effectively serves the page’s worldwide name • URL have three components: • The protocol • The qualified name of the machine one which the page is located • The path uniquely indicating the specific page HTTP – The Client Side http://cse.iitkgp.ac.in/~sandipc/courses.html
  • 28. Indian Institute of Technology Kharagpur • The browser determines the URL • The browser asks DNS for the IP address of the server cse.iitkgp.ac.in • DNS replies with 203.110.245.250 • The browser makes a TCP connection to 203.110.245.250 on port 80, the well known port for the HTTP protocol (Note: https uses 443) • It sends over an HTTP request asking for the page ~sandipc/courses.html • The cse.iitkgp.ac.in server sends the page as an HTTP response, for example by sending the file /courses.html • If the page includes URLS that are needed for display, the browser fetches the other URLs using the same process The Steps When You Click http://cse.iitkgp.ac.in/~sandipc/courses.html
  • 29. Indian Institute of Technology Kharagpur The Steps When You Click http://cse.iitkgp.ac.in/~sandipc/courses.html
  • 30. Indian Institute of Technology Kharagpur • The browser displays the page courses.html • The TCP connections are released if there are no other requests to the same server for a short period. The Steps When You Click http://cse.iitkgp.ac.in/~sandipc/courses.html
  • 31. Indian Institute of Technology Kharagpur • Generalization of the URLs – specifies the pages only or partially refers the pages without complete locations • /images/iit_kgp.png – may become URL https://cse.iitkgp.ac.in/images/iit_kgp.png if accessed from cse.iitkgp.ac.in Uniform Resource Identifier (URI)
  • 32. Indian Institute of Technology Kharagpur • Accept a TCP connection from a client (a browser). • Get the path to the page, which is the name of the file requested. • Get the file (from disk). • Sends the content of the file to the client. • Release (close) the TCP connection. HTTP – The Server Side
  • 33. Indian Institute of Technology Kharagpur Multi-Threaded Server Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell Serves multiple client requests simultaneously
  • 34. Indian Institute of Technology Kharagpur • HTTP uses TCP to set up a connection between the server and the client. In general, HTTP server runs at port 80 (default port) or 8080 (alternate port). • HTTP 1.0 – After the connections were established, a single request was sent over and a single response was sent back. Then the TCP connections are released. • Create separate connections for every content in the web-page. Overhead is high. • Persistent Connection (HTTP 1.1) – send additional requests and additional responses in a single TCP connection (connection reuse). • It is also possible to pipeline requests. Connections
  • 35. Indian Institute of Technology Kharagpur Connections HTTP 1.0 HTTP 1.1 – Persistent Connections HTTP 1.1 – Persistent Connections (Pipelined) Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell Persistent Connections: Set at keep-alive information in the HTTP header (HTTP 1.0) HTTP 1.1 – All connections are by default persistent
  • 36. Indian Institute of Technology Kharagpur • Specifies what a HTTP Request will do • GET filename HTTP/1.1 HTTP Request Methods
  • 37. Indian Institute of Technology Kharagpur HTTP Request Header Fields (Partial List)
  • 38. Indian Institute of Technology Kharagpur • Specifies the status of the request message. HTTP Response
  • 39. Indian Institute of Technology Kharagpur HTTP Response Header Fields (Partial List)
  • 40. Indian Institute of Technology Kharagpur HTTP Caching Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 41. Indian Institute of Technology Kharagpur Dynamic Web Applications Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 42. Indian Institute of Technology Kharagpur • HTTP is by default a stateless protocol • Every Response corresponds to the previous Request only, it does not remember any state information, such as last page accessed • Use Cookies to store the state information. Client forwards the additional information along with the Request message by reading the cookie. Cookies
  • 43. Indian Institute of Technology Kharagpur • Intercepts the TCP connections to process the HTTP data. HTTP Proxy HTTP Proxy
  • 44. Indian Institute of Technology Kharagpur Application Layer Interfacing UDP End to end packet delivery TCP Connection Establishment Reliable Data Delivery Flow and Congestion Control Ordered Packet Delivery Network Transport Name Service (DNS) Data Link Web (HTTP) Email (SMTP, POP, IMAP) File Transfer (FTP)
  • 45. Indian Institute of Technology Kharagpur Electronic Mails – Architecture and Services • User Agent: Allow people to read and send emails. • Message Transfer Agents (main servers): Move the message from the source to the destination sandipc@cse.iitkgp.ernet.in sukumar@iitg.ernet.in cse.iitkgp.ernet.in iitg.ernet.in
  • 46. Indian Institute of Technology Kharagpur • System processes run in the background on mail servers (always available). • Automatically move emails through the system from the originator to the recipient • Uses Simple Mail Transfer Protocol (SMTP) – RFC 821, RFC 5321 • Implements mailing lists, an identical copy of message is delivered to everyone in the list (btech@iitkgp.ac.in) • Implements Mailboxes, to store all the emails received for a user Message Transfer Agents
  • 47. Indian Institute of Technology Kharagpur • An envelope containing message header and message body Message Format (RFC 5322)
  • 48. Indian Institute of Technology Kharagpur • Header fields (for message transport): The Internet Message Format (RFC 5322)
  • 49. Indian Institute of Technology Kharagpur • Header fields (additional fields for message description): The Internet Message Format (RFC 5322)
  • 50. Indian Institute of Technology Kharagpur • ARPANET: email consisted exclusively of text messages written in English and expressed in ASCII • MIME: Use multi-language and multimedia contents (audio, image etc.) inside an email. • Additional message headers for MIME: MIME – The Multipurpose Internet Mail Extension
  • 51. Indian Institute of Technology Kharagpur • Uses SMTP Protocol • Email is delivered by having the sending computer establishing TCP connection to port 25 of the receiving computer. Message Transfer SMTP Server (Port 25) SMTP Client (Port ANY) SMTP Server (Port 25) SMTP Client (Port ANY) UA – SMTP Client Port ANY TCP TCP sandipc@cse.iitkgp.ernet.in cse.iitkgp.ernet.in iitg.ernet.in SMTP SMTP
  • 52. Indian Institute of Technology Kharagpur Message Transfer (SMTP) Source: Computer Networks (5th Edition) by Tanenbaum, Wetherell
  • 53. Indian Institute of Technology Kharagpur • Pull type protocol – UA at the receiver side pulls the emails from mail server after login. • Post Office Protocol, Version 3 (POP3) – an earlier protocol for email delivery • Internet Message Access Protocol, Version 4 (IMAP v4) – RFC 3501 • The email server runs an IMAP server at port 143 • The user agent runs IMAP client • The client connects to the server and issues mail delivery commands Final Delivery
  • 54. Indian Institute of Technology Kharagpur IMAP (Version 4) Commands
  • 55. Indian Institute of Technology Kharagpur Application Layer Interfacing UDP End to end packet delivery TCP Connection Establishment Reliable Data Delivery Flow and Congestion Control Ordered Packet Delivery Network Transport Name Service (DNS) Data Link Web (HTTP) Email (SMTP, POP, IMAP) File Transfer (FTP)
  • 56. Indian Institute of Technology Kharagpur • Is built on a client-server model (RFC 959) • The client requests for the file or send the file to the server • The server responses with the file data or store the file at the file server • Works in two modes – Active and Passive File Transfer Protocol (FTP) File Server (FTP Server) User (FTP Client) File Request File Response Status File Data
  • 57. Indian Institute of Technology Kharagpur Active and Passive Modes of File Transfer FTP server uses two different ports: Port 21 (Command or Control Port): For command message transfer Port 20 or Client assigned (Data Port): For data transfer Image Source: http://henrydu.com/blog/how-to/ftp-active-mode-vs-passive-mode-106.html
  • 58. Indian Institute of Technology Kharagpur • Specifically to avoid busy waiting, and keep the command channel lightweight. • You can always use a multiplexing between command/control and data, but FTP is used for large file transfer; if command channel is used for data transfer as well, the commands for other clients may experience a higher queuing delay while one client is being served. • The clients can continue sending and receiving control information while data transfer is being take place Why There are Two Channels – Command Channel and Data Channel
  • 59. Indian Institute of Technology Kharagpur Why There are Two Modes in FTP? Active Mode: Client informs the port number where it is listening, and the server initiates the TCP connection to that port (TCP server is running at the client side) What If the client is behind a firewall and can not accept a connection?
  • 60. Indian Institute of Technology Kharagpur Why There are Two Modes in FTP? Passive Mode: The server selects a random port, and the client initiates a TCP connection to that server port. The server can serve multiple clients at different server data ports through different threads. The clients always initiate the command and the data transfer. Image Source: http://henrydu.com/blog/how-to/ftp-active-mode-vs-passive-mode-106.html
  • 61. Indian Institute of Technology Kharagpur • Stream mode: Data is sent as a continuous stream, relieving FTP from doing any processing. Rather, all processing is left up to TCP. No End-of-file indicator is needed, unless the data is divided into records. • Block mode: FTP breaks the data into several blocks (block header, byte count, and data field) and then passes it on to TCP. • Compressed mode: Data is compressed using a simple algorithm (usually run-length encoding). FTP Data Transfer Modes Source: Wikipedia
  • 62. Indian Institute of Technology Kharagpur FTP Sample Commands and Response Codes
  • 63. Indian Institute of Technology Kharagpur • Next, we’ll go for the Transport Layer ….