Professional Documents
Culture Documents
Applications and Layered Architectures
Applications and Layered Architectures
1
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
2
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).
3
Big picture of layered architectures
4
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).
5
Example—HTTP and Web Browsing
6
Retrieve a document from the Web
Event Message content
• User selects a document
• HTTP Client locates the
server host and sets up a two
way connection
• HTTP client sends message Get /infocom/index.htm HTTP/1.0
requesting document
• HTTP server listing on TCP
port 80 interprets message
7
Retrieve a document from the Web (cont.)
8
HTTP client/server interaction
Request
HTTP HTTP
client server
Response
9
Figure 2.1
HTTP HTTP
client server
Ephemeral Port 80
Port #
GET 80, #
TCP TCP
#, 80 STATUS
12
DNS DNS
client server
Ephemeral Port 53
Port #
Query 53, #
UDP UDP
#, 53 STATUS
15
Unified view of layers, protocols, and services
16
Peer-to-peer communication
n-PDUs
n n
entity entity
n+1 n+1
entity entity
n+1-PDU n+1-PDU
n-SDU n-SDU n-SAP
n-SAP
n-SDU H
n entity n entity
H n-SDU
n-PDU
•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
18 not
concern the implementation of layer n Figure 2.2
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.
19
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?
20
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.
21
(a) Segmentation Reassembly
n-SDU n-SDU
n-PDU n-PDU
Application Application
Layer Layer
Presentation Presentation
Layer Layer
Session Session
Layer Layer
Transport Transport
Layer Communication Network Layer
24
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.
25
OSI reference model— layer 5
26
OSI reference model— layer 4
27
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
28
Connection-oriented VS. Connectionless
Connection-oriented Connectionless
Maintain state information No knowledge of the
about every connection "connection"
Allocate resources to No resource allocation
connections at switches
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
29
Connection-oriented VS. Connectionless (cont.)
Connection-oriented Connectionless
Route packet based on identifier Route packet based on destination
(connection ID in every packet) address, which is in every packet
31
C PS = packet switch
PS C = computer
C
PS
PS
PS
C
C C
32
Figure 2.7
The networks may be quite different.
A gateway/router may connect several networks.
G = gateway/router
net 3
G
net 1
G
G
G
net 5
net 2 G net 4 G
An internetwork
33
Figure 2.8
Switches/routers/gateways
34
Switches/routers/gateways (cont.)
35
OSI reference model— layer 2
transceivers
37
Figure 1.17
Wireless link
BSS BSS
MSC
HLR STP SS#7
VLR wireline
EIR terminal
AC PSTN
38
Figure 4.52
OSI reference model— layer 1
39
Transfer of what across what in each layer
40
Headers and trailers added to data
Application A Application B
data
Application Application
Layer data ah Layer
Presentation Presentation
Layer data ph Layer
Session Session
Layer data sh Layer
Transport Transport
Layer data th Layer
Network Network
Layer data nh Layer
Physical Physical
Layer bits Layer
41
Figure 2.9