TCP/IP 구조 1. I.P 구조설명 2. ARP 구조설명 3. TCP 구조설명 4. UDT 구조설명 5. RIP 구조설명 6. BOOTP 구조설명 7. TFTP 구조설명
destination addr source addr type data CRC 6 6 2 46-1500 4 type 0X0800 IP datagram 2 46-1500 type 0X0806 ARP request/reply PAD 2 28 18 type 0X0835 RARP request/reply PAD 2 28 18 링크헤더를가진이더넷프레임구조 0 15 16 31 4-bit version 4-bitheader length 8-bit time to live (TTL) 16-bit identification 8-bit type of service (TOS) 8-bit protocol 3-bit flags 32-bit source IP address 16-bit total length (in bytes 13-bit fragment offset 16-bit header checksum 20 bytes 32-bit destination IP address options (if any) data IP 구조
Field Name Length(bit) Description Version(Ver) 4 IP 버전값을표시 ( 현재는 4이고 ipv6도개발되었다 ) Header length 4 4바이트단위로헤더길이를표시 ( 최소값은 5 즉 20바이트 ) Type of servioe(tos)8 서비스클래스지정 ( 보통 0으로지정 ) 애플리켈리션에독립적이다 Total length 16 IP 데이터그램의총길이 ( 바이트단위이며최대값은 65535) Identiflcation 16 송신자가전송한각 IP 데이터프로그램을위한 unique value Flags 3 -첫번째bit : More bit (0 : 마지막패킷, 1 : 연속되는패킷 ) -두번째bit : fragmentation 금지 bit(0 : fragmentation 가능 ) -세번째bit : 미사용 Fragment offset 13 원데이터그램으로부터의 offset (8바이트단위 ) Time to live (TTL) 8 hop counter 값을사용. 최대지나갈수있는라우터의개수하나의라우터를지나갈때마다하나씩감소 Protocol 8 encapsulated data의프로토콜을 identifying 하는데사용 (ex>1 : ICMP, 6 : TCP, 17 : UDP) Header checksum 16 IP 헤더의에러체킹을위함 Source IP address 32 sender 의 IP 주소 Destination IP address 32 reoeiver 의 IP 주소 Options Padding variable variable 선택사항 ( 보통선택하지않는다 ) IP 헤더의길이를 4바이트단위로맞춤 IP 구조설명
hard size port size hard type protocol type op sender Ethemet addr sender IP addr target Ethemet addr target IP addr 2 2 1 1 2 6 4 6 4 ARP 구조 Field Name Length(byte) Description hard type 2 -데이터링크프로토콜을정의 -Ethernet net : 0x0001 protocol type 2 -사용되는네트워크주소의타입 -IP : 0x0800 hard size 1 -물리적주소의길이 ( 바이트단위 ) -이더넷 : 6 바이트 prot size 1 -네트워크주소의길이 ( 바이트단위 ) -IP : 4 바이트 (lpv4일경우 ) op (op code) 2 -오퍼레이션의종류를구분 App request : 1 -App reply : 2 RARP request : 3 -RARP reply : 4 sender Ethernet address 6 sender 의이더넷주소 sender IP address 4 sender 의 IP 주소 target Ethernet address 6 target 의이더넷주소 target IP address 4 target 의 IP 주소 ARP 구조설명
0 15 16 31 16-bit source port number 16-bit destination port number 32-bit sequence number 4-bit header length reserved (6 bits) 32-bit acknowledgment number U R G 16-bit TCP checksum A C K P S H R S T S V N F I N 16-bit window size 16-bit urgent point 20 bytes options (if any) data (if any) TCP 구조 Field Name Length(bit) Description Source port number 16 sender의프로세스 (application) 를 identify Destination port number 16 receiver의프로세스 (application) 를 identify Sequence number 32 현재메시지의첫번째바이트로부터상대적인바이트옵셋 Acknowledgement number 32 -TCP에의하여성공적으로 acknowledge가된마지막바이트의상대적옵셋 ( 수신된데이터바이트수 + 1) -이필드는 ACK 비트가 set 되었을때만조사됨 Header length 4 header length 크기 (4 바이트단위 ) 로보통 5가된다 Reserved 6 reserved field URG 1 긴급데이터임을표시 ( 이때 Urgent Pointer 값이유효하다 ) ACK 1 Ack용데이터임을표시 ( 이때 Ack number 값이유효하다 ) Flags PSH 1 받은메시지를연결과관련된프로세스에게즉시보내야함 RST 1 접속을 reset 하는데사용 SYN 1 연결요청시사용되며 Sequence number가초기임을알림 FIN 1 접속을종료하는데사용 Windiw size 16 flow control 용윈도우사이즈 ( 바이트단위 ) TCP checksum 16 TCP PDU 전체와 IP 계층의헤더중후반부 12byte ( 송수신지 IP주소등 ) 에대한오류검출코드 Urgent pointer 16 먼저처리해야하는데이터의 byte position (In message) Options Vaiable 선택사항 TCP 구조설명
0 15 16 31 16-bit source port number 16-bit UDP length 16-bit destination port number 16-bit UDP checksum 8 bytes data (if any) UDP 구조 Field Name Length(bit) Description Source port number 16 Sender 의 process (application) 를 identify Destination port number 16 receiver의프로세스 (application) 를 identify UDP length 16 header 와 data 영역의크기의합 UDP checksum 16 UDP header 와 data 전체에대한 checksum UDT 구조설명
0 15 16 31 8-bit type 8-bit code 16-bit checksum (contents depends on type and code) ICMP massage Typical ICMP 구조 0 15 16 31 type (0 or 8) code (0) 16-bit UDP length checksum 16-bit destinstion port number 8 bytes optional data ICMP echo request and echo reply ICMP 에코 (echo) 요청과답변메시지구조 0 15 16 31 4-bit IGMP 4-bit IGMP (unused) 16-bitchecksum version(1) type(1-2) 32-bit group address (class D IP address) 8 bytes IGMP structure
0 15 16 31 command (1-6 ) version ( 1 ) (must be zero) address family(2) (must be zero) 32-bit IP address (must be zero) 20 bytes (must be zero) metric (1-16 ) (up to 24 more routes, with same format as previous bytes) RIP version 1 0 15 16 31 command (1-6 ) version ( 2 ) routing domain address family(2) route tag 32-bit IP address 32-bit IP address 20 bytes 32-bit next - hop IP address metric (1-16 ) (up to 24 more routes, with same format as previous bytes) RIP version 2 두개의다른 RIP 구조
0 15 16 31 0pcode(1=request, 2=reply) hardware type(1=ethernet) hardware address length(6 for Ethernet) hop count transaction ID number of seconds (unused) client IP address your IP address server IP address gateway IP address client hardware address (16 bytes) 300 bytes server hostname (64 bytes) boot filename (128 bytes) vendor-specific infomation (64 bytes) BOOTP 구조
IP datagram UDP datagram TFTP message IP header 20 bytes UDP header opcode (1 = RPQ) (2 = WRQ) filename 0 mode 0 8 bytes 2 bytes N bytes 1 N bytes 1 opcode (3 = data) block number data 2 bytes 2 bytes 0-512 bytes opcode (4 = ACK) block number 2 bytes 2 bytes opcode (5 = error) error number error message 2 bytes 2 bytes Nbytes 0 1 TFTP 구조
FTP, TELNET, ETC Application FTP, TELNET, ETC TCP, UDP Transport Layer TCP, UDP ICMP, IGMP IP, ICMP, IGMP Network Layer IP, ARP, RARP ARP, RARP Link Layer Ethernet header TCP/IP Layer structure Protocol order Protocol parsing order TCP/IP 계층프로토콜순서와파싱프로토콜순서와의비교