새소식

반응형
CS 지식/네트워크

[데이터 통신] 2. 네트워크 모델(Network Models)

  • -
반응형

2.1 Protocol Layering

  • 어떤 통신이냐에 따라서 그 복잡도가 다름.
    • communication이 단순할 때는 오직 하나의 단순한 protocol만 필요함
    • communication이 복잡할 때는 각 layer 당 하나의 protocol이 필요함(protocol layering)

이렇듯 복잡도에 따라서 protocol의 layer(계층)를 나누는 것을 의미한다.

 

Single-layer protocol

한 가지 계층으로만 통신하는 형태

  • Layer 1: Listen / Talk
  • 마주보고 대화를 나누는 것과 같은 방식(말하고 듣고)
  • 공기를 매체로 통신
  • one protocol

 

Three-layer protocol

편지를 이용하여 통신을 한다고 가정하자.

  • Layer 3 (Plaintext)
    • Listen : 편지를 보는 행위
    • Talk : 편지를 쓰는 행위
  • Layer 2 (Ciphertext, 암호화된 문장)
    • Encrypt(암호화)
    • Decrypt(복호화)
  • Layer 1 (Mail)
    • Send mail
    • receive mail
  • Postal carrier facility(우편 배달망을 통해 전달)

이처럼 통신을 기능별로 계층을 나누어 구조화 시킨 것이다.

 

통신을 나눔으로써(layering) 얻는 이점은 무엇일까?

  • layer 중 맘에 안드는 것이 발생하면 해당 layer만 수정하면 되기 때문에 좋은 것이다.

 

Principles of Protocol Layering (protocol layering의 원칙)

First Principle

bidirectional(양 방향) communication을 위해서는 각 layer를 만들어 각각의 방향에서 하나씩 서로 반대되는 두 가지 작업을 수행할 수 있도록 해야 합니다.

 

Second Principle

두 사이트 모두에서 각 layer 상의 두 객체들은 동일해야 한다. 

ex)

  • plaintext <-> plaintext
  • Ciphertext <-> Ciphertext
  • Mail <-> Mail

 

2.1.3 Logical Connection(논리적 연결)

위 그림에서 Maria와 Ann이 communication 하는 것을 보면, 실제로는 비서를 통해서 Maria -> Ann 전달이 되는 것이지만 정서적으로는 Ann 입장에서는 Maria가 직접 전해준 것과 같이 Pysical하게 전달된 것처럼 느끼는데 이를 Logical connection이라고 한다.(착각)

  • 예를 들어, 친구와 전화를 하는 경우 나는 전화망을 통해 친구의 목소리를 듣는 것이지만 전화망과 연결되어 있다고 생각하지 않고 오히려 친구와 connection이 존재한다고 믿는 것과 일맥상통하는 의미이다.

즉, Layer to Layer, 동일한 Object끼리의 logical connection이 있다.

 

2.2 TCP/IP Protocol Suite

  • TCP/IP protocol suite에서의 Layer
    • 다섯 가지 layers architecture

original layer의 용어는 이제 사용하지 않고 최근에는 b에 있는 용어를 사용한다.

 

Communication through internet (internet을 통한 통신)

  • A, B 간의 통신 상황을 가정
    • A에서 B로 통신을 할 때 중간에 거치는 여러 개의 장치(switch, router)가 있다.
    • Source(A)와 Destination(B)는 5개의 TCP/IP protocol 계층이 존재한다.
    • switch는 2개의 계층만 사용(data link, physical)
    • router는 3개의 layer가 필요(network, data link, physical)
      • router의 기능을 하는 한 3개의 layer 사용

 

Logical Connetions between Layers

예를 들어, Source Application에서 Destination Application으로 통신된다고 할때 물론 중간 과정(Transport, network, data link,...)을 거쳐서 가지만 layer들끼리는 직접 연결되어 자기들끼리 전달되는 것처럼 느끼는 것과 같은 logical connection이 존재한다는 개념이다.

 

즉, logical connection이 유지되고 있다고 생각되는 것(착각이기도 함)

위의 세 layer들은 duty(의무)가 end-to-end 이고 아래 두 layer들은 hop-to-hop이다.(hop is host or router)

 

Identical Objects in TCP/IP Suite

  • 마주보는 layer들은 서로 동등한(identical) object으로 취급한다.
  • 뒤에서 각 Object 끼리 전달하는 것이 무엇인지에 대해서 나온다.(messages, segment or user datagram, datagram, frame, bits)

 

