1 Applications and layered architectures Various services: various applications require various...

41
1 Applications and layered architectures • Various services: various applications require various services • Flexibility: powerful networks need to be flexible enough to support the current services and future services • Architectures: an overall network architecture is necessary to achieve the flexibility

Transcript of 1 Applications and layered architectures Various services: various applications require various...

Page 1: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

1

Applications and layered architectures

• Various services: various applications require various services

• Flexibility: powerful networks need to be flexible enough to support the current services and future services

• Architectures: an overall network architecture

is necessary to achieve the flexibility

Page 2: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

2

Layered architectures

• Layers: grouping the common functions

• Benefits of layers:– Simplicity: easy to design once layers and their

interaction are defined clearly– Flexibility: easy to modify and develop

networks by separate layers modifications– Incremental changes: add new layers, add new

functions to a layer

Page 3: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

3

Three obvious tasks (layers)

• Transport of data across the network from one end to the other

• Routing/forwarding of packets across multiple hops

• Transfer of a frame from one interface to another (i.e., one hop).

Page 4: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

4

Big picture of layered architectures

• Web browsing and e-mail examples

• OSI reference model (Seven layers)

• TCP/IP architecture

• Detailed end-to-end examples to complete big picture of layered architectures

• Socket API and other utilities

Page 5: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

5

Terminology

• Client/Server model: the most typical interaction between two parties within networks

• Client: the process making requests• Server (Daemon): the process waiting and receiving

requests, processing the requests and returning results• Protocols: a set of rules governing how two

communicating parties are to interact.• Service: a protocol will provide a service• Layers’ protocols: each layer carries out a specific set of

functions using its own protocol, and builds on the services of the layer below it (provides a service to its upper layer).

Page 6: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

6

Example—HTTP and Web Browsing

• HTTP: HyperText Transfer Protocol– Rules by which the (HTTP) client and server

interact so as to retrieve a document and how the request and response are phased

– Client sets up a two-way connection before request

– Client generally carries out DNS (Domain Name Service) to find IP address of server

Page 7: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

7

Retrieve a document from the Web

Event

• User selects a document

• HTTP Client locates the server host and sets up a two way connection

• HTTP client sends message requesting document

• HTTP server listing on TCP port 80 interprets message

Message content

Get /infocom/index.htm HTTP/1.0

Page 8: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

8

Retrieve a document from the Web (cont.)

Event

• HTTP server sends a result code and a description of information that the client will receive

• HTTP server reads the requested file and sends the file through TCP port

• HTTP server disconnects the connection

• Text is displayed by the client browser, which interprets HTML

Message contentHTTP/1.1 200 OK

Server: Apache/1.2/5 FrontPage 3.0.4Content-Length: 414

Content-Type: text/html

<html>

<head>

<title>IEEE Infocom’99—The future is Now …

Page 9: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

9

HTTPserver

HTTPclient

Request

Response

Figure 2.1

HTTP client/server interaction

Page 10: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

10

HTTPserver

HTTPclient

TCP TCP

GET 80, #

#, 80 STATUS

Port 80Ephemeral

Figure 2.2

•TCP provides a pipe between HTTP client and HTTP server•Transfer of message between HTTP client/server is virtual, indirect •HTTP is said to use the service provided by TCP (lower layer)

Port #

Page 11: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

11

Example—DNS query

• DNS—Domain Name Service• Domain nameIP address

– such as cs.iupui.edu134.68.140.1

• It is a distributed database system on multiple machines, each of which can act as a DNS server that other systems can query

• May recursively query to resolve an IP address

Page 12: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

12

DNS query and response

Event 1.Application requests name to address

translation2. Resolver composes query message

3. Resolver sends datagram encapsulating the query

4. DNS server looks up address and prepares response

5. DNS sends UDP datagram encapsulating the response message

Message content

Header: OPCODE=SQUERY

Question:

QNAME=cs.iupui.edu., QCLASS=IN, QTYPE=A

Header: OPCODE=SQUERY,RESPONSE AA

Question: QNAME=cs.iupui.edu., QCLASS=IN,QTYPE=A

Answer: cs.iupui.edu. 86400 IN A134.68.140.1

Page 13: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

13

DNSserver

DNSclient

UDP UDP

Query 53, #

#, 53 STATUS

Port 53Ephemeral

Figure 2.2

•UDP provides a pipe between DNS client and DNS server•Transfer of message between DNS client/server is virtual, indirect •DNS is said to use the service provided by UDP (lower layer)•UDP is connectionless, so no connection between client/server

