The application layer is the highest abstraction layer of the TCP/IP model that provides the interfaces and protocols needed by the users. It combines the functionalities of the session layer, the presentation layer and the application layer of the OSI model.The functions of the application layer are −It facilitates the user to use the services of the network.It is used to develop network-based applications.It provides user services like user login, naming network devices, formatting messages, and e-mails, transfer of files etc.It is also concerned with error handling and recovery of the message as a whole.This layer uses a number of protocols, ... Read More
Similarities between OSI and TCP / IP Reference ModelsBoth the reference models are based upon layered architecture.The layers in the models are compared with each other. The physical layer and the data link layer of the OSI model correspond to the link layer of the TCP/IP model. The network layers and the transport layers are the same in both the models. The session layer, the presentation layer and the application layer of the OSI model together form the application layer of the TCP/IP model.In both the models, protocols are defined in a layer-wise manner.In both models, data is divided into ... Read More
The advantages of the OSI model areIt is a generic model and acts as a guidance tool to develop any network model.It is a layered model. Changes are one layer do not affect other layers, provided that the interfaces between the layers do not change drastically.It distinctly separates services, interfaces, and protocols. Hence, it is flexible in nature. Protocols in each layer can be replaced very conveniently depending upon the nature of the network.It supports both connection-oriented services and connectionless services.The disadvantages of the OSI model areIt is purely a theoretical model that does not consider the availability of appropriate ... Read More
The advantages of TCP/IP protocol suite areIt is an industry–standard model that can be effectively deployed in practical networking problems.It is interoperable, i.e., it allows cross-platform communications among heterogeneous networks.It is an open protocol suite. It is not owned by any particular institute and so can be used by any individual or organization.It is a scalable, client-server architecture. This allows networks to be added without disrupting the current services.It assigns an IP address to each computer on the network, thus making each device to be identifiable over the network. It assigns each site a domain name. It provides name and ... Read More
The transport layer (Layer 4) is responsible for delivery of an entire message from an application program on the source device to a similar application program on the destination device.The main functions of the transport layer are as follows −It delivers a message from a specific process of one computer to a specific process in another computer. The transport layer adds a port address to the header of the data packet.It divides a message into smaller segments such that each segment contains a sequence number along with the port address. It ensures that the segments arrive correctly at the receiver’s ... Read More
Calculating the area of a triangle is a formula that you can easily implement in python. If you have the base and height of the triangle, you can use the following code to get the area of the triangle,def get_area(base, height): return 0.5 * base * height print(get_area(10, 15))This will give the output:75If you have the sides of the triangle, you can use herons formula to get the area. For example,def get_area(a, b, c): s = (a+b+c)/2 return (s*(s-a)*(s-b)*(s-c)) ** 0.5 print(get_area(10, 15, 10))This will give the output:49.607837082461074
The session layer (layer 5) is responsible for establishing, managing, synchronizing and terminating sessions between end-user application processes.The main functions of the session layer are as follows −It works as a dialog controller. It allows the systems to communicate in either half-duplex or full-duplex mode of communication.It is responsible for token management. Through this, it prevents the two users to simultaneously attempt the same critical operation.It synchronizes communication. It adds synchronization points or checkpoints in data streams for long communications. This ensures that data streams up to the checkpoints are successfully received and acknowledged. In case of any failures, only ... Read More
The presentation layer (Layer 6) ensures that the message is presented to the upper layer in a standardized format. It deals with the syntax and the semantics of the messages.The main functions of the presentation layer are as follows −It encodes the messages from the user dependent format to the common format and vice versa, for communication among dissimilar systems.It is responsible for data encryption and decryption of sensitive data before they are transmitted over common channels.It is also responsible for data compression. Data compression is done at the source to reduce the number of bits to be transmitted. It ... Read More
To align a flex item in the center with Bootstrap 4, use the .align-self-center class.The following is my div for flex −Now add flex items and here I have applied the align-self-center class on the 3rd flex item − A-one B-one C-one D-one You can try to run the following code to implement the align-self-center class in Bootstrap −ExampleLive Demo Bootstrap Example Align Specific Flex Item in the center A-one B-one C-one D-one
You can format a floating number to the fixed width in Python using the format function on the string. For example, nums = [0.555555555555, 1, 12.0542184, 5589.6654753] for x in nums: print("{:10.4f}".format(x))This will give the output0.5556 1.0000 12.0542 5589.6655Using the same function, you can also format integersnums = [5, 20, 500] for x in nums: print("{:d}".format(x))This will give the output:5 20 500You can use it to provide padding as well, by specifying the number before dnums = [5, 20, 500] for x in nums: print("{:4d}".format(x))This will give the output5 20 500The https://pyformat.info/ website is a great resource ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP