hyndb
[TCP/IP] 7장 연습문제 - 주관식 본문
1. Which fields of the IP header change from router to router? (IP 헤더의 어느 필더가 라우터와 라우터 사이에서 변하는가?)
A: TTL 필드, 다중 바이트 옵션이 있는 경우 옵션 헤더도 변한다. 조각화가 발생하면 총 길이 필드가 데이터그램의 총 길이를 반영하도록 변경된다. flags, fragmentation offset 필드도 변경될 수 있다.
2. Calculate the HLEN value if the total length is 1200 bytes, 1176 of which is data from the upper layer.
A: HLEN = (1200 - 1167) / 4 = 6
3. Table 7.3 lists the MTUs for many different protocols. The MTUs range from 296 to 65,535. What would be the advantages of having a large MTU? What would be the advantages of having a small MTU? (큰 mtu와 작은 mtu의 장점은?)
A: 큰 mtu : 단편화 필요 x, 더 빠른 배송과 재조립 불필요, 데이터 그램 손실 감소 더 효율적(오버헤드 감소)
작은 mtu : 오디오 또는 비디오와 같이 시간에 민감한 데이터를 전송하는데 적합, 멀티플렉싱에 더 적합
4. Given a fragmented datagram with an offset of 120, how can you determine the f irst and last byte number?
A: first number : offset * 8 = 960
last number은 총 길이를 알아야 풀 수 있다.
5. An IP datagram must go through router 128.46.10.5. There are no other restric tions on the routers to be visited. Draw the IP options with their values.
A:
6. What is the maximum number of routers that can be recorded if the timestamp option has a flag value of 1? Why?
A: 플래그 필드의 값이 1인 경우 4개의 라우터만 기록할 수 있다. 옵션 필드의 최대 길이는 40바이트이다 (최대 헤더 길이 60바이트에서 20바이트 기본 헤더를 뺀 값). 옵션 헤더는 4바이트를 차지하며, 나머지 36바이트가 남는다. 각 엔트리는 8바이트를 차지하는데, 4바이트는 나가는 IP 주소에, 4바이트는 타임스탬프에 사용된다. 즉, 4개의 타임스탬프를 기록할 수 있으며, 총 헤더 길이는 56바이트가 된다.
7. Can the value of the header length in an IP packet be less than 5? When is it exactly 5?
A: IP헤더 길이는 20~60바이트 이기에 IP packet의 최소가 5가 되어야 한다. 5 * 4 = 20, 20이 최소이기에
8. The value of HLEN in an IP datagram is 7. How many option bytes are present?
A: HELEN * 4 = 헤더 크기 = 28, 기본 헤더가 20 bytes 이기에 28 - 20 = option bytes = 8 bytes
9. The size of the option field of an IP datagram is 20 bytes. What is the value of HLEN? What is the value in binary?
A: 옵션 크기가 20이면 20 + 기본 헤더 20 = 40 총 헤더 길이 / 4 = HLEN
HLEN = 10, 1010(2진수 표기법)
10. The value of the total length field in an IP datagram is 36 and the value of the header length field is 5. How many bytes of data is the packet carrying?
A:36 - (5 *4) = 16
데이터 길이 = 전체 길이 - 헤더 길이
11. A datagram is carrying 1024 bytes of data. If there is no option information, what is the value of the header length field? What is the value of the total length field? (데이터 그램이 1024 바이트의 데이터 전달하고 있다. 옵션이 없을 때 헤더 길이는 얼마이고 이 패킷의 전체 길이는 얼마인가?
A:1024 = 전체길이 - 20 / 전체 길이는 1044 = 00000100 00010100
데이터 길이 = 전체 길이 - 헤더 길이
12. A host is sending 100 datagrams to another host. If the identification number of the f irst datagram is 1024, what is the identification number of the last?
A:1024 = last number - 100 + 1 => last number = 1123
first number = last number - 100 + 1
13. An IP datagram arrives with fragmentation offset of 0 and an M bit (more fragment bit) of 0. Is this a first fragment, middle fragment, or last fragment?
A: m = 0 이면 last fragment, offset = 0이면 first fragment => 불완전한 fragment
14. An IP fragment has arrived with an offset value of 100. How many bytes of data were originally sent by the source before the data in this fragment?
A: offset * 8 = 데이터 송신 바이트
800bytes
15. An IP datagram has arrived with the following information in the header (in hexa decimal):
45 00 00 54 00 03 00 00 20 06 00 00 7C 4E 03 02 B4 0E 0F 02
IP버전 4 + 헤더 길이 5(*4 = 20)/ 서비스 타입 00/ 전체 패킷 길이 0054=84/ 패킷 식별 번호 00 03/ 플래그와 오프셋 00 00/ TTL 20=32개/ 프로토콜 06 = TCP/ 체크섬 00 00 (필요 없거나 계산되지 않았음)/ 출발지 IP 주소 7C 4E 03 02 = 124.78.3.2/ 목적지 주소 B4 0E 0F 02 = 180.14.15.2
a. Are there any options? A: 없다. 헤더 길이가 5이므로 20bytes로 기본 헤더 길이다.
b. Is the packet fragmented? A: 플래그와 오프셋이 00 00 이므로 x
c. What is the size of the data? A: 데이터 길이 = 전체 길이 - 헤더 크기 => 84 - 20 => 64 bytes
d. Is a checksum used? A: 0이라 사용 안 되고 있다.
e. How many more routers can the packet travel to? A: 32개의 라우터(TTL)
f. What is the identification number of the packet? A: 0003 = 3 (TCP)
g. What is the type of service? A: TOS 값이 0이라 normal 패킷
16. In a datagram, the M bit is zero, the value of HLEN is 5, the value of total length is 200, and the offset value is 200. What is the number of the first byte and number of the last byte in this datagram? Is this the last fragment, the first fragment, or a middle fragment?
A: M = 0이고 offset 이 0이 아니라 200이기에 last fragment
total length 200 - 20(HLEN 5 * 4) = 180 (데이터 길이)
first number = offset * 8 = 200 * 8 = 1600
last number = first number + 데이터 길이 - 1 => 1600 + 180 - 1 => 1779
* 전체 길이 - 헤더 길이 = 데이터 길이
'TCP IP > 연습문제' 카테고리의 다른 글
[TCP/IP] 8장 연습문제 - 주관식 (1) | 2024.10.19 |
---|---|
[TCP/IP] 6장 연습문제 - 객관식 (1) | 2024.10.06 |
[TCP/IP] 5장 연습문제 - 객관식 (0) | 2024.10.05 |
[TCP/IP] 6장 연습문제 - 주관식 (1) | 2024.09.25 |
[TCP/IP] 5장 연습문제 - 주관식 (0) | 2024.09.17 |