Port #

Page 14: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

14

Email: Client and Servers

The picture copied from http://www.howstuffworks.com/email.htm

Servers: POP3: Post Office Protocol, port #110 or IMAP: Internet Mail Access Protocol, port #143 SMTP: Simple Main Transfer Protocol, port #25Client: MS outlook (express) or pine or elm,,…

Page 15: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

15

Layered structures

HTTP, DNS, EMAIL

||

TCP/UDP

||

IP

Page 16: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

16

Unified view of layers, protocols, and services

• Various layers: a layer groups a set of relevant functions

• Peer processes (entities): the two corresponding communicating processes (entities) in a layer

• Protocol: rules governing the behavior of two peer entities in that layer

• Services: the functionality provided by a layer

• Protocol Data Unit (PDU): the data exchanged between peer entities

• Header: protocol control/address information in a PDU

• Service Data Unit (SDU): actual user information in a PDU

• PDU =Header + SDU, PDUn+1 = SDUn

• Service Access Point (SAP): a place (unique identifier, software port) of layer n where layer n+1 can access the services offered by layer n

Page 17: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

17

nentity

n-PDUs

nentity

Figure 2.3

Peer-to-peer communication

PDU = Header + SDU

Page 18: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

18

n+1entity

n+1entity

n entity n entity

n-SDU H

H n-SDU

n-SAPn-SAP

Figure 2.2

•n+1-PDU is passed to layer n through n-SAP•n-SDU (n+1-PDU) is encapsulated, layer n does not touch it (usually)•Layer n+1 just relies on the success of transfer by layer n, but does not concern the implementation of layer n

n-PDU

n+1-PDUn-SDU

n+1-PDU n-SDU

Layer services

Page 19: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

19

Services: connection-oriented & connectionless services

• a service provided by layer n involves: – Accepting n+1-PDU from layer n+1– Transferring to its peer– The peer delivers to the user at layer n+1

• Connection-oriented service: – 1. Set up a connection between two n-SAPs,– 2. Transferring n-PDUs using layer n protocol, – 3. Tear down the connection and release resources

• Connectionless service: – no set up, each PDU is transferred directly from SAP to SAP;

control information from layer n+1 to layer n must contain all the address information required to transfer the PDUs

• Example: http.

Page 20: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

20

Confirmed & unconfirmed service

• Confirmed service: the sender must be informed of the outcome.

• Unconfirmed service: the sender need not to be informed of the outcome.

Example: connection setup is a confirmed service. The connectionless service may be confirmed or unconfirmed depending whether sender requires acknowledgment.

QUESTION? Does it make sense for a network to provide a confirmed, connectionless transfer service?

Page 21: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

21

Segmentation and blocking

• Different networks may have different limitation on the size of a block of information.

• MTU: Maximum Transfer Unit• Segmentation: if the size of block information is

too large, need to break into several segments and transfer them separately.

• Blocking: if SDUs are too small as to result in inefficiency, then combine several SDUs into a single SDU.

Page 22: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

22

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)

Figure 2.5

Segmentation/reassembly and blocking/unblocking

Page 23: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

23

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

Figure 2.6The OSI reference model (proposed by ISO)

Page 24: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

24

OSI reference model—seven layers

• All applications are built on the top of the seven layers, specifically, on the top of the application layer.

• The top 4 layers are end-to-end and involves the interaction of peer entities across the network, however, the bottom 3 layers are point-to-point and involve the interaction of peer entities across a single hop.

Page 25: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

25

OSI reference model— layer 7 and 6

• Application layer:– provides services that are frequently required by applications. e.g.,

WWW applications (browser and web server) are built on HTTP layer.

• Presentation layer: – provides application layer with independence from difference in the

representation of data. – For example, application A uses machine-dependent data format DFA

and application B uses machine-dependent format DFB, then at end A, the representation layer will convert the data in DFA to machine-independent data, then when data arrive at end B, the representation layer will convert the machine-independent data into format DFB. DFA machine-independent DFB.

– Different codes for characters and integers, 1th bit or last bit as most significant bit.

Page 26: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

26

OSI reference model— layer 5

• Session layer: provides dialog control and enhances the reliable transfer service provided by transport layer. – it establishes and terminates connections between SS-users and

synchronizes the data exchange between them. – it performs various negotiations for the use of session layer tokens,

which the SS-user must possess to begin communicating. – it inserts synchronization points in transmitted data that allow the

session to be recovered in the event of errors or interruptions.– it enables SS-users to interrupt a session and resume it later at a

specific point.

Page 27: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

