SlideShare a Scribd company logo
Computer Networks – CSE331
Lecture 6
2 Hrs
Will be more in Lab
CIDR: Classless InterDomain Routing
 subnet portion of address of arbitrary length
 address format: a.b.c.d/x, where x is # bits in subnet portion
of address
 Purchase what you need
11001000 00010111 00010000 00000000
subnet
part
host
part
200.23.16.0/23
206.0.64.0/18
204.188.0.0/15
209.88.232.0/21Internet Backbone
ISP K owns:
Company X :
206.0.68.0/22
ISP Y :
209.88.237.0/24
Organization Z1 :
209.88.237.192/26
Organization Z2 :
209.88.237.0/26
Backbone sends everything
which matches the prefixes
206.0.64.0/18, 204.188.0.0/15,
209.88.232.0/21 to ISP K.
ISP K sends everything which
matches the prefix:
206.0.68.0/22 to Company X,
209.88.237.0/24 to ISP Y
Backbone routers do not know
anything about Company X, ISP
Y, or Organizations Z1, Z2.
ISP K does not know about
Organizations Z1, Z2. ISP Y sends everything which matches
the prefix:
209.88.237.192/26 to Organizations Z1
209.88.237.0/26 to Organizations Z2
our goals:
 conceptual,
implementation aspects
of network application
protocols
 transport-layer service
models
 client-server paradigm
 peer-to-peer paradigm
 learn about protocols by
examining popular
application-level
protocols
 HTTP
 FTP
 SMTP / POP3 / IMAP
 DNS
 creating network
applications
 socket API
 e-mail
 web
 text messaging
 remote login
 P2P file sharing
 multi-user network games
 streaming stored video
(YouTube, dailymotion)
 voice over IP (e.g.,
Skype)
 real-time video
conferencing
 social networking
 search
 …
 …
write programs that:
 run on (different) end
systems
 communicate over network
 e.g., web server software
communicates with browser
software
Two models
 Client Server
 Peer to Peer (P2P)
application
transport
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
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
client process: process that
initiates communication
server process: process that
waits to be contacted
 aside: applications with P2P
architectures have client
processes & server
processes
clients, servers
server:
 always-on host
 permanent IP address
 data centers for scaling
clients:
 communicate with server
 may be intermittently connected
 may have dynamic IP addresses
 do not communicate directly with
each other
client/server
 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
peer-peer
 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 sufficient
for identifying the process?
 A: no, many processes can be
running on same host
 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
uet.edu.pk web server:
 IP address: 111.68.102.6
 port number: 80
 more shortly…
 process sends/receives messages to/from its socket
 socket analogous to door
 sending process send message out door
 sending process relies on transport infrastructure on other
side of door to deliver message to socket at receiving process
Internet
controlled
by OS
controlled by
app developer
transport
application
physical
link
network
process
transport
application
physical
link
network
processsocket
 Suppose Gifts have to be
delivered to cousins
 Two houses
 House 1
 Ali, Amna
 House 2
 Rehman, Fatima
 Ali want to send to
Rehman & Amna want to
send Fatima
host
host
process
process
Every process associated with a socket – socket has a 16bit number
Complete address is IP address + socket no
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?
Application Application Layer
Protocol
Transport
protocol
Email SMTP [RFC 2821] TCP
Remote terminal access Telnet [RFC 854] TCP
Web HTTP [RFC 2616] TCP
File transfer FTP [RFC 959] TCP
Streaming multimedia HTTP, RTP [RFC 1889] TCP or UDP
Internet telephony SIP, RTP, proprietary (e.g.
skype)
TCP or UDP
TCP & UDP
 no encryption
 cleartext passwords sent into
socket traverse Internet in
cleartext
SSL
 provides encrypted TCP
connection
 data integrity
 end-point authentication
SSL is at app layer
 Apps use SSL libraries, which
“talk” to TCP
SSL socket API
 cleartext passwords sent
into socket traverse Internet
encrypted
 More in Chapter 7
