TCP/IP Basics: Layers and Protocols Explanation based on the OSI Model

Koay Yong Cett
7 min readMay 15, 2020

--

In order to obtain an understanding of the packets sent to destination systems and the reply packets, we should talk about the TCP/IP Internet Protocol Suite.

OSI Reference Model:

Introduction:

  • OSI (open systems interconnection) is a reference model on how a applications can communicate over a network. A reference model is a conceptual framework for the understanding of the relationships between the components.
  • The purpose for the OSI reference model is to guide the vendors and developers. This allows the digital communication products and software programs created will interoperate and to facilitate clear comparisons among communications tools.
  • Most of the vendors involved in the telecommunications field make an attempt to describe their products and services in the relation to the OSI model. It is useful for guiding the discussion and evaluation of the services and products.
  • OSI model is rarely implemented. This is because that few network products and standard tools keep all related functions together in well defined layer as related to the model.
  • OSI model is originally intended to be a detailed specification of actual interfaces. Instead, the committee and community have decided to establish a common reference models for others. This allows others to develop a detailed interfaces and this OSI model turns out to become a standard.
  • Then, OSI model was officially adopted and included as the international standard by the International Organization of Standards(ISO).
OSI model

How OSI Model works:

  • The main concept of the OSI is the process of communication between two endpoints in a telecommunication network. The OSI model can be divided into seven distinct groups of related function or layers.
  • Each communicating user or program is at a computer that is able to provide those seven layers of function.Therefore, in a given message between users, there will be a flow of data between both senders and receivers.
  • A flow of data will went down through the layers in the source computer across the network. Then, the flow of data will went up through the layers in the destination computer.
  • The seven layers of functions are provided by a combinations of applications, operating systems, network card, device drivers and networking hardware. The networking cable enable a system to put a signal on the network cable or out over the WIFI(any wireless protocol).

Layer 7: Application Layer (Apps with user interaction: HTTP, SMTP)

  • A layer which the communication partners/users are identified. Is there a person to talk to? Will the current network allow me to communicate with them now? This layer enable things to send or open the things received.
  • Please note that this layer is not the application itself. However, it is a set of services that an application should be able to make use of directly. Besides that, some applications may perform application layer functions.

Layer 6: Presentation Layer (Meeting with different formats: ASCII, MP3, JPG)

  • This layer is usually part of an operating system and converts incoming and outgoing data from one presentation format to another. For instance from clear text to encrypted text at one one and decrypted back to clear text at other end.

Layer 5: Session Layer (Sessions and Sockets: SQL, RPC)

  • This layer sets up coordinates and terminate conversations. Services include authentication and re-connection after interruption.
  • On the Internet, the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) provide these services for most of the applications

Layer 4: Transport Layer (Flow and Error Control: TCP, UDP)

  • This layer manages packetization of data and then the delivery of the packets. Including the checking for errors in the data once it arrives.
  • TCP and UDP provide these services for most applications as well.

Layer 3: Network Layer (End-to-End Communication, virtual address: IP)

  • This layer handles the addressing and routing of the data. The data is sent in the correct direction to the correct destination on the outgoing transmissions and receiving incoming transmissions at packet level
  • IP is a network layer for the internet.

Layer 2: Data Link Layer (Accessing media: Ethernet, Wireless)

  • This layer sets up links across the physical network and putting the packets into the network frames.
  • This layer has two sub-layers which is the Logical Link Control(LLC) Layer and the Media Access Control(MAC) Layer. Ethernet is the main data link layer in use.

Layer 1: Physical Layer (Bit-wise transportation: Coaxial cables, fibre cables etc)

  • Current Layer conveys the bit stream through the network at the electrical, optical or radio level. It provides a hardware means in the sending and receiving of data on a carrier network.

Let’s see some of the prominent protocols of the layers:

For the ease of explanation, it’s better to explain and review both the physical and data link layer together.

  • Here, we have some physical media and connection methodologies in the physical layer. Whereas, the Ethernet, Token Bus, Wireless LAN and FDDI is included in the data link layer.
  • Ethernet and 802.11 wireless LAN are the most known protocols in the data link layer. Ethernet is a most commonly used network protocol that controls how data is transmitted over a LAN(local area network).
  • The Network Interface Cards is needed in order to connect a devices to the network. A wireless local area network (WLAN) is a wireless computer network protocol that link two or more devices using wireless communication within a limited area. For instance, home, school, computer laboratory or office building.
  • This enables the user to able to move around a local coverage area and yet still able to connected to the network. Most modern WLANs are based on the IEEE 802.11 standard and marketed uder the WiFi brand name.
  • IP which is known as the Internet Protocol is located in the Network Layer. It is responsible for addressing host, encapsulate the data into transferred packets and routing packets from source host to a destination host across one or more IP networks.
  • In the transport layer, the best known transport protocol the Transmission Control Protocol. It is used for connection oriented transmissions whereas the connection-less User Datagram Protocol(UDP) is used for simpler messaging transmissions.
  • Again for the ease of explanation, the last three layer which is session layer, presentation layer and application layer are combined together, referred as application layer.
  • Keep note that there is another reference model called TCP/IP reference model which combined the last three layers into application layer.
  • The application layer protocols are classified according to the protocol that we are using in the transport layer which is the TCP and UDP. These protocols interact with the end user via applications. Thus, these are the most known protocols by everyone.
  • Some of the most known TCP based application layer protocol are Hypertext Transfer Protocol(HTTP). It is simply a communications protocol used to send and receive web pages and files on the internet.
  • Telnet is one of the simplest ways to exchange data between two computers. It allows two computers anywhere in a computer network including the worldwide internet to exchange text and other data in real time.
  • File Transfer Protocol(FTP) is a communication protocol for the rapid simple transmission of files across a network.
  • Simple Mail Transfer Protocol (SMTP) is used to send and relay an email message between email servers. Note that it is not used to retrieve email messages from a server instead either IMAP or POP is used to retrieve email messages.
  • Domain Name System(DNS) is the system used to convert a computer’s hostname into an IP address on the internet. For an example, if a computer needs to communicate with a web server called nhs.uk . Your computer then needs IP address of the web server of the nhs.uk . It is the job of the DNS to convert the hostname to the IP address of the web server. DNS uses the both UDP and TCP.
  • Simple Network Management Protocol (SNMP) is used in the network management systems to monitor status of devices and detect any problems.

Thanks for reading…

--

--

Koay Yong Cett
Koay Yong Cett

Written by Koay Yong Cett

Every stories I shared is based on my personal opinion. Interest in ethical hacking and penetration testing. Thank you.

No responses yet