27

OSI reference model— layer 4

• Transport layer: end-to-end transfer of message from the source machine to the destination machine.

– Only being executed at end computer systems.

– Certain end-to-end services:

• Connection-oriented:

– Error-free transfer of byte stream

– Error detection and recovery

– Sequence and flow control.

• Unconfirmed connection-less:

– Transfer of individual messages

– Provides appropriate address information

Page 28: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

28

OSI reference model— layer 4 (cont.)

• Transport layer– Segmentation/reassembly and

blocking/unblocking – Possibly setting up and releasing connections– Possibly multiplexing multiple transport layer

connections into one network connection – Possibly split one transport layer connection

into several network connections– Accessing transport layer by socket interface

Page 29: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

29

Connection-oriented VS. Connectionless

Connection-oriented Connectionless

Maintain state information about every connection

No knowledge of the "connection"

Allocate resources to connections at switches

No resource allocation

Admission control No admission control

Per connection routing Per packet routing

Reliable and in-order delivery Robust but out of order, duplicate, delay, even lost in delivery

Page 30: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

30

Connection-oriented VS. Connectionless (cont.)

Connection-oriented Connectionless

Route packet based on identifier (connection ID in every packet)

Route packet based on destination address, which is in every packet

Forwarding table specifies the output port and outgoing identifier value as function of the

incoming identifier value

Routing table specifies the output port depending on the destination address

Forwarding table set up by signaling during connection

establishment.

Router executes distributed algorithm to share network state information and dynamically calculate the routing table

Connection must be re-established in cases of failure

Packets are rerouted around failures, robust against

failures

Page 31: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

31

OSI reference model— layer 3

• Network layer: provides the transfer of data in the form of packets across the communication networks.

– Routing (which makes this layer most complex) – Congestion control– Internet sub-layer: routing between the different

networks, hiding the details of each specific network such as address differences, size and format differences

– Being implemented at each intermediate node

Page 32: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

32

C

PS

PS

C

PSPS

C

C

C

PS = packet switch

C = computer

Figure 2.7

A packet-switching network using a uniform routing procedure

Page 33: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

33

G

G

G

G

G

net 1

net 2

net 3

net 4

net 5

G = gateway/router

G

Figure 2.8

An internetwork

The networks may be quite different.A gateway/router may connect several networks.

Page 34: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

34

Switches/routers/gateways

• Circuit switch, used in telephone networks• Packet switch/router/gateway:

– Generally consider them as the same meaning– Packet switch deals with a uniform routing procedure,

within one homogenous network, one pair of data link and physical layer

– Router/gateway deals with routing in multiple heterogeneous networks, more than one pair of data link and physical layers

– Gateway sometime contains firewall function

Page 35: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

35

Switches/routers/gateways (cont.)

• Mainly from the point of software, i.e., containing functions of lower three layers

• Of course, there are some requirements for hardware such as speed, disk, memory, multiple interfaces.

• Bridge: used to connect multiple similar LANs.

Page 36: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

36

OSI reference model— layer 2

• Data link layer: provides the transfer of frames across a transmission link that directly connects two nodes– Point-to-point transfer

– Framing to indicate the boundaries of frames

– Inserting control and physical address information

– Inserting check bits for recovering from error

– Flow control (in point-to-point basis)

• Links: point-to-point, shared media,wireless

Page 37: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

37

transceivers

Figure 1.17

point-to-point link

Shared media link

Page 38: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

38

AC = authentication centerBSS = base station subsystemEIR = equipment identity registerHLR = home location register

wirelineterminal

MSC

PSTN

BSS BSS

STP SS#7HLRVLR

EIRAC

MSC = mobile switching center PSTN = public switched telephone networkSTP = signal transfer pointVLR = visitor location register

Figure 4.52

Wireless link

Page 39: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

39

OSI reference model— layer 1

• Physical layer: deals with the transfer of bits over a communication channel.– Setting up and release of physical connection– Mechanical factors– Systems parameters

• Again, each intermediate node in the networks has the network layer, data link layer and physical layer

Page 40: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

40

Transfer of what across what in each layer

Transport layer: transfer of messages from end (source) to end (destination).

Network layer:transfer of packets across multiple networks.

Data link layer: transfer of frames across a transmission link.

Physical layer: transfer of bits over a communication channel.

The intermediate node (or router) has low three layers.

The end node has high four layers + low three layers.

Page 41: 1 Applications and layered architectures Various services: various applications require various services Flexibility: powerful networks need to be flexible.

41

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

Headers and trailers added to data