First, a review…
 Until 1990s universities, researchers => remote loging, file
transfer, email
 World wide web (www) in 1994 Tim Berners Lee
 web page consists of objects
 object can be HTML file, JPEG image, Java applet, audio file,…
 web page consists of base HTML-file which includes several
referenced objects
 each object is addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif
host name path name
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
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
non-persistent HTTP
 at most one object
sent over TCP
connection
 connection then
closed
 downloading multiple
objects required
multiple connections
persistent HTTP
 multiple objects can be
sent over single TCP
connection between
client, server
www.someSchool.edu/someDepartment/home.html
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.html
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
(contains text,
references to 10
jpeg images)
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.
RTT (definition): time for a small
packet to travel from client to server
and back
HTTP response time:
 one RTT to initiate TCP connection
 one RTT for HTTP request and first
few bytes of HTTP response to return
 file transmission time
 non-persistent HTTP response time
2RTT+ file transmission time
time to
transmit
file
initiate TCP
connection
RTT
request
file
RTT
file
received
time timeIf 1 RTT is 500ms file size is 100KB link
speed is 0.5MB what is total time?
1.2sec If 1 RTT is 500ms file size is 100MB link
speed is 0.5MB what is total time?
201sec
non-persistent HTTP
issues:
 requires 2 RTTs per object
 OS overhead for each TCP
connection
 browsers often open parallel
TCP connections to fetch
referenced objects
persistent HTTP:
 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
Demo – Persistent & non-persistent HTTP
 Quiz upto this Lecture on next Monday
 Ross book 2.1 to 2.2.2
 Forouzan book chapter 17
 List of standard internet protocols
 http://www.iana.org
 For those who want to learn Java
 Lecture 3, 4 (CS-2) on Tuesday 13 Feb 2017
 Bring your laptops with you

More Related Content

PPT
Socket Programming - nitish nagar
PPT
Appl layer
PPT
Networking Java Socket Programming
PDF
Java networking programs - theory
PPT
Network programming in Java
PDF
Unit-4 networking basics in java
PPT
java networking
PPTX
Socket programming in Java (PPTX)
Socket Programming - nitish nagar
Appl layer
Networking Java Socket Programming
Java networking programs - theory
Network programming in Java
Unit-4 networking basics in java
java networking
Socket programming in Java (PPTX)

What's hot (20)

PPT
Networking in java
PDF
Java networking programs socket based
PPTX
Java socket programming
PPT
Chapter2 l2 modified_um
PPT
Network Programming in Java
PPTX
Networking in Java
PPT
Java Network Programming
PPTX
Network programming in java - PPT
PPT
Java Networking
PDF
Chap 1 Network Theory & Java Overview
PPT
Web Services 2009
PPT
A Short Java Socket Tutorial
PPT
Sockets
PDF
maXbox_Arduino_Pascal_Magazine
PPTX
Whole c++ lectures ITM1 Th
PPTX
Python Sockets
PPTX
Java Networking
PDF
Web tcp ip
PPT
Java Networking
Networking in java
Java networking programs socket based
Java socket programming
Chapter2 l2 modified_um
Network Programming in Java
Networking in Java
Java Network Programming
Network programming in java - PPT
Java Networking
Chap 1 Network Theory & Java Overview
Web Services 2009
A Short Java Socket Tutorial
Sockets
maXbox_Arduino_Pascal_Magazine
Whole c++ lectures ITM1 Th
Python Sockets
Java Networking
Web tcp ip
Java Networking
Ad

Similar to Lec 6(Application Layer) (20)

