What application layer protocol is being used when using sockets?

559 views Asked by At

When using web browsers, the application layer protocol being used is HTTP. Whereas I frequently use sockets to create a connection to a server and pass along strings, a frequently used example in Python could be

import socket

clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect(('localhost', 8089))
clientsocket.send('hello')

What application layer protocol is being used when sending the string 'hello' with this basic example?

1

There are 1 answers

0
Steffen Ullrich On

No specific application layer protocol is used in your case. An application layer protocol is some kind of standard how messages are exchanged on top of TCP/UDP whatever transport layer. These standards are defined so that different implementations can interact with each other by just implementing the specific standard.

You can also use sockets without using a standardized application layer protocols but instead just make up what kind of messages you send by your own - and this is exactly what you did.