월간 인기 게시물

게시물 160건
   
Packet Header 의 구조
글쓴이 : 최고관리자 날짜 : 2009-11-30 (월) 22:23 조회 : 7345
글주소 :
                          

IP Header

0

 

16

 

version

-4

header

length -4

type of service (TOS) -8

total length (byte) 16

identification-16

flags-3

fragment offset-13

time to live(TTL)-8

protocol-8

header checksum-16

source IP address-32

destination IP address-32

options (if any)

data

 
UDP Header

0

16

source port number-16

destination port number-16

UDP length-16

UDP checksum-16

data(if any)

 
TCP Header

0

 

16

 

source port number-16

destination port number-16

sequence number-32

acknowledgment number-32

header

length-4

reserved

-6

U

R

G

A

C

K

P

S

H

R

S

T

S

Y

N

F

I

N

window size-16

TCP checksum-16

urgent pointer-16

options (if any)

data (if any)

 
 
/* eternet header */
 struct ether_header
 {
  u_char  dst_host[6];
  u_char  src_host[6];
  u_short  frame_type;
 }ether_header;
 
 
/* IPv4 header */
typedef struct ip_header
 {
  u_char ver_ihl;  // Version (4 bits) + Internet header length (4 bits)
  u_char tos;   // Type of service
  u_short tlen;   // Total length
  u_short identification; // Identification
  u_short flags_fo;  // Flags (3 bits) + Fragment offset (13 bits)
  u_char ttl;   // Time to live
  u_char proto;   // Protocol
  u_short crc;   // Header checksum
  ip_address saddr;  // Source address
  ip_address daddr;  // Destination address
  u_int op_pad;   // Option + Padding
 }ip_header;
 
 
 /* UDP header*/
 typedef struct udp_header
 {
  u_short sport;   // Source port
  u_short dport;   // Destination port
  u_short len;   // Datagram length
  u_short crc;   // Checksum
 }udp_header;
 
 
// 20 bytes TCP Header
typedef struct tcp_header
{
  u_short sport; // Source port
  u_short dport; // Destination port
  u_int seqnum; // Sequence Number
  u_int acknum; // Acknowledgement number
  u_char hlen; // Header length
  u_char flags; // packet flags
  u_short win; // Window size
  u_short crc; // Header Checksum
  u_short urgptr; // Urgent pointer...still don't know what this is...
}tcp_header;

 

[이 게시물은 최고관리자님에 의해 2009-12-01 08:49:45 시스템보안에서 이동 됨]

이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.