OSI Layer-4 and Attack Types

5j4J...GviB
3 Jan 2024
7

The fourth layer of the OSI (Open Systems Interconnection) reference model is called the Transport Layer. This layer is responsible for providing end-to-end communication and ensuring the reliable transfer of data from the application layer.


Basic Tasks of Layer 4:

Service Provision:

  • The Transport Layer provides services to processes in the application layer. These services include data integrity, reliable transmission, flow control, and data segmentation.

Data Segmentation and Reassembly:

  • Data from the application layer is divided into packets of a specific size (segmentation) in the Transport Layer. This aims to better manage data in the network and ensure healthy transmission.

Flow Control:

  • The Transport Layer performs flow control to balance the speed between the sender and the receiver. The sender sends data that the receiver can process, and the receiver accepts the data at a rate that matches the sender's speed.

Error Control:

  • Using error detection and correction mechanisms, the Transport Layer checks for possible errors in the transmitted data and corrects them when necessary.

Connection Establishment and Termination:

  • The Transport Layer manages the processes of establishing a connection, transmitting data, and terminating a connection between two end systems. These processes are crucial for ensuring reliable data transmission.

Port Management:

  • The Transport Layer uses port numbers to separate and direct processes in the application layer, ensuring that data belonging to a specific application is delivered to the correct process.


Segmentation and Protocols:

  • Transport Layer and Protocols:The Transport Layer divides data coming from the application layer into segments. The most important protocols of the Transport Layer are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
  • TCP (Transmission Control Protocol):
    • TCP ensures reliable data transmission. It divides data into segments, assigns a sequence number to each segment, and ensures the correct reassembly of data by the receiver based on these sequence numbers. Additionally, it provides flow control and error control.
  • UDP (User Datagram Protocol):
    • UDP focuses on lightweight and fast data transmission. However, it does not guarantee reliability or sequencing. The segmentation and reassembly processes are simpler compared to TCP.


Connection Establishment and Termination (TCP):

  1. TCP Three-Way Handshake:Sender sends SYN.
  2. Receiver responds with SYN/ACK.
  3. Sender responds with ACK. The connection is established.
  • Connection termination is done using FIN (finish) flags.


Flow Control (TCP):

  • TCP balances the speed of data transmission between the sender and the receiver. The receiver specifies a window size, indicating how much data the sender can send. This maintains a balance in speed.


Error Control (TCP):

  • TCP uses error control mechanisms like CRC (Cyclic Redundancy Check) to detect possible errors in transmitted data. Incorrectly corrupted data packets are detected before reaching the receiver.


Port Management:

  • Ports are used to identify processes in the Transport Layer. By using port numbers, the sender and receiver are directed to the correct application processes.


Connection State and Flow Diagrams:

  • TCP uses a state machine to track the state of a connection. Flow diagrams, including connection establishment, data transmission, and connection termination stages, illustrate the working principles of the Transport Layer.


Segment Header Information:

  • The headers of segments in the Transport Layer are specific to the transport layer protocols. The TCP header, for example, includes a series of flags, sequence numbers, window size, and urgent data information.

Understanding the details of how packets are handled in the Transport Layer, both outgoing and incoming, can provide valuable insights into the workings of networking protocols.

The specific term for a packet transported in Layer 4 is called a "segment." This concept is specific to protocols within the Transport Layer (Layer 4). For instance, data from transport protocols such as TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) is referred to as a "segment" in this layer.
Both TCP and UDP are protocols that operate in Layer 4, but they have different characteristics. TCP provides reliable and sequential data transmission, hence having a segment structure with more control information. On the other hand, UDP is a lightweight protocol that does not guarantee sequencing or reliability, resulting in a simpler segment structure compared to TCP.
In summary, data fragments transported in Layer 4 are termed "segments," and this term is specific to transport protocols such as TCP and UDP.
Details about a "segment":

  • A segment in Layer 4 includes a header and the transported data, specific to the transport protocol (TCP or UDP). Here is a general description of these header and data components:

Header:

  • Sequence Number: Specifies the sequence number of the sent data segment.
  • Acknowledgment Number: Specifies the sequence number of the data segment received from the receiver.
  • Data Offset: An area specifying the length of the header.
  • Control Flags: Contains special control flags of TCP (e.g., SYN, ACK, PSH, RST, FIN).
  • Window Size: A value determined by the receiver indicating how much data the sender can transmit.
  • Checksum: A checksum used to verify the integrity of the data.
  • Urgent Pointer: A value indicating the start of urgent data.
  • Source Port and Destination Port: Specifies the port numbers of the initiating application (source) and the targeted application (destination).

Data:

  • The actual transported data. This part varies depending on the application in use and the purpose of the communication. For example, HTTP data in communication between web browsers, FTP data in file transfers, or RTP data in voice transmission.


These header and data components are fundamental parts of a segment in Layer 4. Differences exist in the header structures of TCP and UDP because each protocol provides different services. These components are customized based on the needs of the communicating applications.

Get fast shipping, movies & more with Amazon Prime

Start free trial

Enjoy this blog? Subscribe to Sisyphos

0 Comments