
ICMP는 패킷의 오류 등을 알려줌IGMP는 멀티캐스트 용도로 사용 (Internet Group Management Protocol)ARP는 IP주소로 MAC주소를 얻기위해 사용 (Address Resolution Protocol)
datagrams의 최대 크기가 65,535byte인 이유는 Header의 Total length의 크기가 16bits이기 때문이다.
datagrams의 최소 크기가 46byte인 이유는 LAN이 최소 64byte의 frame을 받아야 동작을 하기 때문이다. IP
-> frame이 되는 과정에 붙는 header 및 CRC트레일러의 크기가 18byte
-> (64 - 18 = 46)
만약, datagrams의 크기가 46byte가 되지 않는다면 가짜 데이터를 붙여 크기를 맞춘다.
VER: 버전 정보 (IPv4 = 0100)HLEN: Header 길이.Service type: 차별화 서비스 타입 (datagrams마다 처리 순, 방식이 다름) Total length: Datagrams의 전체 길이Identification: IP Packet의 고유 번호FLGs: fragmentation 허용 여부Flagmentation offset: fragment된 조각들을 재조립하기 위한 위치 표시Time to live: 한 Router를 이동할 때마다 -1. Network에서 존재할 수 있는 시간Protocol: 상위의 protocol 표기Header checksum: 에러 채킹용도의 값Source IP address: 출발지 주소Destination IP address: 목적지 주소Options + padding: 옵션
- `Precedence interpretation`: 처리 우선 순위
- `Differential service interpretation`: 통신회사나 인터넷에서 정의해서 사용(아직 정확히 정의되지 않음)
An IP packet has arrived with the first 8 bits as shown:
01000010
The receiver discards the packet. Why?
(01000010으로 시작하는 IP packet이 왜 버려졌는지?)
:
0100 0010에서 0100은 버전 정보로 IPv4를 의미한다.
0010은 헤더 길이로 0010(2) * 4 = 8로 최소 Header 길이인 20보다 작다.
-> 버려진 이유
In and IP packet, the value of HLEN is 1000 in binary. How many bytes of options are being carried by this packet?
(HLEN이 1000일 때 option의 길이는?)
:
HLEN이 1000이면 Header의 길이는 1000(2) * 4 = 32이다.
Header는 최소 20byte이므로 optiondms 32 - 20 = 12byte이다.
In an IP packet, the value of HLEN is 5(16) and the value of the total length field is 0028(16). How many bytes of data are being carried by this packet?
(이 패킷에 전송되는 데이터는?)
:
HLEN = 5(16) * 4 = 20
total length = 0028(16) = 40
total length는 HLEN + data.
Data = 40(total length) - 20(HLEN) = 20byte
An IP packet has arrived with the first few hexadecimal(16) digits as shown below: 45000028000100000102
How many hops can this pacet trabel before being dropped? The data belong to what upper layer protocol?
(Protocol과 앞으로 지날 수 있는 hops의 수)
:
4(VER)/5(HLEN)/00(Service type)/0028(total length)
0001(Identification)/0000(Flas/Fragmentation offset)
01(Time to live)/02(Protocol)/
앞으로 1개의 hops를 더 지날 수 있으며 IGMP에서 넘어옴
Fragmentation: Network 이동간 MTU에 맞게 Packet의 크기를 쪼개주는 것
`D`: 0 fragment 허용 / 1 fragment 불가
`M`: 0 마지막 단편 조각 / 1 뒤에 단편 조각이 더 있음
A packet has arried with an M bit value of 0. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented?
(M = 0이라면 fragment 여부 및 위치를 알수 있나?
:
M이 0인 경우는 Fragment의 마지막 조각이거나 아예 Fragment되지 않았을 경우이다. M의 정보만으로 두 경우를 구분 할 수 없다.
-> First or last fragment. First라면 fragment X, Last라면 fragment O
A packet has arrived with an M bit value of 1. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented?
:
M이 1이면 fragment가 이루어진 것은 확실하다. 하지만 First 인지 Middle 인지는 알 수 없다.
A packet has arrived with an M bit value of 1 and a fragmentation offset value of zero. Is this the first fragment, the last fragment, or a middle fragment?
:
offset값이 0이라는 것은 First Fragment를 의미한다.
A packet has arrived in which the offset value is 100. What is the number of the first byte? Do we know the number of The last byte?
:
100 * 8 = 800.
first byte number은 800이다.
Last byte는 알 수 없다.
A packet has arrived in which the offset value is 100, the value of HLEN is 5 and the value of the total length field is 100. What is the number of the first byte and the last byte?
:
first byte number is 100 8 = 800이다.
Data의 길이는 100 - (54) = 80byte이다.
Last byte number 는 800 + 79 = 879byte이다.
Copy
Copy only in first fragment: 첫번째 fragment 조각에만 option이 들어감Copy into all fragments: 모든 fragment 조각에 option이 들어감Class
Datagram control: 일반적인 Datagram controlReserved: 아직 사용하지 않는 bitDebugging and management: 선로 테스트Number
00000End of option:

Option의 끝임을 알림
Option이 4byte단위로 끝나면 쓰지 않아도 된다.
00001No operation:

Header가 4의 배수의 크기를 가지도록 크기를 맞춰주는 역할
아무 의미도 없다.
2byte가 부족하다면 No operation과 End of option을 하나씩 사용
00011Loose source route:

지정된 경로를 반드시 지나야 하지만 다른 경로를 추가할 수 있음
Strict source route와 같은 포맷
00100Timestamp: (ping)

O-Flow에는 주소가 부족해 timestamp를 찍지 못한 Router의 개수가 기록된다.
flags 0은 Timestamp만, 1은 IP와 Timestamp, 3은 지정된 IP에 해당하는 Router만 Timestamp 기록.
Timestamp로 목적지로 packet이 전달 되는데 걸린 시간을 알 수 있음
00111Record route: (-R)

지나온 Router를 기록하는 option
기록된 Router를 통해 경로를 확인 할 수 있다.
9개의 Router까지만 기록 가능
-> 한 줄이 4byte. 총 40byte를 넘으면 안되기 때문
지나온 Router가 9개 이상이면 9개 이후부터 기록하지 않는다.
point: Router 주소를 기록할 위치를 표시 -> 4/8/12/16 등
01001Strict source route:

경로를 미리 지정한다.
설정된 경로를 빼거나 추가하면 안된다.
내가 원하는 Router만 지나감
모든 fragment 조각에 option이 붙어야 한다.
동일하게 9개 까지만 가능
- pointer에 해당하는 주소에 Router 주소 기록
- pointer값 증가
- 반복
- 처음부터 모든 주소에 기록되어 있는 다음 목적지가 기록되어 있음.
- Router를 이동하면 Destination에 값과 pointer주소에 있는 값을 스왑한다
- 지나온 Router 기록 및 지정 경로로 이동
Which of the six options must be copied to each fragment?
:
Strict source route
Loose source route
Which of the six options are used for datagram control and which for debugging and managements?
Datagram control
Debugging and management control
Checksum: 데이터 전달과정에 파손되지 않았는지 확인하는 것
- Carry 발생시 다시 맨 뒤 비트에 더함
1) packet sniffing
-> 암호화
2) packet modification
-> 무결성 검증
3) packet spoofing
-> 사용자 인증
