Sunteți pe pagina 1din 7

ELEN602 Lecture 2 Communication Networks

• Review of Last Lecture • Many forms of communication networks around


• Layering – 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

1 2

Steps in Web Surfing


1. The user clicks on a link to indicate which document is to be Application level View
retrieved.

The browser must determine the address that contains the


2. document. It does this by sending a query to its local name
server.

3. Once the address is known the browser establishes a connection to the


specified machine, usually a TCP connection. In order for the Request
connection to be successful, the specified machine must be ready to
accept TCP connections. HTTP
HTTP
4. server
The browser runs a client version of HTTP, which issues a request client
specifying both the name of the document and the possible document Response
formats it can handle.

5. 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.

6.
The TCP connection is then closed and the user may view
the document.

3 4
Steps in HTTP Transfer Domain Name Service

• User selects document • DNS servers help resolve name-to-address translation


• Networking software locates the remote machine address – Given a name such as ee.tamu.edu, find its IP address
& establishes a 2-way connection • IP addresses = telephone numbers in phone network
• HTTP client sends request for document (GET ) • Machines (computers/network elements) know each other
• HTTP daemon on remote machine interprets the GET by IP addresses
message • IP addresses are 32bits in IPv4.
• Remote HTTP daemon sends the result of GET operation • DNS protocol allows name-to-IP address resolution
– Result code, Description of the information, requested – Similar to phone directory assistance (411 or 555-1212)
file
• Remote HTTP daemon disconnects the connection
• HTTP client displays the HTML content in the browser. 5 6

A more detailed view - Transport protocol


DNS Example (cont’d) HTTP
HTTP
client server
• QNAME = ee.tamu.edu, QCLASS = IN QTYPE = A
• QNAME = ee.tamu.edu QCLASS = IN QTYPE = A
Ephemeral
– IN A 165.91.241.199
Port # Port 80
• The application will now use 165.91.241.199 whenever it
needs to contact ee.tamu.edu GET 80, #

TCP TCP

#, 80 STATUS

7 8
• Sender establishes TCP Connection to SMTP server
• Sends HELO message -identifying itself to SMTP server
Email and SMTP • Client sends sender’s email address
• SMTP server acknowledges with 250 if successful
• Web transfers use HTTP, email uses SMTP (Simple Mail • Client sends receiver’s email address
Transfer Protocol) - Application level protocols • SMTRP server acknowledges with 250
• Sender - Local SMTP Server -- Remote SMTP Server - • Client sends a DATA message - requesting permission to
Receiver send email message
• SMTP uses Port 25, HTTP uses port 80 • SMTP server sends OK-to-send message
• POP (Post Office Protocol) may be used if receiver not on • Client transfers the email message
all the time. • SMTP server returns ack with a message ID
• Client indicates that the transfer is complete.
• SMTP confirms the receipt of End-of-transfer message

9 10

Abstract View Layering in General

n+1 n+1
entity entity
n-PDUs

n-SDU n-SDU
n n n-SAP n-SAP
entity entity
n-SDU H
n entity n entity
H n-SDU

n-PDU
11 12
OSI Seven-layer Model
Data Units at different layers Application A Application B

(a) Segmentation Reassembly Application Application


Layer Layer
n-SDU n-SDU
Presentation Presentation
Layer Layer

n-PDU n-PDU n-PDU Session Session


n-PDU n-PDU n-PDU Layer Layer

Transport Transport
(b) Blocking Unblocking Layer Communication Network Layer

Network Network Network Network


n-SDU n-SDU n-SDU n-SDU n-SDU n-SDU Layer Layer Layer Layer

Data Link Data Link Data Link Data Link


Layer Layer Layer Layer

Physical Physical Physical Physical


n-PDU n-PDU Layer Layer Layer Layer

Electrical and/or Optical Signals


13 14

Packet-Switched Network An Internetwork

C PS = packet switch
PS C = computer net 3
C G
PS
PS net 1
G
PS
G
C G
net 5
C C
net 2 G net 4 G

G = gateway/router
15 16
Headers and Trailers TCP/IP Network Architecture
Application A Application B
data Application
Layer Application
Application Application Layer
Layer data ah Layer
Transport
Transport
Presentation Presentation Layer
Layer
Layer data ph Layer
Internet
Session Session Internet
data sh Layer
Layer Layer Layer

Transport Transport
Layer
data th Layer Network Network
Interface Interface
Network Network
Layer data nh Layer
(a) (b)
Data Link Data Link
Layer dt data dh Layer

Physical Physical
Layer bits Layer

17 18

IP Hour-Glass Protocol Graph


IP Layer and Network Interface Layer
Machine B HTTP SMTP DNS RTP
Machine A
Application Application
Transport Router/Gateway Transport TCP UDP
Internet Internet Internet
Network Interface Network Interface
Network Interface

IP

Network 1 Network 2

Network Network Network


Interface 1 Interface 2 Interface 3

19 20
(a) (1,1) IP Datagram on an Ethernet
(2,1)
router (2,2)
s (1,3) r PPP
IP
Ethernet w Header

(1,2)
(b) Header contains
source and destination Frame
Ethernet Check
physical addresses; Header
Server HTTP PC Sequence
HTTP network protocol type
TCP Router TCP
IP IP IP
Net Interface Net Interface Net Interface

Ethernet PPP
21 22

socket socket
HTTP Request Application 1 Application 2
interface interface

user user

kernel kernel
Header contains source and
TCP
destination port numbers Socket Socket
Header

Underlying Underlying
Header contains source and
communication communication
destination IP addresses; IP Protocols Protocols
transport protocol type
Header

Communications
network
Header contains source
and destination physical Frame
Ethernet Check
addresses; network
protocol type Header Sequence
23 24
Server
socket() Server
socket()
bind() Client
socket()
listen()
bind()
Client
accept() bind()
socket()
recvfrom()
blocks until server receives
a connect request from client connect negotiation connect() blocks until server
data sendto()
receives data from client
data write()
read()
sendto() data
write() data
read() recvfrom()

close() close()
close()
close()

25 26

User
Interface

C:\WINDOWS>ping nal.toronto.edu
Control
Server PI User PI Pinging nal.toronto.edu [128.100.244.3] with 32 bytes of data:
Connection
Reply from 128.100.244.3: bytes=32 time=118ms TTL=243
Reply from 128.100.244.3: bytes=32 time=118ms TTL=243
Reply from 128.100.244.3: bytes=32 time=118ms TTL=243
Reply from 128.100.244.3: bytes=32 time=118ms TTL=243
Server Data User DTP C:\WINDOWS>
DTP Connection

Server FTP User FTP

PI = Protocol interpreter
DTP = Data transfer process

27 28

S-ar putea să vă placă și