Lecture 3 Slides
Lecture 3 Slides
Introduction to Networks
Hisham Othman
Basma Mohamed Afifi
Nadeen Hamza
2
Internet protocol stack
1-3
user applications
physical
4
Application architectures
5
Client-Server
Peer-to-Peer (P2P)
Hybrid of Client-Server and P2P
Client-Server Architecture
6
Server attributes:
always-on host
permanent IP address
no always-on server
arbitrary end systems
directly communicate peer-peer
peers are intermittently
connected and change IP
addresses
Skype
voice-over-IP P2P application
centralized server: finding address of remote party:
client-client connection: direct (not through server)
Instant messaging
chatting between two users is P2P
centralized service: client presence detection/location
user registers its IP address with central server when it
comes online
user contacts central server to find IP addresses of buddies
Processes communicating
Process: program running Client process: process that
within a host initiates communication
within same host, two
Server process: process that
processes communicate using waits to be contacted
inter-process communication
(defined by OS)
processes in different hosts
communicate by exchanging Note: applications with P2P
messages architectures have client
processes & server
processes
11
Addressing processes
12
Sockets
13
host or host or
process sends/receives server server
messages to/from its socket
controlled by
socket is analogous to door app developer
process process
sending process pushes message
through the door socket socket
Delay Security
some apps (e.g., Internet Encryption,
telephony, interactive Data integrity, …
games) require low delay
to be “effective”
15
Transport service requirements of common apps
16
18
Internet apps: application, transport protocols
19
Application Underlying
Application layer protocol transport protocol
20
1-21 HTTP
HyperText Transfer Protocol
Uniform Resource Locator (URL)
Web and HTTP
22
Mac running
Navigator
25
HTTP overview (continued)
Uses TCP: HTTP is “stateless”
client initiates TCP connection server maintains no
(creates socket) to server, port 80 information about past
server accepts TCP connection client requests
from client
aside
HTTP messages (application-layer Protocols that maintain “state” are
protocol messages) exchanged complex!
between browser (HTTP client) past history (state) must be
and Web server (HTTP server) maintained
TCP connection closed if server/client crashes, their
views of “state” may be
inconsistent, must be
reconciled
26
Stateless vs. Stateful Protocols
1-27
https://www.geeksforgeeks.org/difference-between-stateless-and-stateful-protocol/
HTTP request message
28
request line
(GET, POST, GET /somedir/page.html HTTP/1.1
HEAD commands) Host: www.someschool.edu
User-agent: Mozilla/4.0
header Connection: close
lines Accept-language:fr
(extra carriage return, line feed)
Carriage return,
line feed
indicates end
of message
HTTP request message: general format
29
Uploading form input
30
HTTP Methods
HTTP/1.0 HTTP/1.1
GET GET, POST, HEAD
POST PUT
32
HTTP response message
33
status line
(protocol, status code, status phrase)
HTTP/1.1 200 OK
Connection: close
Date: Thu, 06 Aug 1998 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
header
Last-Modified: Mon, 22 Jun 1998 …...
lines
Content-Length: 6821
Content-Type: text/html
Families of codes:
2xx Success
3xx Redirections: moved,
new location specified
later in this message
(Location:)
4xx Client Errors
5xx HTTP Server Errors
Summary
1-35
Overview on HTTP
Message types
Methods:
GET, POST, HEAD, ..
Message structure
Any Question?
1-36