Session, Presentation and Application Layers Dr Junaid Latief Shah Assistant Professor Department of Higher Education J&K
Session Layer 5
Session establishment and termination: The session layer establishes, manages, and terminates sessions between devices. When two devices wish to communicate, this layer initiates a session, ensuring that both parties are ready to exchange data . Once communication is complete, the session layer ensures the proper termination of the session . Dialog control: In scenarios where multiple devices are engaged in communication, the session layer manages the orderliness of data exchange . It enables full-duplex or half-duplex communication, allowing devices to take turns and prevent data collision . This function is crucial for maintaining a synchronized and coherent flow of information . Token management: In token-based networks, where devices take turns transmitting data , the session layer handles token management . It ensures that each device receives its turn to communicate, promoting fair and efficient utilization of the communication channel . This layer prevents two parties from attempting the same critical operation at the same time. Session Layer 5
Synchronization : Interruptions in communication can lead to data corruption or misalignment. The session layer aids in re-establishing synchronization between devices. It ensures that data packets are delivered in the correct sequence , mitigating the impact of interruptions on the data exchange process . This layer allows synchronization by allowing the process of adding checkpoints, which are considered as synchronization points to the streams of data . Example: If a system is sending a file of 2500 pages , It is advisable to add checkpoints after every 100 to ensures that a 100-page unit is successfully received and acknowledged independently. In this case, if a crash happens during transmission of page number 824; then retransmission begins on page 801 . There is no need to retransmit pages 1 to 800 pages. Authentication: The process of identification is known as authentication. It takes a guarantee from the user to permit them access to the data. Authentication is very important because it provides security . Authorization: It grants privileges after authentication of the user. Authorization means providing access to the data that is authorized to the specific user.
Some Protocols………
PAP: It is an abbreviation for Password Authentication Protocol. The point-to-point protocol uses it to authenticate the user. It takes care of whether the user is authentic or not and then grants access . PPTP: It is the full form of Point-to-Point Tunneling Protocol. This is the technology used to implement VPN. With the help of PPTP, data can be transmitted securely from one node to another through a tunnel . RTCP: It is an abbreviation for Real-time Transport Control Protocol . It is used to provide audio and video over the Internet. Basically, it periodically transmits control packets to all participants in the session. It provides feedback on QoS (Quality of Service) to all participants in the session . It is used in video conferencing, television services, etc . RPC: It is an abbreviation for Remote Procedure Call Protocol . It helps in communication between processes that are residing in different systems connected over a network . It helps one program to request a service from another program located on another computer on a network. The processes that are communicating do not need to comprehend the details of the network ADSP: It is an abbreviation for AppleTalk Data Stream Protocol . It is a networking protocol that was introduced 38 years ago, in 1985, and was created for Apple Macintosh networks. It allows users to share printers and folders for access by other network users.
Presentation Layer
Translation: Data is sent from sender to receiver, but what if the sender device and receiver device understand different formats of code? For example, suppose one device understands ASCII code and another device understands EBCDIC code. In that case, the data must be translated into a code that the recipient understands to determine what data has been sent. The presentation layer is responsible for translating ASCII codes to EBCDIC or vice versa. Encryption and Decryption: The presentation layer is responsible for encrypting and decrypting data to avoid data leakage and data modification . The plaintext data at the source is encrypted into cipher text (unreadable format), then it is sent to the receiver, where the cipher text is decrypted into plaintext . Now, if the hacker tries to hack the data, the hacker receives an encrypted, unreadable form, and if the hacker tries to send modified data, the receiver can detect the modification during decryption; thereby, the data remains safe . RSA,ECC,AES etc. are common examples
Compression and Decompression: If the file size is large, it becomes difficult to transmit the large file over the network. File size can be decreased by compressing the file for easy transmission of data . Compression is the method of diminishing the size of a file to transmit data easily in less time. When the compressed data reaches the receiver, the data is reconstructed back to the original size, and this process is called decompression . This layer carries out data compression to reduce the bandwidth of the data to be transmitted (the primary goal of data compression is to reduce the number of bits which is to be transmitted ). (Huffman Coding and LZ algorithms are common examples)
Application Layer
Last and 7th layer from the bottom of the OSI model. This layer serves as an interface between user applications and the network. It is a layer through which the end user can communicate directly with the software . The application layer transmits the data in the form of a user-readable format. The application layer includes different protocols that are used in email communication, file transfer, web browsing, and more . This layer specifies the availability of resources , i.e., it checks whether adequate network resources are available or not . This layer delivers several facilities to the users for multiple email forwarding and storage facilities. This layer lets users log into a remote host and access any type of application. This layer lets the user access the files in the remote host . Some of the Protocols…………… SMTP,HTTP,FTP, SNMP, DNS
HTTP
HTTP stands for Hyper Text Transfer Protocol . It is a protocol used to access the data on the World Wide Web (www ). The HTTP protocol can be used to transfer the data in the form of plain text, hypertext, audio, video, and so on . HTTP is a protocol for fetching resources such as HTML documents . It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser. A complete document is reconstructed from the different sub-documents fetched, for instance, text, layout description, images, videos, scripts, and more . Clients and servers communicate by exchanging individual messages (as opposed to a stream of data). The messages sent by the client, usually a Web browser, are called requests and the messages sent by the server as an answer are called responses .
HTTP is a client-server protocol: requests are sent by one entity , the user-agent (or a proxy on behalf of it). Most of the time the user-agent is a Web browser ,. Each individual request is sent to a server, which handles it and provides an answer called the response . Between the client and the server there are numerous entities, collectively called proxies , which perform different operations and act as gateways or caches , for example. Client: the user-agent This role is primarily performed by the Web browser The browser is always the entity initiating the request To display a Web page, the browser sends an original request to fetch the HTML document that represents the page. It then parses this file , making additional requests corresponding to execution scripts, layout information (CSS) to display, and sub-resources contained within the page (usually images and videos). The Web browser then combines these resources to present the complete document , the Web page. Scripts executed by the browser can fetch more resources in later phases and the browser updates the Web page accordingly.
The Web server On the opposite side of the communication channel is the server, which serves the document as requested by the client. A server appears as only a single machine virtually ; but it may actually be a collection of servers sharing the load ( load balancing ), or other software ( such as caches, a database server, or e-commerce servers ), totally or partially generating the document on demand. HTTP Transactions and Messages Request Message: The request message is sent by the client that consists of a request line, headers, and sometimes a body . An HTTP method , usually a verb like GET / POST that defines the operation the client wants to perform. Typically, a client wants to fetch a resource (using GET) or post the value of an HTML form (using POST ). The version of the HTTP protocol. Optional headers that convey additional information for the servers.
Response Message: The response message is sent by the server to the client that consists of a status line, headers, and sometimes a body . Responses consist of the following elements: The version of the HTTP protocol they follow. A status code , indicating if the request was successful or not , and why. A status message, a non-authoritative short description of the status code. HTTP headers , like those for requests. Optionally, a body containing the fetched resource
WWW (World Wide Web)
World Wide Web, which is also known as a Web, is a collection of websites or web pages stored in web servers and connected to local computers through the internet. These websites contain text pages, digital images, audios, videos etc. The building blocks of the Web are web pages which are formatted in HTML and connected by links called "hypertext" or hyperlinks and accessed by HTTP . A technical definition of the World Wide Web is : all the resources and users on the Internet that are using the Hypertext Transfer Protocol (HTTP ). The WWW was initiated by CERN (European library for Nuclear Research) in 1989. It is a project created, by Timothy Berners Lee in 1989, for researchers to work together effectively at CERN. is an organization, named the World Wide Web Consortium (W3C), which was developed for further development of the web. This organization is directed by Tim Berners Lee, aka the father of the web . Components of WWW The Components of WWW mainly falls into two categories: Structural Components Semantic Components
Architecture of WWW 1.Client/Browser 2.Server 3.URL 4.HTML
DNS (Domain Name System)
The process of DNS resolution involves converting a hostname (such as www.example.com) into a computer-friendly IP address (such as 192.168.1.1 ) There are 4 DNS servers involved in loading a webpage: DNS recursor - The recursor can be thought of as a librarian who is asked to go find a particular book somewhere in a library. The DNS recursor is a server designed to receive queries from client machines through applications such as web browsers. Root nameserver - The root server is the first step in translating (resolving) human readable host names into IP addresses. It can be thought of like an index in a library that points to different racks of books - typically it serves as a reference to other more specific locations . TLD nameserver - The top level domain server (TLD) can be thought of as a specific rack of books in a library. This nameserver is the next step in the search for a specific IP address, and it hosts the last portion of a hostname (In example.com, the TLD server is “com ”). Authoritative nameserver - This final nameserver can be thought of as a dictionary on a rack of books, in which a specific name can be translated into its definition. The authoritative nameserver is the last stop in the nameserver query. If the authoritative name server has access to the requested record, it will return the IP address for the requested hostname back to the DNS Recursor (the librarian) that made the initial request.
The basic process of a DNS resolution follows these steps: The user enters a web address or domain name into a browser. The browser sends a message, called a recursive DNS query , to the network to find out which IP or network address the domain corresponds to. The query goes to a recursive DNS server , which is also called a recursive resolver , and is usually managed by the internet service provider ( ISP ). If the recursive resolver has the address, it will return the address to the user, and the webpage will load. If the recursive DNS server does not have an answer, it will query a series of other servers in the following order: DNS root name servers, top-level domain (TLD) name servers and authoritative name servers. The three server types work together and continue redirecting until they retrieve a DNS record that contains the queried IP address. It sends this information to the recursive DNS server, and the webpage the user is looking for loads. DNS root name servers and TLD servers primarily redirect queries and rarely provide the resolution themselves. The recursive server stores, or caches , the A record for the domain name, which contains the IP address. The next time it receives a request for that domain name, it can respond directly to the user instead of querying other servers. If the query reaches the authoritative server and it cannot find the information, it returns an error message.