<<

Objectives of Lecture

• Show how network architecture can be understood using a layered approach. Network Architecture • Introduce the OSI seven layer reference model. • Introduce the concepts of internetworking and routing. • Understand the difference between network protocols and services.

CINS/F1-01

Contents Protocols

1.1 Extended example: how the • The term protocol refers to a well-known set of rules protocols fetch a web page and formats to be used in order to perform a task. For example, a task of communicating between processes. 1.2 The concept of protocol layering • Parts of a protocol: 1.3 Internetworking and routing – A specification of a sequence of messages that 1.4 The OSI seven layer model must be exchanged. – A specification of the format of the data in the messages. • Existence of well-known (standard) protocols enables the separate components of the distributed systems to be developed independently in different languages and on different platforms. Four elements of a protocol: 1.1 Internet Protocols

A set of rules governing the communication between two peer entities. It must define the format and the order of messages as well as actions taken on the transmission and receipt of a message. • syntax: format, what is a valid message? – “GET /~hugue/index.html HTTP/1.1\nHOST: www.cs.umd.edu\n\n” • Semantics: what does it mean? Web Browser – Get file /~hugue/index.html using the http 1.1 protocol. Network • Action: – read file /~hugue/index.html from the disk, send it through the socket using the http 1.1 protocol and close the socket • Timing: relative order of messages. Web Server – Reply follows the request

Four-Layer Model Basic Internet Network Architecture

Distributed data communications involves three Host A Host B primary components: Application Layer – Applications HTTP Message – Computers Transport Layer – Networks TCP Packet Four corresponding layers Router – Application layer Internet Layer Internet Layer Internet Layer IP Datagram IP Datagram – Transport layer

– Internet layer Ethernet Network Layer Ethernet Network Layer – Network Interface Frame Frame Physical Network Physical Network Application Layer Application Layer Example

• How does a web browser retrieve data from a • HTTP outline: web server? – GET /~hugue/index.html HTTP/1.1 • Application Protocol: Hypertext Transfer – Host: www.cs.umd.edu Protocol (HTTP). • Users invoke applications which “speak” using application protocol. • Applications interact with a transport protocol to send or receive data. GET /~hugue/index.html HTTP/1.1 • Other applications: FTP, SMTP, DNS, SMB, … Host: www.cs.umd.edu HTTP Message

Transport Layer Transport Layer Example

• Provides end-to-end communication between • TCP outline: applications. – Source Port: 1081 • Transport Protocol: Transport Control Protocol (TCP) – Destination Port: 80 – a reliable, connection-oriented transport protocol. – Checksum: 0xa858 • Divides stream of application messages into packets. • Interacts with Internet Layer to send or receive data. • In general, a transport protocol may be – reliable or unreliable, Src: 1081 Dst: 80 GET /~hugue/index.html HTTP/1.1 – connection-oriented or connectionless, Chksum: 0xa858 Host: www.cs.umd.edu – and flow may or may not be regulated. TCP header HTTP Message • Others: UDP, ICMP. Internet Layer Internet Layer Example

• Responsible for routing communications • IP outline: between one machine and another. – Time to live: 128 • Accepts requests to send packets to – Header checksum: 0x57d1 destination address. – Source: my home pc (69.140.128.222) • (IP) encapsulates packets in – Destination: www.cs.umd.edu (128.8.10.143) IP datagram with IP header and uses routing to decide whether to send directly or IP datagram header TCP header HTTP Message indirectly. Src: 69.140.128.222 Src: 1081 Dst: 80 GET /~hugue/index.html HTTP/1.1 • Also handles incoming IP datagrams. Dst: 128.8.10.143 TTL: 128 Chksum: 0xa858 Host: www.cs.umd.edu – If addressed to local machine, remove the IP datagram header and pass up to transport layer.

Network Interface Layer Network Interface Layer Example

• Accepts IP datagrams and transmits over • Ethernet outline: specific networks. – Destination: 00:a0:cc:54:1d:4e • Maybe a simple device driver (e.g. an Ethernet – Source: 00:e0:81:10:19:fc driver) or a complex subsystem with further – Type: IP data link protocols. Ethernet Frame Src: 00:e0:81:10:19:fc Dst: 00:a0:cc:54:1d:4e Type: IP

