Структура и формат сетевых пакетов для разных протоколов, страница 2

Структура:

Тип

1

Код

1

Контрольная сумма

2

Идентификатор

2

Номер последовательности

2

Пример ICMP-Запроса:

Оригинальный вид:

0x0000   00 03 47 E9 84 D1 00 0C-76 F3 49 C1 08 00 45 00   ..Gй„С..vуIБ..E.

0x0010   00 3C 3B 55 00 00 20 01-DE 16 C0 A8 00 04 C0 A8   .<;U.. .Ю.АЁ..АЁ

0x0020   00 01 08 00 3F 5E 02 00-0E 00 41 42 43 44 45 46   ....?^....ABCDEF

0x0030   47 48 49 4A 4B 4C 4D 4E-4F 50 51 52 53 54 55 56   GHIJKLMNOPQRSTUV

0x0040   57 41 42 43 44 45 46 47-48 49                     WABCDEFGHI

Декодированный вид

Ethernet II

Destination MAC: 00:03:47:E9:84:D1

Source MAC: 00:0C:76:F3:49:C1

Ethertype: 0x0800 (2048) - IP

IP

IP version: 0x04 (4)

Header length: 0x05 (5) - 20 bytes

Type of service: 0x00 (0)

Precedence: 000 - Routine

Delay: 0 - Normal delay

Throughput: 0 - Normal throughput

Reliability: 0 - Normal reliability

Total length: 0x003C (60)

ID: 0x3B55 (15189)

Flags

Don't fragment bit: 0 - May fragment

More fragments bit: 0 - Last fragment

Fragment offset: 0x0000 (0)

Time to live: 0x20 (32)

Protocol: 0x01 (1) - ICMP

Checksum: 0xDE16 (56854) - correct

Source IP: 192.168.0.4

Destination IP: 192.168.0.1

IP Options: None

ICMP

Type: 0x08 (8) - Echo

Code: 0x00 (0)

Checksum: 0x3F5E (16222) - correct

Identifier: 0x0200 (512)

Sequence Number: 0x0E00 (3584)

Пример ICMP-Ответа:

Оригинальный вид:

0x0000   00 0C 76 F3 49 C1 00 03-47 E9 84 D1 08 00 45 00   ..vуIБ..Gй„С..E.

0x0010   00 3C 49 B0 00 00 80 01-6F BB C0 A8 00 01 C0 A8   .<I°..Ђ.o»АЁ..АЁ

0x0020   00 04 00 00 47 5E 02 00-0E 00 41 42 43 44 45 46   ....G^....ABCDEF

0x0030   47 48 49 4A 4B 4C 4D 4E-4F 50 51 52 53 54 55 56   GHIJKLMNOPQRSTUV

0x0040   57 41 42 43 44 45 46 47-48 49                     WABCDEFGHI

Декодированный вид

Ethernet II

Destination MAC: 00:0C:76:F3:49:C1

Source MAC: 00:03:47:E9:84:D1

Ethertype: 0x0800 (2048) - IP

IP

IP version: 0x04 (4)

Header length: 0x05 (5) - 20 bytes

Type of service: 0x00 (0)

Precedence: 000 - Routine

Delay: 0 - Normal delay

Throughput: 0 - Normal throughput

Reliability: 0 - Normal reliability

Total length: 0x003C (60)

ID: 0x49B0 (18864)

Flags

Don't fragment bit: 0 - May fragment

More fragments bit: 0 - Last fragment

Fragment offset: 0x0000 (0)

Time to live: 0x80 (128)

Protocol: 0x01 (1) - ICMP

Checksum: 0x6FBB (28603) - correct

Source IP: 192.168.0.1

Destination IP: 192.168.0.4

IP Options: None

ICMP

Type: 0x00 (0) - Echo reply

Code: 0x00 (0)

Checksum: 0x475E (18270) - correct

Identifier: 0x0200 (512)

Sequence Number: 0x0E00 (3584)


Протокол SMTP (Simple Mail Transfer Protocol)

Оригинальный вид:

Данные:

0x0000   00 03 47 E9 84 D1 00 0C-76 F3 49 C1 08 00 45 00   ..Gй„С..vуIБ..E.

0x0010   00 29 3D ED 40 00 80 06-A0 32 C0 A8 00 04 5A 00   .)=н@.Ђ. 2АЁ..Z.

0x0020   02 03 04 71 00 19 68 1B-11 53 00 2C 90 AA 50 18   ...q..h..S.,ђЄP.

0x0030   FD F0 14 5C 00 00 72                              эр.\..r

Декодированный вид (вместе с заголовками протоколов более низкого уровня):

Ethernet II

Destination MAC: 00:03:47:E9:84:D1

Source MAC: 00:0C:76:F3:49:C1

Ethertype: 0x0800 (2048) - IP

IP

IP version: 0x04 (4)

Header length: 0x05 (5) - 20 bytes

Type of service: 0x00 (0)

Precedence: 000 - Routine

Delay: 0 - Normal delay

Throughput: 0 - Normal throughput

Reliability: 0 - Normal reliability

Total length: 0x0029 (41)

ID: 0x3DED (15853)

Flags

Don't fragment bit: 1 - Don't fragment

More fragments bit: 0 - Last fragment

Fragment offset: 0x0000 (0)

Time to live: 0x80 (128)

Protocol: 0x06 (6) - TCP

Checksum: 0xA032 (41010) - correct

Source IP: 192.168.0.4

Destination IP: 90.0.2.3

IP Options: None

TCP

Source port: 1137

Destination port: 25