728x90
반응형

# 최대 홉 수 조정

traceroute -m 255 google.com

$ traceroute -m 255 google.com         
traceroute to google.com (172.217.161.206), 255 hops max, 40 byte packets
 1  10.40.6.2 (10.40.6.2)  9.359 ms  4.503 ms  4.032 ms
 2  10.40.240.0 (10.40.240.0)  4.312 ms  7.856 ms  4.707 ms
 3  10.40.0.11 (10.40.0.11)  7.454 ms  4.417 ms  5.650 ms
 4  10.128.2.139 (10.128.2.139)  6.526 ms  4.745 ms  6.370 ms
 5  15.248.4.57 (15.248.4.57)  8.095 ms  7.118 ms  5.761 ms
 6  * * *
 7  * * *
 8  * * *
 9  99.82.179.80 (99.82.179.80)  33.133 ms  33.374 ms  33.518 ms
10  99.82.179.81 (99.82.179.81)  34.269 ms  33.815 ms
    99.82.179.83 (99.82.179.83)  30.787 ms
11  192.178.108.209 (192.178.108.209)  35.272 ms  34.049 ms
    216.239.59.149 (216.239.59.149)  27.305 ms
12  108.170.235.5 (108.170.235.5)  34.331 ms
    108.170.235.7 (108.170.235.7)  38.985 ms
    108.170.235.5 (108.170.235.5)  34.198 ms
13  kix07s03-in-f14.1e100.net (172.217.161.206)  33.920 ms  33.770 ms  33.259 ms

 

# 패킷 크기 조정

traceroute google.com 70

$ traceroute google.com 70
traceroute to google.com (172.217.161.206), 64 hops max, 70 byte packets
 1  10.40.6.2 (10.40.6.2)  11.566 ms  5.021 ms  5.796 ms
...

 

# 패킷 테스트 횟수 조정

traceroute -q1 google.com

$ traceroute -q1 google.com
traceroute to google.com (172.217.161.206), 64 hops max, 40 byte packets
 1  10.40.6.2 (10.40.6.2)  5.512 ms
...

# DNS 역방향 조회 건너뛰기

traceroute -n google.com

$  traceroute -n google.com
traceroute to google.com (172.217.161.206), 64 hops max, 40 byte packets
 1  10.40.6.2  7.717 ms  2.673 ms  3.887 ms
 2  10.40.240.0  5.463 ms  2.376 ms  3.898 ms
 3  10.40.0.11  4.332 ms  6.298 ms  4.902 ms
 4  10.128.2.139  4.251 ms  5.431 ms  3.800 ms
 5  15.248.4.57  7.327 ms  6.855 ms  5.558 ms
 6  * * *
 7  * * *
 8  * * *
 9  99.82.179.82  28.092 ms  28.069 ms
    99.82.179.80  33.980 ms
10  99.82.179.81  33.186 ms
    99.82.179.83  29.556 ms
    99.82.179.81  32.288 ms
11  192.178.108.209  36.233 ms
    216.239.59.149  27.248 ms
    192.178.110.61  27.490 ms
12  108.170.235.7  35.891 ms
    108.170.235.5  35.220 ms
    108.170.235.7  34.109 ms
13  172.217.161.206  33.306 ms  34.519 ms  32.720 ms

 

format:

hop_number host_name (IP_address) packet_round_trip_times

hop_number: 경유 순서

host_name: 호스트 이름 (역방향 조회 결과)

IP_address: IP 주소

packet_round_trip_times: 왕복 시간 (기본 3회 측정)

 

asterisks (*): 경로상 문제가 없음을 의미

 

Tutorial: Troubleshooting with Traceroute

https://www.youtube.com/watch?v=WL0ZTcfSvB4

 

How To Use Traceroute and MTR to Diagnose Network Issues

https://www.digitalocean.com/community/tutorials/how-to-use-traceroute-and-mtr-to-diagnose-network-issues

 

$ mtr google.com

$ mtr --report google.com

 

728x90
728x90

'Networking > Network' 카테고리의 다른 글

