1 elen602 lecture 2 review of last lecture layering
TRANSCRIPT
1
ELEN602 Lecture 2
• Review of Last Lecture
• Layering
2
Communication Networks
• Many forms of communication networks around
– Postal mail, telephone, Internet etc.
• Generic steps involved in communication
– Addressing, name-to-address translation, transport, routing, delivery
• Forms of delivery
– Reliable, in-order
– Unreliable, no acknowledgement
3
The user clicks on a link to indicate which document is to be retrieved.
The browser must determine the address that contains the document. It does this by sending a query to its local name server.
Once the address is known the browser establishes a connection to the specified machine, usually a TCP connection. In order for the connection to be successful, the specified machine must be ready to accept TCP connections.
The browser runs a client version of HTTP, which issues a request specifying both the name of the document and the possible document formats it can handle.
The machine that contains the requested document runs a server version of HTTP. It reacts to the HTTP request by sending an HTTP response which contains the desired document in the appropriate format.
The TCP connection is then closed and the user may view the document.
1.
2.
3.
4.
5.
6.
Steps in Web Surfing
4
HTTPserver
HTTPclient
Request
Response
Application level View
5
Steps in HTTP Transfer
• User selects document• Networking software locates the remote machine address &
establishes a 2-way connection• HTTP client sends request for document (GET )• HTTP daemon on remote machine interprets the GET message • Remote HTTP daemon sends the result of GET operation
– Result code, Description of the information, requested file• Remote HTTP daemon disconnects the connection• HTTP client displays the HTML content in the browser.
6
Domain Name Service
• DNS servers help resolve name-to-address translation
– Given a name such as ee.tamu.edu, find its IP address
• IP addresses = telephone numbers in phone network
• Machines (computers/network elements) know each other by IP addresses
• IP addresses are 32bits in IPv4.
• DNS protocol allows name-to-IP address resolution
– Similar to phone directory assistance (411 or 555-1212)
7
DNS Example (cont’d)
• QNAME = ee.tamu.edu, QCLASS = IN QTYPE = A
• QNAME = ee.tamu.edu QCLASS = IN QTYPE = A
– IN A 165.91.241.199
• The application will now use 165.91.241.199 whenever it needs to contact ee.tamu.edu
8
HTTPserver
HTTPclient
TCP TCP
GET 80, #
#, 80 STATUS
Port 80
Ephemeral
Port #
A more detailed view - Transport protocol
9
Email and SMTP
• Web transfers use HTTP, email uses SMTP (Simple Mail Transfer Protocol) - Application level protocols
• Sender - Local SMTP Server -- Remote SMTP Server - Receiver
• SMTP uses Port 25, HTTP uses port 80
• POP (Post Office Protocol) may be used if receiver not on all the time.
10
• Sender establishes TCP Connection to SMTP server
• Sends HELO message -identifying itself to SMTP server
• Client sends sender’s email address
• SMTP server acknowledges with 250 if successful
• Client sends receiver’s email address
• SMTRP server acknowledges with 250
• Client sends a DATA message - requesting permission to send email message
• SMTP server sends OK-to-send message
• Client transfers the email message
• SMTP server returns ack with a message ID
• Client indicates that the transfer is complete.
• SMTP confirms the receipt of End-of-transfer message
11
nentity
n-PDUs
nentity
Abstract View
12
n+1entity
n-SAP
n+1entity
n-SAP
n entity n entity
n-SDU
n-SDU
n-SDU
H
H n-SDU
n-PDU
Layering in General
13
n-SDU
n-PDU n-PDU n-PDU
n-SDU
n-PDU n-PDU n-PDU
Segmentation Reassembly
n-PDU
n-SDU
n-PDU
Blocking Unblocking
n-SDUn-SDUn-SDUn-SDUn-SDU
(a)
(b)
Data Units at different layers
14
ApplicationLayer
PresentationLayer
SessionLayer
TransportLayer
NetworkLayer
Data LinkLayer
PhysicalLayer
ApplicationLayer
PresentationLayer
SessionLayer
TransportLayer
NetworkLayer
Data LinkLayer
PhysicalLayer
NetworkLayer
Electrical and/or Optical Signals
Application A Application B
Data LinkLayer
PhysicalLayer
NetworkLayer
Data LinkLayer
PhysicalLayer
Communication Network
OSI Seven-layer Model
15
C
PS
PS
C
PSPS
C
C
C
PS = packet switch
C = computer
Packet-Switched Network
16
G
G
G
G
G
net 1
net 2
net 3
net 4
net 5
G = gateway/router
G
An Internetwork
17
ApplicationLayer
PresentationLayer
SessionLayer
TransportLayer
NetworkLayer
Data LinkLayer
PhysicalLayer
ApplicationLayer
PresentationLayer
SessionLayer
TransportLayer
NetworkLayer
Data LinkLayer
PhysicalLayer
Application A Application Bdata
data
data
data
data
data
data
ah
ph
sh
th
nh
dh
bits
dt
Headers and Trailers
18
ApplicationLayer
TransportLayer
InternetLayer
NetworkInterface
ApplicationLayer
TransportLayer
InternetLayer
NetworkInterface
(a) (b)
TCP/IP Network Architecture
19
Application
Transport
Internet
Network Interface
Application
Transport
Internet
Network Interface
Internet
Network Interface
Network 1 Network 2
Machine A Machine B
Router/Gateway
IP Layer and Network Interface Layer
20
HTTP SMTP RTP
TCP UDP
IP
Network
Interface 1
Network
Interface 3
Network
Interface 2
DNS
IP Hour-Glass Protocol Graph
21
Net Interface
IP
TCP
HTTP
Net Interface
IP
Net Interface
IP
TCP
HTTP
Ethernet PPP
Router
router
(1,1)
s
(1,2)
w
(2,1)
(1,3) r
(2,2)
PPP
Ethernet
(a)
(b)
Server PC
22
IP Header
Header containssource and destination physical addresses; network protocol type
Frame Check Sequence
Ethernet Header
IP Datagram on an Ethernet
23
HTTP Request
TCP Header
Header contains source and destination port numbers
Header contains source and destination IP addresses; transport protocol type
IP Header
Header contains source and destination physical addresses; network protocol type
Frame Check Sequence
Ethernet Header
24
Application 1
Socket
socket interface
user
kernel
Application 2
user
kernel
Underlying communication
Protocols
Underlying communication
Protocols
Communications network
Socket
socket interface
25
socket()
bind()
listen()
read()
close()
socket()
connect()
read()
write()
close()
blocks until server receivesa connect request from client
data
data
Server
Clientaccept()
write()
connect negotiation
26
socket()
bind()
sendto()
close()
socket()
bind()
recvfrom()
sendto()
close()
blocks until serverreceives data from client data
data
Server
Client
recvfrom()
27
User Interface
User PI
User DTP
PI = Protocol interpreter
DTP = Data transfer process
User FTP
Server PI
Server DTP
Server FTP
Control
Connection
Data
Connection
28
C:\WINDOWS>ping nal.toronto.edu
Pinging nal.toronto.edu [128.100.244.3] with 32 bytes of data:
Reply from 128.100.244.3: bytes=32 time=118ms TTL=243Reply from 128.100.244.3: bytes=32 time=118ms TTL=243Reply from 128.100.244.3: bytes=32 time=118ms TTL=243Reply from 128.100.244.3: bytes=32 time=118ms TTL=243
C:\WINDOWS>