Physhical Layer (layer 1)

  • physical layer는 link를 거쳐 한 frame 안의 각 bit를 나르는 책임이 있다.
  • 가장 아래에 있는 level이지만 hidden layer인 transmission media가 있기 때문에 이 역시 여전히 logical communication이다.
  • Mechanical(기계적)electrical specification(전기적 사양),
    the procedures and functions(절차와 함수)
    • 직접적으로 bit를 전달하는 것이 아니라 위 그림와 같은 optical signal(광학 신호) or electrical signal(전기적 신호)을 나르는 것
  • 예를 들어, USB, 유선 이더넷 커넥터 등이 있다.
  • 단말기에서 만들어진 데이터가 전송매체를 이용하여 전달될 수 있는 것.
  • 컴퓨터나 단말기에서 정보를 유무선으로 내보낼때 전송매체에 접속하기 위한 여러가지 기계적, 전기적, 절차적, 기능적인 것들을 정의한 것
  • identical object : bits

 

Data Link Layer (layer 2)

  • data link는 하나의 hop(node)에서 다음 hop까지 frames를 error 없이 이동시킬 책임이 있다.
  • Transform the physical layer to a reliable (error-free) link
  • physical layer를 reliable link(믿을만한 link -> error-free)로 이동시킨다.
  • identical object: frame
    • frame: bit의 묶음(덩어리)

  1. 먼저 network layer로부터 온 정보에다가 header와 trailer를 붙여서 frame을 형성한다.
  2. 이를 physical layer로 보내면 physical layer는 이 프레임을 비트단위로 전송매체(transmission medium)를 통해 내보내게 되고
  3. 다른 device의 physical layer에 도착했을 때 데이터가 잘 온 경우에는 이를 다시 frame 구조로 만들어서 해당 device의 data link layer로 전달된 후에,
  4. data link layer에서 header와 trailer 정보를 해석해서 이에 따른 적절한 조치를 취한 후, 상대방 network 내에서 받은object를 해당 network로 올려주는 형태이다.

physical layer는 reliable한 곳이 아니다(data가 깨질 수 있음). 그래서 physical layer가 곧바로 전송하기 전에 data link layer에서 header와 trailer를 이용하여 error를 컨트롤 할 수 있는 적절한 기능을 집어 넣어 보내는 것이다

.

그래서 중간에 physical layer에서 문제가 발생해도 다른 곳에 도착하면 error를 찾아내서 error를 복구할 수 있게 하는 역할을 하는 것이다.

 

정리하자면 network layer가 그냥 physical layer로 전달을 하기에는 noise 같은 것들 때문에 불안하여 중간에 data link layer를 통해 reliable 하게 전달을 하도록 하는 것이다.(error-free하게 하는 역할)

 

Network Layer (Layer 3)

  • network layer는 source에서 destination 컴퓨터 사이에 connection을 생성하는 책임이 있다. 
    • 편지 봉투에 써 넣는 받는 사람 주소와 보내는 사람 주소와 비슷한 것
  • 즉, host-to-host 통신에 대한 책임이라고 할 수 있으며, 가능한 route를 통해 packet를 routing하는 것이다.
  • Host-to-host communication and routing
    • routing: destination 주소를 보고 경로망을 선택
  • Internet Protocol(IP)
    • 편지배달망의 비유: 받는사람 주소와 보내는 사람 주소를 통해 여러가지 중간의 노드를 거치고 장치를 거쳐 목적지까지 배달되는 것
  • identical object: datagram

 

Transport Layer (layer 4)

  • Transport layer는 application layer에게 서비스를 주거나 application layer로부터 서비스를 받는 책임이 있다.
    • source host 위에서 동작하는 application 프로그램으로부터 메세지를 받고 그것을 그에 상응하는 destination host 위의 application 프로그램에 전달하는 것
  • End-to-end communication
  • Transport Control Protocol (TCP), User Datagram Protocol(UDP), Stream Control Transmission Protocol (SCTP)
  • identical object: segment or user datagram

 

