
error-reporting messages: 에러 관리 목적(에러 발생 여부를 알려줌)query message: 연결 여부 확인 목적
3: 목적지 도달 불가
4: quench(억제) -> flow control
11: 시간 초과 (TTL 만료(code 0), Time out(code 1))
12: header가 잘못됨
5: 더 빠른 router가 있을 경우
8/0: ping
13/14: 전송/수신 시간 찍어 보내기
IP header가 실리는 이유: Source address를 알기 위함
8byte datagram이 실리는 이유: TCP port number가 실리며, 해당 port에 문제가 있음을 알리기 위함
코드는 destination unreachable 된 원인
code 0: network unreachable
code 1: host unreachable
code 2: protocol unreachable
code 3: port unreachable
code 4: 단편화가 필요하지만 단편화가 금지된 경우
code 5: Source routing 수행 불가 (지정된 router 접근 불가)
code 6: destination network 정보 없음
code 7: destintaion host 정보 없음
code 8: source host 고립
code 9: 통신 금지된 destination network
code 10: 통신 금지된 destination host
code 11: 지정된 type에 대한 service 불가 network
code 12: 지정된 type에 대한 service 불가 host
code 13: 관라지가 filter한 host
code 14: host 위반
code 15: host 차단
code 2, 3은 destination host로 부터, 나머지는 router로 부터 생성됨
code 0: TTL(time-to-live) 초과 (router)
code 1: fragments 조각이 다 안온 경우/ time out (destination host)
Pointer: code 0일 경우, 문제가 있는 byte number가 들어감
code 0: IP packet 자체의 문제인 경우
code 1: option을 준수하지 않은 경우
code 0: network 전용 경로 redirection
code 1: host 전용 경로 redirection
code 2: 서비스 유형에 따른 network 전용 경로 redirection
code 3: 서비스 유형에 따른 host 전용 경로 redirection
Identifier: 내가 보낸 request에 대한 reply인지 확인하기 위한 번호(식별자)
Sequence number: 보낸 request message 여러개를 구분 및 확인 용도
Optional data: 수신율을 확인하기 위한 data
request message는 host나 router에 의해 전송
reply message는 request message를 받은 host나 router가 전송
상대 host나 router가 살아있는지 확인하기 위함(network test).
data를 조금 실어 보냄
ex) ping
Original timestamp: 전송자가 packet을 전송했을 때의 시간
Receive timestamp: 수신자가 packet을 수신했을 때의 시간
Transmit timestamp: 수신자가 reply를 전송했을 때의 시간
왕복 시간 평균 값 계산을 위해 Sequence number필요
- 여러개 보냄
시간 값을 찍어 보냄
- 왕복 시간(round-trip time) 확인용
sending time(송신 시간) = receive timestamp - original timestamp
receiving time(수신 시간) = returned time - transmit timestamp
round-trip time(왕복 시간) = sending time + receiving time
Time difference(시간 오차) = receiving timestamp-(original timestamp+ round-trip time/2)

*이 출력되고 next hop의 응답을 기다림.
- ICMP message가 필요 없는 경우 return