16
Computer Networks Chapter 2: Applications and Layered Architectures

Computer Networks Chapter 2: Applications and Layered Architectures

Embed Size (px)

Citation preview

Page 1: Computer Networks Chapter 2: Applications and Layered Architectures

Computer Networks

Chapter 2: Applications and Layered Architectures

Page 2: Computer Networks Chapter 2: Applications and Layered Architectures

Introduction:

● Variety of services provided and possibly many more in the future.

● 70s proprietary networking protocols.● Divide-and-conquer...subdivide the task =>

Instead of complex monolithic problem, smaller more manageable ones: Layering

● Changing one function does not make everything else obsolete.

Page 3: Computer Networks Chapter 2: Applications and Layered Architectures

HTTP example

● HyperText Transfer Protocol (HTTP)

● Client queries DNS● Client sets up a TCP

connection● Document is requested

to server● Document is delivered

HTTPserver

HTTPclient

Request

Response

Page 4: Computer Networks Chapter 2: Applications and Layered Architectures

HTTP example:

HTTPserver

HTTPclient

TCP TCP

GET 80, #

#, 80 STATUS

Port 80

Ephemeral

Port #

Page 5: Computer Networks Chapter 2: Applications and Layered Architectures

HTTP running on TCP1. Users selects document2. Network software of client locates the server host and establishes two-way connection.3. HTTP client sends message requesting GET/infocom/index.html HTTP/1.0

document.4. HTTP daemon listening on TCP port 80 interprets message.5. HTTP daemon sends a result code and HTTP/1.1 200 OK SERVER: Apache/1.2.5

a description of the information. Content-Length:414 Content-

Type: text/html

6. HTTP daemon reads the file and sends the requested file through the TCP port.7. HTTP daemon disconnects the connection8. Text is displayed by client browser, whichinterprets the HTML format.

Page 6: Computer Networks Chapter 2: Applications and Layered Architectures

DNS Query

1. Application requests name to address translation.2. Resolver composes query message. Header: OPCODE=SQUERY

Question:

QNAME=tesla.comm.toronto.edu.,

QCLASS=IN, QTYPE=A

3. Resolver sends UDP datagram encapsu- lating the query message.4. DNS server looks up address and prepa- Header: OPCODE=SQUERY,

res response. RESPONSE, AA

Question:

QNAME=tesla.comm.toronto.edu.,

QCLASS=IN, QTYPE=A

Answer: tesla.comm.toronto.edu.

86400 IN A 128.100.11.56

5. DNS sends UDP datagram encapsulating the response message.

Page 7: Computer Networks Chapter 2: Applications and Layered Architectures

OSI Reference model● Open Systems Interconnection put in place by the

International Organization for StandardizationISO● It is a reference model to facilitate creation of

computer communication standards.● Partitions overall communication into functions

carried by layers.● Each layer conducts peer-to-peer communication● The packet exchanged between the equivalent

layer is called a PDU which contains a header and user info SDU.

Page 8: Computer Networks Chapter 2: Applications and Layered Architectures

OSI reference model● To reach it's peer layer, each layer communicates

with next layer through SAP uniquely identified.● Except for last layer none of intermediate layer

makes use of SDUs.● Services provided by underlying layer is either

connection-oriented/connectionless, confirmed/ unconfirmed.

● Possibly segmentation (numbering) re-assembly and blocking/unblocking.

Page 9: Computer Networks Chapter 2: Applications and Layered Architectures

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

Seven-Layer Model

Page 10: Computer Networks Chapter 2: Applications and Layered Architectures

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

Figure 2.9

Page 11: Computer Networks Chapter 2: Applications and Layered Architectures

TCP/IP: Overview● To the contrary of OSI model, the TCP/IP suite of

protocoles has emerged from real networks● 4 layers: Application, TCP/UDP, IP, Network

interface.● Reliable and un-acknowledged services are both

possible: TCP, UDP● TCP: end-to-end packet transmission● IP: transfer of packet through multiple networks● Network Interface: Allows us to run over

multiple networks (X.25, ATM,...)

Page 12: Computer Networks Chapter 2: Applications and Layered Architectures

Application

Transport

Internet

Network Interface

Application

Transport

Internet

Network Interface

Internet

Network Interface

Network 1 Network 2

Machine A Machine B

Router/Gateway

TCP/IP over networks

Page 13: Computer Networks Chapter 2: Applications and Layered Architectures

HTTP SMTP RTP

TCP UDP

IP

Network

Interface 1

Network

Interface 3

Network

Interface 2

DNS

Hour-shaped glass

Page 14: Computer Networks Chapter 2: Applications and Layered Architectures

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

TCP/IP: Example

Page 15: Computer Networks Chapter 2: Applications and Layered Architectures

Berkeley API for Sockets programming

● You need to read about the Sockets programming part using Berkeley API.

Page 16: Computer Networks Chapter 2: Applications and Layered Architectures

Networking utilities

● Telnet● FTP● Ping● Traceroute● Netstat● TCPDump