
When two devices want to communicate with each other, data transmission is always provided through certain layers. Each data completes the transmission from the source to the destination by using all of the layers shown on the side in order.
PHYSICAL LAYER
This layer represents wired or wireless connections in communication. It is the simplest form of data transmission. Transmission is provided by bits. All packet headers are clear and readable. The transmission is provided using an electrical signal.
DATA LINK LAYER
The data link layer is the first step in which data transmission will start to establish a connection with the device after the wired or wireless transmission is provided. Data transmission must occur within the same network. It is a control mechanism for transmitting data to the true point and communicating with the true devices during data transmission. This control is achieved using MAC addresses. Each device has a unique MAC address. In this case, the sent or received data is sent to be forwarded to the correct addressing and correct distribution points. This transmission control mechanism is also controlled by pairing the devices over the MAC table. This mode of transmission can be named Switching, inspired by the switch device that provides transmission with MAC addresses.
NETWORK LAYER
The network layer aims to provide transmission by controlling the addressing that occurs during the transmission of data from the current network to another network. Addresses to be made are expressed with special number blocks, which is called IP Addresses. These IP blocks are made up of bits. The central devices (routers) that provide the transmission in the addressing of the data keep records on this addressing. The table where the devices with IP addresses are matched with their MAC addresses and kept under record is called the ARP Table. Thus, addressing information will be recorded for a device that has been transmitted before, and the next transmission will be easier.
TRANSPORT LAYER
This layer is interested with addressing and “how” the transmission the data will send after it is finalized where to go. The urgency of the transmission, which ports to use, port conditions, and the importance of the data to be sent is of great importance in the selection of this transmission type. Data transmission basically takes place in two different ways; TCP and UDP. You can find detailed information about TCP and UDP at the bottom of this article.
SESSION LAYER
The session layer checks whether the connections between devices are active. It controls the dialogues between communication points. It provides for full-duplex, half-duplex, or simplex communication types. Also, it establishes check-pointing, adjournment, cancellation of the connection, and restart all procedures about data communication.
PRESENTATION LAYER
It creates the environment between the applications on the devices and the data to be transmitted. Depending on the type of data sent or received, it offers the application to run into the data and converts the data into a form that the application will accept. In summary, this layer acts as a bridge between the applications and the network layers. Also, data compression, decompression, encryption, decryption processes are occurring in this layer.
APPLICATION LAYER
This is the layer closest to the user. It brings together the user and data through an application. Everything in this layer is completely data-appropriate and specific to the application to be used. This layer is an abstraction layer that defines the shared communication protocols and interface methods used by hosts in data communications in the networks.
HOW DOES DATA TRANSMISSION OCCUR?
OSI Layer principles are implemented by the sender and receiver when performing data transmission. As soon as the sender, who is the original owner of the data, starts the sending process, the data packet progresses from the bottom up. During this progression, each layer adds a packet header to the data indicating this status after it has fulfilled its task. It is possible to think of these titles as a kind of labeling. Thus, when the user who receives the data reaches the data packet, it reads the headers in order, takes its own header tag, and forwards the remaining data packet to the next step. When the packet reaches the last layer, it takes the form of the data sent by the sender and the user can easily view the data via the application.
What are the titles mentioned? Each header added to the message on the sender’s side contains information about its own task. For example, let’s talk about a JPEG photo. When the sender starts sending, the application layer adds a tag header indicating that it is a jpeg file and with which application it should be opened. Our fifth layer, the transport layer, decides whether to transmit data with UDP or TCP. Thus, the decisions and clues made by the sender provide a great convenience for the receiver after the data transmission.

TCP / IP
The TCP/IP reference model, which we often hear today, was created by considering the OSI Layer model. Layers with similar tasks are combined in this model and ease of use is provided.
The TCP/IP reference model is more protocol-oriented than the OSI model. The OSI model gives instructions on how communication should be done, while the TCP/IP protocols set the standards by which the internet is developed. So TCP/IP is a useful model.

TCP – UDP
TRANSMISSION CONTROL PROTOCOL – Transmission is provided by an algorithmic method called a 3-way handshake. After the sent packets are transmitted, a transmission message is sent to the sender that the transmission has taken place. Undeliverable packets are sent again until the transmission is achieved. There is a slow transmission and controlled packet transmission to ensure data transmission. For example, in case of data loss, while watching a video, the video is stopped and the package is waited for. When the packets are transmitted from the receiver to the sender again, the video continues uninterrupted from where it left off. Therefore, the TCP header is 20 bytes.
USER DATAGRAM PROTOCOL – İletimde asla garanti verilemez. En hızlı iletim biçimidir ancak kaybolan, çakışan veya drop edilen paketler asla tekrar gönderilmez. Anlık veri iletimlerinde oldukça etkilidir. Örneğin canlı video izlerken yayın donmadan devam eder ve veri kaybı olduğunda yayın canlı akışından devam eder, arada kaybolan görüntüyü tekrar görüntüleyemez durumda olursunuz. Bu sebeplerden ötürü UDP başlığı 8 byte’dır.
