네트워크

OSI Model

쿠키는 서비스 2023. 9. 6. 15:06
반응형

OSI model은 개발자에게 매우매우 중요한 개념입니다.

네트워크에 표준이 있어야하는데 OSI model이 이 표준을 잡아줍니다. 

OSI model은 Open System Interconnections model의 약자입니다.

 

왜 우리는 커뮤니케이션 모델이 필요한걸까요?

 

Agnostic applications(특정 기술, 플랫폼, 데이터베이스 등에 종속되지 않는 응용 프로그램을 의미합니다. 다양한 환경이나 시스템에서 운영될 수 있으며, 특정 하드웨어나 소프트웨어에 구애받지 않습니다.

- 표준 모델이 없는 경우 응용 프로그램은 기본 네트워크 매체에 대한 지식이 있어야 합니다.

- 와이파이 vs 이더넷 vs LTE vs 광케이블에서 작동하도록 앱의 다른 버전을 만들어야된다고 상상해보세요.

 

네트워크 장비 관리

- 표준 모델이 없으면 네트워크 장비를 업그레이드하는 것이 어려워집니다.

 

분리된 혁신

- 모델 재설정에 영향을 주지 않고 각 계층에서 개별적으로 혁신을 일으킬 수 있습니다.

 

OSI Model?

- 7 Layers each describe a specific networking component

- Layer 7 - Application - HTTP/FTP/gRPC

- Layer 6 - Presentation - Encoding, Serialization

- Layer 5 - Session - Connection establishment, TLS

- Layer 4 - Transport - UDP/TCP

- Layer 3 - Network - IP

- Layer 2 - Data Link - Frames, Mac address Ethernet

- Layer 1 - Physical - Electric signals, fiber or radio waves 

 

The OSI Layers - an Example (Sender)

Example sending a POST request to an HRRPS webpage

 

Layer7 - Application

- POST request with JSON data to HTTPS server

Layer6 - Presentation

- Serialize JSON to flat byte strings

Layer5 - Session

- Request to establish TCP connection/TLS

Layer4 - Transport

- Sends SYN request target port 443

Layer3 - Network

- SYN is placed an IP packet(s) and adds the source/dest IPs

Layer2 - Data link

- Each packet goes into a single frame and adds the source/dest MAC addresses

Layer1 - Physical

- Each frame becomes string of bits which converted into either a radio signal(wifi), electric signal(ethernet), or light(fiber) 

 

The OSI Layers - an Example (Receiver)

Receiver computer receives the POST request the other way around

 

Layer 1 - Physical

- Radio, electric or light is received and converted into digital bits

Layer 2 - Data Link

- The bits from Layer 1 is assembled into frames

Layer 3 - Network

- The frames from layer 2 are assembled into IP packet

Layer4 - Transport

- The IP packets from layer 3 are assembled into TCP segments

- Deals with Congestion control/flow control/retransmission in case of TCP

- If Segment is SYN we don't need to go further into more layers as we are still processing the connection request

Layer5 - Session

- The connection session is estabilshed or identified

- We only arrive at this layer when necessary (three way handshake is done)

Layer6 - Presentation

- Deserialize flat byte strings back to JSON for the app to consume

Layer7 - Application

- Application understands the JSON POST request and your express json or apache request receive event is triggered

 

Take it with a grain of salt, it's not always cut and dry.

반응형