게임서버/TCP IP 이론(6)
-
L4에 대한 정리2
안녕하세요 대학생개발자입니다. 이번글에서는 L4에 대한 정리를 또 해보려고 합니다. 저번글에서는 거의 TCP에 대한 얘기를 주로 했었었습니다. UDP에 대한 아주 짧은 내용과함께요. 이번 글에서는 TCP에 이어서 UDP에 대한 내용을 좀 정리하며 L4를 마무리 해볼까 합니다. 뭐.. 다들 아시겠지만 L4 스위치에는 공유기가 있습니다. 공유기가 어떻게 L4 스위치 역할을 하는가... 저는 사실 공유기는 L3기기인 줄 알고 있었는데 L4기기인 것 같더라구요. 왜냐면 공유기는 IP도 변경하지만 포트까지 변경해버리기 때문에 L4기기가 맞습니다. 우리가 데이터를 내보내면 공유기는 내부에서 dynamic port forwarding table을 만들어서 거기에 자신의 공인 아이피:포트 와 사설 아이피(호스트):포트..
2021.10.31 -
L4에 대한 정리
안녕하세요 대학생 개발자입니다. 이번엔... 음... L4입니다. 어쩌다 보니 그냥 순서대로 쭉 올라가는 중이네요... 이때까지 했던걸 아주 간략하게 적어보겠습니다. L2는 직접 연결된 두 개의 기기간 통신을 정의해놓은 레이어였습니다. L3는 간접적으로 연결되어있는 두 개의 기기간 통신을 정의해놓은 레이어였습니다. 간접적이라는 건 다른 노드들을 통해서 갈 수 있는 길이 만들어져 있다는 의미구요. 그렇기 때문에 L3부터는 이 데이터를 어디로 보내야 되는지에 대한 내용이 결정되는 구간입니다. 일단... 이번 글에서 제가 정리를 해보려고 하는 건 L4 레이어 중 TCP, UDP 정도입니다. 사실 TCP IP레이어라고 하면 거의 TCP와 UDP가 유일하죠... 먼저 L3까지 통과한 데이터는 이제 상대 호스트 내..
2021.10.31 -
L3에 관한 정리
안녕하세요 대학생 개발자입니다. 오늘은 L3에 대해서 정리를 좀 해보도록 하려고 합니다. L1, L2까지는 직접 연결된 단 두 개의 호스트만을 연결할 수 있는 방법에 대해서 제시를 하고 있었는데요 이제 L3로 오게 되면서 멀리 있는 호스트 즉 경유지를 거쳐서 직접 연결되지 않은 호스트에게 데이터를 전달할 수 있는 프로토콜이 등장하게 됩니다. 바로 IP라는 프로토콜입니다. 물론 OSI의 L3는 IP 다는 100% 맞다는 것은 아니지만 TCP/IP 4 layer에서는 일반적으로 IP이기 때문에 IP라고 말씀드렸고요. 그리고 주로 게임 서버에서는 IP 외에는 건드릴 경우가 없다고 생각해서 IP에 대해서 정리를 해보려고 합니다. 123.211.151.4와 같이 IP는 Dotted decimal type으로.으로..
2021.10.29 -
L2에 대한 내용 정리
안녕하세요 대학생 개발자입니다. 어제 글을 3개 적으면서 제가 다시 읽어봤는데 주저리주저리에 뇌피셜 가득인 글이더라구요... 어느 정도는 걸러서 들으시면 될 것 같습니다. 부족한 점 있다면 댓글로 잘못된 부분 말씀해 주신다면 반영해서 수정하도록 하겠습니다. 이번 글은 저번에 다 정리해보려고 했던 L7 to L7을 쪼개서 L2부분에 대한 내용만 좀 정리를 해보려고 합니다. 먼저 L2라고 한다면 ethernet을 통해서 전달되는 계층입니다. 즉 L1을 통해서 직접 연결되어있는 기기간의 통신을 정의하는 것입니다. 우선 L2는 연결된 모든 기기에게 데이터를 뿌린다 라는 개념이 존재합니다 브로드캐스팅이라고 합니다 그리고 내가 보내려고 하는 하나의 호스트에게만 데이터를 전달하는 유니캐스트가 존재합니다. 그리고 일부..
2021.10.28 -
내 손을 떠난 메시지 처리과정에 대한 정리
안녕하세요 대학생 개발자입니다. 이번 글에서는 TCP IP에 대한 간단한 정리..라고 적어놓고 나열을 해보겠습니다. 이번 글에서 주로 다루게 되는 내용은 다음과 같습니다. L7에서 메시지를 만들어서 다른 L7에게 전달을 하려고 한다면 어떤 일이 일이 일어나는지 간단하게 정리할겁니다. 그럼 시작하겠습니다. L7에서 AAA라는 데이터를 보내려고 한다면 우리는 API를 통해 전달을 해야 할 겁니다. 리눅스의 경우에는 오픈소스이기 때문에 커널이 오픈되어있고 커널에서 직접 뭔가를 할 수 있을것 같지만, 윈도우즈의 경우에는 유저에 대해서 커널이 닫혀있는 os입니다. 그러므로 우리가 직접 하드웨어를 제어하거나 커널에 직접 접근한다는 것은 불가능합니다. 그러므로 우리는 윈도우즈에서 제공하는 API를 사용해서 간접 접근..
2021.10.27 -
네트워크의 기본(TCP IP Layer (feat OSI 7Layer))
안녕하세요 대학생 개발자입니다. 이번 글에서는 기본적인 틀이라고 볼 수 있는 OSI 7Layer와 현재 가장 많이 사용하고있는 TCP/IP에 대해서 정리를 해보려고 합니다. 위 그림중 좌측에 보시는 게 osi 7 layer입니다. 하지만 저는 osi 7 layer는 완벽히는 모르고 tcp ip에 빙자해서 대략 설명하려고 합니다! 윗 계층부터 아랫 계층까지 출발해 보겠습니다. Physical layer 진짜 케이블을 의미합니다. 케이블이나 리피터 등 같은 그런 것들입니다. 데이터를 전기신호, 빛 신호 등을 이용해서 전달해주는 애들입니다. 리피터는 생겨먹은 것은 장비처럼 생겨서 L1스위치냐라고 물을 수도 있지만 주소가 존재하지 않을 뿐더러 네트워크 통신에서 그 어떠한 헤더를 뜯어볼 수도 없기 때문에 스위치라..
2021.10.27