Page 11CS 640: Introduction to Computer NetworksAditya AkellaLecture 2Layering, Protocol Stacks,and Standards2Today’s Lecture• Layers and Protocols• A bit about applications3Network Communication:Lots of Functions Needed• Links• Multiplexing • Routing• Addressing/naming (locating peers)• Reliability• Flow control• FragmentationHow do you implement these functions?Key: Layering and protocolsPage 24What is Layering?• A way to deal with complexity– Add multiple levels of abstraction– Each level encapsulates some key functionality– And exports an interface to other components– Example?• Layering: Modular approach to implementing network functionality by introducing abstractions• Challenge: how to come up with the “right”abstractions?5Example of Layering• Software and hardware for communication between two hosts• Advantages:– Simplifies design and implementation– Easy to modify/evolveLink hardwareHost-to-host connectivityApplication-to-application channelsApplication semantics6What is a Protocol?• Could be multiple abstractions at a given level – Build on the same lower level– But provide diferent service to higher layers• Protocol: Abstract object or module in layered structureLink hardwareHost-to-host connectivityRequest-ReplyApplicationMessage streamPage 371. Protocols Offer Interfaces• Each protocol offers interfaces – One to higher-level protocols on the same end hosts• Expects one from the layers on which it builds• Interface characteristics, e.g. IP service model– A “peer interface” to a counterpart on destinations• Syntax and semantics of communications• (Assumptions about) data formats• Protocols build upon each other– Adds value, improves functionality overall• E.g., a reliable protocol running on top of IP– Reuse, avoid re-writing• E.g., OS provides TCP, so apps don’t have to rewrite82. Protocols Necessary for Interoperability• Protocols are the key to interoperability.– Networks are very heterogenous:– The hardware/software of communicating parties are often not built by the same vendor– Yet they can communicate because they use the same protocol• Actually implementations could be different • But must adhere to same specification• Protocols exist at many levels.– Application level protocols– Protocols at the hardware levelHardware/linkNetworkApplicationEthernet: 3com, etc.Routers: cisco, juniper etc.App: Email, AIM, IE etc.9OSI Model• One of the first standards for layering: OSI• Breaks up network functionality into seven layers• This is a “reference model”– For ease of thinking and implementation• A different model, TCP/IP, used in practicePage 410The OSI Standard: 7 Layers1. Physical: transmit bits (link)2. Data link: collect bits into frames and transmit frames (adaptor/device driver)3. Network: route packets in a packet switched network4. Transport: send messages across processes end2end5. Session: tie related flows together6. Presentation: format of app data (byte ordering, video format)7. Application: application protocols (e.g. FTP)• OSI very successful at shaping thought• TCP/IP standard has been amazingly successful, and it’s not based on a rigid OSI model11OSI Layers and LocationsBridge/SwitchFull fledgedpacket switch:use dst addrto routeRouter/GatewayForward usingnetwork layeraddressesHostHostApplicationTransportNetworkData LinkPresentationSessionPhysicalRepeater/HubSimply copypackets out12The Reality: TCP/IP ModelFTP HTTP TFTPNVTCP UDPIPNET1NET2NETn…Network protocols implemented by a comb of hw and sw.Interconnection of n/w technologies into a single logical n/wTwo transport protocols: provide logical channels to appsApp protocolsNote: No strict layering.App writers can define apps that run on any lower level protocols.Page 513The Thin WaistUDP TCPData LinkPhysicalApplicationsThe Hourglass ModelWaistThe waist: minimal, carefully chosen functions. Facilitates interoperability and rapid evolutionFTP HTTP TFTPNVTCP UDPIPNET1NET2NETn…14TCP/IP vs OSIApplication(pluslibraries)TCP/UDPIPData linkPhysicalApplicationPresentationSessionTransportNetworkData linkPhysical15TCP/IP LayeringBridge/SwitchRouter/GatewayHostHostApplicationTransportNetworkLinkPhysicalPage 616Layers & EncapsulationGet index.htmlConnection IDSource/DestinationLink AddressUser A User BHeader17Protocol Demultiplexing• Multiple choices at each layer• How to know which one to pick?FTP HTTP TFTPNVTCP UDPIPNET1NET2NETn…TCP/UDPIPManyNetworks18Multiplexing & Demultiplexing• Multiple implementations of each layer– How does the receiver know what version/module of a layer to use?• Packet header includes a demultiplexing field– Used to identify the right module for next layer– Filled in by the sender– Used by the receiver• Multiplexing occurs at multiple layers. E.g., IP, TCP, …IPTCPIPTCPV/HL TOS LengthID Flags/OffsetTTL Prot. H. ChecksumSource IP addressDestination IP addressOptions..Page 719Layering vs Not• Layer N may duplicate layer N-1 functionality – E.g., error recovery• Layers may need same info (timestamp, MTU)• Strict adherence to layering may hurt performance• Some layers are not always cleanly separated– Inter-layer dependencies in implementations for performance reasons– Many cross-layer assumptions, e.g. buffer management• Layer interfaces are not really standardized.– It would be hard to mix and match layers from independent implementations, e.g., windows network apps on unix (w/o compatibility library)20Applications; Application-Layer Protocols• Application: communicating, distributed processes– Running in network hosts in “user space”– N/w functionality in kernel space– Exchange messages to implement app– e.g., email, file transfer, the Web• Application-layer protocols– One “piece” of an app– Define messages exchanged by apps and actions taken– Use services provided by lower layer protocolsapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysical21Writing Applications: Some Design Choices• Communication model:– Client-server or peer-to-peer– Depends on economic and usage models• Transport service to use?– “TCP” vs “UDP”– Depends on application requirementsPage 822Client-Server Paradigm vs. P2PTypical network app has two pieces: clientand serverapplicationtransportnetworkdata
View Full Document