PPT
Ch2 application layer Network
PPTX
02_Chapter_2_V6_LV.pptx
PPTX
2 - Applications.pptx cccccccccccccccccc
PPT
applayerslides.ppt
PPTX
Http-protocol
PDF
009577496.pdf
PPTX
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
PPTX
Chapter_2 jaringan komputer informatika.pptx
PPTX
Computer Network presentation chapter two
PPT
Chapter2 Application
PPTX
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
PPT
Web Services 2009
PDF
Computer Network notes Application Layer.pdf
PPTX
Unit-3_application layer .pptx
PPTX
Unit-3_application layer of osi model.pptx
PPT
Application Layer and Socket Programming
PPTX
PPTX
Lecture 3 computer communications and networks
PDF
Computer networks module 5 content covered in this ppt
PPT
Application Layer.pptand documents of co
Ch2 application layer Network
02_Chapter_2_V6_LV.pptx
2 - Applications.pptx cccccccccccccccccc
applayerslides.ppt
Http-protocol
009577496.pdf
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
Chapter_2 jaringan komputer informatika.pptx
Computer Network presentation chapter two
Chapter2 Application
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
Web Services 2009
Computer Network notes Application Layer.pdf
Unit-3_application layer .pptx
Unit-3_application layer of osi model.pptx
Application Layer and Socket Programming
Lecture 3 computer communications and networks
Computer networks module 5 content covered in this ppt
Application Layer.pptand documents of co
Ad

More from maamir farooq (20)

DOCX
Ooad lab1
PPT
Lesson 03
PPT
Lesson 02
PDF
Php client libray
PDF
Swiftmailer
PDF
PDF
PPTX
PDF
PDF
J query 1.7 cheat sheet
PDF
Assignment
PDF
Java script summary
PDF
PDF
PPTX
PPTX
Css summary
DOCX
Manual of image processing lab
PDF
Session management
PDF
Data management
PPTX
Content provider
Ooad lab1
Lesson 03
Lesson 02
Php client libray
Swiftmailer
J query 1.7 cheat sheet
Assignment
Java script summary
Css summary
Manual of image processing lab
Session management
Data management
Content provider

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Institutional Correction lecture only . . .
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Complications of Minimal Access Surgery at WLH
PDF
RMMM.pdf make it easy to upload and study
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Pharma ospi slides which help in ospi learning
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Classroom Observation Tools for Teachers
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Microbial disease of the cardiovascular and lymphatic systems
Cell Types and Its function , kingdom of life
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Institutional Correction lecture only . . .
Supply Chain Operations Speaking Notes -ICLT Program
GDM (1) (1).pptx small presentation for students
Complications of Minimal Access Surgery at WLH
RMMM.pdf make it easy to upload and study
102 student loan defaulters named and shamed – Is someone you know on the list?
Anesthesia in Laparoscopic Surgery in India
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Pharma ospi slides which help in ospi learning
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
01-Introduction-to-Information-Management.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Classroom Observation Tools for Teachers
O5-L3 Freight Transport Ops (International) V1.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Microbial disease of the cardiovascular and lymphatic systems