Application Layer (layer 5)

  • Between two processes (programs running at this layer)
    • 한 process가 어떠한 요청을 다른 process에게 보내고 그것의 response를 받는 방식이다.
  • Process-to-process communication
  • HTTP (Hypertext Transfer Protocol)
    • 웹문서를 주고 받을 때 사용하는 protocol
  • WWW (World Wide Web)
  • SMTP (Simple Mail Transfer Protocol)
    • e-mail주고 받는 protocol
  • FTP (File Transfer Protocol)
    • file download/upload 등을 하는
  • TELNET (Terminal Protocol)
    • remote login 관련
  • DNS(Domain Name System)
    • 학교 홈페이지에 access하려면 https://www.asdf.kr 과 같이 page name을 작성하게 된다. 하지만 이런 name은 인터넷에서 통신을 할 때 identifier가 되지 않고 인터넷에서 통신을 하기 위해서는 해당 name을 갖는 컴퓨터의 IP주소가 필요한 것이다.
    • 마치 우리가 홍콩반점이라는 곳에 전화를 하려고 하면 홍콩반점이라는 name만 알아서는 전화를 하는 것이 불가능하고 전화번호를 알아야 가능하듯이 인터넷도 마찬가지다.
    • 만약 브라우저에서 www.asdf.com를 치면 브라우저는 DNS에게 부탁해서 그 IP주소를 가져오고 그 IP주소를 통해 비로소 브라우저가 원하는 서버에 접속하게 되는 것이다.
  • identical object: messages

 

Encapsulation and Decapsulation

  • Encapsulation: 정보들을 포장하는 것
  • Decapsulation: 포장된 정보들을 다시 해체 하는 것

이러한 구조이기 때문에 onion architecture(양파 구조) 라고도 한다.

 

encapsulation

application layer에서 교환되는 data는 message라고 하는데 이 message에는 어떠한 header 라던가 trailer도 붙지 않지만 만약 붙어 있다면 그 전체를 message라고 부른다.

 

위 그림처럼 application layer의 message가 destination host로 전달할 때 아래의 여러 layer들을 거치는데 이때 각 layer의 header가 붙어서 즉, encapsulation되어 전달된다.

 

그러고 나서 전달 받은 이 header를 각 layer에서 해석하여 decapsulation이 진행되어 이 포장을 푸는 행동을 하는 것이고 이를 다시 위로 전달하고 또 그 layer에서는 그 layer에 맞는 header를 해석하고 또 위로 올리고 이러한 과정이 반복되어 application layer에 source layer의 original message가 도착한 것과 같이 되는 것이다.

 

Addressing

위와 같은 layer 마다 addresses를 갖게된다.(physical layer 제외; physical layer는 bit를 교환한다.)

예를 들어, Logical addresses 같은 경우 network layer이므로 IP를 말하는 것이다.

  • Logical address는 무슨구 무슨동 처럼 주소를 말하는 것이고
  • Port number는 특정 포트, 즉 특정 인물을 뜻하는 번호를 말하는 것이다.
  • 따라서 어디어디에 사는 누구누구에게 messages를 전달할 때 각 address에 해당하는 것은 '어디어디'와 '누구누구'에 대한 정보인 것이다.

 

  • Name: someorg.com, somebody@coldmail.com
  • Port number: define the application-layer programs at the source and destination, local address
  • Logical address: uniquely define the connection of a device to the Internet, IP address or network address
  • Link-layer address: define a specific host or router in a network, MAC address or physical address

 

Multiplexing and Demultiplexing

  • Multiplexing
    • 여러 개의 protocol entity들이 TCP안에 한꺼번에 여러 정보를 같이 모을 수 있다는 것
  • DeMultiplexing
    • 전달받은 것을 upper layer에게 전달하는 것

 

2.3 The OSI Model

  • ISO is the organization. OSI is the model

well defined standarization(잘 정의된 표준화)

 

  • Session
    • dialog controller
    • 대화를 컨트롤
  • Presentation
    • 정보를 표현
    • 예) 이미지(.jpg)를 전달하는데 상대는 .jpg 파일을 못받는다면 이를 다른 형식으로 표현하여 보내는 것

 

OSI vs. TCP/IP

Layer 1, 2: underlying network(LAN, WAN) technology

layer 3: Internet Protocols and some helping protocols

layer 4: Several transport protocols

layer 5(6,7): Several application protocols

 

초반에는 OSI가 나왔을 때 각광 받았으나 결국 TCP/IP를 이기지 못했다.

  • Internet protocol이 지배적
  • session 부분이 잘 정돈되지 않음

 

TCP/IP Protocol Suite

  • Host-to-network: Physical and data link layer
    • No specific protocol
  • Network layer
    • IP(Internet Protocol)
    • ARP(Address Resolution Protocol)
    • RARP(Reverse ARP)
    • ICMP(Internet Control Message Protocol)
    • IGMP(Internet Group Message Protocol)
  • Transport layer
    • TCP(Transmission Control Protocol)
    • UDP(User Datagram Protocol)
    • SCTP(Stream Control Transmission Protocol)
  • Application Layer
    • Combined session, presentation, and application layers
반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.