<br>
# My Thoughts
- Dives into the TCP/IP protocol
### [[TCPIP Illustrated_Volume 1_The Protocols_1st Edition_Abstract]]
## Why?
## How?
## What?
<br>
# Summary
- Summarize only resonates you
책 TCP/IP Illustrated, Volume 1, 2nd edition의 183페이지에서 big endian에 대한 설명
IPv4 and IPv6 Headers
Figure 5-1 shows the format of an IPv4 datagram. The normal size of the IPv4 header is 20 bytes, unless options are present (which is rare). The IPv6 header is twice as large but never has any options. It may have extension headers, which pro- vide similar capabilities, as we shall see later. In our pictures of headers and data- grams, the most significant bit is numbered 0 at the left, and the least significant bit of a 32-bit value is numbered 31 on the right.
The 4 bytes in a 32-bit value are transmitted in the following order: bits 0–7 first, then bits 8–15, then 16–23, and bits 24–31 last. This is called big endian byte ordering, which is the byte ordering required for all binary integers in the TCP/IP headers as they traverse a network. It is also called network byte order. Computer CPUs that store binary integers in other formats, such as the little endian format used by most PCs, must convert the header values into network byte order for transmission and back again for reception.
### Big endian byte ordering (빅 엔디언 바이트 순서) = Network byte order (네트워크 바이트 순서)
ChatGPT
Big endian은 데이터의 바이트 순서를 표현하는 방법 중 하나입니다. 이 방식에서는, 가장 중요한 바이트(Most Significant Byte, MSB)가 메모리의 가장 낮은 주소에 위치합니다. 반대로, 가장 덜 중요한 바이트(Least Significant Byte, LSB)는 가장 높은 주소에 위치합니다.
예를 들어, 32비트(4바이트) 정수 값 `0x12345678`을 메모리에 저장한다고 가정해 봅시다. Big endian 방식에서 이 값은 메모리 주소가 증가하는 순서대로 `12 34 56 78`과 같이 저장됩니다. 여기서 `12`는 가장 중요한 바이트(MSB)이며, 가장 낮은 주소에 위치하고, `78`은 가장 덜 중요한 바이트(LSB)이며, 가장 높은 주소에 위치합니다.
TCP/IP 프로토콜에서는 이러한 big endian 바이트 순서를 사용하며, 이를 네트워크 바이트 순서라고도 합니다. 인터넷 상에서 데이터를 전송할 때, 다양한 컴퓨터 아키텍처 사이의 호환성을 보장하기 위해 이 표준 바이트 순서를 사용합니다.
반면, little endian은 MSB가 가장 높은 주소에 위치하고 LSB가 가장 낮은 주소에 위치하는 방식입니다. 많은 개인용 컴퓨터에서 사용되는 little endian 형식을 사용하는 CPU는, 데이터를 네트워크에 전송하기 전에 big endian 형식으로 변환해야 하며, 데이터를 수신한 후에는 다시 원래의 little endian 형식으로 변환해야 합니다. 이러한 변환 과정은 네트워크 통신에서 데이터의 일관성과 호환성을 유지하는 데 필수적입니다.
---
책 TCP/IP Illustrated, Volume 1, 2nd edition의 183페이지에 아래와 같은 내용이 있어. 여기에서 big endian에 대해서 쉽게 설명해줘.
IPv4 and IPv6 Headers
Figure 5-1 shows the format of an IPv4 datagram. The normal size of the IPv4 header is 20 bytes, unless options are present (which is rare). The IPv6 header is twice as large but never has any options. It may have extension headers, which pro- vide similar capabilities, as we shall see later. In our pictures of headers and data- grams, the most significant bit is numbered 0 at the left, and the least significant bit of a 32-bit value is numbered 31 on the right.
The 4 bytes in a 32-bit value are transmitted in the following order: bits 0–7 first, then bits 8–15, then 16–23, and bits 24–31 last. This is called big endian byte ordering, which is the byte ordering required for all binary integers in the TCP/IP headers as they traverse a network. It is also called network byte order. Computer CPUs that store binary integers in other formats, such as the little endian format used by most PCs, must convert the header values into network byte order for transmission and back again for reception.
## IPv6 Extension Header
p.184
[[TCPIP Illustrated_IPv6 Extension Header]]
<br>
## IP-in-IP
p.185
[[TCPIP Illustrated_IP-in-IP]]
<br>
## 5.2.2 The Internet Checksum
p.186 ~ 188
[[TCPIP Illustrated_Internet Checksum]]
<br>
## 5.2.3 DS Field and ECN
p.188 ~ 192
[[TCPIP Illustrated_DS Field and ECN]]
<br>
## 5.2.4 IP Options
p.192 ~ 194
[[TCPIP Illustrated_IP Options]]
<br>
<br>
# References
[TCP/IP Packet Format | AnalysisMan](https://www.analysisman.com/2024/03/tcpip-packet-format.html)
<br>
# Links
[[_MOC_2_Network]]
<br>
# Tags
#internet #protocol #tcpip
<br>