The OSI reference model - · PDF file— World Wide Web Consortium ... Nixu Ltd. 9/35The OSI reference model OSI Layers ... • Unix socket interface example:

Embed Size (px)

Citation preview

  • Nixu Ltd.

    The OSI reference model

  • Nixu Ltd. 2/35 The OSI reference model

    Contents

    OSI Reference model

    Protocols and services, the difference

    Protocol stacks and implementations

    What services protocols provide

  • Nixu Ltd. 3/35 The OSI reference model

    Layered Protocols

    Protocols connect entities on same level, within the layer

    Higher layers use services provided by lower layers, adding value

    Layers are independent and defined by interface provided to the higher layer and required from the lower layer

    Entities communicate by exchanging Protocol Data Units (PDUs) with entities on the same level

    Entity N PeerCommunicates with peers

    Provides an interface for higher level protocols

    Uses services from lower level protocols

    following a protocol

  • Nixu Ltd. 4/35 The OSI reference model

    Why layers?

    Layers may be exchanged as long as interfaces stay unchanged WWW was built on top of existing TCP/IP implementations

    WWW does not have to care about the media (modem, Ethernet, radio link etc.)

    ATM can be used to transport IP packets without any changes to applications

    IPv6 will replace the entire IP part of the TCP/IP layer

    Layering makes development easier and adds flexibility

  • Nixu Ltd. 5/35 The OSI reference model

    Protocol standardization

    International Organization for Standardization (ISO) http://www.iso.ch/

    Internet Society & Internet Engineering Task Force http://www.isoc.org/ http://www.ietf.org/

    International Telecommunications Union (ITU) http://www.itu.ch/

    The Institute of Electronics and Electrical Engineers (IEEE) http://www.ieee.org/

    Industry consortiums WAP forum World Wide Web Consortium

    De-facto standards

  • Nixu Ltd. 6/35 The OSI reference model

    Protocol stacks

    Term protocol stack refers to all layers of a protocol family Eg. having TCP/IP stack implemented in an operating system means

    that part of the OS software uses device drivers (Ethernet, PPP+serial driver etc.) to receive IP packets and provides socket services to applications programs

    Protocol stack has nothing to do with push/pop (data structures)

    TCP/IP by IETF is the most popular protocol stack in data communications

    Signalling System 7 is the most popular telecoms stack

    OSI protocol stack is hardly used in entirety except as a theoretical model (parts of it are in use)

    Implementations of protocol stacks often co-exist (OSI X.500 directory system over TCP/IP, TCP/IP communications over telephone network and SS7)

  • Nixu Ltd. 7/35 The OSI reference model

    OSI Stack

    OSI Internet

    7 Application Sovellus

    6 Presentation Esitys Application

    5 Session Sessio

    4 Transport Siirto Transport (TCP & UDP)

    3 Network Verkko Network (IP)

    2 Data link Linkki Link

    1 Physical Fyysinen Physical

  • Nixu Ltd. 8/35 The OSI reference model

    OSI Model

    Two (N)-level entities in different systems communicate using (N)-level protocol

    The services give by layer (N) to layer (N+1) are realized in (N)-level protocol by encapsulation and decapsulation

    Encapsulation means embedding each layers Service Data Units (SDU) into the Protocol Data Units (PDU) of the layer immediately below it, decapsulation is the reverse process

    Entities at the same level in separate systems are called peer entities (N+1)-level entities are using (N)-level services through (N)-level

    Service Access Points ((N)-SAPs) One (N+1)-entity can be simultaneously connected to one or more

    (N)-SAPs One (N)-SAP is connected to one (N)-entity

  • Nixu Ltd. 9/35 The OSI reference model

    OSI Layers

    Physical Layer Defines the physical characteristics of the communications path

    Electrical, electromagnetic, optical, acoustic, printed Eg. Ethernet, RS-232

    Data Link Layer Transfers frames (packets) over the physical layer Hides the features of the physical implementation Eg. Ethernet, PPP, HDLC

    Network Layer Transfers packets over the entire communications network over vari-

    ous physical networks Independent of physical implementations Eg. IP, X.25

  • Nixu Ltd. 10/35 The OSI reference model

    OSI Layers...

    Transport Layer Provides end to end transport of session (application) data Eg. TCP, UDP

    Session Layer Provides dialogue (communications path) control Eg. HTTP Connection: keep-alive; TCP urgent pointer

    Presentation Layer Provides device independent presentation of data Eg. HTTP Accept: image/gif; MIME headers

    Application Layer How applications communicate Eg. HTTP, SMTP...

  • Nixu Ltd. 11/35 The OSI reference model

    Internet Model

    SNMP, NFS DNS FTP, HTTP, SMTP, Telnet, SSH etc..

    UDP TCP

    Internet Protocol (IP)

    Data Link protocols (Ethernet, PPP, ATM, Frame Relay...)

    ICMP

    Ping

    Physical media

  • Nixu Ltd. 12/35 The OSI reference model

    A Data Packet on EthernetApplication

    data

    ApplicationdataTCP

    ApplicationdataTCPIP

    ApplicationdataTCPIPETH CRC

    ApplicationdataTCPIP

    ApplicationdataTCPIPETH CRC

    ApplicationdataTCPIP

    ApplicationdataTCPIPPPP

    Host Router

  • Nixu Ltd. 13/35 The OSI reference model

    Application Level Protocol Sample

    220 tcm.hut.fi SMTP/smap Ready.helo jalopeno.nixu.fi250 (jalopeno.nixu.fi) pleased to meet you.mail from: [email protected] [email protected]... Sender Okrcpt to: [email protected] [email protected] OKdata354 Enter mail, end with "." on a line by itselfFrom: [email protected]: [email protected]: terveisi

    Heipparallaa.250 Mail acceptedquit221 Closing connection

  • Nixu Ltd. 14/35 The OSI reference model

    Service Interface

    Protocols are usually internationally standardized

    Service interface implementations are usually operating system specific Different implementations can communicate, with common protocol Application programs need to be modified to use different interfaces

    Unix socket interface example: 1. open socket 2. parse address 3. connect to server 4. write request 5. read response 6. close socket

  • Nixu Ltd. 15/35 The OSI reference model

    What Protocols do?

    A protocol shall be: Completely and unambiguously defined Free of dead-locks and live-locks Able to recover from all error conditions

    Some possible functions of protocols Addressing Connections and confirmations Error detection and correction Flow control Priorization Multiplexing, segmentation and blocking

  • Nixu Ltd. 16/35 The OSI reference model

    Protocol Addressing

    On the Internet: People usually use domain names (max 255 chars, eg. www.nixu.fi) IP-protocol uses numeric addresses (four octets, eg. 194.197.118.20) TCP and UDP use 16 bit port addresses (eg. 80), separate address

    spaces LANs and data link level protocols have their own addressing (eg. Eth-

    ernet, six octets) Application level programs must be able to handle both IP addresses

    and port addresses (Unix socket service), but not data link addresses Application level protocols sometimes have their own addresses (e-

    mail, URL) Eg. Telnet protocol does not do any addressing

    Other Telephone numbers Postal addresses

  • Nixu Ltd. 17/35 The OSI reference model

    Connections

    Some protocols, like TCP provide a connection from end to end, some, like UDP are connectionless

    TCP must store the state and sub-states of the connection No connection Link set-up Data transmission Link disconnect

    Three packets to open a TCP connection and four to close

    Stateless and connectionless UDP is easier to implement and lighter on the network Applications must worry about data loss, eg. domain name re-

    requests

  • Nixu Ltd. 18/35 The OSI reference model

    Confirmation

    Protocol can provide a receipt

    Example: TCP header contains the sequence numbers of traffic UDP itself provides only a single datagram transmission SMTP server acknowledges when an e-mail message is received SNMP traps are not acknowledged and may be lost

  • Nixu Ltd. 19/35 The OSI reference model

    Error control

    Lowest level transmission channels are analog and somewhat unreliable

    Data may be changed, entire frames (packets) may be lost

    For reliable communications we need: Error detection Error correction Data retransmission

    Having no error control is also option Eg. old modems and terminals

  • Nixu Ltd. 20/35 The OSI reference model

    Checksums

    A trivial checksum example 1+2+3+4=10, we transmit 1,2,3,4,10 We receive: 1,3,3,4,10 and check 1+3+3+4=11 -> Error detected Our algorithm is not very good, how about: 1,3,2,4,10?

    Actual algorithms are more complex CRC-CCITT catches certainly all burst errors of 16 bits or less

    And is most likely to catch all other errors, too

    Parity bits Odd parity, make data element always to have odd number of ones,

    eg: 11100010 -> 111000101

    Cryptographic checksums (often called also hashes) make it very hard or impossible to replace or change the data

    Checksum design depends on the type of error expected

  • Nixu Ltd. 21/35 The OSI reference model

    Error Detection

    Checksums can be done at different protocol levels and for different sized chucks of data Parity bit for old terminals IP has header checksum TCP and UDP checksums check both header and payload TCP/IP application level protocols do not usually do error detection,

    they trust TCP and UDP Enc