SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programming
backdoor
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
A Short Java Socket Tutorial
A Short Java Socket TutorialA Short Java Socket Tutorial
A Short Java Socket Tutorial
Guo Albert
 

Was ist angesagt? (20)

Networking in java
Networking in javaNetworking in java
Networking in java
 
Java networking programs socket based
Java networking programs socket basedJava networking programs socket based
Java networking programs socket based
 
Java socket programming
Java socket programmingJava socket programming
Java socket programming
 
Chapter2 l2 modified_um
Chapter2 l2 modified_umChapter2 l2 modified_um
Chapter2 l2 modified_um
 
Network Programming in Java
Network Programming in JavaNetwork Programming in Java
Network Programming in Java
 
Networking in Java
Networking in JavaNetworking in Java
Networking in Java
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programming
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Chap 1 Network Theory & Java Overview
Chap 1   Network Theory & Java OverviewChap 1   Network Theory & Java Overview
Chap 1 Network Theory & Java Overview
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
A Short Java Socket Tutorial
A Short Java Socket TutorialA Short Java Socket Tutorial
A Short Java Socket Tutorial
 
Sockets
SocketsSockets
Sockets
 
maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_Magazine
 
Whole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThWhole c++ lectures ITM1 Th
Whole c++ lectures ITM1 Th
 
Tcp
TcpTcp
Tcp
 
Python Sockets
Python SocketsPython Sockets
Python Sockets
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Web tcp ip
Web tcp ipWeb tcp ip
Web tcp ip
 
Java Networking
Java NetworkingJava Networking
Java Networking
 

Ähnlich wie Lec 6(Application Layer)

02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx
ALI2H
 
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
ZahouAmel1
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
elliando dias
 
Chapter2 application layer
Chapter2 application layerChapter2 application layer
Chapter2 application layer
Khánh Ghẻ
 

Ähnlich wie Lec 6(Application Layer) (20)

Ch2 application layer Network
Ch2 application layer NetworkCh2 application layer Network
Ch2 application layer Network
 
02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx
 
applayerslides.ppt
applayerslides.pptapplayerslides.ppt
applayerslides.ppt
 
Http-protocol
Http-protocolHttp-protocol
Http-protocol
 
009577496.pdf
009577496.pdf009577496.pdf
009577496.pdf
 
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
 
Chapter2 Application
Chapter2 ApplicationChapter2 Application
Chapter2 Application
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
 
Networking in python by Rj
Networking in python by RjNetworking in python by Rj
Networking in python by Rj
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Unit 6 : Application Layer
Unit 6 : Application LayerUnit 6 : Application Layer
Unit 6 : Application Layer
 
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptxCS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
 
Chapter2 application layer
Chapter2 application layerChapter2 application layer
Chapter2 application layer
 
Chapter_2_v8.3.pptx
Chapter_2_v8.3.pptxChapter_2_v8.3.pptx
Chapter_2_v8.3.pptx
 
Lec 7(HTTP Protocol)
Lec 7(HTTP Protocol)Lec 7(HTTP Protocol)
Lec 7(HTTP Protocol)
 
Lan chat system
Lan chat systemLan chat system
Lan chat system
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
 
Computer network network edge and network
Computer network network edge and networkComputer network network edge and network
Computer network network edge and network
 
Chapter_2_v8.1.pptx
Chapter_2_v8.1.pptxChapter_2_v8.1.pptx
Chapter_2_v8.1.pptx
 

Mehr von maamir farooq (20)

Ooad lab1
Ooad lab1Ooad lab1
Ooad lab1
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Php client libray
Php client librayPhp client libray
Php client libray
 
Swiftmailer
SwiftmailerSwiftmailer
Swiftmailer
 
Lect15
Lect15Lect15
Lect15
 
Lec 7
Lec 7Lec 7
Lec 7
 
Lec 6
Lec 6Lec 6
Lec 6
 
Lec 5
Lec 5Lec 5
Lec 5
 
J query 1.7 cheat sheet
J query 1.7 cheat sheetJ query 1.7 cheat sheet
J query 1.7 cheat sheet
 
Assignment
AssignmentAssignment
Assignment
 
Java script summary
Java script summaryJava script summary
Java script summary
 
Lec 3
Lec 3Lec 3
Lec 3
 
Lec 2
Lec 2Lec 2
Lec 2
 
Lec 1
Lec 1Lec 1
Lec 1
 
Css summary
Css summaryCss summary
Css summary
 
Manual of image processing lab
Manual of image processing labManual of image processing lab
Manual of image processing lab
 
Session management
Session managementSession management
Session management
 
Data management
Data managementData management
Data management
 
Content provider
Content providerContent provider
Content provider
 

Kürzlich hochgeladen

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

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