[Route53] name servers  (0) 2025.02.07
[essential#03] Wireshark  (0) 2025.02.07
[essentials#01] Server-Client communication using Netcat  (0) 2025.02.06
[AWS] setting up Nginx SSL  (0) 2024.07.30
VPN - Site-to-Site, Client VPN  (0) 2024.02.13
728x90
반응형

Layer 4: https://www.youtube.com/playlist?list=PLelEzczSdJkCukp60g0DOGr7aruKyS6Rs
Layer 5:
why TLS and SSL - 
https://www.youtube.com/watch?v=SJJmoDZ3il8
How the negotiation works - https://www.youtube.com/watch?v=n_d1rCXNrx0
RE:Invent talk about TLS - https://www.youtube.com/watch?v=8AODa_AazY4

1. Connection

1. run in the server mode

nc -l 2389

서버가 2389 포트에서 연결 대기 시작

-l: 리스닝 모드로 실행

 

2. used in client mode

nc localhost 2389

클라이언트가 서버의 2389 포트로 연결 시도, localhost (or 서버IP)

 

서버IP 확인

# private ip
ifconfig
ip addr

# public ip
curl ifconfig.me
wget -q0- ifconfig.me
(whatismyip.com)

# ipv6
curl -6 ifconfig.me

 

3. 통신 테스트

# at client side
HI, server
# displayed at server side
HI, server

클라이언트가 메시지 전송, 서버 측에서 동일한 메시지 수신 확인

 

특징: 양방향 통신, 텍스트 기반, 간단한 소켓 통신 테스트에 유용, 실시간 메시지 전송/수신

2. File Transfer

1. initial setup

# client side - Create source file
$ echo "hello test" > testfile
$ cat testfile
hello test

# server side - Empty destination file
$ touch test

클라이언트 측 testfile이라는 파일이 있고, 내용은 hello test

서버 측 빈 test 파일이 존재

수신된 데이터를 test 파일로 리다이렉션, 서버 측의 test 파일에서는 클라이언트가 보낸 "hello test" 내용이 저장됨

3. Timeout

-w 플래그를 통해 연결 타임아웃을 설정할 수 있음

# server side
nc -l 2389

# client side
nc -w 10 localhost 2389

4. IPv6 connect

-4 또는 -6 플래그는 netcat 유틸리티가 어떤 유형의 주소를 사용해야 하는지 지정한다.

(-4 없이 IPv4 주소를 적을 경우 연결 가능)

# server side
nc -4 -l 2389

# client side
nc -4 localhost 2389

5. Disable reading from STDIN

1) -d 플래그: stdin(표준 입력)에서 읽기를 비활성화

클라이언트에서 서버로 데이터 전송을 막음

(연결 수립 이후 텍스트 입력해야 함, 마지막 hi는 -d와 관계없이 무시됨)

2) -k 플래그: (keep listening) 서버 측 옵션, 클라이언트가 연결을 종료해도 서버는 계속 실행되어 새로운 클라이언트 연결 대기 상태 유지

→ 다중 클라이언트 연결 가능, 서버 수동 종료 전까지 계속 실행

3) -q 플래그: EOF(파일이나 데이터 스트림의 끝, 데이터 전송이 완료되었음을 알리는 시그널) 수신 후 5초간 대기

→ -w 플래그로 대체됨

# server side
nc -l 2389 > received_file.txt

# client side
 date; cat file.txt | nc -w 5 localhost 2389; date

4) -u 플래그: UDP 옵션 (서버와 클라이언트 모두 설정)

$ netstat -an | grep 2389
udp4 0 0 127.0.0.1.61430 127.0.0.1.2389
udp4 0 0 127.0.0.1.2389 127.0.0.1.61430

 

 

728x90
728x90

'Networking > Network' 카테고리의 다른 글

[essential#03] Wireshark  (0) 2025.02.07
[essentials#02] Telnet  (0) 2025.02.06
[AWS] setting up Nginx SSL  (0) 2024.07.30
VPN - Site-to-Site, Client VPN  (0) 2024.02.13
보안 그룹과 네트워크 ACL(Stateful vs Stateless)  (0) 2024.02.12

+ Recent posts