Src: 69.140.128.222 Src: 1081 Dst: 80 GET /~hugue/index.html HTTP/1.1 Dst: 128.8.10.143 TTL: 128 Chksum: 0xa858 Host: www.cs.umd.edu Ports and Addresses 1.2 Protocol Layering

• Ports are destination points within a host computer. Host A Host B Application Layer Application Layer • Processes are attached to the ports, enabling Message them to communicate. • Transport layer addresses are composed of Transport Layer Transport Layer network address of the host computer and a Packet port number. Internet Layer Internet Layer • In the Internet every host is assigned a unique Datagram IP number which is used in routing. Network Interface Network Interface • In an Ethernet each host is responsible for Frame recognizing that the messages meant for it. Physical Network

Protocol Layering Protocol Hierarchies

• Protocols are stacked vertically as series of Web Browser Web Server ‘layers’. Application Layer Application Layer HTTP Message • Each layer offers services to layer above, shielding implementation details. Transport Layer Transport Layer TCP Packet • Layer n on one machine communicates with layer n on another machine (they are peer Internet Layer Internet Layer processes/entities) using Layer n Protocol. IP Datagram

Network Layer Network Layer Ethernet Frame

Physical Network Layers, Protocols & Interfaces Layer/Interface Design

• Important objective is ‘clean’ interfaces, having Layer n/n+1 Layer n/n+1 minimal set of well-defined services. interface interface Layer n Layer n protocol Layer n • Clean-cut interfaces enable: Layer n-1/n Layer n-1/n – minimisation of inter-layer communications interface interface – easy replacement of individual layers Layer 2/3 Layer 2/3 • Set of layers and protocols is the Network interface interface Layer 2 Layer 2 protocol Layer 2 Architecture. Layer 1/2 Layer 1/2 interface interface Layer 1 protocol Layer 1 Layer 1

Physical communications medium

Virtual & Actual Communications Design Issues

• Important to understand difference between: • Some issues affect many layers, e.g: – virtual and actual communications, – need to address data (say who it’s for), – protocols and interfaces. – possible need for setting up connections, • Peer processes ‘think’ of communications as – data transfer rules (simplex, half-duplex, ...), being ‘horizontal’ using protocol. – error management, • Actual communications is via interfaces (and – deal with message component re-ordering, the physical communications medium). – flow control, • Peer process idea is key to network design. – routing – security 1.3 Internetworking and Routing Routing

• No single networking technology can satisfy all Routing is the mechanism used to transfer data requirements. between networks to reach the correct • Universal interconnection is desired. destination. • Protocols allow communication between nodes Router Network B without understanding underlying mechanisms. Web Browser • Internetworking is the process by which a group of disparate, heterogeneous networks Network can be linked to form a single logical network. A • The Internet is just such a collection. Routing takes place at the IP layer: routers are not aware of Web Server transport and application layers.

Protocol Layering and Routing 1.4 The OSI Reference Model

• OSI Reference Model – an internationally Host A Host B standardised network architecture. Application Layer Application Layer HTTP Message • An abstract representation of an ideal network protocol stack; not used in real networks. Transport Layer Transport Layer TCP Packet • OSI = Open Systems Interconnection. Router • Specified in ISO 7498-1. Internet Layer Internet Layer Internet Layer IP Datagram IP Datagram • Model has 7 layers.

Network Layer Ethernet Network Layer Ethernet Network Layer Frame Frame

Physical Network Physical Network Internet Protocols vs OSI The OSI Model

Application 7 Layer 7 Application Layer

5 Application Presentation 6 Layer 6

Session 5 Layer 5

4 TCP Transport 4 Layer 4 Transport Layer 3 IP Network 3 Layer 3 Network Layer 2 Network Interface Data Link 2 Layer 2

1 Hardware Physical 1 Layer 1

Lower/Upper Layers Layer 7: Application Layer

• Layers 1-4 often referred to as lower layers. • Home to wide variety of protocols for specific • Layers 5-7 are the upper layers. user needs, e.g.: • Lower layers relate more closely to the – virtual terminal service, communications technology. – file transfer, – electronic mail, • Layers 1 – 3 manage the communications – directory services. subnet. – the entire set of communications nodes required to manage massages between a pair of machines. • Layers 4 – 7 are true ‘end-to-end’ protocols. • Upper layers relate to application. Layer 6: Presentation Layer Layer 5: Session Layer

• Concerned with representation of transmitted • Allows establishment of sessions between data. machines, e.g. to • Deals with different data representations. – allow remote logins – ASCII or EBCDIC, – provide file transfer service. – one’s complement or two’s complement, • Responsible for: – byte ordering conventions, – dialogue control – floating point conventions (IEEE or proprietary). • which entity sends when with half-duplex communications. • Also deals with data compression. – token management • E.g. control which entity can perform an operation on shared data. – synchronisation • E.g. insertion of checkpoints in large data transfers.

Layer 4: Transport Layer Layer 3: Network Layer

• Basic function is to take data from Session • Key responsibility is control of routing in the Layer, split it up into smaller units, and ensure subnet. that the units arrive correctly. • Routing can be based on: • Concerned with efficient provision of service. – static tables, • The Transport Layer also determines the ‘type – determined at start of session, of service’ to provide to the Session Layer. – highly dynamic (varying for each packet depending on network load). • Also responsible for congestion control and usage monitoring. Layer 2: Data Link Layer Layer 1: Physical Layer

• Provides reliable, error-free service on top of • Concerned with bit transmission over physical raw Layer 1 service. channel. • Breaks data into frames. Requires creation of • Issues include: frame boundaries. – definition of 0/1, • Frames used to manage errors via – whether channel simplex/duplex, acknowledgements and selective frame – connector design. retransmission. • Mechanical, electrical, procedural matters.

Services in the OSI Model Layering Principles

• In OSI model, each layer provide services to layer above, and ‘consumes’ services provided n+1 by layer below. PDU • Active elements in a layer are called entities. (n+1) Entity Layer n+1 protocol (n+1) Entity • Entities in same layer in different machines are Service User Service User Layer n Service called peer entities. SDU Access Point (SAP) (n) Entity Layer n protocol (n) Entity Service Provider Service Provider

N-1 N-1 PDU PDU

PDU - Protocol Data Unit SDU - Service Data Unit Services and Protocols Connections

• Service = set of primitives provided by one • Layers can offer connection-oriented or layer to layer above. connectionless services. • Service defines what layer can do (but not how • Connection-oriented like telephone system. it does it). • Connectionless like postal system. • Protocol = set of rules governing data • Each service has an associated Quality-of- communication between peer entities, i.e. service (e.g. reliable or unreliable). format and meaning of frames/packets. • Service/protocol decoupling very important.

Reliability Issues Encapsulation as it is applied in layered protocols

• Reliable services never lose/corrupt data. • Reliable service costs more. • Typical application for reliable service is file transfer. • Typical application not needing reliable service is voice traffic. • Not all applications need connections. IP datagram TCP Segment Format

• IP Addresses – Logical, unique – eg. cs.umd.edu is 128.8.10.143 Source Port Destination Port • IP Packet Format: Sequence Number Request Number VERS HL TOS Fragment Length offset Reser. Control Window Datagram ID FLAG Fragment Offset TTL Protocol Header Checksum Checksum Urgent Pointer Source Address Options (if any) Destination Address Options (if any) Data Data

UDP Datagram Format Protocol Stacks In Relation To OSI Model

Source Port Destination Port Length Checksum

Data Network Application Programming Sockets Programming Interface (API) • Network API • The services provided by the that provide the interface between application • Socket Structures and protocol software.

• Socket Functions

Application

Network API

Protocol A Protocol B Protocol C

Network API TCP/IP

• Generic Programming Interface. • There are a variety of APIs for use with TCP/IP: • Support for message oriented and connection – Sockets oriented communication. – TLI • Uses the existing I/O services – Winsock – MacTCP • Operating System independence. • Support multiple suites (families): IPv4, IPv6, XNS, UNIX. • Provide special services for Client and Server? Functions needed Berkeley Sockets

• Specify local and remote communication • Generic: endpoints – support for multiple protocol families. • Initiate a connection – address representation independence • Wait for incoming connection • Uses existing I/O programming interface as • Send and receive data much as possible • Terminate a connection gracefully • Error handling

Unix Descriptor Table Socket

• A socket is a process-level abstract Descriptor Table representation of a communication endpoint. Data structure for file 0 • Sockets work with Unix I/O services just like files, pipes & FIFOs. • Sockets (obviously) have special needs: Data structure for file 1 – establishing a connection – specifying communication endpoint addresses

Data structure for file 2