Lec 6(Application Layer)

  • 1. Computer Networks – CSE331 Lecture 6 2 Hrs
  • 2. Will be more in Lab
  • 3. CIDR: Classless InterDomain Routing  subnet portion of address of arbitrary length  address format: a.b.c.d/x, where x is # bits in subnet portion of address  Purchase what you need 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23
  • 4. 206.0.64.0/18 204.188.0.0/15 209.88.232.0/21Internet Backbone ISP K owns: Company X : 206.0.68.0/22 ISP Y : 209.88.237.0/24 Organization Z1 : 209.88.237.192/26 Organization Z2 : 209.88.237.0/26 Backbone sends everything which matches the prefixes 206.0.64.0/18, 204.188.0.0/15, 209.88.232.0/21 to ISP K. ISP K sends everything which matches the prefix: 206.0.68.0/22 to Company X, 209.88.237.0/24 to ISP Y Backbone routers do not know anything about Company X, ISP Y, or Organizations Z1, Z2. ISP K does not know about Organizations Z1, Z2. ISP Y sends everything which matches the prefix: 209.88.237.192/26 to Organizations Z1 209.88.237.0/26 to Organizations Z2
  • 5. our goals:  conceptual, implementation aspects of network application protocols  transport-layer service models  client-server paradigm  peer-to-peer paradigm  learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  DNS  creating network applications  socket API
  • 6.  e-mail  web  text messaging  remote login  P2P file sharing  multi-user network games  streaming stored video (YouTube, dailymotion)  voice over IP (e.g., Skype)  real-time video conferencing  social networking  search  …  …
  • 7. write programs that:  run on (different) end systems  communicate over network  e.g., web server software communicates with browser software Two models  Client Server  Peer to Peer (P2P) application transport network data link physical application transport network data link physical application transport network data link physical
  • 8. 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 client process: process that initiates communication server process: process that waits to be contacted  aside: applications with P2P architectures have client processes & server processes clients, servers
  • 9. server:  always-on host  permanent IP address  data centers for scaling clients:  communicate with server  may be intermittently connected  may have dynamic IP addresses  do not communicate directly with each other client/server
  • 10.  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 peer-peer
  • 11.  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 sufficient for identifying the process?  A: no, many processes can be running on same host  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 uet.edu.pk web server:  IP address: 111.68.102.6  port number: 80  more shortly…
  • 12.  process sends/receives messages to/from its socket  socket analogous to door  sending process send message out door  sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process Internet controlled by OS controlled by app developer transport application physical link network process transport application physical link network processsocket
  • 13.  Suppose Gifts have to be delivered to cousins  Two houses  House 1  Ali, Amna  House 2  Rehman, Fatima  Ali want to send to Rehman & Amna want to send Fatima host host process process Every process associated with a socket – socket has a 16bit number Complete address is IP address + socket no
  • 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. Application Application Layer Protocol Transport protocol Email SMTP [RFC 2821] TCP Remote terminal access Telnet [RFC 854] TCP Web HTTP [RFC 2616] TCP File transfer FTP [RFC 959] TCP Streaming multimedia HTTP, RTP [RFC 1889] TCP or UDP Internet telephony SIP, RTP, proprietary (e.g. skype) TCP or UDP
  • 16. TCP & UDP  no encryption  cleartext passwords sent into socket traverse Internet in cleartext SSL  provides encrypted TCP connection  data integrity  end-point authentication SSL is at app layer  Apps use SSL libraries, which “talk” to TCP SSL socket API  cleartext passwords sent into socket traverse Internet encrypted  More in Chapter 7
  • 17. First, a review…  Until 1990s universities, researchers => remote loging, file transfer, email  World wide web (www) in 1994 Tim Berners Lee  web page consists of objects  object can be HTML file, JPEG image, Java applet, audio file,…  web page consists of base HTML-file which includes several referenced objects  each object is addressable by a URL, e.g., www.someschool.edu/someDept/pic.gif host name path name
  • 18. 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
  • 19. 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
  • 20. non-persistent HTTP  at most one object sent over TCP connection  connection then closed  downloading multiple objects required multiple connections persistent HTTP  multiple objects can be sent over single TCP connection between client, server
  • 21. www.someSchool.edu/someDepartment/home.html 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.html 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 (contains text, references to 10 jpeg images) 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.
  • 22. RTT (definition): time for a small packet to travel from client to server and back HTTP response time:  one RTT to initiate TCP connection  one RTT for HTTP request and first few bytes of HTTP response to return  file transmission time  non-persistent HTTP response time 2RTT+ file transmission time time to transmit file initiate TCP connection RTT request file RTT file received time timeIf 1 RTT is 500ms file size is 100KB link speed is 0.5MB what is total time? 1.2sec If 1 RTT is 500ms file size is 100MB link speed is 0.5MB what is total time? 201sec
  • 23. non-persistent HTTP issues:  requires 2 RTTs per object  OS overhead for each TCP connection  browsers often open parallel TCP connections to fetch referenced objects persistent HTTP:  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 Demo – Persistent & non-persistent HTTP
  • 24.  Quiz upto this Lecture on next Monday  Ross book 2.1 to 2.2.2  Forouzan book chapter 17  List of standard internet protocols  http://www.iana.org  For those who want to learn Java  Lecture 3, 4 (CS-2) on Tuesday 13 Feb 2017  Bring your laptops with you