Chapter 2 Lecture Presentation
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 2 Applications and Layered Architectures Protocols, Services & Layering OSI Reference Model TCP/IP Architecture How the Layers Work Together Berkeley Sockets Application Layer Protocols & Utilities 1 Chapter 2 Applications and Layered Architectures Protocols, Services & Layering 2 Layers, Services & Protocols z The overall communications process between two or more machines connected across one or more networks is very complex z Layering partitions related communications functions into groups that are manageable z Each layer provides a service to the layer above z Each layer operates according to a protocol z Let’s use examples to show what we mean 3 Web Browsing Application z World Wide Web allows users to access resources (i.e. documents) located in computers connected to the Internet z Documents are prepared using HyperText Markup Language (HTML) z A browser application program is used to access the web z The browser displays HTML documents that include links to other documents z Each link references a Uniform Resource Locator (URL) that gives the name of the machine and the location of the given document z Let’s see what happens when a user clicks on a link 4 1. DNS A. 64.15.247.200 Q. www.nytimes.com? z User clicks on http://www.nytimes.com/ z URL contains Internet name of machine (www.nytimes.com), but not Internet address z Internet needs Internet address to send information to a machine z Browser software uses Domain Name System (DNS) protocol to send query for Internet address z DNS system responds with Internet address 5 2. TCP ACK ACK, TCP Connection Request From: 64.15.247.200 Port 80 To:128.100.11.13 Port 1127 TCP Connection Request From: 128.100.11.13 Port 1127 To: 64.15.247.200 Port 80 z Browser software uses HyperText Transfer Protocol (HTTP) to send request for document z HTTP server waits for requests by listening to a well-known port number (80 for HTTP) z HTTP client sends request messages through an “ephemeral port number,” e.g. 1127 z HTTP needs a Transmission Control Protocol (TCP) connection between the HTTP client and the HTTP 6 server to transfer messages reliably 3. HTTP Content 200 OK GET / HTTP/1.1 z HTTP client sends its request message: “GET …” z HTTP server sends a status response: “200 OK” z HTTP server sends requested file z Browser displays document z Clicking a link sets off a chain of events across the Internet! z Let’s see how protocols & layers come into play… 7 Protocols z A protocol is a set of rules that governs how two or more communicating entities in a layer are to interact z Messages that can be sent and received z Actions that are to be taken when a certain event occurs, e.g. sending or receiving messages, expiry of timers z The purpose of a protocol is to provide a service to the layer above 8 Layers z A set of related communication functions that can be managed and grouped together z Application Layer: communications functions that are used by application programs z HTTP, DNS, SMTP (email) z Transport Layer: end-to-end communications between two processes in two machines z TCP, User Datagram Protocol (UDP) z Network Layer: node-to-node communications between two machines z Internet Protocol (IP) 9 Example: HTTP z HTTP is an application layer protocol z Retrieves documents on behalf of a browser application program z HTTP specifies fields in request messages and response messages z Request types; Response codes z Content type, options, cookies, … z HTTP specifies actions to be taken upon receipt of certain messages 10 HTTP Protocol GET HTTP HTTP Client Server Response z HTTP assumes messages can be exchanged directly between HTTP client and HTTP server z In fact, HTTP client and server are processes running in two different machines across the Internet z HTTP uses the reliable stream transfer service provided by TCP 11 Example: TCP z TCP is a transport layer protocol z Provides reliable byte stream service between two processes in two computers across the Internet z Sequence numbers keep track of the bytes that have been transmitted and received z Error detection and retransmission used to recover from transmission errors and losses z TCP is connection-oriented: the sender and receiver must first establish an association and set initial sequence numbers before data is transferred z Connection ID is specified uniquely by (send port #, send IP address, receive port #, receiver IP address) 12 HTTP uses service of TCP HTTP HTTP client server Response GET Port 1127 Port 80 GETResponseTCPTCP80, 1127 1127, 80TCPGETbytesResponse 13 Example: DNS Protocol z DNS protocol is an application layer protocol z DNS is a distributed database that resides in multiple machines in the Internet z DNS protocol allows queries of different types z Name-to-address or Address-to-name z Mail exchange z DNS usually involves short messages and so uses service provided by UDP z Well-known port 53 14 Local Authoritative Name Name Server Server 1 5 4 2 3 6 Root Name Server z Local Name Server: resolve frequently-used names z University department, ISP z Contacts Root Name server if it cannot resolve query z Root Name Servers: 13 globally z Resolves query or refers query to Authoritative Name Server z Authoritative Name Server: last resort z Every machine must register its address with at least two authoritative name servers 15 Example: UDP z UDP is a transport layer protocol z Provides best-effort datagram service between two processes in two computers across the Internet z Port numbers distinguish various processes in the same machine z UDP is connectionless z Datagram is sent immediately z Quick, simple, but not reliable 16 Summary z Layers: related communications functions z Application Layer: HTTP, DNS z Transport Layer: TCP, UDP z Network Layer: IP z Services: a protocol provides a communications service to the layer above z TCP provides connection-oriented reliable byte transfer service z UDP provides best-effort datagram service z Each layer builds on services of lower layers z HTTP builds on top of TCP z DNS builds on top of UDP z TCP and UDP build on top of IP 17 Chapter 2 Applications and Layered Architectures OSI Reference Model 18 Why Layering? z Layering simplifies design, implementation, and testing by partitioning overall communications process into parts z Protocol in each layer can be designed separately from those in other layers z Protocol makes “calls” for services from layer below z Layering provides flexibility for modifying and evolving protocols and services without having to change layers below z Monolithic non-layered architectures are costly, inflexible, and soon obsolete 19 Open Systems Interconnection z Network architecture: z Definition of all the layers z Design of protocols for every layer z By the 1970s every computer vendor had developed its own proprietary layered network architecture z Problem: computers from different vendors could not be networked together z Open Systems Interconnection (OSI) was an international effort by the International Organization for Standardization (ISO) to enable multivendor computer interconnection 20 OSI Reference Model z Describes a seven-layer abstract reference model for a network architecture z Purpose of the reference model was to provide a framework for the development of protocols z OSI also provided a unified view of layers, protocols, and services which is still in use in the development of new protocols z Detailed standards were developed for each layer, but most of these are not in use z TCP/IP protocols preempted deployment of OSI protocols 21 7-Layer OSI Reference Model Application Application End-to-End Protocols Application Application Layer Layer Presentation Presentation Layer Layer Session Session Layer Layer Transport Transport Layer Layer Network Network Network Network Layer Layer Layer Layer Data Link Data Link Data Link Data Link Layer Layer Layer Layer Physical Physical Physical Physical Layer Layer Layer Layer 22 Communicating End Systems One or More Network Nodes Physical Layer z Transfers bits across link z Definition & specification of the physical aspects of a communications link z Mechanical: cable, plugs, pins... z Electrical/optical: modulation, signal strength, voltage levels, bit times, … z functional/procedural: how to activate, maintain, and deactivate physical links… z Ethernet, DSL, cable modem, telephone modems… z Twisted-pair cable, coaxial cable optical fiber, radio, infrared, … 23 Data Link Layer z Transfers frames across direct connections z Groups bits into frames z Detection of bit errors; Retransmission of frames z Activation, maintenance, & deactivation of data link connections z Medium access control for local area networks z Flow control frames Data Link Data Link Layer Layer Physical bits Physical Layer Layer 24 Network Layer z Transfers packets across multiple links and/or multiple networks z Addressing must scale to large networks z Nodes jointly execute routing algorithm to determine paths across the network z Forwarding transfers packet across a node z Congestion control to deal with traffic surges z Connection setup, maintenance, and teardown when connection-based 25 Internetworking Ethernet LAN z Internetworking is part of network layer and provides zzzzzz transfer of packets across multiple possibly dissimilar ATM networks Network ATM Switch z Gateways (routers) direct packets across networks ATM ATM HSwitch Switch ATM H Switch NetNet 33 Net 1 G Net 1 G G G NetNet 5 5 H Net 2 G Net 4 G Net 2 H G = gateway H = host 26 Transport Layer z Transfers data end-to-end from process