There may be a REST api in the OSI layer

I may have a stupid question, but I'm trying to classify REST api between OSI layers. (Interview Question) It should be between 5 and 7 layers. The interviewer says: he is in 5 layers because he looks like an RPC.

But, in my opinion, it cannot be at the 5th session level, because the true REST api is stateless in contrast to the session (http-session), therefore, in my opinion, it can be placed as a protocol from the 7th level of the application because it looks like http (but why not at 6?).

I am looking for some resources on the Internet, but I have not found a clear answer. (I know that hosted protocols in OSI are not clear). But maybe you have a good opinion about this?

+6
source share
5 answers

The REST architecture is stateless in the sense that the server does not save the state of the client, but the state of the objects is passed back and forth. After all, REST stands for State Transfer view. Therefore, I would think that REST belongs to layer 5 - Session Layer, which is usually described as a layer where continuous information exchange is carried out in the form of several reverse and fourth transmissions between two nodes.

It is difficult to understand how the REST API can belong to the Layer 6 or Layer 7 of the OSI Model. The presentation layer provides coordination of the presentation form or syntax of the data to be transmitted. Typically, mechanisms such as character encoding (UTF, ASCII), data encryption and decryption are part of the presentation layer. The application layer provides applications, such as FTP, HTTP, Telnet, which support end-user processes.

+3
source

REST is not a protocol for connecting two systems. REST is an architecture style. This is mainly on top of the HTTP application layer.

+6
source

I assume that the TCP / IP world does not really respect the ISO OSI model above level 4.

0
source

I agree with Gowthamnvv. The REST API will be between the application layer and the transport layer in the case of the OSI model. But it will be at the application level in the case of the TCP / IP model, since the first 3 layers of the OSI model are more integrated into the application layer of the TCP / IP model, with the exception of some of the session functions performed at the transport level in the case of TCP / IP.

-1
source

Do not let the name “Level 5 Session” confuse you. REST is directly level 7. What is under the application? Does the OS operating system care about REST? Let's look at Chrome> Developer Tools> Network> Headings for this page itself (in an incognito window, because I don’t trust you). Screenshot of Developer Tools What makes this REST completely in the HTTP headers that you see here. Does the operating system do anything else but deliver it to Chrome? Not. REST is an application level API.

-1
source

Source: https://habr.com/ru/post/1216124/


All Articles