두 대의 컴퓨터를 연결하려면??
기본 인지 사항
- 모든 파일과 프로그램은 0과 1의 나열이다.
데이터 전송
: 결국 0과 1만 전송하면 된다.
신호(signal)
: 데이터를 통신 회선을 통해 전송할 수 있는 상태로 변환시킨 것
아날로그 신호
: 연속적인 파형. 진폭이 무한대. 연속적으로 이어지는 데이터.
특징 - 주파수에 따라 연속적으로 변하는 전자기파
- 여러 매체를 통해 전송 가능하지만 잡음에 민감
데이터 신호
이산적인 파형. 진폭이 유한개
: 특정 데이터를 분명하게 정의하고 표현하는 방식
특징 - 아날로그 신호에 비해 잡음에 강함
- 동선 매체를 통해 전송하고 아날로그 신호에 비해 잡음에 강함
- 전자기파: 시간(x축, 초) 당 전압(y축, 볼트)로써, '시간 당 전압'을 나타내는 sin 함수를 뜻한다
- 주파수: 1초당 진동한 횟수(단위: Hz) ( 위 그림의 주파수는 1초당 2번 진동(주기) 2Hz인 것이다)
데이터 손실 문제 - 아날로그 신호
기본적으로 하나의 컴퓨터에서 데이터가 유선 or 무선 회선으로 나가기 위해서는 전자기파 일정 진폭이나 주파수 값을 지녀야 한다.
하지만, 만약 전자기파는 아래와 같이 주파수 값이 계속 변하는 전자기파도 존재한다. 이는 아래와 같은 데이터 손실을 일으킨다.
데이터 손실 문제 해결 - 아날로그 신호 변환
[그림1]의 오른쪽 그림처럼 수직선과 수평선이 있는 전자기파는 항상 0~무한대(Hz)의 주파수 범위를 가진다.
이 덕분에 어떠한 데이터 손실도 없이 0과 1을 주고받을 수 있게 하면 된다고 했다.
그런데, 이런 전기 신호를 통과시킬 수 있는 전선은 없다.
이를 위해서 [그림 1]의 오른쪽의 디지털 신호를 왼쪽의 아날로그 신호로 바꿔서 전송해야 한다.
ex) 내 컴퓨터에서 다른 컴퓨터로 0101 0011 이라는 데이터를 보내고 싶다면, 먼저, 아날로그 신호로 바꿔서 전선으로 보내야한다.
수신 측 컴퓨터에서는 아날로그 신호를 받아서, 해석하여 0101 0011이라는 데이터를 이해하는 것이다.
이 과정은 변환 OSI 7 Layer 중 하나인 Phsical Layer에서 담당한다.
참고 1) 컴퓨터 네트워크는 일반적으로 디지털 신호를 사용한다. 이러한 디지털 신호는 0과 1의 이진 데이터로 표현되며, 이를 MAC 주소 등의 정보와 함께 데이터 패킷 형태로 보내게 된다.
참고 2) 컴퓨터가 데이터를 송신할 때에는 이러한 디지털 데이터를 전기적 신호로 변환하여 네트워크를 통해 보낸다. 이때 사용되는 전기적 신호는 아날로그 신호라고 표현하기도 하지만, 사실상 이것은 디지털 데이터를 전송하기 위한 방법일 뿐이다. 따라서, "아날로그 신호"라는 표현은 이러한 전기적 신호의 형태를 설명하기 위한 것이지, 실제 전송되는 데이터가 아날로그 데이터라는 뜻이 아니다. 실제로 전송되는 데이터는 여전히 디지털 데이터다.
Host (Computer + Network)
: 컴퓨터가 네트워크에 연결이 되어 있으면 Host라고 부른다. 즉, 네트워크에 연결된 컴퓨터
- End point(=(끝)단말기): 네트워크 내 네트워크를 이용하는 Host
ex) Server, Client, Peer - Swtich: 네트워크 자체를 이루는 Host (목적에 따라 분류된다.
ex) Switch(단일 네트워크 간 경로 선정 특화된 스위치)
Router(다중 네트워크 간 경로 선정 특화 스위치)
firewall과 IPS (보안 특화 스위치)
여러 대의 컴퓨터가 통신하려면??
- 하나의 컴퓨터에서 여러 컴퓨터로 데이터를 전송하고 싶으면, 네트워크를 통해 데이터를 전송시키면 된다는 것은 알고 있을 것이다. 네트워크를 이용하고 싶으면 유선 케이블이든 무선이든 두 컴퓨터 간 연결을 해야한다.
- 이 때, 두 컴퓨터 간 단일적으로 연결을 하지 않고, 대신 하나의 특정 구리 케이블에 나의 컴퓨터와 상대의 케이블을 연결시켜 통신하게 만들 수 있다.
- 가운데 선을 모아서 하나의 상자에 집어넣은 것을 더미 허브라고 한다.
문제점
구리선은 전기가 통하므로, 신호(=아날로그 신호)는 구리선의 모든 곳으로 전달되어서 모든 컴퓨터로 전달된다.
1. Hub
- 하나의 LAN에서 주로 사용되는 UPT 케이블(=물리적 케이블)은 최대 전송거리가 100m다.
- 이 때, Hub를 사용하면 전송거리가 연장되는데 Hub는 단순 증폭기라고 이해해도 좋다.
허브 문제점
- 허브는 한 장비에서 전송된 데이터 프레임을 허브로 연결된 모든 장비에게 다 전송하며, 이를 플러딩(flooding)이라고 한다.
- 플러딩으로 인해, 여전히 위 그림에서 PC4가 네트워크로 보낸 (MAC 주소 등의 정보를 포함한) 데이터 패킷은 모든 컴퓨터가 받고 있으므로 보안성이 떨어진다.
- 또한, 하프 두플렉스(half duplex)로만 동작하기 때문에 이더넷 프레임의 충돌이 발생할 가능성이 높고, 네트워크의 성능도 떨어진다.
Half Duplex ?
이중통신 또는 쌍방향 통신
두 지점 사이에서 정보를 주고 받는 전자 통신 시스템, 한쪽이 송신하는 동안 다른 쪽에서 수신하는 통신 방식으로, 전송 방향을 교체한다
이러한 허브의 문제점을 해결하기 위해 우리는 Switch를 이용한다.
2. Switch
위 그림의 PC4에서 0000.0000.0003(MAC주소)를 포함한 데이터 패킷은 스위치를 거치기 때문에 해당 MAC주소인 PC3로만 전송시킬 수 있다!
→ 왜냐하면, 위 그림과 같이 MAC 주소 테이블(MAC주소, port번호)을 가지고 있기 때문에 목적지 주소(MAC 주소)를 가진 장비가 연결된 port로만 프레임을 전송하기 때문이다.
즉, 스위치 덕분에 출발지 port에서 전송된 프레임이 MAC 주소 테이블에 있는 특정 port로만 전송되기 때문에 모든 port로 프레임을 전송시키지 않을 수 있다. 허브의 플러딩 문제를 해결하였다!
하나의 스위치와 함께 연결된 Host들을 통틀어 “하나의 네트워크 or 인트라넷“라고 한다.
3. Router
: 내부 네트워크와 외부 네트워크를 연결해주는 장치
- 쉽게 말해서, KT/SKT/LGU+ 같은 곳에서 인터넷을 신청해서, 공인 IP주소 하나를 받게 됐다고 가정하자.
- 그럼 그 주소를 이용해서 여러 기기(노트북, 핸드폰) 등을 연결해서 쓰고 싶을 때, 하나의 공인 IP를 공유해주는 장치를 Router라고 한다.(엄밀히 말하면, NAT 기능을 가진 공유기)
Router는 데이터 패킷이 수신되면, Router는 IP주소를 검사하고, 패킷이 자체 네트워크 용인지 다른 네트워크 용인지 확인한다. Router가 자체 네트워크 용이라고 판단하면 이를 수신한다. 그러나 자체 네트워크를 위한 것이 아니라면 다른 네트워크로 보낸다.
즉, 위 그림처럼, Router는 네트워크 주소가 서로 다른(10.1.1.0, 10.1.2.0) 장비들을 연결할 때 주로 사용한다.
이로써, Router는 스위치와 스위치를 연결해서, 서로 다른 네트워크에 속한 컴퓨터끼리 통신이 가능하게 해주는 장비인 것을 알 수 있을 것이다.
⇒ Router는 IP 주소를 참조해서, 목적지 port로 패킷을 전송한다.
참고) 엄밀히 따지자면 Switch+Router인 L3 Switch이다. L3인 이유는, IP주소를 참조하는 스위치이기 때문에 때로는 라우터를 3 Layer 장비라고도 한다.
전세계 라우터 연결 - 인터넷
: 아래 그림과 같이 여러 네트워크를, 라우터를 이용해서 전 세계의 컴퓨터들을 연결한 것을 인터넷이라고 한다.
Switch vs Router
: 마지막으로 Switch와 Router가 어떤 주요 차이점이 있는지 간략히 알아보고 포스팅을 마치려 한다.
Switch | Router | |
목적 | 여러 Host를 동시에 연결하는 것 | 여러 네트워크를 동시에 연결하는 것 |
작동 TCP/IP Layer | Data Link Layer(프레임 단위) | Network Layer(패킷 단위) |
최대 속도 | 10Mbps~100Mbps | 무선: 1~10Mbps 유선: 100Mbps |
NAT 기능 유무 | 무 | 유 |
참고
https://www.cloudflare.com/ko-kr/learning/network-layer/what-is-a-network-switch/
https://www.geeksforgeeks.org/data-link-layer/
https://www.youtube.com/watch?v=1pfTxp25MA8
https://www.geeksforgeeks.org/difference-between-router-and-switch/
https://www.youtube.com/watch?v=1z0ULvg_pW8&t=127s
https://www.youtube.com/watch?v=K9L9YZhEjC0
'OS' 카테고리의 다른 글
EXT4와 NTFS (0) | 2023.08.21 |
---|---|
OSI 7 Layer (0) | 2023.07.22 |
TCP/UDP (0) | 2023.07.19 |
TCP/IP (0) | 2023.07.16 |
Process Thread (0) | 2023.07.12 |