Layered Architectures
Network must be designed so that it has the flexibility of supporting current and future services To achieve this flexibility, an overall network architecture (plan) is necessary The overall process of enabling machines to communicate is very complex Layering partitions related communication functions into manageable groups Each layer provides a service to the layer above Each layer operates according to a protocol A protocol is a set of rules that governs how two or more communicating entities in a layer are to interact Protocols: Building blocks of a network architecture
1
Why Layering?
Layering simplifies design, implementation, and testing by partitioning overall communications process into parts Layering aids modular design
Protocol in each layer can be designed separately from those in other layers Layering provides flexibility for modifying and evolving protocols and services without having to change layers below
Monolithic (non-layered) architectures are costly, inflexible, and soon obsolete
An Example of Layering
WWW application A framework for accessing documents located in computers in the Internet
Documents (text, graphics, and other media) are interconnected by links which appear within the documents
WWW is accessed through a browser program
Based on client-server interaction
Server process waits for incoming requests by listening to a port Client processes make requests Servers provide responds
Protocol: HTTP (HyperText Transfer Protocol)
Specifies rules by which the client and server interact to retrieve a document
3
An Example of Layering
1. User selects a document by clicking on a link with a URL: [Link] 2. Client locates the server host and establishes a two-way TCP connection 3. Client uses HTTP to send a message requesting a document
GET/world/[Link] HTTP/1.0
4. Server listening on TCP port 80 interprets the message 5. Server sends a results code and a description
HTTP/1.1 200 OK Server: Apache/1.2.5 Content-Length: 500 Content-Type: text/html
6. Server reads the file and sends it through the TCP port
<html><head><Title> CNN
7. Server disconnects the connection 8. Client receives the file and displays it (interprets the HTML code and displays the information)
4
HTTP assumes that message exchange between peer processes occurs directly
Transfer of messages between HTTP client and HTTP server is in fact virtual and occurs indirectly via the TCP connection
HTTP uses the services provided by TCP in an underlying layer TCP, in turn, uses the services provided by IP
Open Systems Interconnection (OSI) Reference Model
Network architecture: Definition of all the layers Design of protocols for every layer By the 1970s every computer vendor developed its own proprietary layered network architecture Problem: computers from different vendors could not be networked together Open Systems Interconnection (OSI) was an international effort by the International Organization for Standardization (ISO) to enable multivendor computer interconnection
OSI Reference Model
Describes a seven-layer abstract reference model for a network architecture Purpose of the reference model was to provide a framework for the development of protocols OSI also provided a unified view of layers, protocols, and services which is still in use in the development of new protocols Detailed protocol standards were developed for each layer, but most of these are not in use TCP/IP protocols preempted deployment of OSI protocols
OSI Unified View: Layers, Protocols, and Services
On each layer, a process on one machine carries out a conversation with peer process on the other machine Processes at layer n are referred to as layer n entities Layer-n peer processes communicate by exchanging Protocol Data Units (PDUs)
PDU = Header (protocol control information) + Service Data Unit (SDU) (User information: data received from the higher layer)
The behavior of layer-n entities is governed by a set of rules called layer-n protocol
n-PDUs Layer-n
n Entity Peer-to-peer communication n Entity
OSI Unified View
Communication between peer processes is virtual and actually indirect For communication to take place, layer n+1 entities make use of the services provided by layer-n Layer n+1 PDU is passed from layer n+1 to layer n through a software port called the layer n Service Access Point (SAP) (Services are available at Service Access Points) Each layer passes data & control information to the layer below it until the physical layer is reached and transfer occurs The data passed to the layer below is called a Service Data Unit (SDU) SDUs are encapsulated in PDUs
10
OSI Unified View
n+1 entity
n-SDU n-SAP n-SDU
n+1 entity
n-SAP
n-SDU
n entity
H n-SDU n-PDU
n entity
11
Connectionless & Connection-Oriented Services
Connection-Oriented Three-phases: 1. Connection setup between two SAPs to initialize state information 2. SDU transfer 3. Connection release E.g. TCP, ATM Connectionless Immediate SDU transfer No connection setup E.g. UDP, IP
Layered services need not be of same type TCP operates over IP IP operates over ATM
12
Segmentation & Reassembly
A layer may impose a limit on the size of a data block that it can transfer for implementation or other reasons Thus a layer-n SDU may be too large to be handled as a single unit by layer-(n-1) Sender side: SDU is segmented into multiple PDUs Receiver side: SDU is reassembled from sequence of PDUs
(a)
Segmentation n-SDU
n-PDU
n-PDU
n-PDU
(b)
Reassembly
n-SDU
n-PDU
n-PDU
n-PDU
13
Multiplexing
Sharing of layer n service by multiple layer n+1 users Multiplexing tag or ID required in each PDU to determine which users an SDU belongs to
n+1 entity n+1 entity
n+1 entity
n+1 entity
n-SDU n-SDU H
n-SDU
n entity
H n-SDU n-PDU
n entity
14
7-Layer OSI Reference Model
Application
End-to-End Protocols Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer End Node
Application
Network Layer Data Link Layer Physical Layer
Network Layer Data Link Layer Physical Layer
End Node
One or More Network Nodes Within the network
15
Headers & Trailers
Layer 7 Layer 6 Layer 5
Layer 4 Layer 3
Layer 2 Layer 1
16
Application & Upper Layers
Networks are driven by applications Communication for a network application takes place between end systems (hosts) at the application layer Application Layer: provides protocols to support different applications such as WWW, FTP, email/SMTP (Simple Mail Transfer Protocol)
Web access: Browser application uses the HTTP application layer protocol to access a WWW document
Application
Application Layer
Presentation Layer Session Layer
An application layer protocol is distributed over multiple end systems Using the protocol, the application in one end system exchanges messages with another end system Some of the functionalities provided by lower layers can also be implemented at the Application layer. E.g. error control
17
Kurose & Ross, Computer Networking A Top Down Approach Featuring the Internet
Application & Upper Layers
Presentation Layer: This layer is intended to provide the application layer with independence from differences in the representation of data
For example, when communicating from application-A to application-B, it converts the machine-dependent information provided by application-A into a machineindependent form and then converts this back into machine-dependent form suitable for application-B Different computers use different data representation (character, integer), and use different conventions such as how data is transmitted MSB first or LSB first
Session Layer: dialog management
provide name space to collectively refer to different transport streams that are a part of a single application eg. Video conferencing (audio and video streams)
19
Network Application Design Principles
Network Application Architectures
Client-Server Architecture Peer-to-Peer (P2P) Architecture
Processes Communicating (a process at the application layer can be thought of as a program that is running within an end system)
Client and Server Processes The Interface between the process and the Network, Socket Communication Addressing Processes: Host Address and Port Number
Transport services
Potential Services that Applications may need from the Transport layer Services Provided by the Internet: TCP and UDP Services
Application-layer Protocols
What an applications-layer protocol defines Public domain and proprietary protocols Applications versus Application-layer protocols
20
Transport Layer
Transfers data end-to-end from a process in a machine to a process in another machine Transport layer protocol involves transfer of Transport layer PDUs: Segments Transport layer uses the services offered by the underlying network to provide services to the upper layer (application): transfer of messages that meets certain QoS Connection oriented service and connectionless service
Connection oriented service:
Reliable stream transfer (error control) Sequence control Flow control Quick-and-simple single-block transfer
Connectionless service:
Port numbers enable multiplexing Message segmentation and reassembly Connection setup, maintenance, and release Transport Layer Transport Layer Network Layer Network Layer
Network Layer
Network Layer
23
Communication Network
Network Layer
When transferring application messages, transport layer provides process-to-process communication service whereas network layer provides host-to-host communication service Transfers packets across multiple links and/or multiple networks Addressing must scale to large networks Nodes jointly execute routing algorithm to determine paths across the network Forwarding transfers packet across a node Internetworking Congestion control to deal with traffic surges Connection oriented (ATM) and connection less (IP) services Connection setup, maintenance, and teardown when connection-based
24
Network Layer
Internetworking is necessary to route packets across multiple possibly dissimilar networks Gateways (routers) direct packets across networks
H
H Net 1 Net 1
G G
Net 3 Net 3
G
G
Net Net 55
G
H G = gateway H = host
Net 2
Net 4
25
Network Layer
Ethernet LAN
ATM Network
ATM Switch H
ATM Switch ATM Switch ATM Switch
H Net 1 Net 1
G G
Net 3 Net 3
G
G
Net Net 55
G
H G = gateway H = host
Net 2
Net 4
26
Data Link Layer
A host-to-host communication path consists many links. The Data Link layer deals with how packets are transmitted over each of the links Transfers frames (blocks of information) across a transmission link that connects two nodes (includes the cases of multiple terminals are connected to a computer in point-to-multipoint fashion and LANs) Can provide connectionless and connection oriented services
E.g. Ethernet : unacknowledged connectionless service
Framing Error control or reliable transmission, Flow control Medium access control for local area networks Activation, maintenance, & deactivation of data link connections
Data Link Layer Physical Layer frames bits Data Link Layer
Physical Layer
27
Data Link Layer
Error control and flow control:
The degree of error control varies based on the network type E.g., Ethernet: only error detection (and discard erroneous frames) and no error correction. No flow control. E.g., HDLC provides error detection and correction. Some proprietary PC LANs include error detection & correction and flow controls, and provide reliable connection oriented services
28
Data Link Layer includes LANs
Leon-Garcia and Widjaja, Communication Networks
29
Physical Layer
Transfers bits across link Definition & specification of the physical aspects of a communications link
Mechanical: cable, plugs, pins... Electrical/optical: modulation, signal strength, voltage levels, bit times, functional/procedural: how to activate, maintain, and deactivate physical links
Key issues:
Digital transmission fundamentals Properties of media: copper, optical fiber, wireless media Line coding modulation
30
TCP/IP Architecture
Successor of ARPAnet (Defense Advanced Research Agency) Principles:
Robustness: survive failures in the network Flexibility: operate over diverse networks
TCP/IP Architecture
Application Application Layer
Transport Layer
Internet Layer Network Interface
31
TCP/IP Architecture
TCP/IP application layer incorporates the functions of the top three OSI layers Two services in the transport layer:
Transmission Control Protocol (TCP): reliable connection oriented transfer of byte stream User Datagram Protocol (UDP): unreliable connectionless service of individual messages
Internet layer:
Transfer of information (packets) across multiple networks through gateways or routers Best-effort connectionless IP packet transfer (robust) Defining globally unique addresses for machines
32
TCP/IP Architecture
Network Interface layer:
Related to network-specific aspects of the transfer of packets Deals with part of the OSI network layer and data link layer Various network interfaces related to networks such as Ethernet, ATM, token ring, frame relay, X.25 Concerned with the protocols that access the intermediate networks
The protocol encapsulates an IP packet into a frame (or packet) of the underlying network or link (e.g., Network 1) The IP packet is recovered at the exit gateway of the given network The exit gateway encapsulates the IP packet into a frame (or packet) of the next network or link (e.g., Network 2)
Provides a clear separation of the internet layer from the technologydependent network interface layer Internet layer provides a packet transfer service that is transparent to the underlying networks (i.e., not depending on the details of the underlying networks)
33
TCP/IP Protocol Suite
HTTP SMTP DNS RTP
Reliable stream service
TCP
UDP
User datagram service
Best-effort connectionless packet transfer
IP
(ICMP, ARP)
Network interface 1
Network interface 2
Diverse network technologies
Network interface 3
34
TCP/IP Protocol Suite
IP protocol is complemented by additional protocols (ICMP, IGMP, ARP, RARP) Hourglass shape of the TCP/IP protocol graph
A single IP protocol over various networks It provides independence from the underlying network technologies
Services of TCP and UDP provide a network independent platform on which applications can be developed By allowing multiple network technologies to coexist, the Internet provides ubiquitous connectivity and achieves enormous economies of scale
35
Internet address and Physical address
Internet Addresses
Each host in the Internet has a globally unique IP address Separate IP address for each network interface to a network Routing decision is done based on destination IP address IP address: net-id (unique) + host-id IP version 4 (IPv4): 32 bits, e.g., [Link] (Dotted Decimal Notation) IP version 6 (IPv6): 128 bits e.g., 2001:0DB8:85A3:0000:0000:8A2E:0370:7334 (hexadecimal)
Physical Addresses
On a physical network (e.g., LAN) attachment of a device to the network is identified by a physical address The physical network uses the physical address to transfer frames or packets to the appropriate destination IP address needs to be resolved to physical address at each IP network interface Example: Ethernet uses 48-bit addresses
Each Ethernet network interface card (NIC) has globally unique Medium Access Control (MAC) or physical address E.g., 00:90:27:96:68:07 (12 hex numbers)(24 bits NIC manufacturer+ 24 bits serial No.)
36
Encapsulation
HTTP Request
Application Data
TCP Header: source & destination port numbers
TCP header
HTTP Request
TCP segment
IP Header: source and destination IP addresses; transport protocol type
IP header
TCP header
HTTP Request
IP Packet
Ethernet Header: source & destination MAC addresses; network protocol type
Ethernet header
IP header
TCP header
HTTP Request
FCS
Ethernet Frame
37
Example internet
Server (1,1) s Router (1,3) r w *PPP does not use addresses Workstation (1,2) netid server workstation 1 1 hostid 1 2 Physical address s w PC (2,1)
PPP Netid=2
(2,2)
Ethernet (netid=1)
router
router PC
1
2 2
3
1 2
r
38
IP packet from workstation to server
Server (1,1) s Ethernet
w
Router (1,3) r
PC (2,1) PPP (2,2) (1,2), (1,1)
w, s
(1,2)
Workstation
1.
2. 3. 4.
IP packet has the IP address of the source (1,2) and the IP address of the destination (1,1) IP table at workstation indicates (1,1) connected to same network. Assume that the physical address of the server (s) is known. IP packet is encapsulated in Ethernet frame with addresses w and s Ethernet frame is broadcast by workstation NIC and captured by server NIC NIC examines protocol type field and then delivers packet to its IP layer
39
IP packet from server to PC
Server (1,1) s
w
Router (1,3) r
PC (2,1) (1,1), (2,2) (2,2)
s, r
(1,1), (2,2) Workstation
1. 2. 3. 4. 5. 6. 7. 8.
(1,2) IP packet has (1,1) and (2,2) as IP source and destination addresses IP table at server indicates packet should be sent to router, so IP packet is encapsulated in Ethernet frame with addresses s and r Ethernet frame is broadcast by server NIC and captured by router NIC NIC examines protocol type field and then delivers packet to its IP layer IP layer examines IP packet destination address and determines IP packet should be routed to (2,2) Routers table indicates (2,2) is directly connected via PPP link IP packet is encapsulated in PPP frame and delivered to PC PPP at PC examines protocol type field and delivers packet to PC IP layer
40
How the layers work together
(a) Server (1,1) s Ethernet Router (1,3) r PC
(2,1)
PPP (2,2)
(b)
Server
HTTP
TCP uses node-to-node Unreliable packet transfer of IP Packet: Server IP address & PC IP address
PC HTTP TCP IP
Network interface
TCP
IP
Network interface
IP
Network interface
Ethernet
Router
PPP
41
How the layers work together
(a) Server (1,1) s Ethernet Router (1,3) r PC
(2,1)
PPP (2,2)
(b)
Server
HTTP
TCP uses node-to-node Unreliable packet transfer of IP Packet: Server IP address & PC IP address
PC HTTP TCP IP
Network interface
TCP
IP
Network interface
IP
Network interface
Internet
Ethernet
Router
PPP
42
How the layers work together
(a) Server (1,1) s Ethernet
HTTP uses process-to-process Reliable byte stream transfer of TCP connection: Server socket: (IP Address, 80, TCP) PC socket (IP Address, Eph. #, TCP) TCP uses node-to-node Unreliable packet transfer of IP Packet: Server IP address & PC IP address
Router (1,3) r
PC
(2,1)
PPP (2,2)
(b)
Server
HTTP
PC HTTP TCP IP
Network interface
TCP
IP
Network interface
IP
Network interface
Internet
Ethernet
Router
PPP
43