Skip to main content

Which OSI layers does network security affect?

Network security affects all layers of the OSI model, because attacks and defenses can occur at any stage of data transmission, from the physical cable to the user application.

It is important to understand: there is no single "security layer" - protection is distributed across the whole OSI model.


Short answer for the interview

If you need a short answer:

Network security affects all 7 layers of the OSI model, because threats and defense mechanisms exist at every layer, from physical to application.


Layer by layer, in plain terms

1. Physical layer

What is protected here: cables, ports, equipment.

Threats:

  • physical access to the server;
  • disconnecting a cable;
  • theft of equipment.

Defenses:

  • access control to the server room;
  • video surveillance;
  • locks, safes.

This is mostly about physical security, but it directly affects the network.


What happens here: frame transmission inside the local network (MAC addresses).

Threats:

  • MAC spoofing;
  • ARP spoofing;
  • local network eavesdropping.

Defenses:

  • port security on switches;
  • ARP protection;
  • network segmentation (VLAN).

3. Network layer

What happens here: routing, IP addresses.

Threats:

  • IP spoofing;
  • network scanning;
  • DDoS attacks.

Defenses:

  • firewall;
  • IP filtering;
  • ACL (access control lists).

This is one of the key layers of network security.


4. Transport layer

What happens here: data transfer between nodes (TCP / UDP).

Threats:

  • SYN flood;
  • session hijacking;
  • port attacks.

Defenses:

  • stateful firewall;
  • session control;
  • connection limits.

5. Session layer

What happens here: managing sessions and connections.

Threats:

  • session hijacking (interception);
  • session reuse.

Defenses:

  • session lifetime control;
  • re-authentication;
  • secure token management.

6. Presentation layer

What happens here: encoding, compression, data encryption.

Threats:

  • interception of data in plain form.

Defenses:

  • data encryption (TLS, SSL);
  • data format protection.

This is exactly where confidentiality is ensured.


7. Application layer

What happens here: the work of applications and services (HTTP, FTP, SMTP and others).

Threats:

  • SQL injection;
  • XSS;
  • phishing;
  • attacks on web applications.

Defenses:

  • WAF (Web Application Firewall);
  • user authentication;
  • input validation.

The most attacked layer, because it is closest to the user.


Summary in plain terms

  • Attacks happen at all layers of the OSI model
  • So security must also be multi-layered
  • The higher the layer, the closer the attack is to the user and the data

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.