Definitions CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011...

Post on 28-Dec-2015

262 views 1 download

Tags:

Transcript of Definitions CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011...

Definitions

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Protocol (1) An agreement between the communicating parties on how communication is to proceed.

(2) A set of rules that governs how two or more communicating entities in a layer are to interact.

Protocol Stack A list of the protocols used by a certain system, one protocol per layer.

Peers The entities comprising the corresponding layers on different machines.

Why Layers?

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

• Layering simplifies design, implementation, and testing by partitioning overall communications process into parts

• Protocol in each layer can be designed separately from those in other layers

• Protocol makes “calls” for services from layer below

• 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

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Protocol Layers (1)

Protocol layering is the main structuring method used to divide up network functionality.

• Each protocol instance talks virtually to its peer

• Each layer communicates only by using the one below

• Lower layer services are accessed by an interface

• At bottom, messages are carried by the medium

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Protocol Layers (2)

Example: the philosopher-translator-secretary architecture

Each protocol at different layers serves a different purpose

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Protocol Layers (3)

Each lower layer adds its own header (with control inform-ation) to the message to transmit and removes it on receive

Layers may also split and join messages, etc.

Example: HTTP

• HTTP is an application layer protocol

• Retrieves documents on behalf of a browser application program

• HTTP specifies fields in request messages and response messages− Request types; Response codes− Content type, options, cookies, …

• HTTP specifies actions to be taken upon receipt of certain messages

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

HTTP Protocol

• HTTP assumes messages can be exchanged directly between HTTP client and HTTP server

• In fact, HTTP client and server are processes running in two different machines across the Internet

• HTTP uses the reliable stream transfer service provided by TCP

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

HTTPClient

GET

Response

HTTPServer

Example: TCP• TCP is a transport layer protocol

• Provides reliable byte stream service between two processes in two computers across the Internet

• Sequence numbers keep track of the bytes that have been transmitted and received

• Error detection and retransmission used to recover from transmission errors and losses

• TCP is connection-oriented: the sender and receiver must first establish an association and set initial sequence numbers before data is transferred

• Connection ID is specified uniquely by (send port #, send IP address, receive port #, receiver IP address)

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

HTTP using the TCP service

HTTPserver

HTTPclient

TCP

Port 80Port 1127

TCP

ResponseGET

TCP80, 1127GET 1127, 80 bytesResponseGETResponse

Design Issues for the Layers

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Each layer solves a particular problem but must include mechanisms to address a set of recurring design issues

Issue Example mechanisms at different layers

Reliability despite failures

Codes for error detection/correction (§3.2, 3.3)Routing around failures (§5.2)

Network growth and evolution

Addressing (§5.6) and naming (§7.1)Protocol layering (§1.3)

Allocation of resources like bandwidth

Multiple access (§4.2)Congestion control (§5.3, 6.3)

Security against various threats

Confidentiality of messages (§8.2, 8.6)Authentication of communicating parties (§8.7)

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Connection-Oriented vs. Connectionless

Service provided by a layer may be kinds of either:• Connection-oriented, must be set up for ongoing use

(and torn down after use), e.g., phone call• Connectionless, messages are handled separately,

e.g., postal delivery

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Service Primitives (1)

A service is provided to the layer above as primitives

Hypothetical example of service primitives that may provide a reliable byte stream (connection-oriented) service:

Service Primitives (2)

Hypothetical example of how these primitives may be used for a client-server interaction

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Client Server

LISTEN (0)

ACCEPT RECEIVE

SEND (4)

DISCONNECT (6)

CONNECT (1)

SENDRECEIVE

DISCONNECT (5)

Connect request

Accept response

Request for data

Reply

Disconnect

Disconnect

(2)

(3)

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Relationship of Services to Protocols

Recap:• A layer provides a service to the one above

[vertical]• A layer talks to its peer using a protocol

[horizontal]

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

OSI Reference Model

A principled, international standard, seven layer model to connect different systems

– Provides functions needed by users

– Converts different representations

– Manages task dialogs

– Provides end-to-end delivery

– Sends packets over multiple links

– Sends frames of information

– Sends bits as signals

7-Layer OSI Reference Model

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

ApplicationLayer

PresentationLayer

SessionLayerTransportLayerNetworkLayerData LinkLayerPhysicalLayer

ApplicationLayer

PresentationLayer

SessionLayerTransportLayerNetworkLayerData LinkLayerPhysicalLayer

NetworkLayer

Application Application

Data LinkLayer

PhysicalLayer

NetworkLayer

Data LinkLayer

PhysicalLayer

Communicating End Systems

End-to-End Protocols

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… Ethernet, DSL, cable modem, telephone

modems… Twisted-pair cable, coaxial cable optical fiber,

radio, infrared, …

Data Link Layer

Transfers frames across direct connections Groups bits into frames Detection of bit errors; Retransmission of frames Activation, maintenance, & deactivation of data link

connections Medium access control for local area networks Flow control

Data LinkLayer

PhysicalLayer

Data LinkLayer

PhysicalLayer

frames

bits

Network Layer

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 Congestion control to deal with traffic surges Connection setup, maintenance, and

teardown when connection-based

Transport Layer Transfers data (segments or datagrams) end-to-

end from process in a machine to process in another machine

Reliable stream transfer or quick-and-simple single-block transfer

Port numbers enable multiplexing Message segmentation and reassembly Connection setup, maintenance, and release

TransportLayer

NetworkLayer

TransportLayer

NetworkLayer

NetworkLayer

NetworkLayer

Communication Network

Application & Upper Layers

Application Layer: Provides services that are frequently required by applications: DNS, web acess, file transfer, email…

Presentation Layer: machine-independent representation of data…

Session Layer: dialog management, recovery from errors, …

ApplicationLayer

PresentationLayer

SessionLayer

TransportLayer

Application

ApplicationLayer

TransportLayer

Application

Incorporated into Application Layer

Headers & Trailers Each protocol uses a header that carries addresses,

sequence numbers, flag bits, length indicators, etc… CRC check bits may be appended for error detection

ApplicationLayer

TransportLayer

NetworkLayer

Data LinkLayer

PhysicalLayer

ApplicationLayer

TransportLayer

NetworkLayer

Data LinkLayer

PhysicalLayer

Application ApplicationAPP DATA

AH APP DATA

TH AH APP DATA

NH TH AH APP DATA

DH NH TH AH APP DATA CRC

bits

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

TCP/IP Reference Model

A four layer model derived from experimentation; omits some OSI layers and uses the IP as the network layer.

IP is the “narrow waist” of the Internet

Protocols are shown in their respective layers

Network

NIC

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Model Used in this Book

It is based on the TCP/IP model but we call out the physical layer and look beyond Internet protocols.

NIC

Port Numbers

IP Address

MAC Address(eg. Ethernet Address)

TCP/IP Protocol Suite

(ICMP, ARP)

Diverse network technologies

Reliable stream service

Userdatagram service

Distributed applications

HTTP SMTP RTP

TCP UDP

IP

Network

interface 1

Network

interface 3

Network

interface 2

DNS

Best-effort connectionless packet transfer

CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

Critique of OSI & TCP/IP

OSI:+ Very influential model with clear concepts− Models, protocols and adoption all bogged down by politics

and complexity

TCP/IP:+ Very successful protocols that worked well and thrived− Weak model derived after the fact from protocols