• Server / Client 각각을 BreakPoint 설정하고 Debug

  • Wireshark 로 실시간 Packet 모니터링

    • Adapter 선택
      • PC 를 한 대만 사용할 경우 ‘Adapter for loopback traffic capture’
    • 필터 사용 권장
      • tcp.port == 25000 (내가 보려고 하는 port 번호 예시)

    wireshark_echo_server-client.pcapng

    • Server 소스 코드를 실행하고 cmd 명령어를 통해 TCP port 가 LISTEN 상태인지 확인

      • netstat -ano | find “25000”

      image.png

    • Client 소스 코드를 실행하고 wireshark 을 통해 연결 성립 3-Way Handshake 확인

      image.png

      • Client 에서 Server 로 연결 확인

        image.png

        image.png

      • Server 에서 Client 와의 연결 확인

        image.png

        image.png

      • 3-way handshake

        image.png

    • Client ↔ Server 연결 후 통신을 Wireshark 로 확인

      • Client 에서 메시지 데이터 를 통신 소켓에 보냄
        • Client

          image.png

          image.png

        • Server

          image.png

          image.png

    • Client ↔ Server 연결 종료로 인한 4-way handshake 를 Wireshark 로 확인

      • Client 에서 EXIT 로 연결 종료

        • Client

          image.png

          image.png

        • Server

          image.png

          image.png

      • 4-way handshake

        image.png

    • TCP 세그먼트 이동 추적 관찰

    • 비정상 종료 상황 확인

    • TCP 상태 다이어그램과 비교