전체 글 72

[TCP/IP] - 3. TCP&UDP 서비스

1. TCP & UDP 포트 번호1) DHCPDynamic Host Configuration Protocol의 약자로, PC가 여러 대 있을 때 IP의 범위 할당 후 PC에서 자동 받기 설정 시, DHCP 서버가 IP 자동 할당해준다. (default gateway, DNS server도 자동 설정) 명령어 1. ipconfig /all: 현재 컴퓨터의 모든 네트워크 어댑터의 상세 정보(IP, MAC, DNS 등)를 출력하는 명령어2. ping [IP 주소]: 해당 IP 주소로 ICMP 요청을 보내 네트워크 연결 상태와 응답 속도를 확인하는 명령어ICMP: Internet Control Message Protocol의 약자로, 네트워크 진단용 메시지3. arp -a: 현재 컴퓨터가 기억하고 있는 IP..

자격증/CCNA 2025.07.16

[TCP/IP] - 2. 네트워크 주소 체계

1. 포트 번호TCP, UDP 헤더 안에 포함된 주소주소 크기: 16bit(2^16 = 0~65535)클라이언트 입장: 서비스 요청 및 실행서버 입장: 서비스 구분 및 제공User Ports (1024~49151)PC에서 사용하는 포트Dynamic/PrivatePorts (49152~65535)PC에서 사용하는 포트, 동적/ 사설 포트System Ports (0~1023)서비스 예약용 ※ 서비스가 계속 추가되다 보니, 'mysql 포트 번호: 3306'처럼 User Ports를 예약해서 사용하는 서비스들도 많다. Ex) IANA Port Number 사이트에서 프로토콜(서비스)를 검색하여 포트 번호 확인 ⭐TCPUDPhttp80domain(dns)53https(ssl)443bootps(dhcp serve..

자격증/CCNA 2025.07.15

[TCP/IP] - 1. 네트워크 구성 요소

1. Network정보 공유를 목적으로 시스템과 시스템들을 연결하여 구성한 망목적: 정보 공유구성: 시스템과 시스템들을 연결장점: 시간 단축, 비용 절감, 통합 운영 관리단점: 보안성 취약(개인/기업 정보 유출 및 탈취, 시스템/서버 공격, 악성코드 유포) 2. Protocol네트워크 환경에서 데이터를 전송할 때 전송 방법을 정의한 규약 및 도구ex) TCP, UDP, IP, Ethernet3. Encapsulation데이터를 전송하기 위해서 프로토콜 정보를 추가하는 패키지 과정반대 과정: Decapsulation실습▶ Wireshark - 12081번 telnet의 헤더 구조와 헤더 크기 확인Ethernet | IP | TCP | telnet 14 20 20 ▶ Wiresh..

자격증/CCNA 2025.07.02

Chapter 8: Tree

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Treedata 간에 hierarchy가 존재할 때 data를 표현하는 방식을 tree라고 한다. Nodes▶ Parents and Children Nodes▶ Root Node▶ Leaf Nodes Level▶ Level 0▶ Level 1▶ Level 2 Subtree▶ Left subtree▶ Right subtree Type Data▶ Char Type Data▶ Int Type Data Unique Path▶ A unique path exists from the root node to every other node.The path from E to Z: E -> C -> Z (acyclic structure)Binary Tree..

CS/자료구조 2025.06.08

Socket Programming in C: Client-server example

Client-server example using TCPserver#include #include #include #include #include #include #include #include ▶ 헤더파일 포함int main(void)▶ main 함수 시작struct sockaddr_in sa;int SocketFD = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);▶ 소켓 주소 구조체 생성 + 소켓 생성socket(): 소켓 생성PF_INET: IPv4 프로토콜 사용SCOK_STREAM: TCP 사용IPPROTP_TCP: TCP 프로토콜socket()이 실패하면 -1 반환if (SocketFD == -1) { perror("cannot create socket"); e..

Socket Programming in C: Socket API functions

SocketSocket Address = TCP or UDP의 Port number + IP의 AddressSocket은 Transport Layer(4)와 Network Layer(3) 간 정보를 주고받기 위한 구멍이다. Header filesFileDescriptionsys/socket.h소켓 생성, 바인딩, 수신, 전송 등 소켓 함수들의 기본 정의 포함 (e.g., socket, bind, listen, accept)netinet/in.hAF_INET, AF_INET6, PF_INET, PF_INET6 등 표준 IP 주소와 TCP/UDP 포트 번호 정의sys/un.h동일 컴퓨터에서 실행되는 프로그램 간의 로컬 통신(UNIX 도메인 소켓 통신)을 위한 기능 제공arpa/inet.hIP 주소 변환 함수..

Programming Exercise: Lab #6

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Exercise #1ProblemsImplement the SORTED LIST using doubly linked structure.1) insertItem(item): Insert the item to the proper position in the list.2) removeItem(item): Delete "item" in the listDeallocate (delete) the deleted item.template void DoubleSortedType::insertItem(ItemType item){ NodeType* newNode = new NodeType; NodeType* tempPtr = listData;..

CS/자료구조 2025.06.02

Chapter 7: Recursion

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.RecursionDefinitionsRecursive call: 재귀, 자기 자신을 호출하는 것Direct recursion: 직접적으로 자기 자신을 호출, e.g., a 함수가 a 함수 호출Indirect recursion: 다른 함수를 우회해 자기 자신을 호출, e.g., a 함수가 b 함수 호출 -> b가 a 함수 호출 Recursion의 필요성recursive한 프로그래밍은 모두 nonrecursive한 방법으로도 가능하다.즉, 반드시 필요한 것은 아니기에 recursion을 사용하지 않아도 모든 알고리즘 구현 가능하다. Recursive solutions can be less efficient than iterative solu..

CS/자료구조 2025.06.02

Programming Exercise: Lab #5

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Exercise #1ProblemsImplement the UNSORTED LIST using linked structure and ANSWER the time complexity questions in the code.Destructor(): Deallocate (delete) all nodes in the list.appendItem(item): Append the item to the list (with the best time complexity)removeItem(item): Delete "item" in the list and Deallocate (delete) the deleted item.getItem(pos): Retur..

CS/자료구조 2025.05.20