This document discusses an application layer chapter that covers several topics:
- It provides an overview of application layer protocols including HTTP, email, DNS, peer-to-peer applications, and socket programming.
- It explains the client-server and peer-to-peer paradigms for network applications. Processes communicate by exchanging messages over sockets.
- It introduces HTTP and the web client-server model, where clients make requests and servers send responses. HTTP uses TCP for reliable data transfer.
Computer network network edge and networkrjnavallasca
This document discusses an application layer chapter that covers key concepts like the client-server and peer-to-peer paradigms, application layer protocols, and transport layer services. It specifically focuses on HTTP as the main application layer protocol for the web, describing its request and response message formats, use of TCP for reliable data transfer, and differences between non-persistent and persistent connections.
This document discusses an application layer chapter that covers:
- Principles of network applications like the client-server and peer-to-peer paradigms
- Popular application layer protocols including HTTP, SMTP, DNS, and video streaming
- How applications use transport layer protocols like TCP and UDP based on their reliability, throughput, and timing requirements
- Socket programming and how processes communicate over the network
Module 2: Application layer
Principles of network applications, Web and HTTP, File transfer protocol, Electronic mail, Domain name system, DDNS, SSH, SNMP ,Internet Applications.
The document describes a set of PowerPoint slides for a networking textbook. It provides instructions for using and modifying the slides, with the only requests being to mention the source and copyright if used for teaching or posted online.
This document provides an overview of the application layer in computer networking. It discusses several key concepts including the client-server and peer-to-peer paradigms, popular application layer protocols like HTTP, SMTP, and DNS, socket programming, addressing processes, and how different applications map to transport layer protocols like TCP and UDP. It also covers topics like non-persistent and persistent HTTP connections. The overall goal is to explain both conceptual and implementation aspects of application layer protocols.
The document describes a chapter about the application layer from a textbook on computer networking. It covers several topics:
1. An introduction to the application layer including common network applications, client-server and peer-to-peer architectures, and how processes communicate over the network.
2. Descriptions of the HTTP and TCP protocols that are commonly used at the application layer. HTTP uses the TCP transport layer to provide reliable data transfer for web applications.
3. An overview of how non-persistent and persistent HTTP connections work, with persistent connections allowing multiple objects to be transferred over a single TCP connection between a client and server.
Chapter_2_V7.01.ppt The client sends one request message for the HTML file, a...MushaimAftab
The client sends one request message for the HTML file, and the server responds with the HTML file and three additional response messages for the images.The client sends one request message for the HTML file, and the server responds with the HTML file and three additional response messages for the images.The client sends one request message for the HTML file, and the server responds with the HTML file and three additional response messages for the images.
Ci hy Jo is type ki videos edit krei Inbox kro mujhe with similar portfolio ...QassimAbbasi
i hy Jo is type ki videos edit krei
Inbox kro mujhe with similar portfolio 💼
I need Honest Editor just like my brother….
I need someone who is exactly do this style also deliver it on time…
I have an interview tomorrow and I wants to finalize s
This document summarizes key aspects of the application layer as covered in Chapter 2, including:
1) It describes common network applications like email, web, file sharing and discusses application layer protocols and transport protocols used.
2) It explains client-server and peer-to-peer architectures and provides examples of each.
3) It provides an overview of HTTP and the web including HTTP requests and responses, persistent connections, and caching.
The document describes an introductory chapter on the application layer from a textbook on computer networking. It provides an overview of key topics that will be covered in the chapter, including application architectures (client-server and peer-to-peer), example network applications, how processes communicate over the network, addressing processes, application layer protocols, and how applications map to transport protocols. It then focuses on describing the Hypertext Transfer Protocol (HTTP) and web architecture, including how HTTP connections and requests/responses work.
In the OSI reference model, the communications between a computing system are split into seven different abstraction layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.
The lowest layer of the OSI Model is concerned with electrically or optically transmitting raw unstructured data bits across the network from the physical layer of the sending device to the physical layer of the receiving device. It can include specifications such as voltages, pin layout, cabling, and radio frequencies. At the physical layer, one might find “physical” resources such as network hubs, cabling, repeaters, network adapters or modems.
Data Link Layer
At the data link layer, directly connected nodes are used to perform node-to-node data transfer where data is packaged into frames. The data link layer also corrects errors that may have occurred at the physical layer.
The data link layer encompasses two sub-layers of its own. The first, media access control (MAC), provides flow control and multiplexing for device transmissions over a network. The second, the logical link control (LLC), provides flow and error control over the physical medium as well as identifies line protocols.
Network Layer
The network layer is responsible for receiving frames from the data link layer, and delivering them to their intended destinations among based on the addresses contained inside the frame. The network layer finds the destination by using logical addresses, such as IP (internet protocol). At this layer, routers are a crucial component used to quite literally route information where it needs to go between networks.
Transport Layer
The transport layer manages the delivery and error checking of data packets. It regulates the size, sequencing, and ultimately the transfer of data between systems and hosts. One of the most common examples of the transport layer is TCP or the Transmission Control Protocol.
Session Layer
The session layer controls the conversations between different computers. A session or connection between machines is set up, managed, and termined at layer 5. Session layer services also include authentication and reconnections.
Presentation Layer
The presentation layer formats or translates data for the application layer based on the syntax or semantics that the application accepts. Because of this, it at times also called the syntax layer. This layer can also handle the encryption and decryption required by the application layer.
Application Layer
At this layer, both the end user and the application layer interact directly with the software application. This layer sees network services provided to end-user applications such as a web browser or Office 365. The application layer identifies communication partners, resource availability, and synchronizes communication.
Presentation on Application layer_201.pdfprince2412001
A Network application is an application running on one host and provides a
communication to another application running on a different host.
▪ A network application development is writing programs that run on different
end systems and communicate with each other over the network.
▪ In the Web application there are two different programs that communicate with each other:
✔ Browser program running in the user's host.
✔ Web server program running in the Web server host.
Host
Host
2
Network Applications - Examples
▪ Email
▪ Web
▪ Remote Login
▪ P2P File Sharing
▪ Multi-user Network Games
▪ Streaming Stored Video (YouTube)
▪ Voice Over IP (Skype)
▪ Real-time Video Conference
▪ Social Networking
3
Network Application Architecture
1. Client-Server architecture
2. P2P (Peer to Peer) architecture
4
1. Client-Server Architecture
Client
Server:
✔ Its always-on host.
✔ It has a fixed IP address.
✔ Large cluster of host – Data Centers.
✔ E.g. Web Server
Client:
✔ It communicate with server.
✔ Its not like continuously connected.
✔ May have dynamic IP addresses.
✔ Do not communicate directly with each other.
✔ E.g. PCs, Mobiles
Server
5
2. P2P Architecture
Peer
▪ Peers (end systems) directly communicate.
▪ Get peers request service from other peers, provide service to other peers.
✔ Self Scalability – New peers bring new service capacity, as well as new service demands.
▪ Peers are alternatingly connected and change IP addresses.
✔ Complex management 6
Peer
Peer
Process Communicating
▪ What is Process?
▪ A process is an instance of a program running in a computer.
▪ We can say that process is program under execution.
▪ Within same host, two processes communicate using inter-process communication (IPC).
▪ Process in different hosts communicate by exchanging messages.
▪ Client process: A process that initiates communication.
▪ Server process: A process that waits to be contacted.
Process P1
Process P2
7
Socket
▪ A process sends messages into, and receives messages from; the
network through a software interface called a socket.
▪ A process is similar to a house and its socket is similar to its door.
✔ Sending process passes message out door.
✔ Sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process.
Process
application
proce ss
transport
network
link
physical
application
proce ss
transport
network
link
physical
socket
controlled by app developer
controlled
by OS
Internet
Socket
8
Transport Services to Applications
▪ Recall that a socket is the interface between the application process and the transport layer protocol.
▪ For develop an application, choose available transport layer protocol.
▪ Pick the protocol with the services that best match the needs of your application.
The document discusses network application protocols and provides examples of common network applications. It describes the client-server and peer-to-peer architectures for network applications. Applications use either TCP or UDP at the transport layer, depending on their requirements for reliability, throughput, and timing. TCP provides reliable data transfer while UDP is simpler but does not guarantee delivery. Well-known application layer protocols are presented along with the transport protocols typically used to support them.
The document discusses the application layer and HTTP protocol. It provides an overview of the HTTP protocol, including that it uses a client-server model with browsers as clients and web servers as servers. It describes how HTTP messages are exchanged over TCP connections and covers non-persistent and persistent HTTP connections. It also provides details on the format of HTTP requests and responses.
This document discusses the application layer in computer networks. It begins by outlining key learning outcomes related to network application protocols, popular protocols like HTTP, FTP, SMTP, and DNS, and socket programming. It then covers principles of network applications like the client-server and peer-to-peer paradigms. Specific sections discuss the HTTP protocol that powers the web, including HTTP requests and responses, and how HTTP connections can be persistent. The document also briefly mentions securing TCP connections with SSL.
The document describes a set of PowerPoint slides for a networking textbook. It provides instructions for using and modifying the slides, with the only requests being to mention the source and copyright if used for teaching or posted online.
This document provides an overview of the application layer in computer networking. It discusses several key concepts including the client-server and peer-to-peer paradigms, popular application layer protocols like HTTP, SMTP, and DNS, socket programming, addressing processes, and how different applications map to transport layer protocols like TCP and UDP. It also covers topics like non-persistent and persistent HTTP connections. The overall goal is to explain both conceptual and implementation aspects of application layer protocols.
The document describes a chapter about the application layer from a textbook on computer networking. It covers several topics:
1. An introduction to the application layer including common network applications, client-server and peer-to-peer architectures, and how processes communicate over the network.
2. Descriptions of the HTTP and TCP protocols that are commonly used at the application layer. HTTP uses the TCP transport layer to provide reliable data transfer for web applications.
3. An overview of how non-persistent and persistent HTTP connections work, with persistent connections allowing multiple objects to be transferred over a single TCP connection between a client and server.
Chapter_2_V7.01.ppt The client sends one request message for the HTML file, a...MushaimAftab
The client sends one request message for the HTML file, and the server responds with the HTML file and three additional response messages for the images.The client sends one request message for the HTML file, and the server responds with the HTML file and three additional response messages for the images.The client sends one request message for the HTML file, and the server responds with the HTML file and three additional response messages for the images.
Ci hy Jo is type ki videos edit krei Inbox kro mujhe with similar portfolio ...QassimAbbasi
i hy Jo is type ki videos edit krei
Inbox kro mujhe with similar portfolio 💼
I need Honest Editor just like my brother….
I need someone who is exactly do this style also deliver it on time…
I have an interview tomorrow and I wants to finalize s
This document summarizes key aspects of the application layer as covered in Chapter 2, including:
1) It describes common network applications like email, web, file sharing and discusses application layer protocols and transport protocols used.
2) It explains client-server and peer-to-peer architectures and provides examples of each.
3) It provides an overview of HTTP and the web including HTTP requests and responses, persistent connections, and caching.
The document describes an introductory chapter on the application layer from a textbook on computer networking. It provides an overview of key topics that will be covered in the chapter, including application architectures (client-server and peer-to-peer), example network applications, how processes communicate over the network, addressing processes, application layer protocols, and how applications map to transport protocols. It then focuses on describing the Hypertext Transfer Protocol (HTTP) and web architecture, including how HTTP connections and requests/responses work.
In the OSI reference model, the communications between a computing system are split into seven different abstraction layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.
The lowest layer of the OSI Model is concerned with electrically or optically transmitting raw unstructured data bits across the network from the physical layer of the sending device to the physical layer of the receiving device. It can include specifications such as voltages, pin layout, cabling, and radio frequencies. At the physical layer, one might find “physical” resources such as network hubs, cabling, repeaters, network adapters or modems.
Data Link Layer
At the data link layer, directly connected nodes are used to perform node-to-node data transfer where data is packaged into frames. The data link layer also corrects errors that may have occurred at the physical layer.
The data link layer encompasses two sub-layers of its own. The first, media access control (MAC), provides flow control and multiplexing for device transmissions over a network. The second, the logical link control (LLC), provides flow and error control over the physical medium as well as identifies line protocols.
Network Layer
The network layer is responsible for receiving frames from the data link layer, and delivering them to their intended destinations among based on the addresses contained inside the frame. The network layer finds the destination by using logical addresses, such as IP (internet protocol). At this layer, routers are a crucial component used to quite literally route information where it needs to go between networks.
Transport Layer
The transport layer manages the delivery and error checking of data packets. It regulates the size, sequencing, and ultimately the transfer of data between systems and hosts. One of the most common examples of the transport layer is TCP or the Transmission Control Protocol.
Session Layer
The session layer controls the conversations between different computers. A session or connection between machines is set up, managed, and termined at layer 5. Session layer services also include authentication and reconnections.
Presentation Layer
The presentation layer formats or translates data for the application layer based on the syntax or semantics that the application accepts. Because of this, it at times also called the syntax layer. This layer can also handle the encryption and decryption required by the application layer.
Application Layer
At this layer, both the end user and the application layer interact directly with the software application. This layer sees network services provided to end-user applications such as a web browser or Office 365. The application layer identifies communication partners, resource availability, and synchronizes communication.
Presentation on Application layer_201.pdfprince2412001
A Network application is an application running on one host and provides a
communication to another application running on a different host.
▪ A network application development is writing programs that run on different
end systems and communicate with each other over the network.
▪ In the Web application there are two different programs that communicate with each other:
✔ Browser program running in the user's host.
✔ Web server program running in the Web server host.
Host
Host
2
Network Applications - Examples
▪ Email
▪ Web
▪ Remote Login
▪ P2P File Sharing
▪ Multi-user Network Games
▪ Streaming Stored Video (YouTube)
▪ Voice Over IP (Skype)
▪ Real-time Video Conference
▪ Social Networking
3
Network Application Architecture
1. Client-Server architecture
2. P2P (Peer to Peer) architecture
4
1. Client-Server Architecture
Client
Server:
✔ Its always-on host.
✔ It has a fixed IP address.
✔ Large cluster of host – Data Centers.
✔ E.g. Web Server
Client:
✔ It communicate with server.
✔ Its not like continuously connected.
✔ May have dynamic IP addresses.
✔ Do not communicate directly with each other.
✔ E.g. PCs, Mobiles
Server
5
2. P2P Architecture
Peer
▪ Peers (end systems) directly communicate.
▪ Get peers request service from other peers, provide service to other peers.
✔ Self Scalability – New peers bring new service capacity, as well as new service demands.
▪ Peers are alternatingly connected and change IP addresses.
✔ Complex management 6
Peer
Peer
Process Communicating
▪ What is Process?
▪ A process is an instance of a program running in a computer.
▪ We can say that process is program under execution.
▪ Within same host, two processes communicate using inter-process communication (IPC).
▪ Process in different hosts communicate by exchanging messages.
▪ Client process: A process that initiates communication.
▪ Server process: A process that waits to be contacted.
Process P1
Process P2
7
Socket
▪ A process sends messages into, and receives messages from; the
network through a software interface called a socket.
▪ A process is similar to a house and its socket is similar to its door.
✔ Sending process passes message out door.
✔ Sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process.
Process
application
proce ss
transport
network
link
physical
application
proce ss
transport
network
link
physical
socket
controlled by app developer
controlled
by OS
Internet
Socket
8
Transport Services to Applications
▪ Recall that a socket is the interface between the application process and the transport layer protocol.
▪ For develop an application, choose available transport layer protocol.
▪ Pick the protocol with the services that best match the needs of your application.
The document discusses network application protocols and provides examples of common network applications. It describes the client-server and peer-to-peer architectures for network applications. Applications use either TCP or UDP at the transport layer, depending on their requirements for reliability, throughput, and timing. TCP provides reliable data transfer while UDP is simpler but does not guarantee delivery. Well-known application layer protocols are presented along with the transport protocols typically used to support them.
The document discusses the application layer and HTTP protocol. It provides an overview of the HTTP protocol, including that it uses a client-server model with browsers as clients and web servers as servers. It describes how HTTP messages are exchanged over TCP connections and covers non-persistent and persistent HTTP connections. It also provides details on the format of HTTP requests and responses.
This document discusses the application layer in computer networks. It begins by outlining key learning outcomes related to network application protocols, popular protocols like HTTP, FTP, SMTP, and DNS, and socket programming. It then covers principles of network applications like the client-server and peer-to-peer paradigms. Specific sections discuss the HTTP protocol that powers the web, including HTTP requests and responses, and how HTTP connections can be persistent. The document also briefly mentions securing TCP connections with SSL.
保密服务皇家艺术学院英文毕业证书影本英国成绩单皇家艺术学院文凭【q微1954292140】办理皇家艺术学院学位证(RCA毕业证书)假学历认证【q微1954292140】帮您解决在英国皇家艺术学院未毕业难题(Royal College of Art)文凭购买、毕业证购买、大学文凭购买、大学毕业证购买、买文凭、日韩文凭、英国大学文凭、美国大学文凭、澳洲大学文凭、加拿大大学文凭(q微1954292140)新加坡大学文凭、新西兰大学文凭、爱尔兰文凭、西班牙文凭、德国文凭、教育部认证,买毕业证,毕业证购买,买大学文凭,购买日韩毕业证、英国大学毕业证、美国大学毕业证、澳洲大学毕业证、加拿大大学毕业证(q微1954292140)新加坡大学毕业证、新西兰大学毕业证、爱尔兰毕业证、西班牙毕业证、德国毕业证,回国证明,留信网认证,留信认证办理,学历认证。从而完成就业。皇家艺术学院毕业证办理,皇家艺术学院文凭办理,皇家艺术学院成绩单办理和真实留信认证、留服认证、皇家艺术学院学历认证。学院文凭定制,皇家艺术学院原版文凭补办,扫描件文凭定做,100%文凭复刻。
特殊原因导致无法毕业,也可以联系我们帮您办理相关材料:
1:在皇家艺术学院挂科了,不想读了,成绩不理想怎么办???
2:打算回国了,找工作的时候,需要提供认证《RCA成绩单购买办理皇家艺术学院毕业证书范本》【Q/WeChat:1954292140】Buy Royal College of Art Diploma《正式成绩单论文没过》有文凭却得不到认证。又该怎么办???英国毕业证购买,英国文凭购买,【q微1954292140】英国文凭购买,英国文凭定制,英国文凭补办。专业在线定制英国大学文凭,定做英国本科文凭,【q微1954292140】复制英国Royal College of Art completion letter。在线快速补办英国本科毕业证、硕士文凭证书,购买英国学位证、皇家艺术学院Offer,英国大学文凭在线购买。
英国文凭皇家艺术学院成绩单,RCA毕业证【q微1954292140】办理英国皇家艺术学院毕业证(RCA毕业证书)【q微1954292140】专业定制国外文凭学历证书皇家艺术学院offer/学位证国外文凭办理、留信官方学历认证(永久存档真实可查)采用学校原版纸张、特殊工艺完全按照原版一比一制作。帮你解决皇家艺术学院学历学位认证难题。
主营项目:
1、真实教育部国外学历学位认证《英国毕业文凭证书快速办理皇家艺术学院成绩单英文版》【q微1954292140】《论文没过皇家艺术学院正式成绩单》,教育部存档,教育部留服网站100%可查.
2、办理RCA毕业证,改成绩单《RCA毕业证明办理皇家艺术学院国外文凭办理》【Q/WeChat:1954292140】Buy Royal College of Art Certificates《正式成绩单论文没过》,皇家艺术学院Offer、在读证明、学生卡、信封、证明信等全套材料,从防伪到印刷,从水印到钢印烫金,高精仿度跟学校原版100%相同.
3、真实使馆认证(即留学人员回国证明),使馆存档可通过大使馆查询确认.
4、留信网认证,国家专业人才认证中心颁发入库证书,留信网存档可查.
《皇家艺术学院快速办理毕业证书英国毕业证书办理RCA办学历认证》【q微1954292140】学位证1:1完美还原海外各大学毕业材料上的工艺:水印,阴影底纹,钢印LOGO烫金烫银,LOGO烫金烫银复合重叠。文字图案浮雕、激光镭射、紫外荧光、温感、复印防伪等防伪工艺。
高仿真还原英国文凭证书和外壳,定制英国皇家艺术学院成绩单和信封。办理学历认证RCA毕业证【q微1954292140】办理英国皇家艺术学院毕业证(RCA毕业证书)【q微1954292140】安全可靠的皇家艺术学院offer/学位证毕业证书不见了怎么办、留信官方学历认证(永久存档真实可查)采用学校原版纸张、特殊工艺完全按照原版一比一制作。帮你解决皇家艺术学院学历学位认证难题。
皇家艺术学院offer/学位证、留信官方学历认证(永久存档真实可查)采用学校原版纸张、特殊工艺完全按照原版一比一制作【q微1954292140】Buy Royal College of Art Diploma购买美国毕业证,购买英国毕业证,购买澳洲毕业证,购买加拿大毕业证,以及德国毕业证,购买法国毕业证(q微1954292140)购买荷兰毕业证、购买瑞士毕业证、购买日本毕业证、购买韩国毕业证、购买新西兰毕业证、购买新加坡毕业证、购买西班牙毕业证、购买马来西亚毕业证等。包括了本科毕业证,硕士毕业证。
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC
Joyce Chen, Senior Advisor, Strategic Engagement at APNIC, presented on 'APNIC Policy Development Process' at the Local APIGA Taiwan 2025 event held in Taipei from 19 to 20 April 2025.
Discover how IPv6 solves address exhaustion, boosts security, and powers the future of internet connectivity. Get expert insights and upgrade your network with RouterArchitects.com.
What's going on with IPv6? presented by Geoff HustonAPNIC
APNIC Chief Scientist, Geoff Huston, presented on the global deployment of IPv6 at the 6th ICANN APAC-TWNIC Engagement Forum and 43rd TWNIC OPM held in Taipei from 22 to 24 April 2025.
1. Chapter 2
Application Layer
A note on the use of these PowerPoint slides:
We’re making these slides freely available to all (faculty, students,
readers). They’re in PowerPoint form so you see the animations; and
can add, modify, and delete slides (including this one) and slide content
to suit your needs. They obviously represent a lot of work on our part.
In return for use, we only ask the following:
▪ If you use these slides (e.g., in a class) that you mention their
source (after all, we’d like people to use our book!)
▪ If you post any slides on a www site, that you note that they are
adapted from (or perhaps identical to) our slides, and note our
copyright of this material.
For a revision history, see the slide note for this page.
Thanks and enjoy! JFK/KWR
All material copyright 1996-2020
J.F Kurose and K.W. Ross, All Rights Reserved
Application Layer: 2-1
Computer Networking: A
Top-Down Approach
8th edition n
Jim Kurose, Keith Ross
Pearson, 2020
2. Application layer: overview
▪ Principles of network
applications
▪ Web and HTTP
▪ E-mail, SMTP, IMAP
▪ The Domain Name System
DNS
▪ P2P applications
▪ video streaming and content
distribution networks
▪ socket programming with
UDP and TCP
Application Layer: 2-2
3. Application layer: overview
Our goals:
▪ conceptual and
implementation aspects of
application-layer protocols
• transport-layer service
models
• client-server paradigm
• peer-to-peer paradigm
▪ learn about protocols by
examining popular
application-layer protocols
• HTTP
• SMTP, IMAP
• DNS
▪ programming network
applications
• socket API
Application Layer: 2-3
4. Some network apps
▪ social networking
▪ Web
▪ text messaging
▪ e-mail
▪ multi-user network games
▪ streaming stored video
(YouTube, Hulu, Netflix)
▪ P2P file sharing
Application Layer: 2-4
▪ voice over IP (e.g., Skype)
▪ real-time video conferencing
▪ Internet search
▪ remote login
▪ …
Q: your favorites?
5. mobile network
home network
enterprise
network
national or global ISP
local or
regional ISP
datacenter
network
content
provider
network
application
transport
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
Creating a network app
write programs that:
▪ run on (different) end systems
▪ communicate over network
▪ e.g., web server software
communicates with browser software
no need to write software for
network-core devices
▪ network-core devices do not run user
applications
▪ applications on end systems allows
for rapid app development,
propagation
Application Layer: 2-5
6. mobile network
home network
enterprise
network
national or global ISP
local or
regional ISP
datacenter
network
content
provider
network
Client-server paradigm
server:
▪ always-on host
▪ permanent IP address
▪ often in data centers, for scaling
clients:
▪ contact, communicate with server
▪ may be intermittently connected
▪ may have dynamic IP addresses
▪ do not communicate directly with
each other
▪ examples: HTTP, IMAP, FTP
Application Layer: 2-6
7. mobile network
home network
enterprise
network
national or global ISP
local or
regional ISP
datacenter
network
content
provider
network
Peer-peer architecture
▪ no always-on server
▪ arbitrary end systems directly
communicate
▪ peers request service from other
peers, provide service in return to
other peers
• self scalability – new peers bring new
service capacity, as well as new service
demands
▪ peers are intermittently connected
and change IP addresses
• complex management
▪ example: P2P file sharing
Application Layer: 2-7
8. Processes communicating
process: program running
within a host
▪within same host, two
processes communicate
using inter-process
communication (defined by
OS)
▪processes in different hosts
communicate by exchanging
messages
Application Layer: 2-8
client process: process that
initiates communication
server process: process
that waits to be contacted
▪ note: applications with
P2P architectures have
client processes &
server processes
clients, servers
9. Sockets
Application Layer: 2-9
▪ process sends/receives messages to/from its socket
▪ socket analogous to door
• sending process shoves message out door
• sending process relies on transport infrastructure on other side of
door to deliver message to socket at receiving process
• two sockets involved: one on each side
Internet
controlled
by OS
controlled by
app developer
transport
application
physical
link
network
process
transport
application
physical
link
network
process
socket
10. Addressing processes
Application Layer: 2-10
▪ to receive messages, process
must have identifier
▪ host device has unique 32-bit
IP address
▪ Q: does IP address of host on
which process runs suffice for
identifying the process?
▪ identifier includes both IP address
and port numbers associated with
process on host.
▪ example port numbers:
• HTTP server: 80
• mail server: 25
▪ to send HTTP message to
gaia.cs.umass.edu web server:
• IP address: 128.119.245.12
• port number: 80
▪ more shortly…
▪ A: no, many processes
can be running on
same host
11. An application-layer protocol defines:
Application Layer: 2-11
▪ types of messages exchanged,
• e.g., request, response
▪ message syntax:
• what fields in messages &
how fields are delineated
▪ message semantics
• meaning of information in
fields
▪ rules for when and how
processes send & respond to
messages
open protocols:
▪ defined in RFCs, everyone
has access to protocol
definition
▪ allows for interoperability
▪ e.g., HTTP, SMTP
proprietary protocols:
▪ e.g., Skype
12. What transport service does an app need?
Application Layer: 2-12
data integrity
▪ some apps (e.g., file transfer,
web transactions) require
100% reliable data transfer
▪ other apps (e.g., audio) can
tolerate some loss
timing
▪ some apps (e.g., Internet
telephony, interactive games)
require low delay to be “effective”
throughput
▪ some apps (e.g., multimedia)
require minimum amount of
throughput to be “effective”
▪ other apps (“elastic apps”)
make use of whatever
throughput they get
security
▪ encryption, data integrity,
…
13. Transport service requirements: common apps
Application Layer: 2-13
application
file transfer/download
e-mail
Web documents
real-time audio/video
streaming audio/video
interactive games
text messaging
data loss
no loss
no loss
no loss
loss-tolerant
loss-tolerant
loss-tolerant
no loss
throughput
elastic
elastic
elastic
audio: 5Kbps-1Mbps
video:10Kbps-5Mbps
same as above
Kbps+
elastic
time sensitive?
no
no
no
yes, 10’s msec
yes, few secs
yes, 10’s msec
yes and no
14. Internet transport protocols services
Application Layer: 2-14
TCP service:
▪ reliable transport between sending
and receiving process
▪ flow control: sender won’t
overwhelm receiver
▪ congestion control: throttle sender
when network overloaded
▪ does not provide: timing, minimum
throughput guarantee, security
▪ connection-oriented: setup required
between client and server processes
UDP service:
▪ unreliable data transfer
between sending and receiving
process
▪ does not provide: reliability,
flow control, congestion
control, timing, throughput
guarantee, security, or
connection setup.
Q: why bother? Why
is there a UDP?
15. Internet transport protocols services
Application Layer: 2-15
application
file transfer/download
e-mail
Web documents
Internet telephony
streaming audio/video
interactive games
application
layer protocol
FTP [RFC 959]
SMTP [RFC 5321]
HTTP 1.1 [RFC 7320]
SIP [RFC 3261], RTP [RFC
3550], or proprietary
HTTP [RFC 7320], DASH
WOW, FPS (proprietary)
transport protocol
TCP
TCP
TCP
TCP or UDP
TCP
UDP or TCP
16. Securing TCP
Application Layer: 2-16
Vanilla TCP & UDP sockets:
▪ no encryption
▪ cleartext passwords sent into socket
traverse Internet in cleartext (!)
Transport Layer Security (TLS)
▪ provides encrypted TCP connections
▪ data integrity
▪ end-point authentication
TSL implemented in
application layer
▪ apps use TSL libraries, that
use TCP in turn
TLS socket API
▪ cleartext sent into socket
traverse Internet encrypted
▪ see Chapter 8
17. Application layer: overview
▪ Principles of network
applications
▪ Web and HTTP
▪ E-mail, SMTP, IMAP
▪ The Domain Name System
DNS
▪ P2P applications
▪ video streaming and content
distribution networks
▪ socket programming with
UDP and TCP
Application Layer: 2-17
18. Web and HTTP
Application Layer: 2-18
First, a quick review…
▪ web page consists of objects, each of which can be stored on
different Web servers
▪ object can be HTML file, JPEG image, Java applet, audio file,…
▪ web page consists of base HTML-file which includes several
referenced objects, each addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif
host name path name
19. HTTP overview
Application Layer: 2-19
HTTP: hypertext transfer protocol
▪ Web’s application layer
protocol
▪ client/server model:
• client: browser that requests,
receives, (using HTTP protocol) and
“displays” Web objects
• server: Web server sends (using
HTTP protocol) objects in response
to requests
PC running
Firefox browser
server running
Apache Web
server
iPhone running
Safari browser
20. HTTP overview (continued)
Application Layer: 2-20
HTTP uses TCP:
▪ client initiates TCP connection
(creates socket) to server, port 80
▪ server accepts TCP connection
from client
▪ HTTP messages (application-layer
protocol messages) exchanged
between browser (HTTP client) and
Web server (HTTP server)
▪ TCP connection closed
HTTP is “stateless”
▪ server maintains no
information about past client
requests
protocols that maintain “state”
are complex!
▪ past history (state) must be
maintained
▪ if server/client crashes, their views
of “state” may be inconsistent,
must be reconciled
aside
21. HTTP connections: two types
Application Layer: 2-21
Non-persistent HTTP
1. TCP connection opened
2. at most one object sent
over TCP connection
3. TCP connection closed
downloading multiple
objects required multiple
connections
Persistent HTTP
▪TCP connection opened to
a server
▪multiple objects can be
sent over single TCP
connection between client,
and that server
▪TCP connection closed
22. Non-persistent HTTP: example
Application Layer: 2-22
User enters URL:
1a. HTTP client initiates TCP
connection to HTTP server
(process) at www.someSchool.edu on
port 80
2. HTTP client sends HTTP
request message (containing
URL) into TCP connection
socket. Message indicates
that client wants object
someDepartment/home.index
1b. HTTP server at host
www.someSchool.edu waiting for TCP
connection at port 80 “accepts”
connection, notifying client
3. HTTP server receives request message,
forms response message containing
requested object, and sends message
into its socket
time
(containing text, references to 10 jpeg images)
www.someSchool.edu/someDepartment/home.index
23. Non-persistent HTTP: example (cont.)
Application Layer: 2-23
User enters URL:
(containing text, references to 10 jpeg images)
www.someSchool.edu/someDepartment/home.index
5. HTTP client receives response
message containing html file,
displays html. Parsing html file,
finds 10 referenced jpeg objects
6. Steps 1-5 repeated for
each of 10 jpeg objects
4. HTTP server closes TCP
connection.
time
24. Non-persistent HTTP: response time
Application Layer: 2-24
RTT (definition): time for a small
packet to travel from client to
server and back
HTTP response time (per object):
▪ one RTT to initiate TCP connection
▪ one RTT for HTTP request and first few
bytes of HTTP response to return
▪ obect/file transmission time
time to
transmit
file
initiate TCP
connection
RTT
request file
RTT
file received
time time
Non-persistent HTTP response time = 2RTT+ file transmission time
25. Persistent HTTP (HTTP 1.1)
Application Layer: 2-25
Non-persistent HTTP issues:
▪ requires 2 RTTs per object
▪ OS overhead for each TCP
connection
▪ browsers often open multiple
parallel TCP connections to
fetch referenced objects in
parallel
Persistent HTTP (HTTP1.1):
▪ server leaves connection open after
sending response
▪ subsequent HTTP messages
between same client/server sent
over open connection
▪ client sends requests as soon as it
encounters a referenced object
▪ as little as one RTT for all the
referenced objects (cutting
response time in half)
26. HTTP request message
Application Layer: 2-26
▪ two types of HTTP messages: request, response
▪ HTTP request message:
• ASCII (human-readable format)
request line (GET, POST,
HEAD commands)
header
lines
carriage return, line feed
at start of line indicates
end of header lines
GET /index.html HTTP/1.1rn
Host: www-net.cs.umass.edurn
User-Agent: Firefox/3.6.10rn
Accept: text/html,application/xhtml+xmlrn
Accept-Language: en-us,en;q=0.5rn
Accept-Encoding: gzip,deflatern
Accept-Charset: ISO-8859-1,utf-8;q=0.7rn
Keep-Alive: 115rn
Connection: keep-alivern
rn
carriage return character
line-feed character
* Check out the online interactive exercises for more
examples: http://gaia.cs.umass.edu/kurose_ross/interactive/
27. HTTP request message: general format
Application Layer: 2-27
request
line
header
lines
body
method sp sp cr lf
version
URL
cr lf
value
header field name
cr lf
value
header field name
~
~ ~
~
cr lf
entity body
~
~ ~
~
28. Other HTTP request messages
Application Layer: 2-28
POST method:
▪ web page often includes form
input
▪ user input sent from client to
server in entity body of HTTP
POST request message
GET method (for sending data to server):
▪ include user data in URL field of HTTP
GET request message (following a ‘?’):
www.somesite.com/animalsearch?monkeys&banana
HEAD method:
▪ requests headers (only) that
would be returned if specified
URL were requested with an
HTTP GET method.
PUT method:
▪ uploads new file (object) to server
▪ completely replaces file that exists
at specified URL with content in
entity body of POST HTTP request
message
29. HTTP response message
Application Layer: 2-29
status line (protocol
status code status phrase)
header
lines
data, e.g., requested
HTML file
HTTP/1.1 200 OKrn
Date: Sun, 26 Sep 2010 20:09:20 GMTrn
Server: Apache/2.0.52 (CentOS)rn
Last-Modified: Tue, 30 Oct 2007 17:00:02
GMTrn
ETag: "17dc6-a5c-bf716880"rn
Accept-Ranges: bytesrn
Content-Length: 2652rn
Keep-Alive: timeout=10, max=100rn
Connection: Keep-Alivern
Content-Type: text/html; charset=ISO-8859-
1rn
rn
data data data data data ...
* Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/
30. HTTP response status codes
Application Layer: 2-30
200 OK
• request succeeded, requested object later in this message
301 Moved Permanently
• requested object moved, new location specified later in this message (in
Location: field)
400 Bad Request
• request msg not understood by server
404 Not Found
• requested document not found on this server
505 HTTP Version Not Supported
▪ status code appears in 1st line in server-to-client response message.
▪ some sample codes:
31. Trying out HTTP (client side) for yourself
Application Layer: 2-31
1. Telnet to your favorite Web server:
▪ opens TCP connection to port 80 (default HTTP server
port) at gaia.cs.umass. edu.
▪ anything typed in will be sent to port 80 at
gaia.cs.umass.edu
telnet gaia.cs.umass.edu 80
3. look at response message sent by HTTP server!
(or use Wireshark to look at captured HTTP request/response)
2. type in a GET HTTP request:
GET /kurose_ross/interactive/index.php HTTP/1.1
Host: gaia.cs.umass.edu
▪ by typing this in (hit carriage return twice), you send
this minimal (but complete) GET request to HTTP
server
32. Maintaining user/server state: cookies
Application Layer: 2-32
Recall: HTTP GET/response
interaction is stateless
▪ no notion of multi-step exchanges of
HTTP messages to complete a Web
“transaction”
• no need for client/server to track
“state” of multi-step exchange
• all HTTP requests are independent of
each other
• no need for client/server to “recover”
from a partially-completed-but-never-
completely-completed transaction
a stateful protocol: client makes
two changes to X, or none at all
time time
X
X
X’
X’’
X’’
t’
Q: what happens if network connection or
client crashes at t’ ?
33. Maintaining user/server state: cookies
Application Layer: 2-33
Web sites and client browser use
cookies to maintain some state
between transactions
four components:
1) cookie header line of HTTP response
message
2) cookie header line in next HTTP
request message
3) cookie file kept on user’s host,
managed by user’s browser
4) back-end database at Web site
Example:
▪ Susan uses browser on laptop,
visits specific e-commerce site
for first time
▪ when initial HTTP requests
arrives at site, site creates:
• unique ID (aka “cookie”)
• entry in backend database
for ID
• subsequent HTTP requests
from Susan to this site will
contain cookie ID value,
allowing site to “identify”
Susan
34. Maintaining user/server state: cookies
Application Layer: 2-34
client
server
usual HTTP response msg
usual HTTP response msg
cookie file
one week later:
usual HTTP request msg
cookie: 1678 cookie-
specific
action
access
ebay 8734 usual HTTP request msg Amazon server
creates ID
1678 for user create
entry
usual HTTP response
set-cookie: 1678
ebay 8734
amazon 1678
usual HTTP request msg
cookie: 1678 cookie-
specific
action
access
ebay 8734
amazon 1678
backend
database
time time
35. HTTP cookies: comments
Application Layer: 2-35
What cookies can be used for:
▪ authorization
▪ shopping carts
▪ recommendations
▪ user session state (Web e-mail)
cookies and privacy:
▪ cookies permit sites to
learn a lot about you on
their site.
▪ third party persistent
cookies (tracking cookies)
allow common identity
(cookie value) to be
tracked across multiple
web sites
aside
Challenge: How to keep state:
▪ protocol endpoints: maintain state at
sender/receiver over multiple transactions
▪ cookies: HTTP messages carry state
36. Web caches (proxy servers)
Application Layer: 2-36
▪ user configures browser to
point to a Web cache
▪ browser sends all HTTP
requests to cache
• if object in cache: cache
returns object to client
• else cache requests object
from origin server, caches
received object, then
returns object to client
Goal: satisfy client request without involving origin server
client
proxy
server
client
origin
server
origin
server
37. Web caches (proxy servers)
Application Layer: 2-37
▪ Web cache acts as both
client and server
• server for original
requesting client
• client to origin server
▪ typically cache is
installed by ISP
(university, company,
residential ISP)
Why Web caching?
▪ reduce response time for client
request
• cache is closer to client
▪ reduce traffic on an institution’s
access link
▪ Internet is dense with caches
• enables “poor” content providers
to more effectively deliver content
38. Caching example
Application Layer: 2-38
origin
servers
public
Internet
institutional
network
1 Gbps LAN
1.54 Mbps
access link
problem: large
delays at high
utilization!
Performance:
▪ LAN utilization: .0015
▪ access link utilization = .97
▪ end-end delay = Internet delay +
access link delay + LAN delay
= 2 sec + minutes + usecs
Scenario:
▪ access link rate: 1.54 Mbps
▪ RTT from institutional router to server: 2 sec
▪ Web object size: 100K bits
▪ Average request rate from browsers to origin
servers: 15/sec
▪ average data rate to browsers: 1.50 Mbps
39. Caching example: buy a faster access link
Application Layer: 2-39
origin
servers
public
Internet
institutional
network
1 Gbps LAN
1.54 Mbps
access link
Performance:
▪ LAN utilization: .0015
▪ access link utilization = .97
▪ end-end delay = Internet delay +
access link delay + LAN delay
= 2 sec + minutes + usecs
Scenario:
▪ access link rate: 1.54 Mbps
▪ RTT from institutional router to server: 2 sec
▪ Web object size: 100K bits
▪ Avg request rate from browsers to origin
servers: 15/sec
▪ avg data rate to browsers: 1.50 Mbps
154 Mbps
154 Mbps
.0097
msecs
Cost: faster access link (expensive!)
40. Performance:
▪ LAN utilization: .?
▪ access link utilization = ?
▪ average end-end delay = ?
Caching example: install a web cache
Application Layer: 2-40
origin
servers
public
Internet
institutional
network
1 Gbps LAN
1.54 Mbps
access link
Scenario:
▪ access link rate: 1.54 Mbps
▪ RTT from institutional router to server: 2 sec
▪ Web object size: 100K bits
▪ Avg request rate from browsers to origin
servers: 15/sec
▪ avg data rate to browsers: 1.50 Mbps
How to compute link
utilization, delay?
Cost: web cache (cheap!) local web cache
41. Caching example: install a web cache
Application Layer: 2-41
origin
servers
public
Internet
institutional
network
1 Gbps LAN
1.54 Mbps
access link
local web cache
Calculating access link utilization, end-
end delay with cache:
▪ suppose cache hit rate is 0.4: 40% requests
satisfied at cache, 60% requests satisfied at
origin
▪ access link: 60% of requests use access link
▪ data rate to browsers over access link
= 0.6 * 1.50 Mbps = .9 Mbps
▪ utilization = 0.9/1.54 = .58
▪ average end-end delay
= 0.6 * (delay from origin servers)
+ 0.4 * (delay when satisfied at cache)
= 0.6 (2.01) + 0.4 (~msecs) = ~ 1.2 secs
lower average end-end delay than with 154 Mbps link (and cheaper too!)
42. Conditional GET
Application Layer: 2-42
Goal: don’t send object if cache has
up-to-date cached version
• no object transmission delay
• lower link utilization
▪ cache: specify date of cached copy
in HTTP request
If-modified-since: <date>
▪ server: response contains no
object if cached copy is up-to-date:
HTTP/1.0 304 Not Modified
HTTP request msg
If-modified-since: <date>
HTTP response
HTTP/1.0
304 Not Modified
object
not
modified
before
<date>
HTTP request msg
If-modified-since: <date>
HTTP response
HTTP/1.0 200 OK
<data>
object
modified
after
<date>
client server
43. HTTP/2
Key goal: decreased delay in multi-object HTTP requests
HTTP1.1: introduced multiple, pipelined GETs over single TCP
connection
▪ server responds in-order (FCFS: first-come-first-served scheduling) to
GET requests
▪ with FCFS, small object may have to wait for transmission (head-of-
line (HOL) blocking) behind large object(s)
▪ loss recovery (retransmitting lost TCP segments) stalls object
transmission
Application Layer: 2-43
44. HTTP/2
Key goal: decreased delay in multi-object HTTP requests
HTTP/2: [RFC 7540, 2015] increased flexibility at server in sending
objects to client:
▪ methods, status codes, most header fields unchanged from HTTP 1.1
▪ transmission order of requested objects based on client-specified
object priority (not necessarily FCFS)
▪ push unrequested objects to client
▪ divide objects into frames, schedule frames to mitigate HOL blocking
Application Layer: 2-44
45. HTTP/2: mitigating HOL blocking
HTTP 1.1: client requests 1 large object (e.g., video file, and 3 smaller
objects)
client
server
GET O1
GET O2
GET O3
GET O4
O1
O2
O3
O4
object data requested
O1
O2
O3
O4
objects delivered in order requested: O2, O3, O4 wait behind O1 Application Layer: 2-45
46. HTTP/2: mitigating HOL blocking
HTTP/2: objects divided into frames, frame transmission interleaved
client
server
GET O1
GET O2
GET O3
GET O4
O2
O4
object data requested
O1
O2
O3
O4
O2, O3, O4 delivered quickly, O1 slightly delayed
O3
O1
Application Layer: 2-46
47. HTTP/2 to HTTP/3
Key goal: decreased delay in multi-object HTTP requests
HTTP/2 over single TCP connection means:
▪ recovery from packet loss still stalls all object transmissions
• as in HTTP 1.1, browsers have incentive to open multiple parallel
TCP connections to reduce stalling, increase overall throughput
▪ no security over vanilla TCP connection
▪ HTTP/3: adds security , per object error- and congestion-
control (more pipelining) over UDP
• more on HTTP/3 in transport layer
Application Layer: 2-47
48. Application layer: overview
▪ Principles of network
applications
▪ Web and HTTP
▪ E-mail, SMTP, IMAP
▪ The Domain Name System
DNS
▪ P2P applications
▪ video streaming and content
distribution networks
▪ socket programming with
UDP and TCP
Application Layer: 2-48
49. E-mail
Application Layer: 2-49
Three major components:
▪ user agents
▪ mail servers
▪ simple mail transfer protocol: SMTP
User Agent
▪ a.k.a. “mail reader”
▪ composing, editing, reading mail messages
▪ e.g., Outlook, iPhone mail client
▪ outgoing, incoming messages stored on
server
user mailbox
outgoing
message queue
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
50. E-mail: mail servers
Application Layer: 2-50
user mailbox
outgoing
message queue
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
mail servers:
▪ mailbox contains incoming
messages for user
▪ message queue of outgoing (to
be sent) mail messages
▪ SMTP protocol between mail
servers to send email messages
• client: sending mail server
• “server”: receiving mail server
51. E-mail: the RFC (5321)
Application Layer: 2-51
▪ uses TCP to reliably transfer email message from client (mail server
initiating connection) to server, port 25
▪ direct transfer: sending server (acting like client) to receiving server
▪ three phases of transfer
• handshaking (greeting)
• transfer of messages
• closure
▪ command/response interaction (like HTTP)
• commands: ASCII text
• response: status code and phrase
▪ messages must be in 7-bit ASCI
52. Scenario: Alice sends e-mail to Bob
Application Layer: 2-52
1) Alice uses UA to compose e-mail
message “to” [email protected]
4) SMTP client sends Alice’s message
over the TCP connection
user
agent
mail
server
mail
server
1
2 3 4
5
6
Alice’s mail server Bob’s mail server
user
agent
2) Alice’s UA sends message to her
mail server; message placed in
message queue
3) client side of SMTP opens TCP
connection with Bob’s mail server
5) Bob’s mail server places
the message in Bob’s
mailbox
6) Bob invokes his user
agent to read message
53. Sample SMTP interaction
Application Layer: 2-53
S: 220 hamburger.edu
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <[email protected]>
S: 250 [email protected]... Sender ok
C: RCPT TO: <[email protected]>
S: 250 [email protected] ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection
54. Try SMTP interaction for yourself:
Application Layer: 2-54
telnet <servername> 25
▪ see 220 reply from server
▪ enter HELO, MAIL FROM:, RCPT TO:, DATA, QUIT commands
above lets you send email without using e-mail client (reader)
Note: this will only work if <servername> allows telnet connections to port 25 (this is becoming
increasingly rare because of security concerns)
55. SMTP: closing observations
Application Layer: 2-55
▪ SMTP uses persistent
connections
▪ SMTP requires message
(header & body) to be in
7-bit ASCII
▪ SMTP server uses
CRLF.CRLF to determine
end of message
comparison with HTTP:
▪ HTTP: pull
▪ SMTP: push
▪ both have ASCII command/response
interaction, status codes
▪ HTTP: each object encapsulated in its
own response message
▪ SMTP: multiple objects sent in
multipart message
56. Mail message format
Application Layer: 2-56
SMTP: protocol for exchanging e-mail
messages, defined in RFC 531 (like HTTP)
RFC 822 defines syntax for e-mail message
itself (like HTML)
▪ header lines, e.g.,
• To:
• From:
• Subject:
these lines, within the body of the email
message area different from SMTP MAIL FROM:,
RCPT TO: commands!
▪ Body: the “message” , ASCII characters only
header
body
blank
line
57. Mail access protocols
Application Layer: 2-57
sender’s e-mail
server
SMTP SMTP
e-mail access
protocol
receiver’s e-mail
server
(e.g., IMAP,
HTTP)
user
agent
user
agent
▪ SMTP: delivery/storage of e-mail messages to receiver’s server
▪ mail access protocol: retrieval from server
• IMAP: Internet Mail Access Protocol [RFC 3501]: messages stored on server, IMAP
provides retrieval, deletion, folders of stored messages on server
▪ HTTP: gmail, Hotmail, Yahoo!Mail, etc. provides web-based interface on
top of STMP (to send), IMAP (or POP) to retrieve e-mail messages
58. Application Layer: Overview
▪ Principles of network
applications
▪ Web and HTTP
▪ E-mail, SMTP, IMAP
▪ The Domain Name System
DNS
▪ P2P applications
▪ video streaming and content
distribution networks
▪ socket programming with
UDP and TCP
Application Layer: 2-58
59. DNS: Domain Name System
Application Layer: 2-59
people: many identifiers:
• SSN, name, passport #
Internet hosts, routers:
• IP address (32 bit) - used for
addressing datagrams
• “name”, e.g., cs.umass.edu -
used by humans
Q: how to map between IP
address and name, and vice
versa ?
Domain Name System:
▪ distributed database implemented in
hierarchy of many name servers
▪ application-layer protocol: hosts,
name servers communicate to resolve
names (address/name translation)
• note: core Internet function,
implemented as application-layer
protocol
• complexity at network’s “edge”
60. DNS: services, structure
Application Layer: 2-60
Q: Why not centralize DNS?
▪ single point of failure
▪ traffic volume
▪ distant centralized database
▪ maintenance
DNS services
▪ hostname to IP address translation
▪ host aliasing
• canonical, alias names
▪ mail server aliasing
▪ load distribution
• replicated Web servers: many IP
addresses correspond to one
name
A: doesn‘t scale!
▪ Comcast DNS servers
alone: 600B DNS queries
per day
61. DNS: a distributed, hierarchical database
Application Layer: 2-61
Root DNS Servers
.com DNS servers .org DNS servers .edu DNS servers
nyu.edu
DNS servers
umass.edu
DNS servers
yahoo.com
DNS servers
amazon.com
DNS servers
pbs.org
DNS servers
… …
Client wants IP address for www.amazon.com; 1st approximation:
▪ client queries root server to find .com DNS server
▪ client queries .com DNS server to get amazon.com DNS server
▪ client queries amazon.com DNS server to get IP address for www.amazon.com
Top Level Domain
Root
Authoritative
…
… … …
62. DNS: root name servers
Application Layer: 2-62
▪ official, contact-of-last-resort by
name servers that can not
resolve name
▪ incredibly important Internet
function
• Internet couldn’t function without it!
• DNSSEC – provides security
(authentication and message
integrity)
▪ ICANN (Internet Corporation for
Assigned Names and Numbers)
manages root DNS domain
13 logical root name “servers”
worldwide each “server” replicated
many times (~200 servers in US)
63. TLD: authoritative servers
Application Layer: 2-63
Top-Level Domain (TLD) servers:
▪ responsible for .com, .org, .net, .edu, .aero, .jobs, .museums, and all
top-level country domains, e.g.: .cn, .uk, .fr, .ca, .jp
▪ Network Solutions: authoritative registry for .com, .net TLD
▪ Educause: .edu TLD
Authoritative DNS servers:
▪ organization’s own DNS server(s), providing authoritative hostname
to IP mappings for organization’s named hosts
▪ can be maintained by organization or service provider
64. Local DNS name servers
Application Layer: 2-64
▪ does not strictly belong to hierarchy
▪ each ISP (residential ISP, company, university) has one
• also called “default name server”
▪ when host makes DNS query, query is sent to its local DNS
server
• has local cache of recent name-to-address translation pairs (but may
be out of date!)
• acts as proxy, forwards query into hierarchy
65. DNS name resolution: iterated query
Application Layer: 2-65
Example: host at engineering.nyu.edu
wants IP address for gaia.cs.umass.edu
Iterated query:
▪ contacted server replies
with name of server to
contact
▪ “I don’t know this name,
but ask this server”
requesting host at
engineering.nyu.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.nyu.edu
1
2
3
4
5
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS server
66. DNS name resolution: recursive query
Application Layer: 2-66
requesting host at
engineering.nyu.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.nyu.edu
1
2 3
4
5
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS server
Recursive query:
▪ puts burden of name
resolution on
contacted name
server
▪ heavy load at upper
levels of hierarchy?
Example: host at engineering.nyu.edu
wants IP address for gaia.cs.umass.edu
67. Caching, Updating DNS Records
Application Layer: 2-67
▪ once (any) name server learns mapping, it caches mapping
• cache entries timeout (disappear) after some time (TTL)
• TLD servers typically cached in local name servers
• thus root name servers not often visited
▪ cached entries may be out-of-date (best-effort name-to-
address translation!)
• if name host changes IP address, may not be known Internet-wide
until all TTLs expire!
▪ update/notify mechanisms proposed IETF standard
• RFC 2136
68. DNS records
Application Layer: 2-68
DNS: distributed database storing resource records (RR)
type=NS
▪ name is domain (e.g., foo.com)
▪ value is hostname of
authoritative name server for
this domain
RR format: (name, value, type, ttl)
type=A
▪ name is hostname
▪ value is IP address
type=CNAME
▪ name is alias name for some “canonical”
(the real) name
▪ www.ibm.com is really servereast.backup2.ibm.com
▪ value is canonical name
type=MX
▪ value is name of mailserver
associated with name
69. DNS protocol messages
Application Layer: 2-69
DNS query and reply messages, both have same format:
message header:
▪ identification: 16 bit # for query,
reply to query uses same #
▪ flags:
• query or reply
• recursion desired
• recursion available
• reply is authoritative
identification flags
# questions
questions (variable # of questions)
# additional RRs
# authority RRs
# answer RRs
answers (variable # of RRs)
authority (variable # of RRs)
additional info (variable # of RRs)
2 bytes 2 bytes
70. Application Layer: 2-70
DNS query and reply messages, both have same format:
identification flags
# questions
questions (variable # of questions)
# additional RRs
# authority RRs
# answer RRs
answers (variable # of RRs)
authority (variable # of RRs)
additional info (variable # of RRs)
2 bytes 2 bytes
name, type fields for a query
RRs in response to query
records for authoritative servers
additional “ helpful” info that may
be used
DNS protocol messages
71. Inserting records into DNS
Application Layer: 2-71
Example: new startup “Network Utopia”
▪ register name networkuptopia.com at DNS registrar (e.g., Network
Solutions)
• provide names, IP addresses of authoritative name server (primary and
secondary)
• registrar inserts NS, A RRs into .com TLD server:
(networkutopia.com, dns1.networkutopia.com, NS)
(dns1.networkutopia.com, 212.212.212.1, A)
▪ create authoritative server locally with IP address 212.212.212.1
• type A record for www.networkuptopia.com
• type MX record for networkutopia.com
72. DNS security
Application Layer: 2-72
DDoS attacks
▪ bombard root servers with
traffic
• not successful to date
• traffic filtering
• local DNS servers cache IPs of TLD
servers, allowing root server
bypass
▪ bombard TLD servers
• potentially more dangerous
Redirect attacks
▪ man-in-middle
• intercept DNS queries
▪ DNS poisoning
• send bogus relies to DNS
server, which caches
Exploit DNS for DDoS
▪ send queries with spoofed
source address: target IP
▪ requires amplification
DNSSEC
[RFC 4033]
73. Application Layer: Overview
▪ Principles of network
applications
▪ Web and HTTP
▪ E-mail, SMTP, IMAP
▪ The Domain Name System
DNS
▪ P2P applications
▪ video streaming and content
distribution networks
▪ socket programming with
UDP and TCP
Application Layer: 2-73
74. mobile network
home network
enterprise
network
national or global ISP
local or
regional ISP
datacenter
network
content
provider
network
Peer-to-peer (P2P) architecture
▪ no always-on server
▪ arbitrary end systems directly
communicate
▪ peers request service from other
peers, provide service in return to
other peers
• self scalability – new peers bring new
service capacity, and new service demands
▪ peers are intermittently connected
and change IP addresses
• complex management
▪ examples: P2P file sharing (BitTorrent),
streaming (KanKan), VoIP (Skype)
Application Layer: 2-74
75. Introduction: 1-75
File distribution: client-server vs P2P
Q: how much time to distribute file (size F) from one server to
N peers?
• peer upload/download capacity is limited resource
us
uN
dN
server
network (with abundant
bandwidth)
file, size F
us: server upload
capacity
ui: peer i upload
capacity
di: peer i download
capacity
u2 d2
u1 d1
di
ui
76. Introduction: 1-76
File distribution time: client-server
▪ server transmission: must sequentially
send (upload) N file copies:
• time to send one copy: F/us
• time to send N copies: NF/us
▪ client: each client must download
file copy
• dmin = min client download rate
• min client download time: F/dmin
us
network
di
ui
F
increases linearly in N
time to distribute F
to N clients using
client-server approach
Dc-s > max{NF/us,,F/dmin}
77. File distribution time: P2P
▪ server transmission: must upload at
least one copy:
• time to send one copy: F/us
▪ client: each client must download
file copy
• min client download time: F/dmin
us
network
di
ui
F
▪ clients: as aggregate must download NF bits
• max upload rate (limiting max download rate) is us + Sui
time to distribute F
to N clients using
P2P approach
DP2P > max{F/us,,F/dmin,,NF/(us + Sui)}
… but so does this, as each peer brings service capacity
increases linearly in N …
Application Layer: 2-77
78. Client-server vs. P2P: example
client upload rate = u, F/u = 1 hour, us = 10u, dmin ≥ us
0
0.5
1
1.5
2
2.5
3
3.5
0 5 10 15 20 25 30 35
N
Minimum
Distribution
Time
P2P
Client-Server
Application Layer: 2-78
79. P2P file distribution: BitTorrent
▪ file divided into 256Kb chunks
▪ peers in torrent send/receive file chunks
tracker: tracks peers
participating in torrent
torrent: group of peers
exchanging chunks of a file
Alice arrives …
… obtains list
of peers from tracker
… and begins exchanging
file chunks with peers in torrent
Application Layer: 2-79
80. P2P file distribution: BitTorrent
▪ peer joining torrent:
• has no chunks, but will accumulate them
over time from other peers
• registers with tracker to get list of peers,
connects to subset of peers
(“neighbors”)
▪ while downloading, peer uploads chunks to other peers
▪ peer may change peers with whom it exchanges chunks
▪ churn: peers may come and go
▪ once peer has entire file, it may (selfishly) leave or (altruistically) remain
in torrent
Application Layer: 2-80
81. BitTorrent: requesting, sending file chunks
Requesting chunks:
▪ at any given time, different
peers have different
subsets of file chunks
▪ periodically, Alice asks
each peer for list of chunks
that they have
▪ Alice requests missing
chunks from peers, rarest
first
Sending chunks: tit-for-tat
▪ Alice sends chunks to those four
peers currently sending her chunks
at highest rate
• other peers are choked by Alice (do
not receive chunks from her)
• re-evaluate top 4 every10 secs
▪ every 30 secs: randomly select
another peer, starts sending
chunks
• “optimistically unchoke” this peer
• newly chosen peer may join top 4
Application Layer: 2-81
82. BitTorrent: tit-for-tat
(1) Alice “optimistically unchokes” Bob
(2) Alice becomes one of Bob’s top-four providers; Bob reciprocates
(3) Bob becomes one of Alice’s top-four providers
higher upload rate: find better trading
partners, get file faster !
Application Layer: 2-82
83. Application layer: overview
▪ Principles of network
applications
▪ Web and HTTP
▪ E-mail, SMTP, IMAP
▪ The Domain Name System
DNS
▪ P2P applications
▪ video streaming and content
distribution networks
▪ socket programming with
UDP and TCP
Application Layer: 2-83
84. Video Streaming and CDNs: context
▪ stream video traffic: major consumer of Internet
bandwidth
• Netflix, YouTube, Amazon Prime: 80% of residential ISP
traffic (2020)
▪ challenge: scale - how to reach ~1B users?
• single mega-video server won’t work (why?)
▪ challenge: heterogeneity
▪ different users have different capabilities (e.g., wired
versus mobile; bandwidth rich versus bandwidth poor)
▪ solution: distributed, application-level infrastructure
Application Layer: 2-84
85. Multimedia: video
▪ video: sequence of images
displayed at constant rate
• e.g., 24 images/sec
▪ digital image: array of pixels
• each pixel represented by bits
▪ coding: use redundancy within and
between images to decrease # bits
used to encode image
• spatial (within image)
• temporal (from one image to
next)
……………………..
spatial coding example: instead
of sending N values of same
color (all purple), send only two
values: color value (purple) and
number of repeated values (N)
……………….…….
frame i
frame i+1
temporal coding example:
instead of sending
complete frame at i+1,
send only differences from
frame i
Application Layer: 2-85
86. Multimedia: video
……………………..
spatial coding example: instead
of sending N values of same
color (all purple), send only two
values: color value (purple) and
number of repeated values (N)
……………….…….
frame i
frame i+1
temporal coding example:
instead of sending
complete frame at i+1,
send only differences from
frame i
▪ CBR: (constant bit rate): video
encoding rate fixed
▪ VBR: (variable bit rate): video
encoding rate changes as
amount of spatial, temporal
coding changes
▪ examples:
• MPEG 1 (CD-ROM) 1.5 Mbps
• MPEG2 (DVD) 3-6 Mbps
• MPEG4 (often used in
Internet, 64Kbps – 12 Mbps)
Application Layer: 2-86
87. Main challenges:
▪ server-to-client bandwidth will vary over time, with changing network
congestion levels (in house, in access network, in network core, at
video server)
▪ packet loss and delay due to congestion will delay playout, or result in
poor video quality
Streaming stored video
simple scenario:
video server
(stored video)
client
Internet
Application Layer: 2-87
88. Streaming stored video
1. video
recorded
(e.g., 30
frames/sec)
2. video
sent
streaming: at this time, client playing out
early part of video, while server still sending
later part of video
network delay
(fixed in this
example)
time
3. video received, played out at client
(30 frames/sec)
Application Layer: 2-88
89. Streaming stored video: challenges
▪ continuous playout constraint: once client
playout begins, playback must match original
timing
• … but network delays are variable (jitter), so will
need client-side buffer to match playout
requirements
▪ other challenges:
• client interactivity: pause, fast-forward, rewind,
jump through video
• video packets may be lost, retransmitted
Application Layer: 2-89
90. Streaming stored video: playout buffering
constant bit
rate video
transmission
time
variable
network
delay
client video
reception
constant bit
rate video
playout at client
client playout
delay
buffered
video
▪client-side buffering and playout delay: compensate for
network-added delay, delay jitter
Application Layer: 2-90
91. Streaming multimedia: DASH
▪ DASH: Dynamic, Adaptive Streaming over HTTP
▪ server:
• divides video file into multiple chunks
• each chunk stored, encoded at different rates
• manifest file: provides URLs for different chunks
▪ client:
• periodically measures server-to-client bandwidth
• consulting manifest, requests one chunk at a time
• chooses maximum coding rate sustainable given current bandwidth
• can choose different coding rates at different points in time (depending
on available bandwidth at time)
client
Internet
Application Layer: 2-91
92. Streaming multimedia: DASH
client
Internet
▪“intelligence” at client: client
determines
• when to request chunk (so that buffer
starvation, or overflow does not occur)
• what encoding rate to request (higher
quality when more bandwidth
available)
• where to request chunk (can request from URL server that is “close”
to client or has high available bandwidth)
Streaming video = encoding + DASH + playout buffering
Application Layer: 2-92
93. Content distribution networks (CDNs)
▪ challenge: how to stream content (selected from millions of
videos) to hundreds of thousands of simultaneous users?
▪ option 1: single, large “mega-server”
• single point of failure
• point of network congestion
• long path to distant clients
• multiple copies of video sent over outgoing link
….quite simply: this solution doesn’t scale
Application Layer: 2-93
94. Content distribution networks (CDNs)
▪ challenge: how to stream content (selected from millions of
videos) to hundreds of thousands of simultaneous users?
• enter deep: push CDN servers deep into many
access networks
• close to users
• Akamai: 240,000 servers deployed in more than 120
countries (2015)
• bring home: smaller number (10’s) of larger
clusters in POPs near (but not within) access
networks
• used by Limelight
▪ option 2: store/serve multiple copies of videos at multiple
geographically distributed sites (CDN)
Application Layer: 2-94
95. ▪ subscriber requests content from CDN
Content distribution networks (CDNs)
▪ CDN: stores copies of content at CDN nodes
• e.g. Netflix stores copies of MadMen
where’s Madmen?
manifest file
• directed to nearby copy, retrieves content
• may choose different copy if network path congested
Application Layer: 2-95
96. Internet host-host communication as a service
OTT challenges: coping with a congested Internet
▪ from which CDN node to retrieve content?
▪ viewer behavior in presence of congestion?
▪ what content to place in which CDN node?
OTT: “over the top”
Content distribution networks (CDNs)
Application Layer: 2-96
97. CDN content access: a closer look
netcinema.com
KingCDN.com
1
1. Bob gets URL for video
http://netcinema.com/6Y7B23V
from netcinema.com web page
2
2. resolve http://netcinema.com/6Y7B23V
via Bob’s local DNS
netcinema’s
authoratative DNS
3
3. netcinema’s DNS returns CNAME for
http://KingCDN.com/NetC6y&B23V 4
5
6. request video from
KINGCDN server,
streamed via HTTP
KingCDN
authoritative DNS
Bob’s
local DNS
server
Bob (client) requests video http://netcinema.com/6Y7B23V
▪ video stored in CDN at http://KingCDN.com/NetC6y&B23V
Application Layer: 2-97
98. Case study: Netflix
1
Bob manages
Netflix account
Netflix registration,
accounting servers
Amazon cloud
CDN
server
2
Bob browses
Netflix video
Manifest file,
requested
returned for
specific video
DASH server
selected, contacted,
streaming begins
upload copies of
multiple versions of
video to CDN servers
CDN
server
CDN
server
3
4
Application Layer: 2-98
99. Application Layer: Overview
▪ Principles of network
applications
▪ Web and HTTP
▪ E-mail, SMTP, IMAP
▪ The Domain Name System
DNS
▪ P2P applications
▪ video streaming and content
distribution networks
▪ socket programming with
UDP and TCP
Application Layer: 2-99
100. Socket programming
goal: learn how to build client/server applications that
communicate using sockets
socket: door between application process and end-end-transport
protocol
Internet
controlled
by OS
controlled by
app developer
transport
application
physical
link
network
process
transport
application
physical
link
network
process
socket
Application Layer: 2-100
101. Socket programming
Two socket types for two transport services:
▪ UDP: unreliable datagram
▪ TCP: reliable, byte stream-oriented
Application Example:
1. client reads a line of characters (data) from its keyboard and sends
data to server
2. server receives the data and converts characters to uppercase
3. server sends modified data to client
4. client receives modified data and displays line on its screen
Application Layer: 2-101
102. Socket programming with UDP
UDP: no “connection” between client & server
▪ no handshaking before sending data
▪ sender explicitly attaches IP destination address and port # to each
packet
▪ receiver extracts sender IP address and port# from received packet
UDP: transmitted data may be lost or received out-of-order
Application viewpoint:
▪ UDP provides unreliable transfer of groups of bytes (“datagrams”)
between client and server
Application Layer: 2-102
103. Client/server socket interaction: UDP
close
clientSocket
read datagram from
clientSocket
create socket:
clientSocket =
socket(AF_INET,SOCK_DGRAM)
Create datagram with server IP and
port=x; send datagram via
clientSocket
create socket, port= x:
serverSocket =
socket(AF_INET,SOCK_DGRAM)
read datagram from
serverSocket
write reply to
serverSocket
specifying
client address,
port number
server (running on serverIP) client
Application Layer: 2-103
104. Example app: UDP client
from socket import *
serverName = ‘hostname’
serverPort = 12000
clientSocket = socket(AF_INET,
SOCK_DGRAM)
message = raw_input(’Input lowercase sentence:’)
clientSocket.sendto(message.encode(),
(serverName, serverPort))
modifiedMessage, serverAddress =
clientSocket.recvfrom(2048)
print modifiedMessage.decode()
clientSocket.close()
Python UDPClient
include Python’s socket library
create UDP socket for server
get user keyboard input
attach server name, port to message; send into socket
print out received string and close socket
read reply characters from socket into string
Application Layer: 2-104
105. Example app: UDP server
Python UDPServer
from socket import *
serverPort = 12000
serverSocket = socket(AF_INET, SOCK_DGRAM)
serverSocket.bind(('', serverPort))
print (“The server is ready to receive”)
while True:
message, clientAddress = serverSocket.recvfrom(2048)
modifiedMessage = message.decode().upper()
serverSocket.sendto(modifiedMessage.encode(),
clientAddress)
create UDP socket
bind socket to local port number 12000
loop forever
Read from UDP socket into message, getting
client’s address (client IP and port)
send upper case string back to this client
Application Layer: 2-105
106. Socket programming with TCP
Client must contact server
▪ server process must first be
running
▪ server must have created socket
(door) that welcomes client’s
contact
Client contacts server by:
▪ Creating TCP socket, specifying IP
address, port number of server
process
▪ when client creates socket: client
TCP establishes connection to
server TCP
▪ when contacted by client, server
TCP creates new socket for server
process to communicate with that
particular client
• allows server to talk with multiple
clients
• source port numbers used to
distinguish clients (more in Chap 3)
TCP provides reliable, in-order
byte-stream transfer (“pipe”)
between client and server
Application viewpoint
Application Layer: 2-106
107. Client/server socket interaction: TCP
server (running on hostid) client
wait for incoming
connection request
connectionSocket =
serverSocket.accept()
create socket,
port=x, for incoming
request:
serverSocket = socket()
create socket,
connect to hostid, port=x
clientSocket = socket()
send request using
clientSocket
read request from
connectionSocket
write reply to
connectionSocket
TCP
connection setup
close
connectionSocket
read reply from
clientSocket
close
clientSocket
Application Layer: 2-107
108. Example app: TCP client
from socket import *
serverName = ’servername’
serverPort = 12000
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName,serverPort))
sentence = raw_input(‘Input lowercase sentence:’)
clientSocket.send(sentence.encode())
modifiedSentence = clientSocket.recv(1024)
print (‘From Server:’, modifiedSentence.decode())
clientSocket.close()
Python TCPClient
create TCP socket for server,
remote port 12000
No need to attach server name, port
Application Layer: 2-108
109. Example app: TCP server
from socket import *
serverPort = 12000
serverSocket = socket(AF_INET,SOCK_STREAM)
serverSocket.bind((‘’,serverPort))
serverSocket.listen(1)
print ‘The server is ready to receive’
while True:
connectionSocket, addr = serverSocket.accept()
sentence = connectionSocket.recv(1024).decode()
capitalizedSentence = sentence.upper()
connectionSocket.send(capitalizedSentence.
encode())
connectionSocket.close()
Python TCPServer
create TCP welcoming socket
server begins listening for
incoming TCP requests
loop forever
server waits on accept() for incoming
requests, new socket created on return
read bytes from socket (but
not address as in UDP)
close connection to this client (but not
welcoming socket)
Application Layer: 2-109
110. Chapter 2: Summary
▪ application architectures
• client-server
• P2P
▪ application service requirements:
• reliability, bandwidth, delay
▪ Internet transport service model
• connection-oriented, reliable: TCP
• unreliable, datagrams: UDP
our study of network application layer is now complete!
▪ specific protocols:
• HTTP
• SMTP, IMAP
• DNS
• P2P: BitTorrent
▪ video streaming, CDNs
▪ socket programming:
TCP, UDP sockets
Application Layer: 2-110
111. Chapter 2: Summary
Most importantly: learned about protocols!
▪ typical request/reply message
exchange:
• client requests info or service
• server responds with data, status code
▪ message formats:
• headers: fields giving info about data
• data: info(payload) being
communicated
important themes:
▪ centralized vs. decentralized
▪ stateless vs. stateful
▪ scalability
▪ reliable vs. unreliable
message transfer
▪ “complexity at network
edge”
Application